On 2018-11-08 10:50 +0000, John Frankish via lfs-dev wrote:
> Ref:
> 
> Linux From Scratch - Version SVN-20181029
> Chapter 5. Constructing a Temporary System
> 5.5. GCC-8.2.0 - Pass 1
> 
> Using the latest script to update the dynamic linker results in gcc
> failing to build.

I was building SVN-20181029 few days last day and I didn't see any
problems in GCC pass 1.

> Using a previous script fixes the problem.
> 
> Details below.
> 
> Regards
> John
> 
> ----------
> 
> This script:
> 
> for file in gcc/config/{linux,i386/linux{,64}}.h
> do
>   cp -uv $file{,.orig}
>   sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
>       -e 's@/usr@/tools@g' $file.orig > $file
>   echo '
> #undef STANDARD_STARTFILE_PREFIX_1
> #undef STANDARD_STARTFILE_PREFIX_2
> #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
> #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
>   touch $file.orig
> done
> 
> results in:
> 
> g++ -fno-PIE -c  -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -g -O2
> -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti
> -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
> -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
> -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -
> DHAVE_CONFIG_H -I. -Ic-family -I../../gcc -I../../gcc/c-family
> -I../../gcc/../include -I../../gcc/../libcpp/include
> -I/mnt/tc/sources/gcc-8.2.0/build/./gmp -I/mnt/tc/sources/gcc-
> 8.2.0/gmp -I/mnt/tc/sources/gcc-8.2.0/build/./mpfr/src
> -I/mnt/tc/sources/gcc-8.2.0/mpfr/src -I/mnt/tc/sources/gcc-
> 8.2.0/mpc/src  -I../../gcc/../libdecnumber
> -I../../gcc/../libdecnumber/dpd -I../libdecnumber
> -I../../gcc/../libbacktrace   -o c-family/c-cppbuiltin.o -MT c-
> family/c-cppbuiltin.o -MMD -MP -MF c-family/.deps/c-cppbuiltin.TPo
> ../../gcc/c-family/c-cppbuiltin.c
> In file included from ./tm.h:38:0,
>                  from ../../gcc/target.h:52,
>                  from ../../gcc/c-family/c-cppbuiltin.c:23:
> ../../gcc/c-family/c-cppbuiltin.c: In function 'void
> c_cpp_builtins(cpp_reader*)':
> ../../gcc/config/i386/linux-common.h:25:7: error:
> 'GNU_USER_TARGET_OS_CPP_BUILTINS' was not declared in this scope
>        GNU_USER_TARGET_OS_CPP_BUILTINS();       \
>        ^
> ../../gcc/c-family/c-cppbuiltin.c:1415:3: note: in expansion of macro
> 'TARGET_OS_CPP_BUILTINS'
>    TARGET_OS_CPP_BUILTINS ();
>    ^~~~~~~~~~~~~~~~~~~~~~
> ../../gcc/config/i386/linux-common.h:25:7: note: suggested
> alternative: 'ANDROID_TARGET_OS_CPP_BUILTINS'
>        GNU_USER_TARGET_OS_CPP_BUILTINS();       \
>        ^
> ../../gcc/c-family/c-cppbuiltin.c:1415:3: note: in expansion of macro
> 'TARGET_OS_CPP_BUILTINS'
>    TARGET_OS_CPP_BUILTINS ();
>    ^~~~~~~~~~~~~~~~~~~~~~
> make[2]: *** [Makefile:1110: c-family/c-cppbuiltin.o] Error 1
> make[2]: Leaving directory '/mnt/tc/sources/gcc-8.2.0/build/gcc'
> make[1]: *** [Makefile:4255: all-gcc] Error 2
> make[1]: Leaving directory '/mnt/tc/sources/gcc-8.2.0/build'
> make: *** [Makefile:890: all] Error 2
> 
> This script works:
> 
> for file in $(find gcc/config -name linux64.h -o -name linux.h)
> do
>   cp $file $file.orig
>   sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' -e 's@/usr@/tools@g'
> $file.orig > $file
>   echo '
> #undef STANDARD_STARTFILE_PREFIX_1
> #undef STANDARD_STARTFILE_PREFIX_2
> #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
> #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
>   touch $file.orig
> done

I can not see any point that is is different from the book.  The
linux.h and linux64.h in other subdirectories of gcc/config is useless
on i386 or x86_64.
-- 
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to