summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Hill <ahill@breadpudding.dev>2025-04-12 22:09:50 -0400
committerAlexander Hill <ahill@breadpudding.dev>2025-04-12 22:09:50 -0400
commit04cd50fa9e083e5d83ad7b299bb3cca0c54b517a (patch)
tree231f4fa9124b43a5bbf075c8e28cb98e3fd014f9
parentd4c6e54f38d6d97ba08bf37c05a4f4106dc01373 (diff)
Fixed sysroot and added skylake optimizations
-rwxr-xr-xbuild-bootstrap.sh72
1 files changed, 36 insertions, 36 deletions
diff --git a/build-bootstrap.sh b/build-bootstrap.sh
index 1d78ad3..c5feabe 100755
--- a/build-bootstrap.sh
+++ b/build-bootstrap.sh
@@ -78,7 +78,7 @@ cd ..
export CC="$MAPLE/maple/tools/bin/clang"
export CXX="$MAPLE/maple/tools/bin/clang++"
-export CFLAGS="--sysroot=$MAPLE"
+export CFLAGS="-O3 -march=skylake -pipe --sysroot=$MAPLE"
export CXXFLAGS="$CFLAGS"
export LD=$MAPLE/maple/tools/bin/ld.lld
export PATH="$MAPLE/maple/tools/bin:$PATH"
@@ -278,11 +278,43 @@ make -j $THREAD
make -j $THREAD install DESTDIR=$MAPLE
cd ..
-# Clear compiler flags to avoid potentially issues with the LLVM build
-export CFLAGS=""
-export CXXFLAGS=""
+# CMake Build
+tar xf ../sources/cmake-*.tar*
+cd cmake-*/
+# NOTE: Tests are disabled because they attempt to run on the system responsible
+# for the build, not the system being built. ~ahill
+cmake -B build -G Ninja \
+ -DBUILD_TESTING=OFF \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_C_COMPILER=$CC \
+ -DCMAKE_CXX_COMPILER=$CXX \
+ -DCMAKE_INSTALL_PREFIX=$MAPLE/usr \
+ -DCMAKE_SYSROOT=$MAPLE \
+ -DCMAKE_USE_OPENSSL=OFF
+cmake --build build
+cmake --install build
+cd ..
+
+# Gawk Build
+tar xf ../sources/gawk-*.tar*
+cd gawk-*/
+./configure \
+ --disable-mpfr \
+ --disable-nls \
+ --exec-prefix="" \
+ --libexecdir=/lib \
+ --localstatedir=/var \
+ --prefix=/usr \
+ --sysconfdir=/etc
+make -j $THREADS
+make -j $THREADS install DESTDIR=$MAPLE
+cd ..
# LLVM Build (Stage 2)
+# NOTE: We are removing the sysroot option from CFLAGS and CXXFLAGS to prevent a
+# potential conflict with CMake. Adapted from Nick's contribution. ~ahill
+export CFLAGS=$(echo $CFLAGS | sed "s/--sysroot=\S*//")
+export CXXFLAGS=$(echo $CXXFLAGS | sed "s/--sysroot=\S*//")
tar xf ../sources/llvm-project-*.tar*
cd llvm-project-*/
TOOLCHAIN_FILE=$HOST-maple-clang.cmake
@@ -338,35 +370,3 @@ ln -s clang $MAPLE/bin/cc
ln -s clang++ $MAPLE/bin/c++
ln -s ld.lld $MAPLE/bin/ld
cd ..
-
-# CMake Build
-tar xf ../sources/cmake-*.tar*
-cd cmake-*/
-# NOTE: Tests are disabled because they attempt to run on the system responsible
-# for the build, not the system being built. ~ahill
-cmake -B build -G Ninja \
- -DBUILD_TESTING=OFF \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_C_COMPILER=$CC \
- -DCMAKE_CXX_COMPILER=$CXX \
- -DCMAKE_INSTALL_PREFIX=$MAPLE/usr \
- -DCMAKE_SYSROOT=$MAPLE \
- -DCMAKE_USE_OPENSSL=OFF
-cmake --build build
-cmake --install build
-cd ..
-
-# Gawk Build
-tar xf ../sources/gawk-*.tar*
-cd gawk-*/
-./configure \
- --disable-mpfr \
- --disable-nls \
- --exec-prefix="" \
- --libexecdir=/lib \
- --localstatedir=/var \
- --prefix=/usr \
- --sysconfdir=/etc
-make -j $THREADS
-make -j $THREADS install DESTDIR=$MAPLE
-cd ..