Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Dec 2021 10:06:01 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 3392ecd6d2a0 - stable/12 - Fix the mips64 world build after r364284.
Message-ID:  <202112221006.1BMA61ix092131@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=3392ecd6d2a0368f77c3a1397b54023db74e21a9

commit 3392ecd6d2a0368f77c3a1397b54023db74e21a9
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2020-08-19 17:05:30 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-12-22 09:58:32 +0000

    Fix the mips64 world build after r364284.
    
    Linking the full version of clang 11 results in errors similar to:
    
    lld: error: /usr/src/contrib/llvm-project/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:736:(.text._ZN5clang4ento22CreateAnalysisConsumerERNS_16CompilerInstanceE+0xE0): relocation R_MIPS_CALL16 out of range: 48920 is not in [-32768, 32767]; references operator new(unsigned long)
    
    Add -mxgot to the compilation flags for llvm libraries to work around
    this error. This may be too big of a hammer, but it can always be
    refined later.
    
    MFC after:      6 weeks
    
    (cherry picked from commit 7eee1720520faaeee2dd91f23092b39f83b89216)
---
 lib/clang/llvm.build.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk
index d080bc57f1f3..7aa034a42d0c 100644
--- a/lib/clang/llvm.build.mk
+++ b/lib/clang/llvm.build.mk
@@ -112,3 +112,8 @@ CXXSTD?=	c++14
 CXXFLAGS+=	-fno-exceptions
 CXXFLAGS+=	-fno-rtti
 CXXFLAGS.clang+= -stdlib=libc++
+
+.if ${MACHINE_ARCH:Mmips64}
+STATIC_CFLAGS+= -mxgot
+STATIC_CXXFLAGS+= -mxgot
+.endif



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