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: Broken SO due to dropped dependencies


On Fri, Mar 29, 2013 at 10:29 AM, Chung-Ju Wu <jasonwucj@gmail.com> wrote:
> 2013/3/29 Ian Lance Taylor <iant@google.com>:
>> On Fri, Mar 29, 2013 at 7:56 AM, Miguel Guedes
>> <miguel.a.guedes@gmail.com> wrote:
>>> I take it you don't think there's anything wrong with GCC? Is the
>>> different behaviour between GCC and clang expected in this case?
>>
>> OK, I looked a bit closer, and I see the problem.  You are listing the
>> -l options before the .o files.  With GCC, that means that the -l
>> options are effectively ignored.  I guess clang must rearrange the -l
>> options in that case, although I don't know how that could work
>> reliably while preserving Unix linking semantics.
>>
>> Move your -l options after your .o files.
>>
>> Ian
>
>
> To my understanding, the linking order is required for static libraries.
> There is no order requirement for object files or dynamic libraries.

That is approximately but not precisely true.  There are a number of
ways in which the relative ordering of object files and dynamic
libraries can change the linker behaviour.  You are right that if no
unusual options are used and no .a files are used that there is likely
to be no difference.

Ian


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