From e9d6414437d27803a16b5d96c48b45140e989e5e Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 16 Mar 2020 15:25:51 +0800 Subject: [PATCH] openvswitch: fix PIE build against 4.14 kernel Reported-by: Josef Schlehofer Signed-off-by: Yousong Zhou Ref: https://github.com/openwrt/packages/pull/11567 --- net/openvswitch/Makefile | 2 +- .../0007-datapath-unexport-LDFLAGS.patch | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 net/openvswitch/patches/0007-datapath-unexport-LDFLAGS.patch diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index 6550ac2c1..8750c6a8b 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/kernel.mk # PKG_NAME:=openvswitch PKG_VERSION:=2.12.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.openvswitch.org/releases/ PKG_HASH:=13fd42703180b4b1146c7e97926d09225485868cc2fbbd58dc0c421b4b8fe8f8 diff --git a/net/openvswitch/patches/0007-datapath-unexport-LDFLAGS.patch b/net/openvswitch/patches/0007-datapath-unexport-LDFLAGS.patch new file mode 100644 index 000000000..ebf846042 --- /dev/null +++ b/net/openvswitch/patches/0007-datapath-unexport-LDFLAGS.patch @@ -0,0 +1,31 @@ +From ddbe0a362cad22e7171524661fd3d3f83628dd7a Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Mon, 16 Mar 2020 15:18:16 +0800 +Subject: [PATCH] datapath: unexport LDFLAGS + +OpenWrt build system will put "-specs=.../hardened-pie-ld.specs" into +LDFLAGS when building PIE binaries. However the "-specs" argument is +inteneded for "gcc" the driver while "ld" the linker when presented will +complain it as unrecognized error. + +This can cause Kbuild error when building datapath kernel modules. The +issue should only happen when compiling against upstream kernel 4.14 and +earlier. Later ones should have been fixed with kernel upstream commit +d503ac531a5 ("kbuild: rename LDFLAGS to KBUILD_LDFLAGS") + +Signed-off-by: Yousong Zhou +--- + datapath/linux/Makefile.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/datapath/linux/Makefile.in b/datapath/linux/Makefile.in +index efc1663e4..61fcaa67e 100644 +--- a/datapath/linux/Makefile.in ++++ b/datapath/linux/Makefile.in +@@ -1,5 +1,6 @@ + ifeq ($(KERNELRELEASE),) + # We're being called directly by running make in this directory. ++unexport LDFLAGS + include Makefile.main + else + # We're being included by the Linux kernel build system