https://bugs.llvm.org/show_bug.cgi?id=49037
Bug ID: 49037
Summary: exception is not ABI-compatible with libstdc++
Product: libc++
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Created attachment 24482
--> https://bugs.llvm.org/attachment.cgi?id=24482&action=edit
make run
If I'm not mistaken,
> ABI compatibility with gcc's libstdc++ for some low-level features such as
> exception objects...
means that we can use libraries compiled with libstdc++ with libc++ and the
exception works well.
I found the case that try-catch statement is not working as expected, which
seems due to some ABI issue.
root@10155041665b:/test# make run
g++ -c lib.cc -fpic -o lib.o```
g++ -nostdinc++ -I/libcxx-install-11/include/c++/v1 -nodefaultlibs
-L/libcxx-install-11/lib -lc++ -lc++abi -lm -lc -lgcc_s -lgcc \
main.cc lib.o -o a.out
LD_LIBRARY_PATH=/libcxx-install-11/lib ./a.out
2
root@10155041665b:/test# cat main.cc
#include <iostream>
#include "lib.h"
int main() {
try {
throw gen();
} catch (const e& exp) {
std::cout << 1 << std::endl;
} catch (...) {
std::cout << 2 << std::endl;
}
}
root@10155041665b:/test# cat lib.cc
#include "lib.h"
std::runtime_error gen() {
return e("");
}
root@10155041665b:/test# cat lib.h
#include <stdexcept>
struct e : public std::runtime_error {
explicit e(const char* what) :
std::runtime_error(what) {
}
};
std::runtime_error gen();
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs