diff options
author | David Allsopp <david.allsopp@metastack.com> | 2019-04-20 13:00:30 +0100 |
---|---|---|
committer | David Allsopp <david.allsopp@metastack.com> | 2019-04-20 13:00:30 +0100 |
commit | 2b4fe09dc7196a4814710495e29a183dbeabad06 (patch) | |
tree | cecdb7d4909ac8f2881cc8182dd3d523fd2954dc /utils/ccomp.ml | |
parent | f4dc3003d579e45f6ddeb6ffceb4c283a9e15bc7 (diff) | |
download | ocaml-2b4fe09dc7196a4814710495e29a183dbeabad06.tar.gz |
Eliminate Config.ocamlopt_c{,pp}flags
Config.ocamlopt_cflags and Config.ocamlopt_cppflags were solely used by
the driver when compiling .c files passed on the command line. The
behaviour of this should be the same as for `ocamlc -c` and the
inclusion of `-fPIC` in `ocamlc_cflags` only on some systems causes
problems for `ocamlmklib` which behaves as though the two drivers
compile C files identically.
This PR eliminates the separate settings in configure.ac and deprecates
the old variables in Config.
Diffstat (limited to 'utils/ccomp.ml')
-rw-r--r-- | utils/ccomp.ml | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/utils/ccomp.ml b/utils/ccomp.ml index 27bccf824a..cdf6840f67 100644 --- a/utils/ccomp.ml +++ b/utils/ccomp.ml @@ -89,11 +89,12 @@ let compile_file ?output ?(opt="") ?stable_name name = (match !Clflags.c_compiler with | Some cc -> cc | None -> - let (cflags, cppflags) = - if !Clflags.native_code - then (Config.ocamlopt_cflags, Config.ocamlopt_cppflags) - else (Config.ocamlc_cflags, Config.ocamlc_cppflags) in - (String.concat " " [Config.c_compiler; cflags; cppflags])) + (* #7678: ocamlopt only calls the C compiler to process .c files + from the command line, and the behaviour between + ocamlc/ocamlopt should be identical. *) + (String.concat " " [Config.c_compiler; + Config.ocamlc_cflags; + Config.ocamlc_cppflags])) debug_prefix_map (match output with | None -> "" |