Skip to content

Commit

Permalink
Upload last of the instructions for the 64-bit toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
dslm4515 committed Nov 3, 2018
1 parent 3c5fe89 commit c5a6ddf
Show file tree
Hide file tree
Showing 27 changed files with 604 additions and 0 deletions.
26 changes: 26 additions & 0 deletions plain-text/x86_64-chunks/013-Tool_Chain-Binutils_Pass2
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Tool Chain: Binutils PASS 2 of 2
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"
mkdir -v build && cd build
../configure \
--target=${MLFS_TARGET} \
--build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools \
--disable-nls \
--disable-werror \
--with-lib-path=/tools/lib \
--with-sysroot

PATH=/bin:/usr/bin:/cross-tools/bin:/tools/bin make
make install
make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib
cp -v ld/ld-new /tools/bin
74 changes: 74 additions & 0 deletions plain-text/x86_64-chunks/014-Tool_Chain-GCC_Pass2
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Tool Chain: GCC-8.2.0 PASS 2 of 2
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

tar -xf ../mpfr-4.0.1.tar.xz
mv -v mpfr-4.0.1 mpfr
tar -xf ../gmp-6.1.2.tar.xz
mv -v gmp-6.1.2 gmp
tar -xf ../mpc-1.1.0.tar.gz
mv -v mpc-1.1.0 mpc

# Apply patches from Void-Linux
patch -Np0 -i ../gcc-8.2.0-void-0016-invalid_tls_model.diff
patch -Np0 -i ../gcc-8.2.0-void-fix-cxxflags-passing.patch
patch -Np0 -i ../gcc-8.2.0-void-fix-musl-execinfo.patch
patch -Np0 -i ../gcc-8.2.0-void-no-stack_chk_fail_local.patch

cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
`dirname $($MLFS_TARGET-gcc -print-libgcc-file-name)`/include-fixed/limits.h
for file in gcc/config/{linux,i386/linux{,64}}.h
do
cp -uv $file{,.orig}
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g' $file.orig > $file
echo '
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
touch $file.orig
done

case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
-i.orig gcc/config/i386/t-linux64
;;
esac

mkdir -v build && cd build
../configure \
--target=${MLFS_TARGET} \
--build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--enable-languages=c,c++ \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-bootstrap \
--disable-libgomp \
--disable-libmpx \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-symvers \
--disable-libitm \
--disable-gnu-indirect-function \
--disable-libmudflap \
--disable-libsanitizer \
--disable-libcilkrts

PATH=/bin:/usr/bin:/cross-tools/bin:/tools/bin make

make install
ln -sv gcc /tools/bin/cc
23 changes: 23 additions & 0 deletions plain-text/x86_64-chunks/015-Tool_Chain-TCL
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Tool Chain: TCL
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

cd unix
ac_cv_func_strtod=yes \
tcl_cv_strtod_buggy=1 \
./configure --build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools

make && make install

chmod -v u+w /tools/lib/libtcl8.6.so
make install-private-headers
ln -sv tclsh8.6 /tools/bin/tcls
26 changes: 26 additions & 0 deletions plain-text/x86_64-chunks/016-Tool_Chain-Expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

patch -Np1 -i ../expect-5.45.3-dont-put-toolchain-in-libpath.patch
patch -Np1 -i ../expect-5.45.3-dont-configure-testsuites.patch
patch -Np1 -i ../expect-5.45.3-allow-cross-compile.patch

cp -v ../config.guess-musl tclconfig/config.guess
cp -v ../config.sub-musl tclconfig/config.sub
cp -v configure{,.orig}
sed 's:/usr/local/bin:/bin:' configure.orig > configure

./configure --build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools \
--with-tcl=/tools/lib \
--with-tclinclude=/tools/include

make && make SCRIPTS="" install
16 changes: 16 additions & 0 deletions plain-text/x86_64-chunks/017-Tool_Chain-DejaGNU
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Toolchain: DejaGNU
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

./configure --build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools

make && make install
16 changes: 16 additions & 0 deletions plain-text/x86_64-chunks/018-Tool_Chain-M4
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Toolchain: M4
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

./configure --prefix=/tools \
--build=${MLFS_HOST} \
--host=${MLFS_TARGET}

make && make install
23 changes: 23 additions & 0 deletions plain-text/x86_64-chunks/019-Tool_Chain-Ncurses
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Toolchain: Ncurses
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in
./configure --prefix=/tools \
--build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--with-shared \
--without-debug \
--without-ada \
--enable-widec \
--enable-overwrite \
--with-build-cc="gcc -D_GNU_SOURCE"

make && make install
33 changes: 33 additions & 0 deletions plain-text/x86_64-chunks/020-Tool_Chain-Bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Toolchain: Bash
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

cat > config.cache << "EOF"
ac_cv_func_mmap_fixed_mapped=yes
ac_cv_func_strcoll_works=yes
ac_cv_func_working_mktime=yes
bash_cv_func_sigsetjmp=present
bash_cv_getcwd_malloc=yes
bash_cv_job_control_missing=present
bash_cv_printf_a_format=yes
bash_cv_sys_named_pipes=present
bash_cv_ulimit_maxfds=yes
bash_cv_under_sys_siglist=yes
bash_cv_unusable_rtsigs=no
gt_cv_int_divbyzero_sigfpe=yes
EOF

./configure --prefix=/tools \
--without-bash-malloc \
--build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--cache-file=config.cache

make && make install
16 changes: 16 additions & 0 deletions plain-text/x86_64-chunks/021-Tool_Chain-Bison
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Toolchain: Bison
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

./configure --build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools

make && make install
21 changes: 21 additions & 0 deletions plain-text/x86_64-chunks/022-Tool_Chain-Bzip2
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ToolChain: Bzip2
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

cp Makefile{,.orig}
sed -e "/^all:/s/ test//" Makefile.orig > Makefile
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile

make -f Makefile-libbz2_so CC="${CC}" AR="${AR}" RANLIB="${RANLIB}"
make clean
make CC="${CC}" AR="${AR}" RANLIB="${RANLIB}"

make PREFIX=/tools install
33 changes: 33 additions & 0 deletions plain-text/x86_64-chunks/023-Tool_Chain-Coreutils
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Toolchain: Coreutils
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

autoreconf -vif

cat > config.cache << EOF
fu_cv_sys_stat_statfs2_bsize=yes
gl_cv_func_rename_trailing_slash_bug=no
gl_cv_func_mbrtowc_incomplete_state=yes
gl_cv_func_mbrtowc_nul_retval=yes
gl_cv_func_mbrtowc_null_arg=yes
gl_cv_func_mbrtowc_retval=yes
gl_cv_func_btowc_eof=yes
gl_cv_func_wcrtomb_retval=yes
gl_cv_func_wctob_works=yes
EOF

sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk

./configure --build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools \
--cache-file=config.cache

make && make install
16 changes: 16 additions & 0 deletions plain-text/x86_64-chunks/024-Tool_Chain-Diffutils
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Toolchain Diffutils
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

./configure --build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools

make && make install
19 changes: 19 additions & 0 deletions plain-text/x86_64-chunks/025-Tool_Chain-File
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Toolchain: File
# Build and install as mlfs
# Must use same version for cross-tools, tools,
# and final system.

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

./configure --build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools

make && make install

16 changes: 16 additions & 0 deletions plain-text/x86_64-chunks/026-Tool_Chain-Findutils
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Toolchain: Findutils
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

./configure --build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools

make && make install
16 changes: 16 additions & 0 deletions plain-text/x86_64-chunks/027-Tool_Chain-Gawk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Toolchain: Gawk
# Build and install as mlfs

export CC="${MLFS_TARGET}-gcc"
export CXX="${MLFS_TARGET}-g++"
export AR="${MLFS_TARGET}-ar"
export AS="${MLFS_TARGET}-as"
export RANLIB="${MLFS_TARGET}-ranlib"
export LD="${MLFS_TARGET}-ld"
export STRIP="${MLFS_TARGET}-strip"

./configure --build=${MLFS_HOST} \
--host=${MLFS_TARGET} \
--prefix=/tools

make && make install
Loading

0 comments on commit c5a6ddf

Please sign in to comment.