From: <no...@so...> - 2001-07-31 21:08:15
|
Bugs item #443170, was opened at 2001-07-20 12:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=443170&group_id=10894 Category: Configure and Build Tools Group: 8.3.3 Status: Open Resolution: None Priority: 5 Submitted By: Lloyd Lim (lloydlim) Assigned to: Nobody/Anonymous (nobody) Summary: Tcl fails to compile on FreeBSD 2.2.x Initial Comment: 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" ---------------------------------------------------------------------- >Comment By: Lloyd Lim (lloydlim) Date: 2001-07-31 14:08 Message: 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. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=443170&group_id=10894 |