On Mon, Dec 14, 2015 at 01:53:04AM +0530, Abhimanyu Saharan wrote:
> 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               \
 NB you are deviating in another way by making $BUILD_DIR within the
source, instead of at the same level [ so, in the book we use
../package-version/configure instead of ../configure ].  I doubt
this is important, but as soon as you change things, you open up
possibilities for things to go wrong.  So, you will need to
double-check everything in all your scripts.

>     --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

I have never used the fakeroot approach (and I think that using it
for the toolchain might add additional problems).  Reading the hint,
it seems that Tushar used it for LFS as well as BLFS.  But do you
need this for the *temporary* system in /tools ?

I see that the hint is 10 years old, and Tushar's build scripts seem
to have been deleted.  A *lot* has changed in LFS in the last 10
years.  For BLFS, I'm sure that the general principles will work
fine (modulo INSTALLROOT instead of DESTDIR for QT packages -
actually, if you manage to build glibc, I think it too will use a
variant like INSTALL_ROOT, and a few packages will not support that
approach : for BLFS packages, check the wiki).  For LFS in chroot, I
don't really grok this - you will still need to be root to build the
first packages.  Since Tushar did it in the past, I'm sure it can
still be done - but I would tend to label the process as "here be
dragons" until somebody documents it for a recent version of LFS.

Sorry I cannot help.  It might be worth asking on blfs-support, to
see if anybody has used the fakeroot approach for LFS itself in
recent years.

Good luck.

ĸen
-- 
This email was written using 100% recycled letters.
-- 
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