Thread (25 messages) flat view 25 messages, 3 authors, 2015-03-18

Re: [PATCH v4 2/9] kbuild: Don't pass LDFLAGS to selftest Makefile

From: Shuah Khan <hidden>
Date: 2015-03-11 16:08:13
Also in: lkml

On 03/10/2015 10:05 PM, Michael Ellerman wrote:
quoted hunk ↗ jump to hunk
The makefile in arch/x86/Makefile.um sets LDFLAGS and exports it, which
is then propagated to the selftest Makefiles and leads to build errors
there. The build errors occur because we are passing LDFLAGS to CC, but
the option set in Makefile.um (-m elf_x86_64) is not understood by CC.
We could fix that by using -Wl, but that might break the UM build if
it's actually passing that option to LD directly.

We don't actually want the LDFLAGS from kbuild in the selftest Makefile,
so the simplest fix seems to be to clear LDFLAGS before invoking the
selftest Makefile.

Signed-off-by: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 0836e9d628f0..5cef1d4c2ea0 100644
--- a/Makefile
+++ b/Makefile
@@ -1085,7 +1085,7 @@ headers_check: headers_install
 
 PHONY += kselftest
 kselftest:
-	$(Q)$(MAKE) -C tools/testing/selftests MAKEFLAGS="$(filter-out rR,$(MAKEFLAGS))" run_tests
+	$(Q)$(MAKE) LDFLAGS= -C tools/testing/selftests MAKEFLAGS="$(filter-out rR,$(MAKEFLAGS))" run_tests
 
 # ---------------------------------------------------------------------------
 # Modules
Does this work on x86, powerpc, and other architectures? Do all tests
with and without explicit rules build correctly?

-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org | (970) 217-8978
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help