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/GFortran compiled without fPIC #23025

Closed
mboisson opened this issue Feb 20, 2017 · 2 comments
Closed

GCC/GFortran compiled without fPIC #23025

mboisson opened this issue Feb 20, 2017 · 2 comments

Comments

@mboisson
Copy link

mboisson commented Feb 20, 2017

Issue description

I compiled gfortran 5.4 (the reciped from branch 16.09). When I then try to compile something with -fPIC, I get errors such as:

/cvmfs/soft.computecanada.ca/nix/store/c8bdsjsazkvdiz59sjb2g471kjmg70a7-binutils-2.27/bin/ld: /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-5.4.0/lib64/libgfortran.a(list_read.o): relocation R_X86_64_32S against `.rodata.eat_separator' can not be used when making a shared object; recompile with -fPIC
/cvmfs/soft.computecanada.ca/nix/store/c8bdsjsazkvdiz59sjb2g471kjmg70a7-binutils-2.27/bin/ld: /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-5.4.0/lib64/libgfortran.a(open.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/cvmfs/soft.computecanada.ca/nix/store/c8bdsjsazkvdiz59sjb2g471kjmg70a7-binutils-2.27/bin/ld: /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-5.4.0/lib64/libgfortran.a(read.o): relocation R_X86_64_32S against `.rodata.masks.8847' can not be used when making a shared object; recompile with -fPIC
/cvmfs/soft.computecanada.ca/nix/store/c8bdsjsazkvdiz59sjb2g471kjmg70a7-binutils-2.27/bin/ld: /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-5.4.0/lib64/libquadmath.a(quadmath-printf.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/cvmfs/soft.computecanada.ca/nix/store/c8bdsjsazkvdiz59sjb2g471kjmg70a7-binutils-2.27/bin/ld: /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-5.4.0/lib64/libquadmath.a(printf_fphex.o): relocation R_X86_64_32 against `.rodata.str4.4' can not be used when making a shared object; recompile with -fPIC
/cvmfs/soft.computecanada.ca/nix/store/c8bdsjsazkvdiz59sjb2g471kjmg70a7-binutils-2.27/bin/ld: /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-5.4.0/lib64/libquadmath.a(printf_fp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/cvmfs/soft.computecanada.ca/nix/store/c8bdsjsazkvdiz59sjb2g471kjmg70a7-binutils-2.27/bin/ld: /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-5.4.0/lib64/libgfortran.a(error.o): relocation R_X86_64_PC32 against symbol `strlen@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

Any reason why it is not compiled with fPIC, and any way to recompile it with fPIC ?

Technical details

  • System: (NixOS: nixos-version, Ubuntu/Fedora: lsb_release -a, ...)
[mboisson@build-node GCC]$ lsb_release -a
LSB Version:    n/a
Distributor ID: CentOS
Description:    CentOS Linux release 7.2.1511 (Core)
Release:        7.2.1511
Codename:       Core
  • Nix version: (run nix-env --version)
    nix-env (Nix) 1.11.4

  • Nixpkgs version: (run nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)
    16.09

@veprbl
Copy link
Member

veprbl commented Feb 24, 2017

Can you add some instructions on how to reproduce this?

@mboisson
Copy link
Author

Turns out this had to do with harderning flags in GCC. Once we disabled the hardening flags, it compiled fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants