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

[Bug]Failed to compile the AES-GCM with feature +soft-float: LLVM ERROR: Do not know how to split the result of this operator! #498

Closed
yaoxin-jing opened this issue Jan 8, 2023 · 5 comments

Comments

@yaoxin-jing
Copy link

yaoxin-jing commented Jan 8, 2023

I try to use AES-GCM in the rust kernel development environment (no-std). But after I add the following to Cargo.toml [dependencies]:

getrandom = { version = "0.2", features = ["rdrand"] }
aes-gcm = "0.10.1"

I got the following error

   Compiling aes-gcm v0.10.1
   Compiling enum_dispatch v0.3.8 (https://github.com/QuarkContainer/enum_dispatch_clone.git#db1abae3)
   Compiling qkernel v0.6.0 (/home/yaoxin/Project/master-thesis-quark/qkernel)
LLVM ERROR: Do not know how to split the result of this operator!

error: could not compile `qkernel`
make[1]: *** [makefile:28: kernel] Error 101
make[1]: Leaving directory '/home/yaoxin/Project/master-thesis-quark/qkernel'
make: *** [makefile:5: release] Error 2

I use cmd CARGO_TARGET_DIR=../target cargo xbuild --target x86_64-qkernel.json
to compile to code. And here is the x86_64-qkernel.json:

{
  "llvm-target": "x86_64-unknown-none",
  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
  "linker-flavor": "gcc",
  "target-endian": "little",
  "target-pointer-width": "64",
  "target-c-int-width": "32",
  "arch": "x86_64",
  "os": "none",
  "disable-redzone": true,
  "features": "-mmx,-sse,-avx,+soft-float",
  "frame-pointer": "always"
}

@yaoxin-jing
Copy link
Author

@tarcieri @warner @fjarri @vladikoff Could you please take a look? Many thanks

@newpavlov
Copy link
Member

It looks like an LLVM issue (I think we had a similar issue recently...). Have you tried to compile aes? If it fails with the same error, then this issue should go to the block ciphers repository.

As a temporary workaround, try to compile your project with the aes_force_soft configuration flag.

@yaoxin-jing
Copy link
Author

It looks like an LLVM issue (I think we had a similar issue recently...). Have you tried to compile aes? If it fails with the same error, then this issue should go to the block ciphers repository.

As a temporary workaround, try to compile your project with the aes_force_soft configuration flag.

I tried to compile aes with my project. It also shows the same error LLVM ERROR: Do not know how to split the result of this operator!.

The workaround works for aes crate. But it doesn't work for aes-gcm.

Here is how I compile my project with the [aes_force_soft]

RUSTFLAGS="--cfg aes_force_soft" CARGO_TARGET_DIR=../target cargo xbuild --target x86_64-qkernel.json 

@newpavlov
Copy link
Member

You also need to enable the polyval_force_soft configuration flag.

yaoxin-jing added a commit to yaoxin-jing/master_thesis_quark that referenced this issue Jan 8, 2023
fix bug [Bug]Failed to compile the AES-GCM with feature +soft-float: LLVM ERROR: Do not know how to split the result of this operator!
RustCrypto/AEADs#498
compiling the qkernel with flags  and  enabled fix the issue
yaoxin-jing added a commit to yaoxin-jing/master_thesis_quark that referenced this issue Jan 8, 2023
fix bug [Bug]Failed to compile the AES-GCM with feature +soft-float: LLVM ERROR: Do not know how to split the result of this operator!
RustCrypto/AEADs#498
compiling the qkernel with flags  and  enabled fix the issue
@yaoxin-jing
Copy link
Author

You also need to enable the polyval_force_soft configuration flag.

Many thanks, compiling the code with RUSTFLAGS="--cfg aes_force_soft --cfg polyval_force_soft" fixed the issue

yaoxin-jing added a commit to yaoxin-jing/master_thesis_quark that referenced this issue Mar 13, 2023
- fix bug [Bug]Failed to compile the AES-GCM with feature +soft-float: LLVM ERROR: Do not know how to split the result of this operator!
- RustCrypto/AEADs#498
- compiling the qkernel with flags  and  enabled fix the issue
yaoxin-jing added a commit to yaoxin-jing/master_thesis_quark that referenced this issue Nov 8, 2023
fix bug [Bug]Failed to compile the AES-GCM with feature +soft-float: LLVM ERROR: Do not know how to split the result of this operator!
RustCrypto/AEADs#498
compiling the qkernel with flags  and  enabled fix the issue
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