about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/native_libs.rs
AgeCommit message (Collapse)AuthorLines
2025-08-27Port the `#[link]` attribute to the new parserJonathan Brouwer-299/+36
2025-08-15Merge link_name and export_namebjorn3-1/+1
2025-08-08Add target_env = "macabi" and target_env = "sim"Mads Marquart-1/+1
2025-07-31remove rustc_attr_data_structuresJana Dönszelmann-1/+2
2025-07-24generate elf symbol version in raw-dylibusamoi-1/+14
2025-07-13Port `#[link_ordinal]` to the new attribute parsing infrastructure.Anne Stijns-7/+3
2025-06-17apply clippy::or_fun_callklensy-1/+1
2025-06-08raw dylib: ensure that we have applied standard ABI checksRalf Jung-3/+9
also unify error messages that do not seem to have a good reason to be different
2025-04-17Replace infallible `name_or_empty` methods with fallible `name` methods.Nicholas Nethercote-7/+7
I'm removing empty identifiers everywhere, because in practice they always mean "no identifier" rather than "empty identifier". (An empty identifier is impossible.) It's better to use `Option` to mean "no identifier" because you then can't forget about the "no identifier" possibility. Some specifics: - When testing an attribute for a single name, the commit uses the `has_name` method. - When testing an attribute for multiple names, the commit uses the new `has_any_name` method. - When using `match` on an attribute, the match arms now have `Some` on them. In the tests, we now avoid printing empty identifiers by not printing the identifier in the `error:` line at all, instead letting the carets point out the problem.
2025-04-06remove compiler support for `extern "rust-intrinsic"` blocksSkgland-1/+1
2025-04-04Rollup merge of #138949 - madsmtm:rename-to-darwin, r=WaffleLapkinMatthias Krüger-3/+3
Rename `is_like_osx` to `is_like_darwin` Replace `is_like_osx` with `is_like_darwin`, which more closely describes reality (OS X is the pre-2016 name for macOS, and is by now quite outdated; Darwin is the overall name for the OS underlying Apple's macOS, iOS, etc.). ``@rustbot`` label O-apple r? compiler
2025-03-25Rename `is_like_osx` to `is_like_darwin`Mads Marquart-3/+3
2025-03-25rustc_session: Add a helper function for obtaining staticlib prefix and suffixVadim Petrochenkov-11/+10
2025-03-09metadata: Ignore sysroot when doing the manual native lib search in rustcVadim Petrochenkov-31/+32
2025-02-26Support raw-dylib link kind on ELFNoratrieb-2/+19
raw-dylib is a link kind that allows rustc to link against a library without having any library files present. This currently only exists on Windows. rustc will take all the symbols from raw-dylib link blocks and put them in an import library, where they can then be resolved by the linker. While import libraries don't exist on ELF, it would still be convenient to have this same functionality. Not having the libraries present at build-time can be convenient for several reasons, especially cross-compilation. With raw-dylib, code linking against a library can be cross-compiled without needing to have these libraries available on the build machine. If the libc crate makes use of this, it would allow cross-compilation without having any libc available on the build machine. This is not yet possible with this implementation, at least against libc's like glibc that use symbol versioning. The raw-dylib kind could be extended with support for symbol versioning in the future. This implementation is very experimental and I have not tested it very well. I have tested it for a toy example and the lz4-sys crate, where it was able to successfully link a binary despite not having a corresponding library at build-time.
2025-02-24Change span field accesses to method callsJana Dönszelmann-2/+2
2024-12-18Auto merge of #134243 - nnethercote:re-export-more-rustc_span, r=jieyouxubors-1/+1
Re-export more `rustc_span::symbol` things from `rustc_span`. `rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers to `rustc_span::`. This is a 300+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one. r? `@jieyouxu`
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-1/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-17Rollup merge of #133265 - the8472:extract-if-ranges, r=cuviperMatthias Krüger-1/+1
Add a range argument to vec.extract_if tracking issue: #43244 This adds the range argument requested in https://github.com/rust-lang/rust/issues/43244#issuecomment-2486160659
2024-12-16update uses of extract_if in the compilerThe 8472-1/+1
2024-12-16rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structuresJonathan Dönszelmann-1/+1
2024-11-30Rollup merge of #132750 - daltenty:daltenty/libs, r=jieyouxu许杰友 Jieyou Xu (Joe)-0/+4
[AIX] handle libunwind native_libs AIX should follow a similar path here to other libunwind platforms, with regards to system vs in-tree libunwind and the native lib search directories. Having the right native lib search directories here is also required to get the correct default library search paths, due to some quirks of the AIX linker.
2024-11-29Add a commentDavid Tenty-0/+3
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-2/+2
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-11-15rustc_metadata: Preprocess search paths for better performancePiotr Osiewicz-2/+2
Over in Zed we've noticed that loading crates for a large-ish workspace can take almost 200ms. We've pinned it down to how rustc searches for paths, as it performs a linear search over the list of candidate paths. In our case the candidate list had about 20k entries which we had to iterate over for each dependency being loaded. This commit introduces a simple FilesIndex that's just a sorted Vec under the hood. Since crates are looked up by both prefix and suffix, we perform a range search on said Vec (which constraints the search space based on prefix) and follow up with a linear scan of entries with matching suffixes. FilesIndex is also pre-filtered before any queries are performed using available target information; query prefixes/sufixes are based on the target we are compiling for, so we can remove entries that can never match up front. Overall, this commit brings down build time for us in dev scenarios by about 6%. 100ms might not seem like much, but this is a constant cost that each of our workspace crates has to pay, even when said crate is miniscule.
2024-11-07[AIX] handle libunwind native_libsDavid Tenty-0/+1
AIX should follow a similar path here to other libunwind platforms, with regards to system vs in-tree libunwind and the native lib search directories
2024-11-03compiler: Directly use rustc_abi in metadata and middleJubilee Young-9/+13
Stop reexporting ReprOptions from middle::ty
2024-10-23nightly feature tracking: get rid of the per-feature bool fieldsRalf Jung-3/+3
2024-10-01Implement boolean lit support in cfg predicatesUrgau-1/+1
2024-10-01Use `ast::NestedMetaItem` when evaluating cfg predicateUrgau-2/+7
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-4/+4
2024-09-08MsvcLinker: allow linking dynamically to Meson and MinGW-style named librariesL. E. Segovia-0/+38
Fixes #122455
2024-08-27linker: Synchronize native library search in rustc and linkerVadim Petrochenkov-10/+82
2024-08-10rustc_metadata: make "link {arg,cfg} is unstable" translatablePavel Grigorenko-5/+11
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-05-22Rename `FrameworkOnlyWindows` to `RawDylibOnlyWindows`Tobias Bucher-1/+1
Frameworks are Apple-specific, no idea why it had "framework" in the name before.
2024-04-12linker: Remove laziness and caching from native search directory walksVadim Petrochenkov-12/+6
It shouldn't be necessary for performance now.
2024-04-12linker: Avoid some allocations in search directory iterationVadim Petrochenkov-4/+4
2024-03-06Rewrite the `untranslatable_diagnostic` lint.Nicholas Nethercote-0/+1
Currently it only checks calls to functions marked with `#[rustc_lint_diagnostics]`. This commit changes it to check calls to any function with an `impl Into<{D,Subd}iagMessage>` parameter. This greatly improves its coverage and doesn't rely on people remembering to add `#[rustc_lint_diagnostics]`. The commit also adds `#[allow(rustc::untranslatable_diagnostic)`] attributes to places that need it that are caught by the improved lint. These places that might be easy to convert to translatable diagnostics. Finally, it also: - Expands and corrects some comments. - Does some minor formatting improvements. - Adds missing `DecorateLint` cases to `tests/ui-fulldeps/internal-lints/diagnostics.rs`.
2024-02-25remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsicsRalf Jung-1/+1
2024-01-13Auto merge of #119088 - George-lewis:glewis/suggest-upgrading-compiler, ↵bors-10/+5
r=Nilstrieb Suggest Upgrading Compiler for Gated Features This PR addresses #117318 I have a few questions: 1. Do we want to specify the current version and release date of the compiler? I have added this in via environment variables, which I found in the code for the rustc cli where it handles the `--version` flag a. How can I handle the changing message in the tests? 3. Do we want to only show this message when the compiler is old? a. How can we determine when the compiler is old? I'll wait until we figure out the message to bless the tests
2024-01-13Add check for ui_testing via promoting parameters from `ParseSess` to `Session`George-lewis-10/+5
2024-01-12allow system abi to be variadicbeepster4096-2/+14
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-43/+49
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-11-30Enable link-arg link kind inside of #[link] attributezetanumbers-0/+12
- Implement link-arg as an attribute - Apply suggestions from review - Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> - Add unstable book entry
2023-11-17rename bound region instantiationlcnr-1/+1
- `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased` - `replace_late_bound_regions_X` -> `instantiate_bound_regions_X`
2023-10-13Format all the let chains in compilerMichael Goulet-1/+3
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-6/+11
Removes a piece of mutable state. Follow up to #114578.
2023-07-17Do not fetch HIR in native_libs.Camille GILLOT-46/+34
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-1/+1