https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82092

            Bug ID: 82092
           Summary: gcc fails to link genmodes on darwin
                    (cfiStartsArray[i] != cfiStartsArray[i-1])
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jeremyhu at macports dot org
  Target Milestone: ---

Snapshot 8-20170604 (trunk r248863) builds fine on darwin.
Snapshot 8-20170611 (trunk r249106) and later (through at least 8-20170827,
r251369) fail to build on darwin.

The build fails with the linker failing an assert due to invalid output
produced by the compiler when building genmodes:

make[3]: Entering directory
`/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/build/gcc'
/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/build/./prev-gcc/xg++
-B/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/build/./prev-gcc/
-B/opt/local/x86_64-apple-darwin17/bin/ -nostdinc++
-B/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/build/prev-x86_64-apple-darwin17/libstdc++-v3/src/.libs
-B/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/build/prev-x86_64-apple-darwin17/libstdc++-v3/libsupc++/.libs
 -isystem
/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/build/prev-x86_64-apple-darwin17/libstdc++-v3/include/x86_64-apple-darwin17
 -isystem
/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/build/prev-x86_64-apple-darwin17/libstdc++-v3/include
 -isystem
/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/gcc-8-20170827/libstdc++-v3/libsupc++
-L/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/build/prev-x86_64-apple-darwin17/libstdc++-v3/src/.libs
-L/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_lang_gcc8/libgcc-devel/work/build/prev-x86_64-apple-darwin17/libstdc++-v3/libsupc++/.libs
  -g -O2   -gtoggle -DIN_GCC     -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common
 -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -static-libstdc++ -static-libgcc
-Wl,-no_pie  -o build/genmodes \
            build/genmodes.o build/errors.o .././libiberty/libiberty.a
0  0x101edfb1b  __assert_rtn + 129
1  0x101ef323a 
mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions
const&) + 3030
2  0x101eeabcc  mach_o::relocatable::Parser<x86_64>::parse(unsigned char
const*, unsigned long long, char const*, long, ld::File::Ordinal,
mach_o::relocatable::ParserOptions const&) + 282
3  0x101f2fae4  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool)
+ 830
4  0x101f3246d  ld::tool::InputFiles::parseWorkerThread() + 497
5  0x7fff7ec806c1  _pthread_body + 340
6  0x7fff7ec8056d  _pthread_body + 0
A linker snapshot was created at:
        /tmp/genmodes-2017-08-03-125525.ld-snapshot
ld: Assertion failed: (cfiStartsArray[i] != cfiStartsArray[i-1]), function
parse, file
/Library/Caches/com.apple.xbs/Sources/ld64/ld64-302.4/src/ld/parsers/macho_relocatable_file.cpp,
line 1898.
collect2: error: ld returned 1 exit status

This happens with all versions of macOS that I’ve tried (El Capitan through
High Sierra).

See also bug #57438

Reply via email to