From 1547c0dbef4d9cd52774767363ab543bbdb692b2 Mon Sep 17 00:00:00 2001 From: Sayed Adel Date: Wed, 6 May 2020 20:39:22 +0200 Subject: [PATCH] Fix stripping binaries from debugging symbols --- env_vars.sh | 12 +++++++++++- env_vars_32.sh | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/env_vars.sh b/env_vars.sh index 6087ab3..31e0dc3 100644 --- a/env_vars.sh +++ b/env_vars.sh @@ -1,5 +1,15 @@ +#!/usr/bin/env bash # Environment variables for build OPENBLAS_VERSION="v0.3.7" MACOSX_DEPLOYMENT_TARGET=10.9 CFLAGS="-std=c99 -fno-strict-aliasing" -LDFLAGS="-Wl,--strip-debug" +# Macos's linker doesn't support stripping symbols +if [ "$(uname)" != "Darwin" ]; then + LDFLAGS="-Wl,--strip-debug" + # make sure that LDFLAGS is exposed to child processes, + # since current version of manybuild only export CFLAGS, CPPFLAGS and FFLAGS + export LDFLAGS="$LDFLAGS" + # override the default stripping flags, since we only override CFLAGS and + # the current version of manybuild pass "-strip-all" to CPPFLAGS and FFLAGS + STRIP_FLAGS="" +fi diff --git a/env_vars_32.sh b/env_vars_32.sh index 291a43d..72f3009 100644 --- a/env_vars_32.sh +++ b/env_vars_32.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Environment variables for 32-bit build. # The important difference from the 64-bit build is `-msse2` to # compile sse loops for ufuncs. @@ -7,4 +8,13 @@ MACOSX_DEPLOYMENT_TARGET=10.9 # Causes failure for pre-1.19 in np.reciprocal # CFLAGS="-msse2 -std=c99 -fno-strict-aliasing" CFLAGS="-std=c99 -fno-strict-aliasing" -LDFLAGS="-Wl,--strip-debug" +# Macos's linker doesn't support stripping symbols +if [ "$(uname)" != "Darwin" ]; then + LDFLAGS="-Wl,--strip-debug" + # make sure that LDFLAGS is exposed to child processes, + # since current version of manybuild only export CFLAGS, CPPFLAGS and FFLAGS + export LDFLAGS="$LDFLAGS" + # override the default stripping flags, since we only override CFLAGS and + # the current version of manybuild pass "-strip-all" to CPPFLAGS and FFLAGS + STRIP_FLAGS="" +fi