Skip to content

LLVM 16.0.6 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm
Submodule llvm updated from 8dfdcc to 7cbf1a
45 changes: 23 additions & 22 deletions rpm/0001-LLVM-Add-MeeGo-vendor-type.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ From: Ruben De Smet <[email protected]>
Date: Sun, 26 Jun 2022 10:48:13 +0200
Subject: [PATCH] LLVM: Add MeeGo vendor type

Co-authored-by: Matti Viljanen <[email protected]>
---
llvm/include/llvm/ADT/Triple.h | 3 ++-
llvm/lib/Support/Triple.cpp | 12 ++++++++++++
llvm/unittests/ADT/TripleTest.cpp | 6 ++++++
llvm/include/llvm/TargetParser/Triple.h | 3 ++-
llvm/lib/TargetParser/Triple.cpp | 12 ++++++++++++
llvm/unittests/TargetParser/TripleTest.cpp | 6 ++++++
3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h
index 42277c013035..9e36dfd4d2d5 100644
--- a/llvm/include/llvm/ADT/Triple.h
+++ b/llvm/include/llvm/ADT/Triple.h
@@ -165,7 +165,8 @@ public:
diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index 59513fa2f2062af90fee7c7c42149674faa05299..5bddc2a52c05172ce444c607b42d037fbc835267 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -180,7 +180,8 @@ public:
Mesa,
SUSE,
OpenEmbedded,
Expand All @@ -23,27 +24,27 @@ index 42277c013035..9e36dfd4d2d5 100644
};
enum OSType {
UnknownOS,
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp
index a9afcc9db96a..c4307bf457c7 100644
--- a/llvm/lib/Support/Triple.cpp
+++ b/llvm/lib/Support/Triple.cpp
@@ -177,6 +177,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
index a68035989a93ea1f8f81bb5acc07e5c78db19eb5..ef48f02504ace6543e77e5e88622d262168e0e79 100644
--- a/llvm/lib/TargetParser/Triple.cpp
+++ b/llvm/lib/TargetParser/Triple.cpp
@@ -188,6 +188,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
case Freescale: return "fsl";
case IBM: return "ibm";
case ImaginationTechnologies: return "img";
+ case MeeGo: return "meego";
case Mesa: return "mesa";
case MipsTechnologies: return "mti";
case Myriad: return "myriad";
@@ -507,6 +508,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
@@ -552,6 +553,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
.Case("mesa", Triple::Mesa)
.Case("suse", Triple::SUSE)
.Case("oe", Triple::OpenEmbedded)
+ .Case("meego", Triple::MeeGo)
.Default(Triple::UnknownVendor);
}

@@ -802,6 +804,9 @@ Triple::Triple(const Twine &Str)
@@ -902,6 +904,9 @@ Triple::Triple(const Twine &Str)
OS = parseOS(Components[2]);
if (Components.size() > 3) {
Environment = parseEnvironment(Components[3]);
Expand All @@ -53,7 +54,7 @@ index a9afcc9db96a..c4307bf457c7 100644
ObjectFormat = parseFormat(Components[3]);
}
}
@@ -853,6 +858,10 @@ Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
@@ -953,6 +958,10 @@ Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
ObjectFormat(parseFormat(EnvironmentStr.str())) {
if (ObjectFormat == Triple::UnknownObjectFormat)
ObjectFormat = getDefaultFormat(*this);
Expand All @@ -64,7 +65,7 @@ index a9afcc9db96a..c4307bf457c7 100644
}

