aboutsummaryrefslogtreecommitdiffstats
path: root/community/gcc-avr
diff options
context:
space:
mode:
Diffstat (limited to 'community/gcc-avr')
-rw-r--r--community/gcc-avr/APKBUILD50
-rw-r--r--community/gcc-avr/fix-no-system-headers.patch27
2 files changed, 55 insertions, 22 deletions
diff --git a/community/gcc-avr/APKBUILD b/community/gcc-avr/APKBUILD
index 447119e1080..9b44ddd572a 100644
--- a/community/gcc-avr/APKBUILD
+++ b/community/gcc-avr/APKBUILD
@@ -2,18 +2,19 @@
# Contributor: Stefan Wagner <stw@bit-strickerei.de>
# Maintainer: Stefan Wagner <stw@bit-strickerei.de>
pkgname=gcc-avr
-pkgver=9.2.0
-pkgrel=0
+pkgver=12.2.0
+pkgrel=4
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"
-arch="all"
-license="GPL LGPL"
+makedepends="bash linux-headers gmp-dev mpfr-dev mpc1-dev zlib-dev isl-dev"
+arch="x86_64 aarch64 ppc64le x86"
+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,19 +23,24 @@ build() {
mkdir "$_workingdir"
cd "$_workingdir"
- # link isl for in-tree build
- ln -s "$srcdir"/isl-"$_islver" "$builddir"/isl
+ export CFLAGS_FOR_TARGET='-pipe -Os -ffunction-sections -fdata-sections'
+ export CXXFLAGS_FOR_TARGET='-pipe -Os -ffunction-sections -fdata-sections -fno-use-cxa-atexit'
- export CFLAGS_FOR_TARGET='-pipe'
- export CXXFLAGS_FOR_TARGET='-pipe'
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100431
+ export CFLAGS="$CFLAGS -Wno-error=format-security"
+ export CXXFLAGS="$CXXFLAGS -Wno-error=format-security"
+ export CPPFLAGS="$CPPFLAGS -Wno-error=format-security"
"$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-__cxa_atexit \
--disable-install-libiberty \
--disable-libssp \
--disable-libstdcxx-pch \
@@ -42,14 +48,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
}
@@ -61,5 +65,7 @@ package() {
find "$pkgdir"/usr/lib -type f -name "*.a" -exec /usr/bin/avr-strip --strip-debug '{}' \;
}
-sha512sums="a12dff52af876aee0fd89a8d09cdc455f35ec46845e154023202392adc164848faf8ee881b59b681b696e27c69fd143a214014db4214db62f9891a1c8365c040 gcc-9.2.0.tar.xz
-85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94 isl-0.18.tar.bz2"
+sha512sums="
+e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173 gcc-12.2.0.tar.xz
+358cb41e6a8612f5c96f27ed573354a909253565caa200af8959d90cf21e0ddbee219f6281fc3917ead1f85c5ec7111162f9b075c3e478df56a2fad505bce5f1 fix-no-system-headers.patch
+"
diff --git a/community/gcc-avr/fix-no-system-headers.patch b/community/gcc-avr/fix-no-system-headers.patch
new file mode 100644
index 00000000000..c007858fbfb
--- /dev/null
+++ b/community/gcc-avr/fix-no-system-headers.patch
@@ -0,0 +1,27 @@
+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}`; \