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
|
# Use the new toolchain
|
||||||
export BUILD_CC=gcc
|
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 CC="$LFS_TGT-gcc"
|
||||||
export CXX="$LFS_TGT-g++ -L$LFS_TOOLS/usr/lib -I$LFS_TOOLS/include -I$LFS_TOOLS/$LFS_TGT/include"
|
export CXX="$LFS_TGT-g++"
|
||||||
export AS="$LFS_TGT-as"
|
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 AR="$LFS_TGT-ar"
|
||||||
export RANLIB="$LFS_TGT-ranlib"
|
export RANLIB="$LFS_TGT-ranlib"
|
||||||
export STRIP="$LFS_TGT-strip"
|
export STRIP="$LFS_TGT-strip"
|
||||||
export OBJDUMP="$LFS_TGT-objdump"
|
export OBJDUMP="$LFS_TGT-objdump"
|
||||||
|
export READELF="$LFS_TGT-readelf"
|
||||||
# remove hardening options for building libraries
|
# remove hardening options for building libraries
|
||||||
export CFLAGS="-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"
|
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"
|
export LD_LIBRARY_PATH_old="$LD_LIBRARY_PATH"
|
||||||
unset LD_LIBRARY_PATH
|
unset LD_LIBRARY_PATH
|
||||||
|
|
||||||
# test the cross toolchain
|
# test the cross toolchain
|
||||||
which -- $LFS_TGT-as || echo $LFS_TGT-as is not in the PATH
|
which -- $LFS_TGT-as || echo $LFS_TGT-as is not in the PATH
|
||||||
|
|
||||||
echo 'int main(){}' | "$LFS_TGT-gcc" -xc -
|
echo 'int main(){}' | "$CC" $CPPFLAGS -xc -
|
||||||
"$LFS_TGT-readelf" -l a.out > test_compiler
|
"$READELF" -l a.out | grep ld-linux
|
||||||
cat test_compiler | grep ld-linux
|
rm -v a.out
|
||||||
rm -v a.out test_compiler
|
|
||||||
|
|
||||||
#cat test_compiler.cpp | "$LFS_TGT-g++" -xc -
|
cat test_compiler.cpp | "$CXX" $CPPFLAGS -xc++ -
|
||||||
#"$LFS_TGT-readelf" -l a.out > test_compiler
|
"$LFS_TGT-readelf" -l a.out
|
||||||
#cat test_compiler | grep ld-linux
|
rm -v a.out
|
||||||
#rm -v a.out test_compiler
|
|
||||||
|
|
||||||
# build m4
|
# build m4
|
||||||
if [ ! -f "$STEPS_DIR/m4" ]; then
|
if [ ! -f "$STEPS_DIR/m4" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue