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

Linker error: SHF_MERGE section size (456) must be a multiple of sh_entsize (32) #156

Open
MattOslinKodiak opened this issue Apr 5, 2022 · 4 comments

Comments

@MattOslinKodiak
Copy link

When trying to link the library to do a very basic test, I'm getting the following linker error (this is on clang 12.0.1):

ld.lld: error: bazel-out/main_compute-opt/bin/external/blasfeo/blasfeo/lib/libblasfeo.a(kernel_dgemm_12x4_lib4.o):(.rodata.cst32): SHF_MERGE section size (456) must be a multiple of sh_entsize (32)

@giaf any ideas how to resolve this? I'm seeing this in both release 0.1.2 and 0.1.3 (I prefer 0.1.2 as HPIPM does not seem to compile with 0.1.3).

@MattOslinKodiak
Copy link
Author

This seems to be specific to the avx2 kernel, the generic c kernel does not have this issue.

@giaf
Copy link
Owner

giaf commented Apr 5, 2022

Hi, I've never encountered such an issue.
It may be something very specific about your target architecture / OS / compiler / static or shared library combination.
And yes, it is expected that the issue only appears in the assembly kernels (as used e.g. in avx2, avx and sse3 kernels) since these are hard-coded by me; the generic kernel only uses C code, so the compiler takes care of producing the correct object code for the specific platform.
Can you share some more details about your platform?

@MattOslinKodiak
Copy link
Author

Thanks for the reply! This is on an Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz processor, which supports avx2

@giaf
Copy link
Owner

giaf commented Apr 28, 2022

Sorry for the late reply.

I installed clang-12 on ubuntu 20.04 but I could not replicate the issue.

This is most likely specific to some (predefined) compiler flag.
Probably the compiler / linker is attempting at merging the read-only data section from different assembly source files (the generic target doesn't use assembly in the kernels, that's why there is no issue there), and it is somehow not happy about something there.
You could try to add some assembler / compiler / linker flag to disable sections merging, e.g. something similar to https://stackoverflow.com/questions/46688618/how-to-switch-off-local-array-merging-in-clang
I'm sorry but since I can not reproduce the issue I can't give much more specific answers.
If you find a solution, please share it here.

About HPIPM not compiling with BLASFEO 0.1.3, could you report what the issue is?

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