Build error on FreeBSD: 'recompile with -fPIC' #14616

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

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    Build on FreeBSD fails with:

      CXXLD    bitcoind
    /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
    libbitcoin_util.a: could not read symbols: Bad value
    c++: error: linker command failed with exit code 1 (use -v to see invocation)
    

    <!--- What behavior did you expect? -->

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

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

    <!-- Any extra information that might be useful in the debugging process. -->

    config.log is here:

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

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  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:

    $ ./autogen.sh
    $ ./configure [...]
    $ 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: 2026-04-28 06:15 UTC

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