yassin
yassin

Reputation: 6707

Gcc and ld arguments

how can I pass the option --enable-auto-import to ld from gcc?

Upvotes: 6

Views: 6360

Answers (4)

LiamF
LiamF

Reputation: 679

Caveat: It's rarely mentioned but if you have a linker option that requires a value, say ...

-current_version 1

... you need to do the following:

-Wl,-current_version,1

... or ...

-Xlinker -current_version -Xlinker 1

Upvotes: 3

zed_0xff
zed_0xff

Reputation: 33257

  -Xlinker option
       Pass option as an option to the linker.  You can use this to supply system-specific
       linker options which GCC does not know how to recognize.

Upvotes: 4

unwind
unwind

Reputation: 400159

You use the -Xlinker option to pass options to the linker:

$ gcc -Xlinker--enable-auto-import blah...

should work.

Upvotes: 3

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799560

gcc ... -Wl,--enable-auto-import ...

Upvotes: 11

Related Questions