1737973
1737973

Reputation: 118

How many object files can I pass to a linking task?

I found this for a vanilla case of Bash on GNU/Linux, but what about other shells, other operating systems and other compilers?

Upvotes: 1

Views: 482

Answers (1)

Employed Russian
Employed Russian

Reputation: 213375

How many object files can I pass to a linking task?

Depends on the linker you use.

When using binutils gnu-ld or gold, you can use Windows-style response file, which allows you to bypass command line length limits and pass as many arguments as you need:

echo "foo.o bar.o baz.o ... -lc" > args
gcc main.o -Wl,@args  # there is no limit on how big args file is.

Upvotes: 2

Related Questions