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

Build fails on powerpc64 and powerpc64le: error: use of undeclared identifier 'power_cpu_has_arch_3_00' #183

Open
yurivict opened this issue Feb 2, 2024 · 7 comments

Comments

@yurivict
Copy link

yurivict commented Feb 2, 2024

  /wrkdirs/usr/ports/devel/gitoxide/work/gitoxide-git-repository-v0.32.0/cargo-crates/libz-sys-1.1.8/src/zlib-ng/functable.c:125:9: error: use of undeclared identifier 'power_cpu_has_arch_3_00'
      if (power_cpu_has_arch_3_00)
          ^
  /wrkdirs/usr/ports/devel/gitoxide/work/gitoxide-git-repository-v0.32.0/cargo-crates/libz-sys-1.1.8/src/zlib-ng/functable.c:158:9: error: use of undeclared identifier 'power_cpu_has_arch_3_00'
      if (power_cpu_has_arch_3_00)
          ^

See the log.

Version: 1.1.8
rust-1.75.0
FreeBSD 14.0

@ofek
Copy link

ofek commented May 12, 2024

I also cannot build on PowerPC but am getting different errors:

error: failed to run custom build command for `libz-ng-sys v1.1.15`

Caused by:
  process didn't exit successfully: `/target/debug/build/libz-ng-sys-c4f0ab3fecb10f49/build-script-build_zng` (exit status: 101)

...

  /cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-ng-sys-1.1.15/src/zlib-ng/arch/power/compare256_power9.c: In function 'compare256_power9_static':
  /cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-ng-sys-1.1.15/src/zlib-ng/arch/power/compare256_power9.c:34:36: warning: implicit declaration of function 'vec_cmpne' [-Wimplicit-function-declaration]
           vc = (vector unsigned char)vec_cmpne(vsrc0, vsrc1);
                                      ^
  /cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-ng-sys-1.1.15/src/zlib-ng/arch/power/compare256_power9.c:34:9: error: AltiVec argument passed to unprototyped function
           vc = (vector unsigned char)vec_cmpne(vsrc0, vsrc1);
           ^
  /cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-ng-sys-1.1.15/src/zlib-ng/arch/power/compare256_power9.c:15:43: warning: implicit declaration of function '__builtin_vec_vctzlsbb' [-Wimplicit-function-declaration]
   #  define zng_vec_vctzlsbb(vc, len) len = __builtin_vec_vctzlsbb(vc)
                                             ^
  /cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-ng-sys-1.1.15/src/zlib-ng/arch/power/compare256_power9.c:39:9: note: in expansion of macro 'zng_vec_vctzlsbb'
           zng_vec_vctzlsbb(vc, cmplen);
           ^
  /cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-ng-sys-1.1.15/src/zlib-ng/arch/power/compare256_power9.c:39:9: error: AltiVec argument passed to unprototyped function
  make[2]: *** [CMakeFiles/zlib.dir/arch/power/compare256_power9.c.o] Error 1
  make[1]: *** [CMakeFiles/zlib.dir/all] Error 2
  make: *** [all] Error 2
  thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 2

@Byron
Copy link
Member

Byron commented May 12, 2024

Thanks for reporting!

This architecture isn't tested on CI here, and I'd think that maybe zlib-ng itself isn't validated on this platform.

In flate2, there now is a zlib-rs feature which is a pure-Rust version of zlib-ng - maybe a little slower still, but might be more compatible already. Since it uses SIMD, it could of course be that it also won't compile on PowerPC just yet.

@ofek
Copy link

ofek commented May 12, 2024

I didn't know about that, nice! Since I don't see such a feature in zip, how would you recommend using that?

@Byron
Copy link
Member

Byron commented May 12, 2024

It's a backend for the flate2 crate, which is probably the more convenient way of using it (if it compiles).

@ofek
Copy link

ofek commented May 12, 2024

Just tried, but very broken for my use case apparently ofek/pyapp#127

@Byron
Copy link
Member

Byron commented May 13, 2024

If any zlib implementation will do, then the default of flate2 for miniz_oxide should definitely compile. Maybe you can do it so that the default is used on PowerPC, and zlib-ng in all other (or known to be working) cases.

@ofek
Copy link

ofek commented May 13, 2024

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

3 participants