Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jan 2001 21:27:26 +0900
From:      FUJISHIMA Satsuki <sf@FreeBSD.org>
To:        will@FreeBSD.org
Cc:        ports@FreeBSD.org
Subject:   qt doesn't compile with -O
Message-ID:  <86puhju3pt.wl@cheerful.com>

next in thread | raw e-mail | index | archive | help
--Multipart_Fri_Jan_19_21:27:26_2001-1
Content-Type: text/plain; charset=US-ASCII

After repeatedly failing to compile x11-toolkits/qt{145,22} on
-CURRENT, I've finally come to conclusion that qt can't be compiled
with -O due to black magic of prereleased gcc-2.95.3.

with CXXFLAGS='-O -pipe', it fails at linking bin/moc as follows:
========
c++  -c -DQT_XFT -I/usr/obj/ports/home/k5/work/Z/qt22/work/qt-2.2.3/include -pthread -D_THREAD_SAFE -Wno-unused -Wno-parentheses -DQT_PREFIX=\"/usr/X11R6\"  -O -pipe -DQT_NO_CODECS -DQT_LITE_UNICODE -I../../include -I../tools -I. -o qfile_unix.o ../tools/qfile_unix.cpp
c++   -o ./moc2 mocgen.o qbuffer.o qcollection.o qcstring.o qdatastream.o qdatetime.o qfile.o qgarray.o qgdict.o qglist.o qglobal.o qgvector.o qiodevice.o qregexp.o qstring.o qtextcodec.o qtextstream.o qfile_unix.o     
qglist.o: In function `QGList::read(QDataStream &)':
qglist.o(.text+0x12b3): undefined reference to `L1341'
gmake[1]: *** [moc2] Error 1
========

but with CXXFLAGS='-O2 -pipe', it seems OK:
========
c++  -c -DQT_XFT -I/usr/obj/ports/home/k5/work/Z/qt22/work/qt-2.2.3/include -pthread -D_THREAD_SAFE -Wno-unused -Wno-parentheses -DQT_PREFIX=\"/usr/X11R6\" -pipe -O2 -DQT_NO_CODECS -DQT_LITE_UNICODE -I../../include -I../tools -I. -o qfile_unix.o ../tools/qfile_unix.cpp
c++   -o ./moc2 mocgen.o qbuffer.o qcollection.o qcstring.o qdatastream.o qdatetime.o qfile.o qgarray.o qgdict.o qglist.o qglobal.o qgvector.o qiodevice.o qregexp.o qstring.o qtextcodec.o qtextstream.o qfile_unix.o     
gmake[1]: Leaving directory `/usr/obj/ports/home/k5/work/Z/qt22/work/qt-2.2.3/src/moc'
========

I wrote a cut'n'try script and got this result:
adding -frerun-cse-after-loop to CXXFLAGS is enough.
========
c++  -c -DQT_XFT -I/usr/obj/ports/home/k5/work/Z/qt22/work/qt-2.2.3/include -pthread -D_THREAD_SAFE -Wno-unused -Wno-parentheses -DQT_PREFIX=\"/usr/X11R6\" -O -pipe -frerun-cse-after-loop -DQT_NO_CODECS -DQT_LITE_UNICODE -I../../include -I../tools -I. -o qfile_unix.o ../tools/qfile_unix.cpp
c++   -o ./moc2 mocgen.o qbuffer.o qcollection.o qcstring.o qdatastream.o qdatetime.o qfile.o qgarray.o qgdict.o qglist.o qglobal.o qgvector.o qiodevice.o qregexp.o qstring.o qtextcodec.o qtextstream.o qfile_unix.o     
gmake[1]: Leaving directory `/usr/obj/ports/home/k5/work/Z/qt22/work/qt-2.2.3/src/moc'
========

How about adding this workaround?
(bumped PORTREVISION; compiler option changed)

-- 
FUJISHIMA Satsuki


--Multipart_Fri_Jan_19_21:27:26_2001-1
Content-Type: text/plain; charset=US-ASCII

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/x11-toolkits/qt145/Makefile,v
retrieving revision 1.51
diff -u -r1.51 Makefile
--- Makefile	2001/01/07 17:49:51	1.51
+++ Makefile	2001/01/19 12:26:03
@@ -7,7 +7,7 @@
 
 PORTNAME=	qt
 PORTVERSION=	1.45
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	x11-toolkits
 MASTER_SITES=	ftp://ftp.trolltech.com/qt/source/
 
@@ -21,7 +21,7 @@
 USE_GMAKE=	yes
 USE_X_PREFIX=	yes
 USE_NEWGCC=	yes
-MAKE_ENV+=	QTDIR=${WRKSRC} CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" CC="${CC}"
+MAKE_ENV+=	QTDIR=${WRKSRC} CXX="${CXX}" CXXFLAGS="${CXXFLAGS} -frerun-cse-after-loop" CC="${CC}"
 
 VER_MAJ=	3
 VER_MIN=	0
@@ -50,7 +50,7 @@
 post-configure:
 	@${PERL} -pi -e "s:g\+\+:${CXX}:g ; \
 		s:/usr/X11R6:${PREFIX}:g ; \
-		s:%%CXXFLAGS%%:${CXXFLAGS}:g ; \
+		s:%%CXXFLAGS%%:${CXXFLAGS} -frerun-cse-after-loop:g ; \
 		s:%%VERSION%%:${VERSION}:g" ${WRKSRC}/configs/freebsd-g++-${STATIC}
 	@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} freebsd-g++-${STATIC})
 

--Multipart_Fri_Jan_19_21:27:26_2001-1
Content-Type: text/plain; charset=US-ASCII

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/x11-toolkits/qt22/Makefile,v
retrieving revision 1.71
diff -u -r1.71 Makefile
--- Makefile	2001/01/07 16:47:21	1.71
+++ Makefile	2001/01/19 12:10:46
@@ -7,7 +7,7 @@
 
 PORTNAME=	qt
 PORTVERSION=	2.2.3
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	x11-toolkits
 MASTER_SITES=	ftp://ftp.trolltech.com/qt/source/
 DISTNAME=	qt-x11-${PORTVERSION}
@@ -66,7 +66,7 @@
 pre-configure:
 	@${CP} ${CONFIG} ${CONFIG}.new
 	${SED} -e "s,gcc,${CC},g" -e "s,g\+\+,${CXX},g" -e "s,/usr/X11R6,${X11BASE},g" \
-		-e "s,-pipe -O2,${CXXFLAGS},g" ${CONFIG}.new > ${CONFIG}
+		-e "s,-pipe -O2,${CXXFLAGS} -frerun-cse-after-loop,g" ${CONFIG}.new > ${CONFIG}
 .if exists(${X11BASE}/lib/libXft.so) && !defined(NO_AA)
 	@${CP} ${CONFIG} ${CONFIG}.new
 	${SED} -e "s,= -lXext,= -lXft -lXext,g" -e "s,QT= -I,QT= -DQT_XFT -I,g" \

--Multipart_Fri_Jan_19_21:27:26_2001-1--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86puhju3pt.wl>