[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Compiling tcc for use in a static environment
From: |
Thomas Preud'homme |
Subject: |
Re: [Tinycc-devel] Compiling tcc for use in a static environment |
Date: |
Wed, 09 Apr 2014 20:37:33 +0800 |
User-agent: |
KMail/4.11.5 (Linux/2.6.38-ac2-ac100; KDE/4.11.5; armv7l; ; ) |
Hi there,
Le mardi 8 avril 2014, 16:17:09 Steve Kemp a écrit :
> I'm in the middle of building a rescue-system, and I would
> like to be able to include a simple compiler within that
> environment.
>
> Ideally I'd like to see tcc compiled against uclibc, or
> musl, however despite coming across prior art I've been
> unsuccessful at making the thing work.
>
> For example this link:
> http://pts-mini-gpl.googlecode.com/svn/trunk/pts-tcc/
>
> Contains a small diff, and a recipe, but for me that fails
> to link.
>
> Using musl I got as far as compiling tcc, but the generated
> binaries themselves fail to link:
>
> $ /opt/tcc/bin/tcc t.c
> tcc: error: file 'crt1.o' not found
> tcc: error: file 'crti.o' not found
I didn't look much at the patch but noticed it hardcodes i686 as the target.
Is your system a 32 bit intel system? If no, that might explain what is the
problem you encounter.
Also you can try playing with the number of / (adding or removing one) in line
396 of the patch (the one that sets CONFIG_TCC_CRTPREFIX.
>
> At this point I'm taking a step back and asking if there
> are any existing recipes for building a static compiler
> that can be used in a static-only environment (with no ldd
> or linker present).
I suppose you mean no ld.so. Currently tcc fails to work with -static with
glibc but I don't know if that is the case with uclibc. I know there is some
line about uclibc in tcc's code so it should be supported but I never tried.
>
>
> Steve
> --
Best regards,
Thomas