I'm using LFS 7.8 (stable) book. I'm familiar with installing the packages
as mentioned in the book. Now I want to install them to a temporary
directory using fakeroot approach. I have read the hint provided on the
website. But while installing glibc, it is unable to locate the new gcc
that is compiled in the 1st pass of gcc.

Here, $FAKEROOT is a temporary directory created using mktemp -d

Build script for binutils:

mkdir "${BUILD_DIR}" &&
    cd "${BUILD_DIR}" &&
    ../configure               \
    --prefix=/tools            \
    --with-sysroot=$FAKEROOT  \
    --with-lib-path=/tools/lib \
    --target=$TARGET           \
    --disable-nls              \
    --disable-werror
    make $MAKE_PARALLEL

    case $(uname -m) in
        x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;;
    esac

    make $MAKE_PARALLEL DESTDIR=$FAKEROOT install

Build script for gcc:

for file in \
        $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.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


    mkdir "${BUILD_DIR}" &&
    cd "${BUILD_DIR}" &&
    ../configure                                   \
    --target=$TARGET                               \
    --prefix=/tools                                \
    --with-glibc-version=2.11                      \
    --with-sysroot=$FAKEROOT                      \
    --with-newlib                                  \
    --without-headers                              \
    --with-local-prefix=/tools                     \
    --with-native-system-header-dir=/tools/include \
    --disable-nls                                  \
    --disable-shared                               \
    --disable-multilib                             \
    --disable-decimal-float                        \
    --disable-threads                              \
    --disable-libatomic                            \
    --disable-libgomp                              \
    --disable-libquadmath                          \
    --disable-libssp                               \
    --disable-libvtv                               \
    --disable-libstdcxx                            \
    --enable-languages=c,c++
     make $MAKE_PARALLEL
     make $MAKE_PARALLEL DESTDIR=$FAKEROOT install

The build logs have been attached.
~/Desktop/Panda-Linux/1.0a/phase1/glibc/glibc-2.22 ~/Desktop/Panda-Linux/1.0a/phase1/glibc
patching file scripts/test-installation.pl
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-panda-linux-gnu
checking for x86_64-panda-linux-gnu-gcc... no
checking for gcc... gcc
configure: WARNING: using cross tools not prefixed with host triplet
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc... gcc
checking for x86_64-panda-linux-gnu-readelf... no
checking for readelf... readelf
checking for x86_64-panda-linux-gnu-g++... no
checking for x86_64-panda-linux-gnu-c++... no
checking for x86_64-panda-linux-gnu-gpp... no
checking for x86_64-panda-linux-gnu-aCC... no
checking for x86_64-panda-linux-gnu-CC... no
checking for x86_64-panda-linux-gnu-cxx... no
checking for x86_64-panda-linux-gnu-cc++... no
checking for x86_64-panda-linux-gnu-cl.exe... no
checking for x86_64-panda-linux-gnu-FCC... no
checking for x86_64-panda-linux-gnu-KCC... no
checking for x86_64-panda-linux-gnu-RCC... no
checking for x86_64-panda-linux-gnu-xlC_r... no
checking for x86_64-panda-linux-gnu-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ can link programs... yes
checking for sysdeps preconfigure fragments... aarch64 alpha arm hppa i386 m68k microblaze mips nacl nios2 powerpc s390 sh sparc tile x86_64 checking whether gcc compiles in -mx32 mode by default... no

configure: running configure fragment for add-on libidn
checking for assembler and linker STT_GNU_IFUNC support... yes
checking whether .text pseudo-op must be used... yes
checking sysdep dirs... sysdeps/unix/sysv/linux/x86_64/64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86 sysdeps/unix/sysv/linux/wordsize-64 sysdeps/x86_64/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/x86_64 sysdeps/unix sysdeps/posix sysdeps/x86_64/64 sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86/fpu sysdeps/x86_64/multiarch sysdeps/x86_64 sysdeps/x86 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/wordsize-64 sysdeps/ieee754 sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether as is GNU as... yes
checking whether ld is GNU ld... yes
checking for as... as
checking version of as... 2.25.1, ok
checking for ld... ld
checking version of ld... 2.25.1, ok
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 4.0, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.19.4, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 6.0, ok
checking for sed... sed
checking version of sed... 4.2.2, ok
checking for gawk... gawk
checking version of gawk... 4.1.1, ok
checking if gcc is sufficient to build libc... yes
checking for x86_64-panda-linux-gnu-nm... no
checking for nm... nm
checking LD_LIBRARY_PATH variable... ok
checking whether GCC supports -static-libgcc... -static-libgcc
checking for bash... /bin/bash
checking for perl... /usr/bin/perl
checking for install-info... /usr/bin/install-info
checking for bison... bison
checking version of bison... 3.0.2, ok
checking for libc-friendly stddef.h... yes
checking whether we need to use -P to assemble .S files... no
checking for .set assembler directive... yes
checking for assembler gnu_unique_object symbol type... yes
checking for .previous assembler directive... yes
checking for .protected and .hidden assembler directive... yes
checking whether __attribute__((visibility())) is supported... yes
checking linker support for protected data symbol... yes
checking for broken __attribute__((visibility()))... no
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking for .preinit_array/.init_array/.fini_array support... yes
checking whether to use .ctors/.dtors header and trailer... (cached) yes
checking for libunwind-support in compiler... no
checking for linker that supports -z nodelete... yes
checking for linker that supports -z nodlopen... yes
checking for linker that supports -z initfirst... yes
checking for -Bgroup option... yes
checking whether --noexecstack is desirable for .S files... yes
checking for -z combreloc... yes
checking for linker that supports -z execstack... yes
checking for -fpie... yes
checking for --hash-style option... yes
checking for sufficient default -shared layout... no
checking linker output format... elf64-x86-64
checking for -fno-toplevel-reorder -fno-section-anchors... yes
checking for -fstack-protector... yes
checking for -fgnu89-inline... yes
checking whether cc puts quotes around section names... no
checking for assembler .weak directive... yes
checking for ld --no-whole-archive... yes
checking for gcc -fexceptions... yes
checking for __builtin_memset... yes
checking for redirection of built-in functions... yes
checking for __thread... yes
checking for tls_model attribute... yes
checking for compiler option to disable generation of FMA instructions... -ffp-contract=off
checking if gcc accepts -fno-tree-loop-distribute-patterns with __attribute__ ((__optimize__))... yes
checking for libgd... no
checking for is_selinux_enabled in -lselinux... no
checking size of long double... 16
checking for _FORTIFY_SOURCE predefine... yes
checking whether gcc implicitly enables -fstack-protector... yes
checking whether the linker provides working __ehdr_start... yes
checking for __builtin_trap with no external dependencies... yes
running configure fragment for sysdeps/unix/sysv/linux/x86_64/64
running configure fragment for sysdeps/unix/sysv/linux/x86_64
running configure fragment for sysdeps/unix/sysv/linux
checking installed Linux kernel header files... 2.6.32 or later
checking for kernel header at least 2.6.32... ok
checking for linux/fanotify.h... yes
running configure fragment for sysdeps/nptl
checking for forced unwind support... (cached) yes
checking for C cleanup handling... (cached) yes
running configure fragment for sysdeps/gnu
running configure fragment for sysdeps/x86_64
checking for cpuid.h... yes
checking for SSE4 support... yes
checking for AVX support... yes
checking for AVX512 support in assembler... yes
checking for AVX512 support... yes
checking for AVX encoding of SSE instructions... yes
checking for FMA4 support... yes
checking for -mno-vzeroupper support... yes
checking for Intel MPX support... yes
checking for AVX2 support... yes
checking for old glibc 2.0.x headers... no
checking whether -fPIC is default... no
checking whether -fPIE is default... no
configure: creating ./config.status
config.status: creating config.make
config.status: creating Makefile
config.status: creating config.h
config.status: executing default commands
~/Desktop/Panda-Linux/1.0a/phase1/glibc
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to