Ch5: "Locking in" glibc, Ch6: Adjusting toolchain

Benoit Rignault benoit.rignault at m4x.org
Mon Jun 9 06:54:16 PDT 2003


On Thu, 5 Jun 2003 01:53:16 +0000 (UTC)
Ryan.Oliver at pha.com.au wrote:

> Good luck making it simple...

Using this regexp :

  sed  "s: /lib: /stage1/lib:"

for all files under gcc-3.3/gcc/config provides the same
changes as the gcc-3.3-specs.patch, plus the following:

(I omit changes in comments)

diff -r config.ben/alpha/linux-elf.h config.lfs/alpha/linux-elf.h
< #define ELF_DYNAMIC_LINKER	"/lib/ld.so.1"
> #define ELF_DYNAMIC_LINKER	"/stage1/lib/ld.so.1"
< #define ELF_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
> #define ELF_DYNAMIC_LINKER	"/stage1/lib/ld-linux.so.2"

diff -r config.ben/i386/gnu.h config.lfs/i386/gnu.h
<       %{!dynamic-linker:-dynamic-linker /stage1/lib/ld.so}} \
>       %{!dynamic-linker:-dynamic-linker /lib/ld.so}} \

diff -r config.ben/i386/linux.h config.lfs/i386/linux.h
< 	%{!dynamic-linker:-dynamic-linker /stage1/lib/elf/ld-linux.so.1} \
< 	%{!rpath:-rpath /stage1/lib/elf/}} %{static:-static}}}"
> 	%{!dynamic-linker:-dynamic-linker /lib/elf/ld-linux.so.1} \
> 	%{!rpath:-rpath /lib/elf/}} %{static:-static}}}"
< 	%{!dynamic-linker:-dynamic-linker /stage1/lib/ld-linux.so.1}} \
> 	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \

diff -r config.ben/rs6000/linux64.h config.lfs/rs6000/linux64.h
<   %{!dynamic-linker:-dynamic-linker /stage1/lib64/ld64.so.1}}}"
>   %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}"
< #define STARTFILE_PREFIX_SPEC "/usr/local/lib64/ /stage1/lib64/ /usr/lib64/"
> #define STARTFILE_PREFIX_SPEC "/usr/local/lib64/ /lib64/ /usr/lib64/"

diff -r config.ben/sh/linux.h config.lfs/sh/linux.h
<      %{!rpath:-rpath /stage1/lib}} \
>      %{!rpath:-rpath /lib}} \

diff -r config.ben/sparc/linux.h config.lfs/sparc/linux.h
<         %{!rpath:-rpath /stage1/lib/elf/}} %{static:-static}}}"
>         %{!rpath:-rpath /lib/elf/}} %{static:-static}}}"

I don't know if the changes in #define are relevant.
To closer follow the patch you can also use (as Jouko Orava suggests)
  sed  "/-dynamic-linker/ s: /lib: /stage1/lib:"
to only match the lines with the word dynamic-linker. 

Also using the commands

  sed "s:/lib:/stage1/lib:" 
  and
  sed "s:/stage1/lib:/lib:"

for specs file works for me (but dunno for some strange architectures).

The fact is that if we want PLFS-stage2 to be self-contained, then all
references to /lib should be change in /stage1/lib or is what I am saying
complete bullshit ? 

Benoit Rignault
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list