discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adding a flag for the linker in a certain order


From: Fred Kiefer
Subject: Re: adding a flag for the linker in a certain order
Date: Fri, 28 Sep 2012 10:43:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0

Dan, the reason that you didn't get a reply from this mailing list may be because you didn't state clear enough what you are after. My impression is that ADDITIONAL_LDFLAGS is the wrong variable to use for whatever purpose you are after. Libraries should be specified by one of the ADDITIONAL_XXX_LIBS variables. But without knowing your specific problem it is hard to tell which one, probably ADDITIONAL_TOOL_LIBS.

Maybe you could read the documentation at:

http://www.gnustep.org/resources/documentation/make_1.html

If this doesn't clear things up, feel free to post your full GNUmakefile.

Hope this helps
Fred


On 27.09.2012 22:30, Dan Hitt wrote:
Just for reference here, some people on the gcc-help list
gave me a work-around for this issue.

The work around is to link in the whole archive, via:

ADDITIONAL_LDFLAGS=-Wl,--whole-archive,/full/path/to/lib1.a,/full/path/to/lib2.a,...,--no-whole-archive

Here, /full/path/to/lib1.a is a static library containing the same
symbols that i wanted to link in.

But i would still like to be able to place my LDFLAGS anywhere i want
in the gnustep GNUmakefile, so if there is a way of doing that somebody
please let me know.

(It would be better because it would be more natural and i could use the
-l abbreviation for libraries which is probably more portable.)

So thanks in advance for any clues on that front, or maybe a pointer to
the docs (because maybe it's right there but i'm just looking over it??).

dan

On Wed, Sep 26, 2012 at 1:49 PM, Dan Hitt <dan.hitt@gmail.com> wrote:
I'm building a command line program (using tool.make) and
i need to add a library.

I understand from the internet that in order to add a flag for
the linker i use
    ADDITIONAL_LDFLAGS=-lblahblahblah

By using "make messages=yes" i can verify that indeed the
extra library is getting added.

But it is getting added to the front of the list, while it needs
to be added to the end of the list in order to get all the
symbols resolved.  (If i manually form the command by
moving the library from the first place on the list to the
last place i have verified that all symbols indeed resolve
if the library is placed last.)

So . . . what should i do to get my linker argument to the
end of the list?

Thanks in advance for any clues or pointers.

dan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]