From 6f4d9658c96f16a6a9ed5d577512a147adf4ccaf Mon Sep 17 00:00:00 2001
From: Olivier Benz <olivier.benz@b-data.ch>
Date: Wed, 11 Sep 2024 07:26:39 +0200
Subject: [PATCH] Update Dockerfiles

---
 prior/8.10.1.Dockerfile | 6 +++++-
 prior/8.10.4.Dockerfile | 6 +++++-
 prior/8.10.5.Dockerfile | 6 +++++-
 prior/8.10.6.Dockerfile | 6 +++++-
 prior/8.10.7.Dockerfile | 6 +++++-
 prior/8.8.4.Dockerfile  | 6 +++++-
 prior/9.0.1.Dockerfile  | 6 +++++-
 prior/9.0.2.Dockerfile  | 6 +++++-
 prior/9.2.1.Dockerfile  | 6 +++++-
 prior/9.2.2.Dockerfile  | 6 +++++-
 prior/9.2.3.Dockerfile  | 6 +++++-
 prior/9.2.4.Dockerfile  | 6 +++++-
 prior/9.2.5.Dockerfile  | 6 +++++-
 prior/9.2.6.Dockerfile  | 6 +++++-
 prior/9.2.7.Dockerfile  | 6 +++++-
 prior/9.2.8.Dockerfile  | 6 +++++-
 prior/9.4.1.Dockerfile  | 6 +++++-
 prior/9.4.2.Dockerfile  | 6 +++++-
 prior/9.4.3.Dockerfile  | 6 +++++-
 prior/9.4.4.Dockerfile  | 6 +++++-
 prior/9.4.5.Dockerfile  | 6 +++++-
 prior/9.4.6.Dockerfile  | 6 +++++-
 prior/9.4.7.Dockerfile  | 6 +++++-
 prior/9.4.8.Dockerfile  | 6 +++++-
 prior/9.6.1.Dockerfile  | 6 +++++-
 prior/9.6.2.Dockerfile  | 6 +++++-
 prior/9.6.3.Dockerfile  | 6 +++++-
 prior/9.6.4.Dockerfile  | 6 +++++-
 prior/9.6.5.Dockerfile  | 6 +++++-
 prior/9.6.6.Dockerfile  | 6 +++++-
 prior/9.8.1.Dockerfile  | 6 +++++-
 prior/9.8.2.Dockerfile  | 6 +++++-
 32 files changed, 160 insertions(+), 32 deletions(-)

diff --git a/prior/8.10.1.Dockerfile b/prior/8.10.1.Dockerfile
index 61f843f..c0b745a 100644
--- a/prior/8.10.1.Dockerfile
+++ b/prior/8.10.1.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/8.10.4.Dockerfile b/prior/8.10.4.Dockerfile
index 0f54ed3..d2460d8 100644
--- a/prior/8.10.4.Dockerfile
+++ b/prior/8.10.4.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/8.10.5.Dockerfile b/prior/8.10.5.Dockerfile
index bd82853..d941c03 100644
--- a/prior/8.10.5.Dockerfile
+++ b/prior/8.10.5.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/8.10.6.Dockerfile b/prior/8.10.6.Dockerfile
index b8f8a10..733d110 100644
--- a/prior/8.10.6.Dockerfile
+++ b/prior/8.10.6.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/8.10.7.Dockerfile b/prior/8.10.7.Dockerfile
index 699f6d7..0613096 100644
--- a/prior/8.10.7.Dockerfile
+++ b/prior/8.10.7.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/8.8.4.Dockerfile b/prior/8.8.4.Dockerfile
index 4aa8744..d993602 100644
--- a/prior/8.8.4.Dockerfile
+++ b/prior/8.8.4.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.0.1.Dockerfile b/prior/9.0.1.Dockerfile
index 166a5fd..ac747a5 100644
--- a/prior/9.0.1.Dockerfile
+++ b/prior/9.0.1.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.0.2.Dockerfile b/prior/9.0.2.Dockerfile
index 370ae55..ccc1f38 100644
--- a/prior/9.0.2.Dockerfile
+++ b/prior/9.0.2.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.2.1.Dockerfile b/prior/9.2.1.Dockerfile
index c293fa5..db66300 100644
--- a/prior/9.2.1.Dockerfile
+++ b/prior/9.2.1.Dockerfile
@@ -57,7 +57,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.2.2.Dockerfile b/prior/9.2.2.Dockerfile
index 8f4c702..2806487 100644
--- a/prior/9.2.2.Dockerfile
+++ b/prior/9.2.2.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && autoreconf \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.2.3.Dockerfile b/prior/9.2.3.Dockerfile
index 5775bde..2c848e1 100644
--- a/prior/9.2.3.Dockerfile
+++ b/prior/9.2.3.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && ./boot \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.2.4.Dockerfile b/prior/9.2.4.Dockerfile
index 1788641..60a1593 100644
--- a/prior/9.2.4.Dockerfile
+++ b/prior/9.2.4.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && ./boot \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.2.5.Dockerfile b/prior/9.2.5.Dockerfile
index 96dba36..79693f6 100644
--- a/prior/9.2.5.Dockerfile
+++ b/prior/9.2.5.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && ./boot \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.2.6.Dockerfile b/prior/9.2.6.Dockerfile
index 9f54254..ef7ac83 100644
--- a/prior/9.2.6.Dockerfile
+++ b/prior/9.2.6.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && ./boot \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.2.7.Dockerfile b/prior/9.2.7.Dockerfile
index 18c7ad5..3d622c7 100644
--- a/prior/9.2.7.Dockerfile
+++ b/prior/9.2.7.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && ./boot \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.2.8.Dockerfile b/prior/9.2.8.Dockerfile
index e4b665b..de4d4cf 100644
--- a/prior/9.2.8.Dockerfile
+++ b/prior/9.2.8.Dockerfile
@@ -52,7 +52,11 @@ RUN cd /tmp \
   && echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
   && echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
   && ./boot \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   ## Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   ## so we can match the llvm vendor string alpine uses
   && sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
