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

Force rlibs to be linked in whole for cdylib and bin #93791

Closed
wants to merge 2 commits into from

Conversation

nbdd0121
Copy link
Contributor

@nbdd0121 nbdd0121 commented Feb 9, 2022

Fix #50007 and #47384

These issues are caused by the fact that linker will perform archive member selection. By default, an object file in an archive won't be selected unless it is needed to satisfy an undefined reference. This step precedes any linker script and section GC. To address this issue, we can just the whole rlibs to be linked (this is --whole-archive for ELF targets).

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 9, 2022
@rust-highfive
Copy link
Collaborator

r? @oli-obk

(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 Feb 9, 2022
@rust-log-analyzer

This comment has been minimized.

@nico-abram
Copy link
Contributor

Would it make sense to only do this when #[no_mangle] or #[used] are actually used somewhere in the crate?

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Finished release [optimized] target(s) in 12.78s
Check compiletest suite=run-make-fulldeps mode=run-make (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 229 tests
..........i.ii....ii......................F......................................................... 100/229
.................i...................iiiiiii..F...i...................iii........................... 200/229
failures:
Some tests failed in compiletest suite=run-make-fulldeps mode=run-make host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu

---- [run-make] run-make-fulldeps/extern-fn-generic stdout ----
---- [run-make] run-make-fulldeps/extern-fn-generic stdout ----

error: make failed
status: exit status: 2
command: "make"
stdout:
------------------------------------------
cc -ffunction-sections -fdata-sections -fPIC -m64 -c -o /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/libtest.o test.c
ar crus /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/libtest.a /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/libtest.o
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic  testcrate.rs
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic  test.rs
rm /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/libtest.o
------------------------------------------
stderr:
------------------------------------------
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.0.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.1.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.10.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.2.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.3.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.4.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.5.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.6.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.7.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.8.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.test.b2d137c1-cgu.9.rcgu.o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test.2k7bs2fd4dv6n3lm.rcgu.o" "-Wl,--as-needed" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-ltest" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/libtestcrate.rlib" "-Wl,--no-whole-archive" "-Wl,--start-group" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-bd4d981d8a81bf84.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-f663e0e2fd3514d9.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-1ef813edcf034814.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-31cc24455faf05ae.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-37b6e6f45f0b8568.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-b69201f842c667b3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-4b7ad2ffd31eee24.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-8e2fa439c7cd8422.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-144ff24f90f4403f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-36a2845ff32ef6cb.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-15e079c738929d4a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-e2a2a36bc40170a2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-c3ea56044af7b95f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-af8cb4557e2888e2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-e998257ebeaf724f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-64320117df9543a5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-2deeba5fb4de62b0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-a2a7040fb9f918eb.rlib" "-Wl,--no-whole-archive" "-Wl,--end-group" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-89964d8ba43e75fe.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/test" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: /usr/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/libtestcrate.rlib(libtest.o): in function `call':
          test.c:(.text.call+0x0): multiple definition of `call'; /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/extern-fn-generic/extern-fn-generic/libtest.a(libtest.o):test.c:(.text.call+0x0): first defined here
          collect2: error: ld returned 1 exit status

error: aborting due to previous error


make: *** [Makefile:5: all] Error 1
------------------------------------------


---- [run-make] run-make-fulldeps/lto-no-link-whole-rlib stdout ----
---- [run-make] run-make-fulldeps/lto-no-link-whole-rlib stdout ----

error: make failed
status: exit status: 2
command: "make"
stdout:
------------------------------------------
cc -ffunction-sections -fdata-sections -fPIC -m64 -c -o /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/libfoo.o foo.c
ar crus /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/libfoo.a /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/libfoo.o
cc -ffunction-sections -fdata-sections -fPIC -m64 -c -o /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/libbar.o bar.c
ar crus /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/libbar.a /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/libbar.o
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib  lib1.rs
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib  lib2.rs
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib  main.rs -Clto
rm /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/libfoo.o /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/libbar.o
------------------------------------------
stderr:
------------------------------------------
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/main.main.cbcd4161-cgu.8.rcgu.o" "-Wl,--as-needed" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/rustcmQCOBd/liblib2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/rustcmQCOBd/liblib1.rlib" "-Wl,--no-whole-archive" "-Wl,--start-group" "-Wl,--end-group" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-89964d8ba43e75fe.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/main" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: /usr/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/rustcmQCOBd/liblib1.rlib(libfoo.o): in function `foo':
          foo.c:(.text.foo+0x0): multiple definition of `foo'; /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/lto-no-link-whole-rlib/lto-no-link-whole-rlib/rustcmQCOBd/liblib2.rlib(libbar.o):bar.c:(.text.foo+0x0): first defined here
          collect2: error: ld returned 1 exit status

error: aborting due to previous error


make: *** [Makefile:6: all] Error 1
------------------------------------------



@thomcc
Copy link
Member

thomcc commented Feb 9, 2022

Wow! It's great that #50007 is finally seeing a fix, after all this time!

Just to make sure, we still need #93718 in addition to this, right?

Would it make sense to only do this when #[no_mangle] or #[used] are actually used somewhere in the crate?

@nico-abram I could be wrong, but think it might be a little more complex than this, to handle the case where a #[no_mangle] symbol gets reexported?

@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Feb 9, 2022

From the test, it seems that the current behaviour is deliberately introduced in cc719d2 by @alexcrichton.

@petrochenkov petrochenkov self-assigned this Feb 9, 2022
@petrochenkov
Copy link
Contributor

I was planning to make an exactly opposite change in #85144, but it requires stabilizing the +whole-archive linking modifier (on which I plan to work soon), so I'm obviously against landing this.

@oli-obk oli-obk removed their assignment Feb 9, 2022
@petrochenkov
Copy link
Contributor

On a closer look, this PR doesn't touch native libs, only rlibs, so the linking modifiers that I've mentioned are somewhat orthogonal to this (but we can support similar linking modifiers for rlibs too).

However, including all symbols is still a huge overkill for fixing #50007 and #47384, those issues need to be addressed in some more selective way.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 9, 2022
@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Feb 9, 2022

On a closer look, this PR doesn't touch native libs, only rlibs, so the linking modifiers that I've mentioned are somewhat orthogonal to this (but we can support similar linking modifiers for rlibs too).

However, including all symbols is still a huge overkill for fixing #50007 and #47384, those issues need to be addressed in some more selective way.

What's your suggested alternative? In #85144 you said (for dylib) we are using symbol export list for this, but this is not sufficient: the exported symbol list is passed to LD using version script, but this wouldn't affect the symbol resolution. E.g. bar in the test case is included in the symbol export list, but it still wouldn't be included for linking since it's in an archive. The "global: bar;" in version script only means that bar should be global if it's being selected.

@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Feb 9, 2022

In my mental model, the artifact of each crate, being a compilation unit on its own, should be closer to a .o file than .a file. So I also think link rlibs as a whole should be the expected behaviour.

@petrochenkov
Copy link
Contributor

What's your suggested alternative?

Somehow mark only the #[used] symbols as needed.

@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Feb 9, 2022

Let's do a perf run to see how "overkill" is this change.

@petrochenkov
Copy link
Contributor

@bors try @rust-timer queue
Not sure whether perf-rlo already compares artifact sizes though.

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 10, 2022
@bors
Copy link
Contributor

bors commented Feb 10, 2022

⌛ Trying commit e760877 with merge f80eb827f9222fa2d5893442f376349408e73200...

@bors
Copy link
Contributor

bors commented Feb 10, 2022

☀️ Try build successful - checks-actions
Build commit: f80eb827f9222fa2d5893442f376349408e73200 (f80eb827f9222fa2d5893442f376349408e73200)

@rust-timer
Copy link
Collaborator

Queued f80eb827f9222fa2d5893442f376349408e73200 with parent e7aca89, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f80eb827f9222fa2d5893442f376349408e73200): comparison url.

Summary: This benchmark run shows 45 relevant regressions 😿 to instruction counts.

  • Average relevant regression: 1.8%
  • Largest regression in instruction counts: 12.2% on incr-unchanged builds of projection-caching debug

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 10, 2022
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2022
@JohnCSimon
Copy link
Member

ping from triage:
@nbdd0121
What is the status of this PR? I see a failing build test.

FYI: when a PR is ready for review, post a message containing
@rustbot ready to switch the PR to S-waiting-on-review so the PR appears in the reviewer's backlog.

@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Mar 8, 2022

Currently there is a disagreement about whether this should be done or not.

@petrochenkov
Copy link
Contributor

Closing in favor of #95604.

@nbdd0121 nbdd0121 deleted the used branch April 10, 2022 22:03
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 10, 2022
Generate synthetic object file to ensure all exported and used symbols participate in the linking

Fix rust-lang#50007 and rust-lang#47384

This is the synthetic object file approach that I described in rust-lang#95363 (comment), allowing all exported and used symbols to be linked while still allowing them to be GCed.

Related rust-lang#93791, rust-lang#95363

r? `@petrochenkov`
cc `@carbotaniuman`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 11, 2022
Generate synthetic object file to ensure all exported and used symbols participate in the linking

Fix rust-lang#50007 and rust-lang#47384

This is the synthetic object file approach that I described in rust-lang#95363 (comment), allowing all exported and used symbols to be linked while still allowing them to be GCed.

Related rust-lang#93791, rust-lang#95363

r? ``@petrochenkov``
cc ``@carbotaniuman``
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 11, 2022
Generate synthetic object file to ensure all exported and used symbols participate in the linking

Fix rust-lang#50007 and rust-lang#47384

This is the synthetic object file approach that I described in rust-lang#95363 (comment), allowing all exported and used symbols to be linked while still allowing them to be GCed.

Related rust-lang#93791, rust-lang#95363

r? ```@petrochenkov```
cc ```@carbotaniuman```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 17, 2022
Generate synthetic object file to ensure all exported and used symbols participate in the linking

Fix rust-lang#50007 and rust-lang#47384

This is the synthetic object file approach that I described in rust-lang#95363 (comment), allowing all exported and used symbols to be linked while still allowing them to be GCed.

Related rust-lang#93791, rust-lang#95363

r? `@petrochenkov`
cc `@carbotaniuman`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 18, 2022
Generate synthetic object file to ensure all exported and used symbols participate in the linking

Fix rust-lang#50007 and rust-lang#47384

This is the synthetic object file approach that I described in rust-lang#95363 (comment), allowing all exported and used symbols to be linked while still allowing them to be GCed.

Related rust-lang#93791, rust-lang#95363

r? `@petrochenkov`
cc `@carbotaniuman`
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 25, 2022
Generate synthetic object file to ensure all exported and used symbols participate in the linking

Fix rust-lang#50007 and rust-lang#47384

This is the synthetic object file approach that I described in rust-lang#95363 (comment), allowing all exported and used symbols to be linked while still allowing them to be GCed.

Related rust-lang#93791, rust-lang#95363

r? `@petrochenkov`
cc `@carbotaniuman`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

Compiling to Shared Library doesn't always expose reexported symbols