Mawg
Mawg

Reputation: 40185

GCC linker : passing multiple --wrap=<function>

I am adding quite a few mocks, using cmocka, which require me to alias them using the GC Clinker opetion --wrap=

I am passing a linker option of the format

-Wl,--wrap=foo,--wrap=bar,--wrap=baz,--wrap= ...

Is there any way to shorten it?

-Wl,--wrap=foo,bar,baz,... did not work. Any suggestions?

Upvotes: 1

Views: 1235

Answers (1)

Employed Russian
Employed Russian

Reputation: 213799

Is there any way to shorten it?

No.

Why would you want to? If you care about the length of the resulting command line, note that GCC supports response files:

echo "-Wl,--wrap=foo,--wrap=bar,--wrap=baz,--wrap=..." > cmd
gcc @cmd ...

Upvotes: 3

Related Questions