From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2CAB3158099 for ; Thu, 23 Nov 2023 13:27:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 634C32BC027; Thu, 23 Nov 2023 13:27:42 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 422F62BC026 for ; Thu, 23 Nov 2023 13:27:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 47B2833BEF1 for ; Thu, 23 Nov 2023 13:27:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8953113B8 for ; Thu, 23 Nov 2023 13:27:39 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1700745987.6956bbfbf02b6c9d75143454eb93779b42a21c24.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/clang-common/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/clang-common/clang-common-17.0.4-r1.ebuild sys-devel/clang-common/clang-common-17.0.4.ebuild sys-devel/clang-common/clang-common-17.0.5-r1.ebuild sys-devel/clang-common/clang-common-17.0.5.ebuild sys-devel/clang-common/clang-common-18.0.0.9999.ebuild sys-devel/clang-common/clang-common-18.0.0_pre20231104-r1.ebuild sys-devel/clang-common/clang-common-18.0.0_pre20231104.ebuild sys-devel/clang-common/clang-common-18.0.0_pre20231111-r1.ebuild sys-devel/clang-common/clang-common-18.0.0_pre20231111.ebuild X-VCS-Directories: sys-devel/clang-common/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 6956bbfbf02b6c9d75143454eb93779b42a21c24 X-VCS-Branch: master Date: Thu, 23 Nov 2023 13:27:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 63e49f62-edef-4fd9-b120-38134a39509c X-Archives-Hash: 02195f1d7a29a89ecc5861aba5f0deb4 commit: 6956bbfbf02b6c9d75143454eb93779b42a21c24 Author: Alfred Wingate protonmail com> AuthorDate: Sat Nov 18 18:13:31 2023 +0000 Commit: Sam James gentoo org> CommitDate: Thu Nov 23 13:26:27 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6956bbfb sys-devel/clang-common: install config files for llvm internal triples * Also drop a redundant doclang_cfg invocation. * This change is to ensure that invoking clang instead of ${TARGET}-clang also uses the installed config files. Problem being that llvm sees its target triple differently from what Gentoo uses and therefore may lead to it ignoring the installed config files. For example x86 Gentoo uses i686-pc-linux-gnu as its CHOST and this leads to i686-{pc,unknown,gentoo}-linux-gnu config files to be installed, this is while llvm internally prefers to use i386-pc-linux-gnu as its target when not invoked explicitly with a target in the executable name or with --target= leading it to ingore them when invoked with just "clang". This also affects multilib so on amd64 clang -m32 exhibits the same issue. * This doesn't address irregularities with prefix installs where the os version and the lack of vendor field may lead to this same issue. Signed-off-by: Alfred Wingate protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/33893 Signed-off-by: Sam James gentoo.org> ...17.0.4.ebuild => clang-common-17.0.4-r1.ebuild} | 38 +++++++++++++++++++--- ...17.0.5.ebuild => clang-common-17.0.5-r1.ebuild} | 38 +++++++++++++++++++--- .../clang-common/clang-common-18.0.0.9999.ebuild | 38 +++++++++++++++++++--- ...d => clang-common-18.0.0_pre20231104-r1.ebuild} | 38 +++++++++++++++++++--- ...d => clang-common-18.0.0_pre20231111-r1.ebuild} | 38 +++++++++++++++++++--- 5 files changed, 165 insertions(+), 25 deletions(-) diff --git a/sys-devel/clang-common/clang-common-17.0.4.ebuild b/sys-devel/clang-common/clang-common-17.0.4-r1.ebuild similarity index 88% rename from sys-devel/clang-common/clang-common-17.0.4.ebuild rename to sys-devel/clang-common/clang-common-17.0.4-r1.ebuild index 696ae8ee4996..99047721833e 100644 --- a/sys-devel/clang-common/clang-common-17.0.4.ebuild +++ b/sys-devel/clang-common/clang-common-17.0.4-r1.ebuild @@ -63,7 +63,7 @@ pkg_pretend() { fi } -doclang_cfg() { +_doclang_cfg() { local triple="${1}" local tool @@ -93,6 +93,37 @@ doclang_cfg() { done } +doclang_cfg() { + local triple="${1}" + + _doclang_cfg ${triple} + + # LLVM may have different arch names in some cases. For example in x86 + # profiles the triple uses i686, but llvm will prefer i386 if invoked + # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will + # be used if invoked through ${CHOST}-clang{,++,-cpp} though. + # + # To make sure the correct triples are installed, + # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp + # and compare with CHOST values in profiles. + + local abi=${triple%%-*} + case ${abi} in + armv4l|armv4t|armv5tel|armv6j|armv7a) + _doclang_cfg ${triple/${abi}/arm} + ;; + i686) + _doclang_cfg ${triple/${abi}/i386} + ;; + sparc) + _doclang_cfg ${triple/${abi}/sparcel} + ;; + sparc64) + _doclang_cfg ${triple/${abi}/sparcv9} + ;; + esac +} + src_install() { newbashcomp bash-autocomplete.sh clang @@ -204,10 +235,7 @@ src_install() { # We only install config files for supported ABIs because unprefixed tools # might be used for crosscompilation where e.g. PIE may not be supported. - # See bug #912237 and bug #901247. - doclang_cfg "${CHOST}" - - # Just ${CHOST} won't do due to bug #912685. + # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685. local abi for abi in $(get_all_abis); do local abi_chost=$(get_abi_CHOST "${abi}") diff --git a/sys-devel/clang-common/clang-common-17.0.5.ebuild b/sys-devel/clang-common/clang-common-17.0.5-r1.ebuild similarity index 88% rename from sys-devel/clang-common/clang-common-17.0.5.ebuild rename to sys-devel/clang-common/clang-common-17.0.5-r1.ebuild index 696ae8ee4996..99047721833e 100644 --- a/sys-devel/clang-common/clang-common-17.0.5.ebuild +++ b/sys-devel/clang-common/clang-common-17.0.5-r1.ebuild @@ -63,7 +63,7 @@ pkg_pretend() { fi } -doclang_cfg() { +_doclang_cfg() { local triple="${1}" local tool @@ -93,6 +93,37 @@ doclang_cfg() { done } +doclang_cfg() { + local triple="${1}" + + _doclang_cfg ${triple} + + # LLVM may have different arch names in some cases. For example in x86 + # profiles the triple uses i686, but llvm will prefer i386 if invoked + # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will + # be used if invoked through ${CHOST}-clang{,++,-cpp} though. + # + # To make sure the correct triples are installed, + # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp + # and compare with CHOST values in profiles. + + local abi=${triple%%-*} + case ${abi} in + armv4l|armv4t|armv5tel|armv6j|armv7a) + _doclang_cfg ${triple/${abi}/arm} + ;; + i686) + _doclang_cfg ${triple/${abi}/i386} + ;; + sparc) + _doclang_cfg ${triple/${abi}/sparcel} + ;; + sparc64) + _doclang_cfg ${triple/${abi}/sparcv9} + ;; + esac +} + src_install() { newbashcomp bash-autocomplete.sh clang @@ -204,10 +235,7 @@ src_install() { # We only install config files for supported ABIs because unprefixed tools # might be used for crosscompilation where e.g. PIE may not be supported. - # See bug #912237 and bug #901247. - doclang_cfg "${CHOST}" - - # Just ${CHOST} won't do due to bug #912685. + # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685. local abi for abi in $(get_all_abis); do local abi_chost=$(get_abi_CHOST "${abi}") diff --git a/sys-devel/clang-common/clang-common-18.0.0.9999.ebuild b/sys-devel/clang-common/clang-common-18.0.0.9999.ebuild index b58ed6b486c2..c70a4d8bd045 100644 --- a/sys-devel/clang-common/clang-common-18.0.0.9999.ebuild +++ b/sys-devel/clang-common/clang-common-18.0.0.9999.ebuild @@ -62,7 +62,7 @@ pkg_pretend() { fi } -doclang_cfg() { +_doclang_cfg() { local triple="${1}" local tool @@ -92,6 +92,37 @@ doclang_cfg() { done } +doclang_cfg() { + local triple="${1}" + + _doclang_cfg ${triple} + + # LLVM may have different arch names in some cases. For example in x86 + # profiles the triple uses i686, but llvm will prefer i386 if invoked + # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will + # be used if invoked through ${CHOST}-clang{,++,-cpp} though. + # + # To make sure the correct triples are installed, + # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp + # and compare with CHOST values in profiles. + + local abi=${triple%%-*} + case ${abi} in + armv4l|armv4t|armv5tel|armv6j|armv7a) + _doclang_cfg ${triple/${abi}/arm} + ;; + i686) + _doclang_cfg ${triple/${abi}/i386} + ;; + sparc) + _doclang_cfg ${triple/${abi}/sparcel} + ;; + sparc64) + _doclang_cfg ${triple/${abi}/sparcv9} + ;; + esac +} + src_install() { newbashcomp bash-autocomplete.sh clang @@ -203,10 +234,7 @@ src_install() { # We only install config files for supported ABIs because unprefixed tools # might be used for crosscompilation where e.g. PIE may not be supported. - # See bug #912237 and bug #901247. - doclang_cfg "${CHOST}" - - # Just ${CHOST} won't do due to bug #912685. + # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685. local abi for abi in $(get_all_abis); do local abi_chost=$(get_abi_CHOST "${abi}") diff --git a/sys-devel/clang-common/clang-common-18.0.0_pre20231111.ebuild b/sys-devel/clang-common/clang-common-18.0.0_pre20231104-r1.ebuild similarity index 88% rename from sys-devel/clang-common/clang-common-18.0.0_pre20231111.ebuild rename to sys-devel/clang-common/clang-common-18.0.0_pre20231104-r1.ebuild index b58ed6b486c2..c70a4d8bd045 100644 --- a/sys-devel/clang-common/clang-common-18.0.0_pre20231111.ebuild +++ b/sys-devel/clang-common/clang-common-18.0.0_pre20231104-r1.ebuild @@ -62,7 +62,7 @@ pkg_pretend() { fi } -doclang_cfg() { +_doclang_cfg() { local triple="${1}" local tool @@ -92,6 +92,37 @@ doclang_cfg() { done } +doclang_cfg() { + local triple="${1}" + + _doclang_cfg ${triple} + + # LLVM may have different arch names in some cases. For example in x86 + # profiles the triple uses i686, but llvm will prefer i386 if invoked + # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will + # be used if invoked through ${CHOST}-clang{,++,-cpp} though. + # + # To make sure the correct triples are installed, + # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp + # and compare with CHOST values in profiles. + + local abi=${triple%%-*} + case ${abi} in + armv4l|armv4t|armv5tel|armv6j|armv7a) + _doclang_cfg ${triple/${abi}/arm} + ;; + i686) + _doclang_cfg ${triple/${abi}/i386} + ;; + sparc) + _doclang_cfg ${triple/${abi}/sparcel} + ;; + sparc64) + _doclang_cfg ${triple/${abi}/sparcv9} + ;; + esac +} + src_install() { newbashcomp bash-autocomplete.sh clang @@ -203,10 +234,7 @@ src_install() { # We only install config files for supported ABIs because unprefixed tools # might be used for crosscompilation where e.g. PIE may not be supported. - # See bug #912237 and bug #901247. - doclang_cfg "${CHOST}" - - # Just ${CHOST} won't do due to bug #912685. + # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685. local abi for abi in $(get_all_abis); do local abi_chost=$(get_abi_CHOST "${abi}") diff --git a/sys-devel/clang-common/clang-common-18.0.0_pre20231104.ebuild b/sys-devel/clang-common/clang-common-18.0.0_pre20231111-r1.ebuild similarity index 88% rename from sys-devel/clang-common/clang-common-18.0.0_pre20231104.ebuild rename to sys-devel/clang-common/clang-common-18.0.0_pre20231111-r1.ebuild index b58ed6b486c2..c70a4d8bd045 100644 --- a/sys-devel/clang-common/clang-common-18.0.0_pre20231104.ebuild +++ b/sys-devel/clang-common/clang-common-18.0.0_pre20231111-r1.ebuild @@ -62,7 +62,7 @@ pkg_pretend() { fi } -doclang_cfg() { +_doclang_cfg() { local triple="${1}" local tool @@ -92,6 +92,37 @@ doclang_cfg() { done } +doclang_cfg() { + local triple="${1}" + + _doclang_cfg ${triple} + + # LLVM may have different arch names in some cases. For example in x86 + # profiles the triple uses i686, but llvm will prefer i386 if invoked + # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will + # be used if invoked through ${CHOST}-clang{,++,-cpp} though. + # + # To make sure the correct triples are installed, + # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp + # and compare with CHOST values in profiles. + + local abi=${triple%%-*} + case ${abi} in + armv4l|armv4t|armv5tel|armv6j|armv7a) + _doclang_cfg ${triple/${abi}/arm} + ;; + i686) + _doclang_cfg ${triple/${abi}/i386} + ;; + sparc) + _doclang_cfg ${triple/${abi}/sparcel} + ;; + sparc64) + _doclang_cfg ${triple/${abi}/sparcv9} + ;; + esac +} + src_install() { newbashcomp bash-autocomplete.sh clang @@ -203,10 +234,7 @@ src_install() { # We only install config files for supported ABIs because unprefixed tools # might be used for crosscompilation where e.g. PIE may not be supported. - # See bug #912237 and bug #901247. - doclang_cfg "${CHOST}" - - # Just ${CHOST} won't do due to bug #912685. + # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685. local abi for abi in $(get_all_abis); do local abi_chost=$(get_abi_CHOST "${abi}")