qLinux
… a distribution study
<< Prev Flex
Next >> gmp
Binutils-2.37
Reference: 8.18. Binutils-2.37. Apply a patch to fix the core of the build system:
patch -Np1 -i binutils-2.37-qlnx-1-20220203.patch
The above patch did made binutils to fit to the qLinux filesystem layout. The next patch fixes the build system to change dynamically created  libtool 
files:
patch -Np1 -i binutils-2.37-qlnx-2-20220203.patch
This second patch adds a sed command to several  Makefile.in 
. Additional it disables make-all in po in subdir ld also. Reason is an unclear behavior: make enters subdir po and returns immediately with “nothing to be done in all”. But somewhere in between the file  ld/libtool 
will be recreated/rewritten - thus the sed command to fix  /dev/null 
before entering po will be reverted. Really weird.
Another patch makes fixes to the sources itself to make the final binaries qLinux compliant:
patch -Np1 -i binutils-2.37-qlnx-3-20220203.patch
An error in the building system causes the shipped man pages to be empty. Remove them, so the man pages will be rebuild correctly:
sed -i '63d' etc/texi2pod.pl find -name \*.1 -delete
Use a separate directory for the build:
mkdir -v build cd build
Configure and compile the package:
../configure --prefix=/qlnx \ --enable-gold \ --enable-ld=default \ --enable-shared \ --enable-plugins \ --disable-werror \ --enable-64-bit-bfd \ --includedir=/qlnx/inc \ --datarootdir=/qlnx/dat \ --mandir=/qlnx/man \ --infodir=/tmp \ --with-system-zlib \ --disable-perl
Then compile binutils:
make MAKEINFO=true tooldir=/qlnx
tooldir=/qlnx     
    From the book: “Normally, the tooldir (the directory where the executables will ultimately be located) is set to $(exec_prefix)/$(target_alias). For example, x86_64 machines would expand that to /usr/x86_64-pc-linux-gnu. Because this is a custom system, this target-specific directory in /usr is not required. $(exec_prefix)/$(target_alias) would be used if the system was used to cross-compile (for example, compiling a package on an Intel machine that generates code that can be executed on PowerPC machines).”
MAKEINFO=true
    We have no texinfo installed (yet) and we don't want nor need info files at all. This sets the makeinfo command to true (as a dummy) w/o building info pages and throwing an error about missing  makeinfo 
..
It is highly recommended to verify the build:
for f in `ls binutils/*` ; do test -x "$f" && file "$f" &>/qlnx/dev/null && grep -q ELF "$f" && readelf -l $f | grep ld done
Install binutils:
make tooldir=/qlnx install -j1
In Binutils-2.37 - Pass 2 the “tooldir” was installed in  /qlnx/lib/binutils 
. This directory is now obsolete and shall be removed:
rm -rf /qlnx/lib/binutils
Remove commonly not used static libraries (optional):
rm -fv /qlnx/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a
<< Prev Flex
        
Next >> Gmp