[llvm-bugs] [Bug 46227] New: lld::wasm::LinkingSection::writeBody(): Assertion `isec->getComdatName() == comdat' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 6 11:21:29 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46227

            Bug ID: 46227
           Summary: lld::wasm::LinkingSection::writeBody(): Assertion
                    `isec->getComdatName() == comdat' failed
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: wasm
          Assignee: unassignedbugs at nondot.org
          Reporter: claude at mathr.co.uk
                CC: llvm-bugs at lists.llvm.org, sbc at chromium.org

Compiling Gem (a plugin for Pure-data) with Emscripten ("latest" as of today)
fails at the link stage with an assertion failure in wasm-ld:

```
(very long link command omitted)
em++: warning: Assuming object file output in the absence of `-c`, based on
output filename. Add with `-c` or `-r` to avoid this warning [-Wemcc]
em++: warning: ignoring unsupported linker flag: `-soname` [-Wlinkflags]
wasm-ld:
/b/s/w/ir/cache/builder/emscripten-releases/llvm-project/lld/wasm/SyntheticSections.cpp:468:
virtual void lld::wasm::LinkingSection::writeBody(): Assertion
`isec->getComdatName() == comdat' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: /home/empd/src/emsdk/upstream/bin/wasm-ld
@/tmp/emscripten_6AmlHz.rsp 
 #0 0x00007fa590cc08c4 PrintStackTraceSignalHandler(void*)
(/home/empd/src/emsdk/upstream/bin/../lib/libLLVM-11git.so+0x7df8c4)
 #1 0x00007fa590cbe50e llvm::sys::RunSignalHandlers()
(/home/empd/src/emsdk/upstream/bin/../lib/libLLVM-11git.so+0x7dd50e)
 #2 0x00007fa590cc0a85 SignalHandler(int)
(/home/empd/src/emsdk/upstream/bin/../lib/libLLVM-11git.so+0x7dfa85)
 #3 0x00007fa5940fb730 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12730)
 #4 0x00007fa5901ba7bb raise (/lib/x86_64-linux-gnu/libc.so.6+0x377bb)
 #5 0x00007fa5901a5535 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22535)
 #6 0x00007fa5901a540f (/lib/x86_64-linux-gnu/libc.so.6+0x2240f)
 #7 0x00007fa5901b3102 (/lib/x86_64-linux-gnu/libc.so.6+0x30102)
 #8 0x000000000078b4e2 lld::wasm::LinkingSection::writeBody()
(/home/empd/src/emsdk/upstream/bin/wasm-ld+0x78b4e2)
 #9 0x000000000077ccaa lld::wasm::SyntheticSection::finalizeContents()
(/home/empd/src/emsdk/upstream/bin/wasm-ld+0x77ccaa)
#10 0x0000000000776aa8 lld::wasm::(anonymous namespace)::Writer::run()
(/home/empd/src/emsdk/upstream/bin/wasm-ld+0x776aa8)
#11 0x000000000076fda1 lld::wasm::writeResult()
(/home/empd/src/emsdk/upstream/bin/wasm-ld+0x76fda1)
#12 0x0000000000754198 lld::wasm::(anonymous
namespace)::LinkerDriver::link(llvm::ArrayRef<char const*>)
(/home/empd/src/emsdk/upstream/bin/wasm-ld+0x754198)
#13 0x000000000074e6a7 lld::wasm::link(llvm::ArrayRef<char const*>, bool,
llvm::raw_ostream&, llvm::raw_ostream&)
(/home/empd/src/emsdk/upstream/bin/wasm-ld+0x74e6a7)
#14 0x0000000000487021 main
(/home/empd/src/emsdk/upstream/bin/wasm-ld+0x487021)
#15 0x00007fa5901a709b __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2409b)
#16 0x0000000000486aaa _start
(/home/empd/src/emsdk/upstream/bin/wasm-ld+0x486aaa)
em++: error: '/home/empd/src/emsdk/upstream/bin/wasm-ld
@/tmp/emscripten_6AmlHz.rsp' failed (-6)
make[3]: *** [Makefile:737: Gem.la] Error 1
```

To reproduce, on a system with `debootstrap`:

```
# on host system
sudo mkdir empd
sudo debootstrap --variant minbase buster empd/
sudo chroot empd/ /bin/bash
# inside chroot
mount -t proc proc /proc
mount -t tmpfs tmpfs /dev/shm/
apt install sudo git-core python2.7 nodejs build-essential cmake default-jre
llvm clang autoconf automake libtool pkg-config
adduser --add_extra_groups empd
adduser empd sudo
su - empd
# as empd user
mkdir tmp
cd tmp/
git clone https://github.com/juj/emsdk.git
cd emsdk/
./emsdk install latest
./emsdk activate latest
. ./emsdk_env.sh 
cd ..
git clone --recursive https://github.com/claudeha/libpd.git
cd libpd
git checkout emscripten
cd pure-data
git remote add claudeha https://github.com/claudeha/pure-data.git
git fetch claudeha
git checkout claudeha/emscripten
cd ..
mkdir build
cd build
emcmake cmake .. -DPD_UTILS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release
emmake make
cd ../../
git clone https://github.com/claudeha/Gem.git
cd Gem/
git checkout emscripten
./autogen.sh 
CXXFLAGS="-s USE_REGAL=1 -DREGAL_LOG=1 -DREGAL_LOG_ALL=1 -DREGAL_LOG_ONCE=1 -s
USE_SDL=2 -s LEGACY_GL_EMULATION=0 -s ERROR_ON_UNDEFINED_SYMBOLS=0" CFLAGS="-s
USE_REGAL=1 -DREGAL_LOG=1 -DREGAL_LOG_ALL=1 -DREGAL_LOG_ONCE=1 -s USE_SDL=2 -s
LEGACY_GL_EMULATION=0 -s ERROR_ON_UNDEFINED_SYMBOLS=0" EMMAKEN_CFLAGS="-s
USE_REGAL=1 -DREGAL_LOG=1 -DREGAL_LOG_ALL=1 -DREGAL_LOG_ONCE=1 -s USE_SDL=2 -s
LEGACY_GL_EMULATION=0 -s ERROR_ON_UNDEFINED_SYMBOLS=0" GL_CFLAGS="-s
USE_REGAL=1 -DREGAL_LOG=1 -DREGAL_LOG_ALL=1 -DREGAL_LOG_ONCE=1 -s USE_SDL=2 -s
LEGACY_GL_EMULATION=0 -s ERROR_ON_UNDEFINED_SYMBOLS=0" GL_LIBS="-s USE_REGAL=1
-s USE_SDL=2 -s LEGACY_GL_EMULATION=0 -s ERROR_ON_UNDEFINED_SYMBOLS=0"
GLU_CFLAGS="-s USE_REGAL=1 -DREGAL_LOG=1 -DREGAL_LOG_ALL=1 -DREGAL_LOG_ONCE=1
-s USE_SDL=2 -s LEGACY_GL_EMULATION=0 -s ERROR_ON_UNDEFINED_SYMBOLS=0"
GLU_LIBS="-s USE_REGAL=1 -s USE_SDL=2 -s LEGACY_GL_EMULATION=0 -s
ERROR_ON_UNDEFINED_SYMBOLS=0"  LIBS="-s USE_REGAL=1 -s USE_SDL=2 -s
LEGACY_GL_EMULATION=0 -s ERROR_ON_UNDEFINED_SYMBOLS=0" emconfigure ./configure
--prefix=${HOME}/opt --with-pd=${HOME}/src/libpd/pure-data/src --without-ALL
--disable-multicontext --without-glew --without-glewmx --without-glut
emmake make -j $(nproc) -k
emmake make
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200606/136882d8/attachment.html>


More information about the llvm-bugs mailing list