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

LTO is not working, again #366

Open
pacak opened this issue Jan 26, 2025 · 3 comments
Open

LTO is not working, again #366

pacak opened this issue Jan 26, 2025 · 3 comments

Comments

@pacak
Copy link
Owner

pacak commented Jan 26, 2025

Hi, I'm having this issue trying to run the tool with https://github.com/louis-e/arnis. I've disabled the (Tauri) GUI feature, so in theory it's just a CLI application with ~500 dependencies.

❯ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/benjamin/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.84.0 (9fc6b4312 2025-01-07)

❯ cargo asm --version
Version: 0.2.47

❯ cargo asm --bin arnis --no-default-features

<lots of output since it is compiling...>

Error: Cannot locate the path to the asm file

The current version of cargo-show-asm works in a brand-new cargo new foo project, but it doesn't work here. What's going on?

Originally posted by @benjamin051000 in #82

@pacak
Copy link
Owner Author

pacak commented Jan 26, 2025

Blocked on cargo rust-lang/cargo#13672

@pacak
Copy link
Owner Author

pacak commented Jan 26, 2025

Thin LTO for arnis crate makes rustc to produce about 950 .s files:

arnis-3243b349208c302c.8qi3mr8qju3xmfjsf34x3m992.rcgu.s
arnis-3243b349208c302c.addr2line-bea85df8985bb2f0.addr2line.257eabc222133535-cgu.0.rcgu.o.rcgu.s
arnis-3243b349208c302c.adler-7edbe936f6124018.adler.c05167120aaaa11-cgu.0.rcgu.o.rcgu.s
arnis-3243b349208c302c.ahash-5f4e9db20a685a8b.ahash.9ea151b83c359a1d-cgu.0.rcgu.o.rcgu.s
...
arnis-3243b349208c302c.console-c85db5ed6c6839da.console.b89a0426d30cb582-cgu.6.rcgu.o.rcgu.s
arnis-3243b349208c302c.console-c85db5ed6c6839da.console.b89a0426d30cb582-cgu.7.rcgu.o.rcgu.s
arnis-3243b349208c302c.core-1e6496089ac34c68.core.9e3ec3a99e20741e-cgu.0.rcgu.o.rcgu.s
arnis-3243b349208c302c.crc32fast-e2cdbd16bb066f34.crc32fast.a5f7f5e1cc329c1d-cgu.0.rcgu.o.rcgu.s
arnis-3243b349208c302c.crossbeam_deque-f35b3fcb74c4667c.crossbeam_deque.a044f344000c4a51-cgu.0.rcgu.o.rcgu.s
arnis-3243b349208c302c.crossbeam_epoch-a8dd3a9032740fa4.crossbeam_epoch.e375ac55259ef9a0-cgu.0.rcgu.o.rcgu.s
...

Usually generated asm is located in a file that starts with the executable name (arnis-3243b349208c302c), contains a hash and ends with .s - here it is arnis-3243b349208c302c.8qi3mr8qju3xmfjsf34x3m992.rcgu.s, but in this case it is mostly empty, and the contents are inside of arnis-3243b349208c302c.core-1e6496089ac34c68.core.9e3ec3a99e20741e-cgu.0.rcgu.o.rcgu.s

@pacak
Copy link
Owner Author

pacak commented Jan 26, 2025

and the contents are inside of arnis-3243b349208c302c.core-1e6496089ac34c68.core.9e3ec3a99e20741e-cgu.0.rcgu.o.rcgu.s

But since code will be optimized at the link time later - this might not be the final code.

Should we try to detect the presence of LTO and propose either disabling it or using --disasm?

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

1 participant