configurator: make c file name last in compiler args to workaround clang bug #11123
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re-order the compiler arguments so the c file name is last. This works around a clang bug which will suppress errors for unsupported flags if linker arguments come after the c file name. This suppression is a problem because it indicates that some argument is supported when it is not which can result in build errors.
llvm/llvm-project#116278
after this change the
base
module will build again with clang > 16 on systems without popcnt.https://github.com/janestreet/base/blob/6ddf3438c79184fa443727058b623ccfe1d82ead/src/discover/discover.ml#L13-L20
eg: on aarch64 darwin and clang > 16
-mpopcnt
will generate an errorhowever, if appending
-lpthread
:Which is a problem as code will assume
-mpopcnt
is supported and will then break later when compiling with the unsupported flag