Artifacts Associated With Ticket 443170ffffffffff
Ticket change [7f0e0358c7] (rid 97509) by lloydlim on 2001-07-20 19:18:32:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Tcl fails to compile on our FreeBSD 2.2.5, 2.2.6, and 2.2.7 machines. The error printed is: cc tclAppInit.o -L/n/bmrca/users/lim/src/mash-code/tcl8.3/unix -ltcl83 -lm -lc -Wl,-rpath,/usr/local/lib -o tclsh ld: /usr/local/lib: malformed input file (not rel or archive) *** Error code 1 Stop. The message is kind of confusing. The problem is that ld does not support the -rpath option. After watching configure and examining tcl.m4, these machines have dlfcn.h but do not have ELF. Here is a patch to fix this problem: --- tcl.m4.old Fri Jul 20 10:51:31 2001 +++ tcl.m4.new Fri Jul 20 11:50:21 2001 @@ -853,18 +853,20 @@ DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' AC_MSG_CHECKING(for ELF) AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif - ], + ], [ AC_MSG_RESULT(yes) - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so', + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + ], [ AC_MSG_RESULT(no) + LD_SEARCH_FLAGS='-Wl,-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' - ) + ]) ], [ SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" - foundin initialized to: "obsolete: 8.3.3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "lloydlim"
- subsystem initialized to: "53. Configuration and Build Tools"
- title initialized to: "Tcl fails to compile on FreeBSD 2.2.x"
- type initialized to: "Bug"
Ticket change [a4ea6265e4] (rid 110282) by lloydlim on 2001-08-01 04:08:15:
- icomment:
Logged In: YES user_id=99220 The above patch works fine when dynamic linking is used. However, when --disable-shared is used and static linking is used to link in the tcl library, the link fails with: ld: No reference to __DYNAMIC *** Error code 1 Stop. This can be reproduced by compiling a very small test program that calls some Tcl routine and linking it as follows: gcc -Wall program.o -Ltcl8.3.3/unix -ltcl83 -lm -static -o program This problem can be solved by switching to a.out format. Here is a new patch that will work with static linking: --- tcl.m4.old Tue Jul 31 09:15:51 2001 +++ tcl.m4 Tue Jul 31 09:18:31 2001 @@ -842,7 +842,7 @@ LDFLAGS="-Wl,-Bexport" LD_SEARCH_FLAGS="" ;; - NetBSD-*|FreeBSD-[[1-2]].*|OpenBSD-*) + NetBSD-*|OpenBSD-*) # Not available on all versions: check for include file. AC_CHECK_HEADER(dlfcn.h, [ # NetBSD/SPARC needs -fPIC, -fpic will not do. @@ -876,6 +876,22 @@ LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' ]) + + # FreeBSD doesn't handle version numbers with dots. + + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots + ;; + FreeBSD-[[1-2]].*) + SHLIB_CFLAGS="" + SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".a" + DL_OBJS="tclLoadAout.o" + DL_LIBS="" + LDFLAGS="" + LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' # FreeBSD doesn't handle version numbers with dots. - login: "lloydlim"
- mimetype: "text/plain"
- username: "lloydlim"
- icomment:
Ticket change [03597f434f] (rid 119813) by andreas_kupries on 2001-08-01 04:20:24:
- assignee changed to: "mdejong"
Ticket change [2f94ee4dbb] (rid 93083) by lloydlim on 2001-08-28 06:08:28:
- icomment:
Logged In: YES user_id=99220 I've just discovered that both of these patches have problems. As noted, the first patch works for dynamic linking but doesn't work for static linking. The second patch works for static linking but doesn't fully work for dynamic linking. I need to work together with an experienced FreeBSD person to resolve the problems. Please contact me directly if you can help. (I will be out of the country from Sep 1-23, 2001.)
- login: "lloydlim"
- mimetype: "text/plain"
- username: "lloydlim"
- icomment:
Ticket change [5d9f85f91e] (rid 115500) by mdejong on 2002-02-13 12:22:04:
- assignee changed to: "acacio"
- icomment:
Logged In: YES user_id=90858 Assigning to acacio to see if he can have a stab at this FreeBSD issue.
- login: "mdejong"
- mimetype: "text/plain"
- username: "mdejong"
Ticket change [c1e0c929b8] (rid 111397) by dgp on 2003-10-03 06:16:19:
- icomment:
Logged In: YES user_id=80530 Is this still valid?
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "8"
- username: "dgp"
- icomment:
Ticket change [dec5e2ad48] (rid 114908) by hobbs on 2005-05-31 09:16:12:
- closedate changed to: "2005-05-31T02:16:12"
- closer changed to: "hobbs"
- resolution changed to: "Out of Date"
- status changed to: "Closed"