This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
-nostdlib -lgcc doesn't work
- From: Patrick Oppenlander <pattyo dot lists at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 3 May 2018 10:09:10 +1000
- Subject: -nostdlib -lgcc doesn't work
- Dkim-filter: OpenDKIM Filter v2.11.0 camber.motec.com.au 4342016BE5D
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?
Patrick