Adding a note about the discussion here for compiling on FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226155
--disable-asm is required to compile on FreeBSD #13122
pull dbolser wants to merge 2 commits into bitcoin:master from dbolser:patch-4 changing 1 files +3 −0-
dbolser commented at 8:40 AM on April 30, 2018: contributor
-
bc21c7348f
--disable-asm is required to compile on FreeBSD
Adding a note about the discussion here for compiling on FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226155
- fanquake added the label Linux/Unix on Apr 30, 2018
-
in doc/build-unix.md:334 in bc21c7348f outdated
327 | @@ -328,8 +328,11 @@ Then build using: 328 | ./autogen.sh 329 | ./configure --disable-wallet # OR 330 | ./configure BDB_CFLAGS="-I${BDB_PREFIX}/include" BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx" 331 | + 332 | gmake 333 | 334 | +*Note* that as of Bitcoin Core version 0.16.0, you need to add --disable-asm at the configure step to disable defailt ASM optimization to compile for FreeBSD. See [here](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226155) for details.
fanquake commented at 8:41 AM on April 30, 2018:s/defailt/default
practicalswift commented at 8:55 AM on April 30, 2018:Nit: Use `--disable-asm` to get correct formatting :-)
dbolser commented at 10:31 AM on April 30, 2018:Done
dbolser commented at 10:32 AM on April 30, 2018:Done.
dbolser commented at 8:55 AM on April 30, 2018: contributorThanks. Should I fix that?
laanwj commented at 9:47 AM on April 30, 2018: memberI cannot reproduce this. I've been building my node on FreeBSD without any special options.
- What version of FreeBSD? I'm running
FreeBSD 11.1-RELEASE-p4. - Have you tested that this issue isn't fixed in master (and something build system specific should be backported to 0.16 branch?).
laanwj added the label Build system on Apr 30, 2018laanwj requested review from theuni on Apr 30, 2018dbolser commented at 10:27 AM on April 30, 2018: contributorThe ticket I've cited says 10.3, 10.4, 11.1 and 12C. I don't actually know the impact of disabling ASM, or if there is a better fix than the one suggested by the port maintainers.
0bdbd0613aMade a couple of small changes
Made a couple of small changes as suggested by the PR discussion.
dbolser commented at 10:33 AM on April 30, 2018: contributorSorry, just spotted your edits. I'll try building master when I get home tonight (this is an issue for me on the 0.16 branch). Cheers,
laanwj commented at 2:25 PM on May 1, 2018: memberYes, no matter what, I think we should solve this in the build system (by making asm detection more robust), not burden the user through the documentation.
dbolser commented at 2:52 PM on May 1, 2018: contributorYes, good point. It didn't work for me on master BTW (same error). I wonder why you're not seeing it.
On 1 May 2018 at 15:26, Wladimir J. van der Laan notifications@github.com wrote:
Yes, no matter what, I think we should solve this in the build system (by making asm detection more robust), not burden the user through the documentation.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/pull/13122#issuecomment-385683289, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH2k8T5cL5N-4I-kb6ihARk6zsF71D5ks5tuHCTgaJpZM4TsRmz .
theuni commented at 3:24 PM on May 1, 2018: memberAccording to the log in that ticket, the build error is:
crypto/sha256_sse4.cpp:953:15: error: cannot compile this unexpected cast lvalue yet : "m"(K256), "m"(FLIP_MASK), "m"(SHUF_00BA), "m"(SHUF_DC00) ^~~~ crypto/sha256_sse4.cpp:953:26: error: cannot compile this unexpected cast lvalue yet : "m"(K256), "m"(FLIP_MASK), "m"(SHUF_00BA), "m"(SHUF_DC00) ^~~~~~~~~ crypto/sha256_sse4.cpp:953:42: error: cannot compile this unexpected cast lvalue yet : "m"(K256), "m"(FLIP_MASK), "m"(SHUF_00BA), "m"(SHUF_DC00) ^~~~~~~~~ crypto/sha256_sse4.cpp:953:58: error: cannot compile this unexpected cast lvalue yet : "m"(K256), "m"(FLIP_MASK), "m"(SHUF_00BA), "m"(SHUF_DC00) ^~~~~~~~~Which turns up as an old clang bug fixed in 2014.
Could you please try this patch? I believe it should apply on top of master as well as 0.16. https://github.com/theuni/bitcoin/commit/5e86e76348ed23f03cbff491dd5eb783e9cb71da
For me the resulting asm is identical.
No clue if it will work around the bug, but it's worth a shot.
Edit: updated commit to mark inputs offsettable.
dbolser commented at 3:41 PM on May 1, 2018: contributorOK, I'll try it at home later toady.
On 1 May 2018 at 16:26, Cory Fields notifications@github.com wrote:
According to the log in that ticket https://bz-attachments.freebsd.org/attachment.cgi?id=191033, the build error is:
crypto/sha256_sse4.cpp:953:15: error: cannot compile this unexpected cast lvalue yet : "m"(K256), "m"(FLIP_MASK), "m"(SHUF_00BA), "m"(SHUF_DC00) ^~~~ crypto/sha256_sse4.cpp:953:26: error: cannot compile this unexpected cast lvalue yet : "m"(K256), "m"(FLIP_MASK), "m"(SHUF_00BA), "m"(SHUF_DC00) ^~~~~~~~~ crypto/sha256_sse4.cpp:953:42: error: cannot compile this unexpected cast lvalue yet : "m"(K256), "m"(FLIP_MASK), "m"(SHUF_00BA), "m"(SHUF_DC00) ^~~~~~~~~ crypto/sha256_sse4.cpp:953:58: error: cannot compile this unexpected cast lvalue yet : "m"(K256), "m"(FLIP_MASK), "m"(SHUF_00BA), "m"(SHUF_DC00) ^~~~~~~~~
Which turns up as an old clang bug fixed in 2014 https://bugs.llvm.org/show_bug.cgi?id=20201.
Could you please try this patch? I believe it should apply on top of master as well as 0.16. theuni/bitcoin@0a5d9e9 https://github.com/theuni/bitcoin/commit/0a5d9e9355594a022f512d5d48175e950f02f8fb
For me the resulting asm is identical.
No clue if it will work around the bug, but it's worth a shot.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/pull/13122#issuecomment-385698850, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH2k-Jt4qcDnbW1W1I9bg_qIrE3ti0cks5tuH6YgaJpZM4TsRmz .
laanwj commented at 3:45 PM on May 1, 2018: memberFWIW here's my config.log:
https://0bin.net/paste/Mm9HmzaWU7YOhbF5#ySh1eN90wjJDDJXNW-ktQ0OOjeBgRfqmRKUF38jfNmZ
configure:19204: checking for assembler crc32 support configure:19230: c++ -std=c++11 -c -g -O2 -Wall -Wextra -Wformat -Wvla -Wformat-security -Wthread-safety-analysis -Wno-unused-parameter -Wno-self-assign -Wno-unused-local-typedef -Wno-deprecated-register -Wno-implicit-fallthrough -msse4.2 conftest.cpp >&5 configure:19230: $? = 0 configure:19231: result: yes ... | #define USE_ASM 1Clang version:
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)theuni commented at 5:42 PM on May 1, 2018: memberI managed to reproduce with an old clang from: http://releases.llvm.org/3.4.2/clang+llvm-3.4.2-x86_64-linux-gnu-ubuntu-14.04.xz
I can confirm that the above patch fixes the issue, although another arises. See here for the next fix: https://github.com/theuni/bitcoin/commit/8f097ef8b9a1d36b1aa82e6428da3884fb9eebf8
With those two patches, I'm able to compile the .cpp without issues, and the sha2 tests pass. If @dbolser confirms that it's fixed for FreeBSD, I'll PR that branch.
dbolser commented at 10:23 PM on May 3, 2018: contributorJust tried again in a new jail (my OS was updated to 11.1, but the jail was still on 10.4, which was causing problems).... It's not finished, but seems to be compiling fine (no tweaked options, no patch, just 0.16). So unless something changed, looks like it was an error my side.
laanwj commented at 11:18 AM on May 14, 2018: memberNot sure what to do here. If you cannot reproduce the problem anymore, might want to close.
dbolser closed this on May 14, 2018theuni commented at 10:27 PM on May 15, 2018: memberAgreed. Ideally we'd compile with any c++11-compatible compiler, but given that this hits 2 separate clang bugs, it's probably best to just require a non-broken version.
MarcoFalke locked this on Sep 8, 2021
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-13 15:15 UTC
More mirrored repositories can be found on mirror.b10c.me