-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
argument not found on ARM linux only #1919
Comments
I don't have an ARM box to repro so you'll need to provide more details, e.g. the exception stack trace and exact version (or commit hash). Also I recommend a clean rebuild from source to make sure you don't have an incompatible version of the library (which is the most likely cause). |
|
I can confirm it is a clean rebuild as there are no fmt files anywhere on the system
|
Could you build |
|
The stack trace shows that Line 2431 in 7277035
although it's unclear why this happens since the |
lldb confirms this:
|
This question is probably just noise, but does this happen with ints, too? Or just chars? |
With numbers the result is the same and stack trace shows the same path.
|
This seems to be LLVM specific. The library has been compiled with GCC
|
compiling fmt with clang
gives
|
The value of
It should be 2184 (0x888) and the current value resembles a pointer (0x7efffae800000000). It looks like there is some incompatibility between clang and gcc. |
on LLVM discord they said it is similar to itanium-cxx-abi/cxx-abi#66 I just confirmed that also on other ARM build this problem occurs. With Fedora it is possible to run arm relatively easy: https://fedoraproject.org/wiki/QA:Testcase_Virt_ARM_on_x86 resizing that image to create some space, install llvm, clang git and cmake on it and run it.
It's strange this problem does not occur on x86 Linux |
Interestingly, it doesn't happen on all ARM systems (or could depend on compiler version). For example, on my Raspberry PI gcc and clang generate compatible code:
|
These are prehistorical versions of llvm and gcc, I used gcc 10 and llvm 11. I ran archlinux on rpi4 to have latest versions of these compilers |
Managed to repro the issue on Raspberry Pi 4 with clang version 7.0.1-8+rpi3+deb10u2 (tags/RELEASE_701/final) and gcc (Raspbian 8.3.0-6+rpi1) 8.3.0 and implemented a workaround in e50ced8. The workaround is enabled by defining the git clone https://github.com/fmtlib/fmt.git
cd fmt
cmake -DCMAKE_CXX_FLAGS=-DFMT_ARM_ABI_COMPATIBILITY .
make fmt
cat >> test.cc << EOF
#include <fmt/core.h>
#include <iostream>
int main() {
std::cout << fmt::format("{0}, {1}, {2}", 'a', 'b', 'c');
return 0;
}
EOF
clang++ -DFMT_ARM_ABI_COMPATIBILITY test.cc -Iinclude -lfmt -L.
./a.out Output:
The workaround will become the default in the next major release since it is ABI breaking. Thanks for reporting. |
Hi vitaut, thanks for the work done. I'm on e50ced8, which is
and I compiled by using cmake .. with gcc 10.2.0, installed it and verified it overwrote /usr/local/lib/ilbfmt.a to the newest version.
I think the LLVM and GCC versions are too old, they are from 2018 and beginning of 2019 respectively. Newer versions still fail. The raspberry pi 4 is powerful enough to compile llvm from source to checkout head, but other than that with Debian I have no idea how to get newer versions on your system. Problems with old versions of software were my main reason never to use Debian again. |
Ah, sorry I missed the CMake flag, will recompile it now again. |
Not just CMake but compiler too. You are missing the flag in both places. |
Yes, now it works, thanks for the fix! Next major release will be fmt 8, that will be next year right? I see a lot of activity, do you work on this project fulltime? Great work btw. |
Thanks for verifying the fix.
Yes.
No, only part time. |
The following code
compiled with
on archlinuxarm gives
while on MacOS it gives
Both versions are compiled from source from the latest source version.
However, compiling with format.cc seems to solve the issue:
The text was updated successfully, but these errors were encountered: