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@gmail.com>
This commit is contained in:
Alessandro Barbieri
2021-09-04 01:04:38 +02:00
parent 40ed7d92f4
commit b69c959800
3 changed files with 249 additions and 1 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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