diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2014-12-11 09:32:09 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2014-12-11 09:32:09 +0100 |
commit | 0342889a01aa16162232b0a87a4eb10bdb852ba4 (patch) | |
tree | 63c9ff7443e18b05275f2c258da3fe758d1413b0 | |
parent | 4d1e02eb67a027d968979ed37f9d90426c634ccd (diff) | |
download | compcert-kvx-0342889a01aa16162232b0a87a4eb10bdb852ba4.tar.gz compcert-kvx-0342889a01aa16162232b0a87a4eb10bdb852ba4.zip |
Update the IA32/MacOS X port.
- Prefix symbols with _
- Print indirect symbol definitions
- Suppress __asm() macros in system header files
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | ia32/PrintAsm.ml | 10 |
2 files changed, 7 insertions, 5 deletions
@@ -154,7 +154,7 @@ case "$target" in abi="standard" system="macosx" cc="${toolprefix}gcc -arch i386" - cprepro="${toolprefix}gcc -arch i386 -U__GNUC__ -U__clang__ -U__BLOCKS__ '-D__attribute__(x)=' -E" + cprepro="${toolprefix}gcc -arch i386 -U__GNUC__ -U__clang__ -U__BLOCKS__ '-D__attribute__(x)=' '-D__asm(x)=' -E" casm="${toolprefix}gcc -arch i386 -c" case `uname -r` in [1-9].*|10.*|11.*) # up to MacOS 10.7 included diff --git a/ia32/PrintAsm.ml b/ia32/PrintAsm.ml index 5c84af6b..41002bac 100644 --- a/ia32/PrintAsm.ml +++ b/ia32/PrintAsm.ml @@ -161,7 +161,7 @@ module MacOS_System = fprintf oc "_%s" s let symbol oc symb = - fprintf oc "%s" (extern_atom symb) + fprintf oc "_%s" (extern_atom symb) let label oc lbl = fprintf oc "L%d" lbl @@ -206,7 +206,8 @@ module MacOS_System = fprintf oc "L%a$non_lazy_ptr:\n" raw_symbol s; fprintf oc " .indirect_symbol %a\n" raw_symbol s; fprintf oc " .long 0\n") - !indirect_symbols + !indirect_symbols; + indirect_symbols := StringSet.empty end:SYSTEM) @@ -638,7 +639,6 @@ let print_builtin_inline oc name args res = let float64_literals : (int * int64) list ref = ref [] let float32_literals : (int * int32) list ref = ref [] let jumptables : (int * label list) list ref = ref [] -let indirect_symbols : StringSet.t ref = ref StringSet.empty (* Reminder on AT&T syntax: op source, dest *) @@ -1042,4 +1042,6 @@ let print_program oc p = Target.raw_symbol "__negs_mask"; fprintf oc "%a: .long 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF\n" Target.raw_symbol "__abss_mask" - end + end; + Target.print_epilogue oc + |