From 3ca2952755fe94070d7d4f99bd138241016a40d1 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Feb 14 2018 20:08:05 +0000 Subject: Fix build flag injection rhbz#1543787 --- diff --git a/0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch b/0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch new file mode 100644 index 0000000..e183053 --- /dev/null +++ b/0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch @@ -0,0 +1,31 @@ +From c321b9a6640b74980f03b45d9dbd8067d279d3c0 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Mon, 12 Feb 2018 07:56:20 -0800 +Subject: [PATCH] Use CFLAGS and LDFLAGS specified in environment variables + +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bc8ce50..75f5339 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -52,12 +52,12 @@ set ( BUILD_VERSION_STRING "${BUILD_VERSION_MAJOR}.${BUILD_VERSION_MINOR}.${BUIL + set ( CMAKE_VERBOSE_MAKEFILE on ) + + ## Compiler flags +-set ( CMAKE_C_FLAGS "-fPIC -W -Wall -Wextra -Werror -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -O2" ) ++set ( CMAKE_C_FLAGS "-fPIC -W -Wall -Wextra -Werror -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -O2 $ENV{CFLAGS}" ) + + set ( HSAKMT_LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/src/libhsakmt.ver" ) + + ## Linker Flags +-set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${HSAKMT_LINKER_SCRIPT} -Wl,-soname=${HSAKMT_COMPONENT}.so.$(VERSION_MAJOR) -Wl,-z,nodelete" ) ++set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${HSAKMT_LINKER_SCRIPT} -Wl,-soname=${HSAKMT_COMPONENT}.so.$(VERSION_MAJOR) -Wl,-z,nodelete $ENV{LDFLAGS}" ) + + ## Source files + set ( HSAKMT_SRC ${HSAKMT_SRC} src/debug.c ) +-- +2.13.6 + diff --git a/hsakmt.spec b/hsakmt.spec index 48afcd1..0c49f2b 100644 --- a/hsakmt.spec +++ b/hsakmt.spec @@ -3,7 +3,7 @@ Name: hsakmt Version: 1.0.6 -Release: 3.20171026git%{shortcommit}%{?dist} +Release: 4.20171026git%{shortcommit}%{?dist} Summary: AMD's HSA thunk library License: MIT @@ -12,6 +12,7 @@ Source0: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/archiv Patch0: 0001-Fix-install-targets.patch Patch1: 0001-CMakeLists-Set-the-correct-default-version.patch Patch2: 0001-Fix-build-with-gcc-8.patch +Patch3: 0001-Use-CFLAGS-and-LDFLAGS-specified-in-environment-vari.patch ExclusiveArch: x86_64 aarch64 BuildRequires: cmake @@ -59,6 +60,10 @@ cd build %{_includedir}/libhsakmt/linux/kfd_ioctl.h %changelog +* Mon Feb 12 2018 Tom Stellard - 1.0.6-4.20171026git172d101 +- Fix build flag injection +- rhbz#1543787 + * Fri Feb 09 2018 Tom Stellard - 1.0.6-3.20171026git172d101 - Build for aarch64