-
Notifications
You must be signed in to change notification settings - Fork 38.7k
cmake: Fix -pthread flags presentation in summary
#31724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31724. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
-- Found SQLite3: /usr/include (found suitable version "3.46.1", minimum required is "3.7.17")
CMake Warning at CMakeLists.txt:195 (message):
PIE is not supported at link time: PIE (CXX): Change Dir:
'/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/build/CMakeFiles/CMakeScratch/TryCompile-.raysb'
Run Build Command(s): /opt/ooce/bin/cmake -E env VERBOSE=1 /usr/bin/make -f
Makefile cmTC_93ec4/fast
/usr/bin/make -f CMakeFiles/cmTC_93ec4.dir/build.make
CMakeFiles/cmTC_93ec4.dir/build
Building CXX object CMakeFiles/cmTC_93ec4.dir/src.cxx.o
/usr/bin/g++ -DCMAKE_CXX_LINK_PIE_SUPPORTED -pthread -std=c++20 -o
CMakeFiles/cmTC_93ec4.dir/src.cxx.o -c
/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/build/CMakeFiles/CMakeScratch/TryCompile-.raysb/src.cxx
Linking CXX executable cmTC_93ec4
/opt/ooce/bin/cmake -E cmake_link_script CMakeFiles/cmTC_93ec4.dir/link.txt
--verbose=1
g++: error: -pie is not supported in this configuration
/usr/bin/g++ -pthread -fPIE -pie CMakeFiles/cmTC_93ec4.dir/src.cxx.o -o
cmTC_93ec4
*** Error code 1
make: Fatal error: Command failed for target `cmTC_93ec4'
Current working directory
/home/runner/work/bitcoin-core-nightly/bitcoin-core-nightly/build/CMakeFiles/CMakeScratch/TryCompile-.raysb
*** Error code 1
make: Fatal error: Command failed for target `cmTC_93ec4/fast'
-- Performing Test CXX_SUPPORTS__WERROR
-- Performing Test CXX_SUPPORTS__WERROR - Success
-- Setting build type to "RelWithDebInfo" as none was specifiedThis one looks like its producing errors, but they are ignored and configuring continues? Is that a different bug? |
UPD. This PR changes only flag presentation in the summary without actual changes in the build system. |
|
So is this a CMake bug then? I don't think our configure process should output |
|
Because CMake has a habit of trying to work around these kinds of issues internally, so when something like this pops up, it's something that they are not accomodating (and without looking at the code, it's unclear if that's a bug, or a concious decision).
Sure, I'm just not sure this is useful output. It's verbose compiler output, that also says
Sure, we can open another issue, or role it into #30771, given this is related to the same CMake functionality. |
300db5b to
2083e9c
Compare
|
Tested ACK 2083e9c Left a non-blocking suggestion of an alternative approach, but I think this is a good solution to #31482 as-is. On FreeBSD 14.2
# freebsd-version
14.2-RELEASEmaster: # cmake -B build
C++ compiler flags .................... -O2 -g -std=c++20 -fPIC -fdebug-prefix-map=/root/bitcoin-master/src=. -fmacro-prefix-map=/root/bitcoin-master/src=. $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:SHELL:-Xcompiler -pthread> $<$<AND:$<NOT:$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>>,$<NOT:$<COMPILE_LANGUAGE:Swift>>>:-pthread> -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protectionOn this branch: # cmake -B build
C++ compiler flags .................... -O2 -g -std=c++20 -fPIC -fdebug-prefix-map=/root/bitcoin-master/src=. -fmacro-prefix-map=/root/bitcoin-master/src=. -pthread -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection |
The issue been fixed is assigned to the "29.0" milestone. Should the milestones for an issue and a PR with its fix be aligned? |
| # the C library implementation, the CMake FindThreads module | ||
| # sets the Threads::Threads target's compile options to | ||
| # generator expressions that evaluate to `-pthread` in this | ||
| # project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generator expressions that evaluate to
-pthreadin this project.
So couldn't we just stop using Threads::Threads and use -pthread directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It is our practise to check whether flags are supported and required, isn't it?
- In the Autotools-based build system, we used the
AX_PTHREADmacro for that purpose. - The
FindThreadsmodule is a CMake's way of achieving the same. - The current issue on the master branch is not about the thread-related flags for the toolchain but rather their presentation in the summary.
|
There are two general problems with printing a build summary at configure time:
The best alternative to printing a summary at configure time, is to generate it into a file at generate time with |
-pthread flags in summary-pthread flags presentation in summary
|
There hasn't been much activity lately. What is the status here? Finding reviewers may take time. However, if the patch is no longer relevant, please close this pull request. If the author lost interest or time to work on this, please close it and mark it 'Up for grabs' with the label, so that it can be picked up in the future. |
I think there is value in printing a configure summary to stdout, so writing it only to a file could make it harder to quickly double-check if an option or compile flag has been applied. |
|
I've closed #31482, as not sure making further changes to address this is worth it. |
This PR removes the raw CMake generator expressions from the summary output.
Fixes #31482.
Here are a few examples of the summary: