]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
xap_helper.h: don't compress debug sections on OpenBSD
authorEric Wong <e@80x24.org>
Wed, 30 Aug 2023 05:10:43 +0000 (05:10 +0000)
committerEric Wong <e@80x24.org>
Wed, 30 Aug 2023 05:27:35 +0000 (05:27 +0000)
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

index 4571676b8b94bbb1fd8cc6cbd423d63a46aa51a8..a22dda1e26318d824108c0c5a58b2366b4f5ddc8 100644 (file)
@@ -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 () {