-
Notifications
You must be signed in to change notification settings - Fork 8
Compiling with tcc (ongoing)
Nat! edited this page Sep 20, 2018
·
5 revisions
On linux, tcc is unaware of where the libraries and headers are, so we ask gcc:
CC=tcc mulle-sde -v craft -- -DCFLAGS="`gcc -E -Wp,-v - 2>&1 < /dev/null | sed -n -e 's/^ /-I/p' | tr '\012' ' '`" -DCMAKE_INCLUDE_PATH="`gcc -E -Wp,-v - 2>&1 < /dev/null | sed -n -e 's/^ //p' | tr '\012' ';'`" -DCMAKE_LIBRARY_PATH="`gcc -print-search-dirs | sed -n -e 's/^libraries: *=//p' | tr ':' ';'`"
-DCMAKE_INCLUDE_PATH is kinda pointless, as we have no
find_file
statements
But crafting mulle-thread already fails at the first simple file:
Let cmake do a Release build of mulle-thread for SDK Default in "build/.buildorder/Release/mulle-thread" ...
=[33074]=> MULLE_MAKE_VERSION='0.6.1' '/usr/local/bin/cmake' -G 'Ninja' -DCMAKE_INSTALL_PREFIX:PATH='/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency.tmp' -DCMAKE_BUILD_TYPE='Release' -DCMAKE_C_FLAGS='-I/usr/lib/gcc/x86_64-linux-gnu/7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include -I'/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include'' -DCMAKE_CXX_FLAGS='-I'/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include'' -DCMAKE_SHARED_LINKER_FLAGS='-L'/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/lib'' -DCMAKE_EXE_LINKER_FLAGS='-L'/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/lib'' -DCMAKE_INCLUDE_PATH='/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include' -DCMAKE_LIBRARY_PATH='/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/lib' -DCMAKE_INCLUDE_PATH='/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include;' -DCMAKE_LIBRARY_PATH='/usr/lib/gcc/x86_64-linux-gnu/7/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/7/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/lib/../lib/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/7/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/;/lib/x86_64-linux-gnu/7/;/lib/x86_64-linux-gnu/;/lib/../lib/;/usr/lib/x86_64-linux-gnu/7/;/usr/lib/x86_64-linux-gnu/;/usr/lib/../lib/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/lib/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../;/lib/;/usr/lib/' '../../../../../../mulle-c/mulle-thread'
-- The C compiler identification is TinyCC
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- MULLE_C11_HEADER is /home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include/mulle-c11/mulle-c11.h
-- PTHREADS_LIBRARY is /usr/lib/x86_64-linux-gnu/libpthread.so
-- CMAKE_MODULE_PATH is /home/src/srcO/mulle-c/mulle-thread/cmake;/home/src/srcO/mulle-c/mulle-thread/cmake/share
-- CMAKE_BUILD_TYPE is Release
-- CMAKE_SYSTEM_NAME is Linux
-- CMAKE_LIBRARY_PATH is /home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/lib;/home/src/srcO/mulle-objc/mulle-objc-runtime/addiction/lib;/usr/lib/gcc/x86_64-linux-gnu/7/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/7/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/lib/../lib/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/7/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/;/lib/x86_64-linux-gnu/7/;/lib/x86_64-linux-gnu/;/lib/../lib/;/usr/lib/x86_64-linux-gnu/7/;/usr/lib/x86_64-linux-gnu/;/usr/lib/../lib/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/lib/;/usr/lib/gcc/x86_64-linux-gnu/7/../../../;/lib/;/usr/lib/
-- MULLE_LANGUAGE is
-- MULLE_C_COMPILER_ID is TinyCC
-- MULLE_CXX_COMPILER_ID is TinyCC
-- CMAKE_C_COMPILER_ID is TinyCC
-- CMAKE_C_FLAGS is -I/usr/lib/gcc/x86_64-linux-gnu/7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include -I/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include
-- CMAKE_CXX_COMPILER_ID is TinyCC
-- CMAKE_CXX_FLAGS is -I/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include
-- CMAKE_EXE_LINKER_FLAGS is -L/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/lib
-- CMAKE_SHARED_LINKER_FLAGS is -L/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/lib
-- CMAKE_STATIC_LINKER_FLAGS is
-- Configuring done
-- Generating done
-- Build files have been written to: /home/src/srcO/mulle-objc/mulle-objc-runtime/build/.buildorder/Release/mulle-thread
=[33074]=> MULLE_MAKE_VERSION='0.6.1' 'ninja' -v install
[1/7] /usr/local/bin/tcc -I/home/src/srcO/mulle-objc/mulle-objc-runtime/addiction/include -I/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include -I/home/src/srcO/mulle-c/mulle-thread/mintomic/include -I/home/src/srcO/mulle-c/mulle-thread/src -I/usr/lib/gcc/x86_64-linux-gnu/7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include -I/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include -DNDEBUG -o CMakeFiles/_1_mulle-thread.dir/src/linkage.c.o -c /home/src/srcO/mulle-c/mulle-thread/src/linkage.c
FAILED: CMakeFiles/_1_mulle-thread.dir/src/linkage.c.o
/usr/local/bin/tcc -I/home/src/srcO/mulle-objc/mulle-objc-runtime/addiction/include -I/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include -I/home/src/srcO/mulle-c/mulle-thread/mintomic/include -I/home/src/srcO/mulle-c/mulle-thread/src -I/usr/lib/gcc/x86_64-linux-gnu/7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include -I/home/src/srcO/mulle-objc/mulle-objc-runtime/dependency/include -DNDEBUG -o CMakeFiles/_1_mulle-thread.dir/src/linkage.c.o -c /home/src/srcO/mulle-c/mulle-thread/src/linkage.c
In file included from /home/src/srcO/mulle-c/mulle-thread/src/linkage.c:35:
In file included from /home/src/srcO/mulle-c/mulle-thread/src/mulle-thread.h:82:
In file included from /home/src/srcO/mulle-c/mulle-thread/src/mulle-atomic.h:66:
In file included from /home/src/srcO/mulle-c/mulle-thread/src/mulle-atomic-mintomic.h:42:
In file included from /usr/include/stdio.h:41:
In file included from /usr/include/x86_64-linux-gnu/bits/libio.h:53:
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h:40: error: ';' expected (got "__gnuc_va_list")
ninja: build stopped: subcommand failed.
mulle-make fatal error: make failed
There is a bug in MULLE_MAKE as the user supplied -DCMAKE_LIBRARY_PATH does not suppress the generated one (although it kinda does, through positioning)
The CMAKE_LIBRARY_PATH
is only needed for cmake to compile find_library stuff.
tcc -print-search-dirs
is he better choice instead of gcc.