PR#6049: support for OpenBSD/macppc

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13835 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2013-06-24 08:17:30 +00:00
parent 034351e37b
commit bfc08c41ac
6 changed files with 20 additions and 12 deletions

View File

@ -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.

View File

@ -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 ->

View File

@ -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

View File

@ -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

View File

@ -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)

3
configure vendored
View File

@ -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";;