Static linking with a custom glibc version

Szabolcs Nagy szabolcs.nagy@arm.com
Thu Jun 4 08:06:12 GMT 2020


The 06/03/2020 14:35, Florian Weimer via Libc-help wrote:
> * Mahmood Naderan:
>
> > Excuse me, even with the default libc, I am not able to use static linking.
> >
> > $ gcc -o test -Wl,--emit-relocs -Wl,-Bstatic test.o
> > /usr/bin/ld: cannot find -lgcc_s
> > /usr/bin/ld: cannot find -lgcc_s
> > collect2: error: ld returned 1 exit status
>
> You need to install the static development libraries for libgcc (perhaps
> libgcc-static?).

just pass -static to the compiler so it knows what you want

for custom glibc you want to pass -B path/to/crtfiles and
may be other things too.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the Libc-help mailing list