Use same cflags and cppflags for ocamlc -c and ocamlopt -c (#7678)#8631
Use same cflags and cppflags for ocamlc -c and ocamlopt -c (#7678)#8631dra27 merged 1 commit intoocaml:trunkfrom
Conversation
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.
|
I have a recollection that merging |
|
Rebased, but still in need of a review if it's to go into 4.10 |
|
Will discuss this with @xavierleroy tomorrow and report back here,
thanks a lot for having rebased!
|
|
Discussed with @xavierleroy
It seems okay to use the same preprocessor and compiler flags when
invoking the C compiler through either ocamlc or ocamlopt.
@xavierleroy recommends, though, that `-fPIC` is used in both cases.
|
|
@dra27 what is the status of this PR? Do we only need to add the |
|
@dra27: did you see my comment about using `-fPIC` in both cases,
according to @xavierleroy 's suggestion?
#8631 (comment)
|
|
Sorry for dropping the ball on this one. It's rebased - on change is required, the point I was making is that This is good to go, assuming a CI pass, therefore. |
|
@Octachron - I marked this a "breaking change" because the native driver passes a flag which it didn't before. Do you agree with that designation, and should this therefore go in 4.10? |
|
Thanks, @dra27!
Feel free to merge!
|
|
If it is a breaking change, it cannot be backported to 4.10 . |
|
Yes, indeed - the breaking change would be that something used |
|
@dra27 There could be a performance implication. Although I think there is a general trend towards having to produce PIC code anyway even for executables. |
|
It sounds as though this should remain for 4.11 only, then. |
Submitted as PR ocaml#8631
To make it possible to instrument only native code, we need to have two sets of flags to be passed to the C compiler, one when called by ocamlc and one when called by ocamlopt. This commit re-introduces this distinction by reverting commit 2b4fe09, Submitted as PR ocaml#8631.
To make it possible to instrument only native code, we need to have two sets of flags to be passed to the C compiler, one when called by ocamlc and one when called by ocamlopt. This commit re-introduces this distinction by reverting commit 2b4fe09, Submitted as PR ocaml#8631.
To make it possible to instrument only native code, we need to have two sets of flags to be passed to the C compiler, one when called by ocamlc and one when called by ocamlopt. This commit re-introduces this distinction by reverting commit 2b4fe09, Submitted as PR ocaml#8631.
To make it possible to instrument only native code, we need to have two sets of flags to be passed to the C compiler, one when called by ocamlc and one when called by ocamlopt. This commit re-introduces this distinction by reverting commit 2b4fe09 (PR ocaml#8631).
To make it possible to instrument only native code, we need to have two sets of flags to be passed to the C compiler, one when called by ocamlc and one when called by ocamlopt. This commit re-introduces this distinction by reverting commit 2b4fe09 (PR ocaml#8631).
To make it possible to instrument only native code, we need to have two sets of flags to be passed to the C compiler, one when called by ocamlc and one when called by ocamlopt. This commit re-introduces this distinction by reverting commit 2b4fe09 (PR ocaml#8631).
To make it possible to instrument only native code, we need to have two sets of flags to be passed to the C compiler, one when called by ocamlc and one when called by ocamlopt. This commit re-introduces this distinction by reverting commit 2b4fe09 (PR ocaml#8631).
Config.ocamlopt_cflagsandConfig.ocamlopt_cppflagswere solely used by the driver when compiling .c files passed on the command line. The behaviour of this should be the same as forocamlc -cand theinclusion of
-fPICinocamlc_cflagsonly on some systems causes problems forocamlmklibwhich behaves as though the two drivers compile C files identically.This PR eliminates the separate settings in
configure.acand deprecates the old variables inConfig.Closes #7678