Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4110 Undefined symbol _tclEmptyStringRep

obsolete: 8.6a2
closed-fixed
9
2015-01-29
2008-08-18
Lars Hellström
No

This is on Mac OS X 10.4.11 PowerPC with a freshly installed XCode 2.5.

Compiling CVS HEAD fails when attempting to link tcltest:

make tcltest-real LIB_RUNTIME_DIR="`pwd`"
gcc -g -pipe -prebind -headerpad_max_install_names -Wl,-search_paths_first tclTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o tclThreadTest.o tclUnixTest.o -F/Installerare/Tcl/tcl/build/tcl/Development -framework Tcl -lpthread -framework CoreFoundation -sectcreate __TEXT __info_plist Tclsh-Info.plist \ -o tcltest
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning prebinding disabled because of undefined symbols
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_tclEmptyStringRep
collect2: ld returned 1 exit status
make[4]: *** [tcltest-real] Error 1
make[3]: *** [tcltest] Error 2
make[2]: *** [build-tcl] Error 2
make[1]: *** [tcl] Error 2
make: *** [develop] Error 2

I have verified that this happens with a fresh checkout today of the tcl module into an empty directory, then: cd macosx; make.

Is this related to tclEmptyStringRep being MODULE_SCOPE?

Discussion

  • Don Porter
    Don Porter
    2008-08-18

    • assigned_to: mdejong --> das
     
  • Neil Madden
    Neil Madden
    2008-08-18

    Logged In: YES
    user_id=102050
    Originator: NO

    I also see this on OS X 10.4.11 Intel. A workaround is to configure with --disable-shared to run the test suite.

     
  • Logged In: YES
    user_id=90580
    Originator: NO

    Culprit is the use of TclInvalidateStringRep() in Miguel's new TestconcatobjCmd()...

     
    • assigned_to: das --> msofer
    • labels: 105686 --> 53. Configuration and Build Tools
    • priority: 5 --> 9
     
  • Logged In: YES
    user_id=90580
    Originator: NO

    the following patch fixes the issue for me, Miguel, any objections to committing this?

    Index: generic/tclTest.c

    RCS file: /cvsroot/tcl/tcl/generic/tclTest.c,v
    retrieving revision 1.122
    diff -u -p -r1.122 tclTest.c
    --- generic/tclTest.c 17 Aug 2008 14:15:25 -0000 1.122
    +++ generic/tclTest.c 19 Aug 2008 20:46:11 -0000
    @@ -6617,11 +6617,17 @@ TestconcatobjCmd(

    list1Ptr = Tcl_NewStringObj("foo bar sum", -1);
    Tcl_ListObjLength(NULL, list1Ptr, &len);
    - TclInvalidateStringRep(list1Ptr);
    + if (list1Ptr->bytes != NULL) {
    + ckfree((char *) list1Ptr->bytes);
    + list1Ptr->bytes = NULL;
    + }

    list2Ptr = Tcl_NewStringObj("eeny meeny", -1);
    Tcl_ListObjLength(NULL, list2Ptr, &len);
    - TclInvalidateStringRep(list2Ptr);
    + if (list2Ptr->bytes != NULL) {
    + ckfree((char *) list2Ptr->bytes);
    + list2Ptr->bytes = NULL;
    + }

    /*
    * Verify that concat'ing a list obj with one or more empty strings does

     
  • miguel sofer
    miguel sofer
    2008-08-19

    Logged In: YES
    user_id=148712
    Originator: NO

    No problem, sorry about that - go ahead and commit

     
  • Logged In: YES
    user_id=90580
    Originator: NO

    fix committed to HEAD and core-8-5-branch

     
    • assigned_to: msofer --> das
    • status: open --> closed-fixed