attr built

This commit is contained in:
Denis Benato 2024-12-07 17:57:57 +01:00
parent 779959bf5c
commit 1fc2e0af3e

113
build.sh
View file

@ -202,6 +202,8 @@ export AS="$LFS_TGT-as"
export LD="$LFS_TGT-ld"
export AR="$LFS_TGT-ar"
export RANLIB="$LFS_TGT-ranlib"
export STRIP="$LFS_TGT-strip"
export OBJDUMP="$LFS_TGT-objdump"
# remove hardening options for building libraries
export CFLAGS="-U_FORTIFY_SOURCE -O2"
export CPPFLAGS="-U_FORTIFY_SOURCE -O2"
@ -295,6 +297,7 @@ unset LD
unset AS
unset AR
unset RANLIB
unset STRIP
unset OBJDUMP
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH_old"
@ -396,7 +399,27 @@ if [ ! -f "$STEPS_DIR/gcc-step3" ]; then
fi
cd "$LFS_BUILD/gcc/build"
make -j 32 all
"../configure" \
--target=$LFS_TGT \
--host=$(../config.guess) \
--build=$(../config.guess) \
--prefix=$LFS_TOOLS \
--with-glibc-version=2.40 \
--with-sysroot=$LFS \
--enable-c99 \
--enable-long-long \
--enable-default-pie \
--enable-default-ssp \
--disable-nls \
--disable-multilib \
--disable-libgomp \
--disable-libquadmath \
--disable-libquadmath-support \
--disable-decimal-float \
--enable-languages=c,c++
# Reebuild everything now that we have bootstrapped an initial gcc and glibc
make -j 32 # if build fails add --disable-libsanitizer
make -j 32 install
cd "$BASE_DIR"
@ -406,34 +429,72 @@ fi
# test the cross toolchain
which -- $LFS_TGT-as || echo $LFS_TGT-as is not in the PATH
echo 'int main(){}' | "$LFS_TGT-gcc" -xc -
"$LFS_TGT-readelf" -l a.out > test_compiler
cat test_compiler | grep ld-linux
rm -v a.out test_compiler
#cat test_compiler.cpp | "$LFS_TGT-g++" -xc -
#"$LFS_TGT-readelf" -l a.out > test_compiler
#cat test_compiler | grep ld-linux
#rm -v a.out test_compiler
# build m4
#if [ ! -f "$STEPS_DIR/m4" ]; then
# if [ ! -d "$LFS_BUILD/m4" ]; then
# tar -xzf "$BASE_DIR/sources/m4-1.4.19.tar.gz"
# mv "m4-1.4.19" "$LFS_BUILD/m4"
# fi
# cd "$LFS_BUILD/m4"
#
# #mkdir -vp build
# #cd build
#
# echo "rootsbindir=/usr/sbin" > configparms
#
# "./configure" \
# --prefix=/usr \
# --target=$LFS_TGT \
# --host=$(build-aux/config.guess) \
# --build=$(build-aux/config.guess) \
#
# make -j 32
# make DESTDIR=$LFS install
#
# cd "$BASE_DIR"
# rm -rf "$LFS_BUILD/m4"
# touch "$STEPS_DIR/m4"
#fi
if [ ! -f "$STEPS_DIR/m4" ]; then
if [ ! -d "$LFS_BUILD/m4" ]; then
tar -xzf "$BASE_DIR/sources/m4-1.4.19.tar.gz"
mv "m4-1.4.19" "$LFS_BUILD/m4"
fi
cd "$LFS_BUILD/m4"
mkdir -vp build
cd build
echo "rootsbindir=/usr/sbin" > configparms
"../configure" \
--prefix=/usr \
--target=$LFS_TGT \
--host=$(build-aux/config.guess) \
--build=$(build-aux/config.guess) \
make -j 32
make DESTDIR=$LFS install
"$LFS_TGT-strip" --strip-unneeded $LFS/bin/m4
cd "$BASE_DIR"
rm -rf "$LFS_BUILD/m4"
touch "$STEPS_DIR/m4"
fi
# build attr
if [ ! -f "$STEPS_DIR/attr" ]; then
if [ ! -d "$LFS_BUILD/attr" ]; then
tar -xzf "$BASE_DIR/sources/attr-2.5.2.tar.gz"
mv "attr-2.5.2" "$LFS_BUILD/attr"
fi
cd "$LFS_BUILD/attr"
mkdir -vp build
cd build
echo "rootsbindir=/usr/sbin" > configparms
"../configure" \
--prefix=/usr \
--disable-static \
--target=$LFS_TGT \
--host=$(build-aux/config.guess) \
--build=$(build-aux/config.guess) \
make -j 32
make DESTDIR=$LFS install
cd "$BASE_DIR"
touch "$STEPS_DIR/attr"
fi
# Right now I have no idea if g++ will build crap.