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

elements-23.2.6 build error with gcc 15.0.1 #1398

Closed
grubles opened this issue Feb 10, 2025 · 3 comments · Fixed by #1400
Closed

elements-23.2.6 build error with gcc 15.0.1 #1398

grubles opened this issue Feb 10, 2025 · 3 comments · Fixed by #1400

Comments

@grubles
Copy link

grubles commented Feb 10, 2025

CXX      elementsd-bitcoind.o                                                                
In file included from ./chainparams.h:9,                                                       
                 from bitcoind.cpp:10:                                                         
./chainparamsbase.h:34:5: error: ‘uint16_t’ does not name a type                                                                                                                              
   34 |     uint16_t RPCPort() const { return m_rpc_port; }                                                                                                                                   
      |     ^~~~~~~~                                                                                                                                                                          
./chainparamsbase.h:10:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
    9 | #include <string>                                                                                                                                                                     
  +++ |+#include <cstdint>                                                                                                                                                                    
   10 |                                                                                        
./chainparamsbase.h:35:5: error: ‘uint16_t’ does not name a type                                                                                                                              
   35 |     uint16_t OnionServiceTargetPort() const { return m_onion_service_target_port; }                                                                                                   
      |     ^~~~~~~~                                                                                                                                                                          
./chainparamsbase.h:35:5: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
./chainparamsbase.h:39:51: error: ‘uint16_t’ has not been declared
   39 |     CBaseChainParams(const std::string& data_dir, uint16_t rpc_port, uint16_t mainchain_rpc_port, uint16_t onion_service_target_port)
      |                                                   ^~~~~~~~
./chainparamsbase.h:39:51: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’                                                         ./chainparamsbase.h:39:70: error: ‘uint16_t’ has not been declared
   39 |     CBaseChainParams(const std::string& data_dir, uint16_t rpc_port, uint16_t mainchain_rpc_port, uint16_t onion_service_target_port)                                                       |                                                                      ^~~~~~~~
./chainparamsbase.h:39:70: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
./chainparamsbase.h:39:99: error: ‘uint16_t’ has not been declared
   39 |     CBaseChainParams(const std::string& data_dir, uint16_t rpc_port, uint16_t mainchain_rpc_port, uint16_t onion_service_target_port)
      |                                                                                                   ^~~~~~~~
./chainparamsbase.h:39:99: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
./chainparamsbase.h:43:11: error: ‘uint16_t’ does not name a type                                                                                                                             
   43 |     const uint16_t m_rpc_port;
      |           ^~~~~~~~      
./chainparamsbase.h:43:11: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
./chainparamsbase.h:44:11: error: ‘uint16_t’ does not name a type
   44 |     const uint16_t m_mainchain_rpc_port;
      |           ^~~~~~~~                                                                     
./chainparamsbase.h:44:11: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
./chainparamsbase.h:45:11: error: ‘uint16_t’ does not name a type
   45 |     const uint16_t m_onion_service_target_port;    
      |           ^~~~~~~~                                                                     
./chainparamsbase.h:45:11: note: ‘uint16_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
./chainparamsbase.h: In member function ‘int CBaseChainParams::MainchainRPCPort() const’:
./chainparamsbase.h:36:43: error: ‘m_mainchain_rpc_port’ was not declared in this scope; did you mean ‘MainchainRPCPort’?
   36 |     int MainchainRPCPort() const { return m_mainchain_rpc_port; }
./chainparamsbase.h:36:43: error: ‘m_mainchain_rpc_port’ was not declared in this scope; did you mean ‘MainchainRPCPort’?                                                             [0/1884]
   36 |     int MainchainRPCPort() const { return m_mainchain_rpc_port; }
      |                                           ^~~~~~~~~~~~~~~~~~~~
      |                                           MainchainRPCPort
./chainparamsbase.h: In constructor ‘CBaseChainParams::CBaseChainParams(const std::string&, int, int, int)’:
./chainparamsbase.h:40:11: error: class ‘CBaseChainParams’ does not have any field named ‘m_rpc_port’
   40 |         : m_rpc_port(rpc_port), m_mainchain_rpc_port(mainchain_rpc_port), m_onion_service_target_port(onion_service_target_port), strDataDir(data_dir) {}
      |           ^~~~~~~~~~
./chainparamsbase.h:40:33: error: class ‘CBaseChainParams’ does not have any field named ‘m_mainchain_rpc_port’
   40 |         : m_rpc_port(rpc_port), m_mainchain_rpc_port(mainchain_rpc_port), m_onion_service_target_port(onion_service_target_port), strDataDir(data_dir) {}
      |                                 ^~~~~~~~~~~~~~~~~~~~
./chainparamsbase.h:40:75: error: class ‘CBaseChainParams’ does not have any field named ‘m_onion_service_target_port’
   40 |         : m_rpc_port(rpc_port), m_mainchain_rpc_port(mainchain_rpc_port), m_onion_service_target_port(onion_service_target_port), strDataDir(data_dir) {}
      |                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./chain.h:13,
                 from ./validation.h:15,
                 from ./interfaces/chain.h:10,
                 from bitcoind.cpp:14:
./sync.h: In instantiation of ‘bool UniqueLock<Mutex, Base>::TryEnter(const char*, const char*, int) [with Mutex = AnnotatedMixin<std::recursive_mutex>; Base = std::unique_lock<std::recursiv
e_mutex>]’:
./sync.h:163:13:   required from ‘UniqueLock<Mutex, Base>::UniqueLock(Mutex&, const char*, const char*, int, bool) [with Mutex = AnnotatedMixin<std::recursive_mutex>; Base = std::unique_lock
<std::recursive_mutex>]’
  163 |             TryEnter(pszName, pszFile, nLine);
      |             ^~~~~~~~
./util/system.h:407:9:   required from here
  231 | #define LOCK(cs) DebugLock<decltype(cs)> PASTE2(criticalblock, __COUNTER__)(cs, #cs, __FILE__, __LINE__)
      |                                                                                                        ^
./sync.h:152:23: warning: ignoring return value of ‘bool std::unique_lock<_Mutex>::try_lock() [with _Mutex = std::recursive_mutex]’, declared with attribute ‘nodiscard’ [-Wunused-result]
  152 |         Base::try_lock();
      |         ~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/15/mutex:50,
                 from ./threadsafety.h:9,
                 from ./sync.h:14:
/usr/include/c++/15/bits/unique_lock.h:156:7: note: declared here
  156 |       try_lock()
      |       ^~~~~~~~
make[2]: *** [Makefile:16625: elementsd-bitcoind.o] Error 1
make[2]: Leaving directory '/home/user/builds/elements/src'
make[1]: *** [Makefile:20119: all-recursive] Error 1
make[1]: Leaving directory '/home/user/builds/elements/src'
make: *** [Makefile:831: all-recursive] Error 1
$ cc --version
cc (GCC) 15.0.1 20250204 (Red Hat 15.0.1-0)
@grubles
Copy link
Author

grubles commented Feb 10, 2025

Looks like it happens all the way back to elements-23.2.3 at least.

@psgreco
Copy link
Contributor

psgreco commented Feb 11, 2025

I'm not expecting any previous version to work. My guess is that we need to port bitcoin/bitcoin#30633 and maybe some extra stuff

@grubles
Copy link
Author

grubles commented Feb 11, 2025

Yeah I tested bitcoind v28.1 and it built fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants