tcc.h: Extend search path for include, lib and crt
This allow the tcc cross compilers to work as expected, when tcc was build with '--enable-cross' and a simple config-extra.mak (see the provided config-extra.mak.example). Make sure, that cross development packages for libc are installed Fixes also open bugs in various bug tracker. Example in debian: 940469 tcc: error: library 'c' not found tcc: error: file 'crtn.o' not found tcc: error: undefined symbol 'printf'
This commit is contained in:
parent
fa25630ce4
commit
2507c71704
2 changed files with 34 additions and 1 deletions
27
config-extra.mak.example
Normal file
27
config-extra.mak.example
Normal file
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# during 'make', this file is included from the tcc Makefile
|
||||
#
|
||||
# this is an example, how to help tcc to find
|
||||
# the c library and the startup files for cross compiling.
|
||||
#
|
||||
# we expect here, that the GNU libc is used and that the related development files
|
||||
# are installed in a subdirectory with the target triplet used by gcc
|
||||
#
|
||||
|
||||
# set CONFIG_TRIPLET for cross compiler targets
|
||||
DEF-i386+= -UCONFIG_TRIPLET -DCONFIG_TRIPLET="\"i386-linux-gnu\" "
|
||||
DEF-x86_64+=-UCONFIG_TRIPLET -DCONFIG_TRIPLET="\"x86_64-linux-gnu\" "
|
||||
|
||||
# many api/fp combinations are possible for arm
|
||||
DEF-arm+=-UCONFIG_TRIPLET -DCONFIG_TRIPLET="\"arm-linux-gnueabihf\" "
|
||||
DEF-arm64+= -UCONFIG_TRIPLET -DCONFIG_TRIPLET="\"aarch64-linux-gnu\" "
|
||||
|
||||
DEF-riscv64+= -UCONFIG_TRIPLET -DCONFIG_TRIPLET="\"riscv64-linux-gnu\" "
|
||||
# For win32/win64 targets, we expect mingw 64
|
||||
# is is for additional packes, as tcc has ist own win32 startfiles
|
||||
DEF-i386-win32+= -UCONFIG_TRIPLET -DCONFIG_TRIPLET="\"i686-w64-mingw32\" "
|
||||
DEF-x86_64-win32+= -UCONFIG_TRIPLET -DCONFIG_TRIPLET="\"x86_64-w64-mingw32\" "
|
||||
|
||||
# is a free cross compile toolchain for macos available?
|
||||
#DEF-x86_64-osx+= -UCONFIG_TRIPLET -DCONFIG_TRIPLET="\"x86_64-apple-darwin\" "
|
||||
#DEF-arm64-osx+= -UCONFIG_TRIPLET -DCONFIG_TRIPLET="\"aarch64-apple-darwin\" "
|
8
tcc.h
8
tcc.h
|
@ -260,7 +260,9 @@ extern long double strtold (const char *__nptr, char **__endptr);
|
|||
|
||||
/* path to find crt1.o, crti.o and crtn.o */
|
||||
#ifndef CONFIG_TCC_CRTPREFIX
|
||||
# define CONFIG_TCC_CRTPREFIX USE_TRIPLET(CONFIG_SYSROOT "/usr/" CONFIG_LDDIR)
|
||||
# define CONFIG_TCC_CRTPREFIX \
|
||||
ALSO_TRIPLET(CONFIG_SYSROOT "/usr/" CONFIG_LDDIR) \
|
||||
":" USE_TRIPLET(CONFIG_SYSROOT "/usr") "/lib"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USR_INCLUDE
|
||||
|
@ -277,6 +279,8 @@ extern long double strtold (const char *__nptr, char **__endptr);
|
|||
# define CONFIG_TCC_SYSINCLUDEPATHS \
|
||||
"{B}/include" \
|
||||
":" ALSO_TRIPLET(CONFIG_SYSROOT "/usr/local/include") \
|
||||
":" USE_TRIPLET(CONFIG_SYSROOT "/usr") "/include" \
|
||||
":" USE_TRIPLET(CONFIG_SYSROOT "/usr/local") "/include" \
|
||||
":" ALSO_TRIPLET(CONFIG_SYSROOT CONFIG_USR_INCLUDE)
|
||||
# endif
|
||||
#endif
|
||||
|
@ -289,6 +293,8 @@ extern long double strtold (const char *__nptr, char **__endptr);
|
|||
# define CONFIG_TCC_LIBPATHS \
|
||||
"{B}" \
|
||||
":" ALSO_TRIPLET(CONFIG_SYSROOT "/usr/" CONFIG_LDDIR) \
|
||||
":" USE_TRIPLET(CONFIG_SYSROOT "/usr") "/lib" \
|
||||
":" USE_TRIPLET(CONFIG_SYSROOT "/usr/local") "/lib" \
|
||||
":" ALSO_TRIPLET(CONFIG_SYSROOT "/" CONFIG_LDDIR) \
|
||||
":" ALSO_TRIPLET(CONFIG_SYSROOT "/usr/local/" CONFIG_LDDIR)
|
||||
# endif
|
||||
|
|
Loading…
Reference in a new issue