tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] more 'include_next' errors (with tcc, GNU Coreutils)


From: Assaf Gordon
Subject: [Tinycc-devel] more 'include_next' errors (with tcc, GNU Coreutils)
Date: Tue, 29 Dec 2015 18:07:22 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Hello,

perhaps related to the recent similar issue with "#include_next", it seems tcc 
fails to correctly include header files (or at least behaves differently from gcc/clang).
I'm using the latest revision ( 933c2235e5c9628aa3d80145dc6ddfa4967a9d70 from 
27-dec-2015 ).


This happens with GNU coreutils (latest version from git):

    git clone git://git.sv.gnu.org/coreutils.git
    cd coreutils
    ./bootstrap
    ./configure CC=tcc
    make

fails with:
    tcc  -I. -I./lib  -Ilib -I./lib -Isrc -I./src    -g -c -o lib/getfilecon.o 
lib/getfilecon.c
    lib/getfilecon.c:36: error: invalid type
    make[2]: *** [lib/getfilecon.o] Error 1

The offending line is:

    int getfilecon (char const *file, security_context_t *con);

And the culprit is that 'security_context_t' is not defined.
digging deeper, it seems that there are few 'selinux' local headers,
that in turn include the system's header:

    $ find -name "selinux.h"
    ./src/selinux.h
    ./lib/selinux/selinux.h

Using "-E" to see what is included, these are the differences between 
tcc,gcc,clang:

=== TCC ===
$ tcc  -I. -I./lib  -Ilib -I./lib -Isrc -I./src -g -E -o tcc-getfilecon.E 
lib/getfilecon.c
$ head -n12 tcc-getfilecon.E
# 1 "lib/getfilecon.c"
# 19 "lib/getfilecon.c"
# 1 "./lib/config.h" 1
# 20 "lib/getfilecon.c" 2

# 1 "./lib/selinux/selinux.h" 1
# 28 "./lib/selinux/selinux.h"
# 1 "lib/selinux/selinux.h" 1
# 29 "./lib/selinux/selinux.h" 2
# 22 "lib/getfilecon.c" 2

=== GCC ===
$ gcc  -I. -I./lib  -Ilib -I./lib -Isrc -I./src    -g -E -o gcc-getfilecon.E 
lib/getfilecon.c
$ head -n20 gcc-getfilecon.E
# 1 "lib/getfilecon.c"
# 1 "/home/gordon/projects/coreutils//"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "lib/getfilecon.c"
# 19 "lib/getfilecon.c"
# 1 "./lib/config.h" 1
# 20 "lib/getfilecon.c" 2

# 1 "./lib/selinux/selinux.h" 1
# 28 "./lib/selinux/selinux.h"
# 1 "/usr/include/selinux/selinux.h" 1 3 4


=== CLANG ===
$ clang  -I. -I./lib  -Ilib -I./lib -Isrc -I./src    -g -E -o 
clang-getfilecon.E lib/getfilecon.c
$ head -n20 clang-getfilecon.E
# 1 "lib/getfilecon.c"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 316 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "lib/getfilecon.c" 2
# 19 "lib/getfilecon.c"
# 1 "./lib/config.h" 1
# 20 "lib/getfilecon.c" 2

# 1 "./lib/selinux/selinux.h" 1
# 28 "./lib/selinux/selinux.h"
# 1 "/usr/include/selinux/selinux.h" 1 3 4

====

So it seems that the "#include_next" in line 28 of the local 'selinux.h' 
(attached) goes to the system's header with gcc,clang but to the local one with tcc.

regards,
 - assaf




Attachment: selinux.h
Description: Text Data


reply via email to

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