[RFC] GDB64 on PPC64 - tclsh does not compile 64bit

Manoj Iyer
2004-05-05T19:44:16Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1718 bytes --]

I have this problem for a while with GDB 6.1 CVS (Same patch is applicable
to mainline GDB as well), and I used to hand patch it while building GDB64
on PPC64. tclsh does not build 64bit because of a missing CFLAGS on the
compile line, a patch is attached.

Problem:
---------
(NOTE: I am using a different toolchain, but the problem is independent of
that)

/cc tclAppInit.o -L/home/manjo/GDB/src/tcl/uni
x -ltcl8.4 -ldl -lieee -lm \
-Wl,-rpath,/usr/local/lib -o tclsh
/opt/biarch/2.6/20040420_nptl/bin/ld: skipping incompatible
/home/manjo/GDB/src/
tcl/unix/libtcl8.4.a when searching for -ltcl8.4
/opt/biarch/2.6/20040420_nptl/bin/ld: warning: powerpc:common64
architecture of
input file `tclAppInit.o' is incompatible with powerpc:common output
tclAppInit.o(.text+0x32): In function `.main':
: relocation truncated to fit: R_PPC64_TOC16_DS .toc
tclAppInit.o(.text+0x34): In function `.main':
: undefined reference to `.Tcl_Main'
tclAppInit.o(.text+0x80): In function `.Tcl_AppInit':
: undefined reference to `.Tcl_Init'
tclAppInit.o(.text+0xa6): In function `.Tcl_AppInit':
: relocation truncated to fit: R_PPC64_TOC16_DS .toc
tclAppInit.o(.text+0xaa): In function `.Tcl_AppInit':
: relocation truncated to fit: R_PPC64_TOC16_DS .toc
tclAppInit.o(.text+0xb0): In function `.Tcl_AppInit':
: undefined reference to `.Tcl_SetVar'
collect2: ld returned 1 exit status
make[2]: *** [tclsh] Error 1
make[2]: Leaving directory `/home/manjo/GDB/src/tcl/unix'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/manjo/GDB/src/tcl'
make: *** [all-tcl] Error 2
manjo@venus:~/GDB/src>

I set CFLAGS=-m64 LDFLAGS=-m64 ./configure .... while configuring. The
above patch fixes this problem.

Thanks
Manoj Iyer

[-- Attachment #2: TCLSH 64bit patch --]
[-- Type: TEXT/PLAIN, Size: 520 bytes --]

diff -Naurd ./old/src/tcl/unix/Makefile.in ./new/src/tcl/unix/Makefile.in
--- ./old/src/tcl/unix/Makefile.in 2003-01-21 11:40:18.000000000 -0800
+++ ./new/src/tcl/unix/Makefile.in 2004-05-05 09:02:20.323082432 -0700
@@ -477,7 +477,7 @@

tclsh: ${TCLSH_OBJS} ${TCL_LIB_FILE}
- ${CC} ${LDFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \
+ ${CC} ${LDFLAGS} ${CFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} \
${CC_SEARCH_FLAGS} -o tclsh

# Resetting the LIB_RUNTIME_DIR below is required so that