-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linker log spam when building on Mac #52411
Comments
I'm told that this is a hard-coded path in clang, and the fix is to just create an empty directory in /usr/lib/local. Not sure if this warrants an update to https://github.com/dart-lang/sdk/wiki/Building or not? FYI @mraleph |
Hey I want contribute , if it is not resolved yet kindly reply me ASAP. |
@eseidel I can't reproduce this. What XCode version are you using? Can you delete one of the binaries (e.g. |
on 86c1825 It only reproduces if you don't have
|
Just rming the binary doesn't repro:
|
This repo'd:
|
But doing the same with
|
@eseidel can you also run |
Repro:
|
Ooops, I do actually have I have looked at the LLVM source code and I am puzzled why this error happens. There was a time when it would trigger such a warning but it seems to be have been fixed by llvm/llvm-project@ebac710 which is a three year old commit. Confusing stuff. Could you try applying the following patch and reproducing again: diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index 48b6bb03163..3c7478494cc 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -180,7 +180,7 @@ template("mac_toolchain") {
stripped_outfile = "{{root_out_dir}}/exe.stripped/$exename"
}
- command = "$ld $sysroot_flags $toolchain_flags {{ldflags}} -Xlinker -rpath -Xlinker @executable_path/Frameworks -o $outfile -Wl,-filelist,$rspfile {{solibs}} {{libs}} {{frameworks}}"
+ command = "$ld -v $sysroot_flags $toolchain_flags {{ldflags}} -Xlinker -rpath -Xlinker @executable_path/Frameworks -o $outfile -Wl,-filelist,$rspfile {{solibs}} {{libs}} {{frameworks}}"
if (defined(invoker.strip)) {
strip = invoker.strip
strip_command = "${strip} -x -o $stripped_outfile $outfile" We should see which linker is invoked and all command line arguments. |
Here's one:
|
@eseidel ah-ha. There is an explicit |
Yes, that's from a clean checkout of 86c1825 |
I (unfortunately) have |
__CFBundleIdentifier=com.apple.Terminal
TMPDIR=/var/folders/fv/fqqmfjqd6zvdqrbrv78gt4m80000gn/T/
XPC_FLAGS=0x0
TERM=xterm-256color
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.bUuXRRtE2f/Listeners
XPC_SERVICE_NAME=0
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=447
TERM_SESSION_ID=49D4DF57-2072-44D3-8A46-96A02E3EE8D1
SHELL=/bin/zsh
HOME=/Users/eseidel
LOGNAME=eseidel
USER=eseidel
PATH=/Users/eseidel/.docker/bin:/Users/eseidel/.shorebird/bin:/Users/eseidel/.pub-cache/bin:/Users/eseidel/Library/Android/sdk/platform-tools:/Users/eseidel/Documents/google-cloud-sdk/bin:/Users/eseidel/Documents/GitHub/upstream_flutter/bin:/Users/eseidel/Documents/GitHub/depot_tools:/Users/eseidel/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/eseidel/.cargo/bin
SHLVL=1
PWD=/Users/eseidel/Documents/GitHub/dart-sdk/sdk
OLDPWD=/Users/eseidel/Documents/GitHub/dart-sdk
HOMEBREW_PREFIX=/opt/homebrew
HOMEBREW_CELLAR=/opt/homebrew/Cellar
HOMEBREW_REPOSITORY=/opt/homebrew
MANPATH=/opt/homebrew/share/man::
INFOPATH=/opt/homebrew/share/info:
CLICOLOR=1
ANDROID_HOME=/Users/eseidel/Library/Android/sdk
NDK_HOME=/Users/eseidel/Library/Android/sdk/ndk/25.2.9519653
NVM_DIR=/Users/eseidel/.nvm
NVM_CD_FLAGS=-q
NVM_RC_VERSION=
LANG=en_US.UTF-8
_=/usr/bin/env |
I couldn't take the spam and created the directory again. 🤣 |
I think I have to give up for now, because I can't reproduce it and cursory reading of clang sources does not reveal anything that would explain where it got injected from. There is something specific to your system that makes this happen - |
@eseidel just out of curiosity (because the problem does not seem to reproduce when you run |
|
Thanks for looking! |
@eseidel I am out of ideas really. One last try. Could you run the following bash script from the SDK root and post the output? #!/bin/bash
set -ex
pushd xcodebuild/ReleaseARM64
../../buildtools/mac-arm64/clang/bin/clang++ -v -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -mmacosx-version-min=10.14 -rdynamic -arch arm64 -fPIE -nostdlib++ ../../buildtools/mac-arm64/clang/bin/../lib/libc++.a -Wl,-dead_strip -Wl,-search_paths_first -L. -undefined dynamic_lookup -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./dart -ldl -lpthread -framework CoreFoundation -framework Security -framework Foundation -framework CoreServices
python3 <<EOF
import subprocess
import os
process = subprocess.Popen(
'../../buildtools/mac-arm64/clang/bin/clang++ -v -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -mmacosx-version-min=10.14 -rdynamic -arch arm64 -fPIE -nostdlib++ ../../buildtools/mac-arm64/clang/bin/../lib/libc++.a -Wl,-dead_strip -Wl,-search_paths_first -L. -undefined dynamic_lookup -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/../../.. -Wl,-pie -Xlinker -rpath -Xlinker @executable_path/Frameworks -o ./dart -ldl -lpthread -framework CoreFoundation -framework Security -framework Foundation -framework CoreServices'.split(' '), stdin=None)
process.wait()
print(os.environ)
EOF
popd |
|
@eseidel okay, we are getting there. It seems that your Python environment is somehow extended to contain Now I can also see the difference between your and my setup: my setup is using
Okay, a bit more searching around and I found: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4149962 and corresponding https://openradar.appspot.com/radar?id=5608755232243712 from @nico I will just apply the same workaround in our |
Thanks! |
I'm on 85d09eb.
I haven't yet figured out where the flag is coming from, but I will and plan to post a patch to fix if someone doesn't beat me to it.
The text was updated successfully, but these errors were encountered: