forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 38
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
error: Undefined temporary symbol .LBB11_19 when compiling rustls #253
Comments
Can you try compiling for a RISCV esp std target too? |
I followed the repro steps in my above post, except used the esp32-c3 template instead of the esp32 template.
I think I installed the riscv toolchain tools correctly, but maybe not. I just followed the instructions here: It builds if I don't add suppaftp dep. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to get an FTPS client working on an esp32. I have to use TLS/SSL for my application.
I'm compiling it for xtensa for the regular esp32-wroom-32. I'm using Ubuntu on WSL on x86-64, and I just installed the esp-rs/rust compiler yesterday.
I'm using the suppaftp crate because it supports rustls so it is a great fit for the esp32.
If you just try and build the suppaftp crate, it gives a few errors. This is because the ring crate says:
error[E0277]: the trait bound
SystemRandom: ring::rand::SecureRandomis not satisfied
You can fix this with a feature flag in the ring crate:
less-safe-getrandom-espidf
.I cloned the suppaftp and rustls crates locally and enabled the feature in rustls's
Cargo.toml
.Note that for some reason I also had to clone ring locally, I'm not entirely sure why.
This fixes all the compile errors.
Then, running
cargo build
again, rustc gives an error:This was run with opt-level = "z".
The build supposedly suceeds on opt level 0, but every other level it errors out.
I haven't verified if the program actually works as intended on opt level 0 as I do not have access to the network with the FTP server at the moment, but it doesn't give any errors.
For opt level 2 and 3, it gives two:
This bug occurs when compiling an empty main function.
suppaftp imports rustls like this:
rustls-crate = { package = "rustls", version = "^0.23", default-features = false, features = ["logging", "ring", "std", "tls12"], optional = true }
However if the bin crate imports rustls using the same line, the problem is not present, so it's something about the combination of rustls and suppaftp that causes the bug to occur.
Minimum reproduction
Admittedly I'm out of my depth here, so I don't know how to minimize this more.
Reproduction:
I have uploaded my crate to github here, though I don't know enough about git to make my changes to the dependencies persist in my commit.
https://github.com/nbc12/esp-rs-repro
Because of this, I think you're better off reproducing it by doing these steps:
cargo generate esp-rs/esp-idf-template cargo
. (The esp-rs rust book talks about this in detail if you need.) Select the esp32 target. Do not configure advanced template options.deps/rustls/Cargo.toml
, replace ring with this line:ring = { path = "../ring", features = ["less-safe-getrandom-espidf"]}
deps/suppaftp/suppaftp/Cargo.toml
, replace rustls-crate with this line:rustls-crate = { package = "rustls", path="../../rustls/rustls", default-features = false, features = ["logging", "ring", "std", "tls12"], optional = true }
./Cargo.toml
, addsuppaftp = { path = "./deps/suppaftp/suppaftp", features = ["rustls"] }
cargo build
Output:
esp-idf-sys takes forever to do a clean build, just wait for it.
Setting RUSTC_BACKTRACE=1 does not change the output.
Output of
rustc --version --verbose
:I also tried compiling to x86-64, and it worked just fine. So it seems to be the xtensa backend.
I'd love to help fix this if I can, I just have no idea where to start.
The text was updated successfully, but these errors were encountered: