mirror of
https://git.proxmox.com/git/llvm-toolchain
synced 2025-07-29 13:39:24 +00:00
Upload 1:14.0.6-9 to sid, fixing the various RC bugs
This commit is contained in:
parent
998f20ed5f
commit
ba4fb0b8e5
29
debian/changelog
vendored
29
debian/changelog
vendored
@ -1,27 +1,13 @@
|
|||||||
llvm-toolchain-14 (1:14.0.6-10~exp1) experimental; urgency=medium
|
|
||||||
|
|
||||||
* More WebAssembly (wasm32/wasm64) work:
|
|
||||||
- Update patch wasm-sysroot-usr to stop including /usr/include when
|
|
||||||
building for the non-OS (unknown) wasm targets, to avoid inadvertently
|
|
||||||
including the host's (glibc) headers.
|
|
||||||
- Re-enable builds on all architectures, previously disabled for
|
|
||||||
arm64 armel mips64el mipsel ppc64el armhf in 1:14.0.6-4, due to an FTBFS
|
|
||||||
related to the /usr/include issue above.
|
|
||||||
- Update patch wasm-sysroot-usr to adjust system include paths for C++
|
|
||||||
headers as well.
|
|
||||||
- Build libc++ and libc++abi for wasm32-wasi, generating two new binary
|
|
||||||
packages, and introducing a build dependency on wasi-libc.
|
|
||||||
- Misc code organization fixes to debian/rules.
|
|
||||||
|
|
||||||
-- Faidon Liambotis <paravoid@debian.org> Fri, 18 Nov 2022 08:21:02 +0200
|
|
||||||
|
|
||||||
llvm-toolchain-14 (1:14.0.6-9) unstable; urgency=medium
|
llvm-toolchain-14 (1:14.0.6-9) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Cherry-pick upstream commit c081bf4098c729afacf20303cc9df62bf13c3362
|
||||||
|
to fix chromium failure in basic_string (Closes: #1025394)
|
||||||
* Disable the MLIR testsuite run because of a freeze
|
* Disable the MLIR testsuite run because of a freeze
|
||||||
(Closes: #1024154)
|
(Closes: #1024154)
|
||||||
See https://github.com/llvm/llvm-project/issues/58357
|
See https://github.com/llvm/llvm-project/issues/58357
|
||||||
|
* Disable wasm on riscv64
|
||||||
|
|
||||||
-- Sylvestre Ledru <sylvestre@debian.org> Tue, 15 Nov 2022 18:23:44 +0100
|
-- Gianfranco Costamagna <locutusofborg@debian.org> Sun, 04 Dec 2022 09:03:06 +0100
|
||||||
|
|
||||||
llvm-toolchain-14 (1:14.0.6-8) unstable; urgency=medium
|
llvm-toolchain-14 (1:14.0.6-8) unstable; urgency=medium
|
||||||
|
|
||||||
@ -1873,6 +1859,13 @@ llvm-toolchain-snapshot (1:11~++20200621103028+10b0539772d-1~exp1) UNRELEASED; u
|
|||||||
* Upstream change ad97ccf6b26a29262c9cbf5b3e7f6e84c6dcf55f
|
* Upstream change ad97ccf6b26a29262c9cbf5b3e7f6e84c6dcf55f
|
||||||
broke clangd-atomic-cmake.patch causing some undef symbol on
|
broke clangd-atomic-cmake.patch causing some undef symbol on
|
||||||
i386 and atomic
|
i386 and atomic
|
||||||
|
* experimental New snapshot release
|
||||||
|
* experimental New snapshot release
|
||||||
|
* experimental New snapshot release
|
||||||
|
* experimental New snapshot release
|
||||||
|
* experimental New snapshot release
|
||||||
|
* experimental New snapshot release
|
||||||
|
* experimental New snapshot release
|
||||||
|
|
||||||
-- Sylvestre Ledru <sylvestre@debian.org> Sun, 21 Jun 2020 10:33:23 +0200
|
-- Sylvestre Ledru <sylvestre@debian.org> Sun, 21 Jun 2020 10:33:23 +0200
|
||||||
|
|
||||||
|
43
debian/control
vendored
43
debian/control
vendored
@ -24,7 +24,6 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build,
|
|||||||
libpfm4-dev [linux-any], python3-setuptools, libz3-dev,
|
libpfm4-dev [linux-any], python3-setuptools, libz3-dev,
|
||||||
llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] <!stage1> | hello [!i386],
|
llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] <!stage1> | hello [!i386],
|
||||||
spirv-tools [ linux-any ] | hello [ !i386],
|
spirv-tools [ linux-any ] | hello [ !i386],
|
||||||
wasi-libc,
|
|
||||||
libcurl4-dev,
|
libcurl4-dev,
|
||||||
libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x],
|
libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x],
|
||||||
protobuf-compiler-grpc [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x],
|
protobuf-compiler-grpc [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x],
|
||||||
@ -649,29 +648,6 @@ Description: LLVM C++ Standard library (development files)
|
|||||||
as exception objects, rtti and memory allocation.
|
as exception objects, rtti and memory allocation.
|
||||||
* Extensive unit tests.
|
* Extensive unit tests.
|
||||||
|
|
||||||
Package: libc++-14-dev-wasm32
|
|
||||||
Section: libdevel
|
|
||||||
Architecture: all
|
|
||||||
Multi-Arch: foreign
|
|
||||||
Depends: wasi-libc, libc++abi-14-dev-wasm32, ${misc:Depends}
|
|
||||||
Provides: libc++-x.y-dev-wasm32
|
|
||||||
Conflicts: libc++-x.y-dev-wasm32
|
|
||||||
Replaces: libc++-x.y-dev-wasm32
|
|
||||||
Description: LLVM C++ Standard library (WASI)
|
|
||||||
libc++ is another implementation of the C++ standard library
|
|
||||||
.
|
|
||||||
Features and Goals
|
|
||||||
.
|
|
||||||
* Correctness as defined by the C++ standards.
|
|
||||||
* Fast execution.
|
|
||||||
* Minimal memory use.
|
|
||||||
* Fast compile times.
|
|
||||||
* ABI compatibility with gcc's libstdc++ for some low-level features such
|
|
||||||
as exception objects, rtti and memory allocation.
|
|
||||||
* Extensive unit tests.
|
|
||||||
.
|
|
||||||
This package provides a version for the 32-bit WebAssembly System Interface.
|
|
||||||
|
|
||||||
# ------------- libcxxabi -------------
|
# ------------- libcxxabi -------------
|
||||||
|
|
||||||
Package: libc++abi1-14
|
Package: libc++abi1-14
|
||||||
@ -711,25 +687,6 @@ Description: LLVM low level support for a standard C++ library (development file
|
|||||||
* Correctness as defined by the C++ standards.
|
* Correctness as defined by the C++ standards.
|
||||||
* Provide a portable sublayer to ease the porting of libc++
|
* Provide a portable sublayer to ease the porting of libc++
|
||||||
|
|
||||||
Package: libc++abi-14-dev-wasm32
|
|
||||||
Section: libdevel
|
|
||||||
Architecture: all
|
|
||||||
Multi-Arch: foreign
|
|
||||||
Depends: wasi-libc, ${misc:Depends}
|
|
||||||
Provides: libc++abi-x.y-dev-wasm32
|
|
||||||
Conflicts: libc++abi-x.y-dev-wasm32
|
|
||||||
Replaces: libc++abi-x.y-dev-wasm32
|
|
||||||
Description: LLVM low level support for a standard C++ library (WASI)
|
|
||||||
libc++abi is another implementation of low level support for a standard C++
|
|
||||||
library.
|
|
||||||
.
|
|
||||||
Features and Goals
|
|
||||||
.
|
|
||||||
* Correctness as defined by the C++ standards.
|
|
||||||
* Provide a portable sublayer to ease the porting of libc++
|
|
||||||
.
|
|
||||||
This package provides a version for the 32-bit WebAssembly System Interface.
|
|
||||||
|
|
||||||
# ------------- libclc -------------
|
# ------------- libclc -------------
|
||||||
|
|
||||||
Package: libclc-14
|
Package: libclc-14
|
||||||
|
3
debian/libc++-X.Y-dev-wasm32.install.in
vendored
3
debian/libc++-X.Y-dev-wasm32.install.in
vendored
@ -1,3 +0,0 @@
|
|||||||
usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a
|
|
||||||
usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/
|
|
||||||
usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/v1/
|
|
2
debian/libc++-X.Y-dev-wasm32.links.in
vendored
2
debian/libc++-X.Y-dev-wasm32.links.in
vendored
@ -1,2 +0,0 @@
|
|||||||
usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a /usr/lib/wasm32-wasi/libc++.a
|
|
||||||
usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/v1 /usr/include/wasm32-wasi/c++/v1
|
|
@ -1 +0,0 @@
|
|||||||
libc++-@LLVM_VERSION@-dev-wasm32: arch-independent-package-contains-binary-or-object usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a
|
|
1
debian/libc++abi-X.Y-dev-wasm32.install.in
vendored
1
debian/libc++abi-X.Y-dev-wasm32.install.in
vendored
@ -1 +0,0 @@
|
|||||||
usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a
|
|
1
debian/libc++abi-X.Y-dev-wasm32.links.in
vendored
1
debian/libc++abi-X.Y-dev-wasm32.links.in
vendored
@ -1 +0,0 @@
|
|||||||
usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a /usr/lib/wasm32-wasi/libc++abi.a
|
|
@ -1 +0,0 @@
|
|||||||
libc++abi-@LLVM_VERSION@-dev-wasm32: arch-independent-package-contains-binary-or-object usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a
|
|
87
debian/patches/basic_string.patch
vendored
Normal file
87
debian/patches/basic_string.patch
vendored
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
From c081bf4098c729afacf20303cc9df62bf13c3362 Mon Sep 17 00:00:00 2001
|
||||||
|
From: serge-sans-paille <sguelton@redhat.com>
|
||||||
|
Date: Sat, 18 Jun 2022 13:48:41 +0200
|
||||||
|
Subject: [PATCH] [clang] Enforce instantiation of constexpr template functions
|
||||||
|
during non-constexpr evaluation
|
||||||
|
|
||||||
|
Otherwise these functions are not instantiated and we end up with an undefined
|
||||||
|
symbol.
|
||||||
|
|
||||||
|
Fix #55560
|
||||||
|
|
||||||
|
Differential Revision: https://reviews.llvm.org/D128119
|
||||||
|
---
|
||||||
|
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 5 +++--
|
||||||
|
.../CodeGenCXX/constexpr-late-instantiation.cpp | 17 +++++++++++++++++
|
||||||
|
.../SemaCXX/constexpr-late-instantiation.cpp | 15 +++++++++++++++
|
||||||
|
3 files changed, 35 insertions(+), 2 deletions(-)
|
||||||
|
create mode 100644 clang/test/CodeGenCXX/constexpr-late-instantiation.cpp
|
||||||
|
create mode 100644 clang/test/SemaCXX/constexpr-late-instantiation.cpp
|
||||||
|
|
||||||
|
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
|
||||||
|
index 467372c71496a..293782822e839 100644
|
||||||
|
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
|
||||||
|
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
|
||||||
|
@@ -4826,7 +4826,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
|
||||||
|
/*Complain*/DefinitionRequired)) {
|
||||||
|
if (DefinitionRequired)
|
||||||
|
Function->setInvalidDecl();
|
||||||
|
- else if (TSK == TSK_ExplicitInstantiationDefinition) {
|
||||||
|
+ else if (TSK == TSK_ExplicitInstantiationDefinition ||
|
||||||
|
+ (Function->isConstexpr() && !Recursive)) {
|
||||||
|
// Try again at the end of the translation unit (at which point a
|
||||||
|
// definition will be required).
|
||||||
|
assert(!Recursive);
|
||||||
|
@@ -4841,7 +4842,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
|
||||||
|
Diag(PatternDecl->getLocation(), diag::note_forward_template_decl);
|
||||||
|
if (getLangOpts().CPlusPlus11)
|
||||||
|
Diag(PointOfInstantiation, diag::note_inst_declaration_hint)
|
||||||
|
- << Function;
|
||||||
|
+ << Function;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/clang/test/CodeGenCXX/constexpr-late-instantiation.cpp b/clang/test/CodeGenCXX/constexpr-late-instantiation.cpp
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000..1c8eef73f2dda
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/clang/test/CodeGenCXX/constexpr-late-instantiation.cpp
|
||||||
|
@@ -0,0 +1,17 @@
|
||||||
|
+// Make sure foo is instantiated and we don't get a link error
|
||||||
|
+// RUN: %clang_cc1 -S -emit-llvm -triple %itanium_abi_triple %s -o- | FileCheck %s
|
||||||
|
+
|
||||||
|
+template <typename T>
|
||||||
|
+constexpr T foo(T a);
|
||||||
|
+
|
||||||
|
+// CHECK-LABEL: define {{.*}} @main
|
||||||
|
+int main() {
|
||||||
|
+ // CHECK: call {{.*}} @_Z3fooIiET_S0_
|
||||||
|
+ int k = foo<int>(5);
|
||||||
|
+}
|
||||||
|
+// CHECK: }
|
||||||
|
+
|
||||||
|
+template <typename T>
|
||||||
|
+constexpr T foo(T a) {
|
||||||
|
+ return a;
|
||||||
|
+}
|
||||||
|
diff --git a/clang/test/SemaCXX/constexpr-late-instantiation.cpp b/clang/test/SemaCXX/constexpr-late-instantiation.cpp
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000..ec8e071217c1d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/clang/test/SemaCXX/constexpr-late-instantiation.cpp
|
||||||
|
@@ -0,0 +1,15 @@
|
||||||
|
+// RUN: %clang_cc1 %s -fsyntax-only -verify
|
||||||
|
+
|
||||||
|
+template <typename T>
|
||||||
|
+constexpr T foo(T a); // expected-note {{declared here}}
|
||||||
|
+
|
||||||
|
+int main() {
|
||||||
|
+ int k = foo<int>(5); // Ok
|
||||||
|
+ constexpr int j = // expected-error {{constexpr variable 'j' must be initialized by a constant expression}}
|
||||||
|
+ foo<int>(5); // expected-note {{undefined function 'foo<int>' cannot be used in a constant expression}}
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+template <typename T>
|
||||||
|
+constexpr T foo(T a) {
|
||||||
|
+ return a;
|
||||||
|
+}
|
1
debian/patches/series
vendored
1
debian/patches/series
vendored
@ -160,3 +160,4 @@ fix-typo-1018770.diff
|
|||||||
lldb/lldb-swig.diff
|
lldb/lldb-swig.diff
|
||||||
lldb/lldb-swig-2.diff
|
lldb/lldb-swig-2.diff
|
||||||
protobuf_3.21.patch
|
protobuf_3.21.patch
|
||||||
|
basic_string.patch
|
||||||
|
39
debian/patches/wasm/wasm-sysroot-usr.diff
vendored
39
debian/patches/wasm/wasm-sysroot-usr.diff
vendored
@ -27,54 +27,21 @@ Index: llvm-toolchain-14-14.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp
|
|||||||
|
|
||||||
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
|
if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
|
||||||
SmallString<128> P(D.ResourceDir);
|
SmallString<128> P(D.ResourceDir);
|
||||||
@@ -419,27 +421,39 @@ void WebAssembly::AddClangSystemIncludeA
|
@@ -421,10 +423,10 @@ void WebAssembly::AddClangSystemIncludeA
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // add the multiarch path on e.g. wasm32-wasi
|
|
||||||
if (getTriple().getOS() != llvm::Triple::UnknownOS) {
|
if (getTriple().getOS() != llvm::Triple::UnknownOS) {
|
||||||
const std::string MultiarchTriple =
|
const std::string MultiarchTriple =
|
||||||
- getMultiarchTriple(D, getTriple(), D.SysRoot);
|
- getMultiarchTriple(D, getTriple(), D.SysRoot);
|
||||||
- addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include/" + MultiarchTriple);
|
- addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include/" + MultiarchTriple);
|
||||||
+ getMultiarchTriple(D, getTriple(), SysRoot);
|
+ getMultiarchTriple(D, getTriple(), SysRoot);
|
||||||
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/local/include/" + MultiarchTriple);
|
|
||||||
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/local/include");
|
|
||||||
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include/" + MultiarchTriple);
|
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include/" + MultiarchTriple);
|
||||||
}
|
}
|
||||||
- addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include");
|
- addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include");
|
||||||
+
|
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include");
|
||||||
+ // also add the non-multiarch path, only on a known OS (as above), or when
|
|
||||||
+ // a sysroot is given, for backwards compatibility with the original driver
|
|
||||||
+ if (getTriple().getOS() != llvm::Triple::UnknownOS ||
|
|
||||||
+ !getDriver().SysRoot.empty())
|
|
||||||
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebAssembly::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
|
void WebAssembly::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
|
||||||
ArgStringList &CC1Args) const {
|
@@ -467,3 +469,15 @@ SanitizerMask WebAssembly::getSupportedS
|
||||||
+ std::string SysRoot = computeSysRoot();
|
|
||||||
+
|
|
||||||
if (!DriverArgs.hasArg(options::OPT_nostdlibinc) &&
|
|
||||||
!DriverArgs.hasArg(options::OPT_nostdincxx)) {
|
|
||||||
if (getTriple().getOS() != llvm::Triple::UnknownOS) {
|
|
||||||
const std::string MultiarchTriple =
|
|
||||||
- getMultiarchTriple(getDriver(), getTriple(), getDriver().SysRoot);
|
|
||||||
+ getMultiarchTriple(getDriver(), getTriple(), SysRoot);
|
|
||||||
addSystemInclude(DriverArgs, CC1Args,
|
|
||||||
- getDriver().SysRoot + "/include/" + MultiarchTriple +
|
|
||||||
+ SysRoot + "/include/" + MultiarchTriple +
|
|
||||||
"/c++/v1");
|
|
||||||
}
|
|
||||||
- addSystemInclude(DriverArgs, CC1Args,
|
|
||||||
- getDriver().SysRoot + "/include/c++/v1");
|
|
||||||
+
|
|
||||||
+ // don't include the host architecture's headers in the search path
|
|
||||||
+ if (!getDriver().SysRoot.empty())
|
|
||||||
+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include/c++/v1");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -467,3 +481,15 @@ SanitizerMask WebAssembly::getSupportedS
|
|
||||||
Tool *WebAssembly::buildLinker() const {
|
Tool *WebAssembly::buildLinker() const {
|
||||||
return new tools::wasm::Linker(*this);
|
return new tools::wasm::Linker(*this);
|
||||||
}
|
}
|
||||||
|
26
debian/qualify-clang.sh
vendored
26
debian/qualify-clang.sh
vendored
@ -1361,34 +1361,22 @@ fi
|
|||||||
if dpkg -l|grep -q wasi-libc; then
|
if dpkg -l|grep -q wasi-libc; then
|
||||||
cat <<EOF > printf.c
|
cat <<EOF > printf.c
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[])
|
||||||
printf("%s\n", "Hello World!");
|
{
|
||||||
|
printf("%s\n", "Hello world!");
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
# wasi-libc supports only wasm32 right now
|
clang-$VERSION -target wasm32-unknown-wasi -o printf printf.c
|
||||||
clang-$VERSION -target wasm32-wasi -o printf printf.c
|
|
||||||
file printf &> foo.log
|
file printf &> foo.log
|
||||||
if ! grep -q "WebAssembly" foo.log; then
|
if ! grep -q "WebAssembly" foo.log; then
|
||||||
echo "the generated file isn't a WebAssembly file?"
|
echo "the generated file isn't a WebAssembly file?"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rm -f printf.c printf
|
rm -f printf.c printf
|
||||||
|
|
||||||
cat <<EOF > cout.cpp
|
|
||||||
#include <iostream>
|
|
||||||
int main() {
|
|
||||||
std::cout << "Hello World!" << std::endl;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
# libcxx requires wasi-libc, which only exists for wasm32 right now
|
|
||||||
clang++-$VERSION --target=wasm32-wasi -o cout cout.cpp
|
|
||||||
file cout &> foo.log
|
|
||||||
if ! grep -q "WebAssembly" foo.log; then
|
|
||||||
echo "the generated file isn't a WebAssembly file?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
rm -f cout.cpp cout
|
|
||||||
fi
|
fi
|
||||||
|
echo '#include <algorithm>' > foo.cpp
|
||||||
|
# Fails for now
|
||||||
|
clang++-$VERSION --target=wasm32-wasi -o foo.o -c foo.cpp||true
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
154
debian/rules
vendored
154
debian/rules
vendored
@ -302,6 +302,12 @@ ifeq ($(LIBUNWIND_ENABLE),yes)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
COMPILER_RT_WASM_ENABLE=yes
|
||||||
|
|
||||||
|
ifneq (,$(filter $(DEB_HOST_ARCH), arm64 armel mips64el mipsel ppc64el armhf riscv64))
|
||||||
|
COMPILER_RT_WASM_ENABLE=no
|
||||||
|
endif
|
||||||
|
|
||||||
# Do not install objects
|
# Do not install objects
|
||||||
STAGE_ALL_CMAKE_EXTRA += -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF
|
STAGE_ALL_CMAKE_EXTRA += -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF
|
||||||
|
|
||||||
@ -709,17 +715,17 @@ debian-libclc-build:
|
|||||||
ninja $(NJOBS) $(VERBOSE)
|
ninja $(NJOBS) $(VERBOSE)
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
build-wasm/compiler-rt-%: cpu = $(@:build-wasm/compiler-rt-%=%)
|
debian-rtlib-wasm-build:
|
||||||
build-wasm/compiler-rt-%:
|
ifeq (${COMPILER_RT_WASM_ENABLE},yes)
|
||||||
@echo "Building compiler-rt for $(cpu)"
|
echo "Using cmake: $(CMAKE_BIN)"
|
||||||
@echo "Using cmake: $(CMAKE_BIN)"
|
for build in wasm32 wasm64; do \
|
||||||
mkdir -p "$@"
|
mkdir -p build-compiler-rt-$$build; \
|
||||||
$(CMAKE_BIN) -B "$@" -S compiler-rt/lib/builtins/ \
|
$(CMAKE_BIN) -B build-compiler-rt-$$build -S compiler-rt/lib/builtins/ \
|
||||||
-G Ninja \
|
-G Ninja \
|
||||||
$(SCCACHE_CMAKE) \
|
$(SCCACHE_CMAKE) \
|
||||||
-DCMAKE_C_COMPILER_TARGET=$(cpu)-unknown-unknown \
|
-DCMAKE_C_COMPILER_TARGET=$$build-unknown-unknown \
|
||||||
-DCMAKE_CXX_COMPILER_TARGET=$(cpu)-unknown-unknown \
|
-DCMAKE_CXX_COMPILER_TARGET=$$build-unknown-unknown \
|
||||||
-DCMAKE_ASM_COMPILER_TARGET=$(cpu)-unknown-unknown \
|
-DCMAKE_ASM_COMPILER_TARGET=$$build-unknown-unknown \
|
||||||
-DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \
|
-DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \
|
||||||
-DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \
|
-DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \
|
||||||
-DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS)" \
|
-DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS)" \
|
||||||
@ -736,112 +742,25 @@ build-wasm/compiler-rt-%:
|
|||||||
-DCOMPILER_RT_INCLUDE_TESTS=OFF \
|
-DCOMPILER_RT_INCLUDE_TESTS=OFF \
|
||||||
-DCOMPILER_RT_USE_LIBCXX=OFF \
|
-DCOMPILER_RT_USE_LIBCXX=OFF \
|
||||||
-DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \
|
-DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \
|
||||||
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$(cpu)-unknown-unknown \
|
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$$build-unknown-unknown \
|
||||||
-DCOMPILER_RT_OS_DIR=wasi
|
-DCOMPILER_RT_OS_DIR=wasi; \
|
||||||
ninja -C "$@" $(NJOBS) $(VERBOSE)
|
ninja -C build-compiler-rt-$$build $(NJOBS) $(VERBOSE); \
|
||||||
|
done
|
||||||
build-wasm/libcxx-%-wasi: cpu = $(@:build-wasm/libcxx-%-wasi=%)
|
else
|
||||||
build-wasm/libcxx-%-wasi: build-wasm/compiler-rt-%
|
echo "Skip on this arch"
|
||||||
@echo "Building libcxx for $(cpu)"
|
endif
|
||||||
@echo "Using cmake: $(CMAKE_BIN)"
|
|
||||||
|
|
||||||
# We need a functioning clang, which in turn requires a linker. We
|
|
||||||
# patch clang to use a versioned wasm-ld (cf. wasm-ld-path.diff), so
|
|
||||||
# create wasm-ld-$(LLVM_VERSION) in the stage2 bin dir manually.
|
|
||||||
cp $(STAGE_2_BIN_DIR)/wasm-ld $(STAGE_2_BIN_DIR)/wasm-ld-$(LLVM_VERSION)
|
|
||||||
|
|
||||||
# We need a wasm compiler-rt. Depend on the make target that builds it,
|
|
||||||
# and manually copy it to the stage2 lib dir from there
|
|
||||||
mkdir -p \
|
|
||||||
$(STAGE_2_LIB_DIR)/clang/$(LLVM_VERSION_FULL)/lib/wasi/
|
|
||||||
cp build-wasm/compiler-rt-$(cpu)/lib/wasi/libclang_rt.builtins-$(cpu).a \
|
|
||||||
$(STAGE_2_LIB_DIR)/clang/$(LLVM_VERSION_FULL)/lib/wasi/
|
|
||||||
|
|
||||||
# Notes:
|
|
||||||
# - Uses $(LDFLAGS) instead of $(STAGE_2_LDFLAGS), because wasm-ld does not
|
|
||||||
# support --build-id yet. Upstream is working on it, cf. D107662.
|
|
||||||
# - Pass -fno-stack-protector to disable -fstack-protector-strong that is
|
|
||||||
# passed by default, as this is not supported yet in WebAssembly, cf.
|
|
||||||
# https://github.com/WebAssembly/wasi-libc/issues/157
|
|
||||||
# - Use llvm-ar and llvm-ranlib, as binutils does not currently support
|
|
||||||
# WebAssembly and creates invalid indexes.
|
|
||||||
# - Use LLVM_LIBDIR_SUFFIX to install to /usr/lib/wasm32-wasi. To be
|
|
||||||
# replaced by CMAKE_INSTALL_LIBDIR=lib/$(cpu)-wasi when D130586
|
|
||||||
# ships.
|
|
||||||
mkdir -p "$@"
|
|
||||||
$(CMAKE_BIN) -B "$@" -S runtimes \
|
|
||||||
-G $(GENERATOR) \
|
|
||||||
$(SCCACHE_CMAKE) \
|
|
||||||
-DCMAKE_C_COMPILER_WORKS=ON \
|
|
||||||
-DCMAKE_CXX_COMPILER_WORKS=ON \
|
|
||||||
-DLLVM_COMPILER_CHECKED=ON \
|
|
||||||
-DCMAKE_C_COMPILER_TARGET=$(cpu)-unknown-wasi \
|
|
||||||
-DCMAKE_CXX_COMPILER_TARGET=$(cpu)-unknown-wasi \
|
|
||||||
-DCMAKE_ASM_COMPILER_TARGET=$(cpu)-unknown-wasi \
|
|
||||||
-DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \
|
|
||||||
-DCMAKE_AR=$(STAGE_2_BIN_DIR)/llvm-ar \
|
|
||||||
-DCMAKE_RANLIB=$(STAGE_2_BIN_DIR)/llvm-ranlib \
|
|
||||||
-DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS) -fno-stack-protector" \
|
|
||||||
-DCMAKE_CXX_FLAGS="$(opt_flags) $(STAGE_2_CXXFLAGS) -fno-stack-protector" \
|
|
||||||
-DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \
|
|
||||||
-DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \
|
|
||||||
-DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$(LLVM_VERSION) \
|
|
||||||
-DCMAKE_INSTALL_INCLUDEDIR=include/$(cpu)-wasi \
|
|
||||||
-DLLVM_LIBDIR_SUFFIX=/$(cpu)-wasi \
|
|
||||||
-DLLVM_CONFIG=$(STAGE_2_BIN_DIR)/llvm-config \
|
|
||||||
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
|
|
||||||
-DLIBCXX_USE_COMPILER_RT=ON \
|
|
||||||
-DLIBCXXABI_USE_COMPILER_RT=ON \
|
|
||||||
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \
|
|
||||||
-DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \
|
|
||||||
-DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \
|
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
|
|
||||||
-DLIBCXX_CXX_ABI=libcxxabi \
|
|
||||||
-DLIBCXX_ABI_VERSION=2 \
|
|
||||||
-DLIBCXX_HAS_MUSL_LIBC:BOOL=ON \
|
|
||||||
-DLIBCXX_ENABLE_SHARED:BOOL=OFF \
|
|
||||||
-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL=OFF \
|
|
||||||
-DLIBCXX_ENABLE_EXCEPTIONS:BOOL=OFF \
|
|
||||||
-DLIBCXX_ENABLE_FILESYSTEM:BOOL=OFF \
|
|
||||||
-DLIBCXX_ENABLE_THREADS:BOOL=OFF \
|
|
||||||
-DLIBCXX_HAS_PTHREAD_API:BOOL=OFF \
|
|
||||||
-DLIBCXX_HAS_EXTERNAL_THREAD_API:BOOL=OFF \
|
|
||||||
-DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF \
|
|
||||||
-DLIBCXXABI_ENABLE_SHARED:BOOL=OFF \
|
|
||||||
-DLIBCXXABI_ENABLE_EXCEPTIONS:BOOL=OFF \
|
|
||||||
-DLIBCXXABI_SILENT_TERMINATE:BOOL=ON \
|
|
||||||
-DLIBCXXABI_ENABLE_THREADS:BOOL=OFF \
|
|
||||||
-DLIBCXXABI_HAS_PTHREAD_API:BOOL=OFF \
|
|
||||||
-DLIBCXXABI_HAS_EXTERNAL_THREAD_API:BOOL=OFF \
|
|
||||||
-DLIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF
|
|
||||||
ninja -C "$@" $(NJOBS) $(VERBOSE)
|
|
||||||
|
|
||||||
# Build compiler-rt for wasm32 and wasm64. Build libcxx only for wasm32, as
|
|
||||||
# libcxx requires wasi-libc, which only exists for wasm32 right now.
|
|
||||||
debian-wasm-build: \
|
|
||||||
build-wasm/compiler-rt-wasm32 \
|
|
||||||
build-wasm/libcxx-wasm32-wasi \
|
|
||||||
build-wasm/compiler-rt-wasm64
|
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
|
||||||
sccache-stats:
|
sccache-stats:
|
||||||
# If we used sccache, shows stats
|
# If we used sccache, shows stats
|
||||||
if test -f /opt/sccache/sccache; then \
|
if test -f /opt/sccache/sccache; then \
|
||||||
ls -al /opt/sccache/; \
|
ls -al /opt/sccache/; \
|
||||||
mkdir -p /tmp/buildd/source/; \
|
/opt/sccache/sccache --show-stats; \
|
||||||
/opt/sccache/sccache --stats-format json --show-stats > /tmp/buildd/source/sccache-stats.json; \
|
|
||||||
cat /tmp/buildd/source/sccache-stats.json; \
|
|
||||||
fi
|
fi
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
override_dh_auto_build: \
|
override_dh_auto_build: debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build sccache-stats
|
||||||
debian-full-build \
|
|
||||||
debian-libfuzzer-build \
|
|
||||||
debian-libclc-build \
|
|
||||||
debian-wasm-build \
|
|
||||||
sccache-stats
|
|
||||||
|
|
||||||
override_dh_prep: build_doc
|
override_dh_prep: build_doc
|
||||||
dh_prep
|
dh_prep
|
||||||
@ -980,10 +899,10 @@ endif
|
|||||||
$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/build/utils/lit/lit/*/__pycache__/
|
$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/build/utils/lit/lit/*/__pycache__/
|
||||||
|
|
||||||
DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C libclc/build install
|
DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C libclc/build install
|
||||||
|
ifeq (${COMPILER_RT_WASM_ENABLE},yes)
|
||||||
DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm32 install
|
DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm32 install
|
||||||
DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm64 install
|
DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm64 install
|
||||||
DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/libcxx-wasm32-wasi install
|
endif
|
||||||
|
|
||||||
# Rename binaries
|
# Rename binaries
|
||||||
mkdir -p $(DEB_INST)/usr/bin/
|
mkdir -p $(DEB_INST)/usr/bin/
|
||||||
@ -1137,7 +1056,7 @@ ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' bin
|
|||||||
else
|
else
|
||||||
# GNU strip doesn't recognize WebAssembly binaries, and actually corrupts them.
|
# GNU strip doesn't recognize WebAssembly binaries, and actually corrupts them.
|
||||||
# llvm-strip (as of 15.0.2) fails with --strip-debug (but works with --strip-all)
|
# llvm-strip (as of 15.0.2) fails with --strip-debug (but works with --strip-all)
|
||||||
dh_strip -a -v -Xlibclang_rt.builtins-wasm32.a -Xlibclang_rt.builtins-wasm64.a -Xusr/lib/wasm32-wasi
|
dh_strip -a -v -Xlibclang_rt.builtins-wasm32.a -Xlibclang_rt.builtins-wasm64.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
override_dh_install:
|
override_dh_install:
|
||||||
@ -1167,13 +1086,6 @@ override_dh_installdeb:
|
|||||||
|
|
||||||
# Remove some libc++ abi files in the libc++ file. See bug #969274
|
# Remove some libc++ abi files in the libc++ file. See bug #969274
|
||||||
rm -f $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/__cxxabi_config.h $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/cxxabi.h
|
rm -f $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/__cxxabi_config.h $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/cxxabi.h
|
||||||
|
|
||||||
mkdir -p $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1
|
|
||||||
mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h \
|
|
||||||
$(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h
|
|
||||||
mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h \
|
|
||||||
$(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h
|
|
||||||
|
|
||||||
# Remove auto generated python pyc
|
# Remove auto generated python pyc
|
||||||
find $(CURDIR)/debian/llvm-$(LLVM_VERSION)-tools/usr/lib/llvm-$(LLVM_VERSION)/ -name '*.pyc' | xargs -r rm -f
|
find $(CURDIR)/debian/llvm-$(LLVM_VERSION)-tools/usr/lib/llvm-$(LLVM_VERSION)/ -name '*.pyc' | xargs -r rm -f
|
||||||
|
|
||||||
@ -1262,7 +1174,7 @@ override_dh_auto_test:
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
override_dh_gencontrol: sccache-stats
|
override_dh_gencontrol:
|
||||||
dh_gencontrol -- $(control_vars)
|
dh_gencontrol -- $(control_vars)
|
||||||
|
|
||||||
|
|
||||||
@ -1282,7 +1194,7 @@ override_dh_auto_clean:
|
|||||||
rm -f $(CURDIR)/clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION)
|
rm -f $(CURDIR)/clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION)
|
||||||
rm -f $(CURDIR)/clang/tools/clang-format/clang-format-$(LLVM_VERSION).py
|
rm -f $(CURDIR)/clang/tools/clang-format/clang-format-$(LLVM_VERSION).py
|
||||||
rm -rf libclc/build
|
rm -rf libclc/build
|
||||||
rm -rf build-wasm
|
rm -rf build-compiler-rt-wasm32 build-compiler-rt-wasm64
|
||||||
if test -f lld/docs/ld.lld-$(LLVM_VERSION).1; then \
|
if test -f lld/docs/ld.lld-$(LLVM_VERSION).1; then \
|
||||||
mv lld/docs/ld.lld-$(LLVM_VERSION).1 lld/docs/ld.lld.1; \
|
mv lld/docs/ld.lld-$(LLVM_VERSION).1 lld/docs/ld.lld.1; \
|
||||||
fi
|
fi
|
||||||
@ -1298,4 +1210,4 @@ override_dh_auto_clean:
|
|||||||
: # remove extra stamps
|
: # remove extra stamps
|
||||||
rm -f debian-*-build
|
rm -f debian-*-build
|
||||||
|
|
||||||
.PHONY: override_dh_strip preconfigure
|
.PHONY: override_dh_strip preconfigure debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build
|
||||||
|
Loading…
Reference in New Issue
Block a user