From 73a53c48901e120a06d221c8cb4f02076e3b9888 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 29 Jan 2019 14:38:49 -0500 Subject: Introduce real toolchain --- etc/pkgs/000-base.sh | 27 ------------------ etc/pkgs/000-dummy.sh | 0 etc/pkgs/001-gcc.sh | 9 ++++-- etc/pkgs/002-binutils.sh | 18 +++++++++--- etc/pkgs/003-openssh.sh | 73 ------------------------------------------------ etc/pkgs/003-openssl.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 94 insertions(+), 106 deletions(-) delete mode 100755 etc/pkgs/000-base.sh mode change 100644 => 100755 etc/pkgs/000-dummy.sh delete mode 100755 etc/pkgs/003-openssh.sh create mode 100755 etc/pkgs/003-openssl.sh (limited to 'etc/pkgs') diff --git a/etc/pkgs/000-base.sh b/etc/pkgs/000-base.sh deleted file mode 100755 index e32bbae..0000000 --- a/etc/pkgs/000-base.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -packages=( - gcc - gcc-c++ - gcc-gfortran - git - glibc - libuuid-devel - make - perl - pkgconfig - expat-devel - bzip2-devel - gdbm-devel - libffi-devel - ncurses-devel - openssl-devel - readline-devel - sqlite-devel - sudo - tcl-devel - tk-devel - which - xz-devel - zlib-devel -) -yum install -y "${packages[@]}" diff --git a/etc/pkgs/000-dummy.sh b/etc/pkgs/000-dummy.sh old mode 100644 new mode 100755 diff --git a/etc/pkgs/001-gcc.sh b/etc/pkgs/001-gcc.sh index 52c01da..21065cd 100755 --- a/etc/pkgs/001-gcc.sh +++ b/etc/pkgs/001-gcc.sh @@ -12,7 +12,7 @@ url_isl=http://isl.gforge.inria.fr/isl-${version_isl}.tar.bz2 version_cloog=0.18.4 url_cloog="http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-${version_cloog}.tar.gz" -sudo yum install -y wget +# Ensure 64-bit libraries go into /lib sudo ln -sf ${TOOLCHAIN_LIB} ${TOOLCHAIN}/lib64 curl -LO ${url} @@ -49,7 +49,7 @@ pushd ${bld} --prefix=${TOOLCHAIN} \ --libdir=${TOOLCHAIN_LIB} \ --libexecdir=${TOOLCHAIN_LIB} \ - --disable-bootstrap \ + --disable-static \ --disable-multilib \ --disable-werror \ --disable-libunwind-exceptions \ @@ -58,6 +58,8 @@ pushd ${bld} --with-system-zlib \ --with-isl \ --with-linker-hash-style=gnu \ + --with-tune=generic \ + --enable-bootstrap \ --enable-languages=c,c++,fortran,lto,go \ --enable-shared \ --enable-threads=posix \ @@ -78,6 +80,9 @@ pushd ${bld} make -j${_maxjobs} make install-strip + # Binutils build cannot use this static archive + rm -f "${TOOLCHAIN_LIB}/libiberty.a" + # Prevent ldconfig from picking up gdb python scripts autoload="${TOOLCHAIN_DATA}/gdb/auto-load${TOOLCHAIN_LIB}" mkdir -p "${autoload}" diff --git a/etc/pkgs/002-binutils.sh b/etc/pkgs/002-binutils.sh index bd119fe..83423be 100755 --- a/etc/pkgs/002-binutils.sh +++ b/etc/pkgs/002-binutils.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x name=binutils version=2.31.1 url=https://ftp.gnu.org/gnu/binutils/${name}-${version}.tar.gz @@ -10,7 +10,17 @@ mkdir -p binutils pushd binutils ../${name}-${version}/configure \ --prefix=${TOOLCHAIN} \ - --with-sysroot=${TOOLCHAIN} - make -j${_maxjobs} - make install + --target=x86_64-pc-linux-gnu \ + --enable-shared \ + --enable-lto \ + --enable-gold \ + --enable-ld=default \ + --enable-plugins \ + --enable-threads \ + --disable-static \ + --disable-multilib \ + --with-sysroot=/ \ + --with-tune=generic + make -j4 + make install-strip popd diff --git a/etc/pkgs/003-openssh.sh b/etc/pkgs/003-openssh.sh deleted file mode 100755 index 1f99fe8..0000000 --- a/etc/pkgs/003-openssh.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -set -e -set -x - -name="openssl" -version="1.1.0j" - -tarball="${name}-${version}.tar.gz" -dest="${tarball%%.tar.gz}" -url="https://www.openssl.org/source/${tarball}" -prefix="${TOOLCHAIN}" - - -function pre() -{ - curl -LO "${url}" - tar xf "${tarball}" -} - - -function get_system_cacert() { - local paths=( - /etc/ssl/cert.pem - /etc/ssl/cacert.pem - /etc/ssl/certs/cacert.pem - /etc/ssl/certs/ca-bundle.crt - ) - for bundle in "${paths[@]}" - do - if [[ -f ${bundle} ]]; then - echo "${bundle}" - break - fi - done -} - - -function build() -{ - pre - pushd "${dest}" - export PATH="${prefix}/bin:${PATH}" - export LDFLAGS="-Wl,-rpath=${prefix}/lib" - export KERNEL_BITS=64 - target="linux-x86_64" - - ./Configure \ - --prefix="${prefix}" \ - --openssldir="ssl" \ - --libdir="lib" \ - ${LDFLAGS} \ - ${target} \ - enable-ec_nistp_64_gcc_128 \ - zlib-dynamic \ - shared \ - no-ssl3-method - make - make install MANDIR="${prefix}/share/man" MANSUFFIX=ssl - popd - post -} - -function post() -{ - bundle=$(get_system_cacert) - install -D -m644 "${bundle}" "${prefix}/ssl/cert.pem" - rm -rf "${dest}" - rm -rf "${tarball}" - echo "All done." -} - -# Main -build diff --git a/etc/pkgs/003-openssl.sh b/etc/pkgs/003-openssl.sh new file mode 100755 index 0000000..c5aaabe --- /dev/null +++ b/etc/pkgs/003-openssl.sh @@ -0,0 +1,73 @@ +#!/bin/bash +set -e +set -x + +name="openssl" +version="1.1.0j" + +tarball="${name}-${version}.tar.gz" +dest="${tarball%%.tar.gz}" +url="https://www.openssl.org/source/${tarball}" +prefix="${TOOLCHAIN}" + + +function pre() +{ + curl -LO "${url}" + tar xf "${tarball}" +} + + +function get_system_cacert() { + local paths=( + /etc/ssl/cert.pem + /etc/ssl/cacert.pem + /etc/ssl/certs/cacert.pem + /etc/ssl/certs/ca-bundle.crt + ) + for bundle in "${paths[@]}" + do + if [[ -f ${bundle} ]]; then + echo "${bundle}" + break + fi + done +} + + +function build() +{ + pre + pushd "${dest}" + export PATH="${prefix}/bin:${PATH}" + export LDFLAGS="-Wl,-rpath=${prefix}/lib" + export KERNEL_BITS=64 + target="linux-x86_64" + + ./Configure \ + --prefix="${prefix}" \ + --openssldir="ssl" \ + --libdir="lib" \ + ${LDFLAGS} \ + ${target} \ + enable-ec_nistp_64_gcc_128 \ + zlib-dynamic \ + shared \ + no-ssl3-method + make -j${_maxjobs} + make install MANDIR="${prefix}/share/man" MANSUFFIX=ssl + popd + post +} + +function post() +{ + bundle=$(get_system_cacert) + install -D -m644 "${bundle}" "${prefix}/ssl/cert.pem" + rm -rf "${dest}" + rm -rf "${tarball}" + echo "All done." +} + +# Main +build -- cgit