From owner-svn-src-all@freebsd.org Sun Oct 6 04:19:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5B77FA894; Sun, 6 Oct 2019 04:19:51 +0000 (UTC) (envelope-from kevans@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 46m9PM4Bnnz4YK0; Sun, 6 Oct 2019 04:19:51 +0000 (UTC) (envelope-from kevans@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 565731FA69; Sun, 6 Oct 2019 04:19:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x964Jp7N047563; Sun, 6 Oct 2019 04:19:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x964JoXX047557; Sun, 6 Oct 2019 04:19:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201910060419.x964JoXX047557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 6 Oct 2019 04:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353140 - in head: lib/csu/tests/dso lib/libc++ lib/libcxxrt lib/libgcc_eh lib/libpmc share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/csu/tests/dso lib/libc++ lib/libcxxrt lib/libgcc_eh lib/libpmc share/mk X-SVN-Commit-Revision: 353140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Oct 2019 04:19:51 -0000 Author: kevans Date: Sun Oct 6 04:19:49 2019 New Revision: 353140 URL: https://svnweb.freebsd.org/changeset/base/353140 Log: Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around Diff partially stolen from CheriBSD; these bits need -Wl,-z,notext in order to build in an LLVM world. They are needed for all flavors/sizes of MIPS. This will eventually get fixed in LLVM, but it's unclear when. Reported by: arichardson, emaste Differential Revision: https://reviews.freebsd.org/D21696 Modified: head/lib/csu/tests/dso/Makefile head/lib/libc++/Makefile head/lib/libcxxrt/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/libpmc/Makefile head/share/mk/bsd.lib.mk Modified: head/lib/csu/tests/dso/Makefile ============================================================================== --- head/lib/csu/tests/dso/Makefile Sun Oct 6 04:12:08 2019 (r353139) +++ head/lib/csu/tests/dso/Makefile Sun Oct 6 04:19:49 2019 (r353140) @@ -5,6 +5,8 @@ SHLIB= h_csu SHLIB_NAME= libh_csu.so SHLIB_MAJOR= 1 +ALLOW_MIPS_SHARED_TEXTREL= + WITHOUT_STATIC= WITHOUT_PROFILE= WITHOUT_PIC= Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Sun Oct 6 04:12:08 2019 (r353139) +++ head/lib/libc++/Makefile Sun Oct 6 04:19:49 2019 (r353140) @@ -11,6 +11,8 @@ CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR} STATIC_CXXFLAGS+= -mlong-calls .endif +ALLOW_MIPS_SHARED_TEXTREL= + .PATH: ${SRCDIR} LIB= c++ Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Sun Oct 6 04:12:08 2019 (r353139) +++ head/lib/libcxxrt/Makefile Sun Oct 6 04:19:49 2019 (r353140) @@ -5,6 +5,7 @@ SRCDIR= ${SRCTOP}/contrib/libcxxrt SHLIB_MAJOR= 1 SHLIBDIR?= /lib +ALLOW_MIPS_SHARED_TEXTREL= .PATH: ${SRCDIR} Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Sun Oct 6 04:12:08 2019 (r353139) +++ head/lib/libgcc_eh/Makefile.inc Sun Oct 6 04:19:49 2019 (r353140) @@ -6,6 +6,8 @@ UNWINDSRCDIR= ${SRCTOP}/contrib/libunwind/src STATIC_CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN +ALLOW_MIPS_SHARED_TEXTREL= + .PATH: ${COMPILERRTDIR}/lib/builtins .PATH: ${UNWINDSRCDIR} SRCS_EXC+= gcc_personality_v0.c Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Sun Oct 6 04:12:08 2019 (r353139) +++ head/lib/libpmc/Makefile Sun Oct 6 04:19:49 2019 (r353140) @@ -5,6 +5,8 @@ LIB= pmc SRCS= libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc INCS= pmc.h pmclog.h pmcformat.h +ALLOW_MIPS_SHARED_TEXTREL= + .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" .if ${MACHINE_ARCH} == "aarch64" Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sun Oct 6 04:12:08 2019 (r353139) +++ head/share/mk/bsd.lib.mk Sun Oct 6 04:19:49 2019 (r353140) @@ -287,6 +287,10 @@ CLEANFILES+= ${SOBJS} .if defined(SHLIB_NAME) _LIBS+= ${SHLIB_NAME} +.if ${CFLAGS:M-fexceptions} || defined(SHLIB_CXX) || defined(LIB_CXX) +ALLOW_MIPS_SHARED_TEXTREL= +.endif + SOLINKOPTS+= -shared -Wl,-x .if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no" SOLINKOPTS+= -Wl,--no-fatal-warnings @@ -294,6 +298,15 @@ SOLINKOPTS+= -Wl,--no-fatal-warnings SOLINKOPTS+= -Wl,--fatal-warnings .endif SOLINKOPTS+= -Wl,--warn-shared-textrel + +.if defined(ALLOW_MIPS_SHARED_TEXTREL) && ${MACHINE_CPUARCH:Mmips} +# Check if we should be defining ALLOW_SHARED_TEXTREL... basically, C++ +# or -fexceptions in CFLAGS on MIPS. This works around clang/lld attempting +# to generate text relocations in read-only .eh_frame. A future version of +# clang/lld should instead transform them into relative references at link +# time, and then we can stop doing this. +SOLINKOPTS+= -Wl,-z,notext +.endif .if target(beforelinking) beforelinking: ${SOBJS}