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

i686-pc-windows-msvc: remove pdb file #67012

Closed
220160239 opened this issue Dec 4, 2019 · 7 comments
Closed

i686-pc-windows-msvc: remove pdb file #67012

220160239 opened this issue Dec 4, 2019 · 7 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@220160239
Copy link

I compile on i686-pc-windows-msvc, the output file (*.exe) include RSDS information. I do not need pdb file, how can I remove it ?

@jonas-schievink
Copy link
Contributor

Have you tried compiling without debug info?

@220160239
Copy link
Author

Have you tried compiling without debug info?

I tried set debug=false in cargo.toml, but pdb file still existed.

@jonas-schievink
Copy link
Contributor

Cargo does not remove old files when recompiling. Deleting the file should work.

@220160239
Copy link
Author

Cargo does not remove old files when recompiling. Deleting the file should work.

I delete the whole target folder, set "[profile.release] debug = false" in cargo.toml, then execute “cargo build --release”, the pdb file is still there. Is there something I ignored ?

@jonas-schievink jonas-schievink added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 4, 2019
@retep998
Copy link
Member

retep998 commented Dec 4, 2019

Rust will always ask the linker to emit debug info for -msvc targets, regardless of whether debug is true or false. This is intended behavior and not a bug.

Is the issue that emitting a PDB file causes the linker to hardcode a path to the PDB in your binary and you don't want that for security reasons? If so, you can use the -Clink-arg rustc command line parameter to pass /DEBUG:NONE to the linker.

@220160239
Copy link
Author

Rust will always ask the linker to emit debug info for -msvc targets, regardless of whether debug is true or false. This is intended behavior and not a bug.

Is the issue that emitting a PDB file causes the linker to hardcode a path to the PDB in your binary and you don't want that for security reasons? If so, you can use the -Clink-arg rustc command line parameter to pass /DEBUG:NONE to the linker.

Thinks, that's the solution.

@csmoe
Copy link
Member

csmoe commented Jan 1, 2020

Closes as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants