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

Can't build. Maybe wrong c/c++ mode? use of undeclared identifier '__builtin_ia32_paddsb128' #81

Closed
nemui-i opened this issue Aug 6, 2024 · 2 comments

Comments

@nemui-i
Copy link

nemui-i commented Aug 6, 2024

I can't build currently,

This will fail:

cargo new test2 && cd test2
cargo add mozangle
cargo build

I also can't build servo, because mozangle fails, which is how I got here:

The following warnings were emitted during compilation:

warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
warning: [email protected]: clang: warning: argument unused during compilation: '-arch:SSE2' [-Wunused-command-line-argument]
  --- stderr
  /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:2228:19: error: use of undeclared identifier '__builtin_ia32_paddsb128'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:2250:19: error: use of undeclared identifier '__builtin_ia32_paddsw128'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:2271:19: error: use of undeclared identifier '__builtin_ia32_paddusb128'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:2292:19: error: use of undeclared identifier '__builtin_ia32_paddusw128'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:2670:19: error: use of undeclared identifier '__builtin_ia32_psubsb128'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:2691:19: error: use of undeclared identifier '__builtin_ia32_psubsw128'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:2711:19: error: use of undeclared identifier '__builtin_ia32_psubusb128'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/emmintrin.h:2731:19: error: use of undeclared identifier '__builtin_ia32_psubusw128'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx2intrin.h:95:19: error: use of undeclared identifier '__builtin_ia32_paddsb256'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx2intrin.h:101:19: error: use of undeclared identifier '__builtin_ia32_paddsw256'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx2intrin.h:107:19: error: use of undeclared identifier '__builtin_ia32_paddusb256'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx2intrin.h:113:19: error: use of undeclared identifier '__builtin_ia32_paddusw256'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx2intrin.h:631:19: error: use of undeclared identifier '__builtin_ia32_psubsb256'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx2intrin.h:637:19: error: use of undeclared identifier '__builtin_ia32_psubsw256'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx2intrin.h:643:19: error: use of undeclared identifier '__builtin_ia32_psubusb256'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx2intrin.h:649:19: error: use of undeclared identifier '__builtin_ia32_psubusw256'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx512fintrin.h:9319:10: error: use of undeclared identifier '__builtin_ia32_reduce_add_q512'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx512fintrin.h:9323:10: error: use of undeclared identifier '__builtin_ia32_reduce_mul_q512'
  /usr/lib/llvm-14/lib/clang/14.0.0/include/avx512fintrin.h:9337:10: error: use of undeclared identifier '__builtin_ia32_reduce_add_q512'
  fatal error: too many errors emitted, stopping now [-ferror-limit=]

I have no clue about anything and looking up this message I found this thread saying it's maybe because of c files being compiled in c++ mode? Which is maybe related to #38 It would also fit the message from above: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated

If I'm missing some package it would be great if that could be added to the README, since I can't figure out what it is from the error message.

@sagudev
Copy link
Member

sagudev commented Aug 6, 2024

You can ignore warnings. From what I recall, missing __builtin_* are due to clang mismatch. In CI we used https://github.com/servo/servo/blob/f2882879d8d345c62d8d1d076485af6280e54dde/.github/workflows/linux.yml#L81, but generally the best idea is to make sure you have only one clang and that it is new enough (preferably same version as used by rustc).

@nemui-i
Copy link
Author

nemui-i commented Aug 6, 2024

Thank you a lot for the help!

LIBCLANG_PATH=/usr/lib/llvm-14/lib cargo build

This works!

@nemui-i nemui-i closed this as completed Aug 6, 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

2 participants