Commit 3e96627e authored by Marian Buschsieweke's avatar Marian Buschsieweke Committed by Rasmus Thomsen
Browse files

community/gcc-avr: fix paths & other issues

- change path of toolchain to /usr/avr/{lib,include} to match binutils
- compile with --with-avrlibc
    - add patch to avoid stage-1 packages of gcc and avrlibc, as this
      for AVR not needed
- fix license specifier
- use system isl
parent 1ad89e5d
......@@ -7,13 +7,14 @@ pkgrel=0
pkgdesc="The GNU Compiler Collection for AVR targets"
url="https://gcc.gnu.org/"
depends="binutils-avr"
makedepends="bash linux-headers gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends="bash linux-headers gmp-dev mpfr-dev mpc1-dev zlib-dev isl-dev"
arch="all"
license="GPL LGPL"
license="GPL-3.0-or-later"
subpackages="$pkgname-doc"
_islver=0.18
source="https://mirrors.kernel.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz
http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2"
source="
https://mirrors.kernel.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz
fix-no-system-headers.patch
"
builddir="$srcdir/gcc-$pkgver"
_workingdir="$builddir/build"
......@@ -22,18 +23,18 @@ build() {
mkdir "$_workingdir"
cd "$_workingdir"
# link isl for in-tree build
ln -s "$srcdir"/isl-"$_islver" "$builddir"/isl
export CFLAGS_FOR_TARGET='-pipe'
export CXXFLAGS_FOR_TARGET='-pipe'
"$builddir"/configure \
--build="$CBUILD" \
--target=avr \
--prefix=/usr \
--with-sysroot=/usr/avr \
--with-native-system-header-dir=/include \
--with-headers=/usr/avr/include \
--with-python-dir=share/gcc-avr \
--libexecdir=/usr/lib \
--enable-languages=c,c++ \
--enable-ld=default \
--enable-__cxa_atexit \
--disable-install-libiberty \
--disable-libssp \
......@@ -42,14 +43,12 @@ build() {
--disable-linker-build-id \
--disable-nls \
--disable-werror \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--with-as=/usr/bin/avr-as \
--with-gnu-as \
--with-gnu-ld \
--with-ld=/usr/bin/avr-ld \
--with-system-zlib \
--with-isl
--with-isl \
--with-avrlibc \
--with-pkgversion='Alpine Linux'
make
}
......@@ -62,4 +61,4 @@ package() {
}
sha512sums="42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e gcc-10.2.0.tar.xz
85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94 isl-0.18.tar.bz2"
358cb41e6a8612f5c96f27ed573354a909253565caa200af8959d90cf21e0ddbee219f6281fc3917ead1f85c5ec7111162f9b075c3e478df56a2fad505bce5f1 fix-no-system-headers.patch"
The normal process of building a cross compilation toolchain is:
1. build GCC without the standard C lib
2. build the standard C lib
3. rebuild GCC
4. rebuild the standard C lib with the new GCC
But for AVR, GCC can be build successfully without (a provisionally version of)
the standard C headers available - likely due to the lack of libstdc++ support
for AVR. But we still need to remove the check to allow for this.
--- gcc-10.2.0.orig/gcc/Makefile.in
+++ gcc-10.2.0/gcc/Makefile.in
@@ -3156,13 +3156,6 @@
sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
fix_dir=include-fixed$${multi_dir}; \
- if ! $(inhibit_libc) && test ! -d ${BUILD_SYSTEM_HEADER_DIR}; then \
- echo The directory that should contain system headers does not exist: >&2 ; \
- echo " ${BUILD_SYSTEM_HEADER_DIR}" >&2 ; \
- tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
- if test "x${BUILD_SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \
- then sleep 1; else exit 1; fi; \
- fi; \
$(mkinstalldirs) $${fix_dir}; \
chmod a+rx $${fix_dir} || true; \
(TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment