-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[macOS+macports+cmake] tcmalloc does not link on aarch64: Undefined symbols: _tc_delete_aligned
etc.
#1460
Comments
Identically fails with LLVM Clang 17.0.5. |
I need more details. You're using cmake? What is exact incantation you use ? (BTW you are aware that cmake support is deeply experimental and mostly 'use at your own risk'?) It compiles fine on my osx testing box (m1 macbook air). |
@alk I will generate logs and share now. (With and without our patches.) It is great that you got MBA M1: building via Macports should be reproducible and fast, if you have Sonoma installed. (Ventura will have pre-built ports, but I have no Ventura installation to check gperftools 2.13 build there at the moment.) |
@alk So here are logs from trying to build 2.13 on Sonoma/aarch64 (same hardware with yours), with and without patches from my PR (but of those only ARM recognition is relevant, PowerPC stuff is inconsequential here, obviously): This commit updates the portfile: barracuda156/macports-ports-powerpc@171894f (it does not build for me atm on Sonoma, as described, so cannot be committed into Macports yet).
|
Undefined symbols: _tc_delete_aligned
etc.Undefined symbols: _tc_delete_aligned
etc.
I submitted your proposed changes. Thanks. As for this specific ticket, I don't promise much attention. This seems specific to osx+cmake and perhaps plus whatever ports stuff you use. On my osx test box cmake nearly builds (there is one odd thing about weak functions that affects malloc_bench only; and somehow only happens with whatever flags or something cmake build does on osex). So your failures, I'd strongly prefer you investigate more yourself. Can we somehow separate those failures from ports stuff ? Also please be aware of #1462 And finally, I don't approve that ports thingy choosing cmake build. We do have known issues there. And for example plenty of tests fail. If you can affect it somehow, please make it stop doing cmake stuff. Or perhaps I should consider just amputating our "best but in practice not so good effort" cmake support? |
@alk I will try building via auto tools and if that succeeds, try to figure out why CMake build fails. |
Ah btw if you intend to debug more of cmake stuff, here is malloc_bench patch that "fix" building with cmake on my osx test box:
I can simply merge it as is, but on the other hand, it would disable one feature even on autotools build where this at least compiles without trouble without patch. So perhaps we investigate some before doing more ifdefs mess. |
@alk I will return to this in a couple of days, but as a quick update, the problem does not appear related to macOS version, arch or compiler. Here is the failure from 10.6 PowerPC with gcc13:
|
@alk Sorry for a delay, much stuff in the pipeline. I can confirm that at least on macOS 14.2.1 |
While it still fails on the same OS with CMake: |
Thanks for update. Perhaps then consider running those same steps manually (check if some of your patches affect stuff; probably not, but who knows). I'd also compare more closely compiler flags. |
@alk For sure patches have nothing to do with this. I reran the build, dropping all our patches, and it still failed with CMake the same way: |
Consider checking what symbols are in debugallocation.cc and tcmalloc.cc where it fails to locate functions. Something like this:
(No idea if osx has objdump but I think it should) |
@alk Looks like CMake build adds |
No idea. If so why it only breaks it on your system ? |
Given that it is reproducible on two completely different systems (different OS versions, different archs, different compilers, different linkers, different standard library), I do not think it is anything related to a particular system. It could be that Macports CMake is doing something which causes the breakage or otherwise something in the source, or something with choice of options. Let me try two things:
|
@alk So I am sure it is something on the side of CMake build implementation. But it is partly fixed in the master (but broken in 2.13). Specifically, with tests and benchmarks disabled the build is successful from the master branch 8987d08 With default setting build fails but on:
|
Ah, I thought I merged workaround for this. Apple's stuff seemingly has borked weak symbols support. Just replace |
I can also confirm that without tests/benchmarks master branch builds on PowerPC as well with CMake. |
Something was broken after 2.10 here:
The text was updated successfully, but these errors were encountered: