@@ -277,15 +277,6 @@ export UNAME=`uname | sed 's/CYGWIN.*/CYGWIN/' `
277277# Mac OS X-specific setup
278278if [ " $UNAME " = " Darwin" ]; then
279279 export MACOSX_VERSION=` uname -r | awk -F. ' {print $1}' `
280- # Try to identify command-line tools version.
281- # See https://apple.stackexchange.com/q/180957/351985.
282- XCLT_VERSION=` pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | awk ' /version: / { print $NF }' | cut -d. -f-1`
283- # If this didn't produce an integer, set to 0.
284- case $XCLT_VERSION in
285- ' ' |* [!0-9]* ) export XCLT_VERSION=0 ;; # bad
286- * ) : ;; # good
287- esac
288- export XCLT_VERSION
289280 # Work around problems on recent OS X crashing with an error message
290281 # "... may have been in progress in another thread when fork() was called"
291282 # when objective-C functions are called after fork(). See Issue #25921.
@@ -383,7 +374,10 @@ if [ -n "$PYTHONHOME" ]; then
383374fi
384375
385376if [ -n " $SAGE_LOCAL " ]; then
386- if [ " $UNAME " = " Darwin" ] && [ " $XCLT_VERSION " -ge 15 ]; then
377+ # On OS X, test whether "ld-classic" is present in the installed
378+ # version of the command-line tools. If so, we add "-ld_classic"
379+ # to LD_FLAGS. See #36599.
380+ if [ " $UNAME " = " Darwin" ] && [ -x " $( xcode-select -p) /usr/bin/ld-classic" ] ; then
387381 LDFLAGS=" -L$SAGE_LOCAL /lib -Wl,-ld_classic,-rpath,$SAGE_LOCAL /lib $LDFLAGS "
388382 else
389383 LDFLAGS=" -L$SAGE_LOCAL /lib -Wl,-rpath,$SAGE_LOCAL /lib $LDFLAGS "
0 commit comments