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

For dylib crates, warn about GNU ld <=2.28 #66839

Conversation

pnkfelix
Copy link
Member

This is a heuristic diagnostic to try to help prevent issues related to issue #61539.

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 28, 2019
@pnkfelix
Copy link
Member Author

We may well not want to do this. (We might be better off just closing #61539 at this point.)

@pnkfelix
Copy link
Member Author

cc @eddyb @nagisa

@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 28, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-28T14:21:17.8910430Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-28T14:21:17.8926157Z ##[command]git config gc.auto 0
2019-11-28T14:21:17.8928491Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-28T14:21:17.8931887Z ##[command]git config --get-all http.proxy
2019-11-28T14:21:17.8934909Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66839/merge:refs/remotes/pull/66839/merge
---
2019-11-28T14:50:33.1530066Z    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
2019-11-28T14:50:33.3079075Z    Compiling backtrace v0.3.40
2019-11-28T14:50:33.8524522Z    Compiling rustc-std-workspace-alloc v1.99.0 (/checkout/src/tools/rustc-std-workspace-alloc)
2019-11-28T14:50:34.0492935Z    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
2019-11-28T14:50:53.7900806Z warning: Linker version inspection failed to parse: `"cc" "cc" "-v" "-Xlinker" "--version"`, output: GNU ld (GNU Binutils for Ubuntu) 2.26.1
2019-11-28T14:50:53.7900956Z Copyright (C) 2015 Free Software Foundation, Inc.
2019-11-28T14:50:53.7901056Z This program is free software; you may redistribute it under the terms of
2019-11-28T14:50:53.7901297Z the GNU General Public License version 3 or (at your option) a later version.
2019-11-28T14:50:53.7901356Z This program has absolutely no warranty.
2019-11-28T14:50:53.7901643Z 
2019-11-28T14:50:53.9717872Z    Compiling rustc-std-workspace-std v1.99.0 (/checkout/src/tools/rustc-std-workspace-std)
2019-11-28T14:50:53.9751771Z    Compiling term v0.0.0 (/checkout/src/libterm)
2019-11-28T14:50:54.0231012Z    Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
2019-11-28T14:50:54.0231012Z    Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
2019-11-28T14:50:59.0934500Z    Compiling unicode-width v0.1.6
2019-11-28T14:50:59.2029049Z    Compiling getopts v0.2.21
2019-11-28T14:51:08.0367216Z    Compiling test v0.0.0 (/checkout/src/libtest)
2019-11-28T14:51:20.1803238Z warning: Linker version inspection failed to parse: `"cc" "cc" "-v" "-Xlinker" "--version"`, output: GNU ld (GNU Binutils for Ubuntu) 2.26.1
2019-11-28T14:51:20.1804730Z Copyright (C) 2015 Free Software Foundation, Inc.
2019-11-28T14:51:20.1805160Z This program is free software; you may redistribute it under the terms of
2019-11-28T14:51:20.1805445Z the GNU General Public License version 3 or (at your option) a later version.
2019-11-28T14:51:20.1805686Z This program has absolutely no warranty.
2019-11-28T14:51:20.1806536Z 
2019-11-28T14:51:20.2737046Z     Finished release [optimized] target(s) in 1m 16s
2019-11-28T14:51:20.2889028Z Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
2019-11-28T14:51:20.2910965Z Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
2019-11-28T14:53:24.5175160Z    Compiling rustc-rayon v0.3.0
2019-11-28T14:53:29.2148474Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2019-11-28T14:53:33.2642497Z    Compiling arena v0.0.0 (/checkout/src/libarena)
2019-11-28T14:53:35.9232978Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2019-11-28T14:53:48.2851903Z warning: Linker version inspection failed to parse: `"cc" "cc" "-v" "-Xlinker" "--version"`, output: GNU ld (GNU Binutils for Ubuntu) 2.26.1
2019-11-28T14:53:48.2852050Z Copyright (C) 2015 Free Software Foundation, Inc.
2019-11-28T14:53:48.2852112Z This program is free software; you may redistribute it under the terms of
2019-11-28T14:53:48.2859553Z the GNU General Public License version 3 or (at your option) a later version.
2019-11-28T14:53:48.2859611Z This program has absolutely no warranty.
2019-11-28T14:53:48.2865759Z 
2019-11-28T14:53:48.7478744Z    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
2019-11-28T14:53:50.6093385Z    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
2019-11-28T14:54:15.3845868Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
---
2019-11-28T15:12:40.9390704Z    Compiling rustc_resolve v0.0.0 (/checkout/src/librustc_resolve)
2019-11-28T15:13:08.1215926Z    Compiling rustc_plugin_impl v0.0.0 (/checkout/src/librustc_plugin_impl)
2019-11-28T15:13:23.3379616Z    Compiling rustc_codegen_ssa v0.0.0 (/checkout/src/librustc_codegen_ssa)
2019-11-28T15:13:56.5690804Z    Compiling rustc_save_analysis v0.0.0 (/checkout/src/librustc_save_analysis)
2019-11-28T15:15:43.3950094Z warning: Linker version inspection failed to parse: `"cc" "cc" "-v" "-Xlinker" "--version"`, output: GNU ld (GNU Binutils for Ubuntu) 2.26.1
2019-11-28T15:15:43.3951009Z Copyright (C) 2015 Free Software Foundation, Inc.
2019-11-28T15:15:43.3951238Z This program is free software; you may redistribute it under the terms of
2019-11-28T15:15:43.3951448Z the GNU General Public License version 3 or (at your option) a later version.
2019-11-28T15:15:43.3951617Z This program has absolutely no warranty.
2019-11-28T15:15:43.3952260Z 
2019-11-28T15:15:51.6535860Z    Compiling rustc-main v0.0.0 (/checkout/src/rustc)
2019-11-28T15:15:51.9025577Z     Finished release [optimized] target(s) in 24m 31s
2019-11-28T15:15:51.9663695Z Copying stage1 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
2019-11-28T15:15:51.9663695Z Copying stage1 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
2019-11-28T15:15:51.9706849Z Building stage1 codegen artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu, llvm)
2019-11-28T15:15:52.4256704Z    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
2019-11-28T15:15:52.4261902Z    Compiling cc v1.0.47
2019-11-28T15:15:54.3371128Z    Compiling rustc_codegen_llvm v0.0.0 (/checkout/src/librustc_codegen_llvm)
2019-11-28T15:15:58.7395980Z    Compiling rustc_llvm v0.0.0 (/checkout/src/librustc_llvm)
2019-11-28T15:17:15.0529433Z warning: Linker version inspection failed to parse: `"cc" "cc" "-v" "-Xlinker" "--version"`, output: GNU ld (GNU Binutils for Ubuntu) 2.26.1
2019-11-28T15:17:15.0530178Z Copyright (C) 2015 Free Software Foundation, Inc.
2019-11-28T15:17:15.0530358Z This program is free software; you may redistribute it under the terms of
2019-11-28T15:17:15.0530566Z the GNU General Public License version 3 or (at your option) a later version.
2019-11-28T15:17:15.0530712Z This program has absolutely no warranty.
2019-11-28T15:17:15.0534864Z 
2019-11-28T15:17:16.2878179Z     Finished release [optimized] target(s) in 1m 24s
2019-11-28T15:17:16.2964027Z Assembling stage2 compiler (x86_64-unknown-linux-gnu)
2019-11-28T15:17:16.2986632Z Uplifting stage1 std (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
2019-11-28T15:20:55.4105936Z .................................................................................................... 1600/9303
2019-11-28T15:21:00.3541057Z .................................................................................................... 1700/9303
2019-11-28T15:21:13.1597802Z ...................................i................................................................ 1800/9303
2019-11-28T15:21:21.0123743Z .................................................................................................... 1900/9303
2019-11-28T15:21:34.8669197Z ....................iiiii........................................................................... 2000/9303
2019-11-28T15:21:45.0995109Z .................................................................................................... 2200/9303
2019-11-28T15:21:47.7232698Z .................................................................................................... 2300/9303
2019-11-28T15:21:52.7233703Z .................................................................................................... 2400/9303
2019-11-28T15:22:14.2969248Z .................................................................................................... 2500/9303
---
2019-11-28T15:24:57.5716183Z .....................i...............i.............................................................. 4800/9303
2019-11-28T15:25:08.2097814Z .................................................................................................... 4900/9303
2019-11-28T15:25:14.2310141Z .................................................................................................... 5000/9303
2019-11-28T15:25:22.8601372Z .................................................................................................... 5100/9303
2019-11-28T15:25:30.7299408Z ..........................ii.ii...........i......................................................... 5200/9303
2019-11-28T15:25:40.4769373Z .................................................................................................... 5400/9303
2019-11-28T15:25:51.9562943Z .................................................................................................... 5500/9303
2019-11-28T15:25:58.9732788Z ........i........................................................................................... 5600/9303
2019-11-28T15:26:05.5073325Z .................................................................................................... 5700/9303
2019-11-28T15:26:05.5073325Z .................................................................................................... 5700/9303
2019-11-28T15:26:16.3284918Z ..............................................................................................ii...i 5800/9303
2019-11-28T15:26:29.1804671Z ..ii...........i.................................................................................... 5900/9303
2019-11-28T15:26:46.5921314Z .................................................................................................... 6100/9303
2019-11-28T15:26:50.4161352Z .................................................................................................... 6200/9303
2019-11-28T15:26:50.4161352Z .................................................................................................... 6200/9303
2019-11-28T15:27:04.5453703Z .................i..ii.............................................................................. 6300/9303
2019-11-28T15:27:24.1585721Z .....................................................................................i.............. 6500/9303
2019-11-28T15:27:26.5978744Z .................................................................................................... 6600/9303
2019-11-28T15:27:28.9073463Z ............................................................................i....................... 6700/9303
2019-11-28T15:27:31.7442095Z .................................................................................................... 6800/9303
---
2019-11-28T15:32:24.7345020Z failures:
2019-11-28T15:32:24.7384642Z 
2019-11-28T15:32:24.7385361Z ---- [ui] ui/proc-macro/no-missing-docs.rs stdout ----
2019-11-28T15:32:24.7385609Z normalized stderr:
2019-11-28T15:32:24.7386515Z warning: Linker version inspection failed to parse: `"cc" "cc" "-v" "-Xlinker" "--version"`, output: GNU ld (GNU Binutils for Ubuntu) 2.26.1
2019-11-28T15:32:24.7386788Z Copyright (C) 2015 Free Software Foundation, Inc.
2019-11-28T15:32:24.7387251Z This program is free software; you may redistribute it under the terms of
2019-11-28T15:32:24.7387422Z the GNU General Public License version 3 or (at your option) a later version.
2019-11-28T15:32:24.7387612Z This program has absolutely no warranty.
2019-11-28T15:32:24.7387892Z 
2019-11-28T15:32:24.7388029Z 
2019-11-28T15:32:24.7388192Z 
2019-11-28T15:32:24.7388328Z 
2019-11-28T15:32:24.7388328Z 
2019-11-28T15:32:24.7388487Z The actual stderr differed from the expected stderr.
2019-11-28T15:32:24.7389038Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-missing-docs/no-missing-docs.stderr
2019-11-28T15:32:24.7389664Z To update references, rerun the tests and pass the `--bless` flag
2019-11-28T15:32:24.7390461Z To only update this specific test, also pass `--test-args proc-macro/no-missing-docs.rs`
2019-11-28T15:32:24.7390803Z error: 1 errors occurred comparing output.
2019-11-28T15:32:24.7390957Z status: exit code: 0
2019-11-28T15:32:24.7390957Z status: exit code: 0
2019-11-28T15:32:24.7391958Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/proc-macro/no-missing-docs.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-missing-docs" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-missing-docs/auxiliary" "-A" "unused"
2019-11-28T15:32:24.7392668Z ------------------------------------------
2019-11-28T15:32:24.7392866Z 
2019-11-28T15:32:24.7393262Z ------------------------------------------
2019-11-28T15:32:24.7393464Z stderr:
2019-11-28T15:32:24.7393464Z stderr:
2019-11-28T15:32:24.7393794Z ------------------------------------------
2019-11-28T15:32:24.7394271Z warning: Linker version inspection failed to parse: `"cc" "cc" "-v" "-Xlinker" "--version"`, output: GNU ld (GNU Binutils for Ubuntu) 2.26.1
2019-11-28T15:32:24.7394479Z Copyright (C) 2015 Free Software Foundation, Inc.
2019-11-28T15:32:24.7394634Z This program is free software; you may redistribute it under the terms of
2019-11-28T15:32:24.7394798Z the GNU General Public License version 3 or (at your option) a later version.
2019-11-28T15:32:24.7394940Z This program has absolutely no warranty.
2019-11-28T15:32:24.7395200Z 
2019-11-28T15:32:24.7395322Z 
2019-11-28T15:32:24.7395666Z ------------------------------------------
2019-11-28T15:32:24.7396907Z 
2019-11-28T15:32:24.7396907Z 
2019-11-28T15:32:24.7397119Z 
2019-11-28T15:32:24.7397626Z ---- [ui] ui/rust-2018/proc-macro-crate-in-paths.rs stdout ----
2019-11-28T15:32:24.7397845Z normalized stderr:
2019-11-28T15:32:24.7398370Z warning: Linker version inspection failed to parse: `"cc" "cc" "-v" "-Xlinker" "--version"`, output: GNU ld (GNU Binutils for Ubuntu) 2.26.1
2019-11-28T15:32:24.7398588Z Copyright (C) 2015 Free Software Foundation, Inc.
2019-11-28T15:32:24.7398769Z This program is free software; you may redistribute it under the terms of
2019-11-28T15:32:24.7398961Z the GNU General Public License version 3 or (at your option) a later version.
2019-11-28T15:32:24.7399124Z This program has absolutely no warranty.
2019-11-28T15:32:24.7399421Z 
2019-11-28T15:32:24.7399721Z 
2019-11-28T15:32:24.7400009Z 
2019-11-28T15:32:24.7400127Z 
2019-11-28T15:32:24.7400127Z 
2019-11-28T15:32:24.7400285Z The actual stderr differed from the expected stderr.
2019-11-28T15:32:24.7400735Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2018/proc-macro-crate-in-paths/proc-macro-crate-in-paths.stderr
2019-11-28T15:32:24.7401160Z To update references, rerun the tests and pass the `--bless` flag
2019-11-28T15:32:24.7401600Z To only update this specific test, also pass `--test-args rust-2018/proc-macro-crate-in-paths.rs`
2019-11-28T15:32:24.7402116Z error: 1 errors occurred comparing output.
2019-11-28T15:32:24.7403096Z status: exit code: 0
2019-11-28T15:32:24.7403096Z status: exit code: 0
2019-11-28T15:32:24.7403880Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/rust-2018/proc-macro-crate-in-paths.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2018/proc-macro-crate-in-paths" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2018/proc-macro-crate-in-paths/auxiliary" "-A" "unused"
2019-11-28T15:32:24.7404198Z ------------------------------------------
2019-11-28T15:32:24.7404245Z 
2019-11-28T15:32:24.7404439Z ------------------------------------------
2019-11-28T15:32:24.7404480Z stderr:
2019-11-28T15:32:24.7404480Z stderr:
2019-11-28T15:32:24.7404858Z ------------------------------------------
2019-11-28T15:32:24.7405316Z warning: Linker version inspection failed to parse: `"cc" "cc" "-v" "-Xlinker" "--version"`, output: GNU ld (GNU Binutils for Ubuntu) 2.26.1
2019-11-28T15:32:24.7405534Z Copyright (C) 2015 Free Software Foundation, Inc.
2019-11-28T15:32:24.7405600Z This program is free software; you may redistribute it under the terms of
2019-11-28T15:32:24.7405649Z the GNU General Public License version 3 or (at your option) a later version.
2019-11-28T15:32:24.7405694Z This program has absolutely no warranty.
2019-11-28T15:32:24.7405759Z 
2019-11-28T15:32:24.7405781Z 
2019-11-28T15:32:24.7406561Z ------------------------------------------
2019-11-28T15:32:24.7406601Z 
---
2019-11-28T15:32:24.7425420Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-28T15:32:24.7425491Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-28T15:32:24.7445002Z 
2019-11-28T15:32:24.7445090Z 
2019-11-28T15:32:24.7447312Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-28T15:32:24.7447601Z 
2019-11-28T15:32:24.7447631Z 
2019-11-28T15:32:24.7453359Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-28T15:32:24.7453426Z Build completed unsuccessfully in 1:05:03
2019-11-28T15:32:24.7453426Z Build completed unsuccessfully in 1:05:03
2019-11-28T15:32:24.7507186Z == clock drift check ==
2019-11-28T15:32:24.7521016Z   local time: Thu Nov 28 15:32:24 UTC 2019
2019-11-28T15:32:25.0302445Z   network time: Thu, 28 Nov 2019 15:32:25 GMT
2019-11-28T15:32:25.0302597Z == end clock drift check ==
2019-11-28T15:32:25.8527677Z 
2019-11-28T15:32:25.8659128Z ##[error]Bash exited with code '1'.
2019-11-28T15:32:25.8695006Z ##[section]Starting: Checkout
2019-11-28T15:32:25.8697295Z ==============================================================================
2019-11-28T15:32:25.8697354Z Task         : Get sources
2019-11-28T15:32:25.8697417Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@eddyb
Copy link
Member

eddyb commented Nov 28, 2019

We may well not want to do this. (We might be better off just closing #61539 at this point.)

I definitely feel weird not having implemented something like this soon after opening #61539 (but I don't remember the context very well, I think it was low priority for me, someone having stumbled over it by doing very unstable proc macro manual loading).

I wish there was a https://caniuse.com but for the GNU/Linux ecosystem...

@alexcrichton
Copy link
Member

Could this also be sure to not do any detection unless something goes wrong? This sort of version detection can be pretty expensive and it runs a risk of being added to all compilations by default (those calling the linker). Ideally the diagnostics could be improved but not at the cost of when the diagnostic doesn't fire

@eddyb
Copy link
Member

eddyb commented Nov 28, 2019

@alexcrichton The problem is that it goes wrong when you go to dlopen the .so.
I guess dylib crates are rare, but on the other hand, proc-macro crates aren't.

Then again, it's very unstable to dlopen a proc-macro crate manually, and when rustc does it, I don't think the issue can occur (but my memory is a bit fuzzy on this).

@pnkfelix
Copy link
Member Author

pnkfelix commented Nov 29, 2019

@eddyb wasn't the problem originally exposed by a proc-macro crate, in #60593 ? Does that not contradict your claim that "it's very unstable to dlopen a proc-macro crate manually, and when rustc does it, I don't think the issue can occur"

(maybe there's some detail I'm missing, e.g. as outlined in #60593 (comment) ...?)

@pnkfelix
Copy link
Member Author

Ah, I overlooked this part of a comment from @eddyb from #60593:

Proc macros presumably work on nightly, and officially your usecase is not supported, ...

So maybe the answer is that yes, the problem can arise for proc-macros, but not in any usage state that we officially support, ...

... and therefore we could plausibly revise this PR to only warn about dylib crates alone, not proc-macro ones? Would that assuage @alexcrichton 's concerns about the execution time overhead here, given that we're trying to discourage people from using dylib in the first place anyway?

@eddyb
Copy link
Member

eddyb commented Nov 29, 2019

@eddyb wasn't the problem originally exposed by a proc-macro crate, in #60593 ?

That issue is what I'm referring to by "very unstable to dlopen a proc-macro crate manually" - that's what they're doing, using proc_macro::bridge to load a proc macro themselves, without using rustc.

Looking at the linked comment, I wrote:

I should also say that this cannot possibly happen within rustc, unless it expands a proc_macro::quote!(...) invocation (which is unstable) before a real proc macro.

So I guess there would be a scenario where rustc is handling the dlopen, but it's also unstable.

@pnkfelix
Copy link
Member Author

I wish there was a https://caniuse.com but for the GNU/Linux ecosystem...

Someone at my office did point me at the whohas tool as a way to query package versions with various distributions.

I tried running it to get a survey of what versions of ld are distributed, but the tool failed when querying a number of popular distributions (e.g. Arch Linux), so I wasn't able to get enough information to feel comfortable acting on it.

@tesuji
Copy link
Contributor

tesuji commented Nov 29, 2019

We could use https://repology.org/project/binutils/versions:
Packaging status

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-29T12:18:41.6008774Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-29T12:18:41.6024318Z ##[command]git config gc.auto 0
2019-11-29T12:18:41.6027744Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-29T12:18:41.6031400Z ##[command]git config --get-all http.proxy
2019-11-29T12:18:41.6037314Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66839/merge:refs/remotes/pull/66839/merge
---
2019-11-29T12:49:15.1706587Z    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
2019-11-29T12:49:15.3292875Z    Compiling backtrace v0.3.40
2019-11-29T12:49:15.9480437Z    Compiling rustc-std-workspace-alloc v1.99.0 (/checkout/src/tools/rustc-std-workspace-alloc)
2019-11-29T12:49:16.1266984Z    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
2019-11-29T12:49:36.6478120Z warning: Using linker `GNU ld (GNU Binutils for Ubuntu) 2.26.1` with Rust dynamic libraries has known bugs.
2019-11-29T12:49:36.6478553Z 
2019-11-29T12:49:36.6479088Z note: Consider upgrading to GNU ld version 2.29 or newer, or using a different linker.
2019-11-29T12:49:36.6479687Z 
2019-11-29T12:49:36.6480284Z note: For more information, see ***/issues/61539
2019-11-29T12:49:36.8396358Z    Compiling rustc-std-workspace-std v1.99.0 (/checkout/src/tools/rustc-std-workspace-std)
2019-11-29T12:49:36.8426849Z    Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
2019-11-29T12:49:36.8907564Z    Compiling term v0.0.0 (/checkout/src/libterm)
2019-11-29T12:49:42.2200387Z    Compiling unicode-width v0.1.6
2019-11-29T12:49:42.2200387Z    Compiling unicode-width v0.1.6
2019-11-29T12:49:42.3225054Z    Compiling getopts v0.2.21
2019-11-29T12:49:51.4529225Z    Compiling test v0.0.0 (/checkout/src/libtest)
2019-11-29T12:50:03.9019335Z warning: Using linker `GNU ld (GNU Binutils for Ubuntu) 2.26.1` with Rust dynamic libraries has known bugs.
2019-11-29T12:50:03.9020289Z 
2019-11-29T12:50:03.9021049Z note: Consider upgrading to GNU ld version 2.29 or newer, or using a different linker.
2019-11-29T12:50:03.9021390Z 
2019-11-29T12:50:03.9027048Z note: For more information, see ***/issues/61539
2019-11-29T12:50:03.9971396Z     Finished release [optimized] target(s) in 1m 19s
2019-11-29T12:50:04.0115556Z Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
2019-11-29T12:50:04.0136877Z Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-11-29T12:50:04.6035150Z    Compiling cfg-if v0.1.8
---
2019-11-29T12:52:13.3913595Z    Compiling rustc-rayon v0.3.0
2019-11-29T12:52:19.1824165Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2019-11-29T12:52:22.5339540Z    Compiling arena v0.0.0 (/checkout/src/libarena)
2019-11-29T12:52:24.9729125Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2019-11-29T12:52:38.0120284Z warning: Using linker `GNU ld (GNU Binutils for Ubuntu) 2.26.1` with Rust dynamic libraries has known bugs.
2019-11-29T12:52:38.0125807Z 
2019-11-29T12:52:38.0131610Z note: Consider upgrading to GNU ld version 2.29 or newer, or using a different linker.
2019-11-29T12:52:38.0133626Z 
2019-11-29T12:52:38.0134421Z note: For more information, see ***/issues/61539
2019-11-29T12:52:38.4963409Z    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
2019-11-29T12:52:40.4381536Z    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
2019-11-29T12:53:06.0891572Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2019-11-29T12:53:58.3155827Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
---
2019-11-29T13:12:00.2726898Z    Compiling rustc_plugin_impl v0.0.0 (/checkout/src/librustc_plugin_impl)
2019-11-29T13:12:16.1494540Z    Compiling rustc_resolve v0.0.0 (/checkout/src/librustc_resolve)
2019-11-29T13:12:42.4987207Z    Compiling rustc_codegen_ssa v0.0.0 (/checkout/src/librustc_codegen_ssa)
2019-11-29T13:13:35.8217795Z    Compiling rustc_save_analysis v0.0.0 (/checkout/src/librustc_save_analysis)
2019-11-29T13:15:16.9457816Z warning: Using linker `GNU ld (GNU Binutils for Ubuntu) 2.26.1` with Rust dynamic libraries has known bugs.
2019-11-29T13:15:16.9461458Z 
2019-11-29T13:15:16.9465872Z note: Consider upgrading to GNU ld version 2.29 or newer, or using a different linker.
2019-11-29T13:15:16.9469986Z 
2019-11-29T13:15:16.9470838Z note: For more information, see ***/issues/61539
2019-11-29T13:15:25.3497258Z    Compiling rustc-main v0.0.0 (/checkout/src/rustc)
2019-11-29T13:15:25.6122414Z     Finished release [optimized] target(s) in 25m 21s
2019-11-29T13:15:25.6666759Z Copying stage1 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
2019-11-29T13:15:25.6764172Z Building stage1 codegen artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu, llvm)
2019-11-29T13:15:25.6764172Z Building stage1 codegen artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu, llvm)
2019-11-29T13:15:26.0364259Z    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
2019-11-29T13:15:26.0370949Z    Compiling cc v1.0.47
2019-11-29T13:15:28.0549546Z    Compiling rustc_codegen_llvm v0.0.0 (/checkout/src/librustc_codegen_llvm)
2019-11-29T13:15:32.6172584Z    Compiling rustc_llvm v0.0.0 (/checkout/src/librustc_llvm)
2019-11-29T13:16:50.3135483Z warning: Using linker `GNU ld (GNU Binutils for Ubuntu) 2.26.1` with Rust dynamic libraries has known bugs.
2019-11-29T13:16:50.3140129Z 
2019-11-29T13:16:50.3141772Z note: Consider upgrading to GNU ld version 2.29 or newer, or using a different linker.
2019-11-29T13:16:50.3142123Z 
2019-11-29T13:16:50.3142790Z note: For more information, see ***/issues/61539
2019-11-29T13:16:51.6406368Z     Finished release [optimized] target(s) in 1m 25s
2019-11-29T13:16:51.6509468Z Assembling stage2 compiler (x86_64-unknown-linux-gnu)
2019-11-29T13:16:51.6547440Z Uplifting stage1 std (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-11-29T13:16:51.6548490Z Copying stage2 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-11-29T13:20:36.3676520Z .................................................................................................... 1600/9306
2019-11-29T13:20:41.3047599Z .................................................................................................... 1700/9306
2019-11-29T13:20:54.5834832Z ....................................i............................................................... 1800/9306
2019-11-29T13:21:02.5703720Z .................................................................................................... 1900/9306
2019-11-29T13:21:16.8428556Z .....................iiiii.......................................................................... 2000/9306
2019-11-29T13:21:27.4851742Z .................................................................................................... 2200/9306
2019-11-29T13:21:30.1215223Z .................................................................................................... 2300/9306
2019-11-29T13:21:35.1403784Z .................................................................................................... 2400/9306
2019-11-29T13:21:57.6455848Z .................................................................................................... 2500/9306
---
2019-11-29T13:24:45.7214808Z ......................i...............i............................................................. 4800/9306
2019-11-29T13:24:56.6047215Z .................................................................................................... 4900/9306
2019-11-29T13:25:02.7011037Z .................................................................................................... 5000/9306
2019-11-29T13:25:11.2243942Z .................................................................................................... 5100/9306
2019-11-29T13:25:19.1808689Z ...........................ii.ii...........i........................................................ 5200/9306
2019-11-29T13:25:29.1188824Z .................................................................................................... 5400/9306
2019-11-29T13:25:40.1236712Z .................................................................................................... 5500/9306
2019-11-29T13:25:47.5721476Z .........i.......................................................................................... 5600/9306
2019-11-29T13:25:54.2980193Z .................................................................................................... 5700/9306
2019-11-29T13:25:54.2980193Z .................................................................................................... 5700/9306
2019-11-29T13:26:05.5202758Z ...............................................................................................ii... 5800/9306
2019-11-29T13:26:18.6432869Z i...ii..........i................................................................................... 5900/9306
2019-11-29T13:26:37.6266916Z .................................................................................................... 6100/9306
2019-11-29T13:26:45.7117305Z .................................................................................................... 6200/9306
2019-11-29T13:26:45.7117305Z .................................................................................................... 6200/9306
2019-11-29T13:27:00.3793659Z ..................i..ii............................................................................. 6300/9306
2019-11-29T13:27:20.9427866Z ......................................................................................i............. 6500/9306
2019-11-29T13:27:23.3851599Z .................................................................................................... 6600/9306
2019-11-29T13:27:25.7884622Z .............................................................................i...................... 6700/9306
2019-11-29T13:27:28.6131222Z .................................................................................................... 6800/9306
---
2019-11-29T13:32:30.8985788Z failures:
2019-11-29T13:32:30.9032804Z 
2019-11-29T13:32:30.9034017Z ---- [ui] ui/proc-macro/no-missing-docs.rs stdout ----
2019-11-29T13:32:30.9034265Z normalized stderr:
2019-11-29T13:32:30.9034463Z warning: Using linker `GNU ld (GNU Binutils for Ubuntu) 2.26.1` with Rust dynamic libraries has known bugs.
2019-11-29T13:32:30.9034612Z 
2019-11-29T13:32:30.9034793Z note: Consider upgrading to GNU ld version 2.29 or newer, or using a different linker.
2019-11-29T13:32:30.9035099Z 
2019-11-29T13:32:30.9035580Z note: For more information, see ***/issues/61539
2019-11-29T13:32:30.9035849Z 
2019-11-29T13:32:30.9035975Z 
2019-11-29T13:32:30.9036080Z 
2019-11-29T13:32:30.9036206Z The actual stderr differed from the expected stderr.
2019-11-29T13:32:30.9036206Z The actual stderr differed from the expected stderr.
2019-11-29T13:32:30.9036631Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-missing-docs/no-missing-docs.stderr
2019-11-29T13:32:30.9037009Z To update references, rerun the tests and pass the `--bless` flag
2019-11-29T13:32:30.9037430Z To only update this specific test, also pass `--test-args proc-macro/no-missing-docs.rs`
2019-11-29T13:32:30.9037751Z error: 1 errors occurred comparing output.
2019-11-29T13:32:30.9037881Z status: exit code: 0
2019-11-29T13:32:30.9037881Z status: exit code: 0
2019-11-29T13:32:30.9038877Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/proc-macro/no-missing-docs.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-missing-docs" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/proc-macro/no-missing-docs/auxiliary" "-A" "unused"
2019-11-29T13:32:30.9039539Z ------------------------------------------
2019-11-29T13:32:30.9039694Z 
2019-11-29T13:32:30.9040046Z ------------------------------------------
2019-11-29T13:32:30.9040211Z stderr:
2019-11-29T13:32:30.9040211Z stderr:
2019-11-29T13:32:30.9040709Z ------------------------------------------
2019-11-29T13:32:30.9041804Z warning: Using linker `GNU ld (GNU Binutils for Ubuntu) 2.26.1` with Rust dynamic libraries has known bugs.
2019-11-29T13:32:30.9041993Z 
2019-11-29T13:32:30.9042165Z note: Consider upgrading to GNU ld version 2.29 or newer, or using a different linker.
2019-11-29T13:32:30.9042319Z 
2019-11-29T13:32:30.9042852Z note: For more information, see ***/issues/61539
2019-11-29T13:32:30.9043717Z 
2019-11-29T13:32:30.9044218Z ------------------------------------------
2019-11-29T13:32:30.9045316Z 
2019-11-29T13:32:30.9045354Z 
2019-11-29T13:32:30.9045354Z 
2019-11-29T13:32:30.9045659Z ---- [ui] ui/rust-2018/proc-macro-crate-in-paths.rs stdout ----
2019-11-29T13:32:30.9045705Z normalized stderr:
2019-11-29T13:32:30.9045752Z warning: Using linker `GNU ld (GNU Binutils for Ubuntu) 2.26.1` with Rust dynamic libraries has known bugs.
2019-11-29T13:32:30.9045799Z 
2019-11-29T13:32:30.9045842Z note: Consider upgrading to GNU ld version 2.29 or newer, or using a different linker.
2019-11-29T13:32:30.9045881Z 
2019-11-29T13:32:30.9046158Z note: For more information, see ***/issues/61539
2019-11-29T13:32:30.9046210Z 
2019-11-29T13:32:30.9046231Z 
2019-11-29T13:32:30.9046253Z 
2019-11-29T13:32:30.9046317Z The actual stderr differed from the expected stderr.
2019-11-29T13:32:30.9046317Z The actual stderr differed from the expected stderr.
2019-11-29T13:32:30.9046619Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2018/proc-macro-crate-in-paths/proc-macro-crate-in-paths.stderr
2019-11-29T13:32:30.9046990Z To update references, rerun the tests and pass the `--bless` flag
2019-11-29T13:32:30.9047272Z To only update this specific test, also pass `--test-args rust-2018/proc-macro-crate-in-paths.rs`
2019-11-29T13:32:30.9047344Z error: 1 errors occurred comparing output.
2019-11-29T13:32:30.9047402Z status: exit code: 0
2019-11-29T13:32:30.9047402Z status: exit code: 0
2019-11-29T13:32:30.9048088Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/rust-2018/proc-macro-crate-in-paths.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2018/proc-macro-crate-in-paths" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2018/proc-macro-crate-in-paths/auxiliary" "-A" "unused"
2019-11-29T13:32:30.9048398Z ------------------------------------------
2019-11-29T13:32:30.9048427Z 
2019-11-29T13:32:30.9048626Z ------------------------------------------
2019-11-29T13:32:30.9048685Z stderr:
2019-11-29T13:32:30.9048685Z stderr:
2019-11-29T13:32:30.9048885Z ------------------------------------------
2019-11-29T13:32:30.9048935Z warning: Using linker `GNU ld (GNU Binutils for Ubuntu) 2.26.1` with Rust dynamic libraries has known bugs.
2019-11-29T13:32:30.9048985Z 
2019-11-29T13:32:30.9049029Z note: Consider upgrading to GNU ld version 2.29 or newer, or using a different linker.
2019-11-29T13:32:30.9049065Z 
2019-11-29T13:32:30.9049338Z note: For more information, see ***/issues/61539
2019-11-29T13:32:30.9049391Z 
2019-11-29T13:32:30.9049721Z ------------------------------------------
2019-11-29T13:32:30.9049778Z 
2019-11-29T13:32:30.9049801Z 
---
2019-11-29T13:32:30.9069996Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-29T13:32:30.9070069Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-29T13:32:30.9084244Z 
2019-11-29T13:32:30.9084420Z 
2019-11-29T13:32:30.9089423Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-29T13:32:30.9089664Z 
2019-11-29T13:32:30.9089689Z 
2019-11-29T13:32:30.9100644Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-29T13:32:30.9101161Z Build completed unsuccessfully in 1:07:35
2019-11-29T13:32:30.9101161Z Build completed unsuccessfully in 1:07:35
2019-11-29T13:32:30.9158013Z == clock drift check ==
2019-11-29T13:32:30.9173999Z   local time: Fri Nov 29 13:32:30 UTC 2019
2019-11-29T13:32:31.1963427Z   network time: Fri, 29 Nov 2019 13:32:31 GMT
2019-11-29T13:32:31.1968168Z == end clock drift check ==
2019-11-29T13:32:32.0637991Z 
2019-11-29T13:32:32.0749734Z ##[error]Bash exited with code '1'.
2019-11-29T13:32:32.0790285Z ##[section]Starting: Checkout
2019-11-29T13:32:32.0793206Z ==============================================================================
2019-11-29T13:32:32.0793269Z Task         : Get sources
2019-11-29T13:32:32.0793335Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexcrichton
Copy link
Member

@eddyb ah ok. I guess I basically just wanted to point out then that this is going to add a cost to all compilations which invoke the linker, and a relatively nontrivial cost. I also suspect that almost all compilations will not actually run into this issue, so it may or may not be worth having a warning specifically for this.

@pnkfelix
Copy link
Member Author

pnkfelix commented Dec 4, 2019

@eddyb ah ok. I guess I basically just wanted to point out then that this is going to add a cost to all compilations which invoke the linker, and a relatively nontrivial cost. I also suspect that almost all compilations will not actually run into this issue, so it may or may not be worth having a warning specifically for this.

Its not meant to be run on all compilations that invoke the linker. (But maybe that was just hyperbole on your part?)

As originally drafted, I meant for it to run on just compilations of dylib or proc-macro crates.

Based on the conversation with @eddyb, I am inclined to further restrict it to just dylib, and let the proc-macro case just be dropped.

But I will admit it is possible that even restricting it to dylib is more cost than we want to bear?

@pnkfelix pnkfelix force-pushed the issue-61539-hack-warn-prior-to-ld-version-2.29 branch from d8c2fb9 to 6644747 Compare December 4, 2019 14:05
…han assuming it starts with "GNU ld version "
…e check.

(The first version of the PR had this implicitly by always searching for the
string literal "GNU ld version " when looking for where to start the search for
the version number.)
@pnkfelix pnkfelix force-pushed the issue-61539-hack-warn-prior-to-ld-version-2.29 branch from 6644747 to c4a76c4 Compare December 4, 2019 14:13
@pnkfelix pnkfelix changed the title For dylib/proc-macro crates, warn about GNU ld <=2.28 For dylib crates, warn about GNU ld <=2.28 Dec 4, 2019
@alexcrichton
Copy link
Member

If this is restricted to just dylib that seems reasonable to me, that's a pretty rare crate type. I do think though that our test suite generates a huge amount of dylib crates, so we may want to be on the lookout for any slowdown regressions there.

@matthewjasper
Copy link
Contributor

r? @alexcrichton

@alexcrichton
Copy link
Member

I'm unfortunately probably not the best reviewer for this. I personally don't think that rustc should be doing any verison checking at all, in my opinion it's far too low-level of a tool to do so. I also have basically no understanding of what this bug is or what this has to do with a linker, so I think I'm not necssarily qualified to review the intention of the PR either.

@eddyb would you be willing to review this?

@eddyb
Copy link
Member

eddyb commented Dec 9, 2019

I also have basically no understanding of what this bug is or what this has to do with a linker

Some GNU ld versions have a bug that makes them incompatible with the post-#54592 "no PLT" world. However, most things work, just not some situations where an executable loads a dylib/proc_macro crate's .so as a "plugin" and there is a statically linked crate duplicated in both of them.

I'm also unsure we should land this. The benefits appear to be marginal, I don't think we've seen a bug report other than manually loading proc macros through very unstable internal implementation details.

@alexcrichton
Copy link
Member

Ah unfortunately while that describes the bug at a high level I still don't really understand what all is in play here. I don't know, for example, how our usage of the PLT changed over time, how this is running afoul of a linker bug, what possible solutions would be, etc. Sounds like you do though! I'll go ahead and...

r? @eddyb

@alexcrichton alexcrichton reopened this Dec 9, 2019
@alexcrichton
Copy link
Member

er oops...

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned alexcrichton Dec 9, 2019
@eddyb
Copy link
Member

eddyb commented Dec 9, 2019

I don't think we figured out what commit actually fixed that bug though, just that it was at some point between 2.28 and 2.29, IIRC.

r? @nagisa

@rust-highfive rust-highfive assigned nagisa and unassigned eddyb Dec 9, 2019
@pnkfelix
Copy link
Member Author

based on above comment with data on the ld versions in use in current channels of popular distributions, I am tempted to just close this PR...

@pnkfelix
Copy link
Member Author

Okay well I made the effort but I don't think there is general interest in landing this lint at this time. . . closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants