Skip to content
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

build: Fix compiling with GCC 11 #53

Merged
merged 1 commit into from
Oct 10, 2021
Merged

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Oct 10, 2021

Currently (a8dbc01), building the qt package in depends with GCC 11 fails:

$ gcc --version
gcc (Ubuntu 11.1.0-1ubuntu1~21.04) 11.1.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make -C depends qt
...
In file included from ../../include/QtQml/5.12.11/QtQml/private/qv4propertykey_p.h:1,
                 from ../../include/QtQml/5.12.11/QtQml/private/../../../../../src/qml/jsruntime/qv4internalclass_p.h:56,
                 from ../../include/QtQml/5.12.11/QtQml/private/qv4internalclass_p.h:1,
                 from ../qml/jsruntime/qv4value_p.h:59,
                 from ../qml/jsruntime/qv4managed_p.h:54,
                 from ../qml/jsruntime/qv4engine_p.h:54,
                 from ../qml/jsruntime/qv4engine.cpp:39:
../../include/QtQml/5.12.11/QtQml/private/../../../../../src/qml/jsruntime/qv4propertykey_p.h: In member function ‘uint QV4::PropertyKey::asArrayIndex() const’:
../../include/QtQml/5.12.11/QtQml/private/../../../../../src/qml/jsruntime/qv4propertykey_p.h:116:73: error: ‘numeric_limits’ is not a member of ‘std’
  116 |     uint asArrayIndex() const { return (isManaged() || val == 0) ? std::numeric_limits<uint>::max() : static_cast<uint>(val & 0xffffffff); }
      |                                                                         ^~~~~~~~~~~~~~
../../include/QtQml/5.12.11/QtQml/private/../../../../../src/qml/jsruntime/qv4propertykey_p.h:116:92: error: expected primary-expression before ‘>’ token
  116 |     uint asArrayIndex() const { return (isManaged() || val == 0) ? std::numeric_limits<uint>::max() : static_cast<uint>(val & 0xffffffff); }
      |                                                                                            ^
../../include/QtQml/5.12.11/QtQml/private/../../../../../src/qml/jsruntime/qv4propertykey_p.h:116:95: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  116 |     uint asArrayIndex() const { return (isManaged() || val == 0) ? std::numeric_limits<uint>::max() : static_cast<uint>(val & 0xffffffff); }
      |                                                                                               ^~~
      |                                                                                               std::max

This is similar to the bitcoin/bitcoin#22186.

@hebasto hebasto added Bug Something isn't working Build system labels Oct 10, 2021
@hebasto hebasto changed the title build, qml: Fix compiling with GCC 11 build: Fix compiling with GCC 11 Oct 10, 2021
@hebasto
Copy link
Member Author

hebasto commented Oct 10, 2021

Guix builds

$ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
c0684cd08e5ce683e4926c5b56d2b2e0b45b2bac8d825b8f8b4c9c678089fe30  guix-build-26ce35fbe0d1/output/aarch64-linux-gnu/SHA256SUMS.part
94ef85669719d98eb9895fa6fb25053d117d3b3a93baaf77d214b1c9d32b583a  guix-build-26ce35fbe0d1/output/aarch64-linux-gnu/bitcoin-26ce35fbe0d1-aarch64-linux-gnu-debug.tar.gz
d61585bf9aaf6b47bbd82e6f08f99e37ca567d5fc39462c3c1dccb3eb3ece276  guix-build-26ce35fbe0d1/output/aarch64-linux-gnu/bitcoin-26ce35fbe0d1-aarch64-linux-gnu.tar.gz
b192626abf33c28173a3fc4cb1dbf25b9740a85192b15557b019dbf2a56e635a  guix-build-26ce35fbe0d1/output/arm-linux-gnueabihf/SHA256SUMS.part
ebb2e09fbcd7a913651acdec8b9667e13010c9d66453a300dad63962a320a790  guix-build-26ce35fbe0d1/output/arm-linux-gnueabihf/bitcoin-26ce35fbe0d1-arm-linux-gnueabihf-debug.tar.gz
2d2e896907554a3ad8a6c7b78872bf72687f2d83b8e0ff1ab6ea47115ccef39a  guix-build-26ce35fbe0d1/output/arm-linux-gnueabihf/bitcoin-26ce35fbe0d1-arm-linux-gnueabihf.tar.gz
2e903af607b2f7510de05ba45814aa620da2fbb21e146b5bbcfa2b4c2649d5b4  guix-build-26ce35fbe0d1/output/dist-archive/bitcoin-26ce35fbe0d1.tar.gz
443133a4304d47d888773ac41b72f5294230e5f4a43bab222dfa9417a6db7f69  guix-build-26ce35fbe0d1/output/powerpc64-linux-gnu/SHA256SUMS.part
20205c11c3cdc00f8af99bdbc3f4b87a22e6ad9a3368b81a808d4f0ce4f18423  guix-build-26ce35fbe0d1/output/powerpc64-linux-gnu/bitcoin-26ce35fbe0d1-powerpc64-linux-gnu-debug.tar.gz
291eadc926c0223fde0472eac67c83a433951bbe36babac52ad51b071a2b057b  guix-build-26ce35fbe0d1/output/powerpc64-linux-gnu/bitcoin-26ce35fbe0d1-powerpc64-linux-gnu.tar.gz
53212fd5c8d788e18e5d264026e5497db2ee2432565fe9fda1a3f230fc2ca1c4  guix-build-26ce35fbe0d1/output/powerpc64le-linux-gnu/SHA256SUMS.part
f7228d3a96931aad505578cdcc3a2a91f96ea24bbf9e845e268bc97199627ec6  guix-build-26ce35fbe0d1/output/powerpc64le-linux-gnu/bitcoin-26ce35fbe0d1-powerpc64le-linux-gnu-debug.tar.gz
5eab1ac68f56dc8d99927e33d303ce7055f6bdcf99b42e7ef0e844509af586ee  guix-build-26ce35fbe0d1/output/powerpc64le-linux-gnu/bitcoin-26ce35fbe0d1-powerpc64le-linux-gnu.tar.gz
0422937387ed464d15fec072d284577fb9d2791b0b2fee30b9d9091e853f3690  guix-build-26ce35fbe0d1/output/riscv64-linux-gnu/SHA256SUMS.part
bd451b9fbab3fbfe86dd9339698c3a49ecfcbb1f00bfe2eaeb01da6c5e336ede  guix-build-26ce35fbe0d1/output/riscv64-linux-gnu/bitcoin-26ce35fbe0d1-riscv64-linux-gnu-debug.tar.gz
ded4bfd27a93399bf6fd1836de78f151ddbcab819bdff0e9b6e9c46fad8ee561  guix-build-26ce35fbe0d1/output/riscv64-linux-gnu/bitcoin-26ce35fbe0d1-riscv64-linux-gnu.tar.gz
3a1d286253a4efb611a46326167b5b5ca1ed06219ba53b21c6ba74e7cee66cd6  guix-build-26ce35fbe0d1/output/x86_64-apple-darwin19/SHA256SUMS.part
aa10749708a69a882a2ec4eee8aa28eda1fee8c506d038651e715d96a96117c8  guix-build-26ce35fbe0d1/output/x86_64-apple-darwin19/bitcoin-26ce35fbe0d1-osx-unsigned.dmg
26e453c815f70a0b19417d1438859a7f7aa8334dbc816ec1f339bab3eaf8370f  guix-build-26ce35fbe0d1/output/x86_64-apple-darwin19/bitcoin-26ce35fbe0d1-osx-unsigned.tar.gz
d8d8fec0ed6cc2bd57621dcdee1d3e2d8b576def50eba0b4365c4682e9f45f17  guix-build-26ce35fbe0d1/output/x86_64-apple-darwin19/bitcoin-26ce35fbe0d1-osx64.tar.gz
d4adf17bf7401acc3c8b0d4efe5a4712ce33e8fb685d2b9734a1ee728e5606f4  guix-build-26ce35fbe0d1/output/x86_64-linux-gnu/SHA256SUMS.part
06a2bd6d644012c8580d936fa0dbda3a2c5c9cffb9536655deff8e2abe142eef  guix-build-26ce35fbe0d1/output/x86_64-linux-gnu/bitcoin-26ce35fbe0d1-x86_64-linux-gnu-debug.tar.gz
51c73b1d32e7e7ef00b3642514107d440ec01ff40bbdd5263cf5d1d332e12f4f  guix-build-26ce35fbe0d1/output/x86_64-linux-gnu/bitcoin-26ce35fbe0d1-x86_64-linux-gnu.tar.gz
693fb029cbe3804a4580b2290c0d4cb06972c8782f026b47f899352a1acca55d  guix-build-26ce35fbe0d1/output/x86_64-w64-mingw32/SHA256SUMS.part
e6342c05e9f182957b6093926f87ac77da320afb476df981bc234f74d8a4d70c  guix-build-26ce35fbe0d1/output/x86_64-w64-mingw32/bitcoin-26ce35fbe0d1-win-unsigned.tar.gz
1f96781a225679e5938d98dafa92d92d388d0eb4f8d5d94dc73da7aa0dd280d5  guix-build-26ce35fbe0d1/output/x86_64-w64-mingw32/bitcoin-26ce35fbe0d1-win64-debug.zip
d1f2c4d01a5ee8a764861226d271b97d24124a69bc45c18527322736e5f2bf53  guix-build-26ce35fbe0d1/output/x86_64-w64-mingw32/bitcoin-26ce35fbe0d1-win64-setup-unsigned.exe
e91b9e867774470a08c42d385cdb55a95e0c340f3a755bde0543eef5bf32e3a2  guix-build-26ce35fbe0d1/output/x86_64-w64-mingw32/bitcoin-26ce35fbe0d1-win64.zip

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 26ce35f. Including <limits> should fix error in OP.

@hebasto hebasto merged commit 48a13bf into bitcoin-core:main Oct 10, 2021
@hebasto hebasto deleted the 211010-gcc11 branch October 10, 2021 18:29
@hebasto
Copy link
Member Author

hebasto commented May 28, 2022

Effectively dropped in #121.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants