Skip to content

Commit

Permalink
selftest/memfd/Makefile: Fix build error
Browse files Browse the repository at this point in the history
Selftest for memfd shows build error as below:
```
gcc -D_FILE_OFFSET_BITS=64 -I../../../../include/uapi/ -I../../../../include/ -I../../../../usr/include/    fuse_mnt.c  -o /home/sjpark/linux/tools/testing/selftests/memfd/fuse_mnt
/tmp/cc6NHdwJ.o: In function `main':
fuse_mnt.c:(.text+0x249): undefined reference to `fuse_main_real'
collect2: error: ld returned 1 exit status
```

The build fails because output file is specified without $(OUTPUT) and
LDFLAGS is used though Makefile implicit rule is used.  This commit
fixes the error by specifying output file path with $(OUTPUT) and using
LDLIBS instead of LDFLAGS.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
(cherry picked from commit d02db4f)
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
  • Loading branch information
SeongJae Park authored and Seth Forshee committed Jul 24, 2017
1 parent 19827c1 commit 3f39f15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/memfd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST_PROGS := run_fuse_test.sh
TEST_GEN_FILES := memfd_test fuse_mnt fuse_test

fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
fuse_mnt: LDFLAGS += $(shell pkg-config fuse --libs)

include ../lib.mk

$(OUTPUT)/fuse_mnt: LDLIBS += $(shell pkg-config fuse --libs)

0 comments on commit 3f39f15

Please sign in to comment.