From 569255e6c40f45a0d78b409c05353d4c1de6ca43 Mon Sep 17 00:00:00 2001 From: grischka Date: Thu, 23 Feb 2017 08:41:57 +0100 Subject: cross-compilers: allow individual configuration since configure supports only native configuration a file 'cross-tcc.mak' needs to be created manually. It is included in the Makefile if present. # ---------------------------------------------------- # Example config-cross.mak: # # windows -> i386-linux cross-compiler # (it expects the linux files in /i386-linux) ROOT-i386 = {B}/i386-linux CRT-i386 = $(ROOT-i386)/usr/lib LIB-i386 = $(ROOT-i386)/lib:$(ROOT-i386)/usr/lib INC-i386 = {B}/lib/include:$(ROOT-i386)/usr/include DEF-i386 += -D__linux__ # ---------------------------------------------------- Also: - use libtcc1-.a instead of directories - add dummy arm assembler - remove include dependencies from armeabi.c/lib-arm64.c - tccelf/ld_add_file: add SYSROOT (when defined) to absolute filenames coming from ld-scripts --- tccpe.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tccpe.c') diff --git a/tccpe.c b/tccpe.c index 50690df..287eb99 100644 --- a/tccpe.c +++ b/tccpe.c @@ -1905,15 +1905,17 @@ static void pe_add_runtime(TCCState *s1, struct pe_info *pe) if (0 == s1->nostdlib) { static const char *libs[] = { - "tcc1", "msvcrt", "kernel32", "", "user32", "gdi32", NULL + TCC_LIBTCC1, "msvcrt", "kernel32", "", "user32", "gdi32", NULL }; const char **pp, *p; for (pp = libs; 0 != (p = *pp); ++pp) { if (0 == *p) { if (PE_DLL != pe_type && PE_GUI != pe_type) break; - } else if (tcc_add_library_err(s1, p) < 0) { - break; + } else if (pp == libs && tcc_add_dll(s1, p, 0) >= 0) { + continue; + } else { + tcc_add_library_err(s1, p); } } } -- cgit v1.3.1