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

libpfm: enable static build #69483

Merged
merged 1 commit into from Sep 26, 2019
Merged

Conversation

nmattia
Copy link
Contributor

@nmattia nmattia commented Sep 26, 2019

Motivation for this change

The pkgsStatic build on Linux fails with the following:

$ nix-build pkgsStatic.libpfm
...
/nix/store/gkq6rh8nj8i7prh4c9rawhwrk5g20cfx-x86_64-unknown-linux-musl-binutils-2.31.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/c2yk9q5j6h15rvw83ry99df8lzak0bkx-gcc-debug-8.3.0-x86_64-unknown-linux-musl-stage-final/lib/gcc/x86_64-unknown-linux-musl/8.3.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/nix/store/gkq6rh8nj8i7prh4c9rawhwrk5g20cfx-x86_64-unknown-linux-musl-binutils-2.31.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/c2yk9q5j6h15rvw83ry99df8lzak0bkx-gcc-debug-8.3.0-x86_64-unknown-linux-musl-stage-final/lib/gcc/x86_64-unknown-linux-musl/8.3.0/crtend.o: relocation R_X86_64_32 against `.ctors' can not be used when making a shared object; recompile with -fPIC
/nix/store/gkq6rh8nj8i7prh4c9rawhwrk5g20cfx-x86_64-unknown-linux-musl-binutils-2.31.1/bin/x86_64-unknown-linux-musl-ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:380: libpfm.so.4.10.1] Error 1
make[1]: Leaving directory '/build/libpfm-4.10.1/lib'
make: *** [Makefile:49: all] Error 2
builder for '/nix/store/378h35wdwnmxkkkzbjv86m0jcdnh61rw-libpfm-4.10.1-x86_64-unknown-linux-musl.drv' failed with exit code 2
error: build of '/nix/store/378h35wdwnmxkkkzbjv86m0jcdnh61rw-libpfm-4.10.1-x86_64-unknown-linux-musl.drv' on 'ssh://nicolas@zrh-3' failed: builder for '/nix/store/378h35wdwnmxkkkzbjv86m0jcdnh61rw-libpfm-4.10.1-x86_64-unknown-linux-musl.drv' failed with exit code 2
builder for '/nix/store/378h35wdwnmxkkkzbjv86m0jcdnh61rw-libpfm-4.10.1-x86_64-unknown-linux-musl.drv' failed with exit code 1
error: build of '/nix/store/378h35wdwnmxkkkzbjv86m0jcdnh61rw-libpfm-4.10.1-x86_64-unknown-linux-musl.drv' failed

By specifying CONFIG_PFMLIB_SHARED=n we disable the shared libraries.

Things done
  • 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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @nbp

@basvandijk
Copy link
Member

@GrahamcOfBorg build pkgsStatic.libpfm

@basvandijk
Copy link
Member

@GrahamcOfBorg build libpfm

@nmattia
Copy link
Contributor Author

nmattia commented Sep 26, 2019

@basvandijk I've s/enableStatic/enableShared/, it makes more sense since the actual option in the Makefile is about enabling shared libs.

@basvandijk basvandijk merged commit 4c5cad9 into NixOS:master Sep 26, 2019
@nmattia nmattia deleted the nm-libpfm-static branch September 26, 2019 11:03
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