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 603BF158094 for ; Wed, 14 Sep 2022 14:55:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 68738E0863; Wed, 14 Sep 2022 14:55:42 +0000 (UTC) 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 pigeon.gentoo.org (Postfix) with ESMTPS id 4A80FE0863 for ; Wed, 14 Sep 2022 14:55: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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 60C3D340A6A for ; Wed, 14 Sep 2022 14:55:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D14A6599 for ; Wed, 14 Sep 2022 14:55:39 +0000 (UTC) From: "Guilherme Amadio" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Guilherme Amadio" Message-ID: <1663167292.144edbafdebe29ac1d2d3edede2385364d740ea6.amadio@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sci-physics/geant/files/, sci-physics/geant/ X-VCS-Repository: repo/gentoo X-VCS-Files: sci-physics/geant/files/geant-4.11.0.2-musl-avoid-execinfo.patch sci-physics/geant/geant-4.11.0.2-r1.ebuild X-VCS-Directories: sci-physics/geant/ sci-physics/geant/files/ X-VCS-Committer: amadio X-VCS-Committer-Name: Guilherme Amadio X-VCS-Revision: 144edbafdebe29ac1d2d3edede2385364d740ea6 X-VCS-Branch: master Date: Wed, 14 Sep 2022 14:55: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: 74634683-d933-45dc-a51a-139ef6d85694 X-Archives-Hash: 92590154212b8d287f80b36dec2c273b commit: 144edbafdebe29ac1d2d3edede2385364d740ea6 Author: listout protonmail com> AuthorDate: Tue Sep 13 10:20:17 2022 +0000 Commit: Guilherme Amadio gentoo org> CommitDate: Wed Sep 14 14:54:52 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=144edbaf sci-physics/geant: Fix building on musl, avoid execinfo.h Avoid including execinfo.h and calling backtrace function on system that don't provide the header. Closes: https://bugs.gentoo.org/829151 Closes: https://github.com/gentoo/gentoo/pull/26313 Signed-off-by: brahmajit das protonmail.com> Signed-off-by: Guilherme Amadio gentoo.org> .../files/geant-4.11.0.2-musl-avoid-execinfo.patch | 100 +++++++++++++++++++++ sci-physics/geant/geant-4.11.0.2-r1.ebuild | 4 + 2 files changed, 104 insertions(+) diff --git a/sci-physics/geant/files/geant-4.11.0.2-musl-avoid-execinfo.patch b/sci-physics/geant/files/geant-4.11.0.2-musl-avoid-execinfo.patch new file mode 100644 index 000000000000..e73a9c24c597 --- /dev/null +++ b/sci-physics/geant/files/geant-4.11.0.2-musl-avoid-execinfo.patch @@ -0,0 +1,100 @@ +# Avoid including execinfo and calling backtrace function when execinfo.h is +# not present or supplied by system's libc +# +# Closes: https://bugs.gentoo.org/829151 +--- a/source/global/management/include/G4Backtrace.hh ++++ b/source/global/management/include/G4Backtrace.hh +@@ -85,23 +85,6 @@ + # endif + #endif + +-#if defined(G4UNIX) && !defined(WIN32) +-# include +-# include +-# include +-#endif +- +-#if defined(G4LINUX) +-# include +-#endif +- +-#include +-#include +-#include +- +-template +-using G4ResultOf_t = std::invoke_result_t; +- + // compatible OS and compiler + #if defined(G4UNIX) && \ + (defined(__GNUC__) || defined(__clang__) || defined(_INTEL_COMPILER)) +@@ -109,7 +92,9 @@ using G4ResultOf_t = std::invoke_result_t; + # define G4SIGNAL_AVAILABLE + # endif + # if !defined(G4DEMANGLE_AVAILABLE) +-# define G4DEMANGLE_AVAILABLE ++# if defined(G4UNIX) && defined(HAVE_EXECINFO_H) ++# define G4DEMANGLE_AVAILABLE ++# endif + # endif + #endif + +@@ -121,6 +106,25 @@ using G4ResultOf_t = std::invoke_result_t; + # endif + #endif + ++#if defined(G4UNIX) && !defined(WIN32) ++# include ++#if defined(HAVE_EXECINFO_H) ++# include ++#endif ++# include ++#endif ++ ++#if defined(G4LINUX) ++# include ++#endif ++ ++#include ++#include ++#include ++ ++template ++using G4ResultOf_t = std::invoke_result_t; ++ + //----------------------------------------------------------------------------// + + inline G4String G4Demangle(const char* _str) +@@ -368,6 +372,7 @@ G4Backtrace::GetMangled(FuncT&& func) + std::array btrace; + btrace.fill((std::is_pointer::value) ? nullptr : type{}); + ++#if defined(G4DEMANGLE_AVAILABLE) + // plus one for this stack-frame + std::array buffer; + // size of returned buffer +@@ -387,6 +392,7 @@ G4Backtrace::GetMangled(FuncT&& func) + btrace[i] = func(bsym[i]); + free(bsym); + } ++#endif + return btrace; + } + +--- a/source/global/management/sources.cmake ++++ b/source/global/management/sources.cmake +@@ -6,6 +6,14 @@ set(G4MULTITHREADED ${GEANT4_BUILD_MULTITHREADED}) + set(G4_STORE_TRAJECTORY ${GEANT4_BUILD_STORE_TRAJECTORY}) + set(G4VERBOSE ${GEANT4_BUILD_VERBOSE_CODE}) + ++include(CheckIncludeFile) ++ ++check_include_file(execinfo.h HAVE_EXECINFO_H) ++ ++if(HAVE_SYS_TYPES_H) ++ list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_EXECINFO_H) ++endif() ++ + configure_file(${CMAKE_CURRENT_LIST_DIR}/include/G4GlobalConfig.hh.in + ${CMAKE_CURRENT_BINARY_DIR}/include/G4GlobalConfig.hh) + diff --git a/sci-physics/geant/geant-4.11.0.2-r1.ebuild b/sci-physics/geant/geant-4.11.0.2-r1.ebuild index 1eaf3d9af34b..e43a735dfdc4 100644 --- a/sci-physics/geant/geant-4.11.0.2-r1.ebuild +++ b/sci-physics/geant/geant-4.11.0.2-r1.ebuild @@ -75,6 +75,10 @@ RDEPEND=" S="${WORKDIR}/${MY_P}" +PATCHES=( + "${FILESDIR}"/${PN}-4.11.0.2-musl-avoid-execinfo.patch +) + src_configure() { local mycmakeargs=( -DCMAKE_INSTALL_DATADIR="${EPREFIX}/usr/share/geant4"