tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] TCC and Fedora Core 5


From: Fred Weigel
Subject: [Tinycc-devel] TCC and Fedora Core 5
Date: Fri, 27 Oct 2006 10:34:12 -0400

Folks
        
I recently migrated to FC5, and am bring over my environment. I had some
issues with TCC, but have been able to "beat it into shape". I am not
familiar with CVS and the normal dev process, but I figured I may as
well post the findings here.
        
There are a number of issues with Fedora Core 5 and TCC.
        
1 - /usr/include/bits/pthreadtypes.h" line 69
        
This error occurs because an anonymous union is being used (gcc
extension). Name the union, and the problem goes away. Change "};" to "}
__FMGW_PATCH_TCC;". If desired, I can patch TCC to support anonymous
unions, but this is probably better left to someone else.
        
2 - Linker in TCC: libc.so in FC5 uses "AS_NEEDED", which is not
supported by TCC. In tccelf.c, function tcc_load_ldscript() change the
filename loading clause (INPUT or GROUP) to:
        
        if (!strcmp(cmd, "INPUT") ||
            !strcmp(cmd, "GROUP")) {
            int paren_count = 1;
            t = ld_next(s1, cmd, sizeof(cmd));
            if (t != '(')
                expect("(");
            t = ld_next(s1, filename, sizeof(filename));
            for(;;) {
                if (t == LD_TOK_EOF) {
                    error_noabort("unexpected end of file");
                    return -1;
                } else if (t == ')') {
                    if (--paren_count == 0) {
                        break;
                    }
                    t = ld_next(s1, filename, sizeof(filename));
                    continue;
                } else if (t == '(') {
                    ++paren_count;
                    t = ld_next(s1, filename, sizeof(filename));
                    continue;
                } else if (t != LD_TOK_NAME) {
                    error_noabort("filename expected");
                    return -1;
                }
                if (strcmp(filename, "AS_NEEDED") == 0) {
                    t = ld_next(s1, filename, sizeof(filename));
                    continue;
                }
                tcc_add_file(s1, filename);
                t = ld_next(s1, filename, sizeof(filename));
                if (t == ',') {
                    t = ld_next(s1, filename, sizeof(filename));
                }
            }
        } ... rest of function ...
        
3 - TCC cannot use the "-run". The created code cannot be executed by
default in the FC5 environment. I don't have a fix for this, because I
use it as a compiler only (not a script engine).
        
Fred Weigel.
fred at weigel-mohamed dot org







reply via email to

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