Menu

#2028 threaded build fails on FreeBSD 4.6

obsolete: 8.4b3
closed-fixed
5
2002-09-03
2002-08-31
No

This is on host usf-cf-x86-freebsd-1 on the SourceForge
compilefarm (FreeBSD 4.6-STABLE):
The threaded build fails to link because of the
presence of an erroneous "-pthread" argument to 'ld'.

the patch to tcl.m4 below fixes the problem and doesn't
affect any of the other builds on the compilefarm
negatively, but I suspect is proabably not a good
solution in general.

Index: tcl.m4

RCS file: /cvsroot/tcl/tcl/unix/tcl.m4,v
retrieving revision 1.80
diff -u -r1.80 tcl.m4
--- tcl.m4 31 Aug 2002 13:28:00 -0000 1.80
+++ tcl.m4 31 Aug 2002 14:25:13 -0000
@@ -438,7 +438,7 @@

AC_CHECK_LIB(c_r,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
if test "$tcl_ok" = "yes"; then
# The space is needed
- THREADS_LIBS=" -pthread"
+ THREADS_LIBS=" "
else
TCL_THREADS=0
AC_MSG_WARN("Don t know how to
find pthread lib on your system - you must disable
thread support or edit the LIBS in the Makefile...")

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-09-02

    Logged In: YES
    user_id=72656

    I built on the same machine without problems.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-09-02
    • status: open --> closed-invalid
     
  • Daniel A. Steffen

    • status: closed-invalid --> open-invalid
     
  • Daniel A. Steffen

    Logged In: YES
    user_id=90580

    really? I just tried again, same problem (on a fresh
    checkout of the HEAD):

    -------------------------------------------------------------------------------------------------

    usf-cf-x86-freebsd-1 tcl $ ~/HEAD/tcl/unix/configure
    --enable-threads

    usf-cf-x86-freebsd-1 tcl $ make
    lrm -f libtclstub8.4.a
    ar cr libtclstub8.4.a tclStubLib.o ; ranlib libtclstub8.4.a
    rm -f libtcl8.4.so
    ld -Bshareable -x -o libtcl8.4.so regcomp.o regexec.o
    regfree.o regerror.o tclAlloc.o tclAsync.o tclBasic.o
    tclBinary.o tclCkalloc.o tclClock.o tclCmdAH.o tclCmdIL.o
    tclCmdMZ.o tclCompCmds.o tclCompExpr.o tclCompile.o
    tclDate.o tclEncoding.o tclEnv.o tclEvent.o tclExecute.o
    tclFCmd.o tclFileName.o tclGet.o tclHash.o tclHistory.o
    tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o tclIOGT.o
    tclIOSock.o tclIOUtil.o tclLink.o tclListObj.o tclLiteral.o
    tclLoad.o tclMain.o tclNamesp.o tclNotify.o tclObj.o
    tclPanic.o tclParse.o tclParseExpr.o tclPipe.o tclPkg.o
    tclPosixStr.o tclPreserve.o tclProc.o tclRegexp.o
    tclResolve.o tclResult.o tclScan.o tclStringObj.o
    tclThread.o tclThreadAlloc.o tclThreadJoin.o tclStubInit.o
    tclStubLib.o tclTimer.o tclUtf.o tclUtil.o tclVar.o
    tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o tclUnixFile.o
    tclUnixPipe.o tclUnixSock.o tclUnixTime.o tclUnixInit.o
    tclUnixThrd.o tclUnixNotfy.o tclLoadDl.o -pthread -lm
    -rpath /usr/local/lib
    /usr/libexec/elf/ld: unrecognized option 'tclLoadDl.o'
    /usr/libexec/elf/ld: use the --help option for usage information
    *** Error code 1

    Stop in
    /home/users/d/da/das/build/usf-cf-x86-freebsd-1/HEAD/tcl.

    -------------------------------------------------------------------------------------------------

    if the -pthread in the ld line is removed, the link succeeds

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-09-03

    Logged In: YES
    user_id=72656

    Yes, really ...

    usf-cf-x86-freebsd-1 [~/build/freebsd/tcl84st] 7 % make shell
    rm -f libtclstub8.4.a
    ar cr libtclstub8.4.a tclStubLib.o ; ranlib libtclstub8.4.a
    rm -f libtcl8.4.a
    ar cr libtcl8.4.a regcomp.o regexec.o regfree.o regerror.o
    tclAlloc.o tclAsync.o tclBasic.o tclBinary.o tclCkalloc.o
    tclClock.o tclCmdAH.o tclCmdIL.o tclCmdMZ.o tclCompCmds.o
    tclCompExpr.o tclCompile.o tclDate.o tclEncoding.o tclEnv.o
    tclEvent.o tclExecute.o tclFCmd.o tclFileName.o tclGet.o
    tclHash.o tclHistory.o tclIndexObj.o tclInterp.o tclIO.o
    tclIOCmd.o tclIOGT.o tclIOSock.o tclIOUtil.o tclLink.o
    tclListObj.o tclLiteral.o tclLoad.o tclMain.o tclNamesp.o
    tclNotify.o tclObj.o tclPanic.o tclParse.o tclParseExpr.o
    tclPipe.o tclPkg.o tclPosixStr.o tclPreserve.o tclProc.o
    tclRegexp.o tclResolve.o tclResult.o tclScan.o
    tclStringObj.o tclThread.o tclThreadAlloc.o tclThreadJoin.o
    tclStubInit.o tclStubLib.o tclTimer.o tclUtf.o tclUtil.o
    tclVar.o tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o
    tclUnixFile.o tclUnixPipe.o tclUnixSock.o tclUnixTime.o
    tclUnixInit.o tclUnixThrd.o tclUnixNotfy.o tclLoadDl.o ;
    ranlib libtcl8.4.a
    gcc -pipe -export-dynamic -pthread tclAppInit.o
    -L/home/users/h/ho/hobbs/build/freebsd/tcl84st -ltcl8.4
    -pthread -lm -Wl,-rpath,/usr/local/lib -o tclsh
    % parray tcl_platform
    tcl_platform(byteOrder) = littleEndian
    tcl_platform(machine) = i386
    tcl_platform(os) = FreeBSD
    tcl_platform(osVersion) = 4.6-STABLE
    tcl_platform(platform) = unix
    tcl_platform(threaded) = 1
    tcl_platform(user) = hobbs
    tcl_platform(wordSize) = 4

    The question is likely about paths ... why do you have ld
    -Bshareable, where I have ar and gcc? Works for me ...

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-09-03
    • status: open-invalid --> closed-works-for-me
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    One build (the failing one) is dynamic, and one (the
    succeeding one) is static. Why would this make a difference?

     
  • Daniel A. Steffen

    Logged In: YES
    user_id=90580

    that's a good point, indeed if I configure with
    --disable-shared my build succeeds as well...

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-09-03
    • status: closed-works-for-me --> closed-fixed
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-09-03

    Logged In: YES
    user_id=72656

    OK, corrected this for FreeBSD to remove it in the FreeBSD
    specific section with a sed macro. This was only needed on
    dynamic builds.