Replies: 8 comments
-
See meson/mesonbuild/scripts/symbolextractor.py Lines 135 to 154 in 9074ad9 If it's possible to detect both cases that would be nice. |
Beta Was this translation helpful? Give feedback.
-
First answer: Mac OS X 10.4, Tiger, has old nm, Mac OS X 10.5, Leopard, certainly as well (exact data in a few days). MacOS High Sierra, Version 10.13 or Darwin 17, and macOS Monterey, Version 12 or Darwin 21, use the modern nm. I'll try to find out more. Another option would be to prepare a patch that on the oldish OS versions meson invokes nm with -g – Display only global (external) symbols – or -U – Don't display undefined symbols –. I am using the MacPorts package manager, and the mentioned patch could just stay there and meson untouched? Another option could be to check whether llvm-nm exists (in /opt/local/libexec/llvm-*/bin, I think the sym-link /opt/local/bin/llvm-nm is also usually provided). This tool might be already standard for the MacPorts users that have installed Clang and llvm. The latter "port" provides llvm-nm since Tiger. -- Pete |
Beta Was this translation helpful? Give feedback.
-
This patch should work:
nm first outputs an empty line and then the pathname of the library. I therefore added two empty lines in the output of llvm-nm to easier compare the two outputs:
BTW, the original file's date is incorrectly extracted by the programme MacPorts uses for this task. Actually this fault happens only with Python related archives… (that are not packed by gtar?) |
Beta Was this translation helpful? Give feedback.
-
The patch works on PPC Mac OS X 10.4.11, Tiger, for meson 0.58.2. I could build dav1d. Before I saw a complaint about nm, after it was gone. I found that on macOS High Sierra, Version 10.13 or Darwin 17, and macOS Monterey, Version 12 or Darwin 21, /usr/bin/nm understands both, -a and --extern-only. So -a/-U/-P could be used on all Macs? -- Pete |
Beta Was this translation helpful? Give feedback.
-
On PPC Mac OS X 10.5.8, Leopard, or Darwin 9, /usr/bin/nm understands only the BSD syntax (and it actually has a bug, -U is not accepted, although documented as working accordingly to Tiger's nm). llvm-nm from MacPorts works here, and also an own nm-classic which is provided by cctools. And, as the name suggests, understands only short BSD syntax. For ease of use a symbolic link /opt/local/bin/nm is created that points to /opt/local/bin/nm-classic. llvm-nm is provided by llvm-3.4 on both, Tiger and Leopard. This is the latest llvm version that built on PowerPC hardware. The build process seems to need Python 2.7, an outdated package. llvm does not seem to play a role on both Tiger and Leopard anymore, its job is performed by GCC 7, an effort is going on to bring GCC 12 to these very old Macs. |
Beta Was this translation helpful? Give feedback.
-
I patched meson 0.63.3 on macOS Monterey, Version 12.6, and macOS High Sierra, Version 10.13.6. On both Macs dav1d 1.0.0 and libepoxy 1.5.0 built without making nm complain. |
Beta Was this translation helpful? Give feedback.
-
2024, OS X 10.10.5 here with XCode 7.2. No idea what version |
Beta Was this translation helpful? Give feedback.
-
I have opened a PR to change to the one-character form: #13336. The discussion above is largely consistent, except for |
Beta Was this translation helpful? Give feedback.
-
Hello!
On old Mac OS X systems Leopard (10.5.8) and Tiger (10.4.11) the nm command seems to have a different syntax than on more recent versions. When building for example libepoxy meson (0.58.2 is recorded in the log) complains:
How can I make meson show which nm command it is invoking? Where in its source code are the arguments for nm written down?
--
Pete
Beta Was this translation helpful? Give feedback.
All reactions