depends: add missing Darwin objcopy #31840

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:missing_darwin_objcopy changing 1 files +1 −0
  1. fanquake commented at 10:56 am on February 11, 2025: member

    Our CMake toolchain for a Darwin cross build currently contains:

    0set(CMAKE_AR "/usr/bin/llvm-ar")
    1set(CMAKE_RANLIB "/usr/bin/llvm-ranlib")
    2set(CMAKE_STRIP "/usr/bin/llvm-strip")
    3set(CMAKE_OBJCOPY "arm64-apple-darwin-objcopy")
    4set(CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
    

    objcopy isn’t currently used for the Darwin build (only for Linux and splitting the debug symbols), but we shouldn’t be producing a toolchain file that refers to nonexistent tools.

  2. depends: add missing Darwin objcopy
    Our CMake toolchain for a Darwin cross build currently contains:
    ```bash
    set(CMAKE_AR "/usr/bin/llvm-ar")
    set(CMAKE_RANLIB "/usr/bin/llvm-ranlib")
    set(CMAKE_STRIP "/usr/bin/llvm-strip")
    set(CMAKE_OBJCOPY "arm64-apple-darwin-objcopy")
    set(CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
    ```
    
    `objcopy` isn't currently used for the Darwin build (only for Linux and
    splitting the debug symbols), but we shouldn't be producing a toolchain
    file that refers to nonexistent tools.
    3edaf0b428
  3. DrahtBot commented at 10:56 am on February 11, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31840.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK laanwj, theuni

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Build system on Feb 11, 2025
  5. fanquake added this to the milestone 29.0 on Feb 12, 2025
  6. fanquake requested review from theuni on Feb 12, 2025
  7. laanwj approved
  8. laanwj commented at 5:30 pm on February 12, 2025: member
    Code review ACK 3edaf0b4286a771520b7e5b0b5064eca713ff0ad
  9. theuni approved
  10. theuni commented at 5:35 pm on February 12, 2025: member
    utACK 3edaf0b4286a771520b7e5b0b5064eca713ff0ad
  11. fanquake merged this on Feb 12, 2025
  12. fanquake closed this on Feb 12, 2025

  13. fanquake deleted the branch on Feb 12, 2025
  14. fanquake referenced this in commit 2434aeab62 on Feb 13, 2025
  15. hebasto commented at 3:15 pm on February 13, 2025: member

    Our CMake toolchain for a Darwin cross build currently contains:

    0set(CMAKE_AR "/usr/bin/llvm-ar")
    1set(CMAKE_RANLIB "/usr/bin/llvm-ranlib")
    2set(CMAKE_STRIP "/usr/bin/llvm-strip")
    3set(CMAKE_OBJCOPY "arm64-apple-darwin-objcopy")
    4set(CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
    

    objcopy isn’t currently used for the Darwin build (only for Linux and splitting the debug symbols), but we shouldn’t be producing a toolchain file that refers to nonexistent tools.

    From CMake’s perspective, the complete toolchain for the Darwin platform additionally includes install_name_tool. It seems reasonable to reconsider 3bee51427a05075150721f0a05ead8f92e1ba019 to avoid the following hack:https://github.com/bitcoin/bitcoin/blob/c242fa5be358150d83c2446896b6f4c45c6365e9/CMakeLists.txt#L62-L66

  16. theuni commented at 5:18 pm on February 13, 2025: member

    @hebasto Agreed as long as it’s trivial. From what I can tell llvm-install-name-tool is just as available as the rest of the tools, so even though it’s annoying because it’s not actually necessary, I don’t see much harm in setting it. @fanquake ?

    This required a similar hack for #30434 as well.

  17. fanquake commented at 5:55 pm on February 13, 2025: member

    even though it’s annoying because it’s not actually necessary, I don’t see much harm in setting it. @fanquake ?

    I’m just not sure of us having to setup/provide tools because CMake thinks they should be available, when we don’t use them. iirc one of the issues with install-name-tool was that it was only available version-suffixed on certain distros (even when the main llvm install was not suffixed), making it hard to find.

    This required a similar hack for #30434 as well.

    This hack is only to work around other Boost/CMake issues right? (CMake wants a tool available to compile libraries just for us to throw those libraries away anyways). I’m not sure redundantly compiling things is a great argument for setting up tools we don’t otherwise need.

    I’m assuming there are likely other tools/programs for various toolchains that CMake might expect in some sense, that we aren’t providing (or using) or ensuring are available?

  18. theuni commented at 6:32 pm on February 13, 2025: member

    even though it’s annoying because it’s not actually necessary, I don’t see much harm in setting it. @fanquake ?

    I’m just not sure of us having to setup/provide tools because CMake thinks they should be available, when we don’t use them. iirc one of the issues with install-name-tool was that it was only available version-suffixed on certain distros (even when the main llvm install was not suffixed), making it hard to find.

    Ah right, I’d forgotten that bit. Blah.

    Yeah, ok, nevermind. I figured there was no harm in adding this if it was trivial, but indeed the missing prefix makes it annoying enough to treat differently.

  19. hebasto commented at 8:53 am on February 14, 2025: member

    iirc one of the issues with install-name-tool was that it was only available version-suffixed on certain distros (even when the main llvm install was not suffixed), making it hard to find.

    If it’s not too much trouble, could you recall which distros those were?

  20. fanquake referenced this in commit 109bfe9573 on Feb 14, 2025
  21. fanquake commented at 1:44 pm on February 14, 2025: member

    If it’s not too much trouble, could you recall which distros those were?

    It’s still the case with Ubuntu, i.e 24.04:

    0# apt install llvm
    1# ls /usr/bin/llvm-* | grep objdump
    2/usr/bin/llvm-objdump
    3/usr/bin/llvm-objdump-18
    4# ls /usr/bin/llvm-* | grep install-name
    5/usr/bin/llvm-install-name-tool-18
    

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-02-22 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me