homebrew-core icon indicating copy to clipboard operation
homebrew-core copied to clipboard

hfsutils is missing symbols on arm64_monterey

Open goshhhy opened this issue 1 year ago • 0 comments

brew gist-logs <formula> link OR brew config AND brew doctor output

linear@kurai ~ % brew config
HOMEBREW_VERSION: 3.5.8
ORIGIN: https://github.com/Homebrew/brew
HEAD: ff9c2500195cc357d4a06f99d462f8d8a5d37892
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a986115b641b03f8cc7f3a8d7299b59a7030336b
Core tap last commit: 5 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.8 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 13.1.6 build 1316
Git: 2.35.1 => /opt/homebrew/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.5-arm64
CLT: 13.4.0.0.1.1651278267
Xcode: N/A
Rosetta 2: false
linear@kurai ~ % brew doctor
Your system is ready to brew.
linear@kurai ~ %

Verification

  • [X] I ran brew update and am still able to reproduce my issue.
  • [X] I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

i am trying to build software that uses libhfs from hfsutils to manipulate hfs images, because i would like to use that software.

What happened (include all command output)?

i installed hfsutils from homebrew, and then attempted to build Retro68, which depends on libhfs from hfsutils. however, it failed to link:

Consolidate compiler generated dependencies of target LaunchAPPL
[ 92%] Building CXX object LaunchAPPL/Client/CMakeFiles/LaunchAPPL.dir/MiniVMac.cc.o
/Users/linear/code/Retro68/LaunchAPPL/Client/MiniVMac.cc:37:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
typedef struct
              ^
               AliasData
/Users/linear/code/Retro68/LaunchAPPL/Client/MiniVMac.cc:40:24: note: type is not C-compatible due to this default member initializer
    char userType[4] = {0, 0, 0, 0};        /* for application use, can be zeros */
                       ^~~~~~~~~~~~
/Users/linear/code/Retro68/LaunchAPPL/Client/MiniVMac.cc:64:3: note: type is given name 'AliasData' for linkage purposes by this typedef declaration
} AliasData;
  ^
1 warning generated.
[ 92%] Linking CXX executable LaunchAPPL
Undefined symbols for architecture arm64:
  "_hfs_vsetattr", referenced from:
      MiniVMacLauncher::MiniVMacLauncher(boost::program_options::variables_map&) in MiniVMac.cc.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [LaunchAPPL/Client/CMakeFiles/LaunchAPPL.dir/build.make:314: LaunchAPPL/Client/LaunchAPPL] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:598: LaunchAPPL/Client/CMakeFiles/LaunchAPPL.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
linear@kurai retro68-build %

using objdump to search for this symbol in libhfs, it does not appear to be present:

linear@kurai ~ % objdump --syms /opt/homebrew/lib/libhfs.a | grep vsetattr
linear@kurai ~ %

i also attempted building by source using brew install -s hfsutils, but received the same output from objdump and the Retro68 build.

i have previously built this project on Big Sur without encountering this issue, implying that the problem did not exist at that time, but this would have been in late 2020. EDIT: it looks like when i did successfully build this, it was likely using a vendored version, not the one from homebrew.

at least one other user is also having this problem, and originally filed an issue on Retro68's repository, believing the issue to be there, as autc04/Retro68#139.

What did you expect to happen?

i expected hfsutils to have all of the symbols that it is supposed to, including _hfs_vsetattr, as it does if i build it locally myself:

linear@kurai hfsutils-3.2.6 % objdump --syms libhfs/libhfs.a | grep vsetattr
000000000000065c g     F __TEXT,__text _hfs_vsetattr
linear@kurai hfsutils-3.2.6 %

Step-by-step reproduction instructions (by running brew commands)

on an Arm Mac with macOS Monterey, install hfsutils using brew:

brew install hfsutils

then attempt to locate the symbol hfs_vsetattr in it, either using objdump or by building a binary that uses that symbol:

objdump --syms /opt/homebrew/lib/libhfs.a | grep vsetattr

goshhhy avatar Aug 08 '22 04:08 goshhhy