public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/files/9999/, sys-devel/clang/
@ 2016-10-04  6:41 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2016-10-04  6:41 UTC (permalink / raw
  To: gentoo-commits

commit:     38ecce6a3e34cfcb6b056550e34974e863226dc7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  4 06:40:23 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct  4 06:41:48 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38ecce6a

sys-devel/clang: Sphinx race conditions fixed upstream

 sys-devel/clang/clang-9999.ebuild                  |  2 --
 ...rdering-dep-between-HTML-Sphinx-docs-and-.patch | 27 ----------------------
 2 files changed, 29 deletions(-)

diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild
index 59d178c..3015cf4 100644
--- a/sys-devel/clang/clang-9999.ebuild
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -115,8 +115,6 @@ src_unpack() {
 src_prepare() {
 	python_setup
 
-	# fix race condition between sphinx targets
-	eapply "${FILESDIR}"/9999/0001-cmake-Add-ordering-dep-between-HTML-Sphinx-docs-and-.patch
 	# automatically select active system GCC's libraries, bugs #406163 and #417913
 	# TODO: cross-linux tests broken by this one
 	eapply "${FILESDIR}"/9999/0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch

diff --git a/sys-devel/clang/files/9999/0001-cmake-Add-ordering-dep-between-HTML-Sphinx-docs-and-.patch b/sys-devel/clang/files/9999/0001-cmake-Add-ordering-dep-between-HTML-Sphinx-docs-and-.patch
deleted file mode 100644
index 35fc19d..00000000
--- a/sys-devel/clang/files/9999/0001-cmake-Add-ordering-dep-between-HTML-Sphinx-docs-and-.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From ec16b3f76a26a3a10b0272d012b306963fa93013 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sun, 21 Aug 2016 23:24:19 +0200
-Subject: [PATCH 1/7] cmake: Add ordering dep between HTML Sphinx docs and
- manpages
-
----
- docs/CMakeLists.txt | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
-index 13b79fdf..bd75b63 100644
---- a/docs/CMakeLists.txt
-+++ b/docs/CMakeLists.txt
-@@ -102,6 +102,9 @@ if (LLVM_ENABLE_SPHINX)
-     endif()
-     if (${SPHINX_OUTPUT_MAN})
-       add_sphinx_target(man clang)
-+      if (${SPHINX_OUTPUT_HTML})
-+        add_dependencies(docs-clang-html docs-clang-man)
-+      endif()
-     endif()
-   endif()
- endif()
--- 
-2.9.3
-


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/files/9999/, sys-devel/clang/
@ 2016-11-01  0:41 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2016-11-01  0:41 UTC (permalink / raw
  To: gentoo-commits

commit:     871a6adcce9514e05f1d5074c337c0684c932c2b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 31 23:25:55 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Oct 31 23:29:19 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=871a6adc

sys-devel/clang: Stop overriding incorrect LLVMgold.so location

Remove the patch allowing override of LLVMgold.so libdir,
and the relevant override. The patch has been rejected upstream,
and the case of running non-native driver considered not important
enough to deserve the added complexity. I will attempt to find another
(upstreamable) solution.

 sys-devel/clang/clang-9999.ebuild                  |  7 ---
 ...LANG_GOLD_LIBDIR_SUFFIX-to-specify-loc-of.patch | 64 ----------------------
 2 files changed, 71 deletions(-)

diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild
index 6a09eb1..689eaae 100644
--- a/sys-devel/clang/clang-9999.ebuild
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -117,16 +117,11 @@ src_prepare() {
 
 	# support overriding clang runtime install directory
 	eapply "${FILESDIR}"/9999/0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch
-	# support overriding LLVMgold.so plugin directory
-	eapply "${FILESDIR}"/9999/0006-cmake-Add-CLANG_GOLD_LIBDIR_SUFFIX-to-specify-loc-of.patch
 	# fix stand-alone doc build
 	eapply "${FILESDIR}"/9999/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
 
 	# User patches
 	eapply_user
-
-	# Native libdir is used to hold LLVMgold.so
-	NATIVE_LIBDIR=$(get_libdir)
 }
 
 multilib_src_configure() {
@@ -135,8 +130,6 @@ multilib_src_configure() {
 		-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
 		# install clang runtime straight into /usr/lib
 		-DCLANG_LIBDIR_SUFFIX=""
-		# specify host's binutils gold plugin path
-		-DCLANG_GOLD_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
 
 		-DBUILD_SHARED_LIBS=ON
 		-DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"

diff --git a/sys-devel/clang/files/9999/0006-cmake-Add-CLANG_GOLD_LIBDIR_SUFFIX-to-specify-loc-of.patch b/sys-devel/clang/files/9999/0006-cmake-Add-CLANG_GOLD_LIBDIR_SUFFIX-to-specify-loc-of.patch
deleted file mode 100644
index 18adcca..00000000
--- a/sys-devel/clang/files/9999/0006-cmake-Add-CLANG_GOLD_LIBDIR_SUFFIX-to-specify-loc-of.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From cf60af04f0ac2836f50d5a042acc89ef76e76a66 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sun, 21 Aug 2016 23:31:28 +0200
-Subject: [PATCH 6/7] cmake: Add CLANG_GOLD_LIBDIR_SUFFIX to specify loc of
- LLVMgold.so
-
-Add CLANG_GOLD_LIBDIR_SUFFIX that defaults to ${LLVM_LIBDIR_SUFFIX}
-and can be overriden if LLVMgold.so is installed elsewhere. The use case
-are multilib systems where binutils is 64-bit and clang is 32-bit,
-therefore the gold plugin is installed in 64-bit libdir while clang
-is not.
-
-Bug: https://llvm.org/bugs/show_bug.cgi?id=23793
-Patch: https://reviews.llvm.org/D23754
----
- CMakeLists.txt                      | 3 +++
- include/clang/Config/config.h.cmake | 3 +++
- lib/Driver/Tools.cpp                | 2 +-
- 3 files changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 67b85b5..8ed8c10 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -239,6 +239,9 @@ set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE
-   STRING "Define suffix of library directory name for clang runtime (32/64)")
- set(CLANG_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${CLANG_LIBDIR_SUFFIX})
- 
-+set(CLANG_GOLD_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE
-+  STRING "Define suffix of library directory name that contains LLVMgold.so (32/64)")
-+
- set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
- set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
- 
-diff --git a/include/clang/Config/config.h.cmake b/include/clang/Config/config.h.cmake
-index 9bf9ea5..26e0e7e 100644
---- a/include/clang/Config/config.h.cmake
-+++ b/include/clang/Config/config.h.cmake
-@@ -20,6 +20,9 @@
- /* Multilib suffix for libdir. */
- #define CLANG_LIBDIR_SUFFIX "${CLANG_LIBDIR_SUFFIX}"
- 
-+/* Multilib suffix for libdir containing LLVMgold.so. */
-+#define CLANG_GOLD_LIBDIR_SUFFIX "${CLANG_GOLD_LIBDIR_SUFFIX}"
-+
- /* Relative directory for resource files */
- #define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}"
- 
-diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
-index a814df3..333a2e9 100644
---- a/lib/Driver/Tools.cpp
-+++ b/lib/Driver/Tools.cpp
-@@ -2007,7 +2007,7 @@ static void AddGoldPlugin(const ToolChain &ToolChain, const ArgList &Args,
-   // forward.
-   CmdArgs.push_back("-plugin");
-   std::string Plugin =
--      ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold.so";
-+      ToolChain.getDriver().Dir + "/../lib" CLANG_GOLD_LIBDIR_SUFFIX "/LLVMgold.so";
-   CmdArgs.push_back(Args.MakeArgString(Plugin));
- 
-   // Try to pass driver level flags relevant to LTO code generation down to
--- 
-2.9.3
-


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/files/9999/, sys-devel/clang/
@ 2017-08-29  6:06 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2017-08-29  6:06 UTC (permalink / raw
  To: gentoo-commits

commit:     f091b5dce7c300551e1e7909a367a388f3df665d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 29 05:58:07 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug 29 06:06:24 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f091b5dc

sys-devel/clang: arch-type patch merged upstream

 sys-devel/clang/clang-9999.ebuild                  |   3 -
 ...arch-type-to-find-compiler-rt-libraries-o.patch | 140 ---------------------
 2 files changed, 143 deletions(-)

diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild
index 7b793aff3cd..e179107e2c2 100644
--- a/sys-devel/clang/clang-9999.ebuild
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -103,9 +103,6 @@ src_unpack() {
 }
 
 src_prepare() {
-	# fix finding compiler-rt libs
-	eapply "${FILESDIR}"/9999/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
-
 	# fix stand-alone doc build
 	eapply "${FILESDIR}"/9999/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
 

diff --git a/sys-devel/clang/files/9999/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch b/sys-devel/clang/files/9999/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
deleted file mode 100644
index 6a0278969c0..00000000000
--- a/sys-devel/clang/files/9999/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
+++ /dev/null
@@ -1,140 +0,0 @@
-From 3ebf8771792a40ff7701f1309914d5d3d930ea71 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Thu, 17 Nov 2016 14:19:18 +0100
-Subject: [PATCH] [Driver] Use arch type to find compiler-rt libraries (on
- Linux)
-
-Use llvm::Triple::getArchTypeName() when looking for compiler-rt
-libraries, rather than the exact arch string from the triple. This is
-more correct as it matches the values used when building compiler-rt
-(builtin-config-ix.cmake) which are the subset of the values allowed
-in triples.
-
-For example, this fixes an issue when the compiler set for
-i686-pc-linux-gnu triple would not find an i386 compiler-rt library,
-while this is the exact arch that is detected by compiler-rt. The same
-applies to any other i?86 variant allowed by LLVM.
-
-This also makes the special case for MSVC unnecessary, since now i386
-will be used reliably for all 32-bit x86 variants.
----
- lib/Driver/ToolChain.cpp                            |  5 +----
- .../usr/i686-unknown-linux/lib/.keep                |  0
- .../usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o |  0
- test/Driver/linux-ld.c                              | 21 +++++++++++++++++++++
- test/Driver/nostdlib.c                              |  2 +-
- test/Driver/print-libgcc-file-name-clangrt.c        | 10 ++++++++--
- test/Driver/windows-cross.c                         |  2 +-
- 7 files changed, 32 insertions(+), 8 deletions(-)
- create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep
- create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
-
-diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
-index 0476d156f5..2660c5a2c0 100644
---- a/lib/Driver/ToolChain.cpp
-+++ b/lib/Driver/ToolChain.cpp
-@@ -297,15 +297,12 @@ static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,
-   const llvm::Triple &Triple = TC.getTriple();
-   bool IsWindows = Triple.isOSWindows();
- 
--  if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86)
--    return "i386";
--
-   if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)
-     return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows)
-                ? "armhf"
-                : "arm";
- 
--  return TC.getArchName();
-+  return llvm::Triple::getArchTypeName(TC.getArch());
- }
- 
- std::string ToolChain::getCompilerRTPath() const {
-diff --git a/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep b/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep
-new file mode 100644
-index 0000000000..e69de29bb2
-diff --git a/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o b/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
-new file mode 100644
-index 0000000000..e69de29bb2
-diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c
-index 1c5f1a4556..a47afe3924 100644
---- a/test/Driver/linux-ld.c
-+++ b/test/Driver/linux-ld.c
-@@ -71,6 +71,27 @@
- // CHECK-LD-RT: libclang_rt.builtins-x86_64.a"
- //
- // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
-+// RUN:     --target=i686-unknown-linux \
-+// RUN:     --gcc-toolchain="" \
-+// RUN:     --sysroot=%S/Inputs/basic_linux_tree \
-+// RUN:     --rtlib=compiler-rt \
-+// RUN:   | FileCheck --check-prefix=CHECK-LD-RT-I686 %s
-+// CHECK-LD-RT-I686-NOT: warning:
-+// CHECK-LD-RT-I686: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
-+// CHECK-LD-RT-I686: "--eh-frame-hdr"
-+// CHECK-LD-RT-I686: "-m" "elf_i386"
-+// CHECK-LD-RT-I686: "-dynamic-linker"
-+// CHECK-LD-RT-I686: "{{.*}}/usr/lib/gcc/i686-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0"
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../../../i686-unknown-linux/lib"
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../.."
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/lib"
-+// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib"
-+// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
-+// CHECK-LD-RT-I686: "-lc"
-+// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
-+//
-+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
- // RUN:     --target=arm-linux-androideabi \
- // RUN:     --gcc-toolchain="" \
- // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
-diff --git a/test/Driver/nostdlib.c b/test/Driver/nostdlib.c
-index a9ef665c57..c9793d968c 100644
---- a/test/Driver/nostdlib.c
-+++ b/test/Driver/nostdlib.c
-@@ -27,5 +27,5 @@
- //
- // CHECK-LINUX-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
- // CHECK-LINUX-NOSTDLIB: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
--// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i686.a"
-+// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i386.a"
- // CHECK-MSVC-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
-diff --git a/test/Driver/print-libgcc-file-name-clangrt.c b/test/Driver/print-libgcc-file-name-clangrt.c
-index fb4545af30..ce941dc4a1 100644
---- a/test/Driver/print-libgcc-file-name-clangrt.c
-+++ b/test/Driver/print-libgcc-file-name-clangrt.c
-@@ -5,10 +5,16 @@
- // RUN:   | FileCheck --check-prefix=CHECK-CLANGRT-X8664 %s
- // CHECK-CLANGRT-X8664: libclang_rt.builtins-x86_64.a
- 
-+// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
-+// RUN:     --target=i386-pc-linux \
-+// RUN:   | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
-+// CHECK-CLANGRT-I386: libclang_rt.builtins-i386.a
-+
-+// Check whether alternate arch values map to the correct library.
-+//
- // RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
- // RUN:     --target=i686-pc-linux \
--// RUN:   | FileCheck --check-prefix=CHECK-CLANGRT-I686 %s
--// CHECK-CLANGRT-I686: libclang_rt.builtins-i686.a
-+// RUN:   | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
- 
- // RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
- // RUN:     --target=arm-linux-gnueabi \
-diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c
-index 0e688f0a26..072d37cd51 100644
---- a/test/Driver/windows-cross.c
-+++ b/test/Driver/windows-cross.c
-@@ -64,7 +64,7 @@
- // RUN:    | FileCheck %s --check-prefix CHECK-SANITIZE-ADDRESS-EXE-X86
- 
- // CHECK-SANITIZE-ADDRESS-EXE-X86: "-fsanitize=address"
--// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i686.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i686.lib" "--undefined" "___asan_seh_interceptor"
-+// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i386.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib" "--undefined" "___asan_seh_interceptor"
- 
- // RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -fuse-ld=lld-link2 -shared -o shared.dll -fsanitize=tsan -x c++ %s 2>&1 \
- // RUN:    | FileCheck %s --check-prefix CHECK-SANITIZE-TSAN
--- 
-2.14.1
-


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/files/9999/, sys-devel/clang/
@ 2020-12-27  9:50 Fabian Groffen
  0 siblings, 0 replies; 4+ messages in thread
From: Fabian Groffen @ 2020-12-27  9:50 UTC (permalink / raw
  To: gentoo-commits

commit:     1b2b62e093d789f6b1a4609c866581991e287b88
Author:     Jacob Floyd <cognifloyd <AT> gmail <DOT> com>
AuthorDate: Sat Dec 19 00:53:24 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Dec 27 09:49:32 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b2b62e0

sys-devel/clang: fix bootstrap on darwin prefix

Adjust the clang internal header/framework search paths when building on
darwin prefix. We symlink the selected MacOSX.sdk to EPREFIX/MacOSX.sdk
during bootstrap, so that is the correct place to get system headers,
such as those for libc, or for system framework headers, that we do not
replace in prefix.

Bug: https://bugs.gentoo.org/758167
Signed-off-by: Jacob Floyd <cognifloyd <AT> gmail.com>
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 sys-devel/clang/clang-11.0.0.ebuild          | 13 ++++-
 sys-devel/clang/clang-11.0.1.9999.ebuild     | 11 +++-
 sys-devel/clang/clang-11.0.1_rc1.ebuild      | 11 +++-
 sys-devel/clang/clang-11.0.1_rc2.ebuild      | 11 +++-
 sys-devel/clang/clang-12.0.0.9999.ebuild     | 11 +++-
 sys-devel/clang/files/9999/prefix-dirs.patch | 75 ++++++++++++++++++++++++++++
 6 files changed, 126 insertions(+), 6 deletions(-)

diff --git a/sys-devel/clang/clang-11.0.0.ebuild b/sys-devel/clang/clang-11.0.0.ebuild
index cf0dde1f160..1d4f4bad16c 100644
--- a/sys-devel/clang/clang-11.0.0.ebuild
+++ b/sys-devel/clang/clang-11.0.0.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6..9} )
 inherit cmake llvm llvm.org multilib-minimal pax-utils \
-	python-single-r1 toolchain-funcs
+	prefix python-single-r1 toolchain-funcs
 
 DESCRIPTION="C language family frontend for LLVM"
 HOMEPAGE="https://llvm.org/"
@@ -30,7 +30,7 @@ ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
 SLOT="$(ver_cut 1)"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux"
+KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux ~x64-macos"
 IUSE="debug default-compiler-rt default-libcxx default-lld
 	doc +static-analyzer test xml kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
 REQUIRED_USE="${PYTHON_REQUIRED_USE}
@@ -75,6 +75,10 @@ PDEPEND="
 # Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
 # multilib clang* libraries (not runtime, not wrappers).
 
+PATCHES=(
+	"${FILESDIR}"/9999/prefix-dirs.patch
+)
+
 pkg_setup() {
 	LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
 	python-single-r1_pkg_setup
@@ -88,6 +92,11 @@ src_prepare() {
 	llvm.org_src_prepare
 
 	mv ../clang-tools-extra tools/extra || die
+
+	# add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+	eprefixify \
+		lib/Frontend/InitHeaderSearch.cpp \
+		lib/Driver/ToolChains/Darwin.cpp || die
 }
 
 check_distribution_components() {

diff --git a/sys-devel/clang/clang-11.0.1.9999.ebuild b/sys-devel/clang/clang-11.0.1.9999.ebuild
index 4a3a05b4df8..c5362450b51 100644
--- a/sys-devel/clang/clang-11.0.1.9999.ebuild
+++ b/sys-devel/clang/clang-11.0.1.9999.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6..9} )
 inherit cmake llvm llvm.org multilib-minimal pax-utils \
-	python-single-r1 toolchain-funcs
+	prefix python-single-r1 toolchain-funcs
 
 DESCRIPTION="C language family frontend for LLVM"
 HOMEPAGE="https://llvm.org/"
@@ -77,6 +77,10 @@ llvm.org_set_globals
 # Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
 # multilib clang* libraries (not runtime, not wrappers).
 
+PATCHES=(
+	"${FILESDIR}"/9999/prefix-dirs.patch
+)
+
 pkg_setup() {
 	LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
 	python-single-r1_pkg_setup
@@ -90,6 +94,11 @@ src_prepare() {
 	llvm.org_src_prepare
 
 	mv ../clang-tools-extra tools/extra || die
+
+	# add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+	eprefixify \
+		lib/Frontend/InitHeaderSearch.cpp \
+		lib/Driver/ToolChains/Darwin.cpp || die
 }
 
 check_distribution_components() {

diff --git a/sys-devel/clang/clang-11.0.1_rc1.ebuild b/sys-devel/clang/clang-11.0.1_rc1.ebuild
index 4a3a05b4df8..c5362450b51 100644
--- a/sys-devel/clang/clang-11.0.1_rc1.ebuild
+++ b/sys-devel/clang/clang-11.0.1_rc1.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6..9} )
 inherit cmake llvm llvm.org multilib-minimal pax-utils \
-	python-single-r1 toolchain-funcs
+	prefix python-single-r1 toolchain-funcs
 
 DESCRIPTION="C language family frontend for LLVM"
 HOMEPAGE="https://llvm.org/"
@@ -77,6 +77,10 @@ llvm.org_set_globals
 # Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
 # multilib clang* libraries (not runtime, not wrappers).
 
+PATCHES=(
+	"${FILESDIR}"/9999/prefix-dirs.patch
+)
+
 pkg_setup() {
 	LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
 	python-single-r1_pkg_setup
@@ -90,6 +94,11 @@ src_prepare() {
 	llvm.org_src_prepare
 
 	mv ../clang-tools-extra tools/extra || die
+
+	# add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+	eprefixify \
+		lib/Frontend/InitHeaderSearch.cpp \
+		lib/Driver/ToolChains/Darwin.cpp || die
 }
 
 check_distribution_components() {

diff --git a/sys-devel/clang/clang-11.0.1_rc2.ebuild b/sys-devel/clang/clang-11.0.1_rc2.ebuild
index 4a3a05b4df8..c5362450b51 100644
--- a/sys-devel/clang/clang-11.0.1_rc2.ebuild
+++ b/sys-devel/clang/clang-11.0.1_rc2.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6..9} )
 inherit cmake llvm llvm.org multilib-minimal pax-utils \
-	python-single-r1 toolchain-funcs
+	prefix python-single-r1 toolchain-funcs
 
 DESCRIPTION="C language family frontend for LLVM"
 HOMEPAGE="https://llvm.org/"
@@ -77,6 +77,10 @@ llvm.org_set_globals
 # Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
 # multilib clang* libraries (not runtime, not wrappers).
 
+PATCHES=(
+	"${FILESDIR}"/9999/prefix-dirs.patch
+)
+
 pkg_setup() {
 	LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
 	python-single-r1_pkg_setup
@@ -90,6 +94,11 @@ src_prepare() {
 	llvm.org_src_prepare
 
 	mv ../clang-tools-extra tools/extra || die
+
+	# add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+	eprefixify \
+		lib/Frontend/InitHeaderSearch.cpp \
+		lib/Driver/ToolChains/Darwin.cpp || die
 }
 
 check_distribution_components() {

diff --git a/sys-devel/clang/clang-12.0.0.9999.ebuild b/sys-devel/clang/clang-12.0.0.9999.ebuild
index e5da1c5cedb..8ebb9ceea5e 100644
--- a/sys-devel/clang/clang-12.0.0.9999.ebuild
+++ b/sys-devel/clang/clang-12.0.0.9999.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6..9} )
 inherit cmake llvm llvm.org multilib-minimal pax-utils \
-	python-single-r1 toolchain-funcs
+	prefix python-single-r1 toolchain-funcs
 
 DESCRIPTION="C language family frontend for LLVM"
 HOMEPAGE="https://llvm.org/"
@@ -77,6 +77,10 @@ llvm.org_set_globals
 # Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
 # multilib clang* libraries (not runtime, not wrappers).
 
+PATCHES=(
+	"${FILESDIR}"/9999/prefix-dirs.patch
+)
+
 pkg_setup() {
 	LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
 	python-single-r1_pkg_setup
@@ -88,6 +92,11 @@ src_prepare() {
 	BUILD_DIR=${WORKDIR}/x/y/clang
 
 	llvm.org_src_prepare
+
+	# add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+	eprefixify \
+		lib/Frontend/InitHeaderSearch.cpp \
+		lib/Driver/ToolChains/Darwin.cpp || die
 }
 
 check_distribution_components() {

diff --git a/sys-devel/clang/files/9999/prefix-dirs.patch b/sys-devel/clang/files/9999/prefix-dirs.patch
new file mode 100644
index 00000000000..0f7b5ca31eb
--- /dev/null
+++ b/sys-devel/clang/files/9999/prefix-dirs.patch
@@ -0,0 +1,75 @@
+This mirrors cmake-*-prefix-dirs.patch
+
+It add EPREFIX to search paths for c/cxx headers.
+It also adds EPREFIX/MacOSX.sdk to search paths for c and Frameworks.
+Assumes that c++ lib and headers will be installed in the prefix.
+
+Also, a couple of args are populated by inspecting the SDK,
+so, default to EPREFIX/MacOSX.sdk when the sysroot is not specified.
+(This does NOT set sysroot).
+
+The ebuild adds an extra / at the end of EPREFIX so that it is never
+an empty string. 
+
+--- a/clang/lib/Frontend/InitHeaderSearch.cpp	2020-11-30 12:53:42.000000000 -0600
++++ b/clang/lib/Frontend/InitHeaderSearch.cpp	2020-11-30 13:57:52.000000000 -0600
+@@ -445,6 +445,9 @@
+   // All header search logic is handled in the Driver for Darwin.
+   if (triple.isOSDarwin()) {
+     if (HSOpts.UseStandardSystemIncludes) {
++      // Add Gentoo Prefix framework dirs first
++      AddPath("@GENTOO_PORTAGE_EPREFIX@MacOSX.sdk/System/Library/Frameworks", System, true);
++      AddPath("@GENTOO_PORTAGE_EPREFIX@MacOSX.sdk/Library/Frameworks", System, true);
+       // Add the default framework include paths on Darwin.
+       AddPath("/System/Library/Frameworks", System, true);
+       AddPath("/Library/Frameworks", System, true);
+--- a/clang/lib/Driver/ToolChains/Darwin.cpp	2020-10-07 05:10:48.000000000 -0500
++++ b/clang/lib/Driver/ToolChains/Darwin.cpp	2020-11-30 12:57:15.000000000 -0600
+@@ -1737,9 +1737,9 @@
+                                          const ArgList &Args,
+                                          const Driver &TheDriver) {
+   const Arg *A = Args.getLastArg(options::OPT_isysroot);
+-  if (!A)
+-    return None;
+-  StringRef isysroot = A->getValue();
++  //if (!A)
++  //  return None;
++  StringRef isysroot = A ? A->getValue() : "@GENTOO_PORTAGE_EPREFIX@MacOSX.sdk";
+   auto SDKInfoOrErr = driver::parseDarwinSDKInfo(VFS, isysroot);
+   if (!SDKInfoOrErr) {
+     llvm::consumeError(SDKInfoOrErr.takeError());
+@@ -1921,13 +1921,14 @@
+     return DriverArgs.getLastArgValue(options::OPT_isysroot);
+   if (!getDriver().SysRoot.empty())
+     return getDriver().SysRoot;
+-  return "/";
++  return "@GENTOO_PORTAGE_EPREFIX@";
+ }
+ 
+ void DarwinClang::AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
+                                             llvm::opt::ArgStringList &CC1Args) const {
+   const Driver &D = getDriver();
+ 
++  // Sysroot is effectively Gentoo EPREFIX when -isysroot/-sysroot is not defined
+   llvm::StringRef Sysroot = GetHeaderSysroot(DriverArgs);
+ 
+   bool NoStdInc = DriverArgs.hasArg(options::OPT_nostdinc);
+@@ -1969,6 +1970,10 @@
+     SmallString<128> P(Sysroot);
+     llvm::sys::path::append(P, "usr", "include");
+     addExternCSystemInclude(DriverArgs, CC1Args, P.str());
++    // And add <sysroot>/MacOSX.sdk/usr/include.
++    SmallString<128> Psdk(Sysroot);
++    llvm::sys::path::append(Psdk, "MacOSX.sdk", "usr", "include");
++    addExternCSystemInclude(DriverArgs, CC1Args, Psdk.str());
+   }
+ }
+ 
+@@ -2017,6 +2022,7 @@
+       DriverArgs.hasArg(options::OPT_nostdincxx))
+     return;
+ 
++  // Sysroot is effectively Gentoo EPREFIX when -isysroot/-sysroot is not defined
+   llvm::StringRef Sysroot = GetHeaderSysroot(DriverArgs);
+ 
+   switch (GetCXXStdlibType(DriverArgs)) {


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-27  9:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-27  9:50 [gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/files/9999/, sys-devel/clang/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2017-08-29  6:06 Michał Górny
2016-11-01  0:41 Michał Górny
2016-10-04  6:41 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox