Skip to content

Commit b390e2e

Browse files
author
Hangbin Liu
committed
tools: ynl: extend CFLAGS to keep options from environment
JIRA: https://issues.redhat.com/browse/RHEL-50389 Upstream Status: net.git commit 05a318b commit 05a318b Author: Jan Stancek <jstancek@redhat.com> Date: Tue Nov 12 09:21:33 2024 +0100 tools: ynl: extend CFLAGS to keep options from environment Package build environments like Fedora rpmbuild introduced hardening options (e.g. -pie -Wl,-z,now) by passing a -spec option to CFLAGS and LDFLAGS. ynl Makefiles currently override CFLAGS but not LDFLAGS, which leads to a mismatch and build failure: CC sample devlink /usr/bin/ld: devlink.o: relocation R_X86_64_32 against symbol `ynl_devlink_family' 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 Extend CFLAGS to support hardening options set by build environment. Signed-off-by: Jan Stancek <jstancek@redhat.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/265b2d5d3a6d4721a161219f081058ed47dc846a.1731399562.git.jstancek@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Hangbin Liu <haliu@redhat.com>
1 parent 45cd832 commit b390e2e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tools/net/ynl/generated/Makefile

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

33
CC=gcc
4-
CFLAGS=-std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \
4+
CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \
55
-I../lib/ -idirafter $(UAPI_PATH)
66
ifeq ("$(DEBUG)","1")
77
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan

tools/net/ynl/lib/Makefile

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

33
CC=gcc
4-
CFLAGS=-std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow
4+
CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow
55
ifeq ("$(DEBUG)","1")
66
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
77
endif

tools/net/ynl/samples/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
include ../Makefile.deps
44

55
CC=gcc
6-
CFLAGS=-std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \
6+
CFLAGS += -std=gnu11 -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow \
77
-I../lib/ -I../generated/ -idirafter $(UAPI_PATH)
88
ifeq ("$(DEBUG)","1")
99
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan

0 commit comments

Comments
 (0)