[SOLVED] What does `-B` linker switch do?

Issue

I see a few in this makefile. eg:

$(CC32) -B./obj32 $(LDFLAGS) $(LDFLAGS32) -o [email protected] $(LDLIBS) -Wl,--hugetlbfs-align $(filter %.o,$^)

What does this -B mean?

Solution

That is not a linker switch. If it were a linker switch specifically it would be prefixed with -Wl, telling the GCC front-end to pass that option through to the linker.

The -B option is for the GCC front-end, and you can learn about its options here: https://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html

Index of options here: https://gcc.gnu.org/onlinedocs/gcc/Option-Index.html

The -B option here: https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html#index-B

Answered By – MadScientist

Answer Checked By – Dawn Plyler (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published.