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
Invalid libefivar.so generated when building with clang-15. #234
Comments
nvinson
added a commit
to nvinson/efivar
that referenced
this issue
Oct 11, 2022
The current implementation attempts to use the linker to create aliases for efi_well_known_guids and efi_well_known_names. It also tries to use the linker to generate the variables efi_well_known_guids_end and efi_well_known_names_end. When building with clang, the generated linker result results in a broken libefivar.so that causes programs to segfault when linked against it. This change does away with linker script hacker and instead introduces pointers to store the locations of efi_well_known_guids_end and efi_well_known_names_end. Additionally, efi_well_known_guids and efi_well_known_names are now created as pointers that point to the beginning of their respective arrays. Signed-off-by: Nicholas Vinson <nvinson234@gmail.com> Fixes: rhboot#234
nvinson
added a commit
to nvinson/efivar
that referenced
this issue
Oct 12, 2022
The current implementation attempts to use the linker to create aliases for efi_well_known_guids and efi_well_known_names. It also tries to use the linker to generate the variables efi_well_known_guids_end and efi_well_known_names_end. When building with clang, the generated linker result results in a broken libefivar.so that causes programs to segfault when linked against it. This change does away with linker script hacker and instead introduces pointers to store the locations of efi_well_known_guids_end and efi_well_known_names_end. Additionally, efi_well_known_guids and efi_well_known_names are now created as pointers that point to the beginning of their respective arrays. Signed-off-by: Nicholas Vinson <nvinson234@gmail.com> Fixes: rhboot#234
tpgxyz
added a commit
to OpenMandrivaAssociation/efivar
that referenced
this issue
Oct 30, 2022
tpgxyz
added a commit
to OpenMandrivaAssociation/efivar
that referenced
this issue
Oct 30, 2022
tpgxyz
added a commit
to OpenMandrivaAssociation/efivar
that referenced
this issue
Oct 30, 2022
tpgxyz
added a commit
to OpenMandrivaAssociation/efivar
that referenced
this issue
Oct 30, 2022
Hi, just to confirm that with this PR i'm able to compile efivar with LLVM/clang-15.0.3. |
frozencemetery
pushed a commit
that referenced
this issue
Feb 6, 2023
The current implementation attempts to use the linker to create aliases for efi_well_known_guids and efi_well_known_names. It also tries to use the linker to generate the variables efi_well_known_guids_end and efi_well_known_names_end. When building with clang, the generated linker result results in a broken libefivar.so that causes programs to segfault when linked against it. This change does away with linker script hacker and instead introduces pointers to store the locations of efi_well_known_guids_end and efi_well_known_names_end. Additionally, efi_well_known_guids and efi_well_known_names are now created as pointers that point to the beginning of their respective arrays. Signed-off-by: Nicholas Vinson <nvinson234@gmail.com> Fixes: #234
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
description
When building with clang-15, the generated libefivar.so library is broken. The broken library causes applications to link to it to segfault on start.
steps to reproduce
CFLAGS="-march=native -O2 -pipe -ggdb" CXXFLAGS="-march=native -O2 -pipe -ggdb" CC=clang LD=ld.lld LDFLAGS="-Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind" make
clang -Wl,-rpath,$PWD/src -Lsrc/ test.c -o test -lefivar
Expected results
the test binary returns the libefivar version number.
Actual results
the test binary segfaults.
Additional notes
test.c:
clang -v
ld.lld -v
The text was updated successfully, but these errors were encountered: