I finally have glibc, binutils, and gcc all building within the chroot
using my alternate paths. Further, bzip2 and pkg-config both built without
issues and installed to my alternate paths. I even verified that bzip2
correctly executes, compresses, and decompresses files. It took some header
file manipulation and some manipulation of various environment variables,
some Makefiles, and a lot of linker flags to this all working in the new
location.

However, now I am getting an error building ncurses. The following output
has verbose mode enabled:


cd man && make DESTDIR="" RPATH_LIST="/home/test/usr/lib" all
make[1]: Entering directory '/build/ncurses-6.0/man'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/build/ncurses-6.0/man'
cd include && make DESTDIR="" RPATH_LIST="/home/test/usr/lib" all
make[1]: Entering directory '/build/ncurses-6.0/include'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/build/ncurses-6.0/include'
cd ncurses && make DESTDIR="" RPATH_LIST="/home/test/usr/lib" all
make[1]: Entering directory '/build/ncurses-6.0/ncurses'
gcc -o make_hash -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I.
-I../include -I./../include -DHAVE_CONFIG_H -I. -I../include
-L/home/product/code/firmware/cur
rent/usr/lib64 -L/home/test/lib -L/lib64 -I/home/test//usr/include
-L/tools/lib64 -I/tools/include -Wl,--sysroot=/home/test -Wl,-nostdlib
-Wl,--library-path=/home/test/usr/lib64 -Wl,--library-path=/home/test/lib
-Wl,--library-path=/lib -Wl,--library-path=/lib64 -Wl,-rpath
-Wl,/home/test/usr/lib64:/home/test/lib -Wl,-rpath-link
-Wl,/home/test/usr/lib64:/home/test/lib
-Wl,--dynamic-linker=/home/test/lib/ld-linux-x86-64.so.2 -Wl,--verbose
-mtune=core-avx2 -O2 -pipe -fPIC -fPIC -D_GNU_SOURCE -DNDEBUG
 -L/home/test/usr/lib64 -L/home/test/lib -L/lib64 -I/home/test//usr/include
-L/tools/lib64 -I/tools/include -Wl,--sysroot=/home/test -Wl,-nostdlib
-Wl,--library-path=/home/test/usr/lib64 -Wl,--library-path=/home/test/lib
-Wl,--library-path=/lib -Wl,--library-path=/lib64 -Wl,-rpath
-Wl,/home/test/usr/lib64:/home/test/lib -Wl,-rpath-link
-Wl,/home/test/usr/lib64:/home/test/lib
-Wl,--dynamic-linker=/home/test/lib/ld-linux-x86-64.so.2 -Wl,--verbose
-mtune=core-avx2 -O2 -pipe -fPIC -I../ncurses -I -I../include -I
./tinfo/make_hash.c
/bin/sh -e ./tinfo/MKfallback.sh /home/test/usr/share/terminfo
../misc/terminfo.src /tools/bin/tic  >fallback.c
/bin/sh -e ./base/MKlib_gen.sh "/home/test/usr/bin/cpp -DHAVE_CONFIG_H -I.
-I../include -L/home/test/usr/lib64 -L/home/test/lib -L/lib64
-I/home/test//usr/include -L/tools/lib64 -I/tools/include
-Wl,--sysroot=/home/test -Wl,-nostdlib
-Wl,--library-path=/home/test/usr/lib64 -Wl,--library-path=/home/test/lib
-Wl,--library-path=/lib -Wl,--library-path=/lib64 -Wl,-rpath
-Wl,/home/test/usr/lib64:/home/test/lib -Wl,-rpath-link
-Wl,/home/test/usr/lib64:/home/test/lib
-Wl,--dynamic-linker=/home/test/lib/ld-linux-x86-64.so.2 -Wl,--verbose
-mtune=core-avx2 -O2 -pipe -fPIC -fPIC -D_GNU_SOURCE -DNDEBUG" "gawk"
generated <../include/curses.h >lib_gen.c
.. adding -P option to work around /home/test/usr/bin/cpp 5.2.0
GNU ld (GNU Binutils) 2.25.1
  Supported emulations:
   elf_x86_64
   elf32_x86_64
   elf_i386
   i386linux
   elf_l1om
   elf_k1om
GNU ld (GNU Binutils) 2.25.1
  Supported emulations:
   elf_x86_64
   elf32_x86_64
   elf_i386
   i386linux
   elf_l1om
   elf_k1om
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
/* Copyright (C) 2014 Free Software Foundation, Inc.
   Copying and distribution of this script, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.  */
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
              "elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
SEARCH_DIR("=/usr/x86_64-unknown-linux-gnu/lib64"); SEARCH_DIR("/usr/lib");
SEARCH_DIR("=/usr/x86_64-unknown-linux-gnu/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); .
= SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash           : { *(.hash) }
  .gnu.hash       : { *(.gnu.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.ctors)
      *(.rela.dtors)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
      *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
      *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
      *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
      *(.rela.ifunc)
    }
  .rela.plt       :
    {
      *(.rela.plt)
      PROVIDE_HIDDEN (__rela_iplt_start = .);
      *(.rela.iplt)
      PROVIDE_HIDDEN (__rela_iplt_end = .);
    }
  .init           :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt            : { *(.plt) *(.iplt) }
  .plt.bnd        : { *(.plt.bnd) }
  .text           :
  {
    *(.text.unlikely .text.*_unlikely .text.unlikely.*)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
  }
  .fini           :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1        : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  /* These sections are generated by the Sun/Oracle C++ compiler.  */
  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) &
(CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT
(MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling  */
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table
.gcc_except_table.*) }
  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges
.exception_ranges*) }
  /* Thread Local Storage sections  */
  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array     :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o
*crtend?.o ) .ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array     :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)
SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o
*crtend?.o ) .dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors          :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.
data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic        : { *(.dynamic) }
  .got            : { *(.got) *(.igot) }
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 24 ? 24 : 0, .);
  .got.plt        : { *(.got.plt)  *(.igot.plt) }
  .data           :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section.  */
   . = ALIGN(. != 0 ? 64 / 8 : 1);
  }
  .lbss   :
  {
    *(.dynlbss)
    *(.lbss .lbss.* .gnu.linkonce.lb.*)
    *(LARGE_COMMON)
  }
  . = ALIGN(64 / 8);
  . = SEGMENT_START("ldata-segment", .);
  .lrodata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) -
1)) :
  {
    *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
  }
  .ldata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) -
1)) :
  {
    *(.ldata .ldata.* .gnu.linkonce.l.*)
    . = ALIGN(. != 0 ? 64 / 8 : 1);
  }
  . = ALIGN(64 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections.  */
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }
  .stab.excl     0 : { *(.stab.excl) }
  .stab.exclstr  0 : { *(.stab.exclstr) }
  .stab.index    0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment       0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  /* DWARF Extension.  */
  .debug_macro    0 : { *(.debug_macro) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}


==================================================
attempt to open
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/crt1.o
succeeded
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/crt1.o
attempt to open
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/crti.o
succeeded
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/crti.o
attempt to open
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/crtbegin.o
succeeded
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/crtbegin.o
attempt to open /home/test/usr/lib64/libgcc.so failed
attempt to open /home/test/usr/lib64/libgcc.a failed
attempt to open /home/test/lib/libgcc.so failed
attempt to open /home/test/lib/libgcc.a failed
attempt to open /lib64/libgcc.so failed
attempt to open /lib64/libgcc.a failed
attempt to open /tools/lib64/libgcc.so failed
attempt to open /tools/lib64/libgcc.a failed
attempt to open /home/test/usr/lib64/libgcc.so failed
attempt to open /home/test/usr/lib64/libgcc.a failed
attempt to open /home/test/lib/libgcc.so failed
attempt to open /home/test/lib/libgcc.a failed
attempt to open /lib64/libgcc.so failed
attempt to open /lib64/libgcc.a failed
attempt to open /tools/lib64/libgcc.so failed
attempt to open /tools/lib64/libgcc.a failed
attempt to open
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/libgcc.so
failed
attempt to open
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/libgcc.a
succeeded
attempt to open /home/test/usr/lib64/libgcc_s.so succeeded
-lgcc_s (/home/test/usr/lib64/libgcc_s.so)
attempt to open /home/test/usr/lib64/libc.so succeeded
opened script file /home/test/usr/lib64/libc.so
opened script file /home/test/usr/lib64/libc.so
attempt to open /home/test/lib64/libc.so.6 succeeded
/lib64/libc.so.6 (/home/test/lib64/libc.so.6)
attempt to open /home/test/usr/lib64/libc_nonshared.a succeeded
(/home/test/usr/lib64/libc_nonshared.a)elf-init.oS
attempt to open /home/test/lib64/ld-linux-x86-64.so.2 succeeded
/lib64/ld-linux-x86-64.so.2 (/home/test/lib64/ld-linux-x86-64.so.2)
/lib64/ld-linux-x86-64.so.2 (/home/test/lib64/ld-linux-x86-64.so.2)
attempt to open /home/test/usr/lib64/libgcc.so failed
attempt to open /home/test/usr/lib64/libgcc.a failed
attempt to open /home/test/lib/libgcc.so failed
attempt to open /home/test/lib/libgcc.a failed
attempt to open /lib64/libgcc.so failed
attempt to open /lib64/libgcc.a failed
attempt to open /tools/lib64/libgcc.so failed
attempt to open /tools/lib64/libgcc.a failed
attempt to open /home/test/usr/lib64/libgcc.so failed
attempt to open /home/test/usr/lib64/libgcc.a failed
attempt to open /home/test/lib/libgcc.so failed
attempt to open /home/test/lib/libgcc.a failed
attempt to open /lib64/libgcc.so failed
attempt to open /lib64/libgcc.a failed
attempt to open /tools/lib64/libgcc.so failed
attempt to open /tools/lib64/libgcc.a failed
attempt to open
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/libgcc.so
failed
attempt to open
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/libgcc.a
succeeded
attempt to open /home/test/usr/lib64/libgcc_s.so succeeded
-lgcc_s (/home/test/usr/lib64/libgcc_s.so)
attempt to open
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/crtend.o
succeeded
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/crtend.o
attempt to open
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/crtn.o
succeeded
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/crtn.o
ld-linux-x86-64.so.2 needed by /home/test/lib64/libc.so.6
found ld-linux-x86-64.so.2 at /home/test/lib64/ld-linux-x86-64.so.2
/home/test/usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64/crt1.o:
In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Makefile:238: recipe for target 'make_hash' failed
make[1]: *** [make_hash] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/build/ncurses-6.0/ncurses'
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

Keep in mind that at his point, we are inside the chroot, we have just
built glibc, binutils, GCC, bzip2, and pkg-config. We are using modified
paths for everything. Notably, it is all being put in /home/test/ inside
the chroot instead of /.

Any assistance anyone can provide would be appreciated.

Thanks.


On Wed, Oct 14, 2015 at 3:57 AM, Pierre Labastie <[email protected]>
wrote:

