llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.01k stars 11.95k forks source link

arm-eabi (and arm-linux-gnueabi) use __cxa_atexit while the ABI specifies __aeabi_atexit #90988

Open pinskia opened 6 months ago

pinskia commented 6 months ago

I noticed this while adding DCEing support of atexit to GCC and the testcases were failing on arm-linux-gnueabi. Simple testcase:

struct A {
    A();
    ~A();
} a;

You will see at -O2:

b       __cxa_atexit

While GCC produces:

        b       __aeabi_atexit
pinskia commented 6 months ago

the latest (at this point) abi can be found at https://github.com/ARM-software/abi-aa/blob/2982a9f3b512a5bfdc9e3fea5d3b298f9165c36b/cppabi32/cppabi32.rst .

llvmbot commented 6 months ago

@llvm/issue-subscribers-clang-codegen

Author: Andrew Pinski (pinskia)

I noticed this while adding DCEing support of atexit to GCC and the testcases were failing on arm-linux-gnueabi. Simple testcase: ``` struct A { A(); ~A(); } a; ``` You will see at -O2: ``` b __cxa_atexit ``` While GCC produces: ``` b __aeabi_atexit ```