Skip to content

Conversation

@fanquake
Copy link
Member

Fixes #19402.

The way we currently test for __builtin_clz* support with AC_CHECK_DECLS does not work with Clang:

configure:21492: clang++-10 -std=c++11 -c -g -O2  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS conftest.cpp >&5
conftest.cpp:100:10: error: builtin functions must be directly called
  (void) __builtin_clz;
         ^
1 error generated.

This also removes the __builtin_clz() check, as we don't actually use it anywhere, and it's trvial to re-add detection if we do start using it at some point. If this is controversial then I'll add a test for it as well.

The way we currently test with AC_CHECK_DECLS do not work with Clang:
```bash
configure:21492: clang++-10 -std=c++11 -c -g -O2  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS conftest.cpp >&5
conftest.cpp:100:10: error: builtin functions must be directly called
  (void) __builtin_clz;
         ^
1 error generated.
```

This also removes the __builtin_clz() check, as we don't actually use
it anywhere, and it's trvial to re-add detection if we do start using
it at some point.
@sipa
Copy link
Member

sipa commented Jun 29, 2020

ACK 9952242

1 similar comment
@laanwj
Copy link
Member

laanwj commented Jun 29, 2020

ACK 9952242

@laanwj laanwj merged commit 1269cab into bitcoin:master Jun 29, 2020
@fanquake fanquake deleted the improve_builtin_clz_detection branch June 29, 2020 13:51
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Aug 15, 2020
The way we currently test with AC_CHECK_DECLS do not work with Clang:
```bash
configure:21492: clang++-10 -std=c++11 -c -g -O2  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS conftest.cpp >&5
conftest.cpp:100:10: error: builtin functions must be directly called
  (void) __builtin_clz;
         ^
1 error generated.
```

This also removes the __builtin_clz() check, as we don't actually use
it anywhere, and it's trvial to re-add detection if we do start using
it at some point.

Github-Pull: bitcoin#19403
Rebased-From: 9952242 (diff-minimised)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

__builtin_clz[l[l]] not detected using clang

3 participants