diff --git a/libtcc.c b/libtcc.c index f97336e..4a4ca66 100644 --- a/libtcc.c +++ b/libtcc.c @@ -971,6 +971,13 @@ LIBTCCAPI TCCState *tcc_new(void) tcc_add_library_path(s, CONFIG_TCC_CRT_PREFIX); tcc_add_library_path(s, CONFIG_SYSROOT CONFIG_TCC_LDDIR); tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local"CONFIG_TCC_LDDIR); +# if defined(__linux) +# ifdef TCC_TARGET_I386 + tcc_add_library_path(s, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX"/i386-linux-gnu"); +# elif defined (TCC_TARGET_X86_84) + tcc_add_library_path(s, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX"/x86_64-linux-gnu"); +# endif +# endif #endif /* no section zero */ @@ -1284,6 +1291,11 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) #ifndef TCC_TARGET_PE tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/local/include"); tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/include"); +# ifdef TCC_TARGET_I386 + tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/include/i386-linux-gnu"); +# elif defined (TCC_TARGET_X86_84) + tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/include/x86_64-linux-gnu)"); +# endif #endif snprintf(buf, sizeof(buf), "%s/include", s->tcc_lib_path); tcc_add_sysinclude_path(s, buf);