#7864: libfplll tries to link 64-bit objects to 32-bit libstdc++.so
------------------------+---------------------------------------------------
   Reporter:  drkirkby  |       Owner:  drkirkby  
       Type:  defect    |      Status:  new       
   Priority:  major     |   Milestone:  sage-4.3.1
  Component:  solaris   |    Keywords:            
Work_issues:            |      Author:            
   Upstream:  N/A       |    Reviewer:            
     Merged:            |  
------------------------+---------------------------------------------------
 == Build environment ==
  * Sun Ultra 27 3.333 GHz Intel Xeon. 12 GB RAM
  * !OpenSolaris 2009.06 snv_111b X86
  * Sage 4.3.1.alpha1 (with a few packages hacked to work on 64-bit)
  * gcc 4.3.4 configured with Sun linker and GNU assembler from binutils
 version 2.20.
  * 64-bit build. SAGE64 was set to yes, plus various other tricks to get
 -m64 into packages.

  == The problem ==
 Despite the fact all the objects file (.o) are created 64-bit (as
 intended), the final link phase tries to link against a 32-bit library
 {{{
  /usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/lib/libstdc++.so
 }}}
 rather than the 64-bit version:
 {{{
 /usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/lib/amd64/libstdc
 }}}
 I don't understand why Here is the the failed part of the build.
 {{{
 if g++ -DPACKAGE_NAME=\"libfplll\" -DPACKAGE_TARNAME=\"libfplll\"
 -DPACKAGE_VERSION=\"3.0.12\" -DPACKAGE_STRING=\"libfplll\ 3.0.12\"
 -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"libfplll\" -DVERSION=\"3.0.12\"
 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -DSTDC_HEADERS=1 -DHAVE_FLOAT_H=1
 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1
 -DHAVE_STDBOOL_H=1 -DHAVE_FLOOR=1 -DHAVE_POW=1 -DHAVE_RINT=1 -DHAVE_SQRT=1
 -DHAVE_STRTOL=1 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -I. -I.  -DFAST_BUILD
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/  -m64 -fPIC
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/
 -L/export/home/drkirkby/sage-4.3.1.alpha1/local/lib -MT fplll_micro-
 topenum.o -MD -MP -MF ".deps/fplll_micro-topenum.Tpo" -c -o fplll_micro-
 topenum.o `test -f 'topenum.cpp' || echo './'`topenum.cpp; \
         then mv -f ".deps/fplll_micro-topenum.Tpo" ".deps/fplll_micro-
 topenum.Po"; else rm -f ".deps/fplll_micro-topenum.Tpo"; exit 1; fi
 /bin/sh ../libtool --tag=CXX --mode=link g++  -m64 -fPIC
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/
 -L/export/home/drkirkby/sage-4.3.1.alpha1/local/lib   -o fplll_micro
 fplll_micro-main.o fplll_micro-enumerate.o fplll_micro-evaluator.o
 fplll_micro-solver.o fplll_micro-tools.o fplll_micro-topenum.o  -lmpfr
 -lgmp -lmpfr -lgmp
 g++ -m64 -fPIC -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/ -o
 fplll_micro fplll_micro-main.o fplll_micro-enumerate.o fplll_micro-
 evaluator.o fplll_micro-solver.o fplll_micro-tools.o fplll_micro-topenum.o
 -L/export/home/drkirkby/sage-4.3.1.alpha1/local/lib
 /export/home/drkirkby/sage-4.3.1.alpha1/local/lib/libmpfr.so
 /export/home/drkirkby/sage-4.3.1.alpha1/local/lib/libgmp.so -Wl,-R
 -Wl,/export/home/drkirkby/sage-4.3.1.alpha1/local/lib -Wl,-R
 -Wl,/export/home/drkirkby/sage-4.3.1.alpha1/local/lib
 make[3]: Leaving directory
 `/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/libfplll-3.0.12.p0/src/src'
 make[3]: Entering directory
 `/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/libfplll-3.0.12.p0/src'
 if /bin/sh ./libtool --tag=CXX --mode=compile g++
 -DPACKAGE_NAME=\"libfplll\" -DPACKAGE_TARNAME=\"libfplll\"
 -DPACKAGE_VERSION=\"3.0.12\" -DPACKAGE_STRING=\"libfplll\ 3.0.12\"
 -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"libfplll\" -DVERSION=\"3.0.12\"
 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -DSTDC_HEADERS=1 -DHAVE_FLOAT_H=1
 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1
 -DHAVE_STDBOOL_H=1 -DHAVE_FLOOR=1 -DHAVE_POW=1 -DHAVE_RINT=1 -DHAVE_SQRT=1
 -DHAVE_STRTOL=1 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -I. -I.
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/  -m64 -fPIC
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/
 -L/export/home/drkirkby/sage-4.3.1.alpha1/local/lib -MT dummy.lo -MD -MP
 -MF ".deps/dummy.Tpo" -c -o dummy.lo dummy.cpp; \
         then mv -f ".deps/dummy.Tpo" ".deps/dummy.Plo"; else rm -f
 ".deps/dummy.Tpo"; exit 1; fi
 mkdir .libs
  g++ "-DPACKAGE_NAME=\"libfplll\"" "-DPACKAGE_TARNAME=\"libfplll\""
 "-DPACKAGE_VERSION=\"3.0.12\"" "-DPACKAGE_STRING=\"libfplll 3.0.12\""
 "-DPACKAGE_BUGREPORT=\"\"" "-DPACKAGE=\"libfplll\"" "-DVERSION=\"3.0.12\""
 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -DSTDC_HEADERS=1 -DHAVE_FLOAT_H=1
 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1
 -DHAVE_STDBOOL_H=1 -DHAVE_FLOOR=1 -DHAVE_POW=1 -DHAVE_RINT=1 -DHAVE_SQRT=1
 -DHAVE_STRTOL=1 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -I. -I.
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/ -m64 -fPIC
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/
 -L/export/home/drkirkby/sage-4.3.1.alpha1/local/lib -MT dummy.lo -MD -MP
 -MF .deps/dummy.Tpo -c dummy.cpp  -fPIC -DPIC -o .libs/dummy.o
 In file included from src/main.h:27,
                  from dummy.cpp:11:
 src/fplll.h:29:1: warning: "NAN" redefined
 In file included from src/defs.h:36,
                  from src/util.h:29,
                  from src/lexer.h:26,
                  from src/main.h:26,
                  from dummy.cpp:11:
 src/dpe.h:30:1: warning: this is the location of the previous definition
  g++ "-DPACKAGE_NAME=\"libfplll\"" "-DPACKAGE_TARNAME=\"libfplll\""
 "-DPACKAGE_VERSION=\"3.0.12\"" "-DPACKAGE_STRING=\"libfplll 3.0.12\""
 "-DPACKAGE_BUGREPORT=\"\"" "-DPACKAGE=\"libfplll\"" "-DVERSION=\"3.0.12\""
 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1
 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -DSTDC_HEADERS=1 -DHAVE_FLOAT_H=1
 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1
 -DHAVE_STDBOOL_H=1 -DHAVE_FLOOR=1 -DHAVE_POW=1 -DHAVE_RINT=1 -DHAVE_SQRT=1
 -DHAVE_STRTOL=1 -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -I. -I.
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/ -m64 -fPIC
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/
 -L/export/home/drkirkby/sage-4.3.1.alpha1/local/lib -MT dummy.lo -MD -MP
 -MF .deps/dummy.Tpo -c dummy.cpp -o dummy.o >/dev/null 2>&1
 /bin/sh ./libtool --tag=CXX --mode=link g++  -m64 -fPIC
 -I/export/home/drkirkby/sage-4.3.1.alpha1/local/include/
 -L/export/home/drkirkby/sage-4.3.1.alpha1/local/lib   -o libfplll.la
 -rpath /export/home/drkirkby/sage-4.3.1.alpha1/local/lib -version-info
 1:0:1 dummy.lo -lgmp -lmpfr -lmpfr -lgmp -lmpfr -lgmp
 g++ -shared -nostdlib  /usr/lib/amd64/crti.o /usr/lib/amd64/values-Xa.o
 /usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/lib/gcc/i386-pc-
 solaris2.11/4.3.4/amd64/crtbegin.o  .libs/dummy.o  -Wl,-R
 -Wl,/export/home/drkirkby/sage-4.3.1.alpha1/local/lib -Wl,-R
 -Wl,/usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/lib -Wl,-R
 -Wl,/export/home/drkirkby/sage-4.3.1.alpha1/local/lib -Wl,-R
 -Wl,/usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/lib
 -L/export/home/drkirkby/sage-4.3.1.alpha1/local/lib
 /export/home/drkirkby/sage-4.3.1.alpha1/local/lib/libmpfr.so
 /export/home/drkirkby/sage-4.3.1.alpha1/local/lib/libgmp.so
 -L/usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/lib/gcc/i386-pc-
 solaris2.11/4.3.4/amd64 -L/usr/local/gcc-4.3.4-GNU-assembler-Sun-
 linker/lib/gcc/i386-pc-solaris2.11/4.3.4/../../../amd64 -L/lib/amd64
 -L/usr/lib/amd64 -L/usr/local/gcc-4.3.4-GNU-assembler-Sun-
 linker/lib/gcc/i386-pc-solaris2.11/4.3.4 -L/usr/local/gcc-4.3.4-GNU-
 assembler-Sun-linker/lib/gcc/i386-pc-solaris2.11/4.3.4/../../..
 /usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/lib/libstdc++.so -lm -lgcc_s
 /usr/local/gcc-4.3.4-GNU-assembler-Sun-linker/lib/gcc/i386-pc-
 solaris2.11/4.3.4/amd64/crtend.o /usr/lib/amd64/crtn.o  -m64 -Wl,-h
 -Wl,libfplll.so.0 -o .libs/libfplll.so.0.1.0
 ld: fatal: file /usr/local/gcc-4.3.4-GNU-assembler-Sun-
 linker/lib/libstdc++.so: wrong ELF class: ELFCLASS32
 ld: fatal: file processing errors. No output written to
 .libs/libfplll.so.0.1.0
 collect2: ld returned 1 exit status
 make[3]: *** [libfplll.la] Error 1
 make[3]: Leaving directory
 `/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/libfplll-3.0.12.p0/src'
 make[2]: *** [all-recursive] Error 1
 make[2]: Leaving directory
 `/export/home/drkirkby/sage-4.3.1.alpha1/spkg/build/libfplll-3.0.12.p0/src'
 Error building libfplll

 real    0m22.114s
 user    0m16.829s
 sys     0m4.053s
 sage: An error occurred while installing libfplll-3.0.12.p0
 }}}
  == Workaround ==
 A workaround is to delete the library, then create a link to the same
 library in the amd64 directory. But this is a hack, and obviously means
 gcc would not work properly for 32-bit builds in this case.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7864>
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