Skip to content
This repository was archived by the owner on Sep 29, 2022. It is now read-only.

Commit 2efb442

Browse files
committed
specfile + gfortran fixes
1 parent a69bede commit 2efb442

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

cross-compilers/compilers_generic/install-gcc.sh

+7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ pushd ${SRC_DIR}/.build/${CHOST}/build/build-cc-gcc-final/
1717
make -C ${CHOST}/libgcc prefix=${PREFIX} install
1818
# rm ${PREFIX}/lib/libgcc_s.so*
1919

20+
mkdir -p $PREFIX/$CHOST/sysroot/lib
21+
22+
cp ${SRC_DIR}/gcc_built/$CHOST/sysroot/lib/libgomp.so* $PREFIX/$CHOST/sysroot/lib
23+
if [ -e ${SRC_DIR}/gcc_built/$CHOST/sysroot/lib/libquadmath.so* ]; then
24+
cp ${SRC_DIR}/gcc_built/$CHOST/sysroot/lib/libquadmath.so* $PREFIX/$CHOST/sysroot/lib
25+
fi
26+
2027
make prefix=${PREFIX} install-libcc1
2128
install -d ${PREFIX}/share/gdb/auto-load/usr/lib
2229

cross-compilers/compilers_generic/install-gfortran.sh

+23-1
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,45 @@ export PATH=${SRC_DIR}/gcc_built/bin:${SRC_DIR}/.build/${CHOST}/buildtools/bin:$
99

1010
pushd $SRC_DIR/.build/$CHOST/build/build-cc-gcc-final/
1111

12-
make -C $CHOST/libgfortran prefix=$PREFIX install
12+
# adapted from Arch install script from https://github.com/archlinuxarm/PKGBUILDs/blob/master/core/gcc/PKGBUILD
13+
# We cannot make install since .la files are not relocatable so libtool deliberately prevents it:
14+
# libtool: install: error: cannot install `libgfortran.la' to a directory not ending in ${SRC_DIR}/work/gcc_built/${CHOST}/lib/../lib
15+
make -C $CHOST/libgfortran prefix=$PREFIX all-multi libgfortran.spec ieee_arithmetic.mod ieee_exceptions.mod ieee_features.mod config.h
1316
if [[ -d $CHOST/libgomp ]]; then
1417
make -C $CHOST/libgomp prefix=$PREFIX install-nodist_fincludeHEADERS
1518
fi
1619
make -C gcc prefix=$PREFIX fortran.install-{common,man,info}
1720
install -Dm755 gcc/f951 $PREFIX/${_libdir}/f951
1821

22+
mkdir -p $PREFIX/$CHOST/sysroot/lib
23+
cp $CHOST/libgfortran/libgfortran.spec $PREFIX/$CHOST/sysroot/lib
24+
1925
pushd $PREFIX/bin
2026
ln -s $CHOST-gfortran $CHOST-f95
2127
popd
2228

2329
popd
2430

31+
cp ${SRC_DIR}/gcc_built/$CHOST/sysroot/lib/libgfortran.so* $PREFIX/$CHOST/sysroot/lib
2532
# Install Runtime Library Exception
2633
install -Dm644 $SRC_DIR/.build/src/gcc-${PKG_VERSION}/COPYING.RUNTIME \
2734
${PREFIX}/share/licenses/gcc-fortran/RUNTIME.LIBRARY.EXCEPTION
2835

36+
# generate specfile so that we can patch loader link path
37+
# link_libgcc should have the gcc's own libraries by default (-R)
38+
# so that LD_LIBRARY_PATH isn't required for basic libraries.
39+
#
40+
# GF method here to create specs file and edit it. The other methods
41+
# tried had no effect on the result. including:
42+
# setting LINK_LIBGCC_SPECS on configure
43+
# setting LINK_LIBGCC_SPECS on make
44+
# setting LINK_LIBGCC_SPECS in gcc/Makefile
45+
specdir=`dirname $($PREFIX/bin/${CHOST}-gcc -print-libgcc-file-name -no-canonical-prefixes)`
46+
mv $PREFIX/bin/${CHOST}-gfortran $PREFIX/bin/${CHOST}-gfortran.bin
47+
echo '#!/bin/sh' > $PREFIX/bin/${CHOST}-gfortran
48+
echo $PREFIX/bin/${CHOST}-gfortran.bin -specs=$specdir/specs '"$@"' >> $PREFIX/bin/${CHOST}-gfortran
49+
chmod +x $PREFIX/bin/${CHOST}-gfortran
50+
2951
mkdir -p ${PREFIX}/etc/conda/{de,}activate.d
3052
cp "${SRC_DIR}"/activate-gfortran.sh ${PREFIX}/etc/conda/activate.d/activate-${PKG_NAME}.sh
3153
cp "${SRC_DIR}"/deactivate-gfortran.sh ${PREFIX}/etc/conda/deactivate.d/deactivate-${PKG_NAME}.sh

0 commit comments

Comments
 (0)