Skip to content

Commit

Permalink
llvm_18, lld_18: Patch to support more OpenBSD sections
Browse files Browse the repository at this point in the history
Without these backports (I've ensured everything has landed upstream)
the OpenBSD binaries we build will not run.

(cherry picked from commit 62a46e8)
  • Loading branch information
Ericson2314 committed Jul 25, 2024
1 parent 6a68f91 commit 5eefee1
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion pkgs/development/compilers/llvm/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,23 @@ let
relative = "llvm";
hash = "sha256-Ot45P/iwaR4hkcM3xtLwfryQNgHI6pv6ADjv98tgdZA=";
})
]
++ lib.optionals (lib.versions.major metadata.release_version == "18") [
# Reorgs one test so the next patch applies
(fetchpatch {
name = "osabi-test-reorg.patch";
url = "https://github.com/llvm/llvm-project/commit/06cecdc60ec9ebfdd4d8cdb2586d201272bdf6bd.patch";
stripLen = 1;
hash = "sha256-s9GZTNgzLS511Pzh6Wb1hEV68lxhmLWXjlybHBDMhvM=";
})
# Sets the OSABI for OpenBSD, needed for an LLD patch for OpenBSD.
# https://github.com/llvm/llvm-project/pull/98553
(fetchpatch {
name = "mc-set-openbsd-osabi.patch";
url = "https://github.com/llvm/llvm-project/commit/b64c1de714c50bec7493530446ebf5e540d5f96a.patch";
stripLen = 1;
hash = "sha256-fqw5gTSEOGs3kAguR4tINFG7Xja1RAje+q67HJt2nGg=";
})
];
pollyPatches =
[ (metadata.getVersionFile "llvm/gnu-install-dirs-polly.patch") ]
Expand Down Expand Up @@ -305,7 +322,16 @@ let
)
++ lib.optional (
lib.versionAtLeast metadata.release_version "16" && lib.versionOlder metadata.release_version "18"
) (metadata.getVersionFile "lld/add-table-base.patch");
) (metadata.getVersionFile "lld/add-table-base.patch")
++ lib.optional (lib.versions.major metadata.release_version == "18") (
# https://github.com/llvm/llvm-project/pull/97122
fetchpatch {
name = "more-openbsd-program-headers.patch";
url = "https://github.com/llvm/llvm-project/commit/d7fd8b19e560fbb613159625acd8046d0df75115.patch";
stripLen = 1;
hash = "sha256-7wTy7XDTx0+fhWQpW1KEuz7xJvpl42qMTUfd20KGOfA=";
}
);
};

lldb = callPackage ./lldb.nix (
Expand Down

0 comments on commit 5eefee1

Please sign in to comment.