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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E4C4D1382C5 for ; Mon, 11 Jan 2021 18:55:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F26ADE09E1; Mon, 11 Jan 2021 18:55:47 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C8010E09E1 for ; Mon, 11 Jan 2021 18:55:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 84E61340F28 for ; Mon, 11 Jan 2021 18:55:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0B18D46B for ; Mon, 11 Jan 2021 18:55:45 +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: <1610391342.185d05c99b7f70791c23e5b93586a3cbc3a95a6f.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/gmmlib/, media-libs/gmmlib/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/gmmlib/files/gmmlib-20.4.1_custom_cflags.patch media-libs/gmmlib/gmmlib-20.4.1.ebuild media-libs/gmmlib/gmmlib-9999.ebuild media-libs/gmmlib/metadata.xml X-VCS-Directories: media-libs/gmmlib/ media-libs/gmmlib/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 185d05c99b7f70791c23e5b93586a3cbc3a95a6f X-VCS-Branch: master Date: Mon, 11 Jan 2021 18:55:45 +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: 3f32ca47-074f-48ea-bfd2-cf3ba14c28ee X-Archives-Hash: 1b32f47fb51d2a1f58b95df657b190fd commit: 185d05c99b7f70791c23e5b93586a3cbc3a95a6f Author: Karlson2k (Evgeny Grin) narod ru> AuthorDate: Fri Jan 8 15:50:47 2021 +0000 Commit: Sam James gentoo org> CommitDate: Mon Jan 11 18:55:42 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=185d05c9 media-libs/gmmlib: added USE flag for user CFLAGS Added patch and USE flag to disable override of user CFLAGS in cmake configuration. Now CFLAGS like -march=native are honoured. Signed-off-by: Karlson2k (Evgeny Grin) narod.ru> Closes: https://github.com/gentoo/gentoo/pull/18952 Signed-off-by: Sam James gentoo.org> .../gmmlib/files/gmmlib-20.4.1_custom_cflags.patch | 92 ++++++++++++++++++++++ media-libs/gmmlib/gmmlib-20.4.1.ebuild | 4 +- media-libs/gmmlib/gmmlib-9999.ebuild | 4 +- media-libs/gmmlib/metadata.xml | 3 + 4 files changed, 101 insertions(+), 2 deletions(-) diff --git a/media-libs/gmmlib/files/gmmlib-20.4.1_custom_cflags.patch b/media-libs/gmmlib/files/gmmlib-20.4.1_custom_cflags.patch new file mode 100644 index 00000000000..47e5288e62e --- /dev/null +++ b/media-libs/gmmlib/files/gmmlib-20.4.1_custom_cflags.patch @@ -0,0 +1,92 @@ +diff --git a/Source/GmmLib/CMakeLists.txt b/Source/GmmLib/CMakeLists.txt +--- a/Source/GmmLib/CMakeLists.txt ++++ b/Source/GmmLib/CMakeLists.txt +@@ -54,6 +54,10 @@ if(NOT DEFINED BS_USE_OSDM_BUILD_SYSTEM) + endif() + endif() + ++if(NOT DEFINED OVERRIDE_COMPILER_FLAGS) ++ option(OVERRIDE_COMPILER_FLAGS "Override user compiler FLAGS and use lib defaults" ON) ++endif() ++ + # begin -- label bldsys file prologue + # WARNING: The "project" statement triggers reading of CMAKE_TOOLCHAIN_FILE + # and so must precede the inclusion below of bs_init.cmake . +diff --git a/Source/GmmLib/Linux.cmake b/Source/GmmLib/Linux.cmake +--- a/Source/GmmLib/Linux.cmake ++++ b/Source/GmmLib/Linux.cmake +@@ -38,7 +38,10 @@ SET (GMMLIB_COMPILER_FLAGS_COMMON + -Werror=format-security + -Werror=non-virtual-dtor + -Werror=return-type ++ ) + ++if (OVERRIDE_COMPILER_FLAGS) ++ list (APPEND GMMLIB_COMPILER_FLAGS_COMMON + # General optimization options + -march=${GMMLIB_MARCH} + -mpopcnt +@@ -50,16 +53,28 @@ SET (GMMLIB_COMPILER_FLAGS_COMMON + -msse4.1 + -msse4.2 + -mfpmath=sse ++ ) ++endif() ++ ++list (APPEND GMMLIB_COMPILER_FLAGS_COMMON + -finline-functions + -fno-short-enums + -Wa,--noexecstack + -fno-strict-aliasing ++ ) ++ ++if (OVERRIDE_COMPILER_FLAGS) ++ list (APPEND GMMLIB_COMPILER_FLAGS_COMMON + # Common defines + -DUSE_MMX + -DUSE_SSE + -DUSE_SSE2 + -DUSE_SSE3 + -DUSE_SSSE3 ++ ) ++endif() ++ ++list (APPEND GMMLIB_COMPILER_FLAGS_COMMON + # Other common flags + -fstack-protector + -fdata-sections +@@ -67,10 +82,15 @@ SET (GMMLIB_COMPILER_FLAGS_COMMON + -fmessage-length=0 + -fvisibility=hidden + -fPIC ++ ) ++ ++if (OVERRIDE_COMPILER_FLAGS) ++ list (APPEND GMMLIB_COMPILER_FLAGS_COMMON + -g + # -m32 or -m64 + -m${GMMLIB_ARCH} + ) ++endif() + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + #Gcc only flags +@@ -128,13 +148,17 @@ SET( GMMLIB_COMPILER_FLAGS_RELEASEINTERNAL ${GMMLIB_COMPILER_FLAGS_RELEASE}) + + #set predefined compiler flags set + add_compile_options("${GMMLIB_COMPILER_FLAGS_COMMON}") ++if (OVERRIDE_COMPILER_FLAGS) + add_compile_options("$<$:${GMMLIB_COMPILER_FLAGS_DEBUG}>") + add_compile_options("$<$:${GMMLIB_COMPILER_FLAGS_RELEASE}>") + add_compile_options("$<$:${GMMLIB_COMPILER_FLAGS_RELEASEINTERNAL}>") + #cmake 3.3+, add_compile_options("$<$:${GMMLIB_COMPILER_CXX_FLAGS_COMMON}>") ++endif() + foreach (flag ${GMMLIB_COMPILER_CXX_FLAGS_COMMON}) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") + endforeach() + ++if (OVERRIDE_COMPILER_FLAGS) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m${GMMLIB_ARCH}") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m${GMMLIB_ARCH}") ++endif() + diff --git a/media-libs/gmmlib/gmmlib-20.4.1.ebuild b/media-libs/gmmlib/gmmlib-20.4.1.ebuild index a09ec1ab123..09b5bcec53f 100644 --- a/media-libs/gmmlib/gmmlib-20.4.1.ebuild +++ b/media-libs/gmmlib/gmmlib-20.4.1.ebuild @@ -28,7 +28,7 @@ fi LICENSE="MIT" SLOT="0" -IUSE="test" +IUSE="test +custom-cflags" RESTRICT="!test? ( test )" @@ -36,12 +36,14 @@ RDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}"/${PN}-20.2.2_conditional_testing.patch + "${FILESDIR}"/${PN}-20.4.1_custom_cflags.patch ) multilib_src_configure() { local mycmakeargs=( -DBUILD_TYPE=Release -DBUILD_TESTING=$(usex test) + -DOVERRIDE_COMPILER_FLAGS=$(usex !custom-cflags) ) cmake_src_configure } diff --git a/media-libs/gmmlib/gmmlib-9999.ebuild b/media-libs/gmmlib/gmmlib-9999.ebuild index a09ec1ab123..09b5bcec53f 100644 --- a/media-libs/gmmlib/gmmlib-9999.ebuild +++ b/media-libs/gmmlib/gmmlib-9999.ebuild @@ -28,7 +28,7 @@ fi LICENSE="MIT" SLOT="0" -IUSE="test" +IUSE="test +custom-cflags" RESTRICT="!test? ( test )" @@ -36,12 +36,14 @@ RDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}"/${PN}-20.2.2_conditional_testing.patch + "${FILESDIR}"/${PN}-20.4.1_custom_cflags.patch ) multilib_src_configure() { local mycmakeargs=( -DBUILD_TYPE=Release -DBUILD_TESTING=$(usex test) + -DOVERRIDE_COMPILER_FLAGS=$(usex !custom-cflags) ) cmake_src_configure } diff --git a/media-libs/gmmlib/metadata.xml b/media-libs/gmmlib/metadata.xml index 648c3cc2422..61c45b70c77 100644 --- a/media-libs/gmmlib/metadata.xml +++ b/media-libs/gmmlib/metadata.xml @@ -8,4 +8,7 @@ k2k@narod.ru Evgeny Grin + + Do not override user CFLAGS like -march, -msse and similar with lib defaults. Not tested by upstream. +