From ea3318ae2e298c9dfeba1b4a796c01af7ddf59f0 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 18 Nov 2017 16:51:59 +0100 Subject: [PATCH] Don't rely on man for ld feature detection --- nix/build-all.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nix/build-all.py b/nix/build-all.py index 0e00c36add..104188a834 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -405,7 +405,8 @@ try: LDFLAGS=os.environ["LDFLAGS"] except KeyError: LDFLAGS="" -if sp.call([bash, "-c", "man ld 2> /dev/null | grep gc-sections &> /dev/null"]) == 0: + +if sp.call([bash, "-c", "ld --gc-sections 2>&1 | grep unrecognized &> /dev/null"]) != 0: CXXFLAGS_MINIMAL="%s -fPIC %s" % (CXXFLAGS, str.join(" ", ADDITIONAL_ARGS)) os.environ["CXXFLAGS_MINIMAL"]=CXXFLAGS_MINIMAL CFLAGS_MINIMAL="%s -fPIC %s" % (CFLAGS, str.join(" ", ADDITIONAL_ARGS))