[tbb-commits] [Git][tpo/applications/tor-browser-build][main] 2 commits: Move the macOS lld patch to llvm-project.

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Thu Jul 27 08:58:16 UTC 2023



Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build


Commits:
a812dd07 by Pier Angelo Vendrame at 2023-07-26T18:04:01+02:00
Move the macOS lld patch to llvm-project.

To solve a macOS reproducibility project, we backported a patch from
LLVM, but we applied it only to clang and only to macOS to prevent a
rebuild for all the other platforms.
However, a new rebuild is now needed, so we can apply the patch to all
the platforms and all the project using the LLVM source code for
consistency, even though the previous solution was completely fine.

- - - - -
98860cf9 by Pier Angelo Vendrame at 2023-07-26T18:10:51+02:00
Bug 40907: Backport the fix to LLVM #62546

We encountered the same problem as llvm-project#62546: we did not have
complete reproducibility on debug symbols.
So, we need to backport the patch that fixes the problem upstream.

- - - - -


6 changed files:

- projects/clang/build
- projects/clang/config
- projects/llvm-project/build
- projects/llvm-project/config
- + projects/llvm-project/partially-revert-llvm-less_second.patch
- projects/clang/use-fixed-chunk-size-for-uuid.patch → projects/llvm-project/use-fixed-chunk-size-for-uuid.patch


Changes:

=====================================
projects/clang/build
=====================================
@@ -16,12 +16,6 @@ mkdir -p /var/tmp/build
 cd /var/tmp/build
 tar -xf $rootdir/[% c('input_files_by_name/clang-source') %]
 cd clang-source
-[% IF c("var/macos") -%]
-  # Remove once we update to a version that includes commit
-  # 359f170f5f712ee714193b46bad45a45656b2c59 (> 16.0.6)
-  # https://github.com/llvm/llvm-project/issues/63961
-  patch -p1 < $rootdir/use-fixed-chunk-size-for-uuid.patch
-[% END -%]
 export LLVM_HOME=$(pwd)
 mkdir build
 cd build


=====================================
projects/clang/config
=====================================
@@ -24,5 +24,3 @@ input_files:
   - project: python
     name: python
     enable: '[% c("var/linux") %]'
-  - filename: use-fixed-chunk-size-for-uuid.patch
-    enable: '[% c("var/macos") %]'


=====================================
projects/llvm-project/build
=====================================
@@ -2,6 +2,18 @@
 [% c("var/set_default_env") -%]
 tar -xf [% project %]-[% c("version") %].tar.[% c('compress_tar') %]
 mv [% project %]-[% c("version") %] clang-source
+
+pushd clang-source
+# Remove once we update to a version that includes commit
+# 359f170f5f712ee714193b46bad45a45656b2c59 (> 16.0.6)
+# https://github.com/llvm/llvm-project/issues/63961
+patch -p1 < $rootdir/use-fixed-chunk-size-for-uuid.patch
+# Remove once we update to a version that includes commit
+# 32ab0978dc3f7f7036df2038ee96a4ab89196255
+# https://github.com/llvm/llvm-project/issues/62546
+patch -p1 < $rootdir/partially-revert-llvm-less_second.patch
+popd
+
 [% c('tar', {
         tar_src => [ 'clang-source' ],
         tar_args => '-caf ' _ dest_dir _ '/' _ c('filename'),


=====================================
projects/llvm-project/config
=====================================
@@ -6,3 +6,7 @@ filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.[% c("co
 
 var:
   llvm_major: 16
+
+input_files:
+  - filename: use-fixed-chunk-size-for-uuid.patch
+  - filename: partially-revert-llvm-less_second.patch


=====================================
projects/llvm-project/partially-revert-llvm-less_second.patch
=====================================
@@ -0,0 +1,29 @@
+From 32ab0978dc3f7f7036df2038ee96a4ab89196255 Mon Sep 17 00:00:00 2001
+From: Kazu Hirata <kazu at google.com>
+Date: Tue, 16 May 2023 14:49:32 -0700
+Subject: [PATCH] Partially revert "Use llvm::less_second (NFC)"
+
+This reverts part of commit e0039b8d6a5bd05e70203962f448569f2d2ef1c2.
+
+This should fix the issue reported in:
+
+https://github.com/llvm/llvm-project/issues/62546
+---
+ llvm/lib/IR/Metadata.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
+index 13fb2b650f89e9..face1ba58cfbbd 100644
+--- a/llvm/lib/IR/Metadata.cpp
++++ b/llvm/lib/IR/Metadata.cpp
+@@ -282,7 +282,9 @@ void ReplaceableMetadataImpl::replaceAllUsesWith(Metadata *MD) {
+   // Copy out uses since UseMap will get touched below.
+   using UseTy = std::pair<void *, std::pair<OwnerTy, uint64_t>>;
+   SmallVector<UseTy, 8> Uses(UseMap.begin(), UseMap.end());
+-  llvm::sort(Uses, llvm::less_second());
++  llvm::sort(Uses, [](const UseTy &L, const UseTy &R) {
++    return L.second.second < R.second.second;
++  });
+   for (const auto &Pair : Uses) {
+     // Check that this Ref hasn't disappeared after RAUW (when updating a
+     // previous Ref).


=====================================
projects/clang/use-fixed-chunk-size-for-uuid.patch → projects/llvm-project/use-fixed-chunk-size-for-uuid.patch
=====================================



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/ad7a51707c9a8257002eb74963c9a2001e38f463...98860cf91ea9cb28f47fe99504be20b45bd828c5

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/ad7a51707c9a8257002eb74963c9a2001e38f463...98860cf91ea9cb28f47fe99504be20b45bd828c5
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20230727/f0cf41e0/attachment-0001.htm>


More information about the tbb-commits mailing list