[llvm-bugs] [Bug 36377] New: clang++ -nostdlib++ -lstdc++ asserts

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 14 01:16:35 PST 2018


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

            Bug ID: 36377
           Summary: clang++ -nostdlib++ -lstdc++ asserts
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvm-bugs at lists.llvm.org, nicolasweber at gmx.de

It should probably be an error instead?

$ bin/clang++ -nostdlib++ -lstdc++ /tmp/a.cc
clang++: ../tools/clang/lib/Driver/ToolChain.cpp:735: virtual void
clang::driver::ToolChain::AddCXXStdlibLibArgs(const llvm::opt::ArgList&,
llvm::opt::ArgStringList&) const: Assertion
`!Args.hasArg(options::OPT_nostdlibxx) && "should not have called this"'
failed.
#0 0x0000560a661501ba llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(bin/clang+++0x24251ba)
#1 0x0000560a6614e03e llvm::sys::RunSignalHandlers() (bin/clang+++0x242303e)
#2 0x0000560a6614e18c SignalHandler(int) (bin/clang+++0x242318c)
#3 0x00007fb2da3d60c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#4 0x00007fb2d8f6bfcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
#5 0x00007fb2d8f6d3fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
#6 0x00007fb2d8f64e37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
#7 0x00007fb2d8f64ee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
#8 0x0000560a6660ec4d (bin/clang+++0x28e3c4d)
#9 0x0000560a6663d717
clang::driver::tools::AddLinkerInputs(clang::driver::ToolChain const&,
llvm::SmallVector<clang::driver::InputInfo, 4u> const&, llvm::opt::ArgList
const&, llvm::SmallVector<char const*, 16u>&, clang::driver::JobAction const&)
(bin/clang+++0x2912717)
#10 0x0000560a6666bac9
clang::driver::tools::gnutools::Linker::ConstructJob(clang::driver::Compilation&,
clang::driver::JobAction const&, clang::driver::InputInfo const&,
llvm::SmallVector<clang::driver::InputInfo, 4u> const&, llvm::opt::ArgList
const&, char const*) const (bin/clang+++0x2940ac9)
#11 0x0000560a665fac05
clang::driver::Driver::BuildJobsForActionNoCache(clang::driver::Compilation&,
clang::driver::Action const*, clang::driver::ToolChain const*, llvm::StringRef,
bool, bool, char const*, std::map<std::pair<clang::driver::Action const*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
>, clang::driver::InputInfo, std::less<std::pair<clang::driver::Action const*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
> >, std::allocator<std::pair<std::pair<clang::driver::Action const*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
> const, clang::driver::InputInfo> > >&, clang::driver::Action::OffloadKind)
const (bin/clang+++0x28cfc05)
#12 0x0000560a665fbca8
clang::driver::Driver::BuildJobsForAction(clang::driver::Compilation&,
clang::driver::Action const*, clang::driver::ToolChain const*, llvm::StringRef,
bool, bool, char const*, std::map<std::pair<clang::driver::Action const*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
>, clang::driver::InputInfo, std::less<std::pair<clang::driver::Action const*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
> >, std::allocator<std::pair<std::pair<clang::driver::Action const*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
> const, clang::driver::InputInfo> > >&, clang::driver::Action::OffloadKind)
const (bin/clang+++0x28d0ca8)
#13 0x0000560a665fc4ab
clang::driver::Driver::BuildJobs(clang::driver::Compilation&) const
(bin/clang+++0x28d14ab)
#14 0x0000560a665fd38e
clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char const*>)
(bin/clang+++0x28d238e)
#15 0x0000560a64975cf0 main (bin/clang+++0xc4acf0)
#16 0x00007fb2d8f592b1 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
#17 0x0000560a649f104a _start (bin/clang+++0xcc604a)
Stack dump:
0.      Program arguments: bin/clang++ -nostdlib++ -lstdc++ /tmp/a.cc 
1.      Compilation construction
2.      Building compilation jobs
3.      Building compilation jobs
Aborted

-- 
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/20180214/7df0f7c4/attachment.html>


More information about the llvm-bugs mailing list