std::string Triple::normalize(StringRef Str) {
@@ -1103,6 +1112,9 @@ static VersionTuple parseVersionFromName(StringRef Name) {
@@ -1207,6 +1216,9 @@ static VersionTuple parseVersionFromName(StringRef Name) {
VersionTuple Triple::getEnvironmentVersion() const {
StringRef EnvironmentName = getEnvironmentName();
StringRef EnvironmentTypeName = getEnvironmentTypeName(getEnvironment());
Expand All @@ -74,11 +75,11 @@ index a9afcc9db96a..c4307bf457c7 100644
if (EnvironmentName.startswith(EnvironmentTypeName))
EnvironmentName = EnvironmentName.substr(EnvironmentTypeName.size());

diff --git a/llvm/unittests/ADT/TripleTest.cpp b/llvm/unittests/ADT/TripleTest.cpp
index 3006ab6d40e8..7a28ed624232 100644
--- a/llvm/unittests/ADT/TripleTest.cpp
+++ b/llvm/unittests/ADT/TripleTest.cpp
@@ -384,6 +384,12 @@ TEST(TripleTest, ParsedIDs) {
diff --git a/llvm/unittests/TargetParser/TripleTest.cpp b/llvm/unittests/TargetParser/TripleTest.cpp
index 77de43a16d0a24026988c8a5c675c5d8d9bbd816..c25e33d2f235f35316a6a55238981779fd158bd4 100644
--- a/llvm/unittests/TargetParser/TripleTest.cpp
+++ b/llvm/unittests/TargetParser/TripleTest.cpp
@@ -535,6 +535,12 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::Linux, T.getOS());
EXPECT_EQ(Triple::GNUEABI, T.getEnvironment());

Expand Down
13 changes: 7 additions & 6 deletions rpm/0002-Add-Triple-isMeeGo.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ From: Ruben De Smet <[email protected]>
Date: Sun, 26 Jun 2022 10:41:44 +0200
Subject: [PATCH] Add Triple::isMeeGo()

Co-authored-by: Matti Viljanen <[email protected]>
---
llvm/include/llvm/ADT/Triple.h | 3 +++
llvm/include/llvm/TargetParser/Triple.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h
index 9e36dfd4d2d5..8e66888615ff 100644
--- a/llvm/include/llvm/ADT/Triple.h
+++ b/llvm/include/llvm/ADT/Triple.h
@@ -657,6 +657,9 @@ public:
diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index 5bddc2a52c05172ce444c607b42d037fbc835267..978a4231cfd81ea543f810d089f4f702b60b465e 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -724,6 +724,9 @@ public:
/// Tests whether the target is Android
bool isAndroid() const { return getEnvironment() == Triple::Android; }

Expand Down
65 changes: 29 additions & 36 deletions rpm/0003-Clang-SailfishOS-toolchain.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,43 @@ From: Ruben De Smet <[email protected]>
Date: Sun, 26 Jun 2022 10:57:51 +0200
Subject: [PATCH] Clang: SailfishOS toolchain

Co-authored-by: Matti Viljanen <[email protected]>
Signed-off-by: Ruben De Smet <[email protected]>
---
clang/include/clang/Driver/Distro.h | 5 +++++
clang/lib/Driver/Distro.cpp | 3 +++
clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++-
clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++----
4 files changed, 15 insertions(+), 5 deletions(-)
clang/lib/Driver/ToolChains/Linux.cpp | 7 +++++--
4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h
index 2723f75e8945..58616ad541e1 100644
index 1aaf93ddb7c43ba8202e53288a934f9c76a13e2b..581a1712d9975dfdbd23792da3174644fdbc2d42 100644
--- a/clang/include/clang/Driver/Distro.h
+++ b/clang/include/clang/Driver/Distro.h
@@ -45,6 +45,7 @@ public:
@@ -46,6 +46,7 @@ public:
Fedora,
Gentoo,
OpenSUSE,
+ Sailfish,
UbuntuHardy,
UbuntuIntrepid,
UbuntuJaunty,
@@ -124,6 +125,10 @@ public:
return DistroVal >= DebianLenny && DistroVal <= DebianBookworm;
@@ -127,6 +128,10 @@ public:
return DistroVal >= DebianLenny && DistroVal <= DebianTrixie;
}

+ bool IsSailfish() const {
+ return DistroVal == Sailfish;
+ }
+
bool IsUbuntu() const {
return DistroVal >= UbuntuHardy && DistroVal <= UbuntuJammy;
return DistroVal >= UbuntuHardy && DistroVal <= UbuntuLunar;
}
diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp
index 5ac38c34d112..cccb2026e527 100644
index 87a0c5a58511561a4eac9e651e313542e638d2ca..de6457bd3dfb8cceeee89fea7cee41308ace337c 100644
--- a/clang/lib/Driver/Distro.cpp
+++ b/clang/lib/Driver/Distro.cpp
@@ -197,6 +197,9 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
@@ -201,6 +201,9 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
if (VFS.exists("/etc/gentoo-release"))
return Distro::Gentoo;

Expand All @@ -49,10 +50,10 @@ index 5ac38c34d112..cccb2026e527 100644
}

diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 7a9570a686f4..e7f57c824961 100644
index 4f2340316654301ddcc70e293a9bf0da327a6de3..814f3482a1b598b24e4b3f63d811666791a6e260 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2073,7 +2073,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
@@ -2218,7 +2218,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
static const char *const AArch64Triples[] = {
"aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
Expand All @@ -61,27 +62,27 @@ index 7a9570a686f4..e7f57c824961 100644
static const char *const AArch64beLibDirs[] = {"/lib"};
static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu",
"aarch64_be-linux-gnu"};
@@ -2082,6 +2082,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
@@ -2227,6 +2227,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
static const char *const ARMTriples[] = {"arm-linux-gnueabi"};
static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
"armv7hl-redhat-linux-gnueabi",
+ "armv7hl-meego-linux-gnueabi",
"armv6hl-suse-linux-gnueabi",
"armv7hl-suse-linux-gnueabi"};
static const char *const ARMebLibDirs[] = {"/lib"};
@@ -2108,6 +2109,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
@@ -2257,6 +2258,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
"i586-linux-gnu", "i686-linux-gnu", "i686-pc-linux-gnu",
"i386-redhat-linux6E", "i686-redhat-linux", "i386-redhat-linux",
"i586-suse-linux", "i686-montavista-linux", "i686-gnu",
+ "i486-meego-linux"
};

static const char *const M68kLibDirs[] = {"/lib"};
static const char *const LoongArch64LibDirs[] = {"/lib64", "/lib"};
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index 83cb41159de7..e7c2dcaef02a 100644
index c6fb290ffdb4dc6a779737a4e838befbc7aba16e..72ef4fff4400f08cf429c1072f7edb69d8e440f5 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -194,7 +194,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
@@ -197,7 +197,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
}

if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() ||
Expand All @@ -90,28 +91,20 @@ index 83cb41159de7..e7c2dcaef02a 100644
ExtraOpts.push_back("-z");
ExtraOpts.push_back("relro");
}
@@ -233,13 +233,13 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
// Hexagon linker/loader does not support .gnu.hash
@@ -241,12 +241,15 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
if (!IsMips && !IsHexagon) {
if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() ||
- (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) ||
+ (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) || Distro.IsSailfish() ||
(IsAndroid && !Triple.isAndroidVersionLT(23)))
ExtraOpts.push_back("--hash-style=gnu");

if (Distro.IsDebian() || Distro.IsOpenSUSE() ||
Distro == Distro::UbuntuLucid || Distro == Distro::UbuntuJaunty ||
- Distro == Distro::UbuntuKarmic ||
+ Distro == Distro::UbuntuKarmic || Distro.IsSailfish() ||
(IsAndroid && Triple.isAndroidVersionLT(23)))
if (Distro.IsOpenSUSE() || Distro == Distro::UbuntuLucid ||
Distro == Distro::UbuntuJaunty || Distro == Distro::UbuntuKarmic ||
- (IsAndroid && Triple.isAndroidVersionLT(23)))
+ Distro.IsSailfish() || (IsAndroid && Triple.isAndroidVersionLT(23)))
ExtraOpts.push_back("--hash-style=both");
else
ExtraOpts.push_back("--hash-style=gnu");
}
@@ -248,7 +248,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)

+ if (Distro.IsSailfish())
+ ExtraOpts.push_back("--enable-new-dtags");
+
#ifdef ENABLE_LINKER_BUILD_ID
ExtraOpts.push_back("--build-id");
#endif

- if (IsAndroid || Distro.IsOpenSUSE())
+ if (IsAndroid || Distro.IsOpenSUSE() || Distro.IsSailfish())
ExtraOpts.push_back("--enable-new-dtags");

// The selection of paths to try here is designed to match the patterns which
23 changes: 12 additions & 11 deletions rpm/0004-Make-funwind-tables-the-default-for-all-archs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,35 @@ From: serge-sans-paille <[email protected]>
Date: Tue, 10 Dec 2019 09:18:03 +0000
Subject: [PATCH] Make -funwind-tables the default for all archs

