diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2022-03-29 20:06:27 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-29 20:25:36 +0200 |
commit | 941d152a88d86808deb4797333b10d6c40440315 (patch) | |
tree | 72a250080c6f9b177c72d255d7aa1b998cae8a98 /Ports/zlib/patches | |
parent | 5da7ebb806cd3be5b126ec22bfda926c7319e4f7 (diff) | |
download | serenity-941d152a88d86808deb4797333b10d6c40440315.zip |
Ports: Stop zlib from trying to use the host linker
Backports an upstream fix for a bug that caused the host compiler to be
used for linking even though the cross-compiler was specified in the
`CC` environment variable.
This didn't cause an issue for SERENITY_ARCH=i686 on Linux hosts,
because seeing that the host linker couldn't deal with i686 objects, the
configure script fell back to generating only a static library. On
x86-64, the host toolchain was able to deal with the object files, but
tried to link those to host libraries. On macOS hosts, nothing worked.
Diffstat (limited to 'Ports/zlib/patches')
-rw-r--r-- | Ports/zlib/patches/ReadMe.md | 7 | ||||
-rw-r--r-- | Ports/zlib/patches/fix-cross-compilation.patch | 24 |
2 files changed, 31 insertions, 0 deletions
diff --git a/Ports/zlib/patches/ReadMe.md b/Ports/zlib/patches/ReadMe.md new file mode 100644 index 0000000000..0a17e81f54 --- /dev/null +++ b/Ports/zlib/patches/ReadMe.md @@ -0,0 +1,7 @@ +# Patches for zlib on SerenityOS + +## `fix-cross-compilation.patch` + +Backports an upstream fix for a bug that caused the host compiler to be used +for linking even though the cross-compiler was specified in the `CC` +environment variable. diff --git a/Ports/zlib/patches/fix-cross-compilation.patch b/Ports/zlib/patches/fix-cross-compilation.patch new file mode 100644 index 0000000000..0136071eab --- /dev/null +++ b/Ports/zlib/patches/fix-cross-compilation.patch @@ -0,0 +1,24 @@ +From 05796d3d8d5546cf1b4dfe2cd72ab746afae505d Mon Sep 17 00:00:00 2001 +From: Mark Adler <madler@alumni.caltech.edu> +Date: Mon, 28 Mar 2022 18:34:10 -0700 +Subject: [PATCH] Fix configure issue that discarded provided CC definition. + +--- + configure | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/configure b/configure +index 52ff4a04e..3fa3e8618 100755 +--- a/configure ++++ b/configure +@@ -174,7 +174,10 @@ if test -z "$CC"; then + else + cc=${CROSS_PREFIX}cc + fi ++else ++ cc=${CC} + fi ++ + cflags=${CFLAGS-"-O3"} + # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure + case "$cc" in |