diff --git a/Changes b/Changes index bc3bc63af..26d05d9c9 100644 --- a/Changes +++ b/Changes @@ -171,6 +171,7 @@ Feature wishes: - PR#5774: Add bswap primitives for amd64 and arm - PR#5827: provide a dynamic command line parsing mechanism - PR#5864: Add a find operation to Set +- PR#6049: support for OpenBSD/macppc platform Tools: - OCamlbuild now features a bin_annot tag to generate .cmt files. diff --git a/asmcomp/power/emit.mlp b/asmcomp/power/emit.mlp index 794478f6f..283312e7e 100644 --- a/asmcomp/power/emit.mlp +++ b/asmcomp/power/emit.mlp @@ -56,7 +56,7 @@ let supports_backtraces = let emit_symbol = match Config.system with - | "elf" | "bsd" -> (fun s -> Emitaux.emit_symbol '.' s) + | "elf" | "bsd" | "bsd_elf" -> (fun s -> Emitaux.emit_symbol '.' s) | "rhapsody" -> (fun s -> emit_char '_'; Emitaux.emit_symbol '$' s) | _ -> assert false @@ -64,7 +64,7 @@ let emit_symbol = let label_prefix = match Config.system with - | "elf" | "bsd" -> ".L" + | "elf" | "bsd" | "bsd_elf" -> ".L" | "rhapsody" -> "L" | _ -> assert false @@ -78,19 +78,19 @@ let emit_data_label lbl = let data_space = match Config.system with - | "elf" | "bsd" -> " .section \".data\"\n" + | "elf" | "bsd" | "bsd_elf" -> " .section \".data\"\n" | "rhapsody" -> " .data\n" | _ -> assert false let code_space = match Config.system with - | "elf" | "bsd" -> " .section \".text\"\n" + | "elf" | "bsd" | "bsd_elf" -> " .section \".text\"\n" | "rhapsody" -> " .text\n" | _ -> assert false let rodata_space = match Config.system with - | "elf" | "bsd" -> " .section \".rodata\"\n" + | "elf" | "bsd" | "bsd_elf" -> " .section \".rodata\"\n" | "rhapsody" -> " .const\n" | _ -> assert false @@ -158,7 +158,7 @@ let is_native_immediate n = let emit_upper emit_fun arg = match Config.system with - | "elf" | "bsd" -> + | "elf" | "bsd" | "bsd_elf" -> emit_fun arg; emit_string "@ha" | "rhapsody" -> emit_string "ha16("; emit_fun arg; emit_string ")" @@ -166,7 +166,7 @@ let emit_upper emit_fun arg = let emit_lower emit_fun arg = match Config.system with - | "elf" | "bsd" -> + | "elf" | "bsd" | "bsd_elf" -> emit_fun arg; emit_string "@l" | "rhapsody" -> emit_string "lo16("; emit_fun arg; emit_string ")" @@ -844,7 +844,7 @@ let fundecl fundecl = else ` .globl {emit_symbol fundecl.fun_name}\n`; begin match Config.system with - | "elf" | "bsd" -> + | "elf" | "bsd" | "bsd_elf" -> ` .type {emit_symbol fundecl.fun_name}, @function\n` | _ -> () end; @@ -889,8 +889,11 @@ let fundecl fundecl = let declare_global_data s = ` .globl {emit_symbol s}\n`; - if Config.system = "elf" || Config.system = "bsd" then + match Config.system with + | "elf" | "bsd" | "bsd_elf" -> ` .type {emit_symbol s}, @object\n` + | "rhapsody" -> () + | _ -> assert false let emit_item = function Cglobal_symbol s -> diff --git a/asmcomp/power/proc.ml b/asmcomp/power/proc.ml index 07eb8b67c..203e8a9ef 100644 --- a/asmcomp/power/proc.ml +++ b/asmcomp/power/proc.ml @@ -186,7 +186,7 @@ let poweropen_external_conventions first_int last_int let loc_external_arguments = match Config.system with | "rhapsody" -> poweropen_external_conventions 0 7 100 112 - | "elf" | "bsd" -> calling_conventions 0 7 100 107 outgoing 8 + | "elf" | "bsd" | "bsd_elf" -> calling_conventions 0 7 100 107 outgoing 8 | _ -> assert false let extcall_use_push = false diff --git a/asmrun/Makefile b/asmrun/Makefile index 89adaa2e0..5ebf7aadb 100644 --- a/asmrun/Makefile +++ b/asmrun/Makefile @@ -81,6 +81,9 @@ install-prof: cp libasmrunp.a $(LIBDIR)/libasmrunp.a cd $(LIBDIR); $(RANLIB) libasmrunp.a +power-bsd_elf.S: power-elf.S + cp power-elf.S power-bsd_elf.S + power.o: power-$(SYSTEM).o cp power-$(SYSTEM).o power.o diff --git a/asmrun/signals_osdep.h b/asmrun/signals_osdep.h index 5e07b2c2d..ff1984754 100644 --- a/asmrun/signals_osdep.h +++ b/asmrun/signals_osdep.h @@ -237,7 +237,7 @@ /****************** PowerPC, BSD */ -#elif defined(TARGET_power) && defined(SYS_bsd) +#elif defined(TARGET_power) && (defined(SYS_bsd) || defined(SYS_bsd_elf)) #define DECLARE_SIGNAL_HANDLER(name) \ static void name(int sig, int code, struct sigcontext * context) diff --git a/configure b/configure index d721aa466..f9ebbd0e8 100755 --- a/configure +++ b/configure @@ -690,6 +690,7 @@ case "$host" in i[3456]86-*-gnu*) arch=i386; system=gnu;; powerpc*-*-linux*) arch=power; model=ppc; system=elf;; powerpc-*-netbsd*) arch=power; model=ppc; system=elf;; + powerpc-*-openbsd*) arch=power; model=ppc; system=bsd_elf;; powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;; powerpc-*-darwin*) arch=power; system=rhapsody if $arch64; then model=ppc64; else model=ppc; fi;; @@ -767,7 +768,7 @@ case "$arch,$model,$system" in aspp='gcc -c';; power,*,elf) as='as -u -m ppc' aspp='gcc -c';; - power,*,bsd) as='as' + power,*,bsd*) as='as' aspp='gcc -c';; power,*,rhapsody) as="as -arch $model" aspp="$bytecc -c";;