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

Strip the local symbols from the nasm objects #2762

Merged
merged 4 commits into from
Jul 22, 2021
Merged

Conversation

lu-zero
Copy link
Collaborator

@lu-zero lu-zero commented Jul 21, 2021

They tend to confuse the debugger and are overall unnecessary.

@coveralls
Copy link
Collaborator

coveralls commented Jul 21, 2021

Coverage Status

Coverage remained the same at 83.521% when pulling 314f184 on rust-av:strip-nasm into 7970d35 on xiph:master.

@KyleSiefring
Copy link
Collaborator

KyleSiefring commented Jul 22, 2021

Thanks for doing this.

Unfortunately, it doesn't work on my computer in its current state. It seems to be using the wrong file.
Printing out the path:

panic!("{:?}", Path::new(&out_dir).join("rav1easm.a"));`

thread 'main' panicked at '"/home/kyle/Programming/VideoEncode/rav1e/rav1e/target/release/build/rav1e-388a8ed5e3fac2cf/out/rav1easm.a"', build.rs:153:5

Finding the file:

find . -regextype sed -regex ".*rav1easm.*"

...
./target/debug/build/rav1e-0d4b49c9f2795e3c/out/librav1easm.a
./target/debug/build/rav1e-fddf7b5d00394bfb/out/librav1easm.a
./target/debug/build/rav1e-a356b122f2ada701/out/librav1easm.a
./target/release/build/rav1e-388a8ed5e3fac2cf/out/librav1easm.a

@lu-zero
Copy link
Collaborator Author

lu-zero commented Jul 22, 2021 via email

@KyleSiefring
Copy link
Collaborator

KyleSiefring commented Jul 22, 2021

I noticed that you switched to -X. This doesn't seem to work, see below.

perf when searching for functions w/ sad

   1.11%  rav1e  rav1e  [.] rav1e_sad16x16_sse2.loop
   0.36%  rav1e  rav1e  [.] rav1e_sad4x4_sse2.loop
   0.15%  rav1e  rav1e  [.] rav1e_sad8x8_sse2.loop
   0.05%  rav1e  rav1e  [.] rav1e_sad16x16_sse2
   0.04%  rav1e  rav1e  [.] rav1e_sad4x4_sse2
   0.01%  rav1e  rav1e  [.] rav1e_sad8x8_sse2
   0.01%  rav1e  rav1e  [.] rav1e_sad16x32_sse2.loop
   0.00%  rav1e  rav1e  [.] rav1e_sad32x32_avx2
   0.00%  rav1e  rav1e  [.] rav1e_sad16x8_sse2.loop
   0.00%  rav1e  rav1e  [.] rav1e_sad64x64_avx2

I basically want the .loop's to be merged with the main function.

I'm also noticing that build_asm_files isn't rerun when build.rs is modified and I have to delete the release folder. This surprises me somewhat, since I could have sworn that in the past it reran whenever it was modified.

EDIT: It seems the hash_changed does not consider whether build.rs has changed.

@lu-zero
Copy link
Collaborator Author

lu-zero commented Jul 22, 2021

I'll add build.rs to the hash in another commit. -x would break linking.

Please open an issue to the nasm upstream.

build.rs Outdated

let mut cmd = std::process::Command::new(strip);

cmd.arg("-").arg(obj.as_ref());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this just remove all symbols???

They tend to confuse the debugger and are overall unnecessary.
Copy link
Collaborator

@KyleSiefring KyleSiefring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

More recent versions use cfg-expr 0.8 that use a rust-1.53 feature: or-patterns
@lu-zero lu-zero merged commit 0f25619 into xiph:master Jul 22, 2021
@lu-zero lu-zero deleted the strip-nasm branch July 22, 2021 17:44
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

Successfully merging this pull request may close these issues.

3 participants