#9833: fatal relocation error with Cliquer library on 64-bit Solaris and
OpenSolaris
------------------------+---------------------------------------------------
   Reporter:  drkirkby  |       Owner:  drkirkby
       Type:  defect    |      Status:  new     
   Priority:  major     |   Milestone:  sage-4.6
  Component:  solaris   |    Keywords:          
     Author:            |    Upstream:  N/A     
   Reviewer:            |      Merged:          
Work_issues:            |  
------------------------+---------------------------------------------------
 If a 64-bit version of Sage is built on !OpenSolaris, Sage reports an
 error as soon as it is started.

 {{{
 drkir...@hawk:~$ 64/sage-4.5.3.alpha2/sage
 ----------------------------------------------------------------------
 | Sage Version 4.5.3.alpha2, Release Date: 2010-08-23                |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 **********************************************************************
 *                                                                    *
 * Warning: this is a prerelease version, and it may be unstable.     *
 *                                                                    *
 **********************************************************************

 <snip>

 ImportError: ld.so.1: python: fatal: relocation error: R_AMD64_PC32: file
 /export/home/drkirkby/64/sage-4.5.3.alpha2/local/lib//libcliquer.so:
 symbol main: value 0x28152e8c7d4 does not fit
 Error importing ipy_profile_sage - perhaps you should run %upgrade?
 WARNING: Loading of ipy_profile_sage failed.
 }}}

 The problem of fatal relocation errors is discussed on this
 [http://blogs.sun.com/rie/entry/my_relocations_don_t_fit Sun blog] by Rod
 Evans.

 A shared library should show no output from the following command:

 {{{
 $ elfdump -d library | fgrep TEXTREL
 }}}

 But in a 64-bit builds of Sage on both !OpenSolaris x64 and Solaris 10 on
 SPARC, but show output. The following is from an !OpenSolaris machine, but
 similar is seen on a 64-bit SPARC build of Sage.

 {{{
 drkir...@hawk:~$ elfdump -d 64/sage-4.5.3.alpha2/local/lib/libcliquer.so
 | grep TEXTREL
       [17]  TEXTREL           0
       [25]  FLAGS             0x4                 [ TEXTREL ]
 drkir...@hawk:~$
 }}}

 If this flag is found, then the link-editor thinks this file contains non-
 pic code.

 Looking at the way the shared library is built on Solaris, it is different
 from other platforms.

 {{{
 # Flags for building a dynamically linked shared object.
 SAGESOFLAGS=" "
 if [ "$UNAME" = "Linux" ] || [ "$UNAME" = "FreeBSD" ]; then
     SAGESOFLAGS="-shared -Wl,-soname,libcliquer.so"
     export SAGESOFLAGS
 elif [ "$UNAME" = "Darwin" ]; then
     MACOSX_DEPLOYMENT_TARGET="10.3"
     export MACOSX_DEPLOYMENT_TARGET
     SAGESOFLAGS="-dynamiclib -single_module -flat_namespace -undefined
 dynamic_l
 ookup"
     export SAGESOFLAGS
 elif [ "$UNAME" = "SunOS" ]; then
     SAGESOFLAGS="-G -Bdynamic"
     export SAGESOFLAGS
 elif [ "$UNAME" = "CYGWIN" ]; then
     SAGESOFLAGS="-shared -Wl,-soname,libcliquer.so"
 }}}

 Using just

 {{{
 elif [ "$UNAME" = "SunOS" ]; then
    SAGESOFLAGS="-shared"
 }}}

 was sufficient to produce a shared library which did not exhibit this
 problem. When Sage was started, Sage no longer produced the libcliquer
 error message, though it did fail to run properly.

 There are in fact several other libraries in Sage that show show output
 using the {{{elfdump}}} command above.

 {{{
  * libcliquer.so
  * libecl.so
  * libgroebner-0.6.4.so
  * libpboriCudd-0.6.4.so
  * libpolybori-0.6.4.so
 }}}
 (These were observed on !OpenSolaris x64. I've confirmed the same is true
 of libcliquer.so on 64-bit SPARC using {{{t2.math}}}, but I've not
 verified if all the other libraries show this problem. )

 I doubt whether these are the only issues preventing Sage running properly
 on 64-bit Solaris, but these should be resolved.

 Since
  * The current version of Cliquer in Sage 1.2 is not the latest.
  * Cliquer 1.2.1 is a bug-fix only release, so should be safe.
  * The Cliquer test suite can't be run as there's no {{{spkg-check}}} file
 - see #9767

 it makes sense to update Cliquer and sort out the Solaris and {{{spkg-
 check}}} issues at the same time.

 Dave

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9833>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to