Skip to contentSkip to conversation

Installing Qemu on a host MacOSX station

Qemu-devel Jean-Michel POURE 2 participants 2 messages Jun 29, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

Dear friends,

Are there pre-compiled binaries available for Qemu under MacOsX? Did someone here compile Qemu recently for MacOsX?

Kindest regards,
Jean-Michel Pouré

#1 lore raw
Quoted 4 lines · Jean-Michel POURE

Are there pre-compiled binaries available for Qemu under MacOsX? Did someone here compile Qemu recently for MacOsX?

I don't think someone made binaries for Mac OS X. I have patches for Qemu to build under Mac OS X. It mostly works, but bugs remain, and you won't be able to boot the linux image provided by Fabrice properly. It crashes before giving a prompt.

Here is a diff of my current work.

? .DS_Store
? .gdb_history
? config-host.h
? config-host.mak
? copying
? copying.lib
? dyngen
? freedos.img
? i386-softmmu
? i386-user
? linux-test
? op.s
? op.syms
? out.c
? ppc-softmmu
? qemu-doc.html
? qemu-mkcow
? qemu-tech.html
? qemu.1
? readme
? small.ffs
? todo
? version
? vmdk2raw
? slirp/copyright
Index: Makefile.target
===================================================================
RCS file: /cvsroot/qemu/qemu/Makefile.target,v
retrieving revision 1.34

Makefile.target +7 -0
diff -u -r1.34 Makefile.target
@@ -100,6 +100,7 @@
 endif
 
 ifeq ($(ARCH),ppc)
+CFLAGS+= -D__powerpc__
 OP_CFLAGS=$(CFLAGS)
 LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld
 endif
@@ -152,6 +153,10 @@
 OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
 endif
 
+ifeq ($(CONFIG_DARWIN),yes)
+OP_CFLAGS+= -mdynamic-no-pic
+endif
+
 #########################################################
 
 DEFINES+=-D_GNU_SOURCE
@@ -268,8 +273,10 @@
 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld 
 endif
 ifndef CONFIG_WIN32
+ifndef CONFIG_DARWIN
 VL_LIBS=-lutil
 endif
+endif
 
 $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
 	$(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VL_LIBS)

Index: configure
===================================================================
RCS file: /cvsroot/qemu/qemu/configure,v
retrieving revision 1.40

configure +15 -2
diff -u -r1.40 configure
@@ -88,12 +88,19 @@
 OpenBSD)
 bsd="yes"
 ;;
+Darwin)
+bsd="yes"
+darwin="yes"
+;;
 *) ;;
 esac
 
-if [ "$bsd" = "yes" ] ; then
+if [ "$bsd" = "yes" ] && ! [ "$darwin" = "yes" ] ; then
   make="gmake"
-  target_list="i386-softmmu"
+fi
+
+if [ "$bsd" = "yes" ] ; then
+  target_list="i386-softmmu ppc-softmmu"
 fi
 
 # find source path
@@ -391,6 +398,10 @@
 elif test -f "/usr/include/byteswap.h" ; then
   echo "#define HAVE_BYTESWAP_H 1" >> $config_h
 fi
+if test "$darwin" = "yes" ; then
+  echo "CONFIG_DARWIN=yes" >> $config_mak
+  echo "#define CONFIG_DARWIN 1" >> $config_h
+fi
 if test "$gdbstub" = "yes" ; then
   echo "CONFIG_GDBSTUB=yes" >> $config_mak
   echo "#define CONFIG_GDBSTUB 1" >> $config_h
@@ -420,9 +431,11 @@
 if [ "$bsd" = "yes" ] ; then
   echo "#define O_LARGEFILE 0" >> $config_h
   echo "#define lseek64 lseek" >> $config_h
+  echo "#define mkstemp64 mkstemp" >> $config_h
   echo "#define ftruncate64 ftruncate" >> $config_h
   echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
   echo "#define _BSD 1" >> $config_h
+  echo "#define off64_t off_t" >> $config_h
 fi
 
 for target in $target_list; do 

Index: cpu-all.h
===================================================================
RCS file: /cvsroot/qemu/qemu/cpu-all.h,v
retrieving revision 1.33

cpu-all.h +5 -5
diff -u -r1.33 cpu-all.h
@@ -538,12 +538,12 @@
 #define TARGET_PAGE_MASK ~(TARGET_PAGE_SIZE - 1)
 #define TARGET_PAGE_ALIGN(addr) (((addr) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK)
 
-extern unsigned long real_host_page_size;
-extern unsigned long host_page_bits;
-extern unsigned long host_page_size;
-extern unsigned long host_page_mask;
+extern unsigned long qemu_real_host_page_size;
+extern unsigned long qemu_host_page_bits;
+extern unsigned long qemu_host_page_size;
+extern unsigned long qemu_host_page_mask;
 
-#define HOST_PAGE_ALIGN(addr) (((addr) + host_page_size - 1) & host_page_mask)
+#define HOST_PAGE_ALIGN(addr) (((addr) + qemu_host_page_size - 1) & qemu_host_page_mask)
 
 /* same as PROT_xxx */
 #define PAGE_READ      0x0001

Index: dyngen-exec.h
===================================================================
RCS file: /cvsroot/qemu/qemu/dyngen-exec.h,v
retrieving revision 1.12

dyngen-exec.h +12 -1
diff -u -r1.12 dyngen-exec.h
@@ -32,6 +32,7 @@
 typedef unsigned long long uint64_t;
 #endif
 
+#ifndef __APPLE__
 typedef signed char int8_t;
 typedef signed short int16_t;
 typedef signed int int32_t;
@@ -40,6 +41,7 @@
 #else
 typedef signed long long int64_t;
 #endif
+#endif
 
 #define INT8_MIN		(-128)
 #define INT16_MIN		(-32767-1)
@@ -59,7 +61,7 @@
 extern int printf(const char *, ...);
 #undef NULL
 #define NULL 0
-#ifdef _BSD
+#if defined(_BSD) && !defined(__APPLE__)
 #include <ieeefp.h>
 #else
 #include <fenv.h>
@@ -187,6 +189,15 @@
 #define PARAM1 ({ int _r; asm("" : "=r"(_r) : "0" (&__op_param1)); _r; })
 #define PARAM2 ({ int _r; asm("" : "=r"(_r) : "0" (&__op_param2)); _r; })
 #define PARAM3 ({ int _r; asm("" : "=r"(_r) : "0" (&__op_param3)); _r; })
+
+#elif defined(__APPLE__)
+static int __op_param1 ;
+static int __op_param2 ;
+static int __op_param3 ;
+#define PARAM1 ((long)(&__op_param1))
+#define PARAM2 ((long)(&__op_param2))
+#define PARAM3 ((long)(&__op_param3))
+
 #else
 extern int __op_param1, __op_param2, __op_param3;
 #define PARAM1 ((long)(&__op_param1))

Index: dyngen.c
===================================================================
RCS file: /cvsroot/qemu/qemu/dyngen.c,v
retrieving revision 1.34

dyngen.c +598 -44

778 lines not on this page · raw message

Index: exec-all.h
===================================================================
RCS file: /cvsroot/qemu/qemu/exec-all.h,v
retrieving revision 1.19

exec-all.h +24 -16
diff -u -r1.19 exec-all.h
@@ -303,16 +303,30 @@
 #define offsetof(type, field) ((size_t) &((type *)0)->field)
 #endif
 
+#ifdef _WIN32
+#define ASM_DATA_SECTION ".section \".data\"\n"
+#define ASM_PREVIOUS_SECTION ".section .text\n"
+#elif __APPLE__
+#define ASM_DATA_SECTION ".data\n"
+#define ASM_PREVIOUS_SECTION ".text\n"
+#define ASM_NAME(x) "_" #x
+#else
+#define ASM_DATA_SECTION ".section \".data\"\n"
+#define ASM_PREVIOUS_SECTION ".previous\n"
+#define ASM_NAME(x) stringify(x)
+#endif
+
+
 #if defined(__powerpc__)
 
 /* we patch the jump instruction directly */
 #define JUMP_TB(opname, tbparam, n, eip)\
 do {\
-    asm volatile (".section \".data\"\n"\
-		  "__op_label" #n "." stringify(opname) ":\n"\
+    asm volatile (ASM_DATA_SECTION\
+		  ASM_NAME(__op_label) #n "." ASM_NAME(opname) ":\n"\
 		  ".long 1f\n"\
-		  ".previous\n"\
-                  "b __op_jmp" #n "\n"\
+		  ASM_PREVIOUS_SECTION\
+                  "b " ASM_NAME(__op_jmp) #n "\n"\
 		  "1:\n");\
     T0 = (long)(tbparam) + (n);\
     EIP = eip;\
@@ -321,17 +335,11 @@
 
 #define JUMP_TB2(opname, tbparam, n)\
 do {\
-    asm volatile ("b __op_jmp" #n "\n");\
+    asm volatile ("b " ASM_NAME(__op_jmp) #n "\n");\
 } while (0)
 
 #elif defined(__i386__) && defined(USE_DIRECT_JUMP)
 
-#ifdef _WIN32
-#define ASM_PREVIOUS_SECTION ".section .text\n"
-#else
-#define ASM_PREVIOUS_SECTION ".previous\n"
-#endif
-
 /* we patch the jump instruction directly */
 #define JUMP_TB(opname, tbparam, n, eip)\
 do {\
@@ -384,11 +392,11 @@
 {
     int ret;
     __asm__ __volatile__ (
-                          "0:    lwarx %0,0,%1 ;"
-                          "      xor. %0,%3,%0;"
-                          "      bne 1f;"
-                          "      stwcx. %2,0,%1;"
-                          "      bne- 0b;"
+                          "0:    lwarx %0,0,%1\n"
+                          "      xor. %0,%3,%0\n"
+                          "      bne 1f\n"
+                          "      stwcx. %2,0,%1\n"
+                          "      bne- 0b\n"
                           "1:    "
                           : "=&r" (ret)
                           : "r" (p), "r" (1), "r" (0)

Index: exec.c
===================================================================
RCS file: /cvsroot/qemu/qemu/exec.c,v
retrieving revision 1.43

exec.c +21 -21

83 lines not on this page · raw message

Index: oss.c
===================================================================
RCS file: /cvsroot/qemu/qemu/oss.c,v
retrieving revision 1.4

oss.c +1 -1
diff -u -r1.4 oss.c
@@ -23,7 +23,7 @@
  */
 #include "vl.h"
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__APPLE__)
 #include <ctype.h>
 #include <fcntl.h>
 #include <errno.h>

Index: vl.c
===================================================================
RCS file: /cvsroot/qemu/qemu/vl.c,v
retrieving revision 1.86

vl.c +10 -4
diff -u -r1.86 vl.c
@@ -40,7 +40,9 @@
 #include <sys/socket.h>
 #ifdef _BSD
 #include <sys/stat.h>
+# ifndef __APPLE__
 #include <libutil.h>
+# endif
 #else
 #include <linux/if.h>
 #include <linux/if_tun.h>
@@ -50,6 +52,8 @@
 #endif
 #endif
 
+#include <SDL/SDL.h>
+
 #if defined(CONFIG_SLIRP)
 #include "libslirp.h"
 #endif
@@ -80,7 +84,7 @@
 
 #include "exec-all.h"
 
-//#define DO_TB_FLUSH
+#define DO_TB_FLUSH
 
 #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
 
@@ -825,7 +829,7 @@
     }
 }
 
-#ifndef _WIN32
+#if !defined(_WIN32)
 
 #if defined(__linux__)
 
@@ -908,7 +912,7 @@
         /* we probe the tick duration of the kernel to inform the user if
            the emulated kernel requested a too high timer frequency */
         getitimer(ITIMER_REAL, &itv);
-
+#if defined(__linux__)
         if (itv.it_interval.tv_usec > 1000) {
             /* try to use /dev/rtc to have a faster timer */
             if (start_rtc_timer() < 0)
@@ -924,7 +928,9 @@
             sigaction(SIGIO, &act, NULL);
             fcntl(rtc_fd, F_SETFL, O_ASYNC);
             fcntl(rtc_fd, F_SETOWN, getpid());
-        } else {
+        } else
+#endif
+		{
         use_itimer:
             pit_min_timer_count = ((uint64_t)itv.it_interval.tv_usec * 
                                    PIT_FREQ) / 1000000;

Index: hw/cirrus_vga.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/cirrus_vga.c,v
retrieving revision 1.11

cirrus_vga.c +2 -2
diff -u -r1.11 cirrus_vga.c
@@ -36,8 +36,8 @@
  *    - optimize bitblt functions
  */
 
-//#define DEBUG_CIRRUS
-//#define DEBUG_BITBLT
+#define DEBUG_CIRRUS
+#define DEBUG_BITBLT
 
 /***************************************
  *

Index: hw/fdc.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/fdc.c,v
retrieving revision 1.11

fdc.c +1 -1
diff -u -r1.11 fdc.c
@@ -25,7 +25,7 @@
 
 /********************************************************/
 /* debug Floppy devices */
-//#define DEBUG_FLOPPY
+#define DEBUG_FLOPPY
 
 #ifdef DEBUG_FLOPPY
 #define FLOPPY_DPRINTF(fmt, args...) \

Index: hw/pc.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/pc.c,v
retrieving revision 1.24

pc.c +1 -1
diff -u -r1.24 pc.c
@@ -24,7 +24,7 @@
 #include "vl.h"
 
 /* output Bochs bios info messages */
-//#define DEBUG_BIOS
+#define DEBUG_BIOS
 
 #define BIOS_FILENAME "bios.bin"
 #define VGABIOS_FILENAME "vgabios.bin"

Index: linux-user/elfload.c
===================================================================
RCS file: /cvsroot/qemu/qemu/linux-user/elfload.c,v retrieving revision 1.22

elfload.c +21 -11
diff -u -r1.22 elfload.c
@@ -13,6 +13,16 @@
 #include "qemu.h"
 #include "disas.h"
 
+/* this flag is uneffective under linux too, should be deleted */
+#ifndef MAP_DENYWRITE
+#define MAP_DENYWRITE 0
+#endif
+
+/* should probably go in elf.h */
+#ifndef ELIBBAD
+#define ELIBBAD 80
+#endif
+
 #ifdef TARGET_I386
 
 #define ELF_START_MMAP 0x80000000
@@ -332,7 +342,7 @@
     /* User-space version of kernel get_free_page.  Returns a page-aligned
      * page-sized chunk of memory.
      */
-    retval = (void *)target_mmap(0, host_page_size, PROT_READ|PROT_WRITE, 
+    retval = (void *)target_mmap(0, qemu_host_page_size, PROT_READ|PROT_WRITE, 
                                  MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
 
     if((long)retval == -1) {
@@ -346,7 +356,7 @@
 
 static void free_page(void * pageaddr)
 {
-    target_munmap((unsigned long)pageaddr, host_page_size);
+    target_munmap((unsigned long)pageaddr, qemu_host_page_size);
 }
 
 /*
@@ -502,7 +512,7 @@
     if (size < MAX_ARG_PAGES*TARGET_PAGE_SIZE)
         size = MAX_ARG_PAGES*TARGET_PAGE_SIZE;
     error = target_mmap(0, 
-                        size + host_page_size,
+                        size + qemu_host_page_size,
                         PROT_READ | PROT_WRITE,
                         MAP_PRIVATE | MAP_ANONYMOUS,
                         -1, 0);
@@ -511,7 +521,7 @@
         exit(-1);
     }
     /* we reserve one extra page at the top of the stack as guard */
-    target_mprotect(error + size, host_page_size, PROT_NONE);
+    target_mprotect(error + size, qemu_host_page_size, PROT_NONE);
 
     stack_base = error + size - MAX_ARG_PAGES*TARGET_PAGE_SIZE;
     p += stack_base;
@@ -562,10 +572,10 @@
            of the file may not be mapped. A better fix would be to
            patch target_mmap(), but it is more complicated as the file
            size must be known */
-        if (real_host_page_size < host_page_size) {
+        if (qemu_real_host_page_size < qemu_host_page_size) {
             unsigned long end_addr, end_addr1;
-            end_addr1 = (elf_bss + real_host_page_size - 1) & 
-                ~(real_host_page_size - 1);
+            end_addr1 = (elf_bss + qemu_real_host_page_size - 1) & 
+                ~(qemu_real_host_page_size - 1);
             end_addr = HOST_PAGE_ALIGN(elf_bss);
             if (end_addr1 < end_addr) {
                 mmap((void *)end_addr1, end_addr - end_addr1,
@@ -574,9 +584,9 @@
             }
         }
 
-        nbyte = elf_bss & (host_page_size-1);
+        nbyte = elf_bss & (qemu_host_page_size-1);
         if (nbyte) {
-	    nbyte = host_page_size - nbyte;
+	    nbyte = qemu_host_page_size - nbyte;
 	    fpnt = (char *) elf_bss;
 	    do {
 		*fpnt++ = 0;
@@ -811,7 +821,7 @@
 	 * bss page.
 	 */
 	padzero(elf_bss);
-	elf_bss = TARGET_ELF_PAGESTART(elf_bss + host_page_size - 1); /* What we have mapped so far */
+	elf_bss = TARGET_ELF_PAGESTART(elf_bss + qemu_host_page_size - 1); /* What we have mapped so far */
 
 	/* Map the last of the bss segment */
 	if (last_bss > elf_bss) {
@@ -1252,7 +1262,7 @@
 	       and some applications "depend" upon this behavior.
 	       Since we do not have the power to recompile these, we
 	       emulate the SVr4 behavior.  Sigh.  */
-	    mapped_addr = target_mmap(0, host_page_size, PROT_READ | PROT_EXEC,
+	    mapped_addr = target_mmap(0, qemu_host_page_size, PROT_READ | PROT_EXEC,
                                       MAP_FIXED | MAP_PRIVATE, -1, 0);
     }
 

Index: linux-user/main.c
===================================================================
RCS file: /cvsroot/qemu/qemu/linux-user/main.c,v
retrieving revision 1.51

main.c +9 -4
diff -u -r1.51 main.c
@@ -28,6 +28,11 @@
 
 #define DEBUG_LOGFILE "/tmp/qemu.log"
 
+#ifdef __APPLE__
+#include <crt_externs.h>
+# define environ  (*_NSGetEnviron())
+#endif
+
 static const char *interp_prefix = CONFIG_QEMU_PREFIX;
 
 #if defined(__i386__) && !defined(CONFIG_STATIC)
@@ -977,9 +982,9 @@
         } else if (!strcmp(r, "L")) {
             interp_prefix = argv[optind++];
         } else if (!strcmp(r, "p")) {
-            host_page_size = atoi(argv[optind++]);
-            if (host_page_size == 0 ||
-                (host_page_size & (host_page_size - 1)) != 0) {
+            qemu_host_page_size = atoi(argv[optind++]);
+            if (qemu_host_page_size == 0 ||
+                (qemu_host_page_size & (qemu_host_page_size - 1)) != 0) {
                 fprintf(stderr, "page size must be a power of two\n");
                 exit(1);
             }
@@ -1007,7 +1012,7 @@
     init_paths(interp_prefix);
 
     /* NOTE: we need to init the CPU at this stage to get the
-       host_page_size */
+       qemu_host_page_size */
     env = cpu_init();
     
     if (elf_exec(filename, argv+optind, environ, regs, info) != 0) {

Index: linux-user/syscall.c
===================================================================
RCS file: /cvsroot/qemu/qemu/linux-user/syscall.c,v retrieving revision 1.50

syscall.c +7 -1
diff -u -r1.50 syscall.c
@@ -22,7 +22,9 @@
 #include <stdarg.h>
 #include <string.h>
 #include <elf.h>
+#ifndef __APPLE__
 #include <endian.h>
+#endif
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -34,10 +36,11 @@
 #include <sys/mount.h>
 #include <sys/resource.h>
 #include <sys/mman.h>
+#ifndef __APPLE__
 #include <sys/swap.h>
+#endif
 #include <signal.h>
 #include <sched.h>
-#include <sys/socket.h>
 #include <sys/uio.h>
 #include <sys/poll.h>
 #include <sys/times.h>
@@ -45,6 +48,7 @@
 #include <utime.h>
 #include <sys/sysinfo.h>
 //#include <sys/user.h>
+#include <sys/socket.h>
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
 
@@ -55,6 +59,7 @@
 #define tchars host_tchars /* same as target */
 #define ltchars host_ltchars /* same as target */
 
+#ifndef __APPLE__
 #include <linux/termios.h>
 #include <linux/unistd.h>
 #include <linux/utsname.h>
@@ -63,6 +68,7 @@
 #include <linux/soundcard.h>
 #include <linux/dirent.h>
 #include <linux/kd.h>
+#endif
 
 #include "qemu.h"
 

Index: slirp/slirp.h
===================================================================
RCS file: /cvsroot/qemu/qemu/slirp/slirp.h,v
retrieving revision 1.3

slirp.h +4 -0
diff -u -r1.3 slirp.h
@@ -127,6 +127,10 @@
 # define WANT_SYS_TERMIOS_H
 #endif
 
+#ifdef __APPLE__
+#define HAVE_TERMIOS_H
+#endif
+
 #ifdef WANT_SYS_TERMIOS_H
 # ifndef INCLUDED_TERMIOS_H
 #  ifdef HAVE_TERMIOS_H

Index: slirp/socket.c
===================================================================
RCS file: /cvsroot/qemu/qemu/slirp/socket.c,v
retrieving revision 1.1

socket.c +11 -1
diff -u -r1.1 socket.c
@@ -369,6 +369,16 @@
 	return nn;
 }
 
+#ifdef __APPLE__
+void
+sorecvfrom(so)
+	struct socket *so;
+{
+	DEBUG_CALL("sorecvfrom");
+	printf("sorecvfrom not supported");
+	exit(0x123);
+}
+#else
 /*
  * recvfrom() a UDP socket
  */
@@ -468,7 +478,7 @@
 	  } /* rx error */
 	} /* if ping packet */
 }
-
+#endif
 /*
  * sendto() a socket
  */

Index: target-i386/op.c
===================================================================
RCS file: /cvsroot/qemu/qemu/target-i386/op.c,v
retrieving revision 1.20

op.c +1 -1
diff -u -r1.20 op.c
@@ -1955,7 +1955,7 @@
     int rnd_type;
     env->fpuc = lduw((void *)A0);
     /* set rounding mode */
-#ifdef _BSD
+#if defined(_BSD) && !defined(__APPLE__)
     switch(env->fpuc & RC_MASK) {
     default:
     case RC_NEAR:

Index: target-ppc/op_helper.c
===================================================================
RCS file: /cvsroot/qemu/qemu/target-ppc/op_helper.c,v retrieving revision 1.7

op_helper.c +7 -0
diff -u -r1.7 op_helper.c
@@ -464,10 +464,17 @@
 
 /*****************************************************************************/
 /* Special helpers for debug */
+#ifdef __APPLE__
+static FILE *stdout;
+#else
 extern FILE *stdout;
+#endif
 
 void dump_state (void)
 {
+#ifdef __APPLE__
+	stdout = open("/dev/stdout", 777);
+#endif
     cpu_ppc_dump_state(env, stdout, 0);
 }
 

Index: target-ppc/translate.c
===================================================================
RCS file: /cvsroot/qemu/qemu/target-ppc/translate.c,v retrieving revision 1.18

translate.c +2 -2
diff -u -r1.18 translate.c
@@ -277,7 +277,7 @@
 }
 
 #define GEN_OPCODE(name, op1, op2, op3, invl, _typ)                           \
-__attribute__ ((section(".opcodes"), unused, aligned (8) ))                   \
+__attribute__ ((section("__TEXT,.opcodes"), unused, aligned (8) ))                   \
 static opcode_t opc_##name = {                                                \
     .opc1 = op1,                                                              \
     .opc2 = op2,                                                              \
@@ -290,7 +290,7 @@
 }
 
 #define GEN_OPCODE_MARK(name)                                                 \
-__attribute__ ((section(".opcodes"), unused, aligned (8) ))                   \
+__attribute__ ((section("__TEXT,.opcodes"), unused, aligned (8) ))                   \
 static opcode_t opc_##name = {                                                \
     .opc1 = 0xFF,                                                             \
     .opc2 = 0xFF,                                                             \

Pierre