-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cc.get_supported_arguments doesn't seem to work when CFLAGS contains linker options #4542
Comments
Hm, why does it complain even though there was |
I assume that's because |
:( any chance this can be tolerated on meson's size? May the order of the arguments be changed (if it affects anything, of course)? Because I'm not sure what to do on OSS-Fuzz side to make sure all the other projects are still building fine. |
Given that the options |
All of those flags are very suspect. The code specifically says that the no-as-needed flag is passed so that the warning produced by a spurious The core problem here is that OSS-Fuzz seems to treat all build systems as dumb and just throws compiler flags en masse at them. Meson does not really work like that. We aim to provide higher level interface to our users. We also exploit that to do things internally. This meshes badly with random linker flags injected in from the outside, especially for things that we have an internal option for. The correct solution for this is that we provide the knobs necessary (most or possibly all of which we already do) so OSS-Fuzz and everyone else can just use those. This means we have one proper working solution and everyone and their dog does not have to reinvent the wheel and do the magic guessing game of "what linker flags should I inject in this case". |
@jpakkane I used the script provided by OSS-Fuzz as an example of the environment where linker options passed via |
We should consider filtering out |
That's the thing. Every build system does not really work like something else from different perspectives. We have to build 150+ projects in ~5 build configurations, and these projects are using whichever build system they prefer. So far, the most unified way to handle this was to provide certain If you have a better idea on how to solve this problem, I'd really appreciate your advice. Feel free to modify https://github.com/google/oss-fuzz/tree/master/infra/base-images/base-builder image locally and then test with different projects by running |
Why are you injecting linker flags via |
Autotools often requires you to inject linker flags in both |
That is not the case here, though. The problematic args are only in Anyhoo, I made an experimental branch for this. Can you test if it works for you? |
@jpakkane I modified the build script a bit so that it used |
It seems AFLplusplus isn't compatible with meson. Since yesterday systemd has been failing to build due to an unused command line argument: ``` Compiler stdout: Compiler stderr: clang-12: error: /src/aflplusplus/afl-compiler-rt.o: 'linker' input unused [-Werror,-Wunused-command-line-argument] clang-12: error: -Wl,--dynamic-list=/src/aflplusplus/dynamic_list.txt: 'linker' input unused [-Werror,-Wunused-command-line-argument] meson.build:647:16: ERROR: Problem encountered: unable to determine gperf len type + exit 1 ``` I'm not sure where the argument comes from but it looks like another variation on mesonbuild/meson#4542
get_supported_arguments(possible_cc_flags)
is used to get a list of arguments supported by the compiler, some of which are supposed to suppress several compiler warnings. Whensystemd
is built with the scripts provided by the OSS-Fuzz project,-Wl,--no-as-needed -Wl,-ldl -Wl,-lm
are added toCFLAGS
, which, in turn, makesmeson
think that none ofpossible_cc_flags
are supported and leads to a lot of spurious warnings. Below is the relevant part of the build log:cc @Dor1s
The text was updated successfully, but these errors were encountered: