Skip to content

Commit

Permalink
another temp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ParkMyCar committed Aug 31, 2024
1 parent 81128f8 commit ca2f1dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sysroot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ RUN make install all-target-libgfortran
RUN make install all-target-libstdc++-v3

FROM gcc as gcc_pruned
RUN --mount=source=prune_gcc.sh,target=/usr/bin/prune_gcc.sh prune_gcc.sh "${LIBSTDCXX_VERSION}" "${LIBSTDCXX_MAJOR}"
RUN --mount=source=prune_gcc.sh,target=/usr/bin/prune_gcc.sh prune_gcc.sh

####################################################################################################
# Assemble final sysroots
Expand Down
15 changes: 6 additions & 9 deletions sysroot/prune_gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@

set -eux

LIBSTDCXX_VERSION=$1
LIBSTDCXX_MAJOR=$2

rm -rf /var/buildlibs/gcc/bin
rm -rf /var/buildlibs/gcc/usr/bin
rm -rf /var/buildlibs/gcc/libexec
rm -rf /var/buildlibs/gcc/share

if [ "$ARCH" == 'x86_64' ]; then
mv /var/buildlibs/gcc/lib/gcc/${ARCH}-linux /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu
mv /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu/${LIBSTDCXX_VERSION} /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu/${LIBSTDCXX_MAJOR}
mv /var/buildlibs/gcc/include/c++/${LIBSTDCXX_VERSION} /var/buildlibs/gcc/include/c++/${LIBSTDCXX_MAJOR}
mv /var/buildlibs/gcc/include/c++/${LIBSTDCXX_MAJOR}/${ARCH}-linux /var/buildlibs/gcc/include/c++/${LIBSTDCXX_MAJOR}/${ARCH}-linux-gnu
mv /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu/11.4.0 /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu/11
mv /var/buildlibs/gcc/include/c++/11.4.0 /var/buildlibs/gcc/include/c++/11
mv /var/buildlibs/gcc/include/c++/11/${ARCH}-linux /var/buildlibs/gcc/include/c++/11/${ARCH}-linux-gnu
elif [ "$ARCH" == 'aarch64' ]; then
mv /var/buildlibs/gcc/lib/gcc/${ARCH}-linux /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu
mv /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu/${LIBSTDCXX_VERSION} /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu/${LIBSTDCXX_MAJOR}
mv /var/buildlibs/gcc/${ARCH}-linux/include/c++/${LIBSTDCXX_VERSION} /var/buildlibs/gcc/${ARCH}-linux/include/c++/${LIBSTDCXX_MAJOR}
mv /var/buildlibs/gcc/${ARCH}-linux/include/c++/${LIBSTDCXX_MAJOR}/${ARCH}-linux /var/buildlibs/gcc/${ARCH}-linux/include/c++/${LIBSTDCXX_MAJOR}/${ARCH}-linux-gnu
mv /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu/11.4.0 /var/buildlibs/gcc/lib/gcc/${ARCH}-linux-gnu/11
mv /var/buildlibs/gcc/${ARCH}-linux/include/c++/11.4.0 /var/buildlibs/gcc/${ARCH}-linux/include/c++/11
mv /var/buildlibs/gcc/${ARCH}-linux/include/c++/11/${ARCH}-linux /var/buildlibs/gcc/${ARCH}-linux/include/c++/11/${ARCH}-linux-gnu
mv /var/buildlibs/gcc/${ARCH}-linux/include/c++ /var/buildlibs/gcc/include/c++
mv /var/buildlibs/gcc/${ARCH}-linux/lib64/* /var/buildlibs/gcc/lib64/
rm -r /var/buildlibs/gcc/${ARCH}-linux
Expand Down

0 comments on commit ca2f1dd

Please sign in to comment.