Skip to content

Commit

Permalink
llvmPackages_12.clang: use nostdlibinc patch instead of sed command
Browse files Browse the repository at this point in the history
Seems like the patch we've written for LLVM 13 and above also works for
LLVM 12 which seems a little more robust.
  • Loading branch information
sternenseemann committed Oct 16, 2024
1 parent 9af7f29 commit 8708697
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 0 additions & 4 deletions pkgs/development/compilers/llvm/common/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ let
--replace-fail 'StringRef P = llvm::sys::path::parent_path(D.Dir);' 'StringRef P = "${lib.getLib libllvm}";'
(cd tools && ln -s ../../clang-tools-extra extra)
'' + lib.optionalString (lib.versionOlder release_version "13") ''
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
-e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
lib/Driver/ToolChains/*.cpp
substituteInPlace tools/extra/clangd/quality/CompletionModel.cmake \
--replace ' ''${CMAKE_SOURCE_DIR}/../clang-tools-extra' ' ''${CMAKE_SOURCE_DIR}/tools/extra'
''
Expand Down
6 changes: 2 additions & 4 deletions pkgs/development/compilers/llvm/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,9 @@ let
# mis-compilation in firefox.
# See: https://bugzilla.mozilla.org/show_bug.cgi?id=1741454
(metadata.getVersionFile "clang/revert-malloc-alignment-assumption.patch")
++ lib.optionals (lib.versionAtLeast metadata.release_version "13") [
# TODO: This also applies for clang == 12, do we need it?
./clang/add-nostdlibinc-flag.patch
]
++ [
./clang/add-nostdlibinc-flag.patch

(substituteAll {
src =
if (lib.versionOlder metadata.release_version "16") then
Expand Down

0 comments on commit 8708697

Please sign in to comment.