Skip to content

Conversation

@Xeonacid
Copy link
Contributor

Fix build error on riscv64:

In file included from /build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/os/alloc_aligned.h:31,
                 from /build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/user_setup/allocator.h:42,
                 from /build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/details/allocator.h:12,
                 from /build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/urcu/details/base.h:11,
                 from /build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/urcu/details/gp_decl.h:9,
                 from /build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/threading/details/_common.h:9,
                 from /build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/src/thread_data.cpp:6:
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:80:28: error: redefinition of ‘uint64_t cds::beans::log2floor(uint64_t)’
   80 |     static inline uint64_t log2floor( uint64_t n )
      |                            ^~~~~~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:13:26: note: ‘size_t cds::beans::log2floor(size_t)’ previously defined here
   13 |     static inline size_t log2floor( size_t n )
      |                          ^~~~~~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:86:28: error: redefinition of ‘uint64_t cds::beans::log2ceil(uint64_t)’
   86 |     static inline uint64_t log2ceil( uint64_t n )
      |                            ^~~~~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:19:26: note: ‘size_t cds::beans::log2ceil(size_t)’ previously defined here
   19 |     static inline size_t log2ceil( size_t n )
      |                          ^~~~~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:106:28: error: redefinition of ‘uint64_t cds::beans::floor2(uint64_t)’
  106 |     static inline uint64_t floor2( uint64_t n )
      |                            ^~~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:39:26: note: ‘size_t cds::beans::floor2(size_t)’ previously defined here
   39 |     static inline size_t floor2( size_t n )
      |                          ^~~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:125:28: error: redefinition of ‘uint64_t cds::beans::ceil2(uint64_t)’
  125 |     static inline uint64_t ceil2( uint64_t n )
      |                            ^~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:58:26: note: ‘size_t cds::beans::ceil2(size_t)’ previously defined here
   58 |     static inline size_t ceil2( size_t n )
      |                          ^~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:131:34: error: redefinition of ‘constexpr bool cds::beans::is_power2(uint64_t)’
  131 |     constexpr static inline bool is_power2( uint64_t n ) noexcept
      |                                  ^~~~~~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:64:34: note: ‘constexpr bool cds::beans::is_power2(size_t)’ previously defined here
   64 |     constexpr static inline bool is_power2( size_t n ) noexcept
      |                                  ^~~~~~~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:137:28: error: redefinition of ‘uint64_t cds::beans::log2(uint64_t)’
  137 |     static inline uint64_t log2( uint64_t n )
      |                            ^~~~
/build/libfbclient/src/Firebird-5.0.1.1469-0-source/extern/libcds/cds/algo/int_algo.h:70:26: note: ‘size_t cds::beans::log2(size_t)’ previously defined here
   70 |     static inline size_t log2( size_t n )
      |                          ^~~~

@AlexPeshkoff
Copy link
Member

Did you try to run cds tests after the build with this patch? I ask because cds is doing rather low-level tricks with CPU, and in a case when something goes wrong with them we may get a very-hard-to-fix & randomly-happening bug in firebird.

I suggest to run tests to check does cds work on riscv before applying your patch.

@Xeonacid
Copy link
Contributor Author

Did you try to run cds tests after the build with this patch? I ask because cds is doing rather low-level tricks with CPU, and in a case when something goes wrong with them we may get a very-hard-to-fix & randomly-happening bug in firebird.

I suggest to run tests to check does cds work on riscv before applying your patch.

I tested locally and all tests passed. 🎇

@AlexPeshkoff AlexPeshkoff merged commit c709689 into FirebirdSQL:master Jan 13, 2025
24 checks passed
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 this pull request may close these issues.

2 participants