Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Dec 2018 15:38:31 +0000 (UTC)
From:      Andreas Tobler <andreast@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r488673 - in head: Mk lang/gcc7
Message-ID:  <201812291538.wBTFcVdt082667@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andreast (src committer)
Date: Sat Dec 29 15:38:30 2018
New Revision: 488673
URL: https://svnweb.freebsd.org/changeset/ports/488673

Log:
  Fix build of GCC on powerpc64.
  
  While building GCC itself we have to use the built GCC libraries to configure
  additional parts of GCC and not the libraires from the host.
  
  Install the built 32-bit libraries. This was not done up to now.
  
  PR:	231804
  Approved by:	gerald@

Modified:
  head/Mk/bsd.gcc.mk
  head/lang/gcc7/Makefile

Modified: head/Mk/bsd.gcc.mk
==============================================================================
--- head/Mk/bsd.gcc.mk	Sat Dec 29 15:30:42 2018	(r488672)
+++ head/Mk/bsd.gcc.mk	Sat Dec 29 15:38:30 2018	(r488673)
@@ -150,9 +150,16 @@ CC:=			gcc${V}
 CXX:=			g++${V}
 CPP:=			cpp${V}
 _GCC_RUNTIME:=		${LOCALBASE}/lib/gcc${V}
+.   if ${PORTNAME} == gcc
+# We don't want the rpath stuff while building GCC itself
+# so we do not set the FLAGS as done in the else part.
+# When building a GCC, we want the target libraries to be used and not the
+# host GCC libraries.
+.   else
 CFLAGS+=		-Wl,-rpath=${_GCC_RUNTIME}
 CXXFLAGS+=		-Wl,-rpath=${_GCC_RUNTIME}
 LDFLAGS+=		-Wl,-rpath=${_GCC_RUNTIME} -L${_GCC_RUNTIME}
+.   endif
 .  else # Use GCC in base.
 CC:=			gcc
 CXX:=			g++

Modified: head/lang/gcc7/Makefile
==============================================================================
--- head/lang/gcc7/Makefile	Sat Dec 29 15:30:42 2018	(r488672)
+++ head/lang/gcc7/Makefile	Sat Dec 29 15:38:30 2018	(r488673)
@@ -70,6 +70,7 @@ CONFIGURE_ARGS+=	--with-cpu=8540 --enable-e500_double 
 
 LANGUAGES:=	c,c++,objc,fortran
 TARGLIB=	${PREFIX}/lib/gcc${SUFFIX}
+TARGLIB32=	${PREFIX}/lib32	# The version information is added later
 LIBEXEC=	${PREFIX}/libexec/gcc${SUFFIX}
 GNU_CONFIGURE=	yes
 CONFIGURE_OUTSOURCE=	yes
@@ -138,7 +139,13 @@ post-stage:
 	${RM} -r ${STAGEDIR}${TARGLIB}/gcc/*/${GCC_VERSION}/include-fixed/
 	# Add target libraries and include files to packaging list.
 	${RM} ${WRKDIR}/PLIST.lib
-.for d in ${TARGLIB:S/^${PREFIX}\///} ${LIBEXEC:S/^${PREFIX}\///}
+
+.if ${ARCH} == powerpc64 && ${PORT_OPTIONS:MMULTILIB}
+	${MKDIR} ${STAGEDIR}${TARGLIB32}/gcc${SUFFIX}
+	${MV} ${STAGEDIR}${PREFIX}/lib/lib32/* ${STAGEDIR}${TARGLIB32}/gcc${SUFFIX}
+.endif
+
+.for d in ${TARGLIB:S/^${PREFIX}\///} ${TARGLIB32:S/^${PREFIX}\///} ${LIBEXEC:S/^${PREFIX}\///}
 	cd ${STAGEDIR}${PREFIX} ; if [ -d $d ]; then \
 	    ${FIND} $d -type f -o -type l >>${WRKDIR}/PLIST.lib ;\
 	fi



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