Shared libraries should use -fPIC
marzojr opened this issue · comments
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.
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.