This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Passing @file option to linker


Hi,

in general there are two ways to pass linker options from the gcc
compiler driver to the linker, either '-Wl,' or '-Xlinker'. Though
when one wants to pass a @file option to the linker, than only
-Wl,@file seems to work, because when using '-Xlinker @file', the
driver already interprets @file and thus would only pass the first
argument from the read file to the linker and the remaining arguments
from the file are already recognized by the driver.

Is this analysis correct? The documentation isn't very clear, that
@file arguments are read immediately when encountered and regardless
of an prior -Xlinker option:

Read command-line options from file. The options read are inserted in
place of the original @file option. If file does not exist, or cannot
be read, then the option will be treated literally, and not removed.

Options in file are separated by whitespace. A whitespace character
may be included in an option by surrounding the entire option in
either single or double quotes. Any character (including a backslash)
may be included by prefixing the character to be included with a
backslash. The file may itself contain additional @file options; any
such options will be processed recursively.

Greetings,
Bert


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]