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

Fails to build on aarch64_be-unknown-linux-gnu #174

Open
joshlf opened this issue Feb 25, 2025 · 5 comments
Open

Fails to build on aarch64_be-unknown-linux-gnu #174

joshlf opened this issue Feb 25, 2025 · 5 comments

Comments

@joshlf
Copy link

joshlf commented Feb 25, 2025

See this GitHub Actions build failure, which builds memchr 2.7.4 with nightly-2025-02-24 for target aarch64_be-unknown-linux-gnu.

This may relate to rust-lang/stdarch#1484, which was recently resolved.

Full error output
error[E0432]: unresolved import `core::arch::aarch64::uint8x16_t`
  --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b5[57](https://github.com/google/zerocopy/actions/runs/13521505509/job/37781631983?pr=2387#step:7:58)f/memchr-2.7.4/src/arch/aarch64/neon/memchr.rs:23:5
   |
23 | use core::arch::aarch64::uint8x16_t;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `uint8x16_t` in `core_arch::arch::aarch64`

error[E0432]: unresolved import `core::arch::aarch64::uint8x16_t`
  --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/arch/aarch64/neon/packedpair.rs:11:5
   |
11 | use core::arch::aarch64::uint8x16_t;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `uint8x16_t` in `core_arch::arch::aarch[64](https://github.com/google/zerocopy/actions/runs/13521505509/job/37781631983?pr=2387#step:7:65)`

error[E0412]: cannot find type `uint8x16_t` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:298:21
    |
298 |     impl Vector for uint8x16_t {
    |                     ^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `uint8x16_t` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:305:38
    |
305 |         unsafe fn splat(byte: u8) -> uint8x16_t {
    |                                      ^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `uint8x16_t` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:310:52
    |
310 |         unsafe fn load_aligned(data: *const u8) -> uint8x16_t {
    |                                                    ^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `uint8x16_t` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:317:54
    |
317 |         unsafe fn load_unaligned(data: *const u8) -> uint8x16_t {
    |                                                      ^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `uint8x16_t` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1[94](https://github.com/google/zerocopy/actions/runs/13521505509/job/37781631983?pr=2387#step:7:95)9cf8c6b5b557f/memchr-2.7.4/src/vector.rs:331:49
    |
331 |         unsafe fn cmpeq(self, vector2: Self) -> uint8x16_t {
    |                                                 ^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `uint8x16_t` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:336:47
    |
336 |         unsafe fn and(self, vector2: Self) -> uint8x16_t {
    |                                               ^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `uint8x16_t` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:341:46
    |
341 |         unsafe fn or(self, vector2: Self) -> uint8x16_t {
    |                                              ^^^^^^^^^^ not found in this scope

   Compiling rustc-demangle v0.1.24
error[E0425]: cannot find function `vdupq_n_u8` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:306:13
    |
306 |             vdupq_n_u8(byte)
    |             ^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `vld1q_u8` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:318:13
    |
318 |             vld1q_u8(data)
    |             ^^^^^^^^ not found in this scope

error[E0425]: cannot find function `vreinterpretq_u16_u8` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:323:26
    |
323 |             let asu16s = vreinterpretq_u16_u8(self);
    |                          ^^^^^^^^^^^^^^^^^^^^------
    |                          |
    |                          help: try calling `vreinterpretq_u16_u8` as a method: `self.vreinterpretq_u16_u8()`

error[E0425]: cannot find function `vshrn_n_u16` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:324:24
    |
324 |             let mask = vshrn_n_u16(asu16s, 4);
    |                        ^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `vreinterpret_u64_u8` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:325:25
    |
325 |             let asu64 = vreinterpret_u64_u8(mask);
    |                         ^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `vget_lane_u64` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:326:28
    |
326 |             let scalar64 = vget_lane_u64(asu64, 0);
    |                            ^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `vceqq_u8` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:332:13
    |
332 |             vceqq_u8(self, vector2)
    |             ^^^^^^^^---------------
    |             |
    |             help: try calling `vceqq_u8` as a method: `self.vceqq_u8(vector2)`

error[E0425]: cannot find function `vandq_u8` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:337:13
    |
337 |             vandq_u8(self, vector2)
    |             ^^^^^^^^---------------
    |             |
    |             help: try calling `vandq_u8` as a method: `self.vandq_u8(vector2)`

error[E0425]: cannot find function `vorrq_u8` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:342:13
    |
342 |             vorrq_u8(self, vector2)
    |             ^^^^^^^^---------------
    |             |
    |             help: try calling `vorrq_u8` as a method: `self.vorrq_u8(vector2)`

error[E0425]: cannot find function `vpmaxq_u8` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-[194](https://github.com/google/zerocopy/actions/runs/13521505509/job/37781631983?pr=2387#step:7:195)9cf8c6b5b557f/memchr-2.7.4/src/vector.rs:353:44
    |
353 |             let low = vreinterpretq_u64_u8(vpmaxq_u8(self, self));
    |                                            ^^^^^^^^^------------
    |                                            |
    |                                            help: try calling `vpmaxq_u8` as a method: `self.vpmaxq_u8(self)`

error[E0425]: cannot find function `vreinterpretq_u64_u8` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:353:23
    |
353 |             let low = vreinterpretq_u64_u8(vpmaxq_u8(self, self));
    |                       ^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `vgetq_lane_u64` in this scope
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.7.4/src/vector.rs:354:13
    |
354 |             vgetq_lane_u64(low, 0) != 0
    |             ^^^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0412, E0425, E0432.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `memchr` (lib) due to 21 previous errors
@BurntSushi
Copy link
Owner

This PR was submitted to fix this I think, but did it by just disabling all NEON paths on big endian. Is that the right fix for this? @workingjubilee commented that it should be fixed upstream. And it looks like this PR was just merged upstream to fix the problem.

So I guess I'm unclear as to the action item here for memchr. It seems wholly like a problem upstream and not something to be fixed in memchr. To be clear, I'm also more than willing to be practical about this if we know upstream isn't going to be fixed any time soon (in which case, something like #162 seems fine), but it seems like that's not the case?

Can you say more about what specific action you're looking for here?

@BurntSushi
Copy link
Owner

I guess the first thing to check here is whether rust-lang/stdarch#1708 is actually in the latest nightly.

@joshlf
Copy link
Author

joshlf commented Feb 25, 2025

I guess the first thing to check here is whether rust-lang/stdarch#1708 is actually in the latest nightly.

Good point; I tried again here with 2025-02-25, which I assume is more likely to contain rust-lang/stdarch#1708, and the issue still shows up. I know there are ways to check which commits are included in nightly, but I'm not sure what those ways are. Maybe somebody else can chime in.

@joshlf
Copy link
Author

joshlf commented Feb 25, 2025

Can you say more about what specific action you're looking for here?

I was under the impression that rust-lang/stdarch#1708 ought to fix this, and so I figured that there might be some work memchr might need to do in order to be compatible with that fix. I'm not sure, though - that's just a guess as to the path forward.

The proximate issue for us is just being able to compile memchr (and thus compile our CI tests) on aarch64_be; since memchr is just an indirect dependency for us, we don't have any opinions about the best resolution - any resolution that gets memchr compiling is equally good from our perspective.

@BurntSushi
Copy link
Owner

All righty. Let's give it a day or two, or until we can confirm that the latest usptream fix doesn't actually help. If so, I can apply the band-aide.

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