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]

Re: is there any way to change the order of name resolution in linking (aside from putting the libraries in the right order?)


On Thu, Sep 27, 2012 at 7:05 AM, Feuerbacher, Alan
<AFeuerbacher@allegromicro.com> wrote:
> Ian Lance Taylor wrote:
>
>
>> One thing that may work, if you are using the GNU linker or something
>> reasonably compatible, is
>>     -Wl,--whole-archive,-lMYLIB,-Wl,--no-whole-archive
>>
>> That will link in the entire contents of the library, so all the
>> symbols defined in the library will be available.
>
> I'm trying something like that for a related purpose, but for it to work you have to replace the "," after "MYLIB" with a space. Otherwise gcc complains about an invalid option "-Wl".

Sorry, I should not have duplicated the -Wl.  (See the docs for -Wl,
which is a GCC option, for how it works.)

Ian


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