tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Re: TinyCC -static not working


From: Henry Kroll
Subject: [Tinycc-devel] Re: TinyCC -static not working
Date: Wed, 24 Nov 2010 21:26:01 -0800

Adrian Powell wrote
Thu, 04 Nov 2010 14:42:02 -0700
>
> Hi,
>
> A 'tcc -static hello.c' under Linux appears to produce errors. I
notice
> that there was some mention of this within the
> tcc mail archive earlier this year.  Is this likely to be fixed ?.
>
> Thanks,  Adrian.
>
>

It would need static libraries to link into the program with -static.

Some distros like Fedora discourage static builds and do not ship static
libraries such as /usr/lib64/libc.a

Using "tcc -vvv" will show the missing libraries:

$ /tcc -static fib.c -vvv
nf /usr/lib64/libc.a
nf /lib64/libc.a
nf /usr/local/lib64/libc.a

The .a suffix is used on these static libraries.

Fedora has /usr/lib64/libc.so which is dynamic.

The static library can be gotten from the debuginfo rpm for glibc.

$ rp /usr/lib/debug/usr/lib64/libc.a
glibc-debuginfo-2.12.90-19.x86_64

It can be linked in with the -L option.

There may be other static libraries to get before it will build. The
resulting program will be bulkier because of all the extra code built
in.

Happy Holidays. I hope this helps.

-henry




reply via email to

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