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

Fix position location code - linking fmt occurs error suggesting recompile with -fPIC #3981

Closed
wants to merge 1 commit into from

Conversation

lucassdiass
Copy link

Linking with fmt could to get a error like
the following:
/usr/local/lib/libfmt.a(format.cc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

To fix it, CMAKE_POSITION_INDEPENDENT_CODE must be configured.

Linking with fmt could to get a error like
the following:
/usr/local/lib/libfmt.a(format.cc.o): relocation R_X86_64_PC32
against symbol `stderr@@GLIBC_2.2.5' can not be used when making
a shared object; recompile with -fPIC

To fix it, CMAKE_POSITION_INDEPENDENT_CODE must be configured.

Signed-off-by: Lucas Dias <[email protected]>
@vitaut
Copy link
Contributor

vitaut commented May 27, 2024

Thanks for the PR but it doesn't need to be set as the default, you can set it when compiling {fmt} if necessary (e.g. when linking into a shared library).

@vitaut vitaut closed this May 27, 2024
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

Successfully merging this pull request may close these issues.

2 participants