Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 May 2018 15:18:28 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r469449 - in head: Mk base/binutils base/gcc base/gcc/files
Message-ID:  <201805091518.w49FISOX007760@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb (src,doc committer)
Date: Wed May  9 15:18:27 2018
New Revision: 469449
URL: https://svnweb.freebsd.org/changeset/ports/469449

Log:
  Add 32-bit mips support to base/binutils and base/gcc.
  
  - When cross-building packages, set ARCH to the target arch instead of
    the arch of the build host.  This fixes bsd.ssp.mk on MIPS which was
    trying to enable SSP on MIPS cross-built packages because the host
    ARCH was amd64.  A new HOST_ARCH variable is added to set the
    --build triple for configure scripts, but I believe most other uses of
    ARCH in ports are really about the target, not the build host so this
    is the more correct general direction.
  - Some updates to base/binutils and base/gcc to use ARCH as the target
    architecture.
  - Drop the extra arguments to GCC to set include and library paths and
    only set --sysroot.
  - Move the --sysroot flags into CC, CXX, CPP (which is now set to XCPP)
    and LD instead of passing it in CFLAGS, etc.  The base/gcc build uses
    ends up using the CFLAGS when building native binaries for the build
    host which fails when tripping over the --sysroot.  I think this might
    have accidentally worked before because the powerpc64 headers in
    /usr/include/machine were "close enough" to the amd64 headers, but with
    32-bit MIPS this failed hard.
  - Add the GCC MIPS patch from devel/powerpc64-gcc to base/gcc to add
    MIPS support to base/gcc.
  - Add a MIPS plist for base/binutils.
  - Set helper variables for the base/gcc plist to tag architecture-specific
    headers (e.g. for intrinsincs) and use these to tag powerpc and MIPS
    specific headers.
  - Drop the include-fixed headers from base/gcc.
  - Strip /usr/local/include from the default list of include paths for
    base/gcc.
  - Use libc++'s include path for C++ for base/gcc.
  
  Reviewed by:	bapt
  Approved by:	portmgr (bapt)
  Differential Revision:	https://reviews.freebsd.org/D15267

Added:
  head/base/binutils/pkg-plist.mips   (contents, props changed)
Deleted:
  head/base/gcc/files/patch-Makefile.in
  head/base/gcc/files/patch-gcc-Makefile.in
  head/base/gcc/files/patch-gcc-configure
Modified:
  head/Mk/bsd.port.mk
  head/base/binutils/Makefile
  head/base/gcc/Makefile
  head/base/gcc/pkg-plist

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Wed May  9 14:05:22 2018	(r469448)
+++ head/Mk/bsd.port.mk	Wed May  9 15:18:27 2018	(r469449)
@@ -1098,15 +1098,13 @@ CXX_FOR_BUILD:=	${HOSTCXX}
 .endif
 CONFIGURE_ENV+= HOSTCC="${HOSTCC}" HOSTCXX="${HOSTCXX}" CC_FOR_BUILD="${CC_FOR_BUILD}" CXX_FOR_BUILD="${CXX_FOR_BUILD}"
 
-CC=		${XCC}
-CXX=	${XCXX}
-CFLAGS+=	--sysroot=${CROSS_SYSROOT} -isystem ${CROSS_SYSROOT}/usr/include
-CXXFLAGS+=	--sysroot=${CROSS_SYSROOT} -isystem ${CROSS_SYSROOT}/usr/include -isystem ${CROSS_SYSROOT}/usr/include/c++/v1 -nostdinc++
-CPPFLAGS+=	--sysroot=${CROSS_SYSROOT} -isystem ${CROSS_SYSROOT}/usr/include
-LDFLAGS+=	--sysroot=${CROSS_SYSROOT}
+CC=		${XCC} --sysroot=${CROSS_SYSROOT}
+CXX=		${XCXX} --sysroot=${CROSS_SYSROOT}
+CPP=		${XCPP} --sysroot=${CROSS_SYSROOT}
 .for _tool in AS AR LD NM OBJCOPY RANLIB SIZE STRINGS
 ${_tool}=	${CROSS_BINUTILS_PREFIX}${tool:tl}
 .endfor
+LD+=		--sysroot=${CROSS_SYSROOT}
 STRIP_CMD=	${CROSS_BINUTILS_PREFIX}strip
 # only bmake support the below
 STRIPBIN=	${STRIP_CMD}
@@ -1144,6 +1142,10 @@ MAINTAINER?=	ports@FreeBSD.org
 .if !defined(ARCH)
 ARCH!=	${UNAME} -p
 .endif
+HOSTARCH:=	${ARCH}
+.if defined(CROSS_TOOLCHAIN)
+ARCH=	${CROSS_TOOLCHAIN:C,-.*$,,}
+.endif
 _EXPORTED_VARS+=	ARCH
 
 # Get the operating system type
@@ -2619,7 +2621,7 @@ PKGLATESTFILE=		${PKGLATESTREPOSITORY}/${PKGBASE}${PKG
 
 CONFIGURE_SCRIPT?=	configure
 CONFIGURE_CMD?=		./${CONFIGURE_SCRIPT}
-CONFIGURE_TARGET?=	${ARCH}-portbld-${OPSYS:tl}${OSREL}
+CONFIGURE_TARGET?=	${HOSTARCH}-portbld-${OPSYS:tl}${OSREL}
 CONFIGURE_TARGET:=	${CONFIGURE_TARGET:S/--build=//}
 CONFIGURE_LOG?=		config.log
 

Modified: head/base/binutils/Makefile
==============================================================================
--- head/base/binutils/Makefile	Wed May  9 14:05:22 2018	(r469448)
+++ head/base/binutils/Makefile	Wed May  9 15:18:27 2018	(r469449)
@@ -8,7 +8,7 @@ VALID_CATEGORIES=	base
 COMMENT=	GNU binary tools for base
 
 MASTERDIR=	${.CURDIR}/../../devel/binutils
-PLIST=		${.CURDIR}/pkg-plist.${TARGET_ARCH}
+PLIST=		${.CURDIR}/pkg-plist.${ARCH}
 
 .if !defined(CROSS_TOOLCHAIN)
 .error Please define CROSS_TOOLCHAIN before building
@@ -18,8 +18,7 @@ PLIST=		${.CURDIR}/pkg-plist.${TARGET_ARCH}
 .error Please define CROSS_SYSROOT before building
 .endif
 
-TARGET_ARCH=	${CROSS_TOOLCHAIN:C,-.*$,,}
-BUTARGET=	${TARGET_ARCH}-unknown-${OPSYS:tl}${OSREL}
+BUTARGET=	${ARCH}-unknown-${OPSYS:tl}${OSREL}
 
 CONFIGURE_ARGS+=	--disable-host-shared
 PREFIX=	/usr

Added: head/base/binutils/pkg-plist.mips
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/base/binutils/pkg-plist.mips	Wed May  9 15:18:27 2018	(r469449)
@@ -0,0 +1,278 @@
+bin/as
+bin/ld
+bin/ld.bfd
+bin/objdump
+bin/%%BUTARGET%%-as
+bin/%%BUTARGET%%-ld
+bin/%%BUTARGET%%-ld.bfd
+bin/%%BUTARGET%%-objdump
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.x
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xbn
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xc
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xce
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xd
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xdc
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xdce
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xde
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xdw
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xdwe
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xe
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xn
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xr
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xs
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xsc
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xsce
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xse
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xsw
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xswe
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xu
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xw
+%%BUTARGET%%/lib/ldscripts/elf32btsmip.xwe
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.x
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xbn
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xc
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xce
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xd
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xdc
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xdce
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xde
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xdw
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xdwe
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xe
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xn
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xr
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xs
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xsc
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xsce
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xse
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xsw
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xswe
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xu
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xw
+%%BUTARGET%%/lib/ldscripts/elf32btsmip_fbsd.xwe
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.x
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xbn
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xc
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xce
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xd
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xdc
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xdce
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xde
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xdw
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xdwe
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xe
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xn
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xr
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xs
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xsc
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xsce
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xse
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xsw
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xswe
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xu
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xw
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32.xwe
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.x
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xbn
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xc
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xce
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xd
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xdc
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xdce
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xde
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xdw
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xdwe
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xe
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xn
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xr
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xs
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xsc
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xsce
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xse
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xsw
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xswe
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xu
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xw
+%%BUTARGET%%/lib/ldscripts/elf32btsmipn32_fbsd.xwe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.x
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xbn
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xd
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xdc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xdce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xde
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xdw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xdwe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xn
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xr
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xs
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xsc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xsce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xse
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xsw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xswe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xu
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip.xwe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.x
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xbn
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xd
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xdc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xdce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xde
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xdw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xdwe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xn
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xr
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xs
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xsc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xsce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xse
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xsw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xswe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xu
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmip_fbsd.xwe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.x
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xbn
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xd
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xdc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xdce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xde
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xdw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xdwe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xn
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xr
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xs
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xsc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xsce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xse
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xsw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xswe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xu
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32.xwe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.x
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xbn
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xd
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xdc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xdce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xde
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xdw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xdwe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xn
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xr
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xs
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xsc
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xsce
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xse
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xsw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xswe
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xu
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xw
+%%BUTARGET%%/lib/ldscripts/elf32ltsmipn32_fbsd.xwe
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.x
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xbn
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xc
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xce
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xd
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xdc
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xdce
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xde
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xdw
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xdwe
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xe
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xn
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xr
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xs
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xsc
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xsce
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xse
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xsw
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xswe
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xu
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xw
+%%BUTARGET%%/lib/ldscripts/elf64btsmip.xwe
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.x
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xbn
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xc
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xce
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xd
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xdc
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xdce
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xde
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xdw
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xdwe
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xe
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xn
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xr
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xs
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xsc
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xsce
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xse
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xsw
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xswe
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xu
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xw
+%%BUTARGET%%/lib/ldscripts/elf64btsmip_fbsd.xwe
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.x
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xbn
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xc
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xce
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xd
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xdc
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xdce
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xde
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xdw
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xdwe
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xe
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xn
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xr
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xs
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xsc
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xsce
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xse
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xsw
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xswe
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xu
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xw
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip.xwe
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.x
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xbn
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xc
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xce
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xd
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xdc
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xdce
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xde
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xdw
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xdwe
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xe
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xn
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xr
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xs
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xsc
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xsce
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xse
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xsw
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xswe
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xu
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xw
+%%BUTARGET%%/lib/ldscripts/elf64ltsmip_fbsd.xwe
+share/man/man1/as.1.gz
+share/man/man1/ld.1.gz
+share/man/man1/objdump.1.gz
+share/man/man1/%%BUTARGET%%-as.1.gz
+share/man/man1/%%BUTARGET%%-ld.1.gz
+share/man/man1/%%BUTARGET%%-objdump.1.gz

Modified: head/base/gcc/Makefile
==============================================================================
--- head/base/gcc/Makefile	Wed May  9 14:05:22 2018	(r469448)
+++ head/base/gcc/Makefile	Wed May  9 15:18:27 2018	(r469449)
@@ -34,16 +34,15 @@ CONFIGURE_ENV=	gcc_gxx_include_dir="/usr/include/c++/v
 		AS_FOR_TARGET=/usr/bin/as \
 		LD_FOR_TARGET=/usr/bin/ld \
 		NM_FOR_TARGET=/usr/bin/nm
-TARGET_ARCH=	${CROSS_TOOLCHAIN:C,-.*$,,}
-GCC_TARGET=	${TARGET_ARCH}-unknown-${OPSYS:tl}${OSREL}
+GCC_TARGET=	${ARCH}-unknown-${OPSYS:tl}${OSREL}
 USES=	gmake libtool tar:bzip2 makeinfo
-PLIST_SUB=	TARGETARCH=${TARGET_ARCH} \
+PLIST_SUB=	TARGETARCH=${ARCH} \
 		OPSYS=${OPSYS:tl} \
 		GCC_TARGET=${GCC_TARGET} \
 		GCC_VERSION=${PORTVERSION}
 
-TARGET_ARCH=	${CROSS_TOOLCHAIN:C,-.*$,,}
 EXTRA_PATCHES+= ${.CURDIR}/../../devel/powerpc64-gcc/files/freebsd-format-extensions
+EXTRA_PATCHES+= ${.CURDIR}/../../devel/powerpc64-gcc/files/patch-gcc-freebsd-mips
 
 GNU_CONFIGURE=	yes
 CONFIGURE_OUTSOURCE=	yes
@@ -52,12 +51,26 @@ CONFIGURE_ARGS+=	\
 		--enable-languages=c,c++ \
 		--disable-nls \
 		--without-headers \
+		--with-gxx-include-dir=/usr/include/c++/v1/ \
 		--with-build-sysroot=${CROSS_SYSROOT} \
 		-with-pkgversion="GNU Collection for FreeBSD"
 
 ALL_TARGET?=	all-gcc
 INSTALL_TARGET?=	install-gcc
 
+.include <bsd.port.pre.mk>
+
+.if ${ARCH:Mmips*}
+PLIST_SUB+=	MIPS=""
+.else
+PLIST_SUB+=	MIPS="@comment "
+.endif
+.if ${ARCH:Mpowerpc*}
+PLIST_SUB+=	POWERPC=""
+.else
+PLIST_SUB+=	POWERPC="@comment "
+.endif
+
 post-extract:
 	cd ${WRKSRC}; ${LN} -sf ../mpfr-3.1.6 mpfr ; \
 		${LN} -sf ../gmp-6.1.2 gmp ; \
@@ -66,6 +79,8 @@ post-extract:
 post-patch:
 	@${REINPLACE_CMD} -e '/LIBSTDCXX/ s/stdc\+\+/c\+\+/g ' \
 		${WRKSRC}//gcc/cp/g++spec.c
+	@${REINPLACE_CMD} -e '/LOCAL_INCLUDE_DIR/ d ' \
+		${WRKSRC}//gcc/Makefile.in
 
 post-install:
 	${MV} ${STAGEDIR}/usr/bin/gcov-tool ${STAGEDIR}/usr/bin/${GCC_TARGET}-gcov-tool ; \
@@ -81,5 +96,6 @@ post-install:
 	${LN} -sf ${GCC_TARGET}-gcc  ${STAGEDIR}/usr/bin/cc ; \
 	${LN} -sf ${GCC_TARGET}-gcc.1.gz ${STAGEDIR}/${MANDIR}1/cc.1.gz
 	${RM} -r ${STAGEDIR}/usr/share/info
+	${RM} -r ${STAGEDIR}/usr/lib/gcc/${GCC_TARGET}/${PORTVERSION}/include-fixed
 
 .include <bsd.port.mk>

Modified: head/base/gcc/pkg-plist
==============================================================================
--- head/base/gcc/pkg-plist	Wed May  9 14:05:22 2018	(r469448)
+++ head/base/gcc/pkg-plist	Wed May  9 15:18:27 2018	(r469449)
@@ -14,33 +14,18 @@ bin/%%GCC_TARGET%%-gcc-nm
 bin/%%GCC_TARGET%%-gcc-ranlib
 bin/%%GCC_TARGET%%-gcov
 bin/%%GCC_TARGET%%-gcov-tool
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/README
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/libmilter/mfapi.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/limits.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_fil.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_lookup.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_nat.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_proxy.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_scan.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/netinet/ip_state.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/stddef.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/stdio.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/stdlib.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/sys/types.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/syslimits.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/unistd.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include-fixed/wchar.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/altivec.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/altivec.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/float.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/htmintrin.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/htmxlintrin.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/htmintrin.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/htmxlintrin.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/iso646.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/paired.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/ppc-asm.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/ppu_intrinsics.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/si2vmx.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/spe.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/spu2vmx.h
+%%MIPS%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/loongson.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/paired.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/ppc-asm.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/ppu_intrinsics.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/si2vmx.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/spe.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/spu2vmx.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/stdalign.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/stdarg.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/stdatomic.h
@@ -52,7 +37,7 @@ lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/stdint.
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/stdnoreturn.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/tgmath.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/varargs.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/vec_types.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/include/vec_types.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/install-tools/fixinc_list
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/install-tools/gsyslimits.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/install-tools/include/README
@@ -109,21 +94,27 @@ lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/collect2.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/conditions.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/dbxelf.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/dbxelf.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/elfos.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/%%OPSYS%%-spec.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/%%OPSYS%%-stdint.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/%%OPSYS%%.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/initfini-array.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/default64.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/%%OPSYS%%64.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/option-defaults.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000-builtin.def
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000-cpus.def
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000-opts.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000-protos.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000.h
-lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/sysv4.h
+%%MIPS%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/mips/elf.h
+%%MIPS%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/mips/%%OPSYS%%.h
+%%MIPS%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/mips/mips-opts.h
+%%MIPS%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/mips/mips-protos.h
+%%MIPS%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/mips/mips.h
+%%MIPS%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/vxworks-dummy.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/default64.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/%%OPSYS%%64.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/option-defaults.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000-builtin.def
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000-cpus.def
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000-opts.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000-protos.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/rs6000.h
+%%POWERPC%%lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/config/rs6000/sysv4.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/configargs.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/context.h
 lib/gcc/%%GCC_TARGET%%/%%GCC_VERSION%%/plugin/include/convert.h



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