summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-07-31 04:20:04 +0000
committerEric Andersen <andersen@codepoet.org>2002-07-31 04:20:04 +0000
commit38ff147a36b98d6c2e0027c0276ba92318ba2add (patch)
treeae23c415a99c0081f13e60a4d240751a7d0629f1
parentc3e08b51cba3b2b9b45c9b75f2f42ee115eeb491 (diff)
Patch from Alexander Pevzner <pzz@pzz.msk.ru> to fixup things when invoked as
the C++ compiler to to automagically add include/g++ into the include search path, and automagically add -lstdc++ and -lm into the set of automatically linked libraries.
-rw-r--r--extra/gcc-uClibc/gcc-uClibc.c12
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";