commit:     b69c9598000651b6a87b8e15e5765725f4001a2f
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Fri Sep  3 23:04:38 2021 +0000
Commit:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
CommitDate: Fri Sep  3 23:05:07 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b69c9598

sys-apps/intel-cmt-cat: respect flags, don't strip

Closes: https://bugs.gentoo.org/810736
Closes: https://bugs.gentoo.org/810733
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 .../files/intel-cmt-cat-do-not-strip.patch         |  32 ++++
 .../files/intel-cmt-cat-respect-flags.patch        | 212 +++++++++++++++++++++
 ...2.0-r1.ebuild => intel-cmt-cat-4.2.0-r2.ebuild} |   6 +-
 3 files changed, 249 insertions(+), 1 deletion(-)

diff --git a/sys-apps/intel-cmt-cat/files/intel-cmt-cat-do-not-strip.patch 
b/sys-apps/intel-cmt-cat/files/intel-cmt-cat-do-not-strip.patch
new file mode 100644
index 000000000..44ea45617
--- /dev/null
+++ b/sys-apps/intel-cmt-cat/files/intel-cmt-cat-do-not-strip.patch
@@ -0,0 +1,32 @@
+--- a/pqos/Makefile
++++ b/pqos/Makefile
+@@ -108,12 +108,12 @@
+ ifeq ($(shell uname), FreeBSD)
+       install -d $(BIN_DIR)
+       install -d $(MAN_DIR)
+-      install -s $(APP) $(BIN_DIR)
++      install $(APP) $(BIN_DIR)
+       install $(APP)-msr $(BIN_DIR)
+       install -m 0444 $(MAN) $(MAN_DIR)
+       ln -f -s $(MAN) $(MAN_DIR)/$(APP)-msr.8
+ else
+-      install -D -s $(APP) $(BIN_DIR)/$(APP)
++      install -D $(APP) $(BIN_DIR)/$(APP)
+       install -D $(APP)-msr $(BIN_DIR)/$(APP)-msr
+       install -D $(APP)-os $(BIN_DIR)/$(APP)-os
+       install -m 0444 $(MAN) -D $(MAN_DIR)/$(MAN)
+--- a/rdtset/Makefile
++++ b/rdtset/Makefile
+@@ -115,10 +115,10 @@
+ ifeq ($(shell uname), FreeBSD)
+       install -d $(BIN_DIR)
+       install -d $(MAN_DIR)
+-      install -s $(APP) $(BIN_DIR)
++      install $(APP) $(BIN_DIR)
+       install -m 0444 $(MAN) $(MAN_DIR)
+ else
+-      install -D -s $(APP) $(BIN_DIR)/$(APP)
++      install -D $(APP) $(BIN_DIR)/$(APP)
+       install -m 0444 $(MAN) -D $(MAN_DIR)/$(MAN)
+ endif
+ 

diff --git a/sys-apps/intel-cmt-cat/files/intel-cmt-cat-respect-flags.patch 
b/sys-apps/intel-cmt-cat/files/intel-cmt-cat-respect-flags.patch
new file mode 100644
index 000000000..81b591060
--- /dev/null
+++ b/sys-apps/intel-cmt-cat/files/intel-cmt-cat-respect-flags.patch
@@ -0,0 +1,212 @@
+--- a/examples/c/CAT_MBA/Makefile
++++ b/examples/c/CAT_MBA/Makefile
+@@ -35,17 +35,17 @@
+ 
###############################################################################
+ 
+ LIBDIR ?= ../../../lib
+-CFLAGS =-I$(LIBDIR) \
++CFLAGS += -I$(LIBDIR) \
+       -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
+       -Wmissing-declarations -Wold-style-definition -Wpointer-arith \
+       -Wcast-qual -Wundef -Wwrite-strings  \
+-      -Wformat -Wformat-security -fstack-protector -fPIE -D_FORTIFY_SOURCE=2 \
+-      -Wunreachable-code -Wsign-compare -Wno-endif-labels \
+-      -g -O2
++      -Wformat -Wformat-security -fPIE \
++      -Wunreachable-code -Wsign-compare -Wno-endif-labels
++
+ ifneq ($(EXTRA_CFLAGS),)
+ CFLAGS += $(EXTRA_CFLAGS)
+ endif
+-LDFLAGS=-L$(LIBDIR) -pie -z noexecstack -z relro -z now
++LDFLAGS += -L$(LIBDIR) -pie -z noexecstack -z relro -z now
+ LDLIBS=-lpqos -lpthread
+ 
+ # ICC and GCC options
+--- a/examples/c/CMT_MBM/Makefile
++++ b/examples/c/CMT_MBM/Makefile
+@@ -35,17 +35,17 @@
+ 
###############################################################################
+ 
+ LIBDIR ?= ../../../lib
+-CFLAGS =-I$(LIBDIR) -pthread \
++CFLAGS += -I$(LIBDIR) -pthread \
+       -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
+       -Wmissing-declarations -Wold-style-definition -Wpointer-arith \
+       -Wcast-qual -Wundef -Wwrite-strings \
+-      -Wformat -Wformat-security -fstack-protector -fPIE -D_FORTIFY_SOURCE=2 \
+-      -Wunreachable-code -Wsign-compare -Wno-endif-labels \
+-      -g -O2
++      -Wformat -Wformat-security -fPIE \
++      -Wunreachable-code -Wsign-compare -Wno-endif-labels
++
+ ifneq ($(EXTRA_CFLAGS),)
+ CFLAGS += $(EXTRA_CFLAGS)
+ endif
+-LDFLAGS=-L$(LIBDIR) -pie -z noexecstack -z relro -z now
++LDFLAGS += -L$(LIBDIR) -pie -z noexecstack -z relro -z now
+ LDLIBS=-lpqos -lpthread
+ 
+ # ICC and GCC options
+--- a/examples/c/PSEUDO_LOCK/Makefile
++++ b/examples/c/PSEUDO_LOCK/Makefile
+@@ -35,15 +35,15 @@
+ 
###############################################################################
+ 
+ LIBDIR ?= ../../../lib
+-LDFLAGS = -L$(LIBDIR) -pie -z noexecstack -z relro -z now
++LDFLAGS += -L$(LIBDIR) -pie -z noexecstack -z relro -z now
+ LDLIBS = -lpqos -lrt -lpthread
+-CFLAGS = -I$(LIBDIR) \
++CFLAGS += -I$(LIBDIR) \
+       -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
+       -Wmissing-declarations -Wold-style-definition -Wpointer-arith \
+       -Wcast-qual -Wundef -Wwrite-strings  \
+-      -Wformat -Wformat-security -fstack-protector -fPIE -D_FORTIFY_SOURCE=2 \
+-      -Wunreachable-code -Wsign-compare -Wno-endif-labels \
+-      -g -O2
++      -Wformat -Wformat-security -fPIE \
++      -Wunreachable-code -Wsign-compare -Wno-endif-labels
++
+ ifneq ($(EXTRA_CFLAGS),)
+ CFLAGS += $(EXTRA_CFLAGS)
+ endif
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -37,12 +37,12 @@
+ VERSION = 4.2.0
+ SO_VERSION = 4
+ SHARED ?= y
+-LDFLAGS = -L. -lpthread -z noexecstack -z relro -z now
+-CFLAGS = -pthread -I./ -D_GNU_SOURCE \
++LDFLAGS += -L. -lpthread -z noexecstack -z relro -z now
++CFLAGS += -pthread -I./ -D_GNU_SOURCE \
+       -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
+       -Wmissing-declarations -Wold-style-definition -Wpointer-arith \
+       -Wcast-qual -Wundef -Wwrite-strings \
+-      -Wformat -Wformat-security -fstack-protector \
++      -Wformat -Wformat-security \
+       -Wunreachable-code -Wsign-compare -Wno-endif-labels
+ ifneq ($(EXTRA_CFLAGS),)
+ CFLAGS += $(EXTRA_CFLAGS)
+@@ -83,9 +83,7 @@
+ 
+ # DEBUG build
+ ifeq ($(DEBUG),y)
+-CFLAGS += -g -ggdb -O0 -DDEBUG
+-else
+-CFLAGS += -g -O2 -D_FORTIFY_SOURCE=2
++CFLAGS += -DDEBUG
+ endif
+ 
+ # RMID CUSTOM
+--- a/pqos/Makefile
++++ b/pqos/Makefile
+@@ -35,13 +35,13 @@
+ 
###############################################################################
+ 
+ LIBDIR ?= ../lib
+-LDFLAGS = -L$(LIBDIR) -pie -z noexecstack -z relro -z now
++LDFLAGS += -L$(LIBDIR) -pie -z noexecstack -z relro -z now
+ LDLIBS = -lpqos -lpthread
+-CFLAGS = -I$(LIBDIR) \
++CFLAGS += -I$(LIBDIR) \
+       -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
+       -Wmissing-declarations -Wold-style-definition -Wpointer-arith \
+       -Wcast-qual -Wundef -Wwrite-strings \
+-      -Wformat -Wformat-security -fstack-protector -fPIE \
++      -Wformat -Wformat-security -fPIE \
+       -Wunreachable-code -Wsign-compare -Wno-endif-labels
+ ifneq ($(EXTRA_CFLAGS),)
+ CFLAGS += $(EXTRA_CFLAGS)
+@@ -68,9 +68,7 @@
+ 
+ # DEBUG build
+ ifeq ($(DEBUG),y)
+-CFLAGS += -g -ggdb -O0 -DDEBUG
+-else
+-CFLAGS += -g -O2 -D_FORTIFY_SOURCE=2
++CFLAGS += -DDEBUG
+ endif
+ 
+ # RMID CUSTOM
+--- a/rdtset/Makefile
++++ b/rdtset/Makefile
+@@ -35,13 +35,13 @@
+ 
###############################################################################
+ 
+ LIBDIR ?= ../lib
+-LDFLAGS = -L$(LIBDIR) -pie -z noexecstack -z relro -z now
++LDFLAGS += -L$(LIBDIR) -pie -z noexecstack -z relro -z now
+ LDLIBS = -lpqos -lpthread
+-CFLAGS = -I$(LIBDIR) \
++CFLAGS += -I$(LIBDIR) \
+       -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
+       -Wmissing-declarations -Wold-style-definition -Wpointer-arith \
+       -Wcast-qual -Wundef -Wwrite-strings \
+-      -Wformat -Wformat-security -fstack-protector -fPIE \
++      -Wformat -Wformat-security -fPIE \
+       -Wunreachable-code -Wsign-compare -Wno-endif-labels \
+       -D_GNU_SOURCE
+ ifneq ($(EXTRA_CFLAGS),)
+@@ -69,9 +69,7 @@
+ 
+ # DEBUG build
+ ifeq ($(DEBUG),y)
+-CFLAGS += -g -ggdb -O0 -DDEBUG
+-else
+-CFLAGS += -g -O2 -D_FORTIFY_SOURCE=2
++CFLAGS += -DDEBUG
+ endif
+ 
+ # RMID CUSTOM
+--- a/tools/membw/Makefile
++++ b/tools/membw/Makefile
+@@ -36,17 +36,15 @@
+ 
+ APP = membw
+ 
+-CFLAGS=-W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
++CFLAGS += -W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
+       -Wmissing-declarations -Wold-style-definition -Wpointer-arith \
+       -Wcast-qual -Wundef -Wwrite-strings \
+-      -Wformat -Wformat-security -fstack-protector -fPIE \
++      -Wformat -Wformat-security -fPIE \
+       -Wunreachable-code -Wsign-compare -Wno-endif-labels \
+-      -Winline -msse4.2
++      -Winline
+ 
+ ifeq ($(DEBUG),y)
+-CFLAGS += -O0 -g -DDEBUG
+-else
+-CFLAGS += -O3 -g -D_FORTIFY_SOURCE=2
++CFLAGS += -DDEBUG
+ endif
+ 
+ HAS_AVX512 := $(shell $(CC) -mavx512f -dM -E - < /dev/null 2> /dev/null | 
grep -c "AVX512F")
+--- a/unit-test/lib/Makefile
++++ b/unit-test/lib/Makefile
+@@ -15,13 +15,13 @@
+ TESTS = $(TESTS_SRCS:%.c=$(BIN_DIR)/%)
+ 
+ 
+-LDFLAGS = -L$(MOCK_DIR) -lpthread -lcmocka -lpqosmock -z noexecstack -z relro 
-z now
+-CFLAGS = -pthread -I$(LIB_DIR) -I$(MOCK_DIR) \
++LDFLAGS += -L$(MOCK_DIR) -lpthread -lcmocka -lpqosmock -z noexecstack -z 
relro -z now
++CFLAGS += -pthread -I$(LIB_DIR) -I$(MOCK_DIR) \
+       -D_GNU_SOURCE \
+       -W -Wall -Wextra -Wstrict-prototypes \
+       -Wold-style-definition -Wpointer-arith \
+       -Wcast-qual -Wundef -Wwrite-strings \
+-      -Wformat -Wformat-security -fstack-protector \
++      -Wformat -Wformat-security \
+       -Wunreachable-code -Wsign-compare -Wno-endif-labels \
+       -D'PQOS_LOCAL=' -D'PQOS_API='
+ 
+@@ -527,4 +527,4 @@
+ 
+ clean:
+       rm -rf $(BIN_DIR)
+-      rm -rf $(OBJ_DIR)
+\ Manca newline alla fine del file
++      rm -rf $(OBJ_DIR)

diff --git a/sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0-r1.ebuild 
b/sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0-r2.ebuild
similarity index 95%
rename from sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0-r1.ebuild
rename to sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0-r2.ebuild
index f4c6de5e7..aee2b7962 100644
--- a/sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0-r1.ebuild
+++ b/sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0-r2.ebuild
@@ -38,7 +38,11 @@ DEPEND="
 "
 
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-PATCHES=( "${FILESDIR}/${PN}-perl-makefile.patch" )
+PATCHES=(
+       "${FILESDIR}/${PN}-perl-makefile.patch"
+       "${FILESDIR}/${PN}-do-not-strip.patch"
+       "${FILESDIR}/${PN}-respect-flags.patch"
+)
 
 distutils_enable_tests unittest
 distutils_enable_tests pytest

Reply via email to