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

rustc -C link-args=-static-libgcc does not work on Windows #15420

Closed
abonander opened this issue Jul 4, 2014 · 1 comment
Closed

rustc -C link-args=-static-libgcc does not work on Windows #15420

abonander opened this issue Jul 4, 2014 · 1 comment
Labels
A-linkage Area: linking into static, shared libraries and binaries O-windows Operating system: Windows

Comments

@abonander
Copy link
Contributor

When building on Windows, libgcc is dynamically linked by default. In the GCC Linker Options, it says that this is necessary for cross-library exception handling, but for programs that don't need that, this adds an unnecessary dynamic linking to the libgcc DLL, which would have to be distributed with the built executable since it's not available by default on Windows.

Passing -C link-args=-static-libgcc should make libgcc statically linked, but it doesn't seem to override the -shared-libgcc flag. While this suggests a bug or undocumented behavior with the GCC linker, rustc should be aware that the user wants to statically link libgcc and not add the -shared-libgcc linker flag.

I'm using Mingw-builds 4.8.1 on Windows 7 (OS is 64-bit, Mingw is 32-bit) and the Rust 0.11.0 release.

@vadimcn
Copy link
Contributor

vadimcn commented Aug 24, 2014

We used to let gcc add the appropriate version of libgcc to linker command line, so the -static-libgcc switch would work. Later, however, an explicit #[link("gcc_s")] was added in libunwind.rs, which takes precedence.
I suppose this could be reverted, however, if we aspire to invoke 'ld' directly, this wouldn't be a long-term solution. To do this properly, we may have to add some support for conditional linking, similar to --cfg.

@bors bors closed this as completed in 8cad720 Sep 24, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 21, 2023
…r=Veykril

Increase the buffer size for discover project command

The default value for maxBuffer is 1 MiB[1]. If the discover project command returns stdout or stderr that is greater than 1 MiB, the extension would error with "RangeError: stderr maxBuffer length exceeded".

Set the default value for maxBuffer to 10 MiB for project discovery.

[1] https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries O-windows Operating system: Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants