diff --git a/board/alix/libgcc_files.txt b/board/alix/libgcc_files.txt deleted file mode 100644 index df2cb01..0000000 --- a/board/alix/libgcc_files.txt +++ /dev/null @@ -1,20 +0,0 @@ -lib/libatomic.so -lib/libatomic.so.1 -lib/libatomic.so.1.2.0 -lib/libcilkrts.so -lib/libcilkrts.so.5 -lib/libcilkrts.so.5.0.0 -lib/libgcc_s.so -lib/libgcc_s.so.1 -lib/libgomp.so -lib/libgomp.so.1 -lib/libgomp.so.1.0.0 -lib/libitm.so -lib/libitm.so.1 -lib/libitm.so.1.0.0 -lib/libquadmath.so -lib/libquadmath.so.0 -lib/libquadmath.so.0.0.0 -lib/libstdc++.so.6.0.24 -lib/libstdc++.so -lib/libstdc++.so.6 diff --git a/board/rpi3/libgcc_files.txt b/board/rpi3/libgcc_files.txt deleted file mode 100644 index 0176b7a..0000000 --- a/board/rpi3/libgcc_files.txt +++ /dev/null @@ -1,17 +0,0 @@ -lib/libatomic.so -lib/libatomic.so.1 -lib/libatomic.so.1.2.0 -lib/libcilkrts.so -lib/libcilkrts.so.5 -lib/libcilkrts.so.5.0.0 -lib/libgcc_s.so -lib/libgcc_s.so.1 -lib/libgomp.so -lib/libgomp.so.1 -lib/libgomp.so.1.0.0 -lib/libitm.so -lib/libitm.so.1 -lib/libitm.so.1.0.0 -lib/libstdc++.so -lib/libstdc++.so.6 -lib/libstdc++.so.6.0.24 diff --git a/pkg/tc-gcc2/build b/pkg/tc-gcc2/build index 97b0094..0161cb7 100755 --- a/pkg/tc-gcc2/build +++ b/pkg/tc-gcc2/build @@ -1,6 +1,6 @@ # inherit package details from first stage GCC source "$SCRIPTDIR/pkg/tc-gcc1/build" -DEPENDS="tc-gcc1 tc-musl" +DEPENDS="tc-gcc1 tc-musl tc-linux_hdr" build() { local INPUT="$1" @@ -21,5 +21,38 @@ build() { } deploy() { + local SOURCE="$1" + local BUILD="$2" + local DEPLOY="$3" + local DEVDEPLOY="$4" + make install + + local f dep + + for f in $(ls ${TCDIR}/${TARGET}/include); do + for dep in $DEPENDS; do + if [ -e ${PKGDEPLOYDIR}/${dep}-dev/include/$f ]; then + rm -rf "$TCDIR/$TARGET/include/$f" + fi + done + done + + for f in $(ls ${TCDIR}/${TARGET}/lib); do + for dep in $DEPENDS; do + if [ -e ${PKGDEPLOYDIR}/${dep}-dev/lib/$f ]; then + rm -rf "$TCDIR/$TARGET/lib/$f" + continue + fi + if [ -e ${PKGDEPLOYDIR}/${dep}/lib/$f ]; then + rm -rf "$TCDIR/$TARGET/lib/$f" + fi + done + done + + mkdir -p "$DEPLOY/lib" + mv ${TCDIR}/${TARGET}/{include,lib} "$DEVDEPLOY" + rm ${DEVDEPLOY}/lib/*.la + mv ${DEVDEPLOY}/lib/*.so* "$DEPLOY/lib" + mv ${DEPLOY}/lib/*.py "$DEVDEPLOY/lib" } diff --git a/pkg/tc-linux_hdr/build b/pkg/tc-linux_hdr/build index b72e502..4e7b322 100755 --- a/pkg/tc-linux_hdr/build +++ b/pkg/tc-linux_hdr/build @@ -13,7 +13,9 @@ build() { deploy() { local INPUT="$1" local OUTPUT="$2" + local DEPLOY="$3" + local DEVDEPLOY="$4" export KBUILD_OUTPUT="$OUTPUT" - make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" INSTALL_HDR_PATH="$TCDIR/$TARGET" headers_install + make -C "$INPUT" O="$OUTPUT" ARCH="$LINUX_CPU" INSTALL_HDR_PATH="$DEVDEPLOY" headers_install } diff --git a/pkg/tc-musl/build b/pkg/tc-musl/build index 46a23eb..925c227 100755 --- a/pkg/tc-musl/build +++ b/pkg/tc-musl/build @@ -3,7 +3,7 @@ SRCDIR="musl-$VERSION" TARBALL="$SRCDIR.tar.gz" URL="https://www.musl-libc.org/releases" SHA256SUM="d017ee5d01aec0c522a1330fdff06b1e428cb409e1db819cc4935d5da4a5a118" -DEPENDS="tc-gcc1" +DEPENDS="tc-gcc1 tc-linux_hdr" prepare() { return @@ -21,8 +21,12 @@ deploy() { local INPUT="$1" local OUTPUT="$2" local DEPLOY="$3" + local DEVDEPLOY="$4" + + DESTDIR="$DEVDEPLOY" make install-headers + DESTDIR="$DEVDEPLOY" make install-libs + rm $DEVDEPLOY/lib/*.so* - DESTDIR="$TCDIR/$TARGET" make install DESTDIR="$DEPLOY" make install-libs rm $DEPLOY/lib/*.a $DEPLOY/lib/*.o diff --git a/pkg/toolchain/build b/pkg/toolchain/build index 14880b0..6a0f0fc 100755 --- a/pkg/toolchain/build +++ b/pkg/toolchain/build @@ -1,4 +1,4 @@ -DEPENDS="tc-gcc2 tc-musl tc-pkg-config tc-file" +DEPENDS="tc-gcc2 tc-musl tc-linux_hdr tc-pkg-config tc-file" build() { return @@ -9,9 +9,6 @@ deploy() { local OUTPUT="$2" local DEPLOY="$3" - rsync -aH --files-from="$SCRIPTDIR/board/$BOARD/libgcc_files.txt" \ - "$TCDIR/$TARGET" "$DEPLOY" - gen_cmake_toolchain_file save_toolchain } diff --git a/util/toolchain.sh b/util/toolchain.sh index adc7287..01c9f49 100644 --- a/util/toolchain.sh +++ b/util/toolchain.sh @@ -7,12 +7,12 @@ save_toolchain() { } restore_toolchain() { + pushd "$TCDIR/$TARGET" > /dev/null + rm -rf include lib if [ -e "${TCDIR}/${TARGET}.tar.gz" ]; then - pushd "$TCDIR/$TARGET" > /dev/null - rm -r include lib tar zxf "${TCDIR}/${TARGET}.tar.gz" - popd > /dev/null fi + popd > /dev/null } install_build_deps() {