Skip to contentSkip to conversation

selftests/futex: Fix build error with OUTPUT variable

PATCH In review Darren Hart 4 participants 5 messages Mar 24, 2017 – Apr 11, 2017

Subsystems (3)
lore
Share & tools
lore

Darren Hart

author reviewer
#0 lore raw

PATCH 1/1 selftests/futex: Fix build error with OUTPUT variable

The use of $$OUTPUT in the target shell commands resulted in an empty string followed by an absolute path for which mkdir failed:

$ make -C tools/testing/selftests/futex
make: Entering directory '/home/dvhart/source/linux/linux-pdx86/tools/testing/selftests/futex'
Makefile:36: warning: overriding recipe for target 'clean'
../lib.mk:55: warning: ignoring old recipe for target 'clean'
for DIR in functional; do		\
	BUILD_TARGET=$OUTPUT/$DIR;	\
	mkdir $BUILD_TARGET  -p;	\
	make OUTPUT=$BUILD_TARGET -C $DIR all;\
done
mkdir: cannot create directory ‘/functional’: Permission denied

Replace $$OUTPUT with $(OUTPUT) when referring to the Makefile OUTPUT variable. The above make command now completes successfully.

Fixes a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
Cc Shuah Khan <[email protected]>
Cc <[email protected]> # 4.10.x-
---
 tools/testing/selftests/futex/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/futex/Makefile +3 -3
index 653c5cd..c8095e6 100644
@@ -8,7 +8,7 @@ include ../lib.mk
 
 all:
 	for DIR in $(SUBDIRS); do		\
-		BUILD_TARGET=$$OUTPUT/$$DIR;	\
+		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
 		mkdir $$BUILD_TARGET  -p;	\
 		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
 	done
@@ -22,7 +22,7 @@ override define INSTALL_RULE
 	install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
 
 	@for SUBDIR in $(SUBDIRS); do \
-		BUILD_TARGET=$$OUTPUT/$$SUBDIR;	\
+		BUILD_TARGET=$(OUTPUT)/$$SUBDIR;	\
 		mkdir $$BUILD_TARGET  -p;	\
 		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \
 	done;
@@ -34,7 +34,7 @@ endef
 
 clean:
 	for DIR in $(SUBDIRS); do		\
-		BUILD_TARGET=$$OUTPUT/$$DIR;	\
+		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
 		mkdir $$BUILD_TARGET  -p;	\
 		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
 	done
Signature · 6 lines
2.9.3


-- 
Darren Hart
VMware Open Source Technology Center
Tested-by Bamvor Jian Zhang on v1 1/1
#1 lore raw

Hi,

Quoted 15 lines · Darren Hart

The use of $$OUTPUT in the target shell commands resulted in an empty string followed by an absolute path for which mkdir failed:

$ make -C tools/testing/selftests/futex
make: Entering directory '/home/dvhart/source/linux/linux-pdx86/tools/testing/selftests/futex'
Makefile:36: warning: overriding recipe for target 'clean'
../lib.mk:55: warning: ignoring old recipe for target 'clean'
for DIR in functional; do               \
        BUILD_TARGET=$OUTPUT/$DIR;      \
        mkdir $BUILD_TARGET  -p;        \
        make OUTPUT=$BUILD_TARGET -C $DIR all;\
done
mkdir: cannot create directory ‘/functional’: Permission denied
Quoted 2 lines

Replace $$OUTPUT with $(OUTPUT) when referring to the Makefile OUTPUT variable. The above make command now completes successfully.

Test with native and cross-compiler build from selftests/futex or selftests, the results are good.

Regards

Bamvor

Quoted 49 lines
Fixes a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
Cc Shuah Khan <[email protected]>
Cc <[email protected]> # 4.10.x-
---
 tools/testing/selftests/futex/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/futex/Makefile +3 -4
index 653c5cd..c8095e6 100644
@@ -8,7 +8,7 @@ include ../lib.mk
 
 all:
        for DIR in $(SUBDIRS); do               \
-               BUILD_TARGET=$$OUTPUT/$$DIR;    \
+               BUILD_TARGET=$(OUTPUT)/$$DIR;   \
                mkdir $$BUILD_TARGET  -p;       \
                make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
        done
@@ -22,7 +22,7 @@ override define INSTALL_RULE
        install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
 
        @for SUBDIR in $(SUBDIRS); do \
-               BUILD_TARGET=$$OUTPUT/$$SUBDIR; \
+               BUILD_TARGET=$(OUTPUT)/$$SUBDIR;        \
                mkdir $$BUILD_TARGET  -p;       \
                $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \
        done;
