Questions tagged [abi]

The (Application Binary Interface) specifies the low level interface between the programs, libraries and the operating system. E.g. which registers are used to pass function parameters.

abi
Filter by
Sorted by
Tagged with
0 votes
1 answer
319 views

Segfault when calling, but not jumping to, address in rax

I'm working with an assembler-like API (it's not really an assembler, but it can emit machine code) that I am debugging and toying with. It's specifically for System V x86_64 ABI, so I'm only going to ...
Mona the Monad's user avatar
1 vote
1 answer
5k views

Android ndkBuild android_gradle_build missing for ABI

I have an Ionic android project and I'm receiving platforms/android/.externalNativeBuild/ndkBuild/debug/armeabi-v7a/android_gradle_build.json (No such file or directory) When I run: ionic cordova ...
FabioCosta's user avatar
  • 2,711
4 votes
1 answer
636 views

Creating a static C library for Linux that is portable across different GCC version

I'd like to distribute a static C library (.a) as a binary. Given a certain CPU architecture and platform (e.g. armv6 / Raspi): Is it possible to create a single binary that works across all ...
Etan's user avatar
  • 17.3k
7 votes
2 answers
2k views

Understanding stack alignment enforcement

Consider the following C code: #include <stdint.h> void func(void) { uint32_t var = 0; return; } The unoptimized (i.e.: -O0 option) assembly code generated by GCC 4.7.2 for the code ...
ロウリン's user avatar
5 votes
1 answer
4k views

Web3 JS Library (& Metamask), Get Token Balance

I want to query the eth balance and all token balances of a public key. So far I managed to load web3 and call the getBalance method. Now, I want to see the balance for ERC20 tokens which are stored ...
Andi Giga's user avatar
  • 4,002
0 votes
0 answers
1k views

Cannot link SYSV static lib with GNU/Linux

I want to link to some external static lib, let's say somelib. I'm trying to do this by FIND_LIBRARY in cmake and it seems to work ok - cmake finds libsomelib.a but there is a problem with linking: (...
pingwindyktator's user avatar
1 vote
2 answers
2k views

Generating Multiple Apk according to the Native ABI

I am building release apk based on the ABI because of apk size to publish on Play store. So I started apk building for ABI = armeabi-v7a then building ABI = x86 and ABI = areambi so my gradle ...
Amjad Khan's user avatar
  • 1,309
0 votes
1 answer
580 views

Different GNU ABI Tag for same C library version?

I have two ELF binaries on my Linux machine. When I run file on them I receive the following: File#1: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.2.0, ...
m-strasser's user avatar
-2 votes
1 answer
2k views

How to detect ABI at compile time? [closed]

Is there a way to detect ABI in C/C++ at compile time? I know there are macros for OS and CPU architecture. Are there similar macros (or some other way) for ABI?
freakish's user avatar
  • 55.3k
1 vote
0 answers
684 views

How to specify target ABI in cmake?

I'm not sure if my question is correct. But I've got an legacy project which is compiled by cmake into shared library with System V ABI: $ readelf -a -W /path/to/my/lib/libname.so | grep 'OS/ABI:' ...
Nelson Tatius's user avatar
159 votes
3 answers
34k views

Is it safe to link C++17, C++14, and C++11 objects

Suppose I have three compiled objects, all produced by the same compiler/version: A was compiled with the C++11 standard B was compiled with the C++14 standard C was compiled with the C++17 standard ...
ricab's user avatar
  • 2,732
13 votes
1 answer
3k views

Fully shadowed APK on Play developer console because of overlapping abis

I am trying to do an abi split in my gradle with the following code splits { abi { enable true reset() include 'x86', 'armeabi-v7a'/*, 'arm64-v8a', 'x86_64'*/ ...
sbaar's user avatar
  • 1,429
2 votes
1 answer
178 views

Does adding enumerators into Java enum break ABI?

For example, in my code there is public enum Color { RED, BLACK } and I add a color later, that is public enum Color { RED, BLACK, BLUE } will this break ABI? That is, does my user need to ...
Franklin Yu's user avatar
  • 9,512
0 votes
1 answer
610 views

QT installed with wrong ABI for Android smartphone, how to get the right one

I installed Qt 5.9.1, with Android x86 selected during the installation. The Qt Creator IDE automatically detects the "Android for x86"-Kit, but when I try to deploy my programme to the smartphone, Qt ...
d0d0's user avatar
  • 160
-1 votes
1 answer
975 views

Access external native functions using JNI

I have a small doubt regarding native library access using NDK. Is it possible to access native functions in the library using JNI? I have a library built completely on C++, is it possible to load ...
0x52616A657368's user avatar
1 vote
0 answers
87 views

Android 32-bit service on aarch64

I'm trying to deploy a system service on Android running on 64-bit ARM (aarch64). The service cannot be built for aarch64 (due to portability issues), and only runs when build for 32-bit ARM. I am ...
Erez St.'s user avatar
1 vote
1 answer
808 views

Error INSTALL_FAILED_NO_MATCHING_ABIS after updating Nexus 5x to Oreo

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 ...
zozelfelfo's user avatar
  • 3,776
2 votes
0 answers
397 views

g++ generating the "complete object allocating constructor"

Is there a way(an argument) to make the g++ compiler to generate the "complete object allocating constructor"(C3) and the "deleting destructor"(D0)? I loooked into this Why are C3 allocating ...
yonutix's user avatar
  • 2,154
1 vote
0 answers
1k views

env->NewStringUTF(s) get crash and different ABI version returning different string value

Want to generate random string of fix length from JNI function for that i have used below function static const char alphanum[] = "abcdefghijklmnopqrstuvwxyz"; jstring Utils::...
Om Infowave Developers's user avatar
75 votes
1 answer
17k views

What happens if you use the 32-bit int 0x80 Linux ABI in 64-bit code?

int 0x80 on Linux always invokes the 32-bit ABI, regardless of what mode it's called from: args in ebx, ecx, ... and syscall numbers from /usr/include/asm/unistd_32.h. (Or crashes on 64-bit kernels ...
Peter Cordes's user avatar
2 votes
0 answers
243 views

clang - useless push rax and pop rcx? [duplicate]

Today, whilst disassembling some binaries I built earlier (clang x86_64), I came across something [seemingly] useless. _baz: ## @baz .cfi_startproc ## BB#0: ...
Mona the Monad's user avatar
3 votes
2 answers
1k views

Our Android static library is in wrong format

we created static library with hugin application on armeabi-v7a and we tried to connect it with our shared library in Android using Cmakelist. We can see the library and his header without any problem,...
smeidak's user avatar
  • 285
3 votes
1 answer
880 views

Win64 vs System V ABI (x86_64): Win64 Skipping registers?

Suppose we have a C (or C++) function with the following signature: void foo(int64_t a, double b, int64_t c, double d); When compiled on Linux, Mac, or any OS that uses the System V ABI (x86_64), a ...
Mona the Monad's user avatar
12 votes
1 answer
3k views

Why do x86-64 Linux system calls work with 6 registers set?

I'm writing a freestanding program in C that depends only on the Linux kernel. I studied the relevant manual pages and learned that on x86-64 the Linux system call entry point receives the system ...
Matheus Moreira's user avatar
1 vote
1 answer
238 views

What is the extended option in abi-compliance-checker used for?

abi-compliance-checker is a perl program that can check ABI of libraries on linux (https://lvc.github.io/abi-compliance-checker/) The tool has a -extended option, and here is what the manual says ...
Gunee's user avatar
  • 451
1 vote
1 answer
2k views

Max string size of Ethereum Contract ABI

I am writing code to communicate deployed ethereum contract through JSON-RPC. When I call eth_call, I need to prepare data set for it. Although this link has details but I got a question when I read ...
chabashilah's user avatar
5 votes
1 answer
421 views

Using C++11 versus GCC 4.8 default causes link error with private inheritance and boost

Preamble Working with a large piece of code that I can't currently break down into an MCVE, so I'll do my best. Problem I'm working with a large project that is compiled as a static library, libfoo.a....
Cloud's user avatar
  • 19.1k
6 votes
0 answers
124 views

Does a legitmate epilog need to include a dummy rsp adjustment even if not otherwise necessary?

The x86-64 Windows ABI has the concept of a legitimate epilog, which is a special type of function epilog that can be simulated during exception handling in order to restore the callers context1 as ...
BeeOnRope's user avatar
  • 62.5k
3 votes
1 answer
343 views

Centos6 gcc6: default ABI not picked up when compiling simple c++11 test file

I have a docker image for centos 6 with devtoolset-6 installed and I want to build my code with the new ABI available in gcc>=5, in this case gcc6. Somehow I do not get what I expect to work by ...
user1357687's user avatar
2 votes
1 answer
581 views

libstdc++ static linking & System V ABI

When I compile with -static-libstdc++, compiled binary uses UNIX - GNU ABI, but I need to get a binary with UNIX - System V ABI. (I need a compatibility with FreeBSD) I also tried Compile libstdc++ ...
Artem's user avatar
  • 91
0 votes
2 answers
1k views

How to pass a variable list of parameters to vprintf in a portable way?

I have a code that receives binary array of 32-bit values from a device and prints them with vsprintf, like this: void print_stuff(int32_t *p, const char *format) { vprintf( format, (va_list)p); }...
ddbug's user avatar
  • 1,461
5 votes
2 answers
4k views

abi::__cxa_demangle -- why buffer needs to be `malloc`-ed?

The documentation of abi::__cxa_demangle (such as https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01696.html) specifies that the second argument, char * output_buffer, need to be ...
Arun's user avatar
  • 20.1k
1 vote
0 answers
686 views

android emulator refuse to run armeabi native program, why?

I use bluestacks & MEmu to test my native programs built from NDK, x86 programs are well supported, but both refuse to run even a simple HelloWorld which is armeabi or armeabi-v7a. Bluestacks ...
Cosmore's user avatar
  • 3,213
0 votes
0 answers
490 views

Is it possible to get the function name from the mangled string

This question is a continuation of the following question, where a code to demangle a function-name given by the backtrace function is presented. I wonder whether there is a way to get the name and ...
Lezkus's user avatar
  • 160
3 votes
1 answer
824 views

Return type in demangled member function name

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 <...
Lezkus's user avatar
  • 160
0 votes
0 answers
432 views

How to find binary compatibility for libraries built with gcc-4.9 vs gcc-6.2?

I have a vendor who supplies the SoC, associated BSP and some key middle-ware to us. Vendor uses gcc-4.9 to build all the delivered software. The software delivered has two categories Source ...
sob's user avatar
  • 1,012
2 votes
0 answers
328 views

C++ calling conventions -- converting between win32 and Linux/GCC?

I'm knee deep in a project to connect Windows OpenVR applications running in Wine directly to Linux native SteamVR via a Winelib wrapper, the idea being to sidestep all the problems with trying to ...
roothorick's user avatar
1 vote
1 answer
444 views

Itanium C++ ABI primary virtual bases

I was reading here about how primary bases are chosen: "...2. If C is a dynamic class type: a. Identify all virtual base classes, direct or indirect, that are primary base classes for some other ...
user42768's user avatar
  • 1,961
0 votes
3 answers
2k views

Validate ABI JSon (Ethereum)

i've a problem with the following Json : [ { constant: false, inputs: [Object], name: 'set', outputs: [], type: 'function' }, { constant: true, inputs: [], name: 'get', ...
Darkikari's user avatar
2 votes
2 answers
2k views

Binary compatibility between VS2017 and VS2015

This SO post: Is Visual-C++-2017 binary compatible with VC++-2015? clearly says that VS 2017 is binary compatible with VS 2015. It even looks like the official position. My question is, in the past, ...
ForeverLearning's user avatar
0 votes
1 answer
296 views

How to correctly pass float arguments on the stack using ABI calling procedure

I’m not proficient in assembly language. I am trying to make a call to a function, foo, which takes ten floating point arguments. After the first eight, using the xmm0-xmm7 registers, I push the ...
user avatar
5 votes
1 answer
1k views

What alignment is needed on 8-bit AVR?

I would have expected the 8-bit AVR platform to not require any alignment. However, I've found the following comment in an LLVM commit: The previous data layout caused issues when dealing with ...
Cactus's user avatar
  • 27.3k
1 vote
1 answer
320 views

AMD64 ABI Function Calling Sequence for arguments of type __m256

I've been reading through this section for a while, but I can't seem to figure it out. I'm on AMD64 ABI Draft 0.99.6, page 18, section 3.32 Parameter Passing and theres the following text: Arguments ...
user avatar
0 votes
2 answers
94 views

ABI stability on pointers to symbols vs regular symbol lookup

General Scenario Using dlsym(), I dynamically load a shared object addon from my main thread. I follow either of these two ways. Way A Pass a struct of pointers to symbols to the addon so it can ...
user avatar
0 votes
3 answers
119 views

Do C interfaces care about the pointed-to type?

I have two pieces of code: The first, inside a C++ program, is where I load and call a function from an external test_lib.so: typedef void *(*init_t)(); // init_t is ptr to fcn returning a void* ...
fonini's user avatar
  • 3,214
3 votes
2 answers
4k views

Undefined symbol when loading LLVM plugin

I am developing an LLVM pass and want to run it as a plugin via the Clang LLVM driver: clang -Xclang -load -Xclang myPlugin.so ... At first I got an error similar to that described here undefined ...
Nik391's user avatar
  • 527
1 vote
0 answers
446 views

Does a DLL import library represent the DLL ABI?

If I build a DLL from a set of C++ headers and sources using MSVC, and generate an import library for the DLL, does that import library represent the ABI for the DLL? More specifically: If I make a ...
acm's user avatar
  • 12.4k
0 votes
0 answers
424 views

new glibc is causing error while using new gcc on a older SUSE [duplicate]

I have been using old version of gcc and libc for my SLES 10 machine to build my code. Recently in order to add support for new libraries, I added GCC 6.3 build version. But when I refer this ./gcc ...
DTdev's user avatar
  • 548
1 vote
1 answer
106 views

errors linking clang-built executable with g++-v6-built boost library

I have a boost regex library built myself with g++ version 6.3.1 on Fedora Linux. Then I have my own library using the boost regex, built with clang++ 4.0 as shared object. Building this works fine. ...
mgr's user avatar
  • 344
1 vote
1 answer
727 views

Two native libraries has different cpu architecture set

In my project I had one native shared library for armeabi, mips, x86 and it worked fine on all devices (e.g. lib1.so). Now I added different native library and it has set of libraries for all of the ...
Андрій Бейлик's user avatar

1
9 10
11
12 13
19