-
Notifications
You must be signed in to change notification settings - Fork 7
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
Possible regression between 12.1-r1 and 12.2-r0 on Intel #5
Comments
Could it be related to e5b0693 ? |
hmm .. that looks possibly like we had a bug in 12.1.. I need to take a look at 12.1 and 12.2 libraries and see what's happened. |
I think libstdc++ already had dependencies on emuTLS (e.g. for the |
FAOD - are you saying that this is not seen on Arm64? (that seems quite unexpected, since there's nothing arch-specific here AFAIU .. unless it's a difference in dyld behaviour). |
Looking at the Homebrew bottles for 12.1, I see:
So they look the same. But we're seeing the issue only on Intel, and not ARM. I have yet to figure out why. The binaries for abyss have:
so they have a clear difference between Intel and ARM. No sure how that came out to be, since they were rebuilt at the same time, using the same GCC. Weird… Further edit: OK another difference is that the ARM binary for abyss is not linking to libgcc_s, for some reason:
|
there's a bunch of stuff to take in here.
having said that, the specs that handle this are in arch-independent code, which implies that the difference is in the way that ld64 is dealing with the weak symbols maybe (was the Xcode toolset version the same in both cases?) humph .. what this is telling me is that I don't even know where the problem lies .. but I do know (at least expect) that the same process is applied to all archs so differences in this could be explained by differences in tools or configuration. |
there is a clear difference between 12.1Dr1 and 12.2Dr0 libstdc++ where the former appears to be (I would have said incorrectly) re-exporting edit: I will have to look at the changes to libstdc++ between the two revisions; I have not (intentionally) made any change to the runtimes in 12.2 other than eliminating the build-time run paths... so either a merge error or some upstream change would seem likely .. OTOH the 12.2 output seems correct to me .. libstdc++ has no business re-exporting symbols from libgcc_.... edit 2: And I cannot be sure that the same version of ld64 was used to build both libraries, there's been Xcode updates in the interval .. sigh, some rebuilding might be needed. |
This release fixed a bug in the handling of lib tool options - and effects the cases that we are using embedded runpaths (macOS 10.11+) - the same fix also fixed the handling of 'nodefaultexport' which was intended to suppress the export of emulated TLS symbols when a shared libgcc is in use. So the bug fix does change the exports. So the long explanation is this: When we are on macOS 10.11+ and we cannot use a shared libgcc_s (because of the DYLD_LIBRARY… shenanigans) we incorporate a weak version of the emulated tls code in each shared object that needs it. Those weak versions must be exported - so that dyld can choose just one instance at load time. When we have @rpaths, we no longer have this constraint - since we can now build and use a shared libgcc_s … and it is not necessary for other shared objects to each have a (wasted) copy of the emutls code. The intent was that (under the second circumstance) there would be no exported emutls symbols from any other shared object than libgcc_s …. but, as noted above, the libtool invocations were buggy and we have been unintentionally re-exporting those symbols. Now, I think that everything should still work in the case that we have a mixture of uses of shared libgcc_s and hard-linked emulated TLS code, since the instances are all still weak - thus dyld should resolve just one at load time (most likely to the libgcc_s one, but that can depend on the order in which DSOs are loaded). So .. probably the simplest way forward is to revert the part of the lib tool fix that fixes ’nodefaultexports’ at least on 12.x .. we can think about whether this is a problem enough to bump the SO version for libstdc++ in gcc-13. |
Not related to this issue (I can open a separate one if merited), but, speaking of
This doesn't seem to be the case for the other libraries, for example:
|
Have you any evidence of a problem? (the exe must already have an rpath for the directory that contains libgcc_s.1.dylib to have found it, I wonder if we need a duplicate. OTOH, I have no problem to add |
hmmm actually in my build there is
So I wonder what's happening there. |
I can now confirm that the 12.2-pre-r1 fixes the issues previously reported for |
We ran into one when building GCC 12 for Homebrew, but it's also a product of the interaction between an application that does linkage a bit unconventionally and some post-build packaging we do at Homebrew. More specifically, we did have one application (Julia) that still tried to go looking for
Details here: Homebrew/homebrew-core#106755 (comment). I did try to add
So, that's actually not the case for us, because of the post-build packaging that I mentioned above, which involves rewriting install names to absolute paths. So you could end up linking to But given that your build seems to have it, this may just be a packaging issue for Homebrew. |
I will double-check with the 12.2r1 changes, but now I think more about this, ISTR that this was fixed between 12.1r0 and 12.1r1 .. feel free to open an new Issue (we've already clouded this one enough) .. |
No need; this seems to not be there anymore in 12.2-r0, which is good enough for us. Thanks! (Apologies; I should've checked our build of that first before making noise here.) |
Testing of 12.2-pre-r1 has concluded, and we shipped it in Homebrew (Homebrew/homebrew-core#108516). We have not seen any other issue. |
this is fixed, but I will leave the report open until the 12.2 release is actually made. |
While testing 12.2-r0 at Homebrew (Homebrew/homebrew-core#108516), we are seeing the same failure on two different packages, specifically on Intel macOS (10.15, 11 and 12, so it's pretty consistent).
We take a binary (
abyss-rresolver-short
) compiled and linked against GCC 12.1-r1 and run it with the libraries from GCC 12.2-r0, and we get:I'll dig into more later, try to see what symbols are present in the two versions, but I'm putting this here in the meantime, in case it rings a bell.
The text was updated successfully, but these errors were encountered: