mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Toolchain: Fix expansion bugs and make BuildIt.sh shellcheck compliant
BuildIt.sh had a bunch of SC2086 errors, where we were not quoting variables in variable expansions. The logic being: Quoting variables prevents word splitting and glob expansion, and prevents the script from breaking when input contains spaces, line feeds, glob characters and such. Reference: https://github.com/koalaman/shellcheck/wiki/SC2086 As bcoles noticed in #6772, shellcheck actually found a real bug here, where the user's build directory included spaces. Close: #6772
This commit is contained in:
parent
f558a44610
commit
8b856bd5a1
Notes:
sideshowbarker
2024-07-18 18:40:36 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/8b856bd5a12 Pull-request: https://github.com/SerenityOS/serenity/pull/6872 Issue: https://github.com/SerenityOS/serenity/issues/6772 Reviewed-by: https://github.com/bcoles ✅
1 changed files with 7 additions and 7 deletions
|
@ -258,8 +258,8 @@ pushd "$DIR/Build/$ARCH"
|
|||
perl -pi -e 's/-no-pie/-nopie/g' "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/configure"
|
||||
fi
|
||||
|
||||
if [ ! -f $DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity-userland.h ]; then
|
||||
cp $DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity.h $DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity-kernel.h
|
||||
if [ ! -f "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity-userland.h" ]; then
|
||||
cp "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity.h" "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity-kernel.h"
|
||||
fi
|
||||
|
||||
for STAGE in Userland Kernel; do
|
||||
|
@ -277,9 +277,9 @@ pushd "$DIR/Build/$ARCH"
|
|||
REALTARGET="$PREFIX/Kernel"
|
||||
fi
|
||||
|
||||
cp $DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity-kernel.h $DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity.h
|
||||
cp "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity-kernel.h" "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity.h"
|
||||
if [ "$STAGE" = "Userland" ]; then
|
||||
sed -i='' 's@-fno-exceptions @@' $DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity.h
|
||||
sed -i='' 's@-fno-exceptions @@' "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/config/serenity.h"
|
||||
fi
|
||||
|
||||
buildstep "gcc/configure/${STAGE,,}" "$DIR/Tarballs/gcc-$GCC_VERSION/configure" --prefix="$PREFIX" \
|
||||
|
@ -302,16 +302,16 @@ pushd "$DIR/Build/$ARCH"
|
|||
fi
|
||||
buildstep "libgcc/build" "$MAKE" -j "$MAKEJOBS" all-target-libgcc || exit 1
|
||||
echo "XXX install gcc and libgcc"
|
||||
buildstep "gcc+libgcc/install" "$MAKE" DESTDIR=$TEMPTARGET install-gcc install-target-libgcc || exit 1
|
||||
buildstep "gcc+libgcc/install" "$MAKE" DESTDIR="$TEMPTARGET" install-gcc install-target-libgcc || exit 1
|
||||
fi
|
||||
|
||||
echo "XXX build libstdc++"
|
||||
buildstep "libstdc++/build/${STAGE,,}" "$MAKE" -j "$MAKEJOBS" all-target-libstdc++-v3 || exit 1
|
||||
echo "XXX install libstdc++"
|
||||
buildstep "libstdc++/install/${STAGE,,}" "$MAKE" DESTDIR=$TEMPTARGET install-target-libstdc++-v3 || exit 1
|
||||
buildstep "libstdc++/install/${STAGE,,}" "$MAKE" DESTDIR="$TEMPTARGET" install-target-libstdc++-v3 || exit 1
|
||||
|
||||
mkdir -p "$REALTARGET"
|
||||
cp -a $TEMPTARGET/$PREFIX/* "$REALTARGET/"
|
||||
cp -a "$TEMPTARGET"/"$PREFIX"/* "$REALTARGET/"
|
||||
rm -rf "$TEMPTARGET"
|
||||
popd
|
||||
|
||||
|
|
Loading…
Reference in a new issue