abi

Return type in demangled member function name

耗尽温柔 提交于 2019-12-10 21:11:42
问题 What is the reason for the g++ abi::__cxa_demangle function to not return the return value for member functions? Here's a working example of this behavior #include <execinfo.h> #include <cxxabi.h> #include <iostream> struct Foo { void operator()() const { constexpr int buf_size = 100; static void *buffer[buf_size]; int nptrs = backtrace(buffer, buf_size); char **strings = backtrace_symbols(buffer, nptrs); for(int i = 0; i < nptrs; ++i) { auto str = std::string(strings[i]); auto first = str

Is it valid to use ptr::NonNull in FFI?

半城伤御伤魂 提交于 2019-12-10 18:40:11
问题 Rust has the ptr::NonNull type that represents a non- NULL pointer. Is it safe to use this type in FFI? Is it guaranteed to have same binary representation (ignoring non-FFI context such as Option optimizations), alignment, register usage as *mut T ? For example, could I implement this interface: void call_me_from_c(char *without_nulls) __attribute__((nonnull)); with extern "C" fn call_me_from_c(without_nulls: ptr::NonNull<c_char>) I don't expect this to do anything (apart from causing UB

Is function parameter constness mismatch allowed?

余生颓废 提交于 2019-12-10 18:37:28
问题 Regarding using const function parameters I've heard that on some OS X systems the constness of a parameter is mangled into the function signature. For example, if one would have the following declaration in an interface header file: int f(int argument); but if one would only implement this function: int f(int const argument); then this might lead to a linking failures on OS X (but not on Linux) because the OS X way to mangle C++ function signatures includes the constness of the parameters.

What does “a GP/function address pair” mean in IA-64?

空扰寡人 提交于 2019-12-10 15:55:47
问题 What does "a GP/function address pair" mean in Itanium C++ ABI? What does GP stand for? 回答1: Short explanation: gp is, for all practical means, a hidden parameter to all functions that comply with the Itanium ABI. It's a kind of this pointer to the global variables the function uses. As far as I know, no mainstream OS does it anymore. GP stands for "globals pointer". It's a base address for data statically allocated by executables, and the Itanium architecture has a register just for it. For

C++ library across different compilers

巧了我就是萌 提交于 2019-12-10 10:50:53
问题 I'm writing a C++ library using MinGW (4.8.0 dw2 posix). This library is used in another C++ project that use another compiler( in this case msvc ). Refering to this I was redesign my C++ library. There are two things that I don't know how can I do: Can I use namespaces? I noticed that time_t on MinGW is 32 bit and in msvc is 64 bit. What Can I do? 1) Does this broke the ABI: // Window.h // MYLIB_API defined as __declspec( dllexports ) // MYLIB_CALL defined as __stdcall namespace mylib {

Avoiding standard library conflicts in unix

我的未来我决定 提交于 2019-12-10 10:47:53
问题 I have a shared library (so) object which exposes a C API ( extern "C" ). It doesn't use C++ in the API nor throws exceptions. Internally it does use C++, especially std::map and other containers, plus some trivial templates. My goal is to be able to provide this library to any program in unix (I compile multiple versions for each target linux distro) without having standard library symbol issues with the loader program (i.e. a program which loads my library with dlopen should function

Why are the temporary registers split in the MIPS ISA? [closed]

时间秒杀一切 提交于 2019-12-10 10:23:17
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last month . I'm currently taking a class that covers the MIPS ISA and one thing that I noticed is the split in temporary registers: Temporary registers $t0 to $t7 are stored in $8 to $15 , but $t8 and $t9 are stored in $24 and $25 . Why is this? Why not make the temporary registers

Boost unit test link error — abi mismatch?

为君一笑 提交于 2019-12-10 07:07:09
问题 I'm trying to build a unit test with boost, but the linker complains about a missing function. Take this skeleton code #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_SUITE(TestFuncOps); BOOST_AUTO_TEST_CASE(CopyConstructor) { } BOOST_AUTO_TEST_SUITE_END(); But it fails with Undefined symbols for architecture x86_64: "boost::unit_test::ut_detail::normalize_test_case_name[abi:cxx11](boost::unit_test::basic_cstring<char const>)",

C Runtime objects, dll boundaries

纵饮孤独 提交于 2019-12-09 12:24:42
问题 What is the best way to design a C API for dlls which deals with the problem of passing "objects" which are C runtime dependent (FILE*, pointer returned by malloc, etc...). For example, if two dlls are linked with a different version of the runtime, my understanding is that you cannot pass a FILE* from one dll to the other safely. Is the only solution to use windows-dependent API (which are guaranteed to work across dlls) ? The C API already exists and is mature, but was designed from a unix

Error INSTALL_FAILED_NO_MATCHING_ABIS after updating Nexus 5x to Oreo

百般思念 提交于 2019-12-09 03:42:25
I was working on an old app I have (I started it on 4.0), and I am facing some issues after upgrading my nexus 5x to Oreo (8.0). My Nexus 5x is a x86 device, and everytime I try to install this apk for debug porpuses I get the so called error "INSTALL_FAILED_NO_MATCHING_ABIS". I had never faced this problem before so I started to look for information and the only thing I found that could be useful was: splits { abi { enable true reset() include 'x86', 'armeabi-v7a' universalApk true } } In my build.gradle file. However this did not work, in order to make sure that the problem was the 8.0 and