bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/28106] New: Build of 2.37 fails on FreeBSD and Clang


From: yasu at utahime dot org
Subject: [Bug gold/28106] New: Build of 2.37 fails on FreeBSD and Clang
Date: Mon, 19 Jul 2021 20:44:19 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=28106

            Bug ID: 28106
           Summary: Build of 2.37 fails on FreeBSD and Clang
           Product: binutils
           Version: 2.37
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: yasu at utahime dot org
                CC: ian at airs dot com
  Target Milestone: ---

OS: FreeBSD 13.0-RELEASE amd64
Compiler: Clang 11.0.1 (system compiler)

Build of 2.37 fails as following.

----------------------------------------------------------------------------------------------------
c++ -DHAVE_CONFIG_H -I.  -I. -I./../include -I./../elfcpp
-DLOCALEDIR="\"/usr/local/share/locale\"" -DBINDIR="\"/usr/local/bin\""
-DTOOLBINDIR="\"/usr/local/x86_64-portbld-freebsd13.0/bin\""
-DTOOLLIBDIR="\"/usr/local/x86_64-portbld-freebsd13.0/lib\""  -isystem
/usr/local/include -W -Wall    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-frandom-seed=gc.o  -pthread -O2 -pipe -fstack-protector-strong -isystem
/usr/local/include -fno-strict-aliasing  -Wno-c++11-narrowing -isystem
/usr/local/include      -MT gc.o -MD -MP -MF .deps/gc.Tpo -c -o gc.o gc.cc
In file included from gc.cc:26:
./gc.h:250:34: error: reinterpret_cast from 'nullptr_t' to 'gold::Relobj *' is
not allowed
                (*secvec).push_back(Section_id(reinterpret_cast<Relobj*>(NULL),
0));
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gc.h:332:34: error: reinterpret_cast from 'nullptr_t' to 'gold::Relobj *' is
not allowed
                (*secvec).push_back(Section_id(reinterpret_cast<Relobj*>(NULL),
0));
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
gmake[5]: *** [Makefile:1134: gc.o] Error 1
----------------------------------------------------------------------------------------------------

If I revert following commit in binutils-2_37-branch of git repository, then
build completes successfully.

----------------------------------------------------------------------------------------------------
commit 5d7f11f0e76
Author: Alan Modra <amodra@gmail.com>
Date:   Tue May 25 14:36:49 2021

    [GOLD] PR27815, gold fails to build with latest GCC

    Don't use nullptr, it requires -std=c++11 on versions of gcc prior to
    6.1.  It would be possible to arrange to pass -std=c++11 automatically
    when required (top level configure does that for gcc builds) but that
    seems overkill and since we're not up-to-date on the top level config
    files would mean someone would need to sync those over.

            PR gold/27815
            * gc.h (gc_process_relocs): Use cast in Section_id constructor.
----------------------------------------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]