Co-authored-by: Matti Viljanen <[email protected]>
---
clang/lib/Driver/ToolChain.cpp | 2 +-
clang/lib/Driver/ToolChains/Gnu.cpp | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index d657d21bfcdb..eac667382fa9 100644
index bc70205a6c01eb06a27cb6cd590da93318527bc5..bfd34869913f734cae98252da61572bd73d56f19 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -258,7 +258,7 @@ std::string ToolChain::getInputFilename(const InputInfo &Input) const {
}
@@ -324,7 +324,7 @@ std::string ToolChain::getInputFilename(const InputInfo &Input) const {

bool ToolChain::IsUnwindTablesDefault(const ArgList &Args) const {
- return false;
+ return true;
ToolChain::UnwindTableLevel
ToolChain::getDefaultUnwindTableLevel(const ArgList &Args) const {
- return UnwindTableLevel::None;
+ return UnwindTableLevel::Asynchronous;
}

Tool *ToolChain::getClang() const {
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index e7f57c824961..9c44b2e741ce 100644
index 814f3482a1b598b24e4b3f63d811666791a6e260..c492e45a2d0b52905234c83c193237999180277b 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2692,6 +2692,9 @@ void Generic_GCC::printVerboseInfo(raw_ostream &OS) const {
}
@@ -2857,6 +2857,9 @@ void Generic_GCC::printVerboseInfo(raw_ostream &OS) const {

bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const {
ToolChain::UnwindTableLevel
Generic_GCC::getDefaultUnwindTableLevel(const ArgList &Args) const {
+ if (getTriple().isMeeGo()) {
+ return true;
+ return UnwindTableLevel::Asynchronous;
+ }
switch (getArch()) {
case llvm::Triple::aarch64:
Expand Down
5 changes: 3 additions & 2 deletions rpm/0005-Disable-out-of-line-atomics-on-MeeGo.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ From: Ruben De Smet <[email protected]>
Date: Sun, 26 Jun 2022 10:42:13 +0200
Subject: [PATCH] Disable out-of-line atomics on MeeGo

Co-authored-by: Matti Viljanen <[email protected]>
---
clang/lib/Driver/ToolChains/Linux.cpp | 2 ++
1 file changed, 2 insertions(+)

diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index e7c2dcaef02a..9b377eca9dc8 100644
index 72ef4fff4400f08cf429c1072f7edb69d8e440f5..8ede9b7ce1fd234718390c3b4356521c0763950d 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -672,6 +672,8 @@ bool Linux::IsAArch64OutlineAtomicsDefault(const ArgList &Args) const {
@@ -725,6 +725,8 @@ bool Linux::IsAArch64OutlineAtomicsDefault(const ArgList &Args) const {
// and libgcc since 9.3.1
assert(getTriple().isAArch64() && "expected AArch64 target!");
ToolChain::RuntimeLibType RtLib = GetRuntimeLibType(Args);
Expand Down
6 changes: 3 additions & 3 deletions rpm/clang.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%global maj_ver 15
%global maj_ver 16
%global min_ver 0
%global patch_ver 7
%global patch_ver 6

%global clang_tools_binaries \
%{_bindir}/clang-apply-replacements \
Expand Down Expand Up @@ -153,7 +153,7 @@ pushd build
%endif
-DCLANG_INCLUDE_TESTS:BOOL=OFF \
-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
%if 0%{?__isa_bits} == 64
%ifarch aarch64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? This limits the usage for only aarch64 ignoring for example x86_64, I would prefer using the old way unless there are some issues with that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@direc85 do you know why you pushed this?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If __isa_bits doesn't work you can also compare against %{_lib}.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was due to not clearing the previous build folder before changing architecture, so that change can be reverted.

Copy link

@Thaodan Thaodan Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
%ifarch aarch64
%if "%{_lib}" == "lib64"

This should be much better ^

-DLLVM_LIBDIR_SUFFIX=64 \
%else
-DLLVM_LIBDIR_SUFFIX= \
Expand Down
2 changes: 1 addition & 1 deletion rpm/llvm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%endif

Name: llvm
Version: 15.0.7
Version: 16.0.6
Release: 0
Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
License: University of Illinois/NCSA Open Source License
Expand Down