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

Generated tests cannot be run when PIE flag is present in compile_commands.json #618

Closed
IDKWNTCMF opened this issue Aug 9, 2023 · 0 comments · Fixed by #619
Closed

Generated tests cannot be run when PIE flag is present in compile_commands.json #618

IDKWNTCMF opened this issue Aug 9, 2023 · 0 comments · Fixed by #619
Labels
bug Something isn't working

Comments

@IDKWNTCMF
Copy link
Collaborator

Description
We often want to compile object files with PIC flag, so we add it to corresponding compile commands. However it can be overriden if PIE flag is used in source compile commands.

To Reproduce
Steps to reproduce the behavior:

  1. Open the libyang project in IDE
  2. Use plugin to generate tests
    *2.1 Remove initialization of thread-local variables in log_wrapper.c if UTBotCpp does not support thread-local variables #616 is not resolved yet
  3. Run generated tests

Expected behavior
Tests are supposed to be executed successfully.

Actual behavior
Linker error.

Visual proofs (screenshots, logs)

error: /home/utbot/libyang/utbot_tests/makefiles/src/../../../build/utbot_files/utbot_build/recompiled/tests/style/CMakeFiles/cpp_compat.dir/cpp_compat.c.o: requires dynamic R_X86_64_PC32 reloc against 'main__' which may overflow at runtime; recompile with -fPIC
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
@IDKWNTCMF IDKWNTCMF added the bug Something isn't working label Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant