From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5F450158B20 for ; Fri, 07 Feb 2025 17:50:34 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 473F134301F for ; Fri, 07 Feb 2025 17:50:34 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 65D9E1103CB; Fri, 07 Feb 2025 17:50:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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 bobolink.gentoo.org (Postfix) with ESMTPS id 57471110471 for ; Fri, 07 Feb 2025 17:50:30 +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 06E00343019 for ; Fri, 07 Feb 2025 17:50:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 373C3268A for ; Fri, 07 Feb 2025 17:50:28 +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: <1738950560.7f9ace99e7d38f320e69320d21c4f2787333f071.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libsoundtouch/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/libsoundtouch/libsoundtouch-2.3.3.ebuild X-VCS-Directories: media-libs/libsoundtouch/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 7f9ace99e7d38f320e69320d21c4f2787333f071 X-VCS-Branch: master Date: Fri, 07 Feb 2025 17:50:28 +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: dc3ab745-897d-4751-bdae-2539eaea3d01 X-Archives-Hash: 780c7b1308a67dec915520866c10411b commit: 7f9ace99e7d38f320e69320d21c4f2787333f071 Author: Z. Liu gmail com> AuthorDate: Mon Feb 3 11:15:15 2025 +0000 Commit: Sam James gentoo org> CommitDate: Fri Feb 7 17:49:20 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f9ace99 media-libs/libsoundtouch: fix undefined symbol: __kmpc_xxx when called with "-fopenmp" and "-nostdlib", clang won't add "-lomp" automatically, while gcc always add "-lgomp". See below: For gcc, "-lgomp" is added always: # echo 'int main() { return 0; }' | gcc -fopenmp -v -x c - 2>&1 | grep -- "-lgomp" /usr/libexec/gcc/x86_64-pc-linux-gnu/14/collect2 -plugin ... -lgomp -lgcc ... # echo 'int main() { return 0; }' | gcc -fopenmp -nostdlib -v -x c - 2>&1 | grep -- "-lgomp" /usr/libexec/gcc/x86_64-pc-linux-gnu/14/collect2 -plugin ... -lgomp For clang, "-lomp" is not added when both "-fopenmp" and "-nostdlib" exist: # echo 'int main() { return 0; }' | clang -fopenmp -v -x c - 2>&1 | grep -- "-lomp" "/usr/bin/x86_64-pc-linux-gnu-ld.bfd" --hash-style=gnu ... -lomp -L/usr/lib/llvm/19/lib64 ... # echo 'int main() { return 0; }' | clang -fopenmp -nostdlib -v -x c - 2>&1 | grep -- "-lomp" In case of libsoundtouch, command to build .so is: clang++ -fPIC -DPIC -shared -nostdlib ... -Wl,-soname -Wl,libSoundTouchDll.so.1 -o .libs/libSoundTouchDll.so.1.0.0 So LDFLAGS "-lomp" is needed if compiler is clang and openmp is enabled. Otherwise, libomp.so won't be defined in Dynamic Section as show bellow: # LC_ALL=C objdump -x /usr/lib64/libSoundTouch.so ... Dynamic Section: NEEDED libomp.so ... cause package depend on libsoundtouch either failed to build or failed to start (if libsoundtouch is reemerged with openmp). Closes: https://bugs.gentoo.org/740310 Signed-off-by: Z. Liu gmail.com> Closes: https://github.com/gentoo/gentoo/pull/40424 Signed-off-by: Sam James gentoo.org> media-libs/libsoundtouch/libsoundtouch-2.3.3.ebuild | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/media-libs/libsoundtouch/libsoundtouch-2.3.3.ebuild b/media-libs/libsoundtouch/libsoundtouch-2.3.3.ebuild index 27b608d12942..fbf04002b684 100644 --- a/media-libs/libsoundtouch/libsoundtouch-2.3.3.ebuild +++ b/media-libs/libsoundtouch/libsoundtouch-2.3.3.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -inherit autotools multilib-minimal toolchain-funcs +inherit autotools flag-o-matic multilib-minimal toolchain-funcs MY_PN=${PN/lib} MY_P=${MY_PN}-${PV} @@ -31,6 +31,11 @@ pkg_setup() { src_prepare() { default sed -i "s:^\(dist_doc_DATA=\)COPYING.TXT :\1:" Makefile.am || die + + if tc-is-clang && use openmp ; then + append-libs omp + fi + eautoreconf }