diff --git a/testing/racket/0001-Ensure-that-the-GMP-ARM-extra-file-has-the-correct-e.patch b/testing/racket/0001-Ensure-that-the-GMP-ARM-extra-file-has-the-correct-e.patch
new file mode 100644
index 0000000000000000000000000000000000000000..873e4faf46de652dcaf75702ca43686b0d11b463
--- /dev/null
+++ b/testing/racket/0001-Ensure-that-the-GMP-ARM-extra-file-has-the-correct-e.patch
@@ -0,0 +1,133 @@
+From 8ff7b4cc86dcd0addcead1b36febae82fa9d4b40 Mon Sep 17 00:00:00 2001
+From: Paulo Matos <pmatos@linki.tools>
+Date: Tue, 12 May 2020 21:04:59 +0200
+Subject: [PATCH] Ensure that the GMP ARM extra file has the correct extension
+ (#3178)
+
+* Ensure that the GMP ARM extra file has the correct extension
+
+We hardcoded in some places the extension of the GMP ARM extra file
+with .o, however the Makefile rule to build the file will use .lo is
+--enable-shared is enabled. This commit fixes the discrepancy by not
+hardcoding the extension anywhere.
+
+Fixes #3176
+
+* Avoid gnu make extension
+
+* Replace spaces to conform with other lines
+
+* Ensure we only add extension if file is needed
+
+* Move the LTO definition to the configure.ac
+
+* Carry the LTO variable into the Makefile
+
+* Fix variable reference
+
+* Add variable definition to gc2 Makefile
+
+* annotate assignment
+---
+ racket/src/cfg-racket             | 6 +++---
+ racket/src/racket/configure.ac    | 6 +++---
+ racket/src/racket/gc2/Makefile.in | 1 +
+ racket/src/racket/src/Makefile.in | 4 +++-
+ 4 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/racket/src/cfg-racket b/racket/src/cfg-racket
+index fb875a897a..321479a48f 100755
+--- a/racket/src/cfg-racket
++++ b/racket/src/cfg-racket
+@@ -4887,7 +4887,7 @@ case "$host_os" in
+       ppc|powerpc)
+        ;;
+       alpha)
+-       EXTRA_GMP_OBJ="gmp_alpha_gcc.o"
++       EXTRA_GMP_OBJ='gmp_alpha_gcc.$(LTO)'
+        EXTRA_GMP_DEP='$(EXTRA_GMP_DEP_FILE)'
+        ;;
+       i386|i486|i586|i686)
+@@ -4895,7 +4895,7 @@ case "$host_os" in
+        check_for_unwind=REG_ESP
+        ;;
+       arm*)
+-       EXTRA_GMP_OBJ="gmp_arm_gcc.o"
++       EXTRA_GMP_OBJ='gmp_arm_gcc.$(LTO)'
+        EXTRA_GMP_DEP='$(EXTRA_GMP_DEP_FILE)'
+        ;;
+       *)
+@@ -4907,7 +4907,7 @@ case "$host_os" in
+     if test "$CC" = "cc" ; then
+       COMPFLAGS="$COMPFLAGS -ieee_with_inexact -assume noaligned_objects"
+     elif test "$CC" = "gcc" ; then
+-      EXTRA_GMP_OBJ="gmp_alpha_gcc.o"
++      EXTRA_GMP_OBJ='gmp_alpha_gcc.$(LTO)'
+       EXTRA_GMP_DEP='$(EXTRA_GMP_DEP_FILE)'
+     fi
+     ;;
+diff --git a/racket/src/racket/configure.ac b/racket/src/racket/configure.ac
+index 6d24ce52dc..a2f43a9a87 100644
+--- a/racket/src/racket/configure.ac
++++ b/racket/src/racket/configure.ac
+@@ -612,7 +612,7 @@ case "$host_os" in
+       ppc|powerpc)
+        ;;
+       alpha)
+-       EXTRA_GMP_OBJ="gmp_alpha_gcc.o"
++       EXTRA_GMP_OBJ='gmp_alpha_gcc.$(LTO)'
+        EXTRA_GMP_DEP='$(EXTRA_GMP_DEP_FILE)'
+        ;;
+       i386|i486|i586|i686)
+@@ -620,7 +620,7 @@ case "$host_os" in
+        check_for_unwind=REG_ESP
+        ;;
+       arm*)
+-       EXTRA_GMP_OBJ="gmp_arm_gcc.o"
++       EXTRA_GMP_OBJ='gmp_arm_gcc.$(LTO)'
+        EXTRA_GMP_DEP='$(EXTRA_GMP_DEP_FILE)'
+        ;;
+       *)
+@@ -632,7 +632,7 @@ case "$host_os" in
+     if test "$CC" = "cc" ; then 
+       COMPFLAGS="$COMPFLAGS -ieee_with_inexact -assume noaligned_objects"
+     elif test "$CC" = "gcc" ; then 
+-      EXTRA_GMP_OBJ="gmp_alpha_gcc.o"
++      EXTRA_GMP_OBJ='gmp_alpha_gcc.$(LTO)'
+       EXTRA_GMP_DEP='$(EXTRA_GMP_DEP_FILE)'
+     fi
+     ;;
+diff --git a/racket/src/racket/gc2/Makefile.in b/racket/src/racket/gc2/Makefile.in
+index ef33c5881e..a89e933cb6 100644
+--- a/racket/src/racket/gc2/Makefile.in
++++ b/racket/src/racket/gc2/Makefile.in
+@@ -581,6 +581,7 @@ LIBRKTIO_FOR_DLL = $(LIBRKTIO_FOR_DLL_@LIBSFX@)
+ LIBRKTIO_FOR_LIB = $(LIBRKTIO_FOR_LIB_@LIBSFX@)
+ LIBRKTIO_UP_FOR_LIB = $(LIBRKTIO_UP_FOR_LIB_@LIBSFX@)
+ 
++LTO=@LTO@ # Need for replacement of EXTRA_GMP_OBJ which carries the variable
+ EXTRA_GMP_DEP_FILE = $(SRCDIR)/@EXTRA_GMP_OBJ@
+ EXTRA_GMP = @EXTRA_GMP_DEP@
+ 
+diff --git a/racket/src/racket/src/Makefile.in b/racket/src/racket/src/Makefile.in
+index 0602f92ec5..60b81ed297 100644
+--- a/racket/src/racket/src/Makefile.in
++++ b/racket/src/racket/src/Makefile.in
+@@ -13,6 +13,7 @@ CFLAGS = @CFLAGS@ @COMPFLAGS@ @PROFFLAGS@
+ CPPFLAGS = @PREFLAGS@
+ RKTIO_INC = -I$(srcdir)/../../rktio -I../../rktio
+ ALL_CFLAGS = $(CFLAGS) -I$(builddir)/.. -I$(srcdir)/../include  $(RKTIO_INC) $(CPPFLAGS) @OPTIONS@ @MZOPTIONS@
++LTO=@LTO@ # Need for replacement of EXTRA_GMP_OBJ which carries the variable
+ 
+ OBJS =  salloc.@LTO@ \
+ 	bignum.@LTO@ \
+@@ -71,7 +72,8 @@ OBJS =  salloc.@LTO@ \
+ 	type.@LTO@ \
+         unwind.@LTO@ \
+         validate.@LTO@ \
+-	vector.@LTO@  @EXTRA_GMP_OBJ@
++	vector.@LTO@ \
++	@EXTRA_GMP_OBJ@
+ 
+ SRCS =  $(srcdir)/salloc.c \
+ 	$(srcdir)/bignum.c \
diff --git a/testing/racket/APKBUILD b/testing/racket/APKBUILD
index 6fa22ffcd219081a0a446b1cd2839b554e97af59..c30a59aca669574f93b3d944cedaf335eb1db601 100644
--- a/testing/racket/APKBUILD
+++ b/testing/racket/APKBUILD
@@ -9,12 +9,17 @@ pkgver=7.7
 pkgrel=0
 pkgdesc="A general purpose programming language in the Lisp-Scheme family"
 url="https://racket-lang.org/"