> On 13/10/2015 23:23, Ken Moffat wrote:
>
>> On Tue, Oct 13, 2015 at 05:00:30PM -0400, Eliot Gable wrote:
>>
>>> export CFLAGS="-mtune=core-avx2 -O2 -fPIC"
>>>>> export CXXFLAGS=$CFLAGS
>>>>>
>>>> Where do you get core-avx2 from ?  It seems to be a gentooism.  If
>>>> you *relly* need to optimise for your specific machine, then I would
>>>> probably leave that for chapter 6.
>>>>
>>>> When you build libstdc++, configure should decide that the build
>>>> system type is x86_64-unknown-linux-gnu and both the host and the
>>>> target should be x86_64-bps-linux-gnu (-lfs-linux-gnu for the rest
>>>> of us).  Is that what you got ?
>>>>
>>>> Is your PATH set correctly, so that things in /tools/bin will take
>>>> priority ?  I assume it looks ok, because you say you've done the
>>>> same thing with gcc-4.9.2.
>>>>
>>>> What is your host system ?  Is it multilib ?
>>>>
>>>> As your lfs user (or bps user, or whatever), what do you get for
>>>> the following commands ?
>>>>
>>>> type -pa gcc
>>>> gcc --version
>>>>
>>>> At the moment, I do not have any understanding of what is likely to
>>>> have gone wrong - over the years, people have had problems in a few
>>>> places in chapter 6, usually caused when we move a library to /lib
>>>> (sometimes the symlinks in /usr/lib got broken).  This problem seems
>>>> to be something different.
>>>>
>>>> I'm also slightly perplexed by your changes from what is in the
>>>> book: when you build LFS, you need to own the machine, and we build
>>>> LFS on its own partition.  If your process worked with an earlier
>>>> version, then I guess it can be fixed, but from here it just looks
>>>> like an unnecessary complication.
>>>>
>>>> So, it seems the issue is now gone. I removed the modified CFLAGS and
>>> it is
>>> working now. I had earlier switched back to gcc-4.9.3 and it compiled
>>> fine
>>> even with the modified CFLAGS. I'm not sure if that was the actual issue,
>>> but it is working now. My hope with the -mtune was to speed up the
>>> overall
>>> build process on modern processors. I do still want it included in
>>> Chapter
>>> 6.
>>>
>>> Glad the problem seems to have gone.  I'm cynical, and I take the
>> view that mtune is probably unlikely to make a noticeable difference
>> (and I'm not interested enough to try a series of repeated builds,
>> on an idle system, to try it out).
>>
>> My overall goal with this is to build a set of programs which use
>>> libraries
>>> independent of the OS on the system where they reside. Basically, I have
>>> a
>>> set of software packages I want to be able to build and deploy on any
>>> system and have them work with these specific libraries regardless of the
>>> underlying OS on which they are deployed. The one issue I'm still
>>> struggling with is inside Chapter 6 with gcc, binutils, and glibc. I am
>>> trying to get them to run from a specific non-root folder. Let's just say
>>> /home/test/ for example. So, the idea is that when everything is built,
>>> anything built with the Chapter 6 gcc and glibc will always search in
>>> /home/test/usr/lib64 and /home/test/lib64 for the libraries to load.
>>> Anything I build from within the chroot should also look in that same
>>> location for the libraries instead of /usr/lib64 and /lib64.
>>>
>>> Right now, I enter the chroot and build glibc and binutils and then when
>>> I
>>> try to build gcc, I get errors while trying to link because it is looking
>>> for the ld-linux-x86-64.so file in /usr/lib64 instead of
>>> /home/test/usr/lib64. I even specified
>>> -Wl,--dynamic-linker=/home/test/lib64/ld-linux-x86-64.so.2 when I built
>>> it,
>>> and that did not do anything. I have tried with and without -Wl,--sysroot
>>> specified, as well as with and without -L options specified. I even tried
>>> going back and rebuilding glibc and binutils with different options for
>>> sysroot (with and without it). No matter what I do, when it gets to
>>> building libstdc++ in gcc, it tries to find the libraries in /usr/lib64
>>> and
>>> won't look in the other locations.
>>>
>>> If you could provide any tips on how to specify the paths appropriately
>>> to
>>> do that, I would appreciate it. I can post the actual error message when
>>> I
>>> get things built back up to that point.
>>>
>>> Thanks for the explanation.  This is a million miles away from what
>> most people building LFS want to do, I've no relevant experience.
>>
>> Perhaps the thread at
>> https://sourceware.org/libc-help/2011-03/msg00005.html might have
>> pointers to alternatives. But it sounds as if you are already doing
>> the right thing by specifying --dynamic-linker= so if all else fails,
>> you might need to ask on the libc-help list.
>>
>> ĸen
>>
> I'd guess that the paths for gcc need to be tweaked (as we do for
> gcc-pass2, instructions after "Once again, change the location of GCC's
> default dynamic linker to use the one installed |in /tools").
>
> Pierre
>
>
> |||
> |||
> |
> --
> 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
>



-- 
Eliot Gable

"We do not inherit the Earth from our ancestors: we borrow it from our
children." ~David Brower

"I decided the words were too conservative for me. We're not borrowing from
our children, we're stealing from them--and it's not even considered to be
a crime." ~David Brower

"Esse oportet ut vivas, non vivere ut edas." (Thou shouldst eat to live;
not live to eat.) ~Marcus Tullius Cicero
-- 
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