sys-apps/intel-cmt-cat: fix patch

Closes: https://bugs.gentoo.org/834747
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri
2022-03-09 01:09:10 +01:00
parent 204f67e373
commit 3cdf921a8a
2 changed files with 285 additions and 3 deletions

View File

@@ -0,0 +1,282 @@
--- a/examples/c/CAT_MBA/Makefile
+++ b/examples/c/CAT_MBA/Makefile
@@ -35,17 +35,16 @@
###############################################################################
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,16 @@
###############################################################################
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,14 @@
###############################################################################
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.3.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 -Og -DDEBUG
-else
-CFLAGS += -g -O2 -D_FORTIFY_SOURCE=2
+CFLAGS += -DDEBUG
endif
# RMID CUSTOM
@@ -114,7 +112,7 @@
endif
HDR = pqos.h
-PREFIX ?= /usr/local
+PREFIX ?= /usr
LIB_INSTALL_DIR ?= $(PREFIX)/lib
HDR_DIR ?= $(PREFIX)/include
DEPFILE = $(LIB).dep
--- 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
@@ -83,7 +81,7 @@
MAN = pqos.8
# XXX: modify as desired
-PREFIX ?= /usr/local
+PREFIX ?= /usr
BIN_DIR = $(PREFIX)/bin
MAN_DIR = $(PREFIX)/man/man8
--- 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
@@ -90,7 +88,7 @@
MAN = rdtset.8
# XXX: modify as desired
-PREFIX ?= /usr/local
+PREFIX ?= /usr
BIN_DIR = $(PREFIX)/bin
MAN_DIR = $(PREFIX)/man/man8
--- a/tools/membw/Makefile
+++ b/tools/membw/Makefile
@@ -38,21 +38,19 @@
MAN = membw.8
# XXX: modify as desired
-PREFIX ?= /usr/local
+PREFIX ?= /usr
BIN_DIR = $(PREFIX)/bin
MAN_DIR = $(PREFIX)/man/man8
-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,18 +15,16 @@
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='
-CFLAGS += -g -ggdb -O0
-
all: $(TESTS)
$(OBJ_DIR)/%.o: $(LIB_DIR)/%.c $(OBJ_DIR)/%.d
@@ -528,4 +526,4 @@
clean:
rm -rf $(BIN_DIR)
- rm -rf $(OBJ_DIR)
\ Manca newline alla fine del file
+ rm -rf $(OBJ_DIR)
--- a/unit-test/mock/Makefile
+++ b/unit-test/mock/Makefile
@@ -38,12 +38,12 @@
LIB = libpqosmock
SHARED ?= y
-LDFLAGS = -L. -lpthread -z noexecstack -z relro -z now
-CFLAGS = -pthread -I$(LIB_DIR) -D_GNU_SOURCE \
+LDFLAGS += -L. -lpthread -z noexecstack -z relro -z now
+CFLAGS += -pthread -I$(LIB_DIR) -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)
@@ -82,9 +82,7 @@
# DEBUG build
ifeq ($(DEBUG),y)
-CFLAGS += -g -ggdb -O0 -DDEBUG
-else
-CFLAGS += -g -O2 -D_FORTIFY_SOURCE=2
+CFLAGS += -DDEBUG
endif
# Build targets and dependencies
@@ -155,4 +153,4 @@
.PHONY: clean
clean:
- -rm -f $(CLEAN_OBJS) $(LIB)* $(DEPFILES)
\ Manca newline alla fine del file
+ -rm -f $(CLEAN_OBJS) $(LIB)* $(DEPFILES)

View File

@@ -41,7 +41,7 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}"
PATCHES=(
"${FILESDIR}/${PN}-perl-makefile.patch"
"${FILESDIR}/${PN}-do-not-strip.patch"
"${FILESDIR}/${PN}-respect-flags.patch"
"${FILESDIR}/${P}-respect-flags.patch"
)
distutils_enable_tests unittest
@@ -79,7 +79,7 @@ src_install() {
dobin tools/membw/membw
dobin snmp/rdt-agentx.pl
dodoc ChangeLog README
dodoc ChangeLog README.md
docinto membw
dodoc tools/membw/README
docinto pqos
@@ -87,7 +87,7 @@ src_install() {
docinto lib
dodoc lib/README
docinto lib/python
dodoc lib/python/README.txt
dodoc lib/python/README.md
docinto snmp
dodoc snmp/README
docinto rdtset