Skip to content
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

error "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard" #375

Open
loseboy001 opened this issue Apr 27, 2024 · 2 comments
Assignees

Comments

@loseboy001
Copy link

你好,我是用mac m1版本编译ios 仿真,为什么一直报错

@shentanyue
Copy link

这个错误信息表明你正在尝试使用ARM NEON指令集,但是编译器配置为使用软浮点ABI(soft-float ABI)。NEON指令集只能在硬浮点ABI(hard-float ABI)下使用。

解决方法:

在编译时,确保启用硬浮点ABI。这通常通过添加 -mfloat-abi=hard 和 -mfpu=neon 标志到你的编译器命令行参数中来实现。例如,如果你使用的是 gcc 或 g++ 编译器,你可以这样做:
bash
gcc -mfloat-abi=hard -mfpu=neon your_source_files.c -o your_program
如果你在使用CMake,可以通过设置CMake变量来启用这些标志:
cmake
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=hard -mfpu=neon")
如果你在使用交叉编译器为特定的ARM架构编译,确保你的交叉编译器工具链支持NEON,并且你的编译配置文件(如cmake工程中的CMakeLists.txt或Makefile)已经正确设置了这些选项。
确保在修改编译器设置后重新编译你的程序,以便更改生效。

@loseboy001
Copy link
Author

loseboy001 commented May 7, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants