Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 132095 - dev-lang/tcc-0.9.23 - tcc cannot find system headers
Summary: dev-lang/tcc-0.9.23 - tcc cannot find system headers
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High major
Assignee: Spider (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-03 00:35 UTC by Samuel Tardieu
Modified: 2006-08-24 01:46 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0.9.23 ebuild cleanup (diff,1.19 KB, patch)
2006-05-03 01:21 UTC, Harald van Dijk (RETIRED)
Details | Diff
tcc-0.9.23-r1.ebuild (tcc-0.9.23-r1.ebuild,983 bytes, text/plain)
2006-08-22 05:27 UTC, Timothy Redaelli (RETIRED)
Details
files/tcc-binutils216.patch (tcc-binutils216.patch,1.61 KB, patch)
2006-08-22 05:27 UTC, Timothy Redaelli (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Tardieu 2006-05-03 00:35:30 UTC
Running the example from tcc documentation:

% cat > t.c << EOF
#!/usr/bin/tcc -run
#include <stdio.h>

int main() 
{
    printf("Hello World\n");
    return 0;
}
EOF
% chmod 755 t.c
% ./t.c
In file included from ./t.c:2:
/usr/include/stdio.h:34: include file 'stddef.h' not found
Comment 1 Samuel Tardieu 2006-05-03 00:36:42 UTC
(tcc 0.9.23)
Comment 2 Harald van Dijk (RETIRED) gentoo-dev 2006-05-03 01:21:16 UTC
Created attachment 86051 [details, diff]
0.9.23 ebuild cleanup

This patch fixes it, and also makes sure examples get installed correctly. There are still two remaining issues with tcc, however:

- tcc doesn't respect either CFLAGS or LDFLAGS

- I believe the "#! /usr/bin/env tcc" should actually be "#! /usr/bin/tcc -run"; -run is also used in the manpage. /usr/bin/env tcc -run would be even better but doesn't work because of #! limitations. As tcc won't compile anything though (next point), I can't test it to be sure -run is really needed.

- tcc doesn't seem to be compatible with glibc 2.4 (I think that's the problem, anyway): even compiling int main() {} results in
tcc: file 'AS_NEEDED' not found
/usr/lib/libc.so:3: filename expected
/usr/lib/libc.so:3: unrecognized file type
tcc: undefined symbol '__gcc_personality_v0'
tcc: undefined symbol '_Unwind_Resume'
tcc: undefined symbol '_Unwind_Backtrace'
tcc: undefined symbol '_Unwind_GetIP'
tcc: undefined symbol '_Unwind_GetGR'
tcc: undefined symbol '_Unwind_GetCFA'
Comment 3 Harald van Dijk (RETIRED) gentoo-dev 2006-08-06 07:33:14 UTC
> - I believe the "#! /usr/bin/env tcc" should actually be "#! /usr/bin/tcc
> -run"; -run is also used in the manpage. /usr/bin/env tcc -run would be even
> better but doesn't work because of #! limitations.

I can now confirm tcc -run is required.

> - tcc doesn't seem to be compatible with glibc 2.4

With these two patches, tcc is usable with glibc 2.4:
http://lists.gnu.org/archive/html/tinycc-devel/2005-07/msg00008.html
http://lists.gnu.org/archive/html/tinycc-devel/2005-08/msg00011.html

The examples run. However, I can then get tcc to consistently segfault trying to compile itself.
Comment 4 Timothy Redaelli (RETIRED) gentoo-dev 2006-08-22 05:27:01 UTC
Created attachment 94853 [details]
tcc-0.9.23-r1.ebuild
Comment 5 Timothy Redaelli (RETIRED) gentoo-dev 2006-08-22 05:27:38 UTC
Created attachment 94854 [details, diff]
files/tcc-binutils216.patch
Comment 6 Timothy Redaelli (RETIRED) gentoo-dev 2006-08-22 05:28:39 UTC
Now it works :)
Comment 7 Harald van Dijk (RETIRED) gentoo-dev 2006-08-22 09:50:22 UTC
> Created an attachment (id=94854) [edit]
> files/tcc-binutils216.patch

> Now it works :)

Which glibc are you using? If 2.3*, you shouldn't need the above patch. If 2.4*, you should also need the other patch I mentioned in comment #3.
Comment 8 Harald van Dijk (RETIRED) gentoo-dev 2006-08-24 01:46:41 UTC
Several bugs mentioned in here are not yet fixed, but the most important ones are, the original bug is, and tcc is useable now. I think this can be closed, and if anyone (other than myself) cares about the remaining issues, a new bug can be opened.