Closed sqkerner closed 4 years ago
I found Issue 1407: Dynamically link tests, but it is not clear how to implement it.
Can we use linkstatic = envoy_linkstatic()
for the targets in envoy_test.bzl
?
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
@asraa solved this issue with https://github.com/envoyproxy/envoy/pull/11045 .
I want to build test
//test/extensions/filters/http/common/fuzz:filter_fuzz_test_with_libfuzzer
with coverage, so that I can see the coverage of a fuzz corpus.In a git client with no changes:
Idea 1: compile with -fPIC
The error
relocation R_X86_64_PC32 out of range
is normally dealt with by compiling code in a position independent way. Adding the flag--force_pic
to thebazel coverage
command in the scripttest/run_envoy_bazel_coverage.sh
causes a build failure inliblua
:Idea 2: Dynamically link tests
If the target is dynamically linked, then we avoid having one object whose size is >2^31 bytes.
I found Issue 1407: Dynamically link tests, but it is not clear how to implement it. I changed
envoy_cc_fuzz_test()
inbazel/envoy_test.bzl
to setlinkstatic = 0
, in a few places, and I can make tests build this way.Perhaps we can enable dynamic linking for fuzz targets that need it. This would be a way to make incremental progress on Issue 1407.