Skip to content

Commit d6714e7

Browse files
jstancekgregkh
authored andcommitted
selftests: net/{lib,openvswitch}: extend CFLAGS to keep options from environment
[ Upstream commit 9b06d5b ] Package build environments like Fedora rpmbuild introduced hardening options (e.g. -pie -Wl,-z,now) by passing a -spec option to CFLAGS and LDFLAGS. Some Makefiles currently override CFLAGS but not LDFLAGS, which leads to a mismatch and build failure, for example: /usr/bin/ld: /tmp/ccd2apay.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status make[1]: *** [../../lib.mk:222: tools/testing/selftests/net/lib/csum] Error 1 openvswitch/Makefile CFLAGS currently do not appear to be used, but fix it anyway for the case when new tests are introduced in future. Fixes: 1d0dc85 ("selftests: drv-net: add checksum tests") Signed-off-by: Jan Stancek <[email protected]> Acked-by: Matthieu Baerts (NGI0) <[email protected]> Reviewed-by: Hangbin Liu <[email protected]> Link: https://patch.msgid.link/3d173603ee258f419d0403363765c9f9494ff79a.1737635092.git.jstancek@redhat.com Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 0f94234 commit d6714e7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/testing/selftests/net/lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3-
CFLAGS = -Wall -Wl,--no-as-needed -O2 -g
3+
CFLAGS += -Wall -Wl,--no-as-needed -O2 -g
44
CFLAGS += -I../../../../../usr/include/ $(KHDR_INCLUDES)
55
# Additional include paths needed by kselftest.h
66
CFLAGS += -I../../

tools/testing/selftests/net/openvswitch/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
top_srcdir = ../../../../..
44

5-
CFLAGS = -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES)
5+
CFLAGS += -Wall -Wl,--no-as-needed -O2 -g -I$(top_srcdir)/usr/include $(KHDR_INCLUDES)
66

77
TEST_PROGS := openvswitch.sh
88

0 commit comments

Comments
 (0)