From: SourceForge.net <no...@so...> - 2007-09-17 20:56:12
|
Bugs item #1749251, was opened at 2007-07-06 10:10 Message generated for change (Comment added) made by jenglish You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1749251&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 84. Unix Build Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Joe English (jenglish) Summary: 8.5 doesn't build correctly on netbsd when using XFT Initial Comment: When building Tk on netbsd (cvs head 07/06/2007) using xft (the default) the building process fails at: rm -f libtk85.so ld -Bshareable -x -o libtk85.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 tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o tkButton.o tkEntry.o tkFrame.o tkListbox.o tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o tkPanedWindow.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 tkStubInit.o tkStubLib.o ttkBlink.o ttkButton.o ttkCache.o ttkClamTheme.o ttkClassicTheme.o ttkDefaultTheme.o ttkElements.o ttkEntry.o ttkFrame.o ttkImage.o ttkInit.o ttkLabel.o ttkLayout.o ttkManager.o ttkNotebook.o ttkPanedwindow.o ttkProgress.o ttkScale.o ttkScrollbar.o ttkScroll.o ttkSeparator.o ttkSquare.o ttkState.o ttkTagSet.o ttkTheme.o ttkTrace.o ttkTrack.o ttkTreeview.o ttkWidget.o ttkStubInit.o ttkStubLib.o tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o tkUnixFocus.o tkUnixRFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o tkUnixSend.o tkUnixWm.o tkUnixXId.o -L/usr/X11R6/lib -lX11 -lXss -lXext -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -lXft -L/usr/X11R6/lib -lfreetype -L/usr/X11R6/lib -lfontconfig -L/usr/X11R6/lib -lXrender -lm -L/home/emiliano/programas/lib -ltclstub85 -rpath /home/emiliano/programas/lib:/usr/X11R6/lib ld: unrecognized option '-Wl,-rpath,/usr/X11R6/lib' ld: use the --help option for usage information gmake: *** [libtk85.so] Error 1 The problem is in the use of 'ld' to link. This patch address the issue and the build process completes successfully. --- Makefile.orig 2007-07-06 13:50:57.000000000 -0300 +++ Makefile 2007-07-06 13:50:06.000000000 -0300 @@ -568,7 +568,7 @@ # a shared library or non-shared library for Tk. ${LIB_FILE}: ${OBJS} ${STUB_LIB_FILE} rm -f $@ - ${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS} + ${CC} -shared -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${CC_SEARCH_FLAGS} ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} rm -f $@ ---------------------------------------------------------------------- >Comment By: Joe English (jenglish) Date: 2007-09-17 13:56 Message: Logged In: YES user_id=68433 Originator: NO Final patch committed to tk CVS HEAD; same patch applied tcl HEAD and tclconfig modules. File Added: tk-config-bsd-fix.patch ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2007-09-17 13:48 Message: Logged In: YES user_id=68433 Originator: NO Also confirmed: NetBSD 2.0 has ELF support. ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2007-09-17 13:08 Message: Logged In: YES user_id=68433 Originator: NO Finally figured out why this patch was not, in fact, working: tk/unix/configure.in throws away the values of CC_SEARCH_FLAGS and LD_SEARCH_FLAGS computed earlier and replaces them with values from tclConfig.sh (~lines 323-324 in r1.137). Relevant ChangeLog entry where the code was introduced is: +2002-07-29 Mo DeJong <md...@us...> [...] + * unix/configure.in: Remove code that was setting + CC_SEARCH_FLAGS and LD_SEARCH_FLAGS to try to + account for cc vs ld linking. Tcl now handles this. This method appears to no longer be operative or useful -- extensions are encouraged to not rely on the results of Tcl's configure script for such things any more (to support variant compilers, etc.) Confirmed that after removing this, NetBSD builds work. ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2007-09-17 11:02 Message: Logged In: YES user_id=68433 Originator: NO File Added: tk-config-bsd-fix.patch ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2007-07-26 07:05 Message: Logged In: YES user_id=68433 Originator: NO See attached patch. Can't find the version of NetBSD in which `cc -shared` started working, this patch sticks with 'ld -Bshareable' for NetBSD-[[1-2]].*. Also simplified the OpenBSD branch some: -fpic and -fPIC mean the same thing on most architectures, and on the ones where it makes a difference it's necessary to use -fPIC; might as well just use -fPIC everywhere. File Added: tk-config-bsd-fix.patch ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2007-07-23 14:22 Message: Logged In: YES user_id=79902 Originator: NO Maybe it's time to change the incantation in tcl.m4? Note that we need the values of 'uname -s' and 'uname -r' for this so we can ensure that the guards (inside SC_CONFIG_CFLAGS) are set correctly. ---------------------------------------------------------------------- Comment By: Per G (printzells) Date: 2007-07-20 13:55 Message: Logged In: YES user_id=1641556 Originator: NO On FreeBSD 6.2 i386 I just put SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' (the linux options) instead of the usual SHLIB_LD="ld -Bshareable -x" in unix/configure. It compiled. If it works and is correct I leave to other people. ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2007-07-20 12:27 Message: Logged In: YES user_id=68433 Originator: NO Also reported on c.l.t. (news:200...@sa...): ----- NetBSD: [piggy:49>>% pkg-config --cflags xft -DXTHREADS -I/usr/pkg/include -I/usr/pkg/include/freetype2 -I/usr/X11R6/include [piggy:51>>% pkg-config --libs xft -Wl,-R/usr/pkg/lib -Wl,--rpath -Wl,/usr/pkg/lib -L/usr/pkg/lib -L/usr/X11R6/lib -lXft -lfreetype -lz -lXrender -lX11 -lfontconfig [piggy:50>>% uname -a NetBSD piggy 3.0.1 NetBSD 3.0.1 (piggy) #0: Fri Sep 15 08:31:31 EDT 2006 rob@piggy:/usr/src/sys/arch/i386/compile/piggy i386[piggy:51>>% FreeBSD: [mel.controlq.com:489>>% pkg-config --cflags xft -I/usr/X11R6/include -I/usr/local/include/freetype2 -I/usr/local/include [mel.controlq.com:493>>% pkg-config --libs xft -Wl,--rpath -Wl,/usr/local/lib -L/usr/X11R6/lib -L/usr/local/lib -lXft -lfreetype -lz -lXrender -lX11 -lXext -lfontconfig [mel.controlq.com:490>>% uname -a FreeBSD mel.controlq.com 6.2-RELEASE FreeBSD 6.2-RELEASE #1: Thu May 17 12:24:25 EDT 2007 ro...@me...:/usr/src/sys/i386/compile/mel i386 ----- So "-Wl,-rpath" *is* coming from `pkg-config --libs`. Or at least it might be. Proposed solution: in tcl.m4, change the "FreeBSD-*)" branch to match "NetBSD-*|FreeBSD-*)", and to use "${CC} -shared" instead of "ld -Bshareable" for SHLIB_LD (same as OpenBSD). Also find out when NetBSD added ELF support and change the earlier "NetBSD-*|FreeBSD-[[1-2]].*)" to only match the ancient NetBSD versions that didn't support it (or, alternately, remove that branch altogether to avoid another MP-RAS-style charlie fox situation). ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2007-07-20 08:57 Message: Logged In: YES user_id=68433 Originator: NO Thanks. So the -Wl,-rpath flag isn't coming from `pkg-config`, must be from somewhere else. | How do I attach my Makefile? Is there an "Upload and Attach a file" field at the bottom of the page? (should be below all the Followups). If not, you can just email it to me... ---------------------------------------------------------------------- Comment By: Julian Noble (juliannoble) Date: 2007-07-19 22:14 Message: Logged In: YES user_id=598324 Originator: NO %uname -a FreeBSD nplex.precisium.net 6.2-RELEASE-p2 FreeBSD 6.2-RELEASE-p2 #0: Sun Mar 11 05:11:37 UTC 2007 ro...@np...:/usr/obj/usr/src/sys/SMP i386 %pkg-config --cflags xft -I/usr/X11R6/include -I/usr/local/include/freetype2 -I/usr/local/include How do I attach my Makefile?? This page only seems to have this text field and a submit button. (Makefile 60K.. paste here?) Julian ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2007-07-19 20:03 Message: Logged In: YES user_id=68433 Originator: NO Same problem reported on FreeBSD (news:118...@m3...). ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2007-07-13 13:52 Message: Logged In: YES user_id=68433 Originator: NO Part of the problem is that tcl.m4 sets SHLIB_LD="ld -Bshareable -x" on NetBSD. This might have been right at some time in the past, but nowadays you have to use "${CC} -shared" instead of "ld" to build shared libraries on most Unices. Another part of the problem is that a GCC option ("-Wl,-rpath") is getting passed to SHLIB_LD. (This won't cause a problem if $(SHLIB_LD) is $(CC) and $(CC) is gcc, but it indicates some confusion somewhere in the configurator). What version of NetBSD are you running? Could you attach the complete generated Makefile so I can try to see what's coming from where? Also, what does "pkg-config --libs xft" produce? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1749251&group_id=12997 |