From abde2515c64816e7233d138c3f00e59213cb980e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Apr 2023 13:25:23 +0200 Subject: Adjust build to match build system driver better --- bpkg/buildfile | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/bpkg/buildfile b/bpkg/buildfile index 19fd4dc..0ba60dc 100644 --- a/bpkg/buildfile +++ b/bpkg/buildfile @@ -131,10 +131,34 @@ switch $cxx.class if ($cxx.id == 'msvc' && $cxx.version.major == 19 && $cxx.version.minor < 10) cxx.coptions += /wd4503 -# Make sure backtrace includes function names. +# Similar option to the build system driver. # -if ($cxx.target.class == 'linux') - cxx.loptions += -rdynamic +switch $cxx.target.class +{ + case 'linux' + { + # Make sure backtrace includes function names. + # + if ($cc.stdlib == 'glibc') + cxx.loptions += -rdynamic + + # Make sure we use RPATH and not RUNPATH since the latter messes up + # dlopen(). + # + cxx.loptions += -Wl,--disable-new-dtags + } + case 'windows' + { + # Adjust stack size (affects all threads). + # + # 8M 4M + stack_size = ($cxx.target.cpu == "x86_64" ? 8388608 : 4194304) + + cxx.loptions += ($cxx.target.system == 'win32-msvc' \ + ? "/STACK:$stack_size" \ + : "-Wl,--stack,$stack_size") + } +} # Generated options parser. # -- cgit v1.1