Hello community,
here is the log from the commit of package llvm7 for openSUSE:Factory checked in at 2019-04-01 12:33:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/llvm7 (Old)
and /work/SRC/openSUSE:Factory/.llvm7.new.25356 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "llvm7"
Mon Apr 1 12:33:55 2019 rev:12 rq:689737 version:7.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/llvm7/llvm7.changes 2019-03-22 14:53:36.758087877 +0100
+++ /work/SRC/openSUSE:Factory/.llvm7.new.25356/llvm7.changes 2019-04-01 12:34:02.781808563 +0200
@@ -1,0 +2,19 @@
+Thu Mar 28 15:15:46 UTC 2019 - Bernhard Wiedemann
+
+- Add clang-deterministic-selector-order.patch to make build of
+ gnustep-libobjc2 package reproducible (boo#1067478)
+
+-------------------------------------------------------------------
+Sat Mar 23 23:29:21 UTC 2019 - aaronpuchert@alice-dsl.net
+
+- Fix packaging on ppc: the sanitizers aren't available there, so
+ the directories /usr/lib/clang/*/{lib,share} are missing.
+- Package LLVMgold even when we don't use gold for linking.
+ It's promised in /usr/lib/cmake/llvm/LLVMExports.cmake.
+- Unignore test failures on PowerPC64 architectures. The failures
+ in ppc are unrelated to AMDGPU, so we remove that remark.
+- Fix dependencies: the gold plugin shouldn't depend on llvm-devel.
+ libc++abi-devel should depend on libc++abi.
+- Fix typo.
+
+-------------------------------------------------------------------
New:
----
clang-deterministic-selector-order.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ llvm7.spec ++++++
--- /var/tmp/diff_new_pack.JOxltZ/_old 2019-04-01 12:34:05.165809174 +0200
+++ /var/tmp/diff_new_pack.JOxltZ/_new 2019-04-01 12:34:05.169809175 +0200
@@ -111,6 +111,7 @@
Patch27: llvm-D51108.patch
Patch28: llvm-Ensure-that-variant-part-discriminator-is-read-by-Me.patch
Patch29: llvm-test-Fix-Assembler-debug-info.ll.patch
+Patch30: clang-deterministic-selector-order.patch
BuildRequires: binutils-devel >= 2.21.90
%if %{with gold}
BuildRequires: binutils-gold
@@ -172,9 +173,7 @@
Requires: libstdc++-devel
Requires: libtool
Requires: llvm%{_sonum}-LTO-devel
-%if %{with gold}
Requires: llvm%{_sonum}-gold
-%endif
Requires: llvm%{_sonum}-polly-devel
Requires: ncurses-devel
Requires: pkgconfig
@@ -205,9 +204,7 @@
Recommends: clang%{_sonum}-checker
Recommends: libc++-devel
Recommends: libomp%{_sonum}-devel
-%if %{with gold}
Recommends: llvm-gold-devel
-%endif
Recommends: scan-build
Recommends: scan-view
%if %{with cxx}
@@ -300,19 +297,16 @@
This package contains the link-time optimizer for LLVM.
(development files)
-%if %{with gold}
%package gold
Summary: Gold linker plugin for LLVM
# Avoid multiple provider errors
Group: Development/Languages/Other
-Requires: %{name}-devel = %{_relver}
Requires: libLLVM%{_sonum}
Conflicts: llvm-gold-provider
Provides: llvm-gold-provider
%description gold
This package contains the Gold linker plugin for LLVM.
-%endif
%package -n libomp%{_sonum}-devel
Summary: MPI plugin for LLVM
@@ -360,6 +354,7 @@
Summary: C++ standard library ABI (devel package)
Group: Development/Languages/C and C++
Requires: libc++-devel
+Requires: libc++abi%{_socxx} = %{_relver}
Conflicts: libc++abi.so
Provides: libc++abi.so
@@ -555,6 +550,7 @@
%patch8 -p1
%patch16 -p2
%patch26 -p1
+%patch30 -p1
popd
%if %{with lldb}
@@ -810,9 +806,7 @@
# Note that bfd-plugins is always in /usr/lib/bfd-plugins, no matter what _libdir is.
mkdir -p %{buildroot}/usr/lib/bfd-plugins
-%if %{with gold}
ln -s %{_libdir}/LLVMgold.so %{buildroot}/usr/lib/bfd-plugins/
-%endif
install -m 755 -d %{buildroot}%{_datadir}/vim/site/
for i in ftdetect ftplugin indent syntax; do
@@ -967,8 +961,8 @@
%if !0%{?qemu_user_space_build:1}
# we just do not have enough memory with qemu emulation
-%ifarch ppc ppc64 ppc64le
-ninja -v %{?_smp_mflags} check || { echo "Ignore PowerPC failures https://bugs.llvm.org/show_bug.cgi?id=35871"; }
+%ifarch ppc
+ninja -v %{?_smp_mflags} check || { echo "Ignore PowerPC failures"; }
%else
ninja -v %{?_smp_mflags} check
%endif
@@ -1004,10 +998,8 @@
%postun -n liblldb%{_sonum} -p /sbin/ldconfig
%endif
-%if %{with gold}
%post gold -p /sbin/ldconfig
%postun gold -p /sbin/ldconfig
-%endif
%post devel -p /sbin/ldconfig
%postun devel -p /sbin/ldconfig
%post LTO-devel -p /sbin/ldconfig
@@ -1439,7 +1431,7 @@
%ghost %{_sysconfdir}/alternatives/llvm-link.1%{ext_man}
%ghost %{_sysconfdir}/alternatives/llvm-mca.1%{ext_man}
%ghost %{_sysconfdir}/alternatives/llvm-nm.1%{ext_man}
-%ghost %{_sysconfdir}/alternatives/llvm-pdbuti.1%{ext_man}
+%ghost %{_sysconfdir}/alternatives/llvm-pdbutil.1%{ext_man}
%ghost %{_sysconfdir}/alternatives/llvm-profdata.1%{ext_man}
%ghost %{_sysconfdir}/alternatives/llvm-readobj.1%{ext_man}
%ghost %{_sysconfdir}/alternatives/llvm-stress.1%{ext_man}
@@ -1532,8 +1524,11 @@
%dir %{_libdir}/clang/
%dir %{_libdir}/clang/%{_relver}/
%{_libdir}/clang/%{_relver}/bash-autocomplete.sh
+# The sanitizer runtime is not available for ppc.
+%ifnarch ppc
%{_libdir}/clang/%{_relver}/lib
%{_libdir}/clang/%{_relver}/share
+%endif
%{_sysconfdir}/bash_completion.d/clang.sh
%files -n clang%{_sonum}-checker
@@ -1571,16 +1566,12 @@
%license CREDITS.TXT LICENSE.TXT
%{_libdir}/libLTO.so.*
-%if %{with gold}
%files gold
%license CREDITS.TXT LICENSE.TXT
%{_libdir}/LLVMgold.so
# Note that bfd-plugins is always in /usr/lib/bfd-plugins, no matter what _libdir is.
%dir /usr/lib/bfd-plugins/
/usr/lib/bfd-plugins/LLVMgold.so
-%else
-%exclude %{_libdir}/LLVMgold.so
-%endif
%if %{with openmp}
%files -n libomp%{_sonum}-devel
++++++ clang-deterministic-selector-order.patch ++++++
commit 6c4fb3c5356d1a4fb031292c3a56458dd6e041b2
Author: David Chisnall
Date: Tue Aug 14 10:05:25 2018 +0000
[gnu-objc] Make selector order deterministic.
Summary:
This probably fixes PR35277, though there may be other sources of
nondeterminism (this was the only case of iterating over a DenseMap).
It's difficult to provide a test case for this, because it shows up only
on systems with ASLR enabled.
Reviewers: rjmccall
Reviewed By: rjmccall
Subscribers: bmwiedemann, mgrang, cfe-commits
Differential Revision: https://reviews.llvm.org/D50559
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339668 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 622c8bfb50..b509187b4c 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -3541,12 +3541,16 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
ConstantInitBuilder builder(CGM);
auto selectors = builder.beginArray(selStructTy);
auto &table = SelectorTable; // MSVC workaround
- for (auto &entry : table) {
+ std::vector<Selector> allSelectors;
+ for (auto &entry : table)
+ allSelectors.push_back(entry.first);
+ llvm::sort(allSelectors.begin(), allSelectors.end());
- std::string selNameStr = entry.first.getAsString();
+ for (auto &untypedSel : allSelectors) {
+ std::string selNameStr = untypedSel.getAsString();
llvm::Constant *selName = ExportUniqueString(selNameStr, ".objc_sel_name");
- for (TypedSelector &sel : entry.second) {
+ for (TypedSelector &sel : table[untypedSel]) {
llvm::Constant *selectorTypeEncoding = NULLPtr;
if (!sel.first.empty())
selectorTypeEncoding =
diff --git a/test/CodeGenObjC/gnu-deterministic-selectors.m b/test/CodeGenObjC/gnu-deterministic-selectors.m
new file mode 100644
index 0000000000..5f8d2e5378
--- /dev/null
+++ b/test/CodeGenObjC/gnu-deterministic-selectors.m
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -fobjc-runtime=gnustep-1.5 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-freebsd -fobjc-runtime=gcc %s -emit-llvm -o - | FileCheck %s
+
+// Check that these selectors are emitted in alphabetical order.
+// The order doesn't actually matter, only that it doesn't vary across runs.
+// Clang sorts them when targeting a GCC-like ABI to guarantee determinism.
+// CHECK: @.objc_selector_list = internal global [6 x { i8*, i8* }] [{ i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_namea, i64 0, i64 0), i8* null }, { i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_nameg, i64 0, i64 0), i8* null }, { i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_namej, i64 0, i64 0), i8* null }, { i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_namel, i64 0, i64 0), i8* null }, { i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_namez, i64 0, i64 0), i8* null }, { i8*, i8* } zeroinitializer], align 8
+
+
+void f() {
+ SEL a = @selector(z);
+ SEL b = @selector(a);
+ SEL c = @selector(g);
+ SEL d = @selector(l);
+ SEL e = @selector(j);
+}