32-bit powerpc: gcc8 unable to build devel/llvm60: "/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935"

Mark Millard via freebsd-toolchain <[email protected]>
Newsgroups gmane.os.freebsd.devel.toolchain,gmane.os.freebsd.devel.ppc,gmane.os.freebsd.devel.ports
Message-ID <[email protected]>
My ports-mgmt/pouriere-devel based build attempt for building devel/llvm60 failed
with:

[00:00:53] [01] [00:00:00] Building devel/llvm60 | llvm60-6.0.1_6
[02:05:13] [01] [02:04:20] Saved devel/llvm60 | llvm60-6.0.1_6 wrkdir to: /usr/local/poudriere/data/wrkdirs/FBSDpowerpc-default/default/llvm60-6.0.1_6.tbz
[02:05:14] [01] [02:04:21] Finished devel/llvm60 | llvm60-6.0.1_6: Failed: build
[02:05:30] Stopping 1 builders

The log shows:

[3365/4552] : && /usr/local/bin/g++8 -fPIC -O2 -pipe  -DNDEBUG -Wl,-rpath=/usr/local/lib/gcc8  -DNDEBUG -D_GLIBCXX_USE_C99 -Wl,-rpath=/usr/local/lib/gcc8 -isystem /usr/local/include -fPIC -fvisibility
-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-v
irtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -pipe  -DNDEBUG -Wl,-rpath=/usr/local/lib/gcc8  -DNDEBUG -D_GLIBCXX_USE_C99 -Wl,-rpath=/usr/local/lib/gcc8 -isystem /usr/local/include 
 -Wl,-rpath=/usr/local/lib/gcc8 -L/usr/local/lib/gcc8   -Wl,-z,origin  -Wl,-O3 -Wl,--gc-sections  -Wl,--version-script,/wrkdirs/usr/ports/devel/llvm60/work/.build/tools/lto/LTO.exports -shared -Wl,-so
name,libLTO.so.6 -o lib/libLTO.so.6.0.1 tools/lto/CMakeFiles/LTO.dir/LTODisassembler.cpp.o tools/lto/CMakeFiles/LTO.dir/lto.cpp.o -L/usr/local/lib -Wl,-rpath,"\$ORIGIN/../lib:/usr/local/lib" lib/libLL
VM-6.0.so && :
FAILED: lib/libLTO.so.6.0.1 
: && /usr/local/bin/g++8 -fPIC -O2 -pipe  -DNDEBUG -Wl,-rpath=/usr/local/lib/gcc8  -DNDEBUG -D_GLIBCXX_USE_C99 -Wl,-rpath=/usr/local/lib/gcc8 -isystem /usr/local/include -fPIC -fvisibility-inlines-hid
den -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor 
-Wno-comment -ffunction-sections -fdata-sections -O2 -pipe  -DNDEBUG -Wl,-rpath=/usr/local/lib/gcc8  -DNDEBUG -D_GLIBCXX_USE_C99 -Wl,-rpath=/usr/local/lib/gcc8 -isystem /usr/local/include  -Wl,-rpath=
/usr/local/lib/gcc8 -L/usr/local/lib/gcc8   -Wl,-z,origin  -Wl,-O3 -Wl,--gc-sections  -Wl,--version-script,/wrkdirs/usr/ports/devel/llvm60/work/.build/tools/lto/LTO.exports -shared -Wl,-soname,libLTO.
so.6 -o lib/libLTO.so.6.0.1 tools/lto/CMakeFiles/LTO.dir/LTODisassembler.cpp.o tools/lto/CMakeFiles/LTO.dir/lto.cpp.o -L/usr/local/lib -Wl,-rpath,"\$ORIGIN/../lib:/usr/local/lib" lib/libLLVM-6.0.so &&
 :
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
/usr/local/bin/ld: BFD (GNU Binutils) 2.32 assertion fail elflink.c:2935
collect2: error: ld returned 1 exit status
. . .

The assert seems to be the last BFD_ASSERT shown below:

 /* If this is a weak defined symbol in a dynamic object, and we know
     the real definition in the dynamic object, copy interesting flags
     over to the real definition.  */
  if (h->is_weakalias)
    {
      struct elf_link_hash_entry *def = weakdef (h);
   
      /* If the real definition is defined by a regular object file,
         don't do anything special.  See the longer description in
         _bfd_elf_adjust_dynamic_symbol, below.  */
      if (def->def_regular)
        {
          h = def;
          while ((h = h->u.alias) != def)
            h->is_weakalias = 0;
        }
      else
        {
          while (h->root.type == bfd_link_hash_indirect)
            h = (struct elf_link_hash_entry *) h->root.u.i.link;
          BFD_ASSERT (h->root.type == bfd_link_hash_defined
                      || h->root.type == bfd_link_hash_defweak);
          BFD_ASSERT (def->def_dynamic);
          BFD_ASSERT (def->root.type == bfd_link_hash_defined);
          (*bed->elf_backend_copy_indirect_symbol) (eif->info, def, h);
        }
. . .


Context:

# uname -apKU
FreeBSD FBSDG4S 13.0-CURRENT FreeBSD 13.0-CURRENT #14 r344955M: Fri Mar  8 22:39:44 PST 2019     markmi@FBSDFSSD:/usr/obj/powerpcvtsc_clang_gcc421/powerpc.powerpc/usr/src/powerpc.powerpc/sys/GENERICvtsc-NODBG  powerpc powerpc 1300014 1300014

(The 32-bit powerpc is running a gcc 4.2.1 based system. amd64 system-clang built the
bootstrap gcc 4.2.1 toolchain, which in turn built the system. The 32-bit FreeBSD was
running on  a PowerMac G5 [2-sockets, 2 cores each].)

# svnlite info /usr/ports/ | grep 'Re[plv]'
Relative URL: ^/head
Repository Root: svn://svn0.us-west.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 495006
Last Changed Rev: 495006




===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.