Skip to content

bundled libcds breaks build on s390x #7395

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

Closed
sharkcz opened this issue Nov 23, 2022 · 15 comments
Closed

bundled libcds breaks build on s390x #7395

sharkcz opened this issue Nov 23, 2022 · 15 comments

Comments

@sharkcz
Copy link
Contributor

sharkcz commented Nov 23, 2022

Per our CI a recent commit (most likely d2795cc) breaks build on Fedora/s390x platform.

from the build log

...
make libcds
make[4]: Entering directory '/home/jenkins/workspace/Firebird/label/s390x/gen'
mkdir -p /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release
cd /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release; \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-fPIC /home/jenkins/workspace/Firebird/label/s390x/extern/libcds
-- The C compiler identification is GNU 12.2.1
-- The CXX compiler identification is GNU 12.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:24 (set):
  implicitly converting 'string' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Binary output path: /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release/bin
C++ std: -std=c++11 (default)
-- Looking for C++ include linux/membarrier.h
-- Looking for C++ include linux/membarrier.h - not found
Build type -- Release
Compiler version: GNU 12.2.1
System: Linux version: 6.0.5-200.fc36.s390x
Target architecture: unknown
Compiler flags: -fPIC -O3 -DNDEBUG -std=c++11 -Wall;-Wextra;-pedantic
Exe flags: 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release
AR="ar" make -C /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release
make[5]: Entering directory '/home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release'
make[6]: Entering directory '/home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release'
make[7]: Entering directory '/home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release'
make[7]: Leaving directory '/home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release'
make[7]: Entering directory '/home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release'
[  4%] Building CXX object CMakeFiles/cds.dir/src/init.cpp.o
In file included from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/os/alloc_aligned.h:31,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/user_setup/allocator.h:42,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/details/allocator.h:12,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/urcu/details/base.h:11,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/urcu/details/gp_decl.h:9,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/threading/details/_common.h:9,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/threading/model.h:9,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/os/linux/topology.h:14,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/os/topology.h:14,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/init.h:10,
                 from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/src/init.cpp:6:
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                            ^~~~~~~~~
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                          ^~~~~~~~~
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                            ^~~~~~~~
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                          ^~~~~~~~
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                            ^~~~~~
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                          ^~~~~~
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                            ^~~~~
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                          ^~~~~
/home/jenkins/workspace/Firebird/label/s390x/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
      |                                  ^~~~~~~~~
/home/jenkins/workspace/Firebird/label/s390x/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
      |                                  ^~~~~~~~~
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                            ^~~~
/home/jenkins/workspace/Firebird/label/s390x/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 )
      |                          ^~~~
/home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/urcu/details/base.h: In constructor ‘cds::urcu::epoch_retired_ptr::epoch_retired_ptr(const cds::gc::details::retired_ptr&, uint64_t)’:
/home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/urcu/details/base.h:436:36: warning: implicitly-declared ‘constexpr cds::gc::details::retired_ptr::retired_ptr(const cds::gc::details::retired_ptr&)’ is deprecated [-Wdeprecated-copy]
  436 |                 , m_nEpoch( nEpoch )
      |                                    ^
In file included from /home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/urcu/details/base.h:10:
/home/jenkins/workspace/Firebird/label/s390x/extern/libcds/cds/gc/details/retired_ptr.h:59:26: note: because ‘cds::gc::details::retired_ptr’ has user-provided ‘cds::gc::details::retired_ptr& cds::gc::details::retired_ptr::operator=(const cds::gc::details::retired_ptr&)’
   59 |             retired_ptr& operator =( retired_ptr const& s) noexcept
      |                          ^~~~~~~~
make[7]: *** [CMakeFiles/cds.dir/build.make:76: CMakeFiles/cds.dir/src/init.cpp.o] Error 1
make[7]: Leaving directory '/home/jenkins/workspace/Firebird/label/s390x/extern/libcds/lib/Release'
make[6]: *** [CMakeFiles/Makefile2:85: CMakeFiles/cds.dir/all] Error 2
@AlexPeshkoff
Copy link
Member

Appears s390 is not supported by libcds.
We will discuss and try to decide what to do with this problem (i.e. port libcds ourself, use some emulation or what?).

@sharkcz
Copy link
Contributor Author

sharkcz commented Nov 24, 2022

@AlexPeshkoff , your access to our public s390x machine should still work.

Also, where is libcds coming from? I would take a look what might be missing there for the s390x support.

@AlexPeshkoff
Copy link
Member

CDS here means "concurrent data structures". It's a library that provides lock-less multi-threaded access to various traditional data structure (like linked list, etc) using first of all hazard pointers technique.

Sources are @github: https://github.com/khizmax/libcds. As far as I can see on Debian it's ported to almost all HW - except s390.

@sharkcz
Copy link
Contributor Author

sharkcz commented Nov 24, 2022

Thanks, after a brief look it might be feasible to add s390x support with only minimal changes. OpenMainframe Projects's Linux Distribution Working Group might be able to help with the porting as well.

@AlexPeshkoff
Copy link
Member

Appears that from out side will be very useful to make it possible to use system (not bundled) libcds

@sharkcz
Copy link
Contributor Author

sharkcz commented Nov 24, 2022

I have some preliminary patch that add s390x support, need to figure out how the test-suite is run to achieve some level of confidence in the fix :-)

@AlexPeshkoff
Copy link
Member

You mean internal CDS tests?

@sharkcz
Copy link
Contributor Author

sharkcz commented Nov 24, 2022

You mean internal CDS tests?

yes, seems they need to be enabled

@asfernandes
Copy link
Member

Appears that from out side will be very useful to make it possible to use system (not bundled) libcds

Just remember that Vlad modified libcds sources in the Firebird tree.

@hvlad
Copy link
Member

hvlad commented Nov 25, 2022

Even without custom modifications it is hard to impossible to guarantee equality of library-specific defines that used in our code and that used to build system library. We have similar case with ttmath, iirc.

@sharkcz
Copy link
Contributor Author

sharkcz commented Nov 25, 2022

s390x support for libcds has been proposed in khizmax/libcds#177

@AlexPeshkoff
Copy link
Member

Added patch to bundled library. Use of system library is suspicious for 2 reasons - first, patch required for firebird remains non-processed by upstream since Aug-2021. Next we anyway need non-default parameters of cds which is hardly the case for system library.

@sharkcz
Copy link
Contributor Author

sharkcz commented Nov 28, 2022

Make sense, thanks. Using the system library could be reconsidered when upstream will be alive.

@pmakowski, for the record, we will need Provides: bundled(libcds) = 2.3.3 in the Fedora Firebird rpms once this will be released, so the bundling is properly tracked.

@dyemanov
Copy link
Member

May we close this ticket as resolved now?

@sharkcz
Copy link
Contributor Author

sharkcz commented Jan 25, 2023

May we close this ticket as resolved now?

yes

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

No branches or pull requests

5 participants