diff --git a/prior/9.4.1.Dockerfile b/prior/9.4.1.Dockerfile
index 67d3ebb..5c82118 100644
--- a/prior/9.4.1.Dockerfile
+++ b/prior/9.4.1.Dockerfile
@@ -42,7 +42,11 @@ RUN cd /tmp \
   && tar xf ghc-$GHC_VERSION-src.tar.xz \
   && cd ghc-$GHC_VERSION \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Use the LLVM backend
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
diff --git a/prior/9.4.2.Dockerfile b/prior/9.4.2.Dockerfile
index 5772bf4..2e8261d 100644
--- a/prior/9.4.2.Dockerfile
+++ b/prior/9.4.2.Dockerfile
@@ -42,7 +42,11 @@ RUN cd /tmp \
   && tar xf ghc-$GHC_VERSION-src.tar.xz \
   && cd ghc-$GHC_VERSION \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Use the LLVM backend
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
diff --git a/prior/9.4.3.Dockerfile b/prior/9.4.3.Dockerfile
index 29bc62c..e07f2ad 100644
--- a/prior/9.4.3.Dockerfile
+++ b/prior/9.4.3.Dockerfile
@@ -42,7 +42,11 @@ RUN cd /tmp \
   && tar xf ghc-$GHC_VERSION-src.tar.xz \
   && cd ghc-$GHC_VERSION \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Use the LLVM backend
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
diff --git a/prior/9.4.4.Dockerfile b/prior/9.4.4.Dockerfile
index 60cc63d..9f6cd2d 100644
--- a/prior/9.4.4.Dockerfile
+++ b/prior/9.4.4.Dockerfile
@@ -42,7 +42,11 @@ RUN cd /tmp \
   && tar xf ghc-$GHC_VERSION-src.tar.xz \
   && cd ghc-$GHC_VERSION \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Use the LLVM backend
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
diff --git a/prior/9.4.5.Dockerfile b/prior/9.4.5.Dockerfile
index fcd37d3..ed9fc32 100644
--- a/prior/9.4.5.Dockerfile
+++ b/prior/9.4.5.Dockerfile
@@ -42,7 +42,11 @@ RUN cd /tmp \
   && tar xf ghc-$GHC_VERSION-src.tar.xz \
   && cd ghc-$GHC_VERSION \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Use the LLVM backend
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
diff --git a/prior/9.4.6.Dockerfile b/prior/9.4.6.Dockerfile
index 8437ba8..e4ceec5 100644
--- a/prior/9.4.6.Dockerfile
+++ b/prior/9.4.6.Dockerfile
@@ -43,7 +43,11 @@ RUN cd /tmp \
   && tar -xJf "ghc-$GHC_VERSION-src.tar.xz" \
   && cd "ghc-$GHC_VERSION" \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Use the LLVM backend
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
diff --git a/prior/9.4.7.Dockerfile b/prior/9.4.7.Dockerfile
index 3fe963d..957fd07 100644
--- a/prior/9.4.7.Dockerfile
+++ b/prior/9.4.7.Dockerfile
@@ -43,7 +43,11 @@ RUN cd /tmp \
   && tar -xJf "ghc-$GHC_VERSION-src.tar.xz" \
   && cd "ghc-$GHC_VERSION" \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Use the LLVM backend
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
diff --git a/prior/9.4.8.Dockerfile b/prior/9.4.8.Dockerfile
index dc12584..cb51ef5 100644
--- a/prior/9.4.8.Dockerfile
+++ b/prior/9.4.8.Dockerfile
@@ -43,7 +43,11 @@ RUN cd /tmp \
   && tar -xJf "ghc-$GHC_VERSION-src.tar.xz" \
   && cd "ghc-$GHC_VERSION" \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   ## Use the LLVM backend
   ## Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   ## so we can match the llvm vendor string alpine uses
diff --git a/prior/9.6.1.Dockerfile b/prior/9.6.1.Dockerfile
index c96949a..f156575 100644
--- a/prior/9.6.1.Dockerfile
+++ b/prior/9.6.1.Dockerfile
@@ -42,7 +42,11 @@ RUN cd /tmp \
   && tar -xJf "ghc-$GHC_VERSION-src.tar.xz" \
   && cd "ghc-$GHC_VERSION" \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Use the LLVM backend
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
diff --git a/prior/9.6.2.Dockerfile b/prior/9.6.2.Dockerfile
index 2d29a61..ce132bd 100644
--- a/prior/9.6.2.Dockerfile
+++ b/prior/9.6.2.Dockerfile
@@ -43,7 +43,11 @@ RUN cd /tmp \
   && tar -xJf "ghc-$GHC_VERSION-src.tar.xz" \
   && cd "ghc-$GHC_VERSION" \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   # Use the LLVM backend
   # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   # so we can match the llvm vendor string alpine uses
diff --git a/prior/9.6.3.Dockerfile b/prior/9.6.3.Dockerfile
index 57a940f..d5ed4c1 100644
--- a/prior/9.6.3.Dockerfile
+++ b/prior/9.6.3.Dockerfile
@@ -122,7 +122,11 @@ RUN cd /tmp \
   ## Install GHC
   && tar -xJf ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz \
   && cd ghc-"$GHC_VERSION"-*-alpine-linux \
-  && ./configure --disable-ld-override \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override \
   && make install \
   ## Install Stack
   && cd /tmp \
diff --git a/prior/9.6.4.Dockerfile b/prior/9.6.4.Dockerfile
index 8e298e8..d1fd92b 100644
--- a/prior/9.6.4.Dockerfile
+++ b/prior/9.6.4.Dockerfile
@@ -43,7 +43,11 @@ RUN cd /tmp \
   && tar -xJf "ghc-$GHC_VERSION-src.tar.xz" \
   && cd "ghc-$GHC_VERSION" \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   ## Use the LLVM backend
   ## Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   ## so we can match the llvm vendor string alpine uses
diff --git a/prior/9.6.5.Dockerfile b/prior/9.6.5.Dockerfile
index 0107db6..1340cf6 100644
--- a/prior/9.6.5.Dockerfile
+++ b/prior/9.6.5.Dockerfile
@@ -50,7 +50,11 @@ RUN cd /tmp \
   && patch -p0 <"$GHC_VERSION.patch" \
   ## Configure and build
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   ## Use the LLVM backend
   ## Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   ## so we can match the llvm vendor string alpine uses
diff --git a/prior/9.6.6.Dockerfile b/prior/9.6.6.Dockerfile
index 61004a9..52480b0 100644
--- a/prior/9.6.6.Dockerfile
+++ b/prior/9.6.6.Dockerfile
@@ -50,7 +50,11 @@ RUN cd /tmp \
   && patch -p0 <"$GHC_VERSION.patch" \
   ## Configure and build
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   ## Use the LLVM backend
   ## Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   ## so we can match the llvm vendor string alpine uses
diff --git a/prior/9.8.1.Dockerfile b/prior/9.8.1.Dockerfile
index 748b3e7..c831251 100644
--- a/prior/9.8.1.Dockerfile
+++ b/prior/9.8.1.Dockerfile
@@ -43,7 +43,11 @@ RUN cd /tmp \
   && tar -xJf "ghc-$GHC_VERSION-src.tar.xz" \
   && cd "ghc-$GHC_VERSION" \
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   ## Use the LLVM backend
   ## Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   ## so we can match the llvm vendor string alpine uses
diff --git a/prior/9.8.2.Dockerfile b/prior/9.8.2.Dockerfile
index 3d526bd..5c2b002 100644
--- a/prior/9.8.2.Dockerfile
+++ b/prior/9.8.2.Dockerfile
@@ -50,7 +50,11 @@ RUN cd /tmp \
   && patch -p0 <"$GHC_VERSION.patch" \
   ## Configure and build
   && ./boot.source \
-  && ./configure --disable-ld-override LD=ld.gold \
+  && ./configure \
+    --build=$(uname -m)-alpine-linux \
+    --host=$(uname -m)-alpine-linux \
+    --target=$(uname -m)-alpine-linux \
+    --disable-ld-override LD=ld.gold \
   ## Use the LLVM backend
   ## Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
   ## so we can match the llvm vendor string alpine uses
-- 
GitLab