Skip to content
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

gcc*: fix libgomp (OpenMP) to work w/musl, don't build DSO using initial-exec #47309

Merged
merged 4 commits into from Sep 25, 2018

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Sep 25, 2018

See commits for details and links.

When testing this[1] it fixed enabling OpenMP support in openblas and
in particular fixed Cython which was failing tests due to dlopen'ing borked libgomp.so

[1] on top of (minor) updates to cython/openblas/numpy not yet merged in our tree,
but I believe in PR's already

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Only apply w/musl since while it's wrong everywhere it apparently
hasn't broken things entirely w/glibc so keep things as they were.

Patch regenerated from original so that it applies
which isn't saying much since it's simple :).

Source:

https://patchwork.ozlabs.org/patch/154298/

IRC chat on #musl with Rich and others endorses this,
at least at the conceptual level of no shared library
should be using initial-exec TLS.

Fixes various uses of libgomp that previously crashed (before 1.1.20)
or encounter errors (post-1.1.20), such as pythonPackages.cython .
@dtzWill
Copy link
Member Author

dtzWill commented Sep 25, 2018

cc @nh2 -- this should fix the Cython problem you encountered over on nh2/static-haskell-nix#6 (comment) . If it doesn't then one of the minor updates is needed first, but I'll have the answer to that in a few minutes-- cython tests take a long time :3.

@dtzWill
Copy link
Member Author

dtzWill commented Sep 25, 2018

Update: yep cython "still" works with these fixes--as it should :).

If you use allvm.cachix.org, path is: /nix/store/48m09z9lqhhiamx1l33gg2fmxl7cq3lm-python2.7-Cython-0.28.3 --which is what you should get building 'pkgsMusl.pythonPackages.cython' with this PR :).

Anyway hopefully will be on a proper nixpkgs branch soon!

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: gcc, gcc7, openblas

Partial log (click to expand)

  /nix/store/6jalg1y82lmircxvg159q616fl2qsqdm-gcc-7.3.0
  /nix/store/lg3s38557262fsifkzbxyf1vp883nj15-openblas-0.3.1
  /nix/store/qidjv1minlnixkgxp61919id2hb71s4b-gcc-wrapper-7.3.0
copying path '/nix/store/lg3s38557262fsifkzbxyf1vp883nj15-openblas-0.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/50hnnx8f3zn7v7r6c5p37872j2bijhzw-gcc-7.3.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/6jalg1y82lmircxvg159q616fl2qsqdm-gcc-7.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/qidjv1minlnixkgxp61919id2hb71s4b-gcc-wrapper-7.3.0' from 'https://cache.nixos.org'...
/nix/store/qidjv1minlnixkgxp61919id2hb71s4b-gcc-wrapper-7.3.0
/nix/store/qidjv1minlnixkgxp61919id2hb71s4b-gcc-wrapper-7.3.0
/nix/store/lg3s38557262fsifkzbxyf1vp883nj15-openblas-0.3.1

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: gcc, gcc7, openblas

Partial log (click to expand)

copying path '/nix/store/649jspwx2vbv7zl2gf7w654hr0lfmn2z-expand-response-params' from 'https://cache.nixos.org'...
copying path '/nix/store/g3czn3wlv3xgs8icrm1mb0g9j7c1iarc-gcc-7.3.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/r9m5bbm22j1hccw8yz5hfh7m5s9nnmfi-gfortran-7.3.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/wcqyrcgk7ws3q2a6pj7zn4m6x1l5fyvp-isl-0.17.1' from 'https://cache.nixos.org'...
copying path '/nix/store/8s60cvic2p87szj16bmz7mz1b5wdagi7-gcc-7.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/667hvf0gvh6lidqvmml1ixz1svlq0i8f-openblas-0.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/9ha4n70sl6112j4wfpbimdi9xwncglwh-gcc-wrapper-7.3.0' from 'https://cache.nixos.org'...
/nix/store/083ahg0c6xfksdwz9ga292gjczb0sj77-gcc-wrapper-7.3.0
/nix/store/9ha4n70sl6112j4wfpbimdi9xwncglwh-gcc-wrapper-7.3.0
/nix/store/667hvf0gvh6lidqvmml1ixz1svlq0i8f-openblas-0.3.1

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gcc, gcc7, openblas

Partial log (click to expand)

  /nix/store/qgilx8bpva0d3jg99g53kr9swhjady8y-gcc-7.3.0
  /nix/store/z1f5fla70bjgmfp9pnzqp72lbzhsn3vl-gcc-7.3.0-lib
copying path '/nix/store/z1f5fla70bjgmfp9pnzqp72lbzhsn3vl-gcc-7.3.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/h8ws6vmvyga884x0m5vfdqrzmqa7wrb1-isl-0.17.1' from 'https://cache.nixos.org'...
copying path '/nix/store/8vmhlylgzm7074k0m0rpash0xy5c27wa-openblas-0.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/qgilx8bpva0d3jg99g53kr9swhjady8y-gcc-7.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/1py0m9bhz4jkszlffqbnksqdw1rf64d5-gcc-wrapper-7.3.0' from 'https://cache.nixos.org'...
/nix/store/lzh9rcw3rjvbaj7n3z4nzsvcz85k2p2m-gcc-wrapper-7.3.0
/nix/store/1py0m9bhz4jkszlffqbnksqdw1rf64d5-gcc-wrapper-7.3.0
/nix/store/8vmhlylgzm7074k0m0rpash0xy5c27wa-openblas-0.3.1

@dtzWill
Copy link
Member Author

dtzWill commented Sep 25, 2018

Post-merge review/comments welcome as always! :)

@dtzWill dtzWill merged commit 93b30a8 into NixOS:master Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants