From owner-svn-src-stable@freebsd.org Tue Jun 6 18:40:16 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43CDEBF29DE; Tue, 6 Jun 2017 18:40:16 +0000 (UTC) (envelope-from dim@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 mx1.freebsd.org (Postfix) with ESMTPS id 138147686A; Tue, 6 Jun 2017 18:40:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v56IeFm3041986; Tue, 6 Jun 2017 18:40:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v56IeFsx041985; Tue, 6 Jun 2017 18:40:15 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201706061840.v56IeFsx041985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 6 Jun 2017 18:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r319631 - stable/10/lib/clang X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2017 18:40:16 -0000 Author: dim Date: Tue Jun 6 18:40:14 2017 New Revision: 319631 URL: https://svnweb.freebsd.org/changeset/base/319631 Log: Work around a gcc 4.2 bug on powerpc architectures, where using -fdata-sections can cause bogus "section type conflict" errors. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33168 for more information. Since the upstream fixes are under GPLv3 and non-trivial, just disable using function and data sections, at the cost of a slightly larger executable. Direct commit to stable/10, since the version of clang in head and stable/11 cannot be built by gcc 4.2 at all. Modified: stable/10/lib/clang/clang.build.mk Modified: stable/10/lib/clang/clang.build.mk ============================================================================== --- stable/10/lib/clang/clang.build.mk Tue Jun 6 17:27:41 2017 (r319630) +++ stable/10/lib/clang/clang.build.mk Tue Jun 6 18:40:14 2017 (r319631) @@ -31,9 +31,14 @@ TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGE BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.3 CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \ -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \ - -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" \ - -ffunction-sections -fdata-sections + -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" +# Work around gcc 4.2 "section type conflict" bug with -fdata-sections on +# powerpc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33168 +.if !(${MACHINE_CPUARCH} == "powerpc" && ${COMPILER_TYPE} == "gcc" && \ + ${COMPILER_VERSION} < 40300) +CFLAGS+= -ffunction-sections -fdata-sections LDFLAGS+= -Wl,--gc-sections +.endif CXXFLAGS+= -fno-exceptions -fno-rtti .PATH: ${LLVM_SRCS}/${SRCDIR}