From df7b43a096e9a274b5b3ba8ca85275c637557c12 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 6 Apr 2018 14:48:47 +0200 Subject: Define C11 conditional feature macros (#77) These macros can be defined to indicate that variable length arrays, the _Complex type, atomics and threads are not supported. Since the _Complex type is not supported, we also need to undefine __STDC_IEC_559_COMPLEX__ Bug 23408 --- driver/Frontend.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'driver/Frontend.ml') diff --git a/driver/Frontend.ml b/driver/Frontend.ml index 209e72e9..9b7d5328 100644 --- a/driver/Frontend.ml +++ b/driver/Frontend.ml @@ -17,6 +17,15 @@ open Driveraux (* Common frontend functions between clightgen and ccomp *) +let predefined_macros = + [ + "-D__COMPCERT__"; + "-U__STDC_IEC_559_COMPLEX__"; + "-D__STDC_NO_ATOMICS__"; + "-D__STDC_NO_COMPLEX__"; + "-D__STDC_NO_THREADS__"; + "-D__STDC_NO_VLA__" + ] (* From C to preprocessed C *) @@ -26,7 +35,7 @@ let preprocess ifile ofile = if ofile = "-" then None else Some ofile in let cmd = List.concat [ Configuration.prepro; - ["-D__COMPCERT__"]; + predefined_macros; (if !Clflags.use_standard_headers then ["-I" ^ Filename.concat !Clflags.stdlib_path "include" ] else []); -- cgit From a5d9207885f55542f0b4e2004e2545e0bd487734 Mon Sep 17 00:00:00 2001 From: Frédéric Besson Date: Wed, 20 Jun 2018 17:31:59 +0200 Subject: Typo in -iquote preprocessing option (#239) The `-iquote` option was passed to the GNU preprocessor as `-iquore` --- driver/Frontend.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'driver/Frontend.ml') diff --git a/driver/Frontend.ml b/driver/Frontend.ml index 9b7d5328..e5b51c1f 100644 --- a/driver/Frontend.ml +++ b/driver/Frontend.ml @@ -124,7 +124,7 @@ let gnu_prepro_actions = [ Exact "-imacros", String (gnu_prepro_opt_key "-imacros"); Exact "-idirafter", String (gnu_prepro_opt_key "-idirafter"); Exact "-isystem", String (gnu_prepro_opt_key "-isystem"); - Exact "-iquote", String (gnu_prepro_opt_key "-iquore"); + Exact "-iquote", String (gnu_prepro_opt_key "-iquote"); Exact "-P", Self gnu_prepro_opt; Exact "-C", Self gnu_prepro_opt; Exact "-CC", Self gnu_prepro_opt;] -- cgit From 6fc89e5c8c4a8f98ef0a4a03c00994bbfb146431 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 20 Aug 2018 10:22:35 +0200 Subject: Add sizeof_reg and new Machine configurations (#129) Since the size of integer registers is not identical to the size of pointers for the ppc64 and e5500 model the check for register pairs in ExtendedAsm does not work correctly. In order to avoid this a new field sizeof_intreg is introduced in the Machine configuration which describes the size of integer registers. New configurations for the ppc64 and e5500 model are added and used. Bug 24273 --- driver/Frontend.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'driver/Frontend.ml') diff --git a/driver/Frontend.ml b/driver/Frontend.ml index e5b51c1f..88b47854 100644 --- a/driver/Frontend.ml +++ b/driver/Frontend.ml @@ -73,10 +73,12 @@ let parse_c_file sourcename ifile = let init () = Machine.config:= begin match Configuration.arch with - | "powerpc" -> if Configuration.gnu_toolchain - then if Configuration.abi = "linux" - then Machine.ppc_32_linux_bigendian - else Machine.ppc_32_bigendian + | "powerpc" -> if Configuration.model = "e5500" || Configuration.model = "ppc64" + then if Configuration.abi = "linux" then Machine.ppc_32_r64_linux_bigendian + else if Configuration.gnu_toolchain then Machine.ppc_32_r64_bigendian + else Machine.ppc_32_r64_diab_bigendian + else if Configuration.abi = "linux" then Machine.ppc_32_linux_bigendian + else if Configuration.gnu_toolchain then Machine.ppc_32_bigendian else Machine.ppc_32_diab_bigendian | "arm" -> if Configuration.is_big_endian then Machine.arm_bigendian -- cgit