Open yoki0099 opened 4 months ago
是这个问题:https://github.com/ejoy/ant/pull/87
现在我手头没有环境做测试,所以没有支持好。关于检测 Mac 架构的部分,需要 @actboy168 在 luamake 上做一些工作。
另外,我觉得可以考虑退回去用 zlib 而不是 zlib-ng ,兼容性好一些,但会舍弃一些优化。
@cloudwu zlib-ng原来的构建脚本大量使用了类似automake的写法,这种写法实际上是把大量的代码挪到了构建脚本。现在luamake编译zlib-ng的脚本并没有1:1地还原它。不过我觉得应该可以加一些c代码来完成本来在automake里实现的脚本。
如果不需要特别为 mac 优化的话,我觉得可以关闭那些特有平台的 SIMD 分支。zlib-ng 应该也有保守的编译选项。或者退回 zlib 也不错。
zlib-ng无论是否使用simd都需要指定使用x86/x86_features.c或者arm/arm_features.c,所以不用simd确实可以把问题简化但是依然需要解决相同的问题。
我编译通过了,但是我的bin目录只有几个东西:
接下来怎么弄呢?
luamake
能补充一下MAC方面的文档吗? README 里面,后半截就只有WINDOWS了。
能补充一下MAC方面的文档吗? README 里面,后半截就只有WINDOWS了。
除了bin/msvc改为bin/macos之外,应该就没区别了
luamake [1/7] Compile C build/macos/debug/obj/zlib-ng-arm/adler32_neon.obj FAILED: build/macos/debug/obj/zlib-ng-arm/adler32_neon.obj clang -MMD -MT build/macos/debug/obj/zlib-ng-arm/adler32_neon.obj -MF build/macos/debug/obj/zlib-ng-arm/adler32_neon.obj.d -std=c17 -Wall -g -mmacosx-version-min=13.3 -I./3rd/zlib-ng -I./3rd/zlib-ng/arch/arm/ -Ibuild/macos/debug/gen-zlib -DDISABLE_RUNTIME_CPU_DETECTION -DHAVE_ARM_ACLE_H -DARM_FEATURES -DARM_NEON -DARM_NEON_HASLD4 -DHAVE_ATTRIBUTE_ALIGNED -DHAVE_BUILTIN_CTZLL -o build/macos/debug/obj/zlib-ng-arm/adler32_neon.obj -c 3rd/zlib-ng/arch/arm/adler32_neon.c In file included from 3rd/zlib-ng/arch/arm/adler32_neon.c:9: In file included from ./3rd/zlib-ng/arch/arm/neon_intrins.h:8: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:28:2: error: "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard"
error "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard"
^ 3rd/zlib-ng/arch/arm/adler32_neon.c:24:5: error: unknown type name 'uint32x4_t'; did you mean 'uint32_t'? uint32x4_t adacc = vdupq_n_u32(0); ^
~~~~~ uint32_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h:31:22: note: 'uint32_t' declared here typedef unsigned int uint32_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:24:24: error: call to undeclared function 'vdupq_n_u32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] uint32x4_t adacc = vdupq_n_u32(0); ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:25:5: error: unknown type name 'uint32x4_t'; did you mean 'uint32_t'? uint32x4_t s2acc = vdupq_n_u32(0); ^~~~~~ uint32_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h:31:22: note: 'uint32_t' declared here typedef unsigned int uint32_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:26:5: error: unknown type name 'uint32x4_t'; did you mean 'uint32_t'? uint32x4_t s2acc_0 = vdupq_n_u32(0); ^~~~~~ uint32_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h:31:22: note: 'uint32_t' declared here typedef unsigned int uint32_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:27:5: error: unknown type name 'uint32x4_t'; did you mean 'uint32_t'? uint32x4_t s2acc_1 = vdupq_n_u32(0); ^~~~~~ uint32_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h:31:22: note: 'uint32_t' declared here typedef unsigned int uint32_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:28:5: error: unknown type name 'uint32x4_t'; did you mean 'uint32_t'? uint32x4_t s2acc_2 = vdupq_n_u32(0); ^~~~~~ uint32_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h:31:22: note: 'uint32_t' declared here typedef unsigned int uint32_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:30:13: error: call to undeclared function 'vsetq_lane_u32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] adacc = vsetq_lane_u32(s[0], adacc, 0); ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:33:5: error: unknown type name 'uint32x4_t'; did you mean 'uint32_t'? uint32x4_t s3acc = vdupq_n_u32(0); ^~~~~~ uint32_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h:31:22: note: 'uint32_t' declared here typedef unsigned int uint32_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:34:5: error: unknown type name 'uint32x4_t'; did you mean 'uint32_t'? uint32x4_t adacc_prev = adacc; ^~~~~~ uint32_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h:31:22: note: 'uint32_t' declared here typedef unsigned int uint32_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:36:5: error: unknown type name 'uint16x8_t'; did you mean 'uint16_t'? uint16x8_t s2_0, s2_1, s2_2, s2_3; ^~~~~~ uint16_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h:31:24: note: 'uint16_t' declared here typedef unsigned short uint16_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:37:33: error: call to undeclared function 'vdupq_n_u16'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] s2_0 = s2_1 = s2_2 = s2_3 = vdupq_n_u16(0); ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:39:5: error: unknown type name 'uint16x8_t'; did you mean 'uint16_t'? uint16x8_t s2_4, s2_5, s2_6, s2_7; ^~~~~~ uint16_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h:31:24: note: 'uint16_t' declared here typedef unsigned short uint16_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:46:21: error: expected ';' after expression uint8x16x4_t d0_d3 = vld1q_u8_x4(buf); ^ ; 3rd/zlib-ng/arch/arm/adler32_neon.c:46:9: error: use of undeclared identifier 'uint8x16x4_t' uint8x16x4_t d0_d3 = vld1q_u8_x4(buf); ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:46:22: error: use of undeclared identifier 'd0_d3' uint8x16x4_t d0_d3 = vld1q_u8_x4(buf); ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:46:30: error: call to undeclared function 'vld1q_u8_x4'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] uint8x16x4_t d0_d3 = vld1q_u8_x4(buf); ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:50:9: error: unknown type name 'uint16x8x2_t'; did you mean 'uint16_t'? uint16x8x2_t hsum, hsum_fold; ^~~~ uint16_t /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h:31:24: note: 'uint16_t' declared here typedef unsigned short uint16_t; ^ 3rd/zlib-ng/arch/arm/adler32_neon.c:51:13: error: member reference base type 'uint16_t' (aka 'unsigned short') is not a structure or union hsum.val[0] = vpaddlq_u8(d0_d3.val[0]);