diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-11-06 19:42:09 +0100 |
---|---|---|
committer | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-11-06 19:42:09 +0100 |
commit | 8091566352c8128612fa49c3f7dcbf0309d4f3fc (patch) | |
tree | 0d1d3d44d3618a385efbfd7a54d725eba9180e8d | |
parent | 7ddcc4c80f56eb3b8e109df823e1c764e04c5bf0 (diff) | |
download | native-toolchain-8091566352c8128612fa49c3f7dcbf0309d4f3fc.tar.gz |
native-toolchain: Build gold
Change-Id: I30109635b2806e84881094c3ba1036164aa1211d
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rwxr-xr-x | build.sh | 2 | ||||
-rw-r--r-- | tc-wrapper.c | 43 |
2 files changed, 41 insertions, 4 deletions
@@ -268,7 +268,7 @@ $SRC/binutils/binutils-$BINUTILS/configure \ --host=arm-linux-androideabi \ --enable-shared \ --disable-static \ - --disable-gold \ + --enable-gold=default \ --disable-nls make $SMP make install DESTDIR=$DEST diff --git a/tc-wrapper.c b/tc-wrapper.c index 79cc051..f714563 100644 --- a/tc-wrapper.c +++ b/tc-wrapper.c @@ -11,6 +11,7 @@ enum { CCLD = 0x4, LD = 0x8, SHLD = 0x10, + PLUSPLUS= 0x20, } mode; static const char *cpp_extras[] = { "-nostdinc", @@ -43,6 +44,10 @@ static const char *ccld_extras[] = { TCROOT "/lib/gcc/arm-linux-androideabi/" CCVERSION "/libgcc.a", DESTDIR "/system/lib/crtend_android.o" }; +static const char *ccld_extras_pp[] = { + "-lstlport", + "-lstdc++" +}; static const char *shld_extras[] = { "-nostdlib", "-L" DESTDIR "/system/lib/", @@ -62,6 +67,10 @@ static const char *shld_extras[] = { "-Wl,--no-undefined", TCROOT "/lib/gcc/arm-linux-androideabi/" CCVERSION "/libgcc.a" }; +static const char *shld_extras_pp[] = { + "-lstlport", + "-lstdc++" +}; static const char *ld_extras[] = { "-nostdlib", "-L" DESTDIR "/system/lib/", @@ -83,6 +92,10 @@ static const char *ld_extras[] = { TCROOT "/lib/gcc/arm-linux-androideabi/" CCVERSION "/libgcc.a", DESTDIR "/system/lib/crtend_android.o" }; +static const char *ld_extras_pp[] = { + "-lstlport", + "-lstdc++" +}; static const char *cc_extras[] = { "-march=armv7-a", "-mtune=cortex-a9", @@ -123,17 +136,29 @@ int main(int argc, char **argv) { break; } } + if(strstr(basetool, "++")) + mode |= PLUSPLUS; int args = argc; if(mode & CPP) args += sizeof(cpp_extras)/sizeof(char*); if(mode & CC) args += sizeof(cc_extras)/sizeof(char*); - if(mode & LD) + if(mode & LD) { args += sizeof(ld_extras)/sizeof(char*); - if(mode & CCLD) + if(mode & PLUSPLUS) + args += sizeof(ld_extras_pp)/sizeof(char*); + } + if(mode & CCLD) { args += sizeof(ccld_extras)/sizeof(char*); - if(mode & SHLD) + if(mode & PLUSPLUS) + args += sizeof(ccld_extras_pp)/sizeof(char*); + } + if(mode & SHLD) { args += sizeof(shld_extras)/sizeof(char*); + if(mode & PLUSPLUS) + args += sizeof(shld_extras_pp)/sizeof(char*); + + } char **new_argv=(char**)malloc(sizeof(char*)*(args+2)); new_argv[0]=(char*)malloc(strlen(TCROOT) + 6 + strlen(tool)); sprintf(new_argv[0], "%s/bin/%s", TCROOT, tool); @@ -151,10 +176,18 @@ int main(int argc, char **argv) { if(mode & LD) { for(int i=0; i<sizeof(ld_extras)/sizeof(char*); i++) new_argv[arg++]=ld_extras[i]; + if(mode & PLUSPLUS) { + for(int i=0; i<sizeof(ld_extras_pp)/sizeof(char*); i++) + new_argv[arg++]=ld_extras_pp[i]; + } } if(mode & CCLD) { for(int i=0; i<sizeof(ccld_extras)/sizeof(char*); i++) new_argv[arg++]=ccld_extras[i]; + if(mode & PLUSPLUS) { + for(int i=0; i<sizeof(ccld_extras_pp)/sizeof(char*); i++) + new_argv[arg++]=ccld_extras_pp[i]; + } } if(mode & SHLD) { for(int i=0; i<sizeof(shld_extras)/sizeof(char*); i++) { @@ -171,6 +204,10 @@ int main(int argc, char **argv) { } new_argv[arg++]=shld_extras[i]; } + if(mode & PLUSPLUS) { + for(int i=0; i<sizeof(shld_extras_pp)/sizeof(char*); i++) + new_argv[arg++]=shld_extras_pp[i]; + } } new_argv[arg]=0; FILE *f=fopen("/tmp/LOG", "a"); |