What does mean -Xlinker -R $PROJECT/boost_1_34_1/lib ?

C

CPP beginner

-Xlinker seems to be the argument to the linker but what does this
command ? What does mean -R ? (lib is a directory here)
This allows your output file to refer symbolically to absolute
locations ...

Does it mean that if i use a multithread library, i must give -Xlinker -R ?

Thank you.

--
 
V

Vladyslav Lazarenko

-Xlinker seems to be the argument to the linker but what does this
command ? What does mean -R ? (lib is a directory here)
This allows your output file to refer symbolically to  absolute
locations ...

Does it mean that if i use a multithread library, i must give -Xlinker -R ?

Thank you.

--

Dear see pee pee beginner. Please note that this is off topic here.
Furthermore, you have not provided anything about a kind or version of
compiler, linker, operating system, architecture etc. In the future,
please make an effort to read manual, search for similar answered
questions, find corresponding group to post your questions and provide
as much information as possible.

Turning my clairvoyant mode on, I will give you an answer. In the
future, refer to your GCC documentation - http://gcc.gnu.org/onlinedocs/

Thank you.

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.
If you want to pass an option that takes an argument, you must use -
Xlinker twice, once for the option and once for the argument. For
example, to pass -assert definitions, you must write `-Xlinker -assert
-Xlinker definitions'. It does not work to write -Xlinker "-assert
definitions", because this passes the entire string as a single
argument, which is not what the linker expects.

For compatibility with other ELF linkers, if the -R option is
followed by a directory name, rather than a file name, it is treated
as the -rpath option.

-rpath dir

Add a directory to the runtime library search path. This is used
when linking an ELF executable with shared objects.
All -rpath arguments are concatenated and passed to the runtime
linker, which uses them to locate shared objects at run-
time. The -rpath option is also used when locating shared
objects which are needed by shared objects explicitly
included in the link; see the description of the -rpath-link option.
If -rpath is not used when linking an ELF exe-
cutable, the contents of the environment variable "LD_RUN_PATH" will
be used if it is defined.

The -rpath option may also be used on SunOS. By default, on SunOS,
the linker will form a runtime search patch out of
all the -L options it is given. If a -rpath option is used, the
runtime search path will be formed exclusively using
the -rpath options, ignoring the -L options. This can be useful when
using gcc, which adds many -L options which may be
on NFS mounted filesystems.
 
C

CPP beginner

Vladyslav said:
Dear see pee pee beginner. Please note that this is off topic here.
Furthermore, you have not provided anything about a kind or version of
compiler, linker, operating system, architecture etc. In the future,
please make an effort to read manual, search for similar answered
questions, find corresponding group to post your questions and provide
as much information as possible.

Turning my clairvoyant mode on, I will give you an answer. In the
future, refer to your GCC documentation - http://gcc.gnu.org/onlinedocs/

Thank you.

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.
If you want to pass an option that takes an argument, you must use -
Xlinker twice, once for the option and once for the argument. For
example, to pass -assert definitions, you must write `-Xlinker -assert
-Xlinker definitions'. It does not work to write -Xlinker "-assert
definitions", because this passes the entire string as a single
argument, which is not what the linker expects.

For compatibility with other ELF linkers, if the -R option is
followed by a directory name, rather than a file name, it is treated
as the -rpath option.

-rpath dir

Add a directory to the runtime library search path. This is used
when linking an ELF executable with shared objects.
All -rpath arguments are concatenated and passed to the runtime
linker, which uses them to locate shared objects at run-
time. The -rpath option is also used when locating shared
objects which are needed by shared objects explicitly
included in the link; see the description of the -rpath-link option.
If -rpath is not used when linking an ELF exe-
cutable, the contents of the environment variable "LD_RUN_PATH" will
be used if it is defined.

The -rpath option may also be used on SunOS. By default, on SunOS,
the linker will form a runtime search patch out of
all the -L options it is given. If a -rpath option is used, the
runtime search path will be formed exclusively using
the -rpath options, ignoring the -L options. This can be useful when
using gcc, which adds many -L options which may be
on NFS mounted filesystems.

I saw doc ...
but i do not understand what happens at runtime.
my compiler :gcc 4.3
my linker : ld

Thank you
--
 
J

Joe Smith

CPP said:
I saw doc ...
but i do not understand what happens at runtime.
my compiler :gcc 4.3
my linker : ld

You want to ask in a Linux or Unix newsgroup how dynamic linking works at
runtime, and what the rpath is.

Some relvent keywords for Google searching would be "ld.so", and "rpath".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top