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

LLVM ERROR: Broken module found, compilation aborted #32

Open
zamazan4ik opened this issue Mar 18, 2023 · 4 comments
Open

LLVM ERROR: Broken module found, compilation aborted #32

zamazan4ik opened this issue Mar 18, 2023 · 4 comments

Comments

@zamazan4ik
Copy link
Contributor

zamazan4ik commented Mar 18, 2023

Hi!

I am trying to test PGO with https://github.com/cloudflare/boringtun . I have the following errors:

... <lines omitted>
Compiling boringtun v0.5.2 (/Users/zamazan4ik/open_source/boringtun/boringtun)
warning: unused variable: `fwmark`===> ] 170/177: clap, boringtun, clap, criterion
   --> boringtun/src/device/peer.rs:107:9
    |
107 |         fwmark: Option<u32>,
    |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_fwmark`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: 535 warnings emitted========> ] 172/177: boringtun, criterion

   Compiling boringtun-cli v0.5.2 (/Users/zamazan4ik/open_source/boringtun/boringtun-cli)
warning: unused variable: `fwmark`===> ] 174/177: crypto_benches(bench), boringtun(test), boringtun-cli(bin test)
   --> boringtun/src/device/peer.rs:107:9
    |
107 |         fwmark: Option<u32>,
    |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_fwmark`
    |
    = note: `#[warn(unused_variables)]` on by default

module flag identifiers must be unique (or of 'require' type)
!"CG Profile"
LLVM ERROR: Broken module found, compilation aborted!
error: could not compile `boringtun-cli`; 3 warnings emitted
warning: build failed, waiting for other jobs to finish...
module flag identifiers must be unique (or of 'require' type)
!"CG Profile"
LLVM ERROR: Broken module found, compilation aborted!
error: could not compile `boringtun`; 26 warnings emitted
module flag identifiers must be unique (or of 'require' type)
!"CG Profile"
LLVM ERROR: Broken module found, compilation aborted!
error: could not compile `boringtun`; 48 warnings emitted
PGO optimized build has failed.
Cargo finished with an error (101)

I did the following steps:

  • Run cargo pgo bench. All is fine here.
  • Run cargo pgo optimize bench. Here I got the errors.

I have tried to google the error but with no success. I didn't dig into LLVM, however.

If you need additional information - I would be happy to provide it :)

@Kobzol
Copy link
Owner

Kobzol commented Mar 21, 2023

Hi, sorry for the late response, I was a bit sick over the weekend.

I have tested the crate with rustc 1.68.0 and these two commands worked for me. I wonder if this could have something to do with the sudo -E script in boringtun's config.toml. I disabled it when I ran the benchmarks.

When I ran the benchmarks with the sudo flag, cargo pgo optimize wasn't even able to open the PGO profiles.

@zamazan4ik
Copy link
Contributor Author

Hi, sorry for the late response, I was a bit sick over the weekend.

No worries - health is much more important!

Hi, sorry for the late response, I was a bit sick over the weekend.

Hmm... I will try to do the same things and will report the results. Initially forgot to say - my env is macOS 13.2.1.

@zamazan4ik
Copy link
Contributor Author

I got the same issue when building Vector ( https://github.com/vectordotdev/vector , from master branch on dc665666bcd4d3487ca3684fd2fe41d4415cea52 commit):

cargo pgo optimize

<skipped some logs>
...
Compiling vector v0.33.0 (/home/zamazan4ik/open_source/vector)
module flag identifiers must be unique (or of 'require' type)
!"CG Profile"
LLVM ERROR: Broken module found, compilation aborted!
error: could not compile `vector` (bin "secret-backend-example"); 201 warnings emitted
warning: build failed, waiting for other jobs to finish...
module flag identifiers must be unique (or of 'require' type)
!"CG Profile"
LLVM ERROR: Broken module found, compilation aborted!
error: could not compile `vector` (bin "vector")
PGO optimized build has failed.
Cargo finished with an error (101)

OS: Fedora 38
Rust version: https://github.com/vectordotdev/vector/blob/master/rust-toolchain.toml (1.71.1)

Not sure what is the reason for the error.

@zamazan4ik
Copy link
Contributor Author

zamazan4ik commented Aug 26, 2023

Seems like I found the reason in LLVM: llvm/llvm-project#57501 . Since the issue is reproduced not only by me, I think it should be reported to rustc repo as well.

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