openvswitch: fix PIE build against 4.14 kernel
[feed/packages.git] / net / openvswitch / patches / 0007-datapath-unexport-LDFLAGS.patch
1 From ddbe0a362cad22e7171524661fd3d3f83628dd7a Mon Sep 17 00:00:00 2001
2 From: Yousong Zhou <yszhou4tech@gmail.com>
3 Date: Mon, 16 Mar 2020 15:18:16 +0800
4 Subject: [PATCH] datapath: unexport LDFLAGS
5
6 OpenWrt build system will put "-specs=.../hardened-pie-ld.specs" into
7 LDFLAGS when building PIE binaries. However the "-specs" argument is
8 inteneded for "gcc" the driver while "ld" the linker when presented will
9 complain it as unrecognized error.
10
11 This can cause Kbuild error when building datapath kernel modules. The
12 issue should only happen when compiling against upstream kernel 4.14 and
13 earlier. Later ones should have been fixed with kernel upstream commit
14 d503ac531a5 ("kbuild: rename LDFLAGS to KBUILD_LDFLAGS")
15
16 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
17 ---
18 datapath/linux/Makefile.in | 1 +
19 1 file changed, 1 insertion(+)
20
21 diff --git a/datapath/linux/Makefile.in b/datapath/linux/Makefile.in
22 index efc1663e4..61fcaa67e 100644
23 --- a/datapath/linux/Makefile.in
24 +++ b/datapath/linux/Makefile.in
25 @@ -1,5 +1,6 @@
26 ifeq ($(KERNELRELEASE),)
27 # We're being called directly by running make in this directory.
28 +unexport LDFLAGS
29 include Makefile.main
30 else
31 # We're being included by the Linux kernel build system