From b73f3a4c9f04fd956a18df8135134b7b7382580b Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Wed, 16 Dec 2020 16:08:53 +0000 Subject: [PATCH] import clang-11.0.0-1.module+el8.4.0+8598+a071fcd5 --- .clang.metadata | 4 +- .gitignore | 4 +- ...c-toolchains-with-libgcc_s.so-when-n.patch | 132 ++++++++++++++++++ SOURCES/clang-11.0.0.src.tar.xz.sig | Bin 0 -> 566 bytes SOURCES/clang-11.0.0rc2.src.tar.xz.sig | Bin 566 -> 0 bytes .../clang-tools-extra-11.0.0.src.tar.xz.sig | Bin 0 -> 566 bytes ...clang-tools-extra-11.0.0rc2.src.tar.xz.sig | Bin 566 -> 0 bytes SPECS/clang.spec | 12 +- 8 files changed, 143 insertions(+), 9 deletions(-) create mode 100644 SOURCES/0001-Driver-Prefer-gcc-toolchains-with-libgcc_s.so-when-n.patch create mode 100644 SOURCES/clang-11.0.0.src.tar.xz.sig delete mode 100644 SOURCES/clang-11.0.0rc2.src.tar.xz.sig create mode 100644 SOURCES/clang-tools-extra-11.0.0.src.tar.xz.sig delete mode 100644 SOURCES/clang-tools-extra-11.0.0rc2.src.tar.xz.sig diff --git a/.clang.metadata b/.clang.metadata index 664bea5..a41b878 100644 --- a/.clang.metadata +++ b/.clang.metadata @@ -1,3 +1,3 @@ -79ccca001aa5727d954a2b5970b9c11ef750411e SOURCES/clang-11.0.0rc2.src.tar.xz -3f7c23287becbfd781b1657e04654ce38b496e32 SOURCES/clang-tools-extra-11.0.0rc2.src.tar.xz +02c87f5e07f2a1c1e2dbb8ce8328f0106d70b10d SOURCES/clang-11.0.0.src.tar.xz +b77dc0494894b997c8f4012debbf0bf469462386 SOURCES/clang-tools-extra-11.0.0.src.tar.xz 32fa4b0193960f05064f2ab31b5a89c7cf48a0b9 SOURCES/hans-gpg-key.asc diff --git a/.gitignore b/.gitignore index c302376..5665b65 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -SOURCES/clang-11.0.0rc2.src.tar.xz -SOURCES/clang-tools-extra-11.0.0rc2.src.tar.xz +SOURCES/clang-11.0.0.src.tar.xz +SOURCES/clang-tools-extra-11.0.0.src.tar.xz SOURCES/hans-gpg-key.asc diff --git a/SOURCES/0001-Driver-Prefer-gcc-toolchains-with-libgcc_s.so-when-n.patch b/SOURCES/0001-Driver-Prefer-gcc-toolchains-with-libgcc_s.so-when-n.patch new file mode 100644 index 0000000..0050b40 --- /dev/null +++ b/SOURCES/0001-Driver-Prefer-gcc-toolchains-with-libgcc_s.so-when-n.patch @@ -0,0 +1,132 @@ +From 67013ee5feecca0c1e1dd8a149b20779a9b6c12a Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Wed, 23 Sep 2020 12:47:30 +0000 +Subject: [PATCH] Driver: Prefer gcc toolchains with libgcc_s.so when not + static linking libgcc + +Fedora ships cross-compilers on all platforms, so a user could end up +with a gcc x86_64 cross-compiler installed on an x86_64 system. clang +maintains a list of supported triples for each target and when all +else is equal will prefer toolchains with triples that appear earlier +in the list. + +The cross-compiler triple on Fedora is x86_64-linux-gnu and this comes +before the Fedora system compiler's triple: x86_64-redhat-linux in +the triples list, so the cross compiler is always preferred. This +is a problem, because the cross compiler is missing libraries, like +libgcc_s.so, that clang expects to be there so linker invocations +will fail. + +This patch fixes this by checking for the existence of libgcc_s.so +when it is required and taking that into account when selecting a +toolchain. +--- + lib/Driver/ToolChains/Gnu.cpp | 16 ++++++++++++++-- + lib/Driver/ToolChains/Gnu.h | 4 +++- + .../usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o | 0 + .../usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o | 0 + .../lib/gcc/x86_64-redhat-linux/7/libgcc_s.so | 0 + test/Driver/linux-ld.c | 12 ++++++++++++ + 6 files changed, 29 insertions(+), 3 deletions(-) + create mode 100644 test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o + create mode 100644 test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o + create mode 100644 test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so + +diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp +index c8a7fce0..f28792b7 100644 +--- a/lib/Driver/ToolChains/Gnu.cpp ++++ b/lib/Driver/ToolChains/Gnu.cpp +@@ -2500,6 +2500,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + (TargetArch == llvm::Triple::x86 && + TargetTriple.getOS() != llvm::Triple::Solaris)}}; + ++ bool NeedLibgccShared = !Args.hasArg(options::OPT_static_libgcc) && ++ !Args.hasArg(options::OPT_static); + for (auto &Suffix : Suffixes) { + if (!Suffix.Active) + continue; +@@ -2517,8 +2519,17 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + continue; // Saw this path before; no need to look at it again. + if (CandidateVersion.isOlderThan(4, 1, 1)) + continue; +- if (CandidateVersion <= Version) +- continue; ++ ++ bool CandidateHasLibGccShared = false; ++ if (CandidateVersion <= Version) { ++ if (NeedLibgccShared && !HasLibGccShared) { ++ CandidateHasLibGccShared = ++ D.getVFS().exists(LI->path() + "/libgcc_s.so"); ++ ++ } ++ if (HasLibGccShared || !CandidateHasLibGccShared) ++ continue; ++ } + + if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), + NeedsBiarchSuffix)) +@@ -2532,6 +2543,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + GCCInstallPath = (LibDir + "/" + LibSuffix + "/" + VersionText).str(); + GCCParentLibPath = (GCCInstallPath + "/../" + Suffix.ReversePath).str(); + IsValid = true; ++ HasLibGccShared = CandidateHasLibGccShared; + } + } + } +diff --git a/lib/Driver/ToolChains/Gnu.h b/lib/Driver/ToolChains/Gnu.h +index 52690ab4..2a4452d9 100644 +--- a/lib/Driver/ToolChains/Gnu.h ++++ b/lib/Driver/ToolChains/Gnu.h +@@ -190,6 +190,7 @@ public: + /// Driver, and has logic for fuzzing that where appropriate. + class GCCInstallationDetector { + bool IsValid; ++ bool HasLibGccShared; + llvm::Triple GCCTriple; + const Driver &D; + +@@ -213,7 +214,8 @@ public: + MultilibSet Multilibs; + + public: +- explicit GCCInstallationDetector(const Driver &D) : IsValid(false), D(D) {} ++ explicit GCCInstallationDetector(const Driver &D) ++ : IsValid(false), HasLibGccShared(false), D(D) {} + void init(const llvm::Triple &TargetTriple, const llvm::opt::ArgList &Args, + ArrayRef ExtraTripleAliases = None); + +diff --git a/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o b/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o +new file mode 100644 +index 00000000..e69de29b +diff --git a/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o b/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o +new file mode 100644 +index 00000000..e69de29b +diff --git a/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so b/test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so +new file mode 100644 +index 00000000..e69de29b +diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c +index ec539522..95725d5c 100644 +--- a/test/Driver/linux-ld.c ++++ b/test/Driver/linux-ld.c +@@ -784,6 +784,18 @@ + // CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|\\\\}}crtend.o" + // CHECK-FEDORA-31-RISCV64: "{{.*}}/usr/lib/gcc/riscv64-redhat-linux/9{{/|\\\\}}crtn.o" + // ++// Check that clang does not select the cross compiler by default on Fedora 28. ++// ++// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ ++// RUN: --target=x86_64-unknown-linux-gnu \ ++// RUN: --gcc-toolchain="" \ ++// RUN: --sysroot=%S/Inputs/fedora_28_tree \ ++// RUN: | FileCheck --check-prefix=CHECK-FEDORA-28-X86_64 %s ++// ++// CHECK-FEDORA-28-X86_64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" ++// CHECK-FEDORA-28-X86_64: "[[SYSROOT]]/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o" ++// CHECK-FEDORA-28-X86_64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-redhat-linux/7" ++// + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=arm-unknown-linux-gnueabi -rtlib=platform \ + // RUN: --gcc-toolchain="" \ +-- +2.25.2 + diff --git a/SOURCES/clang-11.0.0.src.tar.xz.sig b/SOURCES/clang-11.0.0.src.tar.xz.sig new file mode 100644 index 0000000000000000000000000000000000000000..b5378e033864e1a5b053df63fabbd11e33eebd66 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SW*e79j+-$oYbTxkTfz)xuK`!vrogTF_ku0$+p^2>=QS5D&uy zE;L%uT|l1@0G0O`q}nn_y+U3|ZItMJ%WeXThDi?r-W>}vDLey1D#era7WQ+R8$l)x zv$g{wv+RwjgCk9s;BD{OdW!_7cd@N%U#R{?P1RfriBv@=J(#?;mixL)ECqZ+v0!wa z|C44ZrgvF(PnH|Vv~OF@lV5>hSYS{!yYVV1re$)ACH)NZF_i$a_!zb0zbmB5;SO}r z8)*1@>6aKhgu)2~RghCPUVazlwQ%oXI%(iI3to_BCtyQCVDYQ z(#tqeWFHNdUxZdAcU>OJq@zGg&x_bcQmsqpS;Naf0F4CcjggN)nD@?Tv$&ViQS9M8r!F*GaQ+t`Nn!|{jpI$f zT95m+PAf0S)Nxhf9c?&AgyFpp$6rn~8W1|&z06m!o~-#M{GBZrT)HIEeo3hrdaF-3 zALD7vymAz5Wz*alpMOTLy9@S~6CsbJMk+2&49kv$R|+-5RIFKA%v>_Z2nd>m_Jl+s z{!nnsq*WYSDYQAUEoI9M><1=YZ?K1=4Yo-dPyfjJX3L=v3z!<;5CD6we@@oV=!T7( ELX_GDsQ>@~ literal 0 HcmV?d00001 diff --git a/SOURCES/clang-11.0.0rc2.src.tar.xz.sig b/SOURCES/clang-11.0.0rc2.src.tar.xz.sig deleted file mode 100644 index 71526a83386af645840dac2e93635aa6ba96b7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 566 zcmV-60?GY}0y6{v0SW*e79j+-$oYbTxkTfz)xuK`!vrogTF_ku0$)DMlK=_{5D&uy zE;L%uUARaO{T+BAF{`?KOH6X%wa*su^%?o1Lep?}-mChfg!S$(DN#(AQlOT*Sxz&S zD|M^xwT60z$(OUG316LJdjyrKeg?I~@v11> zW5DNto^#l9ni*nbvZQhH#+Sjj2^?E+b*uP_P~9~SFrVmMv|YgE7Zy&JIeUPO0G``* zXS#7cKZ9^hv~F{}$x8r{`E#C9@8(_NoMxB*Tv6C&*-1F2zHD-=E(T-K~7u2-S(07dKIt% zMqAWuC;#$Sxk&LWkR0BFR=*-~=yZ#gHqv*Kf4r~WeM)~L^eyiCAd>pEs4ka=+LucQP%h={3B9p=!F8P+2t$^jv^g$ z)5d>z6i?X)Gx`c62*2clpAj_YkWXuQ0AyYChq!HXzJvrW6F2X*@@^g*GHck(QRIZb zvyJnfrJf3Us#cZpIAeJIVIv;|nh+~qljXE8l-W-nq1a4Egy^|`G#CVe&4E$ehE$)b ETy209rT_o{ diff --git a/SOURCES/clang-tools-extra-11.0.0.src.tar.xz.sig b/SOURCES/clang-tools-extra-11.0.0.src.tar.xz.sig new file mode 100644 index 0000000000000000000000000000000000000000..5ff2b0ab2ad7cce4a65158f86e5371a5099375fb GIT binary patch literal 566 zcmV-60?GY}0y6{v0SW*e79j+-$oYbTxkTfz)xuK`!vrogTF_ku0$+p^3;+rV5D&uy zE;L%uU6Py+{S*_EzZt+*6TkUA(sW#COPwU32LAT2Z*0y(`VClu7f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100644 --- a/SPECS/clang.spec +++ b/SPECS/clang.spec @@ -3,8 +3,8 @@ %global maj_ver 11 %global min_ver 0 %global patch_ver 0 -%global rc_ver 2 -%global baserelease 0.2 +#%%global rc_ver 6 +%global baserelease 1 %global clang_tools_binaries \ %{_bindir}/clang-apply-replacements \ @@ -89,6 +89,7 @@ Patch13: 0001-Make-funwind-tables-the-default-for-all-archs.patch # Not Upstream Patch15: 0001-clang-Don-t-install-static-libraries.patch Patch16: 0001-clang-Fix-spurious-test-failure.patch +Patch17: 0001-Driver-Prefer-gcc-toolchains-with-libgcc_s.so-when-n.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -130,9 +131,6 @@ BuildRequires: python3-devel # Needed for %%multilib_fix_c_header BuildRequires: multilib-rpm-config -# For origin certification -BuildRequires: gnupg2 - # scan-build uses these perl modules so they need to be installed in order # to run the tests. BuildRequires: perl(Digest::MD5) @@ -256,6 +254,7 @@ pathfix.py -i %{__python3} -pn \ %patch13 -p2 -b .unwind-all %patch15 -p2 -b .no-install-static %patch16 -p2 -b .test-fix2 +%patch17 -p1 -b .check-gcc_s mv ../%{clang_tools_srcdir} tools/extra @@ -489,6 +488,9 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ninja check-all -C _build || \ %endif %changelog +* Thu Oct 29 2020 sguelton@redhat.com - 11.0.0-1 +- 11.0.0 final release + * Thu Sep 17 2020 sguelton@redhat.com - 11.0.0-0.1.rc2 - 11.0.0-rc2 Release