[MacPorts] #66346: meson @0.58.2 seems to have a flaw with "nm"

MacPorts noreply at macports.org
Thu Dec 1 17:50:40 UTC 2022


#66346: meson @0.58.2 seems to have a flaw with "nm"
------------------------+-----------------------
  Reporter:  ballapete  |      Owner:  (none)
      Type:  defect     |     Status:  new
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:  2.8.0
Resolution:             |   Keywords:  tiger ppc
      Port:  meson      |
------------------------+-----------------------

Comment (by ballapete):

 There is an easy patch available:

 {{{
 --- mesonbuild/scripts/symbolextractor.py~      1970-01-01
 01:00:00.000000000 +0100
 +++ mesonbuild/scripts/symbolextractor.py       2022-12-01
 18:32:05.000000000 +0100
 @@ -146,8 +146,7 @@
              break
      result = [arr[match + 2], arr[match + 5]] # Libreoffice stores all 5
 lines but the others seem irrelevant.
      # Get a list of all symbols exported
 -    output = call_tool('nm', ['--extern-only', '--defined-only',
 -                              '--format=posix', libfilename])
 +    output = call_tool('nm', ['-a', '-U', '-P', libfilename])
      if not output:
          dummy_syms(outfilename)
          return
 }}}

 Comparing the output of `llvm-nm` as an example of a modern version of
 `nm` with that of old standard `nm` I get on the command line:

 {{{

 /opt/local/lib/libcharset.1.dylib(single module):
 00000000 U ____mb_cur_max_l
 U ____mb_cur_max_l
 00000b9c t ___initialize_Cplusplus
 00000b9c t ___initialize_Cplusplus
 00000b7c t __dyld_func_lookup
 00000b7c t __dyld_func_lookup
 00000000 T __mh_dylib_header
 00000000 t __mh_dylib_header
 00000da6 s _alias_table
 00000da6 s _alias_table
 00000ce4 T _libcharset_set_relocation_prefix
 00000ce4 T _libcharset_set_relocation_prefix
 00000bf8 T _locale_charset
 00000bf8 T _locale_charset
 00000000 U _nl_langinfo
 U _nl_langinfo
 00000000 U _strcmp
 U _strcmp
 00000000 U _uselocale
 U _uselocale
 00000b74 t cfm_stub_binding_helper
 00000b74 t cfm_stub_binding_helper
 0000101c s dyld__mach_header
 0000101c d dyld__mach_header
 00000b44 t dyld_stub_binding_helper
 00000b44 t dyld_stub_binding_helper

 pete 256 /\ llvm-nm --defined-only /opt/local/lib/libcharset.1.dylib
 pete 257 /\ nm -U /opt/local/lib/libcharset.1.dylib

 /opt/local/lib/libcharset.1.dylib(single module):
 00000b9c t ___initialize_Cplusplus
 00000b9c t ___initialize_Cplusplus
 00000b7c t __dyld_func_lookup
 00000b7c t __dyld_func_lookup
 00000000 T __mh_dylib_header
 00000000 t __mh_dylib_header
 00000da6 s _alias_table
 00000da6 s _alias_table
 00000ce4 T _libcharset_set_relocation_prefix
 00000ce4 T _libcharset_set_relocation_prefix
 00000bf8 T _locale_charset
 00000bf8 T _locale_charset
 00000b74 t cfm_stub_binding_helper
 00000b74 t cfm_stub_binding_helper
 0000101c s dyld__mach_header
 0000101c d dyld__mach_header
 00000b44 t dyld_stub_binding_helper
 00000b44 t dyld_stub_binding_helper

 pete 258 /\ llvm-nm --format=posix /opt/local/lib/libcharset.1.dylib
 pete 259 /\ nm -P /opt/local/lib/libcharset.1.dylib

 /opt/local/lib/libcharset.1.dylib(single module):
 ____mb_cur_max_l U 00000000
 ____mb_cur_max_l U 0 0
 ___initialize_Cplusplus t 00000b9c
 ___initialize_Cplusplus t b9c 0
 __dyld_func_lookup t 00000b7c
 __dyld_func_lookup t b7c 0
 __mh_dylib_header T 00000000
 __mh_dylib_header t 0 0
 _alias_table s 00000da6
 _alias_table s da6 0
 _libcharset_set_relocation_prefix T 00000ce4
 _libcharset_set_relocation_prefix T ce4 0
 _locale_charset T 00000bf8
 _locale_charset T bf8 0
 _nl_langinfo U 00000000
 _nl_langinfo U 0 0
 _strcmp U 00000000
 _strcmp U 0 0
 _uselocale U 00000000
 _uselocale U 0 0
 cfm_stub_binding_helper t 00000b74
 cfm_stub_binding_helper t b74 0
 dyld__mach_header s 0000101c
 dyld__mach_header d 101c 0
 dyld_stub_binding_helper t 00000b44
 dyld_stub_binding_helper t b44 0
 }}}

 I had to insert two empty lines into the output of `llvm-nm` in order to
 get matching lines, because `nm` first outputs an empty line and then the
 path name of the shared library. Alas, to see before an after I tried to
 build `libepoxy` before patching `meson` – and ran into a problem:

 {{{
 Library dl found: YES
 Checking for function "dlvsym" with dependency -ldl: NO
 Run-time dependency appleframeworks found: NO (tried framework)

 test/meson.build:164:2: ERROR: Dependency "appleframeworks" not found,
 tried framework
 }}}

 Have to git there a bit…

-- 
Ticket URL: <https://trac.macports.org/ticket/66346#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list