Home > Software design >  What does `-B` linker switch do?
What does `-B` linker switch do?

Time:03-22

I see a few in this makefile. eg:

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

What does this -B mean?

CodePudding user response:

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

  • Related