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

Rollup of 9 pull requests #108989

Closed
wants to merge 23 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

zertosh and others added 23 commits December 20, 2022 10:55
The `asm!` and `global_asm!` macros require their operands to appear
strictly in the following order:
- Template strings
- Positional operands
- Named operands
- Explicit register operands
- `clobber_abi`
- `options`

This is overly strict and can be inconvienent when building complex
`asm!` statements with macros. This PR relaxes the ordering requirements
as follows:
- Template strings must still come before all other operands.
- Positional operands must still come before named and explicit register
operands.
- Named and explicit register operands can be freely mixed.
- `options` and `clobber_abi` can appear in any position.
SymbolWrapper.cpp doesn't use std::optional or llvm::Optional, so this
patch removes the extraneous include.  Note that llvm/ADT/Optional.h
has been deprecated upstream.  This patch ensures that
SymbolWrapper.cpp continues to compile even after the upcoming removal
of Optional.h.
Relax ordering rules for `asm!` operands

The `asm!` and `global_asm!` macros require their operands to appear strictly in the following order:
- Template strings
- Positional operands
- Named operands
- Explicit register operands
- `clobber_abi`
- `options`

This is overly strict and can be inconvienent when building complex `asm!` statements with macros. This PR relaxes the ordering requirements as follows:
- Template strings must still come before all other operands.
- Positional operands must still come before named and explicit register operands.
- Named and explicit register operands can be freely mixed.
- `options` and `clobber_abi` can appear in any position after the template strings.

r? ``````@joshtriplett``````
…tr, r=dtolnay

Stabilize path_as_mut_os_str

Closes rust-lang#105021

r? ``@dtolnay``
…, r=pietroalbini

use problem matchers for tidy CI
…king, r=pnkfelix

Support linking to rust dylib with --crate-type staticlib

This allows for example dynamically linking libstd, while statically linking the user crate into an executable or C dynamic library. For this two unstable flags (`-Z staticlib-allow-rdylib-deps` and `-Z staticlib-prefer-dynamic`) are introduced. Without the former you get an error. The latter is the equivalent to `-C prefer-dynamic` for the staticlib crate type to indicate that dynamically linking is preferred when both options are available, like for libstd. Care must be taken to ensure that no crate ends up being merged into two distinct staticlibs that are linked together. Doing so will cause a linker error at best and undefined behavior at worst. In addition two distinct staticlibs compiled by different rustc may not be combined under any circumstances due to some rustc private symbols not being mangled.

To successfully link a staticlib, `--print native-static-libs` can be used while compiling to ask rustc for the linker flags necessary when linking the staticlib. This is an existing flag which previously only listed native libraries. It has been extended to list rust dylibs too. Trying to locate libstd yourself to link against it is not supported and may break if for example the libstd of multiple rustc versions are put in the same directory.

For an example on how to use this see the `src/test/run-make-fulldeps/staticlib-dylib-linkage/` test.
Stabilize movbe target feature

Almost all "old" x86 target features are stable.  As far as I can tell, these are the last two unstable features in the `x86-64-v2` or `x86-64-v3` microarchitecture levels, so I'm not sure if it was an oversight or if they're still unstable for a reason (see rust-lang#106323 for `f16c`).

Note that this only stabilizes the target features, and not the intrinsics.

cc ``@Amanieu``

r? ``@rust-lang/lang``
Add `--no-undefined-version` link flag and fix associated breakage

LLVM upstream sets `--no-undefined-version` by default in lld: https://reviews.llvm.org/D135402.

Due to a bug in how version scripts are generated, this breaks the `dylib` output type for most crates. See rust-lang#105967 (comment) for details.

This PR adds the flag to gcc flavor linkers in anticipation of this LLVM change rolling in, and patches `rustc` to not attempt to export `__rust_*` allocator symbols when they weren't generated.

Fixes rust-lang#105967
Remove an extraneous include

SymbolWrapper.cpp doesn't use std::optional or llvm::Optional, so this patch removes the extraneous include.  Note that llvm/ADT/Optional.h has been deprecated upstream.  This patch ensures that SymbolWrapper.cpp continues to compile even after the upcoming removal of Optional.h.
Document tool lints

Add brief doc comments for the internal tool lints so a summary can be seen without needing to open source code
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Mar 10, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Mar 10, 2023

📌 Commit 2dc5272 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 10, 2023
@bors
Copy link
Contributor

bors commented Mar 10, 2023

⌛ Testing commit 2dc5272 with merge 9c43306755ba4cc10e12c4a53daf1ef211762c6f...

@bors
Copy link
Contributor

bors commented Mar 10, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 10, 2023
@rust-log-analyzer
Copy link
Collaborator

The job i686-msvc-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
error: make failed
status: exit code: 2
command: "make"
--- stdout -------------------------------
make[1]: Entering directory '/d/a/rust/rust/tests/run-make-fulldeps/staticlib-dylib-linkage'
Some tests failed in compiletest suite=run-make-fulldeps mode=run-make host=i686-pc-windows-msvc target=i686-pc-windows-msvc
PATH="/d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage:D:\a\rust\rust\build\i686-pc-windows-msvc\stage2\bin:/c/Program Files (x86)/Windows Kits/10/bin/x64:/c/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x64:/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64:/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86:/d/a/rust/rust/build/i686-pc-windows-msvc/stage0-bootstrap-tools/i686-pc-windows-msvc/release/deps:/d/a/rust/rust/build/i686-pc-windows-msvc/stage0/bin:/d/a/rust/rust/ninja:/d/a/rust/rust/msys2/mingw32/bin:/c/hostedtoolcache/windows/Python/3.11.2/x64/Scripts:/c/hostedtoolcache/windows/Python/3.11.2/x64:/usr/bin:/d/a/rust/rust/sccache:/c/Program Files/MongoDB/Server/5.0/bin:/c/aliyun-cli:/c/vcpkg:/c/cf-cli:/c/Program Files (x86)/NSIS:/c/tools/zstd:/c/Program Files/Mercurial:/c/hostedtoolcache/windows/stack/2.9.3/x64:/c/cabal/bin:/c/ghcup/bin:/c/Program Files/dotnet:/c/mysql/bin:/c/Program Files/R/R-4.2.2/bin/x64:/c/SeleniumWebDrivers/GeckoDriver:/c/Program Files (x86)/sbt/bin:/c/Program Files (x86)/GitHub CLI:/c/Program Files/Git/bin:/c/Program Files (x86)/pipx_bin:/c/npm/prefix:/c/hostedtoolcache/windows/go/1.17.13/x64/bin:/c/hostedtoolcache/windows/Python/3.7.9/x64/Scripts:/c/hostedtoolcache/windows/Python/3.7.9/x64:/c/hostedtoolcache/windows/Ruby/2.5.9/x64/bin:/c/tools/kotlinc/bin:/c/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/8.0.362-9/x64/bin:/c/Program Files/ImageMagick-7.1.0-Q16-HDRI:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI2/wbin:/c/ProgramData/kind:/c/Program Files/Eclipse Foundation/jdk-8.0.302.8-hotspot/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/ProgramData/Chocolatey/bin:/c/Program Files/PowerShell/7:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/140/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/150/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/160/DTS/Binn:/c/Program Files/OpenSSL/bin:/c/Strawberry/c/bin:/c/Strawberry/perl/site/bin:/c/Strawberry/perl/bin:/c/ProgramData/chocolatey/lib/pulumi/tools/Pulumi/bin:/c/Program Files/TortoiseSVN/bin:/c/Program Files/CMake/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.8.7/bin:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/nodejs:/c/Program Files/Git/cmd:/c/Program Files/Git/mingw64/bin:/c/Program Files/Git/usr/bin:/c/Program Files/GitHub CLI:/c/tools/php:/c/Program Files (x86)/sbt/bin:/c/SeleniumWebDrivers/ChromeDriver:/c/SeleniumWebDrivers/EdgeDriver:/c/Program Files/Amazon/AWSCLIV2:/c/Program Files/Amazon/SessionManagerPlugin/bin:/c/Program Files/Amazon/AWSSAMCLI/bin:/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin:/c/Program Files (x86)/Microsoft BizTalk Server:/c/Program Files/LLVM/bin:/c/Users/runneradmin/.dotnet/tools:/c/Users/runneradmin/.cargo/bin:/c/Users/runneradmin/AppData/Local/Microsoft/WindowsApps" 'D:\a\rust\rust\build\i686-pc-windows-msvc\stage2\bin\rustc.exe' --out-dir /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage -L /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage  -C prefer-dynamic bar.rs
PATH="/d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage:D:\a\rust\rust\build\i686-pc-windows-msvc\stage2\bin:/c/Program Files (x86)/Windows Kits/10/bin/x64:/c/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x64:/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64:/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86:/d/a/rust/rust/build/i686-pc-windows-msvc/stage0-bootstrap-tools/i686-pc-windows-msvc/release/deps:/d/a/rust/rust/build/i686-pc-windows-msvc/stage0/bin:/d/a/rust/rust/ninja:/d/a/rust/rust/msys2/mingw32/bin:/c/hostedtoolcache/windows/Python/3.11.2/x64/Scripts:/c/hostedtoolcache/windows/Python/3.11.2/x64:/usr/bin:/d/a/rust/rust/sccache:/c/Program Files/MongoDB/Server/5.0/bin:/c/aliyun-cli:/c/vcpkg:/c/cf-cli:/c/Program Files (x86)/NSIS:/c/tools/zstd:/c/Program Files/Mercurial:/c/hostedtoolcache/windows/stack/2.9.3/x64:/c/cabal/bin:/c/ghcup/bin:/c/Program Files/dotnet:/c/mysql/bin:/c/Program Files/R/R-4.2.2/bin/x64:/c/SeleniumWebDrivers/GeckoDriver:/c/Program Files (x86)/sbt/bin:/c/Program Files (x86)/GitHub CLI:/c/Program Files/Git/bin:/c/Program Files (x86)/pipx_bin:/c/npm/prefix:/c/hostedtoolcache/windows/go/1.17.13/x64/bin:/c/hostedtoolcache/windows/Python/3.7.9/x64/Scripts:/c/hostedtoolcache/windows/Python/3.7.9/x64:/c/hostedtoolcache/windows/Ruby/2.5.9/x64/bin:/c/tools/kotlinc/bin:/c/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/8.0.362-9/x64/bin:/c/Program Files/ImageMagick-7.1.0-Q16-HDRI:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI2/wbin:/c/ProgramData/kind:/c/Program Files/Eclipse Foundation/jdk-8.0.302.8-hotspot/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/ProgramData/Chocolatey/bin:/c/Program Files/PowerShell/7:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/140/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/150/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/160/DTS/Binn:/c/Program Files/OpenSSL/bin:/c/Strawberry/c/bin:/c/Strawberry/perl/site/bin:/c/Strawberry/perl/bin:/c/ProgramData/chocolatey/lib/pulumi/tools/Pulumi/bin:/c/Program Files/TortoiseSVN/bin:/c/Program Files/CMake/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.8.7/bin:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/nodejs:/c/Program Files/Git/cmd:/c/Program Files/Git/mingw64/bin:/c/Program Files/Git/usr/bin:/c/Program Files/GitHub CLI:/c/tools/php:/c/Program Files (x86)/sbt/bin:/c/SeleniumWebDrivers/ChromeDriver:/c/SeleniumWebDrivers/EdgeDriver:/c/Program Files/Amazon/AWSCLIV2:/c/Program Files/Amazon/SessionManagerPlugin/bin:/c/Program Files/Amazon/AWSSAMCLI/bin:/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin:/c/Program Files (x86)/Microsoft BizTalk Server:/c/Program Files/LLVM/bin:/c/Users/runneradmin/.dotnet/tools:/c/Users/runneradmin/.cargo/bin:/c/Users/runneradmin/AppData/Local/Microsoft/WindowsApps" 'D:\a\rust\rust\build\i686-pc-windows-msvc\stage2\bin\rustc.exe' --out-dir /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage -L /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage  foo.rs --crate-type staticlib --print native-static-libs \
 -Z staticlib-allow-rdylib-deps 2>&1 | grep 'note: native-static-libs: ' \
 | sed 's/note: native-static-libs: \(.*\)/\1/' > /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage/libs.txt
cat /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage/libs.txt
/LIBPATH:D:\a\rust\rust\build\i686-pc-windows-msvc\test\run-make-fulldeps\staticlib-dylib-linkage\staticlib-dylib-linkage bar.dll.lib /LIBPATH:D:\a\rust\rust\build\i686-pc-windows-msvc\stage2\lib\rustlib\i686-pc-windows-msvc\lib std-cd9b1bbd15237c39.dll.lib
'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x86\cl.exe' -nologo -MT -Brepro  foo.c /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage/foo.lib -Fe:`cygpath -w /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage/foo.exe` -Fo:`cygpath -w /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage/foo.obj` /link $(cat /d/a/rust/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/staticlib-dylib-linkage/staticlib-dylib-linkage/libs.txt)
foo.c
LINK : fatal error LNK1181: cannot open input file 'C:\msys64\link.obj'
make[1]: Leaving directory '/d/a/rust/rust/tests/run-make-fulldeps/staticlib-dylib-linkage'
--- stderr -------------------------------
--- stderr -------------------------------
cl : Command line warning D9002 : ignoring unknown option '/LIBPATH:D:\a\rust\rust\build\i686-pc-windows-msvc\test\run-make-fulldeps\staticlib-dylib-linkage\staticlib-dylib-linkage'
cl : Command line warning D9002 : ignoring unknown option '/LIBPATH:D:\a\rust\rust\build\i686-pc-windows-msvc\stage2\lib\rustlib\i686-pc-windows-msvc\lib'
cl : Command line warning D9024 : unrecognized source file type 'C:/msys64/link', object file assumed
make[1]: *** [Makefile:7: all] Error 2



failures:
failures:
    [run-make] tests\run-make-fulldeps\staticlib-dylib-linkage

test result: FAILED. 179 passed; 1 failed; 51 ignored; 0 measured; 0 filtered out; finished in 52.48s

Build completed unsuccessfully in 1:04:33
make: *** [Makefile:68: ci-subset-1] Error 1

@matthiaskrgr matthiaskrgr deleted the rollup-tum513y branch March 16, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.