Improve toolchain tester
This commit is contained in:
parent
82c3bad5ad
commit
bb5724caa6
1 changed files with 12 additions and 13 deletions
25
build.sh
25
build.sh
|
|
@ -428,32 +428,31 @@ fi
|
|||
|
||||
# Use the new toolchain
|
||||
export BUILD_CC=gcc
|
||||
export CC="$LFS_TGT-gcc -L$LFS_TOOLS/usr/lib -I$LFS_TOOLS/include -I$LFS_TOOLS/$LFS_TGT/include"
|
||||
export CXX="$LFS_TGT-g++ -L$LFS_TOOLS/usr/lib -I$LFS_TOOLS/include -I$LFS_TOOLS/$LFS_TGT/include"
|
||||
export CC="$LFS_TGT-gcc"
|
||||
export CXX="$LFS_TGT-g++"
|
||||
export AS="$LFS_TGT-as"
|
||||
export LD="$LFS_TGT-ld -L$LFS_TOOLS/usr/lib"
|
||||
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"
|
||||
export READELF="$LFS_TGT-readelf"
|
||||
# remove hardening options for building libraries
|
||||
export CFLAGS="-U_FORTIFY_SOURCE -O2"
|
||||
export CPPFLAGS="-U_FORTIFY_SOURCE -O2"
|
||||
export CFLAGS="-U_FORTIFY_SOURCE -O2 -L$LFS_TOOLS/lib -L$LFS/usr/lib -I$LFS_TOOLS/include -I$LFS_TOOLS/$LFS_TGT/include"
|
||||
export CPPFLAGS="-U_FORTIFY_SOURCE -O2 -L$LFS_TOOLS/lib -L$LFS/usr/lib -I$LFS_TOOLS/include -I$LFS_TOOLS/$LFS_TGT/include -I$LFS_TOOLS/$LFS_TGT/include/c++/14.2.0/ -I$LFS_TOOLS/$LFS_TGT/include/c++/14.2.0/$LFS_TGT"
|
||||
export LD_LIBRARY_PATH_old="$LD_LIBRARY_PATH"
|
||||
unset LD_LIBRARY_PATH
|
||||
|
||||
# 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
|
||||
echo 'int main(){}' | "$CC" $CPPFLAGS -xc -
|
||||
"$READELF" -l a.out | grep ld-linux
|
||||
rm -v a.out
|
||||
|
||||
#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
|
||||
cat test_compiler.cpp | "$CXX" $CPPFLAGS -xc++ -
|
||||
"$LFS_TGT-readelf" -l a.out
|
||||
rm -v a.out
|
||||
|
||||
# build m4
|
||||
if [ ! -f "$STEPS_DIR/m4" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue