diff options
Diffstat (limited to 'extra')
-rw-r--r-- | extra/gcc-uClibc/gcc-uClibc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c index 76798fee2..a5dcee31c 100644 --- a/extra/gcc-uClibc/gcc-uClibc.c +++ b/extra/gcc-uClibc/gcc-uClibc.c @@ -303,7 +303,7 @@ int main(int argc, char **argv) } } - gcc_argv = __builtin_alloca(sizeof(char*) * (argc + 20)); + gcc_argv = __builtin_alloca(sizeof(char*) * (argc + 64)); gcc_argument = __builtin_alloca(sizeof(char*) * (argc + 20)); i = 0; k = 0; @@ -354,6 +354,12 @@ int main(int argc, char **argv) } if (use_stdinc && source_count) { gcc_argv[i++] = nostdinc; + if (cplusplus) { + char *cppinc; + xstrcat(&cppinc, uClibc_inc[use_build_dir], "g++/", NULL); + gcc_argv[i++] = "-isystem"; + gcc_argv[i++] = cppinc; + } gcc_argv[i++] = "-isystem"; gcc_argv[i++] = uClibc_inc[use_build_dir]; gcc_argv[i++] = "-iwithprefix"; @@ -379,6 +385,10 @@ int main(int argc, char **argv) for ( l = 0 ; l < m ; l++ ) { if (libraries[l]) gcc_argv[i++] = libraries[l]; } + if (cplusplus) { + gcc_argv[ i++ ] = "-lstdc++"; + gcc_argv[ i++ ] = "-lm"; + } gcc_argv[i++] = "-lc"; gcc_argv[i++] = "-lgcc"; //gcc_argv[i++] = "-Wl,--end-group"; |