Difference between revisions of "User:Pnoecker/clfs"

From Funtoo
Jump to navigation Jump to search
(→‎ch 5.6: update to 6.2.1 because its breaking later on)
Line 150: Line 150:
this package suggests using make check, it's optional but it's good practice to ensure it's working.
this package suggests using make check, it's optional but it's good practice to ensure it's working.
{{console|body=
{{console|body=
$##i## tar -xf gmp-6.0.0a.tar.xz && cd gmp-6.0.0
$##i## wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz
$##i## tar -xf gmp-6.2.1.tar.xz && cd gmp-6.2.1
$##i## ./configure --prefix=/cross-tools --enable-cxx --disable-static && make && make install
$##i## ./configure --prefix=/cross-tools --enable-cxx --disable-static && make && make install
$##i## make check
$##i## make check
Line 156: Line 157:


{{console|body=
{{console|body=
$##i## cd .. && rm -rf gmp-6.0.0
$##i## cd .. && rm -rf gmp-6.2.1
}}
}}



Revision as of 17:28, February 9, 2022

this will overview my powerpc64 clfs progress on this page. http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/ppc64-64/index.html

first export the clfs variable. this is my ~/sexybeast.


user $ pwd
/home/pnoecker
user $ mkdir sexybeast
user $ export CLFS=/home/pnoecker/sexybeast
user $ sudo su
root # export CLFS=/home/pnoecker/sexybeast

follow from http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/ppc64-64/materials/introduction.html

user $ mkdir -v ${CLFS}/sources
user $ chmod -v a+wt ${CLFS}/sources
user $ wget http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/ppc64-64/dl.list

dl.list has a broken isl link. use nano ctl + w : isl to find the link. replace it with this live link. http://ftp.osuosl.org/pub/clfs/conglomeration/isl/isl-0.12.2.tar.lzma then write the file and exit out of nano.

  • download sources
user $ wget -i dl.list -P ${CLFS}/sources

follow on from http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/ppc64-64/final-preps/creatingtoolsdir.html

igore root, were doing this cash money $$$$ on the first command. second command requires root.

user $ install -dv ${CLFS}/tools
user $ sudo ln -sv ${CLFS}/tools /

create cross tool directory.

user $ install -dv ${CLFS}/cross-tools
user $ sudo ln -sv ${CLFS}/cross-tools /

http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/ppc64-64/final-preps/addinguser.html

user $ sudo groupadd clfs
user $ sudo useradd -s /bin/bash -g clfs -d /home/clfs clfs
user $ sudo mkdir -pv /home/clfs
user $ sudo chown -v clfs:clfs /home/clfs
user $ sudo chown -v clfs ${CLFS}/tools
user $ sudo chown -v clfs ${CLFS}/cross-tools
user $ sudo chown -v clfs ${CLFS}/sources
user $ sudo su - clfs

setup environment:

user $ cat > ~/.bash_profile << "EOF"
exec env -i HOME=${HOME} TERM=${TERM} PS1='\u:\w\$ ' /bin/bash
EOF
user $ cat > ~/.bashrc << "EOF"
set +h
umask 022
CLFS=/home/pnoecker/sexybeast
LC_ALL=POSIX
PATH=/cross-tools/bin:/bin:/usr/bin
export CLFS LC_ALL PATH
unset CFLAGS CXXFLAGS
EOF
user $source ~/.bash_profile

setup host and target variables.

http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/ppc64-64/final-preps/variables.html

user $ export CLFS_HOST=$(echo ${MACHTYPE} | sed -e 's/-[^-]*/-cross/')
user $ export CLFS_TARGET="powerpc64-unknown-linux-gnu"
user $ export BUILD64="-m64"
user $ cat >> ~/.bashrc << EOF
export CLFS_HOST="${CLFS_HOST}"
export CLFS_TARGET="${CLFS_TARGET}"
export BUILD64="${BUILD64}"
EOF

link the sources directory to your clfs ~ home work space:

user $ ln -sv ${CLFS}/sources .

http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/ppc64-64/cross-tools/introduction.html

user $ tar -xf file-5.19.tar.gz && cd file-5.19

compile according to the page. http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/ppc64-64/cross-tools/file.html

user $ ./configure --prefix=/cross-tools --disable-static && make && make install

once finished compiling, go back down a level and remove the source directory:

user $ cd .. && rm -rf file-5.19

install the linux headers. ch 5.3

user $ wget https://trac.clfs.org/export/a4a0c7f1cd78df350da9e28b1d8f496702356e0f/patches/patch-3.14.21.xz
user $ tar -xf linux-3.14.tar.xz && cd linux-3.14
user $ xzcat ../patch-3.14.21.xz | patch -Np1 -i -
user $ make mrproper
user $ make ARCH=powerpc headers_check
user $ make ARCH=powerpc INSTALL_HDR_PATH=/tools headers_install

ch 5.4

user $ wget https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.xz
user $ tar -xf m4-1.4.19.tar.xz && cd m4-1.4.19
user $ ./configure --prefix=/cross-tools && make && make install

ch 5.5

user $ wget https://ftp.gnu.org/gnu/ncurses/ncurses-6.3.tar.gz
user $ tar -xf ncurses-6.3.tar.gz && cd ncurses-6.3
user $ ./configure --prefix=/cross-tools --without-debug --without-shared && make -C include && make -C progs tic && install -v -m755 progs/tic /cross-tools/bin

ch 5.6

user $ tar -xf pkg-config-lite-0.28-1.tar.gz && cd pkg-config-lite-0.28-1
user $ ./configure --prefix=/cross-tools --host=${CLFS_TARGET} --with-pc-path=/tools/lib/pkgconfig:/tools/share/pkgconfig && make && make install
user $ cd .. && rm -rf pkg-config-lite-0.28-1

ch 5.7 this package suggests using make check, it's optional but it's good practice to ensure it's working.

user $ wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz
user $ tar -xf gmp-6.2.1.tar.xz && cd gmp-6.2.1
user $ ./configure --prefix=/cross-tools --enable-cxx --disable-static && make && make install
user $ make check
user $ cd .. && rm -rf gmp-6.2.1

ch 5.8

user $ tar -xf mpfr-3.1.2.tar.xz && cd mpfr-3.1.2
user $ patch -Np1 -i ../mpfr-3.1.2-fixes-4.patch
user $ LDFLAGS="-Wl,-rpath,/cross-tools/lib" ./configure --prefix=/cross-tools --disable-static --with-gmp=/cross-tools && make && make install
user $ cd .. && rm -rf mpfr-3.1.2

ch 5.9

user $ wget https://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz
user $ tar -xf mpc-1.0.2.tar.gz && cd mpc-1.0.2
user $ LDFLAGS="-Wl,-rpath,/cross-tools/lib" ./configure --prefix=/cross-tools --disable-static --with-gmp=/cross-tools --with-mpfr=/cross-tools && make && make install
user $ cd .. && rm -rf mpc-1.0.2

ch 5.10

this needs to be updated to isl 0.15 or 16 for gcc 8 series later on.

user $ tar -xf isl-0.12.2.tar.lzma && cd isl-0.12.2
user $ LDFLAGS="-Wl,-rpath,/cross-tools/lib" ./configure --prefix=/cross-tools --disable-static     --with-gmp-prefix=/cross-tools && make && make install
user $ cd .. && rm -rf isl-0.12.2

ch 5.11

user $ tar -xf cloog-0.18.2.tar.gz && cd cloog-0.18.2
user $ LDFLAGS="-Wl,-rpath,/cross-tools/lib" ./configure --prefix=/cross-tools --disable-static --with-gmp-prefix=/cross-tools --with-isl-prefix=/cross-tools
user $ cp -v Makefile{,.orig} && sed '/cmake/d' Makefile.orig > Makefile && make && make install
user $ cd .. && rm -rf cloog-0.18.2

ch 5.12

bin utils needs to be built in an external directory.

user $ tar -xf binutils-2.24.tar.bz2 && cd binutils-2.24
user $ mkdir -v ../binutils-build && cd ../binutils-build
user $ AR=ar AS=as ../binutils-2.24/configure     --prefix=/cross-tools --host=${CLFS_HOST} --target=${CLFS_TARGET}     --with-sysroot=${CLFS} --with-lib-path=/tools/lib --disable-nls     --disable-static --enable-64-bit-bfd --disable-multilib --disable-werror && make && make install
user $ cd .. && rm -rf binutils-build && rm -rf binutils-2.24

ch 5.13

gcc static:

user $ tar -xf gcc-8.1.0.tar.bz2 && cd gcc-8.1.0
user $ echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/rs6000/sysv4.h && echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/rs6000/sysv4.h
user $ touch /tools/include/limits.h && mkdir -v ../gcc-build && cd ../gcc-build
user $ AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
    ../gcc-8.1.0/configure --prefix=/cross-tools \
    --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \
    --with-sysroot=${CLFS} --with-local-prefix=/tools \
    --with-native-system-header-dir=/tools/include --disable-nls \
    --disable-shared --with-mpfr=/cross-tools --with-gmp=/cross-tools \
    --with-isl=/cross-tools --with-cloog=/cross-tools --with-mpc=/cross-tools \
    --without-headers --with-newlib --disable-decimal-float --disable-libgomp \
    --disable-libmudflap --disable-libssp --disable-libatomic --disable-libitm \
    --disable-libsanitizer --disable-libquadmath --disable-threads \
    --disable-multilib --disable-target-zlib --with-system-zlib \
    --enable-languages=c --enable-checking=release
user $ make all-gcc all-target-libgcc && make install-gcc install-target-libgcc
user $ cd .. && rm -rf gcc-8.1.0 && rm -rf gcc-build

ch 5.14

glib c

user $ tar -xf glibc-2.19.tar.xz && cd glibc-2.19
user $ cp -v timezone/Makefile{,.orig} && sed 's/\\$$(pwd)/`pwd`/' timezone/Makefile.orig > timezone/Makefile
user $ mkdir -v ../glibc-build && cd ../glibc-build
user $ echo "libc_cv_ssp=no" > config.cache
user $ BUILD_CC="gcc" CC="${CLFS_TARGET}-gcc ${BUILD64}" \
      AR="${CLFS_TARGET}-ar" RANLIB="${CLFS_TARGET}-ranlib" \
      ../glibc-2.19/configure --prefix=/tools \
      --host=${CLFS_TARGET} --build=${CLFS_HOST} \
      --disable-profile --enable-kernel=2.6.32 \
      --with-binutils=/cross-tools/bin --with-headers=/tools/include \
      --enable-obsolete-rpc --cache-file=config.cache && make && make install
user $ cd .. && rm -rf glibc-build && rm -rf glibc-2.19

ch 5.15

gcc final pass

user $ tar -xf gcc-8.1.0.tar.xz && cd gcc-8.1.0
user $ echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/rs6000/sysv4.h && echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/rs6000/sysv4.h
user $ mkdir -v ../gcc-build && cd ../gcc-build
user $ AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
    ../gcc-8.1.0/configure --prefix=/cross-tools \
    --build=${CLFS_HOST} --target=${CLFS_TARGET} --host=${CLFS_HOST} \
    --with-sysroot=${CLFS} --with-local-prefix=/tools \
    --with-native-system-header-dir=/tools/include --disable-nls \
    --disable-static --enable-languages=c,c++ --enable-__cxa_atexit \
    --enable-threads=posix --disable-multilib \
    --with-mpc=/cross-tools --with-mpfr=/cross-tools --with-gmp=/cross-tools \
    --with-cloog=/cross-tools --with-isl=/cross-tools --with-system-zlib \
    --enable-checking=release --enable-libstdcxx-time
user $ make AS_FOR_TARGET="${CLFS_TARGET}-as" LD_FOR_TARGET="${CLFS_TARGET}-ld" && make install
user $ cd .. && rm -rf gcc-build && rm -rf gcc-8.1.0

ch 6

ch 6.2

export CC="${CLFS_TARGET}-gcc ${BUILD64}"
export CXX="${CLFS_TARGET}-g++ ${BUILD64}"
export AR="${CLFS_TARGET}-ar"
export AS="${CLFS_TARGET}-as"
export RANLIB="${CLFS_TARGET}-ranlib"
export LD="${CLFS_TARGET}-ld"
export STRIP="${CLFS_TARGET}-strip"
echo export CC=\""${CC}\"" >> ~/.bashrc
echo export CXX=\""${CXX}\"" >> ~/.bashrc
echo export AR=\""${AR}\"" >> ~/.bashrc
echo export AS=\""${AS}\"" >> ~/.bashrc
echo export RANLIB=\""${RANLIB}\"" >> ~/.bashrc
echo export LD=\""${LD}\"" >> ~/.bashrc
echo export STRIP=\""${STRIP}\"" >> ~/.bashrc

ch 6.3

problemz =(

user $ tar -xf gmp-6.0.0a.tar.xz && cd gmp-6.0.0
user $ CC_FOR_BUILD=gcc ./configure --prefix=/tools --build=${CLFS_HOST} --host=${CLFS_TARGET} --enable-cxx && make && make install