From: Eric Wong Date: Wed, 30 Aug 2023 05:10:43 +0000 (+0000) Subject: xap_helper.h: don't compress debug sections on OpenBSD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b78cd406ff28d8c25081dd81072c362c001bad5b;p=thirdparty%2Fpublic-inbox.git xap_helper.h: don't compress debug sections on OpenBSD 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. --- diff --git a/lib/PublicInbox/XapHelperCxx.pm b/lib/PublicInbox/XapHelperCxx.pm index 4571676b8..a22dda1e2 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 () {