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
gcc9: add patches required for target musl #101189
gcc9: add patches required for target musl #101189
Conversation
also ping @domenkozar @dtzWill @shlevy and @rasendubi (based on https://github.com/NixOS/rfcs/blob/master/rfcs/0023-musl-libc.md#responsibility) |
Result of 2 packages marked as broken and skipped:
2 packages blacklisted:
3 packages failed to build:
55 packages built:
|
LGTM from inspection, build-testing a bit presently. We may wish to bump to 1.2.1 while we're rebuilding musl things... :). |
Does gcc10 (or versions before 9) need any of these patches, is that known? :) |
Thanks for the review @dtzWill . I don't see gcc 10 in https://github.com/richfelker/musl-cross-make/tree/master/patches, so I would assume no. For that particular problem I was investigating the patch I needed was already upstream in gcc 10 for example. Good point about bumping to 1.2.1, I might try that in the project I'm experimenting with. |
0f522ed
to
f6d6c6b
Compare
@dtzWill I bumped musl version in the last commit, tested that |
1.2.1 update may be better tackled separately? It's not widely adopted in musl-based distros "yet" AFAICT... Alpine used it with patches, and just past few days bumped to git and calling for a 1.2.2 on the mailing list[1]. Which makes me think perhaps we should wait until that settles a bit? :) |
@dtzWill Right, that's certainly more safe. I'll revert the bump in that case. |
These patches are taken from: https://github.com/richfelker/musl-cross-make/tree/master/patches/gcc-9.2.0 and based on a recommendation from the musl maintainers as these patches are deemed critical for gcc9/musl to work correctly. This started with an obscure bug I had while investigating the following program which was getting unexpectedly aborted instead of catching the exception: ``` \#include <boost/thread.hpp> \#include <iostream> \#include <thread> struct Foo {}; void foo() { try { std::cout << "entered thread" << std::endl; throw Foo(); } catch (...) { } } void bar() { try { foo(); } catch (...) { } } int main() { std::thread _bar(bar); boost::thread _foo(foo); _bar.join(); _foo.join(); std::cout << "should ignore exception" << std::endl; return 0; } ``` Thanks to nsz and dalias in #musl freenode channel they traced down the issue to be linked to a missing patch (0014-fix-gthr-weak-refs-for-libgcc.patch in this case) which was needed. They also recommended adding the following patches that I added as those are all critical. I think these patches aren't really musl specific and could be applied all the time, in fact 0014-fix-gthr-weak-refs-for-libgcc.patch is already upstream in GCC 10 but I'm not sure if we should do that.
f6d6c6b
to
40c9af9
Compare
@dtzWill Anything remaining that I should take care of? |
@dtzWill do you know who should hit the merge button for this? |
There doesn't seem to be any interest for merging this for over a month now so closing the PR. |
These patches are taken from:
https://github.com/richfelker/musl-cross-make/tree/master/patches/gcc-9.2.0
and based on a recommendation from the musl maintainers as these patches
are deemed critical for gcc9/musl to work correctly.
This started with an obscure bug I had while investigating the following
program which was getting unexpectedly aborted instead of catching the
exception:
Thanks to nsz and dalias in #musl freenode channel they traced down the
issue to be linked to a missing patch (0014-fix-gthr-weak-refs-for-libgcc.patch
in this case) which was needed. They also recommended adding the following
patches that I added as those are all critical.
I think these patches aren't really musl specific and could be applied
all the time, in fact 0014-fix-gthr-weak-refs-for-libgcc.patch is
already upstream in GCC 10 but I'm not sure if we should do that.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)