Re: -nostdlib -lgcc doesn't work

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

 



On 3 May 2018 at 06:30, Marc Glisse wrote:
> On Thu, 3 May 2018, Patrick Oppenlander wrote:
>
>> The documentation for the '-nostdlib' option included with gcc-7.3.1 says
>> that specifying -lgcc is a way to ensure that you have no unresolved
>> references to libgcc.a. I tried a simple test,
>>
>>> cat test.c
>>
>> int _start()
>> {
>>         volatile __int128 x;
>>         return x / 12345;
>> }
>>>
>>> gcc -nostdlib -lgcc test.c
>>
>> /tmp/ccjXikir.o: In function `_start':
>> test.c:(.text+0x2d): undefined reference to `__divti3'
>> collect2: error: ld returned 1 exit status
>>
>> Am I doing something wrong or is this a bug?
>
>
> Try putting the options in the right order (if A depends on B, A comes
> before B on the command line).

This is in the C FAQ: http://c-faq.com/lib/libsearch.html



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux