#73 Solaris: linking fails due to relocations

open
nobody
5
2009-09-29
2009-09-29
Thorsten Hirsch
No

Compiling strigi on OpenSolaris with gcc 3.4.2 leads to a lot of "relocations remain against allocatable but non-writable sections" error. I've attached the full output. I'm not sure what the error is about, seems like it has something to do with position-independent code as you can see here: http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWdev/LLM/p24.html

OpenSolaris snv_123 / 32bit / gcc 3.4.2 / gnu binutils (ld) / gnu make

By the way: thank you for the quick fix concerning my last bug report, Sebastian.

Discussion

  • relocation errors on OpenSolaris

     
    Attachments
  • A guy in #opensolaris told me, that it looks as if the linker doesn't include the correct library paths, because even the basic functions fopen, fprintf, ... are listed. And in the kdesupport/strigi/src/streamanalyzer/CmakeLists.txt are a lot of lines that could mean what lib pathes to use ...sorry, i have no idea what these lines really mean. Please have a look into the CMakeListst.txt.

     
  • Hooray, I got it! I'll attach a patch.

     
  • patch so that strigi will compile on solaris

     
    Attachments
  • I've got a better idea for the patch. Look at how solaris / gcc is being checked in ./kdesupport/qimageblitz/blitz/CMakeLists.txt:

    if (NOT CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME MATCHES SunOS)
    target_link_libraries(qimageblitz -lm -lsunmath)
    endif (NOT CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME MATCHES SunOS)

    I think you should also just include "NOT CMAKE_COMPILER_IS_GNUCXX AND" in your CMakeLists.txt.