From ecf89d56702ac8c33b0ee07e9438e454740b20be Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 31 Oct 2019 23:40:54 +0100 Subject: [PATCH] build: use --whole-archive for pthread with --fully-static This resolves a crash during the build of Node.js when built with `./configure --fully-static`. Fixes: https://github.com/nodejs/node/issues/30180 --- configure.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index 959c1db6518fdb..4739517f48cdab 100755 --- a/configure.py +++ b/configure.py @@ -1267,7 +1267,9 @@ def configure_static(o): return if options.fully_static: - o['libraries'] += ['-static'] + o['libraries'] += [ + '-static', '-Wl,--whole-archive', '-lpthread', '-Wl,--no-whole-archive' + ] elif options.partly_static: o['libraries'] += ['-static-libgcc', '-static-libstdc++'] if options.enable_asan: