Build error on FreeBSD: ‘recompile with -fPIC’ #14616

issue murrayn openend this issue on October 31, 2018
  1. murrayn commented at 8:10 am on October 31, 2018: contributor

    Build on FreeBSD fails with:

    0  CXXLD    bitcoind
    1/usr/bin/ld: libbitcoin_util.a(libbitcoin_util_a-sync.o): relocation R_X86_64_TPOFF32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
    2libbitcoin_util.a: could not read symbols: Bad value
    3c++: error: linker command failed with exit code 1 (use -v to see invocation)
    

    FreeBSD 11.2, but I’ve had it fail on earlier versions as well.

    config.log is here:

    https://0bin.net/paste/epcDXoNlXiwxyYzG#a-072U7z83TRocrB1f7NIQ3U656RVwinqBQMKti9ful

  2. fanquake added the label Linux/Unix on Oct 31, 2018
  3. murrayn commented at 9:10 am on October 31, 2018: contributor
    As a workaround, appending ‘-fPIC’ to HARDENED_LDFLAGS and PIE_FLAGS in both Makefile and src/Makefile worked for me.
  4. MarcoFalke commented at 12:35 pm on April 26, 2020: member

    FreeBSD is supported now.

    Is this still an issue with a recent version of Bitcoin Core? If yes, what are the steps to reproduce?

  5. MarcoFalke closed this on Apr 26, 2020

  6. murrayn commented at 5:02 am on April 27, 2020: contributor

    Yes, it is still an issue (FreeBSD 11.3). To reproduce, just the usual:

    0$ ./autogen.sh
    1$ ./configure [...]
    2$ gmake check
    
  7. fanquake reopened this on Apr 27, 2020

  8. MarcoFalke commented at 11:49 am on April 27, 2020: member

    FreeBSD 12.1 works just fine:

    https://cirrus-ci.com/task/6384853019000832

  9. MarcoFalke commented at 4:03 pm on April 28, 2020: member
    I also remember that this used to work on freeBSD 11.3. Are you sure this is not a local issue? Is the failure reproducible on a fresh machine?
  10. fanquake commented at 2:44 am on April 29, 2020: member
    FWIW I don’t see any issues when building master with Clang 8 inside a FreeBSD 11.3 VM (vagrant). @murrayn can you provide any more info?
  11. murrayn commented at 4:35 am on April 29, 2020: contributor
    @fanquake Interesting. I just built on a new FreeBSD 12.1 VM with no issues as well.
  12. murrayn closed this on Apr 29, 2020

  13. MarcoFalke locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me