@@ -34,7 +34,7 @@ endef
 
 clean:
        for DIR in $(SUBDIRS); do               \
-               BUILD_TARGET=$$OUTPUT/$$DIR;    \
+               BUILD_TARGET=$(OUTPUT)/$$DIR;   \
                mkdir $$BUILD_TARGET  -p;       \
                make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
        done
--

2.9.3

--
Darren Hart
VMware Open Source Technology Center

Signature · 4 lines
-----------------------------------------
   arm64, kernel. opensuse
   blog: http://aarch64.me
-----------------------------------------
#2 lore raw
In reply to Darren Hart
Quoted 17 lines · Darren Hart

The use of $$OUTPUT in the target shell commands resulted in an empty string followed by an absolute path for which mkdir failed:

$ make -C tools/testing/selftests/futex
make: Entering directory '/home/dvhart/source/linux/linux-pdx86/tools/testing/selftests/futex'
Makefile:36: warning: overriding recipe for target 'clean'
../lib.mk:55: warning: ignoring old recipe for target 'clean'
for DIR in functional; do		\
	BUILD_TARGET=$OUTPUT/$DIR;	\
	mkdir $BUILD_TARGET  -p;	\
	make OUTPUT=$BUILD_TARGET -C $DIR all;\
done
mkdir: cannot create directory ‘/functional’: Permission denied

Replace $$OUTPUT with $(OUTPUT) when referring to the Makefile OUTPUT variable. The above make command now completes successfully.

Quoted 6 lines
Fixes a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
Cc Shuah Khan <[email protected]>
Cc <[email protected]> # 4.10.x-

The OUTPUT support only went into v4.11-rc1, so I don't see why you need a stable tag?

Change looks good though.

cheers

author reviewer
#3 lore raw
Quoted 26 lines · Michael Ellerman
Quoted 17 lines · Darren Hart

The use of $$OUTPUT in the target shell commands resulted in an empty string followed by an absolute path for which mkdir failed:

$ make -C tools/testing/selftests/futex
make: Entering directory '/home/dvhart/source/linux/linux-pdx86/tools/testing/selftests/futex'
Makefile:36: warning: overriding recipe for target 'clean'
../lib.mk:55: warning: ignoring old recipe for target 'clean'
for DIR in functional; do		\
	BUILD_TARGET=$OUTPUT/$DIR;	\
	mkdir $BUILD_TARGET  -p;	\
	make OUTPUT=$BUILD_TARGET -C $DIR all;\
done
mkdir: cannot create directory ‘/functional’: Permission denied

Replace $$OUTPUT with $(OUTPUT) when referring to the Makefile OUTPUT variable. The above make command now completes successfully.

Quoted 6 lines
Fixes a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
Cc Shuah Khan <[email protected]>
Cc <[email protected]> # 4.10.x-
Quoted 2 lines

The OUTPUT support only went into v4.11-rc1, so I don't see why you need a stable tag?

Git spelunking failure on my part, you are correct. Please disregard the stable tag.

Quoted 3 lines

Change looks good though.

Thank you for the review.

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center
#4 lore raw
Quoted 30 lines · Darren Hart
Quoted 26 lines · Michael Ellerman
Quoted 17 lines · Darren Hart

The use of $$OUTPUT in the target shell commands resulted in an empty string followed by an absolute path for which mkdir failed:

$ make -C tools/testing/selftests/futex
make: Entering directory '/home/dvhart/source/linux/linux-pdx86/tools/testing/selftests/futex'
Makefile:36: warning: overriding recipe for target 'clean'
../lib.mk:55: warning: ignoring old recipe for target 'clean'
for DIR in functional; do		\
	BUILD_TARGET=$OUTPUT/$DIR;	\
	mkdir $BUILD_TARGET  -p;	\
	make OUTPUT=$BUILD_TARGET -C $DIR all;\
done
mkdir: cannot create directory ‘/functional’: Permission denied

Replace $$OUTPUT with $(OUTPUT) when referring to the Makefile OUTPUT variable. The above make command now completes successfully.

Quoted 6 lines
Fixes a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
Cc Shuah Khan <[email protected]>
Cc <[email protected]> # 4.10.x-
Quoted 2 lines

The OUTPUT support only went into v4.11-rc1, so I don't see why you need a stable tag?

Quoted 9 lines

Git spelunking failure on my part, you are correct. Please disregard the stable tag.

Quoted 3 lines

Change looks good though.

Thank you for the review.

Thanks for fixing this.

Applied to linux-kselftest next after removing the stable tag.

-- Shuah