You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug occurs only when compiling to bytecode and then linking the bytecode
into a single executable. When I use llvm-g++ to compile each C++ source to
native object files and link those, the executable runs fine.
Running the bytecode of the executable in lli also produces a segfault.
The std::map, although unused in the code, is essential for the segfault to
occur. Also, the segfault only occurs when I use two source files: when I put
this same code in a single C++ source file, it runs fine.
The std::map being part of the problem looks similar to bug 1491, but not
exactly the same:
this bug occurs when running the native executable, no errors while linking
this bug also occurs without -O2
I'm using LLVM 2.0 and its g++ front-end, compiled from source with GCC 4.1.3.
The text was updated successfully, but these errors were encountered:
Maarten, llvm-ld also runs optimizations. It seems, that static ctors/dtors were
deleted by llvm-ld (this can be due to #1863 ). Please use llvm-link as a
temporary workaround.
This was due to some legacy code that was used to support llvm-gcc3. The easiest thing to do is to zap it
entirely. Thanks for the report and the nice reduced testcase!
-Chris
llvmbot
transferred this issue from llvm/llvm-bugzilla-archive
Dec 3, 2021
Extended Description
See attached sources and build+test script.
The bug occurs only when compiling to bytecode and then linking the bytecode
into a single executable. When I use llvm-g++ to compile each C++ source to
native object files and link those, the executable runs fine.
Running the bytecode of the executable in lli also produces a segfault.
The std::map, although unused in the code, is essential for the segfault to
occur. Also, the segfault only occurs when I use two source files: when I put
this same code in a single C++ source file, it runs fine.
The std::map being part of the problem looks similar to bug 1491, but not
exactly the same:
I'm using LLVM 2.0 and its g++ front-end, compiled from source with GCC 4.1.3.
The text was updated successfully, but these errors were encountered: