-
Notifications
You must be signed in to change notification settings - Fork 36.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
build: call AC_PATH_TOOL for dsymutil in macOS cross-compile #19565
Conversation
While testing bitcoin#19530 I noticed that we couldn't call dsymutil after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-otool`.
Code review ACK ef3d4ce |
Nice find. Though I don't understand the interaction with lto or #19530 ? Because I'm not sure what's calling it, I'm not sure if we should be concerned about others missing as well. From my libtool:
Should we add one for nmedit as well? I know we don't need lipo. |
The interaction is that at least when building a dylib, and using LTO, LLVM adds some actions to the compiler runtime which invoke make -C depends/ -j6 HOST=x86_64-apple-darwin16
./autogen.sh
./configure --prefix=/bitcoin/depends/x86_64-apple-darwin16 --with-gui=no --disable-wallet --disable-tests --disable-bench --with-utils=no --with-daemon=no --with-libs=yes
make -j8
...
make[3]: Leaving directory '/bitcoin/src/secp256k1'
CXXLD libbitcoinconsensus.la
../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found
make[2]: Leaving directory '/bitcoin/src' With this patch, When building #19530 + your patch + this PR and ./autogen.sh
./configure --prefix=/bitcoin/depends/x86_64-apple-darwin16 --with-gui=no --disable-wallet --disable-tests --disable-bench --with-utils=no --with-daemon=no --with-libs=yes --enable-debug
make -j8 V=1
...
libtool: link: /bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil .libs/libbitcoinconsensus.0.dylib || :
warning: (x86_64) /tmp/lto.o unable to open object file: No such file or directory
<snip>
warning: (x86_64) /tmp/lto.o unable to open object file: No such file or directory
warning: no debug symbols in executable (-arch x86_64)
libtool: link: (cd ".libs" && rm -f "libbitcoinconsensus.dylib" && ln -s "libbitcoinconsensus.0.dylib" "libbitcoinconsensus.dylib") The solution seemed to be to pass ./autogen.sh
./configure --prefix=/bitcoin/depends/x86_64-apple-darwin16 --with-gui=no --disable-wallet --disable-tests --disable-bench --with-utils=no --with-daemon=no --with-libs=yes --enable-debug LDFLAGS="-Wl,-object_path_lto /temp_dir"
make -j8
...
llvm-dwarfdump-7 src/.libs/libbitcoinconsensus.0.dylib.dSYM
src/.libs/libbitcoinconsensus.0.dylib.dSYM/Contents/Resources/DWARF/libbitcoinconsensus.0.dylib: file format Mach-O 64-bit x86-64
.debug_info contents:
0x00000000: Compile Unit: length = 0x0000036c version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x00000370)
0x0000000b: DW_TAG_compile_unit
DW_AT_producer ("clang version 8.0.0 (tags/RELEASE_800/final)")
DW_AT_language (DW_LANG_C_plus_plus)
DW_AT_name ("support/cleanse.cpp")
DW_AT_stmt_list (0x00000000)
DW_AT_comp_dir ("/bitcoin/src")
DW_AT_GNU_pubnames (true)
DW_AT_APPLE_optimized (true)
DW_AT_low_pc (0x0000000000000fc0)
DW_AT_high_pc (0x0000000000000ff8)
0x0000002a: DW_TAG_namespace
DW_AT_name ("std")
0x0000002f: DW_TAG_namespace
DW_AT_name ("__1")
DW_AT_export_symbols (true)
0x00000034: DW_TAG_imported_declaration
DW_AT_decl_file ("/bitcoin/depends/SDKs/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers/usr/include/c++/v1/cstring")
DW_AT_decl_line (69)
DW_AT_import (0x00000000000000d7)
<snip>
0x00000620: DW_TAG_const_type
DW_AT_type (0x00000000000005d9 "AES_state")
0x00000625: DW_TAG_subprogram
DW_AT_linkage_name ("_ZL17KeySetupTransformP9AES_statePKS_")
DW_AT_name ("KeySetupTransform")
DW_AT_decl_file ("/bitcoin/src/./crypto/ctaes/ctaes.c")
DW_AT_decl_line (378)
DW_AT_APPLE_optimized (true)
DW_AT_inline (DW_INL_inlined) There's at least one mention of LTO and dsymutil in the Darwin Driver that would suggest that we shouldn't have to pass this through explicitly? Although maybe something isn't hooked up correctly:
In any case that is discussion for the #19530. I'll make sure I dig around in LLVM some more.
I haven't seen any obvious calls / usage of |
This is some good digging! I think this change looks good, but I'd like to understand fully as I think we may want to upstream some clang/libtool fixes here.
I don't understand how this patch actually helps From what I can tell, clang should find the correct Rather, it looks like libtool itself is calling it directly:
Could you paste the relevant part of your generated libtool? |
Ok, managed to find it in my local libtool. Not sure how I missed it last time I grepped:
So, yes, this is coming from libtool and not from clang (though it's not clear if it's actually needed anymore, since clang seems to call it as necessary). Which means libtool needs to know the path. ACK ef3d4ce. Also, as far as I can tell, clang should manage to find dsymutil just fine. I am also seeing these with debugging on:
This one looks like a real clang bug, let's discuss it in #19530. |
…ross-compile ef3d4ce build: call AC_PATH_TOOL for dsymutil in macOS cross-compile (fanquake) Pull request description: While testing bitcoin#19530 I noticed that we couldn't call [`dsymutil`](https://www.llvm.org/docs/CommandGuide/dsymutil.html) after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil`. ACKs for top commit: laanwj: Code review ACK ef3d4ce theuni: ACK ef3d4ce. Tree-SHA512: e4fa93e7f9f7945289143dfe2a6645ad8ee7f3bee0793412b3509901a30566d6f952e3b39e0e525a54f8dbd0c480f8da70fc6cb80b07800d11b0c6071fbb7466
…ross-compile ef3d4ce build: call AC_PATH_TOOL for dsymutil in macOS cross-compile (fanquake) Pull request description: While testing bitcoin#19530 I noticed that we couldn't call [`dsymutil`](https://www.llvm.org/docs/CommandGuide/dsymutil.html) after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil`. ACKs for top commit: laanwj: Code review ACK ef3d4ce theuni: ACK ef3d4ce. Tree-SHA512: e4fa93e7f9f7945289143dfe2a6645ad8ee7f3bee0793412b3509901a30566d6f952e3b39e0e525a54f8dbd0c480f8da70fc6cb80b07800d11b0c6071fbb7466
…ross-compile ef3d4ce build: call AC_PATH_TOOL for dsymutil in macOS cross-compile (fanquake) Pull request description: While testing bitcoin#19530 I noticed that we couldn't call [`dsymutil`](https://www.llvm.org/docs/CommandGuide/dsymutil.html) after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil`. ACKs for top commit: laanwj: Code review ACK ef3d4ce theuni: ACK ef3d4ce. Tree-SHA512: e4fa93e7f9f7945289143dfe2a6645ad8ee7f3bee0793412b3509901a30566d6f952e3b39e0e525a54f8dbd0c480f8da70fc6cb80b07800d11b0c6071fbb7466
…ross-compile ef3d4ce build: call AC_PATH_TOOL for dsymutil in macOS cross-compile (fanquake) Pull request description: While testing bitcoin#19530 I noticed that we couldn't call [`dsymutil`](https://www.llvm.org/docs/CommandGuide/dsymutil.html) after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil`. ACKs for top commit: laanwj: Code review ACK ef3d4ce theuni: ACK ef3d4ce. Tree-SHA512: e4fa93e7f9f7945289143dfe2a6645ad8ee7f3bee0793412b3509901a30566d6f952e3b39e0e525a54f8dbd0c480f8da70fc6cb80b07800d11b0c6071fbb7466
…ross-compile ef3d4ce build: call AC_PATH_TOOL for dsymutil in macOS cross-compile (fanquake) Pull request description: While testing bitcoin#19530 I noticed that we couldn't call [`dsymutil`](https://www.llvm.org/docs/CommandGuide/dsymutil.html) after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil`. ACKs for top commit: laanwj: Code review ACK ef3d4ce theuni: ACK ef3d4ce. Tree-SHA512: e4fa93e7f9f7945289143dfe2a6645ad8ee7f3bee0793412b3509901a30566d6f952e3b39e0e525a54f8dbd0c480f8da70fc6cb80b07800d11b0c6071fbb7466
…ross-compile ef3d4ce build: call AC_PATH_TOOL for dsymutil in macOS cross-compile (fanquake) Pull request description: While testing bitcoin#19530 I noticed that we couldn't call [`dsymutil`](https://www.llvm.org/docs/CommandGuide/dsymutil.html) after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil`. ACKs for top commit: laanwj: Code review ACK ef3d4ce theuni: ACK ef3d4ce. Tree-SHA512: e4fa93e7f9f7945289143dfe2a6645ad8ee7f3bee0793412b3509901a30566d6f952e3b39e0e525a54f8dbd0c480f8da70fc6cb80b07800d11b0c6071fbb7466
…ross-compile ef3d4ce build: call AC_PATH_TOOL for dsymutil in macOS cross-compile (fanquake) Pull request description: While testing bitcoin#19530 I noticed that we couldn't call [`dsymutil`](https://www.llvm.org/docs/CommandGuide/dsymutil.html) after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil`. ACKs for top commit: laanwj: Code review ACK ef3d4ce theuni: ACK ef3d4ce. Tree-SHA512: e4fa93e7f9f7945289143dfe2a6645ad8ee7f3bee0793412b3509901a30566d6f952e3b39e0e525a54f8dbd0c480f8da70fc6cb80b07800d11b0c6071fbb7466
…ross-compile ef3d4ce build: call AC_PATH_TOOL for dsymutil in macOS cross-compile (fanquake) Pull request description: While testing bitcoin#19530 I noticed that we couldn't call [`dsymutil`](https://www.llvm.org/docs/CommandGuide/dsymutil.html) after LTO: ```bash ../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found ``` This updates configure to call `AC_PATH_TOOL` so that we end up with the full path to dsymutil, similar to `otool` and `install_name_tool`, ie: `/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil`. ACKs for top commit: laanwj: Code review ACK ef3d4ce theuni: ACK ef3d4ce. Tree-SHA512: e4fa93e7f9f7945289143dfe2a6645ad8ee7f3bee0793412b3509901a30566d6f952e3b39e0e525a54f8dbd0c480f8da70fc6cb80b07800d11b0c6071fbb7466
While testing #19530 I noticed that we couldn't call
dsymutil
after LTO:../libtool: line 10643: x86_64-apple-darwin16-dsymutil: command not found
This updates configure to call
AC_PATH_TOOL
so that we end up with thefull path to dsymutil, similar to
otool
andinstall_name_tool
, ie:/bitcoin/depends/x86_64-apple-darwin16/share/../native/bin/x86_64-apple-darwin16-dsymutil
.