lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1498214246-1244-3-git-send-email-marcin.nowakowski@imgtec.com>
Date:   Fri, 23 Jun 2017 12:37:25 +0200
From:   Marcin Nowakowski <marcin.nowakowski@...tec.com>
To:     Shuah Khan <shuah@...nel.org>
CC:     <linux-kselftest@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Marcin Nowakowski <marcin.nowakowski@...tec.com>
Subject: [PATCH 2/3] selftests/gpio: fix build error

While building selftests/gpio, gpio-utils from linux/tools/gpio as built
in the process as well. However, the OUTPUT make variable usage in
selftests breaks the build system in linux/tools/gpio resulting in its
output files placed in the selftests folder (due to lack of trailing
slash in the path, the files are placed directly in selftests):

make -f linux/tools/build/Makefile.build dir=. obj=lsgpio
make[3]: Entering directory '/mnt/ssd/MIPS/linux-next/tools/gpio'
CC    linux/tools/testing/selftests/gpiolsgpio.o
CC    linux/tools/testing/selftests/gpiogpio-utils.o
LD    linux/tools/testing/selftests/gpiolsgpio-in.o

This pollutes the selftests directory and, most importantly, makes it
impossible for selftests/gpio to find the object file it's looking for
to link the test:

cc -O2 -g -std=gnu99 -Wall -I../../../../usr/include/
gpio-mockup-chardev.c ../../../gpio/gpio-utils.o
../../../../usr/include/linux/gpio.h  -lmount -I/usr/include/libmount -o
gpio-mockup-chardev
gcc: error: ../../../gpio/gpio-utils.o: No such file or directory

Fix this by clearing the OUTPUT variable when invoking linux/tools/gpio
make to ensure it's built where expected.

Note, that this solution is not ideal as the output is placed in
linux/tools/gpio rather than a location relative to OUTPUT, but this at
least ensures the build succeeds.
Due to differences and complexities of selftests and linux/tools build
systems, it's not trivial to ensure linux/tools get built properly when
invoked recursively from selftests build and this is left as a future
task to resolve properly.

Fixes: a8ba798bc8ec ('selftests: enable O and KBUILD_OUTPUT')

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@...tec.com>
---
 tools/testing/selftests/gpio/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile
index 298929d..950956e 100644
--- a/tools/testing/selftests/gpio/Makefile
+++ b/tools/testing/selftests/gpio/Makefile
@@ -23,7 +23,7 @@ LDLIBS += -lmount -I/usr/include/libmount
 $(BINARIES): ../../../gpio/gpio-utils.o ../../../../usr/include/linux/gpio.h
 
 ../../../gpio/gpio-utils.o:
-	make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio
+	make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C ../../../gpio OUTPUT=
 
 ../../../../usr/include/linux/gpio.h:
 	make -C ../../../.. headers_install INSTALL_HDR_PATH=$(shell pwd)/../../../../usr/
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