Poppler-23.09.0 fails to build on Solaris
poppler-23.09.0 fails to build with following error on Solaris:
[ 48%] Linking CXX shared library libpoppler.so
ld: fatal: option --version-script requires option -z gnu-version-script-compat to be specified
collect2: error: ld returned 1 exit status
CMakeLists.txt contains this:
if(UNIX AND (NOT APPLE))
set_target_properties(poppler PROPERTIES LINK_OPTIONS LINKER:--version-script=${LINKER_SCRIPT})
endif()
I tried to use -z gnu-version-script-compat
as suggested, but it is failing with following error:
[ 64%] Linking CXX executable pdfseparate
Undefined first referenced
symbol in file
__iob CMakeFiles/pdfseparate.dir/parseargs.cc.o (symbol belongs to unavailable version ../libpoppler.so.131.0.0 ((null)))
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
To be honest I don't understand the latter issue at all, so the only way I was able to workaround that was to ifdef it this way:
-if(UNIX AND (NOT APPLE))
+if(UNIX AND (NOT APPLE AND NOT CMAKE_HOST_SOLARIS))
Solaris has specific ld which tries to be compatible with GNU ld, but for some reason doesn't behave in the same way here.
Is this linker setting important or is it just fine to merge the change above to make it build, please?
Thank you, Martin