Date: Sun, 6 Oct 2019 04:19:50 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> 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 Message-ID: <201910060419.x964JoXX047557@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910060419.x964JoXX047557>