CoreMarkPro Linux Cross-Compiler gcc 4.7.2 error size_t

284 views
Skip to first unread message

samfisc...@gmail.com

unread,
Jan 25, 2016, 12:35:01 PM1/25/16
to EEMBC CoreMark Public Group
Hallo,

someone can help me to solve my problem ? I try to compile a 32-Bit Linux Version of CoreMark Pro with a cross-compiler who is running on a 64-Bit Linux. The compiler version is gcc 4.7.2


I try to compile it with make TARGET=linux32-x86 TOOLCHAIN=gcc-cross-linux

I made some changes in in the gcc-cross-linux.mak to solve some problems:
I chanced the tools root directory  ->
        TOOLS = /home/buildroot/x-tools/i686-unknown-linux-gnu
        TPREF = i686-unknown-linux-gnu-
Added a compiler flag   ->
        COMPILER_FLAGS = -g -m32 -std=c99 -O2 $(CDEFN)NDEBUG $(CDEFN)HOST_EXAMPLE_CODE=1
made some Includes  ->
        COMPILER_INCLUDES += $(TOOLS)/i686-unknown-linux-gnu/sysroot/usr/include/linux

Now when I typing in make TARGET=linux32-x86 TOOLCHAIN=gcc-cross-linux i get an error I don't understand.

make -I/home/k0912330/prj/coremark-pro_1.1.2470/util/make -f Makefile.mak TARGET=linux32-x86 workloads/sets/workload-joins.fp1
make[1]: Entering directory `/home/k0912330/prj/coremark-pro_1.1.2470'
make[1]: Nothing to be done for `workloads/sets/workload-joins.fp1'.
make[1]: Leaving directory `/home/k0912330/prj/coremark-pro_1.1.2470'
make -I/home/k0912330/prj/coremark-pro_1.1.2470/util/make -f Makefile.mak TARGET=linux32-x86 Makefile
make[1]: Entering directory `/home/k0912330/prj/coremark-pro_1.1.2470'
make[1]: Nothing to be done for `Makefile'.
make[1]: Leaving directory `/home/k0912330/prj/coremark-pro_1.1.2470'
make -I/home/k0912330/prj/coremark-pro_1.1.2470/util/make -f Makefile.mak all
make[1]: Entering directory `/home/k0912330/prj/coremark-pro_1.1.2470'
mkdir -p /home/k0912330/prj/coremark-pro_1.1.2470/builds/linux/gcc-cross-linux/obj/mith
make -C /home/k0912330/prj/coremark-pro_1.1.2470/builds/linux/gcc-cross-linux/obj/mith -f /home/k0912330/prj/coremark-pro_1.1.2470/mith/Makefile all
make[2]: Entering directory `/home/k0912330/prj/coremark-pro_1.1.2470/builds/linux/gcc-cross-linux/obj/mith'
mkdir -p src
mkdir -p al/src
/home/buildroot/x-tools/i686-unknown-linux-gnu/bin/i686-unknown-linux-gnu-gcc -c  -g -m32 -std=c99 -O2 -D NDEBUG -D HOST_EXAMPLE_CODE=1 -D HAVE_SYS_STAT_H=1 -D USE_NATIVE_PTHREAD=1 -D GCC_INLINE_MACRO=1 -D HAVE_SYS_STAT_H=1 -D USE_NATIVE_PTHREAD=1 -D GCC_INLINE_MACRO=1   -Wall -Wno-long-long -fno-asm -fsigned-char      -I /home/k0912330/prj/coremark-pro_1.1.2470/mith/include -I /home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include -I /home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include -I /home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/linux -I /home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/linux /home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c -o  src/md5.o
In file included from /home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/stdio.h:75:0,
                 from /home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include/th_al.h:42,
                 from /home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:54,
                 from /home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c:29:
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/libio.h:334:3: error: unknown type name 'size_t'
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/libio.h:338:67: error: 'size_t' undeclared here (not in a function)
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/libio.h:366:62: error: expected declaration specifiers or '...' before 'size_t'
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/libio.h:375:6: error: expected declaration specifiers or '...' before 'size_t'
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/libio.h:497:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_IO_sgetn'
In file included from /home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include/th_al.h:42:0,
                 from /home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:54,
                 from /home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c:29:
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/stdio.h:334:20: error: expected declaration specifiers or '...' before 'size_t'
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/stdio.h:383:44: error: expected declaration specifiers or '...' before 'size_t'
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/stdio.h:387:45: error: expected declaration specifiers or '...' before 'size_t'
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/stdio.h:702:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
/home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/stdio.h:708:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite'
In file included from /home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:54:0,
                 from /home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c:29:
/home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include/th_al.h:76:2: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include/th_al.h:77:2: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include/th_al.h:79:2: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include/th_al.h:80:2: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include/th_al.h:98:2: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/al/include/th_al.h:99:71: error: expected declaration specifiers or '...' before 'size_t'
In file included from /home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c:29:0:
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:130:4: error: expected specifier-qualifier-list before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:168:28: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:172:20: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:174:20: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:174:34: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:176:32: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:185:28: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:185:41: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:193:47: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:197:48: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:199:1: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:201:43: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:202:44: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:203:33: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:204:47: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:205:1: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:206:1: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:224:1: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:225:1: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:226:1: error: unknown type name 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:247:43: error: expected declaration specifiers or '...' before 'size_t'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:295:39: error: expected declaration specifiers or '...' before 'size_t'
In file included from /home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c:29:0:
/home/k0912330/prj/coremark-pro_1.1.2470/mith/include/th_lib.h:425:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'BlockSize'
/home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c: In function 'MD5CRC':
/home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c:65:2: warning: implicit declaration of function 'th_crcbuffer' [-Wimplicit-function-declaration]
/home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c: In function 'MD5Update':
/home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c:107:6: warning: implicit declaration of function 'th_memcpy' [-Wimplicit-function-declaration]
/home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c: In function 'MD5Final':
/home/k0912330/prj/coremark-pro_1.1.2470/mith/src/md5.c:154:2: warning: implicit declaration of function 'th_memset' [-Wimplicit-function-declaration]
make[2]: *** [src/md5.o] Error 1
make[2]: Leaving directory `/home/k0912330/prj/coremark-pro_1.1.2470/builds/linux/gcc-cross-linux/obj/mith'
make[1]: *** [/home/k0912330/prj/coremark-pro_1.1.2470/builds/linux/gcc-cross-linux/obj/mith.a] Error 2
make[1]: Leaving directory `/home/k0912330/prj/coremark-pro_1.1.2470'
make: *** [all] Error 2


The error: unknown type name 'size_t' confuses me, because in the COMPILER_INCLUDES there is the header file where "sitze_t" should be declared .... ?

Would be awesome when someone can help me out ...

Thank you for the help
regards Sam




samfisc...@gmail.com

unread,
Jan 26, 2016, 10:25:37 AM1/26/16
to EEMBC CoreMark Public Group
I just found out what the Problem is ... the header-file types.h in the directory /home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/linux causes the Problem. I found types.h in the following directory too  --> /home/buildroot/x-tools/i686-unknown-linux-gnu/i686-unknown-linux-gnu/sysroot/usr/include/asm-generic

I chanced the Compiler Includes to:
COMPILER_INCLUDES += $(TOOLS)/i686-unknown-linux-gnu/sysroot/usr/include/asm-generic
and the "size_t" Problem was gone ...

But now the "timer.h" Compiler-Include was missing. So I simply added "timer.h" in one of the Include folders form the CoreMarkPro project (coremark-pro_1.1.2470\mith\include\)

 
Not a very nice solution, but it worked for me ...

regards Sam
Reply all
Reply to author
Forward
0 new messages