ld(1) on OpenBSD 7.3 doesn't appear to support zlib-compressed
debug sections out-of-the-box.  Oh well, being able to build
this C++ bit at all is required to get acceptable performance
with -cindex --associate.
---
 lib/PublicInbox/XapHelperCxx.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/XapHelperCxx.pm b/lib/PublicInbox/XapHelperCxx.pm
index 4571676b..a22dda1e 100644
--- a/lib/PublicInbox/XapHelperCxx.pm
+++ b/lib/PublicInbox/XapHelperCxx.pm
@@ -15,8 +15,10 @@ my $bin = "$dir/xap_helper";
 my ($srcpfx) = (__FILE__ =~ m!\A(.+/)[^/]+\z!);
 my @srcs = map { $srcpfx.$_ } qw(xap_helper.h);
 my @pm_dep = map { $srcpfx.$_ } qw(Search.pm CodeSearch.pm);
+my $ldflags = '-Wl,-O1';
+$ldflags .= ' -Wl,--compress-debug-sections=zlib' if $^O ne 'openbsd';
 my $xflags = ($ENV{CXXFLAGS} // '-Wall -ggdb3 -O0') . ' ' .
-       ($ENV{LDFLAGS} // '-Wl,-O1 -Wl,--compress-debug-sections=zlib') .
+       ($ENV{LDFLAGS} // $ldflags) .
        qq{ -DTHREADID=}.PublicInbox::Search::THREADID;
 
 sub xflags_chg () {

Reply via email to