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

building with clang for alpine fails on x86_64 and x86 with linking errors #89

Closed
a16bitsysop opened this issue Jan 30, 2022 · 4 comments

Comments

@a16bitsysop
Copy link

I tried building with clang as gcc tunes too much for arm64 so it fails at runtime with rspamd.

When attempting to build with clang 12.0.1 it also has lots of nm errors for x86_86 and x86 finding glibc:

'libc.so.6': No such file
471nm: 'libc.so.6': No such file

Then at the end it has lots of linker errors, aarch64 compiles fine with clang.

https://gitlab.alpinelinux.org/a16bitsysop/aports/-/jobs/611687

When using gcc 11.2.1 on arm64 (https://gitlab.alpinelinux.org/a16bitsysop/aports/-/jobs/605071/raw )is sets these:

-- gcc version 11.2.1
CMake Warning at CMakeLists.txt:185 (message):
  Something went wrong determining gcc tune:
  -mtune=armv8.2-a+crypto+fp16+rcpc+dotprod+ssbs not valid, falling back to
  -mtune=native

then further down
-- Building for current host CPU: -march=armv8.2-a+crypto+fp16+rcpc+dotprod+ssbs -mtune=native

So I have created a temporary patch:
https://gitlab.alpinelinux.org/alpine/aports/-/blob/1d08133a1b57f07565f7a679210c24db09681a32/community/vectorscan/armv8.patch

So I can build with gcc.

@a16bitsysop
Copy link
Author

libmusl does not support ifunc, it is disabled in gcc for musl but it is still enabled in clang

@markos
Copy link

markos commented Feb 13, 2022

ifunc is an important feature necessary for fat runtime to work. If musl does not support this, then you will have to disable fat runtime for this platform.

@a16bitsysop
Copy link
Author

Yes I have created a patch to disable. I had several goes at re doing the FAT_RUNTIME logic in CMakeLists.txt, as currently if FAT_RUNTIME=OFF is used it is enabled anyway if FAT_RUNTIME_REQUISITES is true.

So if you compile with a compiler that passes this test FAT_RUNTIME cannot be disabled without patching.

I couldn’t get it to work with the dependant option and made the opposite happen so it was always disabled.

@markos
Copy link

markos commented Apr 18, 2022

Merged #94, so closing this.

@markos markos closed this as completed Apr 18, 2022
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

2 participants