I'm new to a codebase and I'm looking through a Makefile. I see several compiler flags specified with a -Wl,
prefix (i.e. -Wl,--no-undefined
specified). I have not encountered this syntax before and it is difficult to Google search.
What is the prefix doing? It looks like it has to do with warnings, but I don't know and I'm hesitant to mess with it.
It has nothing to do with warnings.
From GCC manual:
-Wl,option
Pass option as an option to the linker. If option contains commas, it is split into multiple options at the commas. You can use this syntax to pass an argument to the option. For example, ‘
-Wl,-Map,output.map
’ passes ‘-Map output.map
’ to the linker. When using the GNU linker, you can also get the same effect with ‘-Wl,-Map=output.map
’.
man gcc:
-Wl,option
Pass option as an option to the linker. If option contains commas, it is split into multiple options at the commas. You can use this syntax to pass an argument to the option. For example,
-Wl,-Map,output.map
passes -Map output.map to the linker. When using the GNU linker, you can also get the same effect with-Wl,-Map=output.map
.
Also important tip for google, add quotes for search that include special character. The following search led me to an answer: "-wl" flag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With