zig icon indicating copy to clipboard operation
zig copied to clipboard

Cann't build for armv7 with "neon"

Open Dirreke opened this issue 2 years ago • 2 comments

Zig Version

0.9.1

Steps to Reproduce and Observed Behavior

I use zig c++ -target arm-linux-gnueabihf -mcpu=generic+v7a+vfp3+d32+thumb2+neon -mfpu=neon -mfloat-abi=hard and it still cann't add neon to target-feature, and I always get this

/opt/zig/zig-linux-x86_64-0.9.1/lib/include/arm_neon.h:32:2: error: "NEON support not enabled"

Is it a bug? Or maybe I just missed some args?

Expected Behavior

//

Dirreke avatar Jun 13 '23 16:06 Dirreke

do you have the same issue with the latest stable zig release 0.10.1?

leecannon avatar Jun 13 '23 16:06 leecannon

I cann't build for arm with 0.10.1 because #6573

  cargo:warning=warning(compilation): libc++ does not work on multi-threaded ARM yet.
  cargo:warning=For more details: https://github.com/ziglang/zig/issues/6573
  cargo:warning=error: unable to create compilation: TargetRequiresSingleThreaded
  exit status: 1

is there any way to build like rocksdb or Cbc with zig 0.10.1?

Dirreke avatar Jun 13 '23 16:06 Dirreke

is there any way to build like rocksdb or Cbc with zig 0.10.1?

Can you use Clang?

iacore avatar Jun 17 '23 18:06 iacore

Zig is indeed passing the neon flags to Clang, so the question is why doesn't clang define the macro?

#if !defined(__ARM_NEON)
#error "NEON support not enabled"
#else

Can you file a bug report on Clang? Use ZIG_VERBOSE_CC=1 to observe the clang command that zig spits out (which includes -Xclang +neon) and ask them why __ARM_NEON is not defined.

andrewrk avatar Jul 23 '23 00:07 andrewrk

I'd love to try it. However, I'm a little busy these days. I will try to find this bug some days later.

Dirreke avatar Jul 23 '23 08:07 Dirreke

It issue seems very related to #10411

Dirreke avatar Jun 13 '24 08:06 Dirreke