diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-08-05 14:05:34 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-08-05 14:05:34 +0200 |
commit | 028aaefc44b8ed8bafd8b8896fedb53f6e68df3c (patch) | |
tree | d7f9325da52050a64e5c9ced1017a4f57c674ff3 /driver | |
parent | 4ac759d0bceef49d16197e3bb8c9767ece693c5e (diff) | |
download | compcert-028aaefc44b8ed8bafd8b8896fedb53f6e68df3c.tar.gz compcert-028aaefc44b8ed8bafd8b8896fedb53f6e68df3c.zip |
Implement support for big endian arm targets.
Adds support for the big endian arm targets by making the target
endianess flag configurable, adding support for the big endian
calling conventions, rewriting memory access patterns and adding
big endian versions of the runtime functions.
Bug 19418
Diffstat (limited to 'driver')
-rw-r--r-- | driver/Configuration.ml | 5 | ||||
-rw-r--r-- | driver/Configuration.mli | 3 | ||||
-rw-r--r-- | driver/Driver.ml | 4 |
3 files changed, 11 insertions, 1 deletions
diff --git a/driver/Configuration.ml b/driver/Configuration.ml index e1a02573..765b075a 100644 --- a/driver/Configuration.ml +++ b/driver/Configuration.ml @@ -121,6 +121,11 @@ let arch = | v -> bad_config "arch" [v] let model = get_config_string "model" let abi = get_config_string "abi" +let is_big_endian = + match get_config_string "endianness" with + | "big" -> true + | "little" -> false + | v -> bad_config "endianness" [v] let system = get_config_string "system" let has_runtime_lib = match get_config_string "has_runtime_lib" with diff --git a/driver/Configuration.mli b/driver/Configuration.mli index dde9d6fd..4b9c64a9 100644 --- a/driver/Configuration.mli +++ b/driver/Configuration.mli @@ -19,6 +19,9 @@ val model: string val abi: string (** ABI to use *) +val is_big_endian: bool + (** Endianness to use *) + val system: string (** Flavor of operating system that runs CompCert *) diff --git a/driver/Driver.ml b/driver/Driver.ml index 68615727..9c07dba1 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -524,7 +524,9 @@ let _ = | "powerpc" -> if Configuration.system = "linux" then Machine.ppc_32_bigendian else Machine.ppc_32_diab_bigendian - | "arm" -> Machine.arm_littleendian + | "arm" -> if Configuration.is_big_endian + then Machine.arm_bigendian + else Machine.arm_littleendian | "ia32" -> if Configuration.abi = "macosx" then Machine.x86_32_macosx else Machine.x86_32 |