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

Shared libraries should use -fPIC #88

Open
marzojr opened this issue Apr 10, 2022 · 1 comment
Open

Shared libraries should use -fPIC #88

marzojr opened this issue Apr 10, 2022 · 1 comment

Comments

@marzojr
Copy link
Contributor

marzojr commented Apr 10, 2022

The shared libraries should use -fPIC flag. This helps security (by allowing address space layout randomization to be used with the libraries)m but it also helps when building libraries that link to libmt32emu.

This can be easily set on cmake by using the following:

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

at the appropriate location on one of the CMakeLists.txt files.

@sergm
Copy link
Member

sergm commented Apr 12, 2022

I don't get why this is an issue. When a shared library is built, position independent code must be generated by default, see CMake documentation. Besides, even in case the default does not apply, the aforementioned variable can be easily set to the required value in cmake command line or via the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants