Menu

#946 Under AIX, configure --enable-gcc produces a nonworking Makf

obsolete: 8.3.2
closed-fixed
5
2002-01-29
2000-11-01
No

OriginalBugID: 6302 Bug
Version: 8.3.2
SubmitDate: '2000-09-22'
LastModified:
Severity: CRIT
Status: UnAssn
Submitter: techsupp
OS: AIX

Comments:
Sorry I'm not sending a better patch!

ReproducibleScript:
configure --enable-gcc

ObservedBehavior:
Using /bin/ld, libgcc.a isn't found. Different compile options use
-Wl,-b... while others use -b... - these two forms cannot be mixed

DesiredBehavior:
If --enable-gcc is supplied, /bin/ld should not be called, and all
loader-specific flags should use the -Wl,-b form

Patch:
--- Makefile Fri Sep 22 16:49:44 2000
+++ Makefile.good Fri Sep 22 16:52:56 2000
@@ -204,7 +204,7 @@
# libraries. See configure.in for a description of what it means.
# The values of the symbolis normally set by the configure script.

-SHLIB_LD = /usr/local/trilogy/download/src/tcltk/tcl8.3.2/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry
+SHLIB_LD = /usr/local/trilogy/download/src/tcltk/tcl8.3.2/unix/ldAix $(CC) -Wl,-bhalt:4 -Wl,-bM:SRE -Wl,-bE:lib.exp -Wl,-H512 -Wl,-T512 -Wl,-bnoentry
SHLIB_LD_LIBS = ${LIBS}

# Additional search flags needed to find the various shared libraries
@@ -391,23 +391,23 @@

wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE)
$(CC) $(WISH_OBJS) - -bI:/usr/local/trilogy/download/src/tcltk/tk8.3.2/unix/A.powerpc-ibm-aix4.3.3.0/lib.exp + -Wl,-bI:/usr/local/trilogy/download/src/tcltk/tk8.3.2/unix/A.powerpc-ibm-aix4.3.3.0/lib.exp $(WISH_LIBS) $(TK_CC_SEARCH_FLAGS) -o wish

# This rule is executed if the user tried to run tktest without first
# building tcltest in the Tcl bin directory. Just do it for them.
${TCL_BIN_DIR}/tcltest:
cd ${TCL_BIN_DIR} ; - make tcltest
+ $(MAKE) tcltest

tktest: ${TCL_BIN_DIR}/tcltest $(TKTEST_OBJS) $(TK_LIB_FILE)
${CC} $(TKTEST_OBJS) - -bI:/usr/local/trilogy/download/src/tcltk/tk8.3.2/unix/A.powerpc-ibm-aix4.3.3.0/lib.exp + -Wl,-bI:/usr/local/trilogy/download/src/tcltk/tk8.3.2/unix/A.powerpc-ibm-aix4.3.3.0/lib.exp $(WISH_LIBS) $(TK_CC_SEARCH_FLAGS) -o tktest

xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE)
${CC} test.o tkTest.o tkSquare.o - -bI:/usr/local/trilogy/download/src/tcltk/tk8.3.2/unix/A.powerpc-ibm-aix4.3.3.0/lib.exp + -Wl,-bI:/usr/local/trilogy/download/src/tcltk/tk8.3.2/unix/A.powerpc-ibm-aix4.3.3.0/lib.exp $(WISH_LIBS) $(TK_LD_SEARCH_FLAGS) -lXt -o xttest

# Note, in the target below TCL_LIBRARY needs to be set or else

PatchFiles:
I suspect configure.in and Makfile.in

Discussion

1 2 > >> (Page 1 of 2)
  • Donal K. Fellows

    • labels: 104343 --> 84. Unix Build
     
  • Mo DeJong

    Mo DeJong - 2001-11-12
    • assigned_to: nobody --> mdejong
     
  • Mo DeJong

    Mo DeJong - 2001-12-19

    Logged In: YES
    user_id=90858

    This bug should be fixed in the HEAD as of 2001-12-18.
    It has not been tested with a gcc AIX build so if someone
    could double check it that would be great.

     
  • Mo DeJong

    Mo DeJong - 2001-12-19
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2001-12-19

    Logged In: YES
    user_id=80530

    No. It fails during the link step:

    $ make
    rm -f libtk8.4.so
    /home/fs3c/dgp/tmp/tcl8.4a4/unix/ldAix /bin/ld -bhalt:4
    -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -o libtk8.4.so
    tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o
    tkCmds.o tkColor.o tkConfig.o tkConsole.o tkCursor.o
    tkError.o tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o
    tkGeometry.o tkGrab.o tkGrid.o tkMain.o tkObj.o
    tkOldConfig.o tkOption.o tkPack.o tkPlace.o tkSelect.o
    tkUtil.o tkVisual.o tkWindow.o tkUnix.o tkUnix3d.o
    tkUnixButton.o tkUnixColor.o tkUnixConfig.o tkUnixCursor.o
    tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o tkUnixFocus.o
    tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o
    tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o
    tkUnixSend.o tkUnixWm.o tkUnixXId.o tkStubInit.o tkStubLib.o
    tkButton.o tkEntry.o tkFrame.o tkListbox.o tkMenu.o
    tkMenubutton.o tkMenuDraw.o tkMessage.o tkScale.o
    tkScrollbar.o tkCanvas.o tkCanvArc.o tkCanvBmap.o
    tkCanvImg.o tkCanvLine.o tkCanvPoly.o tkCanvPs.o
    tkCanvText.o tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o
    tkImage.o tkImgBmap.o tkImgGIF.o tkImgPPM.o tkImgPhoto.o
    tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o
    tkTextIndex.o tkTextMark.o tkTextTag.o tkTextWind.o
    -L/usr/local/lib -L/home/fs3c/dgp/tmp/tcl8.4a4/unix -lc
    -lX11 -ldl -lm
    noDotA="libtk8.4.so"
    ld: 0711-317 ERROR: Undefined symbol: .Tcl_GetString
    ...
    <dozens of undefined symbols deleted>
    ...
    ld: 0711-317 ERROR: Undefined symbol: .Tcl_SetMainLoop
    ld: 0711-317 ERROR: Undefined symbol: tclStubsPtr
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain
    more information.
    make: *** [libtk8.4.so] Error 8

     
  • Don Porter

    Don Porter - 2001-12-19
    • status: closed-fixed --> open-remind
     
  • Mo DeJong

    Mo DeJong - 2002-01-11

    Logged In: YES
    user_id=90858

    This is a different problem. It now fails because Tk is
    not being built with correctly WRT stub support. That
    is bug 220858.

     
  • Mo DeJong

    Mo DeJong - 2002-01-11

    Logged In: YES
    user_id=90858

    Added patch from bug report 220858 to build Tk with stubs
    enabled on 2002-01-11, it should fix the build under AIX.

     
  • Mo DeJong

    Mo DeJong - 2002-01-11
    • status: open-remind --> closed-fixed
     
  • Don Porter

    Don Porter - 2002-01-19

    Logged In: YES
    user_id=80530

    still moving the ball forward. The HEAD of 2002-Jan-18
    when configured --enable-gcc --enable-shared now fails
    to link wish:

    gcc -pipe tkAppInit.o
    -Wl,-bI:/home/fs3c/dgp/tmp/tk8.4a4/unix/lib.exp \ -L/home/fs3c/dgp/tmp/tk8.4a4/unix
    -L/home/fs3c/dgp/tmp/tcl8.4a4/unix \ -lc -lX11 -ldl -lm -L/home/fs3c/dgp/rs6000/aix4/lib -o wish
    ld: 0711-317 ERROR: Undefined symbol: .Tcl_CreateInterp
    ld: 0711-317 ERROR: Undefined symbol: .Tcl_Init
    ld: 0711-317 ERROR: Undefined symbol: .Tcl_StaticPackage
    ld: 0711-317 ERROR: Undefined symbol: .Tcl_SetVar
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to
    obtain more information.

     
  • Don Porter

    Don Porter - 2002-01-19
    • status: closed-fixed --> open-remind
     
  • Mo DeJong

    Mo DeJong - 2002-01-19

    Logged In: YES
    user_id=90858

    I don't understand why your -L options are missing
    -l arguments. Here is what I get when I run the
    command under Linux.

    gcc -pipe -rdynamic tkAppInit.o \ -L/home/mo/project/build/tk -ltk8.4g \ -L/home/mo/project/build/tcl -ltcl8.4
    -L/usr/X11R6/lib -lX11 -ldl -lieee -lm
    -Wl,-rpath,/usr/local/lib:/usr/local/project/install/tcl/lib:/usr/X11R6/lib
    -o wish

    Note how -ltcl8.4 appears after the -L argument for
    the Tcl build directory. Could you look into why
    this is not working with your AIX box?

    It seems the unresolved symbols come from the
    tkAppInit.c file. I am not sure if it should
    also be build with the -DUSE_TCL_STUBS flag.

    % nm tkAppInit.o | grep Tcl
    0000003c T Tcl_AppInit
    U Tcl_CreateInterp
    U Tcl_Init
    U Tcl_SetVar
    U Tcl_StaticPackage

     
  • Mo DeJong

    Mo DeJong - 2002-01-19

    Logged In: YES
    user_id=90858

    I took a look at the configure.in file and it seems
    that no -l option was being passed when a .exp file
    is used. I think the following patches to Tcl and Tk
    might fix the problem, but I have no way to test this.
    Please give the attached patch a test run. If it does
    not work, please try to figure out why it does not
    work while you have access to the AIX box.

     
  • Don Porter

    Don Porter - 2002-01-21

    Logged In: YES
    user_id=80530

    After this patch, tclsh fails to link:

    gcc -pipe -c -O -Wall -Wconversion -Wno-implicit-int
    -I./../generic -I. -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1
    -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1
    -DHAVE_STRTOL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1
    -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1
    -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_TIME_H=1
    -DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME=1 -DHAVE_GMTIME_R=1
    -DHAVE_LOCALTIME_R=1 -DHAVE_TIMEZONE_VAR=1
    -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1
    -DNEED_MATHERR=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1
    -DUSE_DELTA_FOR_TZ=1 -DHAVE_SYS_IOCTL_H=1
    -DTCL_SHLIB_EXT=\".so\" ./../unix/tclAppInit.c
    gcc -pipe tclAppInit.o
    -Wl,-bI:/home/fs3c/dgp/tmp/tcl8.4a4/unix/lib.exp
    -L/home/fs3c/dgp/tmp/tcl8.4a4/unix -ltcl8.4 -ldl -lc -lm
    -lbsd \ -L/home/fs3c/dgp/rs6000/aix4/lib -o tclsh
    ld: 0706-006 Cannot find or open library file: -l tcl8.4
    ld:open(): A file or directory in the path name
    does not exist.

    Will continue to look for a solution.

     
  • Don Porter

    Don Porter - 2002-01-21

    Logged In: YES
    user_id=80530

    OK, the problem is with lines 348-349 of
    tk/unix/configure.in.

    Working definitions for TCL_LIB_SPEC and TCL_BUILD_LIB_SPEC
    are stored in tclConfig.sh by Tcl's configure script.

    Those defintions are read from tclConfig.sh, but are then
    overwritten by lines 348-349 of Tk's configure.in. When
    I remove those lines, wish builds properly on AIX.

    I do not know what effect removing those lines might have
    on other platforms, possible breaking them. However, it
    seems to me that if the tclConfig.sh script has given us
    values for these variables, we ought to keep them, not
    overwrite them. Perhaps lines 348-349 should be kept,
    but performed only on the condition that those variables
    are undefined?

    How long has Tk building been not working on AIX? Can
    we trace back to what change broke it in the first place?
    Or has it never worked?

     
  • Mo DeJong

    Mo DeJong - 2002-01-21

    Logged In: YES
    user_id=90858

    That hack where it resets TCL_LIB_SPEC is only in there
    to support linking from the build dir or from the install
    dir. It is a rather sad old hack, it really should die.
    I described a method to replace this hack in TIP 34
    under the header "Build vs. Install Configuration".
    It might be time to rip out these old hacks and use
    this new method.

    Also, were you able to figure out why Tcl was not
    linking after the patch was added? Is it because
    there is a . in the lib name but the lib on the
    disk has no dot in the name?

     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    CVS sez: That hack was added in version 1.35 by wart, who
    claimed it was to make the file TEA compliant (first public
    release was with 8.2b1)

     
  • Mo DeJong

    Mo DeJong - 2002-01-26

    Logged In: YES
    user_id=90858

    Here is an initial patch that implements the change
    I originally described in TIP 34. Please take it for
    a test drive and tell me if this fixes the problem
    under AIX. The patch simply uses the TCL_LIB_SPEC
    setting stored in tclConfig.sh. It should fix the
    problem and still work a built or installed version
    of Tcl.

     
  • Don Porter

    Don Porter - 2002-01-27
    • summary: Under AIX, configure --enable-gcc produces a nonworking Makfeile --> Under AIX, configure --enable-gcc produces a nonworking Makf
     
  • Don Porter

    Don Porter - 2002-01-27

    Logged In: YES
    user_id=80530

    No, with that patch wish fails to link:

    gcc -pipe tkAppInit.o \ -Wl,-bI:/home/fs3c/dgp/tmp/tk8.4a4/unix/lib.exp
    -L/home/fs3c/dgp/tmp/tk8.4a4/unix -ltk8.4 \ -Wl,-bI:/home/fs3c/dgp/tmp/tcl8.4a4/unix/lib.exp
    -L/home/fs3c/dgp/tmp/tcl8.4a4/unix -lc -lX11 -ldl -lm
    -L/home/fs3c/dgp/rs6000/aix4/lib -o wish
    ld: 0706-006 Cannot find or open library file: -l tk8.4
    ld:open(): A file or directory in the path name does
    not exist.

    It appears to me that when a *.exp file is being used on
    AIX, the -l option should not be used. When I edit
    the Makefile and remove "-ltk8.4" from the wish: and
    tktest-real: targets, then everything builds fine.

    But I don't really understand it.

     
  • Mo DeJong

    Mo DeJong - 2002-01-28

    Logged In: YES
    user_id=90858

    Ok, I have attached a new patch that should fix
    the problem without hosing around with -l flags.
    Please give it a test drive and I will check it in.

     
  • Mo DeJong

    Mo DeJong - 2002-01-28

    Fix AIX build

     
  • Don Porter

    Don Porter - 2002-01-29

    Logged In: YES
    user_id=80530

    that works. stick a fork in it.

     
  • Mo DeJong

    Mo DeJong - 2002-01-29
    • status: open-remind --> closed-fixed
     
  • Mo DeJong

    Mo DeJong - 2002-01-29

    Logged In: YES
    user_id=90858

    This should be fixed as of 2002-01-28.

     
1 2 > >> (Page 1 of 2)