diff options
Diffstat (limited to 'driver')
-rw-r--r-- | driver/Clflags.ml | 1 | ||||
-rw-r--r-- | driver/CommonOptions.ml | 9 | ||||
-rw-r--r-- | driver/Configuration.ml | 2 | ||||
-rw-r--r-- | driver/Driver.ml | 2 | ||||
-rw-r--r-- | driver/Frontend.ml | 9 |
5 files changed, 12 insertions, 11 deletions
diff --git a/driver/Clflags.ml b/driver/Clflags.ml index 80883372..25c3e1dd 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -17,7 +17,6 @@ let linker_options = ref ([]: string list) let assembler_options = ref ([]: string list) let option_flongdouble = ref false let option_fstruct_passing = ref false -let option_fbitfields = ref false let option_fvararg_calls = ref true let option_funprototyped = ref true let option_fpacked_structs = ref false diff --git a/driver/CommonOptions.ml b/driver/CommonOptions.ml index e8a6941c..9da1e533 100644 --- a/driver/CommonOptions.ml +++ b/driver/CommonOptions.ml @@ -32,7 +32,7 @@ let version_options tool_name = (* Language support options *) let all_language_support_options = [ - option_fbitfields; option_flongdouble; + option_flongdouble; option_fstruct_passing; option_fvararg_calls; option_funprototyped; option_fpacked_structs; option_finline_asm ] @@ -44,11 +44,11 @@ let unset_all opts () = List.iter (fun r -> r := false) opts let language_support_options = [ Exact "-fall", Unit (set_all all_language_support_options); - Exact "-fnone", Unit (unset_all all_language_support_options);] + Exact "-fnone", Unit (unset_all all_language_support_options); + Exact "-fbitfields", Unit (fun () -> ()); ] @ f_opt "longdouble" option_flongdouble @ f_opt "struct-return" option_fstruct_passing @ f_opt "struct-passing" option_fstruct_passing - @ f_opt "bitfields" option_fbitfields @ f_opt "vararg-calls" option_fvararg_calls @ f_opt "unprototyped" option_funprototyped @ f_opt "packed-structs" option_fpacked_structs @@ -56,7 +56,6 @@ let language_support_options = let language_support_help = {|Language support options (use -fno-<opt> to turn off -f<opt>) : - -fbitfields Emulate bit fields in structs [off] -flongdouble Treat 'long double' as 'double' [off] -fstruct-passing Support passing structs and unions by value as function results or function arguments [off] @@ -67,6 +66,7 @@ let language_support_help = -finline-asm Support inline 'asm' statements [off] -fall Activate all language support options above -fnone Turn off all language support options above + -fbitfields Ignored (bit fields are now implemented natively) |} (* General options *) @@ -77,7 +77,6 @@ let general_help = -v Print external commands before invoking them -timings Show the time spent in various compiler passes -version Print the version string and exit - -version-file <file> Print version inforation to <file> and exit -target <value> Generate code for the given target -conf <file> Read configuration from file @<file> Read command line options from <file> diff --git a/driver/Configuration.ml b/driver/Configuration.ml index 2188acf0..4b0c116e 100644 --- a/driver/Configuration.ml +++ b/driver/Configuration.ml @@ -157,4 +157,4 @@ let response_file_style = let gnu_toolchain = system <> "diab" -let elf_target = system <> "macosx" && system <> "cygwin" +let elf_target = system <> "macos" && system <> "cygwin" diff --git a/driver/Driver.ml b/driver/Driver.ml index 043e43c1..2b34d538 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -412,6 +412,8 @@ let _ = fatal_error no_loc "ambiguous '-o' option (multiple source files)"; if !num_input_files = 0 then fatal_error no_loc "no input file"; + if not !option_interp && !main_function_name <> "main" then + fatal_error no_loc "option '-main' requires option '-interp'"; let linker_args = time "Total compilation time" perform_actions () in if not (nolink ()) && linker_args <> [] then begin linker (output_filename_default "a.out") linker_args diff --git a/driver/Frontend.ml b/driver/Frontend.ml index bb97e945..6133291e 100644 --- a/driver/Frontend.ml +++ b/driver/Frontend.ml @@ -80,7 +80,6 @@ let parse_c_file sourcename ifile = let simplifs = "b" (* blocks: mandatory *) ^ (if !option_fstruct_passing then "s" else "") - ^ (if !option_fbitfields then "f" else "") ^ (if !option_fpacked_structs then "p" else "") in (* Parsing and production of a simplified C AST *) @@ -109,15 +108,17 @@ let init () = | "x86" -> if Configuration.model = "64" then Machine.x86_64 else - if Configuration.abi = "macosx" - then Machine.x86_32_macosx + if Configuration.abi = "macos" + then Machine.x86_32_macos else if Configuration.system = "bsd" then Machine.x86_32_bsd else Machine.x86_32 | "riscV" -> if Configuration.model = "64" then Machine.rv64 else Machine.rv32 - | "aarch64" -> Machine.aarch64 + | "aarch64" -> if Configuration.abi = "apple" + then Machine.aarch64_apple + else Machine.aarch64 | _ -> assert false end; Env.set_builtins C2C.builtins; |