updated biber can't compile

Bruno Voisin bvoisin at icloud.com
Sat Mar 23 18:25:32 CET 2024


> Tom Kacvinsky wrote:
> 
> The messages below indicate that the symbol _iconv can’t be find by the Perl module LibXML. I am not sure if this is a system Perl issue or if it’s an issue with a module distributed by TeXLive. If is the former, it should just work. If the latter, looks like like the Perl module is coming from a Perl that does not work with macOS 14.4, which was just released recently.

This seems to be a mismatch between libiconv and libxml in the ARM part of the biber binary (which is a bundle packed with PAR::Packer).

First, the build process of biber on ARM Macs has changed between versions 2.20 and 2.19. See dist/darwin_arm64/build.sh: for 2.20 the libraries are linked from a Homebrew install

  --link=/opt/homebrew/Cellar/libiconv/1.17/lib/libiconv.2.dylib \

while with 2.19 they were linked from a MacPorts install

  --link=/opt/local/lib/libiconv.2.dylib \

With Intel macs, the libraries are still taken from MacPorts in version 2.20.

However, the problem goes deeper than that. When Intel code is used, all's well:

% arch -x86_64 biber --version       
biber version: 2.20

The Intel content of biber is unpacked to /var/folders/1r/dhdtft1s4qgfjwbcpkfhqf5c0000gn/T/par-6272756e6f766f6973696e/cache-f809780b7a27eda9549a1b7c41c590810ec8f465/, where for libiconv

% otool -L libiconv.2.dylib
libiconv.2.dylib:
/opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)

% dsymutil -s libiconv.2.dylib | grep -E "iconv"
Symbol table for: 'libiconv.2.dylib' (x86_64)
[   346] 00001884 1e (PEXT SECT    ) 01     0000   0000000000016b96 '_libiconv_relocate'
[   347] 00001897 1e (PEXT SECT    ) 01     0000   0000000000016c68 '_libiconv_relocate2'
[  1080] 00000002 0f (     SECT EXT) 0c     0000   00000000000f67d0 '__libiconv_version'
[  1081] 00000015 0f (     SECT EXT) 01     0000   0000000000003666 '_iconv_canonicalize'
[  1082] 00000029 0f (     SECT EXT) 01     0000   0000000000002e8e '_libiconv'
[  1083] 00000033 0f (     SECT EXT) 01     0000   0000000000002eb0 '_libiconv_close'
[  1084] 00000043 0f (     SECT EXT) 01     0000   0000000000001b78 '_libiconv_open'
[  1085] 00000052 0f (     SECT EXT) 01     0000   0000000000002ebd '_libiconv_open_into'
[  1086] 00000066 0f (     SECT EXT) 01     0000   0000000000016add '_libiconv_set_relocation_prefix'
[  1087] 00000086 0f (     SECT EXT) 01     0000   0000000000003378 '_libiconvctl'
[  1088] 00000093 0f (     SECT EXT) 01     0000   0000000000003474 '_libiconvlist'

and for libxml

% otool -L libxml2.2.dylib                                                                                                           
libxml2.2.dylib:
/opt/local/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.9.0)
/opt/local/lib/libicui18n.58.dylib (compatibility version 58.0.0, current version 58.2.0)
/opt/local/lib/libicuuc.58.dylib (compatibility version 58.0.0, current version 58.2.0)
/opt/local/lib/libicudata.58.dylib (compatibility version 58.0.0, current version 58.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/opt/local/lib/liblzma.5.dylib (compatibility version 8.0.0, current version 8.4.0)
/opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.0.0)

% dsymutil -s libxml2.2.dylib | grep -E "iconv"
[  3009] 000095c9 01 (     UNDF EXT) 00     0700   0000000000000000 '_libiconv'
[  3010] 000095d3 01 (     UNDF EXT) 00     0700   0000000000000000 '_libiconv_close'
[  3011] 000095e3 01 (     UNDF EXT) 00     0700   0000000000000000 '_libiconv_open'

The same /opt/local/lib/libiconv.2.dylib has been used for both, and the symbols match, _libiconv*.

Using ARM code, mayhem begins:

% biber --version
Can't load '/var/folders/1r/dhdtft1s4qgfjwbcpkfhqf5c0000gn/T/par-6272756e6f766f6973696e/cache-351a9b4d1739a271ecf0be692d0ec1ef0a81d258/inc/lib/auto/XML/LibXML/LibXML.bundle' for module XML::LibXML: dlopen(/var/folders/1r/dhdtft1s4qgfjwbcpkfhqf5c0000gn/T/par-6272756e6f766f6973696e/cache-351a9b4d1739a271ecf0be692d0ec1ef0a81d258/inc/lib/auto/XML/LibXML/LibXML.bundle, 0x0001): Symbol not found: _iconv
  Referenced from: <4FABCE36-0023-3D1B-A158-3499EFD82412> /private/var/folders/1r/dhdtft1s4qgfjwbcpkfhqf5c0000gn/T/par-6272756e6f766f6973696e/cache-351a9b4d1739a271ecf0be692d0ec1ef0a81d258/libxml2.2.dylib
  Expected in:     <E05EA2EB-4F11-36B6-87E5-41C89C1BCC5D> /private/var/folders/1r/dhdtft1s4qgfjwbcpkfhqf5c0000gn/T/par-6272756e6f766f6973696e/cache-351a9b4d1739a271ecf0be692d0ec1ef0a81d258/libiconv.2.dylib at /loader/HASH(0x14008e308)/DynaLoader.pm line 210.
 at /loader/HASH(0x140108e98)/PAR/Heavy.pm line 104.
[...]

The ARM content of biber has been unpacked to /var/folders/1r/dhdtft1s4qgfjwbcpkfhqf5c0000gn/T/par-6272756e6f766f6973696e/cache-351a9b4d1739a271ecf0be692d0ec1ef0a81d258, where for libiconv

% otool -L libiconv.2.dylib
libiconv.2.dylib:
/opt/homebrew/opt/libiconv/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)

% dsymutil -s libiconv.2.dylib | grep -E "iconv"
Symbol table for: 'libiconv.2.dylib' (arm64)
[   455] 0000207d 1e (PEXT SECT    ) 01     0000   000000000001b170 '_libiconv_relocate'
[   456] 00002090 1e (PEXT SECT    ) 01     0000   000000000001b250 '_libiconv_relocate2'
[  1322] 00000002 0f (     SECT EXT) 0a     0000   0000000000108020 '__libiconv_version'
[  1323] 00000015 0f (     SECT EXT) 01     0000   00000000000051ac '_iconv_canonicalize'
[  1324] 00000029 0f (     SECT EXT) 01     0000   00000000000049a4 '_libiconv'
[  1325] 00000033 0f (     SECT EXT) 01     0000   00000000000049c8 '_libiconv_close'
[  1326] 00000043 0f (     SECT EXT) 01     0000   0000000000003858 '_libiconv_open'
[  1327] 00000052 0f (     SECT EXT) 01     0000   00000000000049e0 '_libiconv_open_into'
[  1328] 00000066 0f (     SECT EXT) 01     0000   000000000001b0b0 '_libiconv_set_relocation_prefix'
[  1329] 00000086 0f (     SECT EXT) 01     0000   0000000000004df8 '_libiconvctl'
[  1330] 00000093 0f (     SECT EXT) 01     0000   0000000000004f2c '_libiconvlist'

and for libxml

% otool -L libxml2.2.dylib
libxml2.2.dylib:
/opt/homebrew/opt/libxml2/lib/libxml2.2.dylib (compatibility version 15.0.0, current version 15.6.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
/opt/homebrew/opt/icu4c/lib/libicui18n.74.dylib (compatibility version 74.0.0, current version 74.2.0)
/opt/homebrew/opt/icu4c/lib/libicuuc.74.dylib (compatibility version 74.0.0, current version 74.2.0)
/opt/homebrew/opt/icu4c/lib/libicudata.74.dylib (compatibility version 74.0.0, current version 74.2.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)

% dsymutil -s libxml2.2.dylib | grep -E "iconv"
[  2894] 0000884d 01 (     UNDF EXT) 00     0500   0000000000000000 '_iconv'
[  2895] 00008854 01 (     UNDF EXT) 00     0500   0000000000000000 '_iconv_close'
[  2896] 00008861 01 (     UNDF EXT) 00     0500   0000000000000000 '_iconv_open'

libiconv has been built with /opt/homebrew/opt/libiconv/lib/libiconv.2.dylib and defines _libiconv*, while libxml has been built with /usr/lib/libiconv.2.dylib and defines _iconv*.

Bruno Voisin


PS For completeness: that's probably irrelevant here, but there's no actual /usr/lib/libiconv.2.dylib on recent macOS, the library is in the dynamic linker shared cache and what's used when building binaries is the stub at

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libiconv.2.tbd

containing

--- !tapi-tbd
tbd-version:     4
targets:         [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 
                   arm64e-macos, arm64e-maccatalyst ]
install-name:    '/usr/lib/libiconv.2.dylib'
current-version: 7
compatibility-version: 7
reexported-libraries:
  - targets:         [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 
                       arm64e-macos, arm64e-maccatalyst ]
    libraries:       [ '/usr/lib/libcharset.1.dylib' ]
exports:
  - targets:         [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, 
                       arm64e-macos, arm64e-maccatalyst ]
    symbols:         [ ___bsd___iconv, ___bsd___iconv_free_list, ___bsd___iconv_get_list, 
                       ___bsd_iconv, ___bsd_iconv_canonicalize, ___bsd_iconv_close, 
                       ___bsd_iconv_open, ___bsd_iconv_open_into, ___bsd_iconv_set_relocation_prefix, 
                       ___bsd_iconvctl, ___bsd_iconvlist, ___iconv, ___iconv_free_list, 
                       ___iconv_get_list, __citrus_NONE_stdenc_ops, __citrus_NONE_stdenc_traits, 
                       __citrus_bcs_convert_to_lower, __citrus_bcs_convert_to_upper, 
                       __citrus_bcs_skip_nonws, __citrus_bcs_skip_nonws_len, __citrus_bcs_skip_ws, 
                       __citrus_bcs_skip_ws_len, __citrus_bcs_strcasecmp, __citrus_bcs_strncasecmp, 
                       __citrus_bcs_strtol, __citrus_bcs_strtoul, __citrus_bcs_trunc_rws_len, 
                       __citrus_csmapper_open, __citrus_db_close, __citrus_db_factory_add, 
                       __citrus_db_factory_add16_by_string, __citrus_db_factory_add32_by_string, 
                       __citrus_db_factory_add8_by_string, __citrus_db_factory_add_by_string, 
                       __citrus_db_factory_add_string_by_string, __citrus_db_factory_calc_size, 
                       __citrus_db_factory_create, __citrus_db_factory_free, __citrus_db_factory_serialize, 
                       __citrus_db_get_entry, __citrus_db_get_number_of_entries, 
                       __citrus_db_hash_std, __citrus_db_lookup, __citrus_db_lookup16_by_string, 
                       __citrus_db_lookup32_by_string, __citrus_db_lookup8_by_string, 
                       __citrus_db_lookup_by_string, __citrus_db_lookup_string_by_string, 
                       __citrus_db_open, __citrus_esdb_alias, __citrus_esdb_close, 
                       __citrus_esdb_free_list, __citrus_esdb_get_list, __citrus_esdb_open, 
                       __citrus_find_getops, __citrus_iconv_canonicalize, __citrus_iconv_close, 
                       __citrus_iconv_open, __citrus_load_module, __citrus_lookup_factory_convert, 
                       __citrus_lookup_get_number_of_entries, __citrus_lookup_seq_close, 
                       __citrus_lookup_seq_lookup, __citrus_lookup_seq_next, __citrus_lookup_seq_open, 
                       __citrus_lookup_seq_rewind, __citrus_lookup_simple, __citrus_map_file, 
                       __citrus_mapper_close, __citrus_mapper_create_area, __citrus_mapper_open, 
                       __citrus_mapper_open_direct, __citrus_mapper_set_persistent, 
                       __citrus_memory_stream_chr, __citrus_memory_stream_getln, 
                       __citrus_memory_stream_matchline, __citrus_memory_stream_skip_ws, 
                       __citrus_pivot_factory_convert, __citrus_prop_parse_variable, 
                       __citrus_stdenc_close, __citrus_stdenc_default, __citrus_stdenc_open, 
                       __citrus_unload_module, __citrus_unmap_file, __libiconv_version, 
                       __string_hash_func, _iconv, _iconv_canonicalize, _iconv_close, 
                       _iconv_open, _iconv_open_into, _iconvctl, _iconvlist, _libiconv_set_relocation_prefix ]

See

https://developer.apple.com/forums/thread/655588?answerId=665804022#665804022
https://developer.apple.com/forums/thread/715385




More information about the tex-live mailing list.