William Harrington wrote:
On Fri, January 22, 2016 18:54, Bruce Dubbs wrote:
I'm thinking about changing the way we build packages in separate
directories.  What we do now for tool chain packages is:

mkdir -v ../binutils-build
cd ../binutils-build

../binutils-2.25.1/configure  ...


I'm thinking about changing that to:

mkdir -v build
cd       build

../configure ...


Hello Bruce,

In the past, people who have included gcc-build within gcc-<x.y.z> ended
up having errors in the build process from building within the gcc source
tree. Since you tested that with ch5, then ch6 should be okay. I suppose
it depends on the gcc version. The problem occured many years ago.

We have stuck with this for the longest time:

https://gcc.gnu.org/install/configure.html

"First, we highly recommend that GCC be built into a separate directory
from the sources which does not reside within the source tree. This is how
we generally build GCC; building where srcdir == objdir should still work,
but doesn't get extensive testing; building where objdir is a subdirectory
of srcdir is unsupported."

When I read that, I interpret is to mean that they build for multiple targets and want to keep the object files from those builds separate.

I've modified LFS according to the attached diff. I did a full build and the failures in the test logs are the same as with the current book.

Actually I cannot think of a good reason for differentiation between the case where objdir is completely separate from srcdir and the case where objdir is a subdirectory of srcdir, even though they say that case is unsupported. About the only thing I can think of is that they may be doing some kind of recursive directory search and there is some sort of match in the build tree.

In any case, my initial test shows a normal build.

Still asking for more input before I commit.

  -- Bruce


Index: chapter05/binutils-pass1.xml
===================================================================
--- chapter05/binutils-pass1.xml	(revision 10985)
+++ chapter05/binutils-pass1.xml	(working copy)
@@ -52,11 +52,11 @@
     linker and assembler to determine which of their own features to
     enable.</para>
 
-    <para>The Binutils documentation recommends building Binutils outside of the
-    source directory in a dedicated build directory:</para>
+    <para>The Binutils documentation recommends building Binutils 
+    in a dedicated build directory:</para>
 
-<screen><userinput remap="pre">mkdir -v ../binutils-build
-cd ../binutils-build</userinput></screen>
+<screen><userinput remap="pre">mkdir -v build
+cd       build</userinput></screen>
 
     <note>
       <para>In order for the SBU values listed in the rest of the book
@@ -72,13 +72,12 @@
 
     <para>Now prepare Binutils for compilation:</para>
 
-<screen><userinput remap="configure">../binutils-&binutils-version;/configure     \
-    --prefix=/tools            \
-    --with-sysroot=$LFS        \
-    --with-lib-path=/tools/lib \
-    --target=$LFS_TGT          \
-    --disable-nls              \
-    --disable-werror</userinput></screen>
+<screen><userinput remap="configure">../configure --prefix=/tools            \
+             --with-sysroot=$LFS        \
+             --with-lib-path=/tools/lib \
+             --target=$LFS_TGT          \
+             --disable-nls              \
+             --disable-werror</userinput></screen>
 
     <variablelist>
       <title>The meaning of the configure options:</title>
Index: chapter05/binutils-pass2.xml
===================================================================
--- chapter05/binutils-pass2.xml	(revision 10985)
+++ chapter05/binutils-pass2.xml	(working copy)
@@ -45,8 +45,8 @@
 
     <para>Create a separate build directory again:</para>
 
-<screen><userinput remap="pre">mkdir -v ../binutils-build
-cd ../binutils-build</userinput></screen>
+<screen><userinput remap="pre">mkdir -v build
+cd       build</userinput></screen>
 
     <para>Prepare Binutils for compilation:</para>
 
@@ -53,7 +53,7 @@
 <screen><userinput remap="configure">CC=$LFS_TGT-gcc                \
 AR=$LFS_TGT-ar                 \
 RANLIB=$LFS_TGT-ranlib         \
-../binutils-&binutils-version;/configure     \
+../configure                   \
     --prefix=/tools            \
     --disable-nls              \
     --disable-werror           \
Index: chapter05/gcc-pass1.xml
===================================================================
--- chapter05/gcc-pass1.xml	(revision 10985)
+++ chapter05/gcc-pass1.xml	(working copy)
@@ -111,15 +111,15 @@
 
 <screen><userinput remap="pre">sed -i 's/if \((code.*))\)/if (\1 \&amp;\&amp; \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen>
 -->
-    <para>The GCC documentation recommends building GCC outside of the
-    source directory in a dedicated build directory:</para>
+    <para>The GCC documentation recommends building GCC 
+    in a dedicated build directory:</para>
 
-<screen><userinput remap="pre">mkdir -v ../gcc-build
-cd ../gcc-build</userinput></screen>
+<screen><userinput remap="pre">mkdir -v build
+cd       build</userinput></screen>
 
     <para>Prepare GCC for compilation:</para>
 
-<screen><userinput remap="configure">../gcc-&gcc-version;/configure                             \
+<screen><userinput remap="configure">../configure                                       \
     --target=$LFS_TGT                              \
     --prefix=/tools                                \
     --with-glibc-version=2.11                      \
Index: chapter05/gcc-pass2.xml
===================================================================
--- chapter05/gcc-pass2.xml	(revision 10985)
+++ chapter05/gcc-pass2.xml	(working copy)
@@ -101,8 +101,8 @@
 -->
     <para>Create a separate build directory again:</para>
 
-<screen><userinput remap="pre">mkdir -v ../gcc-build
-cd ../gcc-build</userinput></screen>
+<screen><userinput remap="pre">mkdir -v build
+cd       build</userinput></screen>
 
     <para>Before starting to build GCC, remember to unset any environment
     variables that override the default optimization flags.</para>
@@ -113,7 +113,7 @@
 CXX=$LFS_TGT-g++                                   \
 AR=$LFS_TGT-ar                                     \
 RANLIB=$LFS_TGT-ranlib                             \
-../gcc-&gcc-version;/configure                             \
+../configure                                       \
     --prefix=/tools                                \
     --with-local-prefix=/tools                     \
     --with-native-system-header-dir=/tools/include \
Index: chapter05/generalinstructions.xml
===================================================================
--- chapter05/generalinstructions.xml	(revision 10985)
+++ chapter05/generalinstructions.xml	(working copy)
@@ -107,9 +107,7 @@
               <para>Change back to the sources directory.</para>
             </listitem>
             <listitem>
-              <para>Delete the extracted source directory and any
-              <filename class="directory"><replaceable>&lt;package&gt;</replaceable>-build</filename>
-              directories that were created in the build process unless instructed otherwise.</para>
+              <para>Delete the extracted source directory unless instructed otherwise.</para>
             </listitem>
           </orderedlist>
         </listitem>
Index: chapter05/glibc.xml
===================================================================
--- chapter05/glibc.xml	(revision 10985)
+++ chapter05/glibc.xml	(working copy)
@@ -47,15 +47,15 @@
 
 <screen><userinput remap="pre">patch -Np1 -i ../&glibc-upstream-patch;</userinput></screen>
 
-    <para>The Glibc documentation recommends building Glibc outside of the source
-    directory in a dedicated build directory:</para>
+    <para>The Glibc documentation recommends building Glibc 
+    in a dedicated build directory:</para>
 
-<screen><userinput remap="pre">mkdir -v ../glibc-build
-cd ../glibc-build</userinput></screen>
+<screen><userinput remap="pre">mkdir -v build
+cd       build</userinput></screen>
 
     <para>Next, prepare Glibc for compilation:</para>
 
-<screen><userinput remap="configure">../glibc-&glibc-version;/configure                             \
+<screen><userinput remap="configure">../configure                                        \
       --prefix=/tools                               \
       --host=$LFS_TGT                               \
       --build=$(../glibc-&glibc-version;/scripts/config.guess) \
Index: chapter05/libstdc++.xml
===================================================================
--- chapter05/libstdc++.xml	(revision 10985)
+++ chapter05/libstdc++.xml	(working copy)
@@ -48,14 +48,14 @@
       <filename>gcc-&gcc-version;</filename> directory.</para>
     </note>
 
-    <para>Create a directory for Libstdc++ and enter it:</para>
+    <para>Create a separate build directory for Libstdc++ and enter it:</para>
 
-<screen><userinput remap="pre">mkdir -v ../gcc-build
-cd ../gcc-build</userinput></screen>
+<screen><userinput remap="pre">mkdir -v build
+cd       build</userinput></screen>
 
     <para>Prepare Libstdc++ for compilation:</para>
 
-<screen><userinput remap="configure">../gcc-&gcc-version;/libstdc++-v3/configure \
+<screen><userinput remap="configure">../libstdc++-v3/configure           \
     --host=$LFS_TGT                 \
     --prefix=/tools                 \
     --disable-multilib              \
Index: chapter06/binutils.xml
===================================================================
--- chapter06/binutils.xml	(revision 10985)
+++ chapter06/binutils.xml	(working copy)
@@ -65,17 +65,17 @@
 
 <screen><userinput remap="pre">patch -Np1 -i ../&binutils-multiple-plugins-patch;</userinput></screen>
 -->
-    <para>The Binutils documentation recommends building Binutils outside of the
-    source directory in a dedicated build directory:</para>
+    <para>The Binutils documentation recommends building Binutils 
+    in a dedicated build directory:</para>
 
-<screen><userinput remap="pre">mkdir -v ../binutils-build
-cd ../binutils-build</userinput></screen>
+<screen><userinput remap="pre">mkdir -v build
+cd       build</userinput></screen>
 
     <para>Prepare Binutils for compilation:</para>
 
-<screen><userinput remap="configure">../binutils-&binutils-version;/configure --prefix=/usr   \
-                           --enable-shared \
-                           --disable-werror</userinput></screen>
+<screen><userinput remap="configure">../configure --prefix=/usr   \
+             --enable-shared \
+             --disable-werror</userinput></screen>
 
     <para>Compile the package:</para>
 
Index: chapter06/gcc.xml
===================================================================
--- chapter06/gcc.xml	(revision 10985)
+++ chapter06/gcc.xml	(working copy)
@@ -45,21 +45,19 @@
 
 <screen><userinput remap="pre">patch -Np1 -i ../&gcc-upstream-patch;</userinput></screen>
 -->
-    <para>The GCC documentation recommends building GCC outside of the source
-    directory in a dedicated build directory:</para>
+    <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
 
-<screen><userinput remap="pre">mkdir -v ../gcc-build
-cd ../gcc-build</userinput></screen>
+<screen><userinput remap="pre">mkdir -v build
+cd       build</userinput></screen>
 
     <para>Prepare GCC for compilation:</para>
 
-<screen><userinput remap="configure">SED=sed                       \
-../gcc-&gcc-version;/configure        \
-     --prefix=/usr            \
-     --enable-languages=c,c++ \
-     --disable-multilib       \
-     --disable-bootstrap      \
-     --with-system-zlib</userinput></screen>
+<screen><userinput remap="configure">SED=sed                               \
+../configure --prefix=/usr            \
+             --enable-languages=c,c++ \
+             --disable-multilib       \
+             --disable-bootstrap      \
+             --with-system-zlib</userinput></screen>
 
     <para>Note that for other languages, there are some prerequisites that
     are not yet available. See the
@@ -106,7 +104,7 @@
 
     <para>To receive a summary of the test suite results, run:</para>
 
-<screen><userinput remap="test">../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
+<screen><userinput remap="test">../contrib/test_summary</userinput></screen>
 
     <para>For only the summaries, pipe the output through
     <userinput>grep -A7 Summ</userinput>.</para>
Index: chapter06/glibc.xml
===================================================================
--- chapter06/glibc.xml	(revision 10985)
+++ chapter06/glibc.xml	(working copy)
@@ -77,19 +77,18 @@
 
 <screen><userinput remap="pre">patch -Np1 -i ../&glibc-largefile-patch;</userinput></screen>
 
-    <para>The Glibc documentation recommends building Glibc outside of the source
-    directory in a dedicated build directory:</para>
+    <para>The Glibc documentation recommends building Glibc 
+    in a dedicated build directory:</para>
 
-<screen><userinput remap="pre">mkdir -v ../glibc-build
-cd ../glibc-build</userinput></screen>
+<screen><userinput remap="pre">mkdir -v build
+cd       build</userinput></screen>
 
     <para>Prepare Glibc for compilation:</para>
 
-<screen><userinput remap="configure">../glibc-&glibc-version;/configure    \
-    --prefix=/usr          \
-    --disable-profile      \
-    --enable-kernel=&min-kernel; \
-    --enable-obsolete-rpc</userinput></screen>
+<screen><userinput remap="configure">../configure --prefix=/usr          \
+             --disable-profile      \
+             --enable-kernel=&min-kernel; \
+             --enable-obsolete-rpc</userinput></screen>
 
     <para>Compile the package:</para>
 
@@ -170,7 +169,7 @@
     <para>Install the configuration file and runtime directory for
     <command>nscd</command>:</para>
 
-<screen><userinput remap="install">cp -v ../glibc-&glibc-version;/nscd/nscd.conf /etc/nscd.conf
+<screen><userinput remap="install">cp -v ../nscd/nscd.conf /etc/nscd.conf
 mkdir -pv /var/cache/nscd</userinput></screen>
 
     <para>The locales that can make the system respond in a different language
@@ -274,7 +273,7 @@
     <title>Adding time zone data</title>
 
     <para>Install and set up the time zone data with the following:</para>
-<screen><userinput>tar -xf ../tzdata&tzdata-version;.tar.gz
+<screen><userinput>tar -xf ../../tzdata&tzdata-version;.tar.gz
 
 ZONEINFO=/usr/share/zoneinfo
 mkdir -pv $ZONEINFO/{posix,right}
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to