As reported by @BarrySmith in #1813, cc is still unsetting LD_LIBRARY_PATH and some other variables when it shouldn't:
cc.py:
unset LD_LIBRARY_PATH
unset LD_RUN_PATH
unset DYLD_LIBRARY_PATH
This shouldn't happen because these things are already unset in build_environment.py before the build begins:
# Stuff in here sanitizes the build environemnt to eliminate
# anything the user has set that may interfere.
if not dirty:
# Remove these vars from the environment during build because they
# can affect how some packages find libraries. We want to make
# sure that builds never pull in unintended external dependencies.
env.unset('LD_LIBRARY_PATH')
env.unset('LIBRARY_PATH')
env.unset('CPATH')
env.unset('LD_RUN_PATH')
env.unset('DYLD_LIBRARY_PATH')