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 DA371158041 for ; Tue, 12 Mar 2024 07:17:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2AA94E2A04; Tue, 12 Mar 2024 07:17:14 +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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 13FA1E2A04 for ; Tue, 12 Mar 2024 07:17:14 +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 4821734068A for ; Tue, 12 Mar 2024 07:17:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7C75214E8 for ; Tue, 12 Mar 2024 07:17:11 +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: <1710227808.1e0b8f0d7458644b7e5ef8f697de9c52ec36e4ea.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libcaca/files/, media-libs/libcaca/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/libcaca/files/configure-lto.patch media-libs/libcaca/libcaca-0.99_beta19-r11.ebuild X-VCS-Directories: media-libs/libcaca/files/ media-libs/libcaca/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 1e0b8f0d7458644b7e5ef8f697de9c52ec36e4ea X-VCS-Branch: master Date: Tue, 12 Mar 2024 07:17:11 +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: 75f86364-4a60-4935-89df-f42a51199e1c X-Archives-Hash: 21c35e8bc27a3e612e1397396fc53d8d commit: 1e0b8f0d7458644b7e5ef8f697de9c52ec36e4ea Author: Sam James gentoo org> AuthorDate: Tue Mar 12 07:16:16 2024 +0000 Commit: Sam James gentoo org> CommitDate: Tue Mar 12 07:16:48 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e0b8f0d media-libs/libcaca: fix build w/ LTO on some arches Avoid configure test getting optimised out. Signed-off-by: Sam James gentoo.org> media-libs/libcaca/files/configure-lto.patch | 44 +++++++++++++++++++++++ media-libs/libcaca/libcaca-0.99_beta19-r11.ebuild | 1 + 2 files changed, 45 insertions(+) diff --git a/media-libs/libcaca/files/configure-lto.patch b/media-libs/libcaca/files/configure-lto.patch new file mode 100644 index 000000000000..c60989b3c8f4 --- /dev/null +++ b/media-libs/libcaca/files/configure-lto.patch @@ -0,0 +1,44 @@ +https://github.com/cacalabs/libcaca/pull/76 + +[Modified to just save/restore flags.] + +From 07cb730bf3dc49170f0c387d9edcf5537a4e26b6 Mon Sep 17 00:00:00 2001 +From: kxxt +Date: Wed, 21 Jun 2023 00:06:04 +0800 +Subject: [PATCH] Disable LTO when checking for fsin/fcos/fldln2/... + +LTO might interfere with the instruction detection and produce false positives. +(The conftest.c compiles with `-flto=auto` but fails without it) + +The build for riscv64 arch linux fails because of this: +https://archriscv.felixc.at/.status/log.htm?url=logs/libcaca/libcaca-0.99.beta20-2.log + +This PR fixes it. +--- + configure.ac | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 27b8d5b4..ee38ead3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -145,6 +145,9 @@ AC_COMPILE_IFELSE( + AC_DEFINE(HAVE_SLEEP, 1, [Define to 1 if you have the ‘Sleep’ function.])], + [AC_MSG_RESULT(no)]) + ++OLD_CFLAGS="${CFLAGS}" # Disable LTO when checking for the instructions ++CFLAGS="${CFLAGS} -fno-lto" ++ + AC_MSG_CHECKING(for fsin/fcos) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( +@@ -163,6 +166,8 @@ AC_COMPILE_IFELSE( + AC_DEFINE(HAVE_FLDLN2, 1, [Define to 1 if you have the ‘fldln2’ and other floating point instructions.])], + [AC_MSG_RESULT(no)]) + ++CFLAGS="${OLD_CFLAGS}" ++ + AC_CHECK_HEADERS(zlib.h) + AC_CHECK_LIB(z, gzopen, [ZLIB_LIBS="${ZLIB_LIBS} -lz"]) + + diff --git a/media-libs/libcaca/libcaca-0.99_beta19-r11.ebuild b/media-libs/libcaca/libcaca-0.99_beta19-r11.ebuild index 32b14aa901c4..917b1e972fc7 100644 --- a/media-libs/libcaca/libcaca-0.99_beta19-r11.ebuild +++ b/media-libs/libcaca/libcaca-0.99_beta19-r11.ebuild @@ -61,6 +61,7 @@ PATCHES=( "${FILESDIR}/100_doxygen.diff" # Fix doxygen docs install, bug 543870 "${FILESDIR}/fix-css-path.patch" + "${FILESDIR}/configure-lto.patch" ) src_prepare() {