From owner-svn-ports-all@freebsd.org Fri Jan 25 19:04:50 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFDF714BED43; Fri, 25 Jan 2019 19:04:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 738FB6AECC; Fri, 25 Jan 2019 19:04:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E8D0C804; Fri, 25 Jan 2019 19:04:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PJ4o62057598; Fri, 25 Jan 2019 19:04:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PJ4noc057595; Fri, 25 Jan 2019 19:04:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901251904.x0PJ4noc057595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 25 Jan 2019 19:04:49 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r491173 - in head: base/gcc devel/powerpc64-gcc devel/powerpc64-gcc/files X-SVN-Group: ports-head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: base/gcc devel/powerpc64-gcc devel/powerpc64-gcc/files X-SVN-Commit-Revision: 491173 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 738FB6AECC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:04:51 -0000 Author: jhb (src,doc committer) Date: Fri Jan 25 19:04:49 2019 New Revision: 491173 URL: https://svnweb.freebsd.org/changeset/ports/491173 Log: Override the library search directories for external GCC toolchains. The default library search directories when building a native GCC end up falling back to /usr/local/lib (for devel/*-gcc) and /usr/lib (for base/gcc) even when --sysroot is used. For devel/*-gcc, I previously forced CROSS_DIRECTORY_STRUCTURE on in r466699 to workaround this. However, this solution could not be used for base/gcc. Instead, patch the sources to remove several of the library search directories and override STARTFILE_PREFIX_SPEC to only look in /usr/lib. GCC still adds tuple-specific subdirs to /usr/lib, but this is ok. Bump PORTREVISION for both the external GCC toolchains and base/gcc. Reviewed by: kan Differential Revision: https://reviews.freebsd.org/D18677 Added: head/devel/powerpc64-gcc/files/freebsd-libdir (contents, props changed) Modified: head/base/gcc/Makefile head/devel/powerpc64-gcc/Makefile Modified: head/base/gcc/Makefile ============================================================================== --- head/base/gcc/Makefile Fri Jan 25 18:39:59 2019 (r491172) +++ head/base/gcc/Makefile Fri Jan 25 19:04:49 2019 (r491173) @@ -2,7 +2,7 @@ PORTNAME= gcc PORTVERSION= 6.4.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= base MASTER_SITES= GCC/releases/gcc-${DISTVERSION} \ http://www.mpfr.org/mpfr-3.1.6/:mpfr \ @@ -44,6 +44,7 @@ PLIST_SUB= TARGETARCH=${TARGETARCH} \ GCC_VERSION=${PORTVERSION} EXTRA_PATCHES+= ${.CURDIR}/../../devel/powerpc64-gcc/files/freebsd-format-extensions +EXTRA_PATCHES+= ${.CURDIR}/../../devel/powerpc64-gcc/files/freebsd-libdir EXTRA_PATCHES+= ${.CURDIR}/../../devel/powerpc64-gcc/files/patch-gcc-freebsd-mips GNU_CONFIGURE= yes Modified: head/devel/powerpc64-gcc/Makefile ============================================================================== --- head/devel/powerpc64-gcc/Makefile Fri Jan 25 18:39:59 2019 (r491172) +++ head/devel/powerpc64-gcc/Makefile Fri Jan 25 19:04:49 2019 (r491173) @@ -2,7 +2,7 @@ PORTNAME= gcc PORTVERSION= 6.4.0 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= devel MASTER_SITES= GCC/releases/gcc-${DISTVERSION} PKGNAMEPREFIX?= powerpc64- @@ -30,7 +30,8 @@ TARGETARCH= ${PKGNAMEPREFIX:C/-//g:S/amd64/x86_64/} .if empty(GCC_TARGET) # We are building for a FreeBSD target GCC_TARGET= ${PKGNAMEPREFIX:S/amd64/x86_64/}unknown-${OPSYS:tl}${OSREL} -EXTRA_PATCHES+= ${FILESDIR}/freebsd-format-extensions +EXTRA_PATCHES+= ${FILESDIR}/freebsd-format-extensions \ + ${FILESDIR}/freebsd-libdir .endif BU_PREFIX?= ${GCC_TARGET} @@ -49,9 +50,6 @@ CONFIGURE_ARGS+=--target=${GCC_TARGET} --disable-nls - ALL_TARGET?= all-gcc INSTALL_TARGET?= install-gcc - -# Force build of a cross compiler even if the target matches the host. -CFLAGS+= -DCROSS_DIRECTORY_STRUCTURE .include .include Added: head/devel/powerpc64-gcc/files/freebsd-libdir ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/powerpc64-gcc/files/freebsd-libdir Fri Jan 25 19:04:49 2019 (r491173) @@ -0,0 +1,43 @@ +diff --git gcc/config/freebsd.h gcc/config/freebsd.h +index e7ea42370c5..191e7da2071 100644 +--- gcc/config/freebsd.h ++++ gcc/config/freebsd.h +@@ -44,6 +44,9 @@ along with GCC; see the file COPYING3. If not see + #undef LIB_SPEC + #define LIB_SPEC FBSD_LIB_SPEC + ++#undef STARTFILE_PREFIX_SPEC ++#define STARTFILE_PREFIX_SPEC "/usr/lib/ " ++ + #if defined(HAVE_LD_EH_FRAME_HDR) + #define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " + #endif +diff --git gcc/gcc.c gcc/gcc.c +index f70755679f4..890ef20fd43 100644 +--- gcc/gcc.c ++++ gcc/gcc.c +@@ -4298,10 +4298,12 @@ process_command (unsigned int decoded_options_count, + } + + set_std_prefix (gcc_exec_prefix, len); ++#if 0 + add_prefix (&exec_prefixes, gcc_libexec_prefix, "GCC", + PREFIX_PRIORITY_LAST, 0, 0); + add_prefix (&startfile_prefixes, gcc_exec_prefix, "GCC", + PREFIX_PRIORITY_LAST, 0, 0); ++#endif + } + + /* COMPILER_PATH and LIBRARY_PATH have values +@@ -4585,9 +4587,11 @@ process_command (unsigned int decoded_options_count, + add_prefix (&exec_prefixes, + concat (tooldir_prefix, "bin", dir_separator_str, NULL), + "BINUTILS", PREFIX_PRIORITY_LAST, 0, 0); ++#if 0 + add_prefix (&startfile_prefixes, + concat (tooldir_prefix, "lib", dir_separator_str, NULL), + "BINUTILS", PREFIX_PRIORITY_LAST, 0, 1); ++#endif + free (tooldir_prefix); + + #if defined(TARGET_SYSTEM_ROOT_RELOCATABLE) && !defined(VMS)