tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] static linking with tcc on i386 linux


From: Clemens Kolbitsch
Subject: Re: [Tinycc-devel] static linking with tcc on i386 linux
Date: Tue, 27 Nov 2007 19:47:16 +0100
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)

ok... now i'm back to REAL basics...

my program:

--------------------------------
void main() { }
--------------------------------

(alternatively i have also used

--------------------------------
int main(int argc, char **argv) { return 0; }
--------------------------------)

--> hardly any glibc required.


compiling with gcc works. but

$ tcc -static temp.c

fails like in the previous post.

By now, i have found out that the

/usr/lib/libc.a: '_nl_category_name_idxs' defined twice

comes from including "/usr/lib/crt1.o" and "/usr/lib/libc.a" at the same time.

--> if i exclude one of them (hard-coded into the tcc-source) i either get

tcc: _start not defined" (because of the missing crt1.o)

or

tcc: undefined symbol '__libc_csu_fini'
tcc: undefined symbol '__libc_csu_init'
tcc: undefined symbol '__libc_start_main' (because of the missing libc.a)


has ANYONE EVER compiled ANYTHING statically on linux using tcc? hopefully 
somebody can help on this -- i'm starting to get a little worried by now *g*

Clemens



On Tuesday 27 November 2007 16:26:20 Clemens Kolbitsch wrote:
> one more thing:
>
> i just saw that the double-defined symbols are in /usr/lib/libc.a ... maybe
> this is because i include the glibc twice. how can i tell tcc to NOT
> include the standard glibc?
>
> the second errors
>
> > tcc: undefined symbol '_Unwind_Resume'
> > tcc: undefined symbol '__gcc_personality_v0'
> > tcc: undefined symbol '_Unwind_Backtrace'
> > tcc: undefined symbol '_Unwind_GetIP'
> > tcc: undefined symbol '_Unwind_GetGR'
> > tcc: undefined symbol '_Unwind_GetCFA'
>
> probably have nothing to do with that, however :-(
>
> On Tuesday 27 November 2007 16:20:40 Clemens Kolbitsch wrote:
> > hi everyone!
> > i am working with tcc on kubuntu (debian) linux on an i386 and have been
> > using it without problems (ever since applying the patch to resolve the
> > AS_NEEDED issue).
> >
> > however, when compiling a static binary, i still have problems (this has
> > been addressed some years ago in this list but never been answered :-( ).
> >
> > the thing is: i want to compile in statically a different (personally
> > modified) version of the glibc as i don't really want to install it and
> > mess up my whole system ;-)
> >
> > my call:
> > $ tcc -L/path-to-glibc-2.7/build/ -o test -static myfile.c
> > brings
> >
> > /usr/lib/libc.a: '_nl_category_name_idxs' defined twice
> > ...
> > /usr/lib/libc.a: '_nl_category_name_idxs' defined twice
> > tcc: undefined symbol '_Unwind_Resume'
> > tcc: undefined symbol '__gcc_personality_v0'
> > tcc: undefined symbol '_Unwind_Backtrace'
> > tcc: undefined symbol '_Unwind_GetIP'
> > tcc: undefined symbol '_Unwind_GetGR'
> > tcc: undefined symbol '_Unwind_GetCFA'
> >
> > any ideas for that? (with gcc that very same command works just fine and
> > leaving out the "-static" works as well)
> >
> > thankful for any hints :-)
> > Clemens
> >
> >
> > _______________________________________________
> > Tinycc-devel mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/tinycc-devel






reply via email to

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