diff options
| author | bellard <bellard> | 2003-04-27 11:45:01 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2003-04-27 11:45:01 +0000 |
| commit | 2b64f2f5705384aa85b5d65c89af7c9215129917 (patch) | |
| tree | 12d8e89903e8464b5d8452c39e893f960a588807 /tcc.c | |
| parent | 7828683e609c0d2b03193a78a0aaaf9368c8f03b (diff) | |
| download | tinycc-2b64f2f5705384aa85b5d65c89af7c9215129917.tar.gz tinycc-2b64f2f5705384aa85b5d65c89af7c9215129917.tar.bz2 | |
added -nostdlib
Diffstat (limited to 'tcc.c')
| -rw-r--r-- | tcc.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -392,9 +392,9 @@ struct TCCState { /* exported dynamic symbol section */ Section *dynsym; - /* if true, no standard headers are added */ - int nostdinc; - + int nostdinc; /* if true, no standard headers are added */ + int nostdlib; /* if true, no standard libraries are added */ + /* if true, static linking is performed */ int static_link; @@ -9478,8 +9478,8 @@ int tcc_set_output_type(TCCState *s, int output_type) } /* add libc crt1/crti objects */ - if (output_type == TCC_OUTPUT_EXE || - output_type == TCC_OUTPUT_DLL) { + if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) && + !s->nostdlib) { if (output_type != TCC_OUTPUT_DLL) tcc_add_file(s, CONFIG_TCC_CRT_PREFIX "/crt1.o"); tcc_add_file(s, CONFIG_TCC_CRT_PREFIX "/crti.o"); @@ -9620,6 +9620,7 @@ enum { TCC_OPTION_m, TCC_OPTION_f, TCC_OPTION_nostdinc, + TCC_OPTION_nostdlib, TCC_OPTION_print_search_dirs, TCC_OPTION_rdynamic, TCC_OPTION_run, @@ -9653,6 +9654,7 @@ static const TCCOption tcc_options[] = { { "m", TCC_OPTION_m, TCC_OPTION_HAS_ARG }, { "f", TCC_OPTION_f, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP }, { "nostdinc", TCC_OPTION_nostdinc, 0 }, + { "nostdlib", TCC_OPTION_nostdlib, 0 }, { "print-search-dirs", TCC_OPTION_print_search_dirs, 0 }, { "v", TCC_OPTION_v, 0 }, { NULL }, @@ -9804,6 +9806,9 @@ int main(int argc, char **argv) case TCC_OPTION_nostdinc: s->nostdinc = 1; break; + case TCC_OPTION_nostdlib: + s->nostdlib = 1; + break; case TCC_OPTION_print_search_dirs: print_search_dirs = 1; break; |
