tools build: Link static libs for libopenssl feature
PATCH v2 1/1 tools build: Link static libs for libopenssl feature
The perf static build reports that the BPF skeleton is disabled due to the missing libopenssl feature.
Explicitly linking the libraries fixes the static build failure.
--- tools/build/feature/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/build/feature/Makefile +1 -1
@@ -384,7 +384,7 @@ $(OUTPUT)test-libpfm4.bin: $(BUILD) -lpfm $(OUTPUT)test-libopenssl.bin: - $(BUILD) -lssl + $(BUILD) -lssl -lcrypto -lz -lzstd $(OUTPUT)test-bpftool-skeletons.bin: $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
---
base-commit: bb551508e78c886e6d3bcca6c744d3bc3fd8ad59
change-id: 20260317-tools_fix_build_libopenssl-8290bfebda3c
Best regards,
Signature · 1 line
Leo Yan <[email protected]>
Quoted 17 lines · Leo Yan
The perf static build reports that the BPF skeleton is disabled due to the missing libopenssl feature.
Explicitly linking the libraries fixes the static build failure.
Fixes 7678523109d1 ("tools/build: Add a feature test for libopenssl")Signed-off-by Leo Yan <[email protected]>--- tools/build/feature/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/build/feature/Makefile +0
-0
tools/build/feature/Makefile $(OUTPUT)test-libpfm4.bin: · line 387
Quoted 5 lines
tools/build/feature/Makefile +1
-1@@ -384,7 +384,7 @@ $(OUTPUT)test-libpfm4.bin: $(BUILD) -lpfm $(OUTPUT)test-libopenssl.bin: - $(BUILD) -lssl + $(BUILD) -lssl -lcrypto -lz -lzstd
I wonder it would be better to do something like test-gtk2.bin so that if openssl wasn't compiled with libz and libzstd things don't fail:
```
$(OUTPUT)test-gtk2.bin:
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0
2>/dev/null) -Wno-deprecated-declarations
```
so:
```
$(OUTPUT)test-openssl.bin:
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags openssl 2>/dev/null)
```Since "-lssl" is a dependency of BUILD_ALL, that will probably also need updating.
Thanks,
Ian
Quoted 12 lines
tools/build/feature/Makefile +0
-1$(OUTPUT)test-bpftool-skeletons.bin: $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \ ---base-commit:
bb551508e78c886e6d3bcca6c744d3bc3fd8ad59
change-id: 20260317-tools_fix_build_libopenssl-8290bfebda3cBest regards,
--
Leo Yan <[email protected]>
Quoted 36 lines · Ian Rogers
Quoted 17 lines · Leo Yan
The perf static build reports that the BPF skeleton is disabled due to the missing libopenssl feature.
Explicitly linking the libraries fixes the static build failure.
Fixes 7678523109d1 ("tools/build: Add a feature test for libopenssl")Signed-off-by Leo Yan <[email protected]>--- tools/build/feature/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/build/feature/Makefile +0
-0tools/build/feature/Makefile $(OUTPUT)test-libpfm4.bin: · line 387
Quoted 5 lines
tools/build/feature/Makefile +1
-1@@ -384,7 +384,7 @@ $(OUTPUT)test-libpfm4.bin: $(BUILD) -lpfm $(OUTPUT)test-libopenssl.bin: - $(BUILD) -lssl + $(BUILD) -lssl -lcrypto -lz -lzstdI wonder it would be better to do something like test-gtk2.bin so that if openssl wasn't compiled with libz and libzstd things don't fail:
``` $(OUTPUT)test-gtk2.bin: $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) -Wno-deprecated-declarations ``` so: ``` $(OUTPUT)test-openssl.bin: $(BUILD) $(shell $(PKG_CONFIG) --libs --cflags openssl 2>/dev/null) ```
Quoted 2 lines
Since "-lssl" is a dependency of
BUILD_ALL, that will probably also need updating.
Thanks for suggestion, I have sent out v3.
Just record for another issue:
I was not able to build test-all.bin successfully with static linking until explicitly added -lexpat. Seems some Python extension libraries depends on libexpat, but python3-config doesn't include this dependency.
This would be a wider issue - as this is not limited to feature build,
we also need to fix perf's build as well? I might look into details
when have free time.
Thanks,
Leo