Add temporary C++ toolchain hack
authorHugo Villeneuve <hugo@hugovil.com>
Thu, 12 Mar 2015 02:12:07 +0000 (22:12 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Thu, 12 Mar 2015 02:16:22 +0000 (22:16 -0400)
stage2/hv-install-1
stage2/toolchain-hack-cpp-add [new file with mode: 0755]
stage2/toolchain-hack-cpp-remove [new file with mode: 0755]

index 7a6b91f..db8b333 100755 (executable)
@@ -15,6 +15,7 @@ ipkg ${GLIBC}
 ipkg -m noac -s tzdata -c ${TZDATA}
 
 rscr once "Adjusting toolchain" toolchain-adjust
+rscr once "Creating temporary C++ toolchain hack" toolchain-hack-cpp-add
 rscr mult "Testing toolchain"   toolchain-test
 
 export CC="gcc -isystem /usr/include"
@@ -34,6 +35,7 @@ unset LDFLAGS
 ipkg -m acnb ${ZLIB}
 ipkg ${BINUTILS}
 ipkg ${GCC}
+rscr once "Deleting temporary C++ toolchain hack" toolchain-hack-cpp-remove
 rscr mult "Testing toolchain" toolchain-test
 ipkg ${SED} "--bindir=/bin"
 ipkg ${LIBFFI}
diff --git a/stage2/toolchain-hack-cpp-add b/stage2/toolchain-hack-cpp-add
new file mode 100755 (executable)
index 0000000..e2de7c8
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+source ../functions/main
+
+# Temporary hack. If not, C++ programs cannot be run because
+# libstdc++ libraries are in /tools/lib, but ldd expect to find them
+# in /lib. I don't know why this is necessary now...
+cd /lib
+ln -s /tools/lib/libstdc++.so* .
+
+exit $?
diff --git a/stage2/toolchain-hack-cpp-remove b/stage2/toolchain-hack-cpp-remove
new file mode 100755 (executable)
index 0000000..231857a
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+source ../functions/main
+
+# Remove temporary toolchain hack:
+cd /lib
+rm -f libstdc++.so*
+
+exit $?