Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 2014 10:24:59 -0500
From:      Stacey Son <sson@me.com>
To:        freebsd-mips@FreeBSD.org
Cc:        David Chisnall <theraven@FreeBSD.org>
Subject:   mips64 ld GOT problem
Message-ID:  <77F1DDA2-A4E5-4D64-AA43-F8CBC55249C4@me.com>

next in thread | raw e-mail | index | archive | help
Hi all:

I have been trying to bootstrap clang/llvm 3.5 for mips64 (i.e. cross =
build clang/llvm 3.5 for mips64 using clang/llvm 3.5) but run into the =
following linker problem (see below) in about the midway point as it is =
trying to link 'opt'.   The assertions that fail are the following:

BFD 2.17.50 [FreeBSD] 2007-07-03 assertion fail =
/usr/home/sson/freebsd/gnu/usr.bin/binutils/libbfd/../../../../contrib/bin=
utils/bfd/elfxx-mips.c:7455

                  BFD_ASSERT (g->assigned_gotno - g->local_gotno
                              <=3D g->global_gotno);

 BFD 2.17.50 [FreeBSD] 2007-07-03 assertion fail =
/usr/home/sson/freebsd/gnu/usr.bin/binutils/libbfd/../../../../contrib/bin=
utils/bfd/elfxx-mips.c:2767

  /* There should have been enough room in the symbol table to
     accommodate both the GOT and non-GOT symbols.  */
  BFD_ASSERT (hsd.max_non_got_dynindx <=3D hsd.min_got_dynindx);

BFD 2.17.50 [FreeBSD] 2007-07-03 assertion fail =
/usr/home/sson/freebsd/gnu/usr.bin/binutils/libbfd/../../../../contrib/bin=
utils/bfd/elfxx-mips.c:10282

      /* Make sure we didn't grow the global .got region.  */
      dynobj =3D elf_hash_table (info)->dynobj;
      got =3D mips_elf_got_section (dynobj, FALSE);
      g =3D mips_elf_section_data (got)->u.got_info;
                              =20
      if (g->global_gotsym !=3D NULL)
        BFD_ASSERT ((elf_hash_table (info)->dynsymcount
                     - g->global_gotsym->dynindx)
                    <=3D g->global_gotno);

Does anyone have an idea for a work around or fix?

Thanks in advance,

-stacey.

----
The full  ld crash message:

[ 50%] Building CXX object tools/opt/CMakeFiles/opt.dir/opt.cpp.o
Linking CXX executable ../../bin/opt
/home/sson/sdk/bin/mips64-unknown-freebsd-ld: BFD 2.17.50 [FreeBSD] =
2007-07-03 assertion fail =
/usr/home/sson/freebsd/gnu/usr.bin/binutils/libbfd/../../../../contrib/bin=
utils/bfd/elfxx-mips.c:7455
/home/sson/sdk/bin/mips64-unknown-freebsd-ld: BFD 2.17.50 [FreeBSD] =
2007-07-03 assertion fail =
/usr/home/sson/freebsd/gnu/usr.bin/binutils/libbfd/../../../../contrib/bin=
utils/bfd/elfxx-mips.c:7455
/home/sson/sdk/bin/mips64-unknown-freebsd-ld: BFD 2.17.50 [FreeBSD] =
2007-07-03 assertion fail =
/usr/home/sson/freebsd/gnu/usr.bin/binutils/libbfd/../../../../contrib/bin=
utils/bfd/elfxx-mips.c:7455
/home/sson/sdk/bin/mips64-unknown-freebsd-ld: BFD 2.17.50 [FreeBSD] =
2007-07-03 assertion fail =
/usr/home/sson/freebsd/gnu/usr.bin/binutils/libbfd/../../../../contrib/bin=
utils/bfd/elfxx-mips.c:2767
/home/sson/sdk/bin/mips64-unknown-freebsd-ld: BFD 2.17.50 [FreeBSD] =
2007-07-03 assertion fail =
/usr/home/sson/freebsd/gnu/usr.bin/binutils/libbfd/../../../../contrib/bin=
utils/bfd/elfxx-mips.c:10282
CMakeFiles/opt.dir/PrintSCC.cpp.o: In function =
`llvm::scc_iterator<llvm::CallGraph*, =
llvm::GraphTraits<llvm::CallGraph*> >::hasLoop() const':
=
/usr/home/sson/llvm/tools/opt/PrintSCC.cpp:(.text._ZNK4llvm12scc_iteratorI=
PNS_9CallGraphENS_11GraphTraitsIS2_EEE7hasLoopEv[_ZNK4llvm12scc_iteratorIP=
NS_9CallGraphENS_11GraphTraitsIS2_EEE7hasLoopEv]+0x108): relocation =
truncated to fit: R_MIPS_CALL16 against =
`llvm::GraphTraits<llvm::CallGraphNode*>::child_end(llvm::CallGraphNode*)'=

CMakeFiles/opt.dir/PrintSCC.cpp.o: In function =
`llvm::scc_iterator<llvm::CallGraph*, =
llvm::GraphTraits<llvm::CallGraph*> >::GetNextSCC()':
=
/usr/home/sson/llvm/tools/opt/PrintSCC.cpp:(.text._ZN4llvm12scc_iteratorIP=
NS_9CallGraphENS_11GraphTraitsIS2_EEE10GetNextSCCEv[_ZN4llvm12scc_iterator=
IPNS_9CallGraphENS_11GraphTraitsIS2_EEE10GetNextSCCEv]+0x150): =
relocation truncated to fit: R_MIPS_CALL16 against =
`llvm::GraphTraits<llvm::CallGraphNode*>::child_end(llvm::CallGraphNode*)'=

CMakeFiles/opt.dir/PrintSCC.cpp.o: In function =
`llvm::scc_iterator<llvm::CallGraph*, =
llvm::GraphTraits<llvm::CallGraph*> >::DFSVisitChildren()':
=
/usr/home/sson/llvm/tools/opt/PrintSCC.cpp:(.text._ZN4llvm12scc_iteratorIP=
NS_9CallGraphENS_11GraphTraitsIS2_EEE16DFSVisitChildrenEv[_ZN4llvm12scc_it=
eratorIPNS_9CallGraphENS_11GraphTraitsIS2_EEE16DFSVisitChildrenEv]+0xb0): =
relocation truncated to fit: R_MIPS_CALL16 against =
`llvm::GraphTraits<llvm::CallGraphNode*>::child_end(llvm::CallGraphNode*)'=

../../lib/libLLVMMipsCodeGen.a(Mips16ISelDAGToDAG.cpp.o): In function =
`$BB72_54':
=
/usr/home/sson/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.cpp:(.text._ZNK4llv=
m16MipsDAGToDAGISel18CheckNodePredicateEPNS_6SDNodeEj[_ZNK4llvm16MipsDAGTo=
DAGISel18CheckNodePredicateEPNS_6SDNodeEj]+0x1214): relocation truncated =
to fit: R_MIPS_CALL16 against =
`llvm::ISD::isBuildVectorAllOnes(llvm::SDNode const*)'
../../lib/libLLVMMipsCodeGen.a(MipsSEISelLowering.cpp.o): In function =
`performXORCombine(llvm::SDNode*, llvm::SelectionDAG&, =
llvm::MipsSubtarget const&)':
=
/usr/home/sson/llvm/lib/Target/Mips/MipsSEISelLowering.cpp:(.text._ZL17per=
formXORCombinePN4llvm6SDNodeERNS_12SelectionDAGERKNS_13MipsSubtargetE+0x18=
0): relocation truncated to fit: R_MIPS_CALL16 against =
`llvm::ISD::isBuildVectorAllOnes(llvm::SDNode const*)'
=
/usr/home/sson/llvm/lib/Target/Mips/MipsSEISelLowering.cpp:(.text._ZL17per=
formXORCombinePN4llvm6SDNodeERNS_12SelectionDAGERKNS_13MipsSubtargetE+0x1d=
8): relocation truncated to fit: R_MIPS_CALL16 against =
`llvm::ISD::isBuildVectorAllOnes(llvm::SDNode const*)'
../../lib/libLLVMMipsDesc.a(MipsOptionRecord.cpp.o): In function =
`llvm::DenseMapBase<llvm::DenseMap<llvm::MCSection const*, =
llvm::MCSectionData*, llvm::DenseMapInfo<llvm::MCSection const*> >, =
llvm::MCSection const*, llvm::MCSectionData*, =
llvm::DenseMapInfo<llvm::MCSection const*> >::grow(unsigned int)':
=
/usr/home/sson/llvm/lib/Target/Mips/MCTargetDesc/MipsOptionRecord.cpp:(.te=
xt._ZN4llvm12DenseMapBaseINS_8DenseMapIPKNS_9MCSectionEPNS_13MCSectionData=
ENS_12DenseMapInfoIS4_EEEES4_S6_S8_E4growEj[_ZN4llvm12DenseMapBaseINS_8Den=
seMapIPKNS_9MCSectionEPNS_13MCSectionDataENS_12DenseMapInfoIS4_EEEES4_S6_S=
8_E4growEj]+0x28): relocation truncated to fit: R_MIPS_CALL16 against =
`llvm::DenseMap<llvm::MCSection const*, llvm::MCSectionData*, =
llvm::DenseMapInfo<llvm::MCSection const*> >::grow(unsigned int)'
clang-3.5: error: linker command failed with exit code 1 (use -v to see =
invocation)
*** Error code 1

ld invocation:

/home/sson/sdk/bin/mips64-unknown-freebsd-ld --sysroot=3D/home/sson/sdk =
--eh-frame-hdr -dynamic-linker /libexec/ld
-elf.so.1 --enable-new-dtags -o ../../bin/opt =
/home/sson/sdk/usr/lib/crt1.o /home/sson/sdk/usr/lib/crti.o /home/
sson/sdk/usr/lib/crtbegin.o -L/usr/local/lib -L/home/sson/sdk/usr/lib -z =
origin --export-dynamic CMakeFiles/opt.
dir/AnalysisWrappers.cpp.o CMakeFiles/opt.dir/BreakpointPrinter.cpp.o =
CMakeFiles/opt.dir/GraphPrinters.cpp.o CMa
keFiles/opt.dir/NewPMDriver.cpp.o CMakeFiles/opt.dir/Passes.cpp.o =
CMakeFiles/opt.dir/PassPrinters.cpp.o CMakeFil
es/opt.dir/PrintSCC.cpp.o CMakeFiles/opt.dir/opt.cpp.o =
../../lib/libLLVMMipsCodeGen.a ../../lib/libLLVMMipsAsmPr
inter.a ../../lib/libLLVMMipsAsmParser.a ../../lib/libLLVMMipsDesc.a =
../../lib/libLLVMMipsInfo.a ../../lib/libLL
VMMipsDisassembler.a ../../lib/libLLVMAnalysis.a =
../../lib/libLLVMBitWriter.a ../../lib/libLLVMCodeGen.a ../../l
ib/libLLVMCore.a ../../lib/libLLVMipa.a ../../lib/libLLVMipo.a =
../../lib/libLLVMIRReader.a ../../lib/libLLVMInst
Combine.a ../../lib/libLLVMInstrumentation.a ../../lib/libLLVMMC.a =
../../lib/libLLVMObjCARCOpts.a ../../lib/libL
LVMScalarOpts.a ../../lib/libLLVMSupport.a ../../lib/libLLVMTarget.a =
../../lib/libLLVMTransformUtils.a ../../lib
/libLLVMVectorize.a ../../lib/libLLVMAsmPrinter.a =
../../lib/libLLVMSelectionDAG.a ../../lib/libLLVMCodeGen.a ../
../lib/libLLVMMipsAsmPrinter.a ../../lib/libLLVMMCParser.a =
../../lib/libLLVMMipsInfo.a ../../lib/libLLVMMCDisass
embler.a ../../lib/libLLVMScalarOpts.a ../../lib/libLLVMInstCombine.a =
../../lib/libLLVMAsmParser.a ../../lib/lib
LLVMBitReader.a ../../lib/libLLVMTransformUtils.a ../../lib/libLLVMipa.a =
../../lib/libLLVMAnalysis.a ../../lib/l
ibLLVMTarget.a ../../lib/libLLVMCore.a ../../lib/libLLVMMC.a =
../../lib/libLLVMSupport.a --library=3Drt --library=3Dt
info --library=3Dpthread --library=3Dz -rpath $ORIGIN/../lib =
--library=3Dc++ --library=3Dm --library=3Dgcc --as-needed --l
ibrary=3Dgcc_s --no-as-needed --library=3Dc --library=3Dgcc --as-needed =
--library=3Dgcc_s --no-as-needed /home/sson/sdk/
usr/lib/crtend.o /home/sson/sdk/usr/lib/crtn.o




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?77F1DDA2-A4E5-4D64-AA43-F8CBC55249C4>