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

Is s390x supported? #267

Closed
marxin opened this issue Jan 10, 2022 · 11 comments
Closed

Is s390x supported? #267

marxin opened this issue Jan 10, 2022 · 11 comments

Comments

@marxin
Copy link
Sponsor Contributor

marxin commented Jan 10, 2022

I noticed one can't build mold on s390x due to:

[   33s] make[3]: Entering directory '/home/abuild/rpmbuild/BUILD/mold-1.0.999+git.20220109.b18d4881/out/mimalloc'
[   33s] [100%] Built target mimalloc-static
[   33s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/mold-1.0.999+git.20220109.b18d4881/out/mimalloc'
[   33s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/mold-1.0.999+git.20220109.b18d4881/out/mimalloc'
[   33s] /usr/bin/cmake -E cmake_progress_start /home/abuild/rpmbuild/BUILD/mold-1.0.999+git.20220109.b18d4881/out/mimalloc/CMakeFiles 0
[   33s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/mold-1.0.999+git.20220109.b18d4881/out/mimalloc'
[   33s] g++ -DMOLD_VERSION=\"1.0.1\" -DLIBDIR="\"/usr/lib64\"" -Ithird-party/mimalloc/include  -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wno-sign-compare -pthread -fPIE -fno-unwind-tables -fno-asynchronous-unwind-tables  -std=c++20 -fno-exceptions -c -o out/perf.o perf.cc
[   36s] g++ -DMOLD_VERSION=\"1.0.1\" -DLIBDIR="\"/usr/lib64\"" -Ithird-party/mimalloc/include  -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wno-sign-compare -pthread -fPIE -fno-unwind-tables -fno-asynchronous-unwind-tables  -std=c++20 -fno-exceptions -c -o out/elf/arch-i386.o elf/arch-i386.cc
[   37s] g++ -DMOLD_VERSION=\"1.0.1\" -DLIBDIR="\"/usr/lib64\"" -Ithird-party/mimalloc/include  -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wno-sign-compare -pthread -fPIE -fno-unwind-tables -fno-asynchronous-unwind-tables  -std=c++20 -fno-exceptions -c -o out/elf/arch-arm64.o elf/arch-arm64.cc
[   37s] g++ -DMOLD_VERSION=\"1.0.1\" -DLIBDIR="\"/usr/lib64\"" -Ithird-party/mimalloc/include  -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wno-sign-compare -pthread -fPIE -fno-unwind-tables -fno-asynchronous-unwind-tables  -std=c++20 -fno-exceptions -c -o out/elf/arch-x86-64.o elf/arch-x86-64.cc
[   38s] g++ -DMOLD_VERSION=\"1.0.1\" -DLIBDIR="\"/usr/lib64\"" -Ithird-party/mimalloc/include  -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -Wno-sign-compare -pthread -fPIE -fno-unwind-tables -fno-asynchronous-unwind-tables  -std=c++20 -fno-exceptions -c -o out/elf/gc-sections.o elf/gc-sections.cc
[   38s] elf/gc-sections.cc:30:19: error: 'tbb::feeder' has not been declared
[   38s]    30 |                   tbb::feeder<InputSection<E> *> &feeder, i64 depth) {
[   38s]       |                   ^~~
[   38s] elf/gc-sections.cc:30:30: error: expected ',' or '...' before '<' token
[   38s]    30 |                   tbb::feeder<InputSection<E> *> &feeder, i64 depth) {
[   38s]       |                              ^
[   38s] elf/gc-sections.cc: In function 'void mold::elf::visit(mold::elf::Context<E>&, mold::elf::InputSection<E>*, int)':
[   38s] elf/gc-sections.cc:47:11: error: 'feeder' was not declared in this scope
[   38s]    47 |           feeder.add(sym->input_section);
[   38s]       |           ^~~~~~
[   38s] elf/gc-sections.cc:64:9: error: 'depth' was not declared in this scope
[   38s]    64 |     if (depth < 3)
[   38s]       |         ^~~~~
[   38s] elf/gc-sections.cc:65:37: error: 'feeder' was not declared in this scope
[   38s]    65 |       visit(ctx, sym.input_section, feeder, depth + 1);
[   38s]       |                                     ^~~~~~
[   38s] elf/gc-sections.cc:67:7: error: 'feeder' was not declared in this scope
[   38s]    67 |       feeder.add(sym.input_section);
[   38s]       |       ^~~~~~
[   38s] elf/gc-sections.cc: In function 'void mold::elf::mark(mold::elf::Context<E>&, tbb::concurrent_vector<mold::elf::InputSection<E>*>&)':
[   38s] elf/gc-sections.cc:145:37: error: 'tbb::feeder' has not been declared
[   38s]   145 |                                     tbb::feeder<InputSection<E> *> &feeder) {
[   38s]       |                                     ^~~
[   38s] elf/gc-sections.cc:145:48: error: expected ',' or '...' before '<' token
[   38s]   145 |                                     tbb::feeder<InputSection<E> *> &feeder) {
[   38s]       |                                                ^
[   38s] elf/gc-sections.cc: In lambda function:
[   38s] elf/gc-sections.cc:146:22: error: 'feeder' was not declared in this scope
[   38s]   146 |     visit(ctx, isec, feeder, 0);
[   38s]       |                      ^~~~~~
[   38s] In file included from elf/gc-sections.cc:8:
[   38s] /usr/include/tbb/parallel_for_each.h: In instantiation of 'void tbb::internal::parallel_for_each_body_for<Function, Iterator>::operator()(tbb::blocked_range<Index>) const [with Function = mold::elf::mark<mold::elf::ARM64>(mold::elf::Context<mold::elf::ARM64>&, tbb::concurrent_vector<mold::elf::InputSection<mold::elf::ARM64>*, tbb::cache_aligned_allocator<mold::elf::InputSection<mold::elf::ARM64>*> >&)::<lambda(mold::elf::InputSection<mold::elf::ARM64>*, int)>; Iterator = tbb::internal::vector_iterator<tbb::concurrent_vector<mold::elf::InputSection<mold::elf::ARM64>*, tbb::cache_aligned_allocator<mold::elf::InputSection<mold::elf::ARM64>*> >, mold::elf::InputSection<mold::elf::ARM64>*>]':

@rui314
Copy link
Owner

rui314 commented Jan 10, 2022

Currently I have only x86-64 and ARM64 machines, so I'd say s390 isn't on our supported host list. If you can fix this compilation error, I'm happy to apply a patch though.

@ktdreyer
Copy link

I ran into this same issue. By the way I'm packaging mold for Fedora at https://copr.fedorainfracloud.org/coprs/ktdreyer/mold/ , are you a Fedora packager who can review this if I submit it to the distro?

@rui314
Copy link
Owner

rui314 commented Jan 12, 2022

I'm not a Fedora packager nor a Fedora user, and I know nothing about its packaging system. So I don't think I'm a right person to review your change.

@sicherha
Copy link
Contributor

@ktdreyer, I'm in the process of packaging mold for Fedora. The current progress is being tracked here: https://bugzilla.redhat.com/show_bug.cgi?id=2036468

@sicherha
Copy link
Contributor

As for s390x support, I'm not sure it makes a lot of sense to package mold for a platform for which it cannot produce native binaries. That should probably be debated over at the Red Hat Bugzilla rather than here.

@marxin
Copy link
Sponsor Contributor Author

marxin commented Sep 18, 2022

@rui314 Can you please describe if you plan to support this target?
Note it's a target most commercial distros (RHEL, SLES) do support.

@rui314
Copy link
Owner

rui314 commented Sep 18, 2022

I'm trying to get a support to support s390 and POWER (especially POWER10) from IBM. I'll update this bug once the situation changes.

@marxin
Copy link
Sponsor Contributor Author

marxin commented Sep 18, 2022

Great. Do you speak about getting access to a machine you can use for testing?

@rui314
Copy link
Owner

rui314 commented Oct 5, 2022

I just started working on it yesterday. Until then I knew nothing about s390x and zArchitecture, but somehow I managed to self-host mold on a real s390x machine today! So I think this item is done.

@rui314 rui314 closed this as completed Oct 5, 2022
@marxin
Copy link
Sponsor Contributor Author

marxin commented Oct 5, 2022

Nice work! I've just read the comment at elf/arch-s390.cc and yes, we as SUSE have quite some customers who run safety-critical systems on the platform. Mostly being used by banks and similar types of clients.

@rui314
Copy link
Owner

rui314 commented Oct 5, 2022

Yup. I hope to make support contracts with such users to make this project viable.

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

4 participants