Skip to content

Instantly share code, notes, and snippets.

@coypoop
Created May 27, 2018 16:41
Show Gist options
  • Save coypoop/2e241754bb136b55dae168b706cc6aaf to your computer and use it in GitHub Desktop.
Save coypoop/2e241754bb136b55dae168b706cc6aaf to your computer and use it in GitHub Desktop.
cross compilation setup
Unpack ~/gcc
Unpack ~/binutils-gdb
Unpack ~/alpha/destdir.alpha, base and comp for openbsd/alpha.
Unpack /usr/pkgsrc
Install GNU sed (as gsed), makeinfo, gmake
Convenience: sudo, gmake, bsdtar.
for i in gmp mpcomplex mpfr; do make fetch -C /usr/pkgsrc/*/$i; done
rm -rf /tmp/binutils-build/
mkdir /tmp/binutils-build/
cd /tmp/binutils-build/
~/binutils-gdb/configure --disable-nls --target=alpha--openbsd --with-build-sysroot=/home/fly/alpha/destdir.alpha --with-sysroot=/home/fly/alpha/destdir.alpha/ --without-gdb MAKEINFO=/usr/pkg/bin/makeinfo
gmake -j20
sudo gmake install
cd ~/gcc
rm -rf gmp mpfr mpc
gmake distclean
git clean -xf
git reset --hard
bsdtar xf /usr/pkgsrc/distfiles/gmp-*.tar.bz2
bsdtar xf /usr/pkgsrc/distfiles/mpc-*.tar.gz
bsdtar xf /usr/pkgsrc/distfiles/mpfr-*.tar.bz2
mv mpc-*/ mpc
mv mpfr-*/ mpfr
mv gmp-*/ gmp
rm -rf /tmp/build
mkdir /tmp/build
cd /tmp/build
# Might not be necessary, this one is for netbsd
export ac_cv_func_freelocale=no
export ac_cv_func_newlocale=no
export ac_cv_func_uselocale=no
#export CFLAGS_FOR_TARGET="-O0 -g -ggdb3"
#export CXXFLAGS_FOR_TARGET="-O0 -g -ggdb3"
#export CFLAGS="-O0 -g -ggdb3"
#export CXXFLAGS="-O0 -g -ggdb3"
export PATH=/usr/local/bin/:$PATH
~/gcc/configure --disable-libssp --disable-nls --target=alpha--openbsd --with-build-sysroot=/home/fly/alpha/destdir.alpha/ --with-sysroot=/home/fly/alpha/destdir.alpha/ --with-as=/usr/local/bin/alpha--openbsd-as --with-ar=/usr/local/bin/alpha--openbsd-ar --with-ld=/usr/local/bin/alpha--openbsd-ld MAKEINFO=/usr/pkg/bin/makeinfo SED=/usr/pkg/bin/gsed --enable-shared
gmake -j10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment