From 34affc37681f612ef8e33b3254cb0bf667cea724 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Fri, 16 Feb 2024 09:54:15 +0100 Subject: [PATCH 1/7] Install *clang_rt* on sparc and sparc64 --- debian/changelog | 7 +++++++ debian/libclang-rt-X.Y-dev.install.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3109171d..04173f79 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +llvm-toolchain-18 (1:18.1.0~rc2-4) UNRELEASED; urgency=medium + + [ John Paul Adrian Glaubitz ] + * Install *clang_rt* on sparc and sparc64 + + -- John Paul Adrian Glaubitz Fri, 16 Feb 2024 09:53:15 +0100 + llvm-toolchain-18 (1:18.1.0~rc2-3) unstable; urgency=medium * Add abi=+time64,+lfs only on 64bits system diff --git a/debian/libclang-rt-X.Y-dev.install.in b/debian/libclang-rt-X.Y-dev.install.in index 8b973ead..cd2a8425 100644 --- a/debian/libclang-rt-X.Y-dev.install.in +++ b/debian/libclang-rt-X.Y-dev.install.in @@ -2,7 +2,7 @@ usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/share/*.txt usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/sanitizer/ -[!sparc !sparc64] usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib/*/*clang_rt* +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib/*/*clang_rt* usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/README.txt usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/fuzzer/ usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/orc/c_api.h From 88f4607443718947014f1553df6d367ea9b25ea3 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Fri, 16 Feb 2024 09:55:07 +0100 Subject: [PATCH 2/7] Run chrpath for libclang on sparc and sparc64 --- debian/changelog | 1 + debian/rules | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 04173f79..6f1015ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ llvm-toolchain-18 (1:18.1.0~rc2-4) UNRELEASED; urgency=medium [ John Paul Adrian Glaubitz ] * Install *clang_rt* on sparc and sparc64 + * Run chrpath for libclang on sparc and sparc64 -- John Paul Adrian Glaubitz Fri, 16 Feb 2024 09:53:15 +0100 diff --git a/debian/rules b/debian/rules index 9948e467..a5820140 100755 --- a/debian/rules +++ b/debian/rules @@ -1132,7 +1132,7 @@ override_dh_auto_install: # Only run on executable, not script chrpath -d `find $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/bin/ -type f -executable -exec file -i '{}' \; | grep 'x-executable; charset=binary'|cut -d: -f1` -ifeq (,$(filter $(DEB_HOST_ARCH), powerpc powerpcspe sparc sparc64)) +ifeq (,$(filter $(DEB_HOST_ARCH), powerpc powerpcspe)) ifneq (,$(filter $(DEB_HOST_ARCH_OS),linux)) # To fix custom-library-search-path chrpath -d $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION)*/lib/linux/*.so From 4df76dc5b4bb483bd90d944c592b4ac234b19c84 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 18 Feb 2024 22:34:01 +0100 Subject: [PATCH 3/7] add -DLIBCXX_INSTALL_MODULES=ON see https://discourse.llvm.org/t/libc-c-23-module-installation-support/77061/1 --- debian/changelog | 6 +++++- debian/rules | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6f1015ea..720513c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,11 @@ llvm-toolchain-18 (1:18.1.0~rc2-4) UNRELEASED; urgency=medium * Install *clang_rt* on sparc and sparc64 * Run chrpath for libclang on sparc and sparc64 - -- John Paul Adrian Glaubitz Fri, 16 Feb 2024 09:53:15 +0100 + [ Sylvestre Ledru ] + * add -DLIBCXX_INSTALL_MODULES=ON + see https://discourse.llvm.org/t/libc-c-23-module-installation-support/77061/1 + + -- Sylvestre Ledru Sun, 18 Feb 2024 22:32:30 +0100 llvm-toolchain-18 (1:18.1.0~rc2-3) unstable; urgency=medium diff --git a/debian/rules b/debian/rules index a5820140..89269eb6 100755 --- a/debian/rules +++ b/debian/rules @@ -781,6 +781,7 @@ endif -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \ -DLIBCXX_INSTALL_LIBRARY=OFF \ + -DLIBCXX_INSTALL_MODULES=ON \ -DOPENMP_ENABLE_LIBOMP_PROFILING=OFF \ -DOPENMP_ENABLE_LIBOMPTARGET_PROFILING=OFF \ -DLIBOMP_ENABLE_RTTI=OFF \ From 397c393faf92aee56c2d6f004a5078ccd283d040 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 19 Feb 2024 16:22:25 +0100 Subject: [PATCH 4/7] Ship libc++-18-dev /usr/lib/llvm-18/lib/libc++.modules.json /usr/lib/llvm-18/include/c++/v1/std.compat.cppm /usr/lib/llvm-18/include/c++/v1/std.cppm --- debian/changelog | 6 ++++-- debian/libc++-X.Y-dev.install.in | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 720513c7..8f7de8f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-18 (1:18.1.0~rc2-4) UNRELEASED; urgency=medium +llvm-toolchain-18 (1:18.1.0~rc2-5) UNRELEASED; urgency=medium [ John Paul Adrian Glaubitz ] * Install *clang_rt* on sparc and sparc64 @@ -7,8 +7,10 @@ llvm-toolchain-18 (1:18.1.0~rc2-4) UNRELEASED; urgency=medium [ Sylvestre Ledru ] * add -DLIBCXX_INSTALL_MODULES=ON see https://discourse.llvm.org/t/libc-c-23-module-installation-support/77061/1 + Ship libc++-18-dev /usr/lib/llvm-18/lib/libc++.modules.json /usr/lib/llvm-18/include/c++/v1/std.compat.cppm + /usr/lib/llvm-18/include/c++/v1/std.cppm - -- Sylvestre Ledru Sun, 18 Feb 2024 22:32:30 +0100 + -- Sylvestre Ledru Mon, 19 Feb 2024 16:21:34 +0100 llvm-toolchain-18 (1:18.1.0~rc2-3) unstable; urgency=medium diff --git a/debian/libc++-X.Y-dev.install.in b/debian/libc++-X.Y-dev.install.in index b3ac19c1..208e5daf 100644 --- a/debian/libc++-X.Y-dev.install.in +++ b/debian/libc++-X.Y-dev.install.in @@ -3,3 +3,6 @@ usr/lib/llvm-@LLVM_VERSION@/lib/libc++.a usr/lib/llvm-@LLVM_VERSION@/include/c++/ usr/lib/llvm-@LLVM_VERSION@/include/c++/v1/ usr/lib/llvm-@LLVM_VERSION@/lib/libc++experimental.a +build-llvm/modules/c++/v1/std.cppm usr/lib/llvm-@LLVM_VERSION@/include/c++/v1/ +build-llvm/modules/c++/v1/std.compat.cppm usr/lib/llvm-@LLVM_VERSION@/include/c++/v1/ +build-llvm/lib/libc++.modules.json usr/lib/llvm-@LLVM_VERSION@/lib/ From 9cd963c144f865a07f88f286d3c9c6c538879b39 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 19 Feb 2024 16:22:25 +0100 Subject: [PATCH 5/7] Ship libc++-18-dev /usr/lib/llvm-18/lib/libc++.modules.json /usr/lib/llvm-18/include/c++/v1/std.compat.cppm /usr/lib/llvm-18/include/c++/v1/std.cppm --- debian/changelog | 10 ++++++++++ debian/libc++-X.Y-dev.install.in | 9 ++++++--- debian/libllvmlibc-X.Y-dev.install.in | 1 + debian/rules | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 debian/libllvmlibc-X.Y-dev.install.in diff --git a/debian/changelog b/debian/changelog index 8f7de8f4..e36c84d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ llvm-toolchain-18 (1:18.1.0~rc2-5) UNRELEASED; urgency=medium +<<<<<<< [ John Paul Adrian Glaubitz ] * Install *clang_rt* on sparc and sparc64 * Run chrpath for libclang on sparc and sparc64 @@ -9,6 +10,15 @@ llvm-toolchain-18 (1:18.1.0~rc2-5) UNRELEASED; urgency=medium see https://discourse.llvm.org/t/libc-c-23-module-installation-support/77061/1 Ship libc++-18-dev /usr/lib/llvm-18/lib/libc++.modules.json /usr/lib/llvm-18/include/c++/v1/std.compat.cppm /usr/lib/llvm-18/include/c++/v1/std.cppm +======= + [ John Paul Adrian Glaubitz ] + * Install *clang_rt* on sparc and sparc64 + * Run chrpath for libclang on sparc and sparc64 + + [ Sylvestre Ledru ] + * add -DLIBCXX_INSTALL_MODULES=ON to install libc++ C++-20 modules + see https://discourse.llvm.org/t/libc-c-23-module-installation-support/77061/1 +>>>>>>> -- Sylvestre Ledru Mon, 19 Feb 2024 16:21:34 +0100 diff --git a/debian/libc++-X.Y-dev.install.in b/debian/libc++-X.Y-dev.install.in index 208e5daf..1a4d26ee 100644 --- a/debian/libc++-X.Y-dev.install.in +++ b/debian/libc++-X.Y-dev.install.in @@ -3,6 +3,9 @@ usr/lib/llvm-@LLVM_VERSION@/lib/libc++.a usr/lib/llvm-@LLVM_VERSION@/include/c++/ usr/lib/llvm-@LLVM_VERSION@/include/c++/v1/ usr/lib/llvm-@LLVM_VERSION@/lib/libc++experimental.a -build-llvm/modules/c++/v1/std.cppm usr/lib/llvm-@LLVM_VERSION@/include/c++/v1/ -build-llvm/modules/c++/v1/std.compat.cppm usr/lib/llvm-@LLVM_VERSION@/include/c++/v1/ -build-llvm/lib/libc++.modules.json usr/lib/llvm-@LLVM_VERSION@/lib/ + +# C++ modules +usr/lib/llvm-@LLVM_VERSION@/lib/libc++.modules.json +usr/lib/llvm-@LLVM_VERSION@/share/libc++/v1/std.compat/*.inc +usr/lib/llvm-@LLVM_VERSION@/share/libc++/v1/*.cppm +usr/lib/llvm-@LLVM_VERSION@/share/libc++/v1/std/*.inc diff --git a/debian/libllvmlibc-X.Y-dev.install.in b/debian/libllvmlibc-X.Y-dev.install.in new file mode 100644 index 00000000..cd6c1add --- /dev/null +++ b/debian/libllvmlibc-X.Y-dev.install.in @@ -0,0 +1 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/libllvmlibc.a diff --git a/debian/rules b/debian/rules index 89269eb6..6f4f3fe7 100755 --- a/debian/rules +++ b/debian/rules @@ -782,6 +782,7 @@ endif -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \ -DLIBCXX_INSTALL_LIBRARY=OFF \ -DLIBCXX_INSTALL_MODULES=ON \ + -DBOOTSTRAP_LIBCXX_INSTALL_MODULES=ON \ -DOPENMP_ENABLE_LIBOMP_PROFILING=OFF \ -DOPENMP_ENABLE_LIBOMPTARGET_PROFILING=OFF \ -DLIBOMP_ENABLE_RTTI=OFF \ From 989a63a68eeaf451897a35b6c9166980f70609fc Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 20 Feb 2024 22:40:44 +0100 Subject: [PATCH 6/7] fix changelog --- debian/changelog | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index e36c84d1..f780270a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,16 +1,5 @@ -llvm-toolchain-18 (1:18.1.0~rc2-5) UNRELEASED; urgency=medium +llvm-toolchain-18 (1:18.1.0~rc2-4) UNRELEASED; urgency=medium -<<<<<<< - [ John Paul Adrian Glaubitz ] - * Install *clang_rt* on sparc and sparc64 - * Run chrpath for libclang on sparc and sparc64 - - [ Sylvestre Ledru ] - * add -DLIBCXX_INSTALL_MODULES=ON - see https://discourse.llvm.org/t/libc-c-23-module-installation-support/77061/1 - Ship libc++-18-dev /usr/lib/llvm-18/lib/libc++.modules.json /usr/lib/llvm-18/include/c++/v1/std.compat.cppm - /usr/lib/llvm-18/include/c++/v1/std.cppm -======= [ John Paul Adrian Glaubitz ] * Install *clang_rt* on sparc and sparc64 * Run chrpath for libclang on sparc and sparc64 @@ -18,7 +7,6 @@ llvm-toolchain-18 (1:18.1.0~rc2-5) UNRELEASED; urgency=medium [ Sylvestre Ledru ] * add -DLIBCXX_INSTALL_MODULES=ON to install libc++ C++-20 modules see https://discourse.llvm.org/t/libc-c-23-module-installation-support/77061/1 ->>>>>>> -- Sylvestre Ledru Mon, 19 Feb 2024 16:21:34 +0100 From 8ab71b62cfbd77e0b0aa93b60d79fa04777496c8 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 20 Feb 2024 22:42:46 +0100 Subject: [PATCH 7/7] Add a new package libllvmlibc-18-dev to ship LLVM libc (experimental for now) --- debian/changelog | 1 + debian/control | 10 ++++++++++ debian/control.in | 10 ++++++++++ debian/rules | 7 +++++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f780270a..f3a10a2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ llvm-toolchain-18 (1:18.1.0~rc2-4) UNRELEASED; urgency=medium [ Sylvestre Ledru ] * add -DLIBCXX_INSTALL_MODULES=ON to install libc++ C++-20 modules see https://discourse.llvm.org/t/libc-c-23-module-installation-support/77061/1 + * Add a new package libllvmlibc-18-dev to ship LLVM libc (experimental for now) -- Sylvestre Ledru Mon, 19 Feb 2024 16:21:34 +0100 diff --git a/debian/control b/debian/control index f6cdae61..24e736c9 100644 --- a/debian/control +++ b/debian/control @@ -952,3 +952,13 @@ Description: Flang library - Development package of examples, some functionalities are still missing. . This package contains the flang libraries and headers. + +# ------------- LLVM libc ------------- + +Package: libllvmlibc-18-dev +Section: libdevel +Architecture: any +Description: LLVM C Library - dev package + Implementation of the C standard library targeting C17 and above. + . + This is an experimental project. Don't use in production. diff --git a/debian/control.in b/debian/control.in index d47e0cc4..b785ad23 100644 --- a/debian/control.in +++ b/debian/control.in @@ -952,3 +952,13 @@ Description: Flang library - Development package of examples, some functionalities are still missing. . This package contains the flang libraries and headers. + +# ------------- LLVM libc ------------- + +Package: libllvmlibc-@LLVM_VERSION@-dev +Section: libdevel +Architecture: any +Description: LLVM C Library - dev package + Implementation of the C standard library targeting C17 and above. + . + This is an experimental project. Don't use in production. diff --git a/debian/rules b/debian/rules index 6f4f3fe7..9adb73af 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,7 @@ # polly & lldb aren't enabled for every platform PROJECTS = clang;clang-tools-extra;lld;cross-project-tests;mlir # openmp & libunwind aren't enabled for every platform -RUNTIMES = compiler-rt;libcxx;libcxxabi +RUNTIMES = compiler-rt;libcxx;libcxxabi;libc TARGET_BUILD := build-llvm TARGET_BUILD_STAGE2 := $(TARGET_BUILD)/tools/clang/stage2-bins @@ -553,7 +553,7 @@ ifneq (,$(filter coverity,$(DEB_BUILD_OPTIONS))) endif # enables cmake build targets like stage2-[target_name] -ENABLED_STAGE2_CMAKE_BUILD_TARGETS = check-all;check-llvm;check-clang;check-clang-tools;check-lld;check-libcxx;check-libcxxabi;check-mlir;check-sanitizer;llvm-config;test-suite +ENABLED_STAGE2_CMAKE_BUILD_TARGETS = check-all;check-llvm;check-clang;check-clang-tools;check-lld;check-libcxx;check-libcxxabi;check-mlir;check-libc;check-sanitizer;llvm-config;test-suite %: dh $@ $(DH_OPTIONS) @@ -1473,6 +1473,9 @@ endif # Libcxx ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxx || true +# Libc + ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libc || true + # Libcxxabi ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxxabi || true