#define IS_64BIT 1
#define IS_NOT_64BIT 0
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__arm64e__)
static pid_t child_pid; /* Child PID */
-static void run_legacy_backend(int argc, char *argv[], int fd) _CUPS_NORETURN; /* Starts child backend process running as a ppc executable */
-#endif /* __i386__ || __x86_64__ */
-static void sigterm_handler(int sig); /* SIGTERM handler */
+static void run_legacy_backend(int argc, char *argv[], int fd) _CUPS_NORETURN; /* Starts child backend process running as a x86_64 executable */
+static void sigterm_handler(int sig); /* SIGTERM handler */
+#endif /* __arm64e__ */
static void sigquit_handler(int sig, siginfo_t *si, void *unused) _CUPS_NORETURN;
#ifdef PARSE_PS_ERRORS
status = registry_open(&driverBundlePath);
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__arm64e__)
/*
* If we were unable to load the class drivers for this printer it's
- * probably because they're ppc or i386. In this case try to run this
- * backend as i386 or ppc executables so we can use them...
+ * probably because they're x86_64 (or older). In this case try to run this
+ * backend as x86_64 so we can use them...
*/
if (status == -2)
{
run_legacy_backend(argc, argv, print_fd);
/* Never returns here */
}
-#endif /* __i386__ || __x86_64__ */
+#endif /* __arm64e__ */
if (status == -2)
{
}
#pragma mark -
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__arm64e__)
/*!
* @function run_legacy_backend
*
- * @abstract Starts child backend process running as a ppc or i386 executable.
+ * @abstract Starts child backend process running as a x86_64 executable.
*
* @result Never returns; always calls exit().
*
/*
- * If we're running as x86_64 or i386 and couldn't load the class driver
- * (because it's ppc or i386), then try to re-exec ourselves in ppc or i386
- * mode to try again. If we don't have a ppc or i386 architecture we may be
+ * If we're running as ARM and couldn't load the class driver
+ * (because it's x86_64, i386 or ppc), then try to re-exec ourselves in x86_64
+ * mode to try again. If we don't have that architecture we may be
* running with the same architecture again so guard against this by setting
* and testing an environment variable...
*/
-# ifdef __x86_64__
- usb_legacy_status = getenv("USB_I386_STATUS");
-# else
- usb_legacy_status = getenv("USB_PPC_STATUS");
-# endif /* __x86_64__ */
+ usb_legacy_status = getenv("USB_LEGACY_STATUS");
if (!usb_legacy_status)
{
* Set the environment variable...
*/
-# ifdef __x86_64__
- setenv("USB_I386_STATUS", "1", false);
-# else
- setenv("USB_PPC_STATUS", "1", false);
-# endif /* __x86_64__ */
+ setenv("USB_LEGACY_STATUS", "1", false);
/*
* Tell the kernel to use the specified CPU architecture...
*/
-# ifdef __x86_64__
- cpu_type_t cpu = CPU_TYPE_I386;
-# else
- cpu_type_t cpu = CPU_TYPE_POWERPC;
-# endif /* __x86_64__ */
+ cpu_type_t cpu = CPU_TYPE_X86_64;
size_t ocount = 1;
posix_spawnattr_t attrs;
posix_spawnattr_setsigdefault(&attrs, &oldmask);
if (posix_spawnattr_setbinpref_np(&attrs, 1, &cpu, &ocount) || ocount != 1)
{
-# ifdef __x86_64__
- perror("DEBUG: Unable to set binary preference to i386");
-# else
- perror("DEBUG: Unable to set binary preference to ppc");
-# endif /* __x86_64__ */
+ perror("DEBUG: Unable to set binary preference to X86_64");
_cupsLangPrintFilter(stderr, "ERROR",
_("Unable to use legacy USB class driver."));
exit(CUPS_BACKEND_STOP);
exit(exitstatus);
}
-#endif /* __i386__ || __x86_64__ */
-
/*
* 'sigterm_handler()' - SIGTERM handler.
static void
sigterm_handler(int sig) /* I - Signal */
{
-#if defined(__i386__) || defined(__x86_64__)
/*
* If we started a child process pass the signal on to it...
*/
_exit(CUPS_BACKEND_STOP);
}
}
-#endif /* __i386__ || __x86_64__ */
}
+#endif /* __arm64e__ */
/*