diff options
author | Miles Bader <miles@lsi.nec.co.jp> | 2002-10-23 05:06:03 +0000 |
---|---|---|
committer | Miles Bader <miles@lsi.nec.co.jp> | 2002-10-23 05:06:03 +0000 |
commit | 27e47143db2f0b85fae8203625895c7e4bf71a75 (patch) | |
tree | 435a4e8fd5bef5b1391ccbfc3e87a64d45947d71 | |
parent | 4c593181389b86bc184bdbf2b09dfdadd57b9c71 (diff) |
Make `-nostdlib' and `-nodefaultlibs' work correctly.
-rw-r--r-- | extra/gcc-uClibc/gcc-uClibc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c index 13049d17d..24f49d216 100644 --- a/extra/gcc-uClibc/gcc-uClibc.c +++ b/extra/gcc-uClibc/gcc-uClibc.c @@ -263,6 +263,7 @@ int main(int argc, char **argv) use_start = 0; } else if (strcmp(nodefaultlibs,argv[i]) == 0) { use_stdlib = 0; + argv[i] = '\0'; } else if (strcmp(nostdlib,argv[i]) == 0) { use_start = 0; use_stdlib = 0; @@ -339,9 +340,7 @@ int main(int argc, char **argv) #if defined HAVE_ELF && ! defined HAS_MMU gcc_argv[i++] = "-Wl,-elf2flt"; #endif - if (use_stdlib) { - gcc_argv[i++] = nostdlib; - } + gcc_argv[i++] = nostdlib; if (use_static_linking) { gcc_argv[i++] = static_linking; } @@ -406,9 +405,11 @@ int main(int argc, char **argv) if (use_stdlib) { //gcc_argv[i++] = "-Wl,--start-group"; gcc_argv[i++] = "-lgcc"; - for ( l = 0 ; l < m ; l++ ) { - if (libraries[l]) gcc_argv[i++] = libraries[l]; - } + } + for ( l = 0 ; l < m ; l++ ) { + if (libraries[l]) gcc_argv[i++] = libraries[l]; + } + if (use_stdlib) { if (cplusplus) { gcc_argv[ i++ ] = "-lstdc++"; gcc_argv[ i++ ] = "-lm"; |