已开启
开启NEON优化时构建失败 #3
panzhe0328创建于 2025年11月25日
2025年11月25日 创建了任务
openeuler-ci-bot
2025年11月25日 评论:
2025年11月25日 评论:
Hi panzhe0328, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Base-service, and any of the maintainers: @licihua , @zhujianwei001 , @xiezhipeng1 , @dillon_chen , @shenyangyang01 , @overweight , any of the committers: @yanan-rock


2025年11月25日 添加了
sig/Base-service
标签
2025年11月25日 关联了src-openEuler/libpng Pull Request !44
2025年11月25日 修改了描述
xh
4月27日 评论:
4月27日 评论:
当前在升级到1.6.55版本时,构建方式已经从make切换到cmake,不再使用configure,故不涉及该问题。
https://gitcode.com/src-openeuler/libpng/pull/90


开启NEON优化时构建失败:
(1)问题现象:
在spec文件中对aarch64架构开启NEON优化时:%configure --enable-arm-neon=yes/check ,编译报错如下:
contrib/libtests/pngvalid.c:11941:34: error: expected expression before ',' token
11941 | option = PNG_ARM_NEON, arg += 9;
| ^
contrib/libtests/pngvalid.c:11941:34: warning: left-hand operand of comma expression has no effect [-Wunused-value]
(2)问题分析:
设置--enable-arm-neon=yes/check时,PNG_ARM_NEON宏是一个空值,在pngvalid.c中出现空宏展开导致语法错误。根据png.h文件,只有定义PNG_ARM_NEON_API_SUPPORTED宏时,宏PNG_ARM_NEON才有值0
/* HARDWARE: ARM Neon SIMD instructions supported */
#ifdef PNG_ARM_NEON_API_SUPPORTED
define PNG_ARM_NEON 0
#endif
(3)解决方案:
修改pngvalid.c中的判断逻辑,必须同时定义PNG_ARM_NEON和PNG_ARM_NEON_API_SUPPORTED宏