#5026 Solaris build fails: TclBN_mp_init_set_int not found

obsolete: 8.5.11
open-works-for-me
5
2012-05-04
2012-05-02
Mark
No

This occurs on Solaris 10 + 11 x86 and SPARC, using the Sun Studio 12.x compilers.

[...]
cc -c -O -I/usr/local/include -L/usr/local/lib -KPIC -I"." -I/var/tmp/tcl8.5.11/unix/../unix -I/var/tmp/tcl8.5.11/unix/../generic -I/var/tmp/tcl8.5.11/unix/../libtommath -DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.5\" -DPACKAGE_STRING=\"tcl\ 8.5\" -DPACKAGE_BUGREPORT=\"\" -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_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -D_REENTRANT=1 -D_POSIX_PTHREAD_SEMANTICS=1 -DTCL_SHLIB_EXT=\".so\" -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_DIRENT64=1 -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETADDRINFO=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_BLKCNT_T=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -DTCL_UNLOAD_DLLS=1 /var/tmp/tcl8.5.11/unix/../unix/tclAppInit.c
cc -O -I/usr/local/include -L/usr/local/lib -I/usr/local/include -L/usr/local/lib tclAppInit.o -L/var/tmp/tcl8.5.11/unix -ltcl8.5 -ldl -lsocket -lnsl -lsunmath -lm \ -Wl,-R,/tcl/lib -o tclsh

host:/var/tmp/tcl8.5.11/unix root# gmake install
Making directory /tcl/lib
Making directory /tcl/bin
Installing libtcl8.5.so to /tcl/lib/
Installing tclsh as /tcl/bin/tclsh8.5
Installing tclConfig.sh to /tcl/lib/
Installing libtclstub8.5.a to /tcl/lib/
Installing message catalogs
ld.so.1: tclsh: fatal: relocation error: file /var/tmp/tcl8.5.11/unix/libtcl8.5.so: symbol TclBN_mp_init_set_int: referenced symbol not found
gmake: *** [install-msgs] Killed

# nm libtcl8.5.so
[...]
[2646] | 1124908| 172|FUNC |GLOB |0 |9 |TclBN_mp_grow
[2287] | 1125104| 104|FUNC |GLOB |0 |9 |TclBN_mp_init
[2428] | 1125208| 52|FUNC |GLOB |0 |9 |TclBN_mp_init_copy
[1683] | 1125260| 204|FUNC |GLOB |0 |9 |TclBN_mp_init_multi
[2324] | 1125464| 48|FUNC |GLOB |0 |9 |TclBN_mp_init_set
[1516] | 0| 0|FUNC |GLOB |0 |UNDEF |TclBN_mp_init_set_int
[1807] | 1125580| 156|FUNC |GLOB |0 |9 |TclBN_mp_init_size
[2640] | 1125736| 2720|FUNC |GLOB |0 |9 |TclBN_mp_karatsuba_mul
[2083] | 1128456| 1688|FUNC |GLOB |0 |9 |TclBN_mp_karatsuba_sqr
[2735] | 1130168| 892|FUNC |GLOB |0 |9 |TclBN_mp_lshd
[2170] | 1131060| 144|FUNC |GLOB |0 |9 |TclBN_mp_mod
[...]

host:/var/tmp/tcl8.5.11 root# find . -print | xargs grep TclBN_mp_init_set_int
./generic/tclTomMathDecls.h:#define mp_init_set_int TclBN_mp_init_set_int
./generic/tclTomMathDecls.h:#ifndef TclBN_mp_init_set_int_TCL_DECLARED
./generic/tclTomMathDecls.h:#define TclBN_mp_init_set_int_TCL_DECLARED
./generic/tclTomMathDecls.h:EXTERN int TclBN_mp_init_set_int(mp_int*a, unsigned long i);
./generic/tclTomMathDecls.h:#ifndef TclBN_mp_init_set_int
./generic/tclTomMathDecls.h:#define TclBN_mp_init_set_int \ ./generic/tclStubInit.c: TclBN_mp_init_set_int, /* 61 */
./generic/tclTomMath.decls: int TclBN_mp_init_set_int(mp_int* a, unsigned long i)

Discussion

  • Don Porter

    Don Porter - 2012-05-02

    Precisely what are you building? Where did it come from?

     
  • Don Porter

    Don Porter - 2012-05-03

    I see this is a build as root? Do you have the
    same troubles building as a non-superuser?

     
  • Don Porter

    Don Porter - 2012-05-03
    • assigned_to: stwo --> dgp
    • status: open --> pending-works-for-me
     
  • Don Porter

    Don Porter - 2012-05-03

    Can't reproduce on a Solaris 10 sparc system
    with Forte Developer 7 C 5.4 and a regular user
    account. If you've got more details that can tell
    us what can help, attach them.

     
  • Mark

    Mark - 2012-05-04

    This is the recipe:

    cd /var/tmp
    rm -rf /tcl tcl8.5.11
    untgz /usr/local/src/tcl/tcl8.5.11-src.tar.gz
    mkdir /tcl
    cd tcl8.5.11/unix/
    ./configure \ --prefix=/tcl \ --enable-shared \ --enable-dtrace
    gmake
    gmake test
    gmake install

    The tclsh problem doesn't occur when compiling as a non-root user. It compiles and installs as expected. What's in the build that makes a difference to that?

     
  • Mark

    Mark - 2012-05-04
    • status: pending-works-for-me --> open-works-for-me
     
  • Mark

    Mark - 2012-05-04

    # cc -V
    cc: Sun C 5.11 SunOS_i386 145355-01 2010/10/11
    # uname -a
    SunOS x86host 5.10 Generic_142901-13 i86pc i386 i86pc

    # cc -V
    cc: Sun C 5.11 SunOS_sparc 145354-01 2010/10/11
    # uname -a
    SunOS host 5.10 Generic_142909-17 sun4v sparc SUNW,T5240

    # env
    LANG=en_US.UTF-8
    LC_COLLATE=C
    USER=root
    GROUP=root
    HOST=host
    JAVA_HOME=/usr/java
    LD_RUN_PATH=/usr/local/lib:/lib:/usr/lib
    CC=cc
    CXX=CC
    LDFLAGS=-I/usr/local/include -L/usr/local/lib
    CPPFLAGS=-I/usr/local/include -L/usr/local/lib

     
  • Stuart Cassoff

    Stuart Cassoff - 2012-05-06

    Please attach a full build log.

     
  • Poor Yorick

    Poor Yorick - 2012-06-13

    I got this same error when compiling tcl-8.5.11 on a Linux host. After making sure that CPPFLAGS included ...tcl8.5.11/generic prior to other directories that contained older versions of tclTomMath.h, the problem went away.

     
  • Stuart Cassoff

    Stuart Cassoff - 2012-06-15

    Looks like the presence of CPPFLAGS and LDFLAGS in your environment is causing the build to use different (installed) includes and libs.

    Should these flags be placed after Tcl's in compiler/linker invocations?

     
  • Poor Yorick

    Poor Yorick - 2012-06-18

    I think the sane approach might be to have key directories like ...tcl8.5.11/generic (where ... probably represents some variable guaranteed to resolve to the build-time source directory) unequivocally appear before CPPFLAGS. in the Makefiles. Nearly always, when a user is specifying CPPFLAGS, they intend to supplement the distribution header files, not override them. The user who actually wants to override distribution header files will probably have the skills to find a way to do that.

     
  • Donal K. Fellows

    If it works when building as non-root, do that. Only installation to a shared directory requires elevated privileges.

     
  • Donal K. Fellows

    Also, Tcl's configure merges the CPPFLAGS into the definition of CFLAGS for you (as long as you don't override directly; check the generated Makefile and try unsetting before the make step) and the Makefile only uses LDFLAGS when linking.

     
  • Donal K. Fellows

    Umm, by "unsetting" I mean "unsetting it in your environment variables"; remember, they _override_ the makefile if present.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks