xmake removes arguments even with {force = true }
.
#4762
Unanswered
davidchisnall
asked this question in
Q&A
Replies: 1 comment
-
xmake will remove duplicate flags. try add_cflags({"-mllvm", "-cheri-stack-bounds-single-intrinsic-threshold"}, {"-mllvm", "1"}, {expand = false, force = true }) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Xmake Version
v2.8.6+20231226
Operating System Version and Architecture
macOS 14.3
Describe Bug
Xmake does not contain an exhaustive list of the compiler flags that a compiler supports, but acts as if it does. Many compiler flags are positional and mean different things in different places. Adding the same unknown flag with xmake causes it to be removed. This makes it impossible to pass LLVM flags through clang, because each needs to be prefixed with
-mllvm
. For example:This results in the following in the clang command line:
-mllvm -cheri-stack-bounds-single-intrinsic-threshold 1
.Expected Behavior
Ideally, xmake should never tamper with arguments passed to
add_cflags
or similar. These are low-level interfaces for communicating directly with the compiler. If xmake wants to provide higher-level abstractions (as it does for debug level, optimisation level, and so on) that map compiler flags to other things then that's fine, but it should never assume that it knows more than the user about the flags that the compiler accepts. Given that this is not the behaviour, at least users who explicitly tell xmake that they know what they're doing viaforce = true
should just have the arguments forwarded to the compiler and not modified.Project Configuration
xmake.lua
a.c
is an empty file. Runxmake -v
and see the command line contains-mllvm -some-flag -some-other-flag
, not-mllvm -some-flag -mllvm -some-other-flag
.Additional Information and Error Logs
N/A.
Beta Was this translation helpful? Give feedback.
All reactions