Patch "selftests/bpf: Fix vmtest static compilation error" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests/bpf: Fix vmtest static compilation error

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-bpf-fix-vmtest-static-compilation-error.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c2f27247d27293f6c8c4a04e2bb2c29e5f36baba
Author: Daniel T. Lee <danieltimlee@xxxxxxxxx>
Date:   Wed Jan 25 19:04:40 2023 +0900

    selftests/bpf: Fix vmtest static compilation error
    
    [ Upstream commit 2514a31241e1e9067d379e0fbdb60e4bc2bf4659 ]
    
    As stated in README.rst, in order to resolve errors with linker errors,
    'LDLIBS=-static' should be used. Most problems will be solved by this
    option, but in the case of urandom_read, this won't fix the problem. So
    the Makefile is currently implemented to strip the 'static' option when
    compiling the urandom_read. However, stripping this static option isn't
    configured properly on $(LDLIBS) correctly, which is now causing errors
    on static compilation.
    
        # LDLIBS=-static ./vmtest.sh
        ld.lld: error: attempted static link of dynamic object liburandom_read.so
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        make: *** [Makefile:190: /linux/tools/testing/selftests/bpf/urandom_read] Error 1
        make: *** Waiting for unfinished jobs....
    
    This commit fixes this problem by configuring the strip with $(LDLIBS).
    
    Fixes: 68084a136420 ("selftests/bpf: Fix building bpf selftests statically")
    Signed-off-by: Daniel T. Lee <danieltimlee@xxxxxxxxx>
    Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/bpf/20230125100440.21734-1-danieltimlee@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 5a8fd8b3fb4a5..1fda7448f4a2f 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -181,14 +181,15 @@ endif
 # do not fail. Static builds leave urandom_read relying on system-wide shared libraries.
 $(OUTPUT)/liburandom_read.so: urandom_read_lib1.c urandom_read_lib2.c
 	$(call msg,LIB,,$@)
-	$(Q)$(CLANG) $(filter-out -static,$(CFLAGS) $(LDFLAGS)) $^ $(LDLIBS)   \
+	$(Q)$(CLANG) $(filter-out -static,$(CFLAGS) $(LDFLAGS))   \
+		     $^ $(filter-out -static,$(LDLIBS))	     \
 		     -fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
 		     -fPIC -shared -o $@
 
 $(OUTPUT)/urandom_read: urandom_read.c urandom_read_aux.c $(OUTPUT)/liburandom_read.so
 	$(call msg,BINARY,,$@)
 	$(Q)$(CLANG) $(filter-out -static,$(CFLAGS) $(LDFLAGS)) $(filter %.c,$^) \
-		     liburandom_read.so $(LDLIBS)			       \
+		     liburandom_read.so $(filter-out -static,$(LDLIBS))	     \
 		     -fuse-ld=$(LLD) -Wl,-znoseparate-code -Wl,--build-id=sha1 \
 		     -Wl,-rpath=. -o $@
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux