Skip to content

Commit d70aae0

Browse files
author
Matthias Koeppe
committed
src/bin/sage-env: Do not set the ld-classic flag when LD is set
1 parent 4bdc404 commit d70aae0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bin/sage-env

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fi
127127
# The compilers are set in order of priority by
128128
# 1) environment variables
129129
# 2) compiler installed by sage
130-
# 3) compiler set at configuration time
130+
# 3) compiler set at configuration time
131131
if [ -z "$CC" ]; then
132132
if [ -n "$SAGE_LOCAL" -a -x "$SAGE_LOCAL/bin/gcc" ]; then
133133
CC=gcc
@@ -378,7 +378,9 @@ if [ -n "$SAGE_LOCAL" ]; then
378378
# gives "/Applications/Xcode.app/Contents/Developer", but "ld-classic"
379379
# is not in the subdirectory "usr/bin/" but rather in the subdirectory
380380
# "Toolchains/XcodeDefault.xctoolchain/usr/bin/". See #37237.
381-
if [ "$UNAME" = "Darwin" ] && [ -x "$(xcode-select -p)/usr/bin/ld-classic" -o -x "$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-classic" ] ; then
381+
# However, if LD is set explicitly, as it is within conda on macOS,
382+
# do not not do this.
383+
if [ "$UNAME" = "Darwin" ] && [ -z "$LD" ] && [ -x "$(xcode-select -p)/usr/bin/ld-classic" -o -x "$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-classic" ] ; then
382384
LDFLAGS="-L$SAGE_LOCAL/lib -Wl,-ld_classic,-rpath,$SAGE_LOCAL/lib $LDFLAGS"
383385
else
384386
LDFLAGS="-L$SAGE_LOCAL/lib -Wl,-rpath,$SAGE_LOCAL/lib $LDFLAGS"

0 commit comments

Comments
 (0)