Autoconf fixes #2979

pull luke-jr wants to merge 5 commits into bitcoin:master from luke-jr:autoconf changing 10 files +98 −27
  1. luke-jr commented at 9:13 PM on September 7, 2013: member

    No description provided.

  2. wtogami commented at 12:15 AM on September 8, 2013: contributor
  3. wtogami commented at 12:55 AM on September 8, 2013: contributor

    Please also search for lrelease-qt4 and lrelease-qt5 instead of just lrelease.

  4. wtogami commented at 5:46 AM on September 8, 2013: contributor

    "configure: Prefer specific known-good versions of Qt metacompiler tools"

    Please add the -qt5 equivalents after the -qt4. It works for me if I completely remove the qt4 headers and tools. Yes, it needs more work so it isn't confused when both are installed.

  5. luke-jr commented at 5:49 AM on September 8, 2013: member

    @wtogami Qt5 support can be something for a future pull request. As long as it doesn't build correctly (I don't think having to remove Qt4 counts), configure should fail.

  6. Krellan commented at 6:05 AM on September 8, 2013: contributor

    Nice improvements to the configure script! When trying the current master, I found that ./configure --enable-hardening would not build unless I added -fPIC option to CXXFLAGS. Should the configure script be made aware of this, and automatically add -fPIC if needed? Or is this just a local symptom of some bug/misconfiguration on my system, and so wouldn't be needed by anybody else?

  7. gmaxwell commented at 6:11 AM on September 8, 2013: contributor

    We should be enable hardening all the time, with an AC test to make sure the hardening flags work, and whining at you if they don't.

    ACK on the BDB changes, though I've not tested yet.

  8. Krellan commented at 6:49 AM on September 8, 2013: contributor

    I also wondered why that wasn't already the default, as it seems like a good idea. Perhaps --disable-hardening for those who explicitly wish to disable hardening for whatever reason (old build tools, debugging, etc.)?

  9. wtogami commented at 6:54 AM on September 8, 2013: contributor

    If your build tools are that old, your OS likely lacks dependencies needed by Bitcoin anyway. For now please focus on getting this to build on all common operating systems, every typical variant of Linux, and all gitian targets.

  10. wtogami commented at 7:09 AM on September 8, 2013: contributor

    I strongly recommend two more "fixes" in order to prevent confusion and many useless bug reports from hundreds of future builders.

    1. Automatically remove the old leveldb.a from pre-autotools builds. If necessary name the new target something else so it is easy to distinguish the old leveldb.a from new.
    2. Automatically remove the old bitcoind, or print something at the end of each frontend build where the binary is located. Right now it is easy to mistake the old bitcoind in the base directory as the output.
  11. jgarzik commented at 7:21 AM on September 8, 2013: contributor

    @wtogami The proposed solutions are largely an artifact of transitional code. New checkouts should not see the problem, and pre-autotools builds will quickly plunge in frequency, in a few months after release.

    Seems like an issue for release notes, something easily grep-able and google-able for people finding common pre->autotools transition issues.

  12. Krellan commented at 10:03 AM on September 8, 2013: contributor

    Speaking of release notes, an easy documentation bug to fix.

    In doc/build-unix.md where it says CXXFLAGS="-i/usr/include/db4.8"

    The -i should be -I (capital I, as in India).

  13. Diapolo commented at 11:27 AM on September 8, 2013: none

    I feel like i now never could contribute again to compiler switches, hardening or whatever. That autotools stuff looks like magic an I miss my .pro file ^^. I have yet to try builing bitcoin-qt with this.

    I whish Qt5 support is working as I don't use Qt4 anymore.

  14. gmaxwell commented at 11:30 AM on September 8, 2013: contributor

    @Diapolo The secret of autotools is that no one else in the world understands it either. Really you just randomly poke at it until it works. Once you've done this long enough everyone will assume that you actually know what you're doing, and you can smirk quietly and carry on the great secret. :)

    Don't worry, if you get stuck everyone will help you. Autotools is like a big hazing as part of the initiation into the free software brotherhood. At conferences we all sit around over beer griping about how much autotools stinks. :)

  15. wtogami commented at 11:58 AM on September 8, 2013: contributor

    <gmaxwell> ... this is being compiled without optimization 0_o <warren> gmaxwell: yeah, I complained about that. -O1 is needed at least for hardening to work <warren> gmaxwell: our old default was -O2 right?
    <gmaxwell> we absolutely shouldn't be compiling with just O1. <gmaxwell> right.

  16. luke-jr commented at 2:08 PM on September 8, 2013: member

    @Krellan Programs are not supposed to be built with -fPIC (it's for shared libraries only), so I'm not sure where your problem is coming from. I'll make a note to remove the CXXFLAGS from build-unix.md (it's no longer necessary). @wtogami bitcoind was never built in the base directory, so the location is already the same.

  17. wtogami commented at 2:12 PM on September 8, 2013: contributor

    @luke-jr Oops, I meant bitcoin-qt.

  18. Krellan commented at 7:18 PM on September 8, 2013: contributor

    @luke-jr As for -fPIC, nonetheless, it seems to be required. Can you compile on your system with --enable-hardening without adding -fPIC? I can't, without getting the error message about relocation and the reminder to use -fPIC. With ASLR hardening, the address space is randomized, so position-independent code would already be a necessity, right?

    On my system, a hardened executable shows up as "shared object" (ET_DYN) instead of "executable" (ET_EXEC) in the file and scanelf -e commands respectively. So, although -fPIC is for shared libraries only, as you said and I agree with, maybe a hardened executable counts as a shared library for this purpose?

  19. luke-jr commented at 7:34 PM on September 8, 2013: member

    Does it work with -fPIE (and not -fPIC)? That's what some hardening systems use (I don't know what --enable-hardening is supposed to do)

  20. jgarzik commented at 7:52 PM on September 8, 2013: contributor

    Perhaps a hardened executable requires a randomized address space, rather than compiler-chosen static offsets.

  21. gavinandresen commented at 12:29 AM on September 9, 2013: contributor

    NACK. Breaks on my macports/OSX machine:

    checking for db_version in -ldb_cxx-4.8... no checking for db_version in -ldb_cxx... no configure: error: libdb_cxx missing

    Compare with master:

    checking db_cxx.h usability... yes checking db_cxx.h presence... yes checking for db_cxx.h... yes checking for main in -ldb_cxx... yes

  22. theuni commented at 5:58 AM on September 9, 2013: member

    Please hold off on these for a day or two, I have portability concerns with many of them. I'll be back in the office on Mon/Tues.

  23. theuni commented at 6:01 AM on September 9, 2013: member

    Hardening should be on by default already, the help string is just backwards.

  24. theuni commented at 6:15 AM on September 9, 2013: member

    @Diapolo: I have patches for enabling qt5, and it builds fine. But I excluded it from the initial autotools pull to avoid overcomplicating it.

  25. theuni commented at 6:56 AM on September 9, 2013: member

    I'd like to point out that I made a big effort to make this functionally the same as the old build (I'm not claiming that I succeeded, far from it I'm sure). But the old build was very static and manual, so new options open up now that users can easily configure the build.

    If the behavior doesn't make sense, let's fix the core issues. For example, the old system had a notion of debug/release builds, and hardened/unhardened builds. I tried to match those for the sake of feature-parity, but that's not to say they make sense anymore. I'd prefer to have a good discussion/debate about what actually needs to be configurable, and what are sane defaults.

  26. laanwj commented at 8:56 AM on September 9, 2013: member

    Hardening definitely requires some form of position independent executable, for address space randomization. And I think PIE only applies to libraries. Not sure tho, the difference between PIE/PIC is a bit hazy to me.

  27. Diapolo commented at 10:43 AM on September 9, 2013: none

    I agree that we should harmonize hardening options and review them for all OSes. Also there is still my old pull I remember, which activates -fstack-protector-all for Windows, which never worked because of our ancient compiler suite. Shouldn't we now switch to something newer in order to allow this for Windows builds also? Maybe we can now also start looking in hardening our used libs?

    I'm looking forward to your Qt5 fixes :) and would suggest we also start looking into dependency lib versins, as some are rather out of date and may contain serious bugs or security issues!?

  28. wtogami commented at 12:03 PM on September 9, 2013: contributor

    Is the mingw Ubuntu 12 toolchain new enough?

  29. theuni commented at 12:07 PM on September 9, 2013: member

    hardening flags can be seen here: https://github.com/bitcoin/bitcoin/blob/master/configure.ac#L296

    For the most part, each one is tested and applied wherever possible, to avoid the need to specify per-toolchain.

  30. laanwj commented at 12:34 PM on September 9, 2013: member

    @wtogami yes,the mingw-w64 (don't mind the name, it's for 32 bit as well) cross compilation stuff in Ubuntu 12.04 is new enough for hardened builds (w/ stack-protector-all) to work correctly on Windows.

  31. autotools: use an absolute path to test data b4d8d03b86
  32. configure: Check common include subdirectories for bdb headers, and refuse to use any version other than 4.8 by default 941dba1783
  33. build-unix.md: Remove now-redundant and unnecessary Gentoo instructions 56ba02aa2a
  34. configure: Prefer specific known-good versions of Qt metacompiler tools 9a09c0091c
  35. theuni commented at 10:31 PM on September 10, 2013: member

    ACK.

  36. Bugfix: Since test_bitcoin is being built and run inside src/test/, try using relative directories from that point 1e9d3b1392
  37. gmaxwell commented at 11:58 PM on September 10, 2013: contributor

    ACK. Builds for me now.

  38. BitcoinPullTester commented at 12:04 AM on September 11, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/1e9d3b1392b604fafc6802e4d43469f519d14424 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  39. wtogami commented at 12:12 AM on September 11, 2013: contributor

    This seems to lack -O by default. gmaxwell says it will probably be in the next pull though.

  40. luke-jr commented at 12:49 AM on September 11, 2013: member

    Yep, it's part of my autoconf_pt2 branch (out of 4).

  41. gmaxwell referenced this in commit 11a79680b1 on Sep 11, 2013
  42. gmaxwell merged this on Sep 11, 2013
  43. gmaxwell closed this on Sep 11, 2013

  44. luke-jr deleted the branch on Jan 1, 2015
  45. Bushstar referenced this in commit 7334aa553c on Apr 8, 2020
  46. DrahtBot locked this on Sep 8, 2021

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-14 15:15 UTC

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