-arch="all !armv7" # fails to build gmp_arm_gcc.o
+arch="all"
 license="LGPL-3.0-or-later MIT"
 depends="ca-certificates libcrypto1.1 libssl1.1"
 makedepends="chrpath libffi-dev libucontext-dev"
 subpackages="$pkgname-dev $pkgname-doc"
-source="https://download.racket-lang.org/releases/$pkgver/installers/racket-minimal-$pkgver-src.tgz"
+source="https://download.racket-lang.org/releases/$pkgver/installers/racket-minimal-$pkgver-src.tgz
+	0001-Ensure-that-the-GMP-ARM-extra-file-has-the-correct-e.patch"
+
+# XXX: Upstream repository uses a racket/ subdirectory, this can be
+# removed if the aport builds without any git format patches.
+patch_args="-p2"
 
 prepare() {
 	default_prepare
@@ -51,4 +56,5 @@ package() {
 	rm -Rf usr/share/applications
 }
 
-sha512sums="e683a2f90dc2f0a0f73d07319f9241359c85593d2e227183c604fa60c734bc922a0c184cae4934dc04f71b889f433c40902098b02c03078a3da8bb0a10c24e30  racket-minimal-7.7-src.tgz"
+sha512sums="e683a2f90dc2f0a0f73d07319f9241359c85593d2e227183c604fa60c734bc922a0c184cae4934dc04f71b889f433c40902098b02c03078a3da8bb0a10c24e30  racket-minimal-7.7-src.tgz
+ce29c2761ad69b8f9415e23080fa607bd45e8e8ac76394d8fde1e9f022aa58374651ebf3576de88c1280a3aeaae4c9921eaa66d3a950943eec4fe1528f10311a  0001-Ensure-that-the-GMP-ARM-extra-file-has-the-correct-e.patch"