diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a577c2eed71..52f94dc2970 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,15 +72,10 @@ jobs: git config --global user.name "User" ./y.sh prepare - - name: Add more failing tests because of undefined symbol errors (FIXME) - run: cat tests/failing-lto-tests.txt >> tests/failing-ui-tests.txt - - name: Run tests run: | # FIXME(antoyo): we cannot enable LTO for stdarch tests currently because of some failing LTO tests using proc-macros. - # FIXME(antoyo): this should probably not be needed since we embed the LTO bitcode. - printf '[profile.release]\nlto = "fat"\n' >> build/build_sysroot/sysroot_src/library/Cargo.toml - ./y.sh test --release --clean --release-sysroot --build-sysroot --keep-lto-tests ${{ matrix.commands }} + CG_RUSTFLAGS="-Cembed-bitcode=yes" ./y.sh test --release --clean --release-sysroot --build-sysroot --keep-lto-tests ${{ matrix.commands }} - name: LTO test run: | @@ -99,7 +94,7 @@ jobs: ar rcs libadd.a add.o popd - EMBED_LTO_BITCODE=1 CHANNEL="release" CG_RUSTFLAGS="-L native=. -Clinker-plugin-lto -Clinker=gcc" ./y.sh cargo build --release --manifest-path tests/cross_lang_lto/Cargo.toml + CHANNEL="release" CG_RUSTFLAGS="-L native=. -Clinker-plugin-lto -Clinker=gcc" ./y.sh cargo build --release --manifest-path tests/cross_lang_lto/Cargo.toml call_found=$(objdump -dj .text tests/cross_lang_lto/target/release/cross_lang_lto | grep -c "call .*my_add" ) ||: if [ $call_found -gt 0 ]; then echo "ERROR: call my_add found in asm" diff --git a/src/back/write.rs b/src/back/write.rs index 9f3ac6f682e..b654b34992c 100644 --- a/src/back/write.rs +++ b/src/back/write.rs @@ -59,8 +59,6 @@ pub(crate) fn codegen( if lto_supported { context.add_command_line_option("-flto=auto"); context.add_command_line_option("-flto-partition=one"); - // TODO(antoyo): remove since we don't want fat objects when it is for Bitcode only. - context.add_command_line_option("-ffat-lto-objects"); } context .compile_to_file(OutputKind::ObjectFile, bc_out.to_str().expect("path to str")); diff --git a/tests/cross_lang_lto/src/main.rs b/tests/cross_lang_lto/src/main.rs index a7180b33396..3c64248ba2a 100644 --- a/tests/cross_lang_lto/src/main.rs +++ b/tests/cross_lang_lto/src/main.rs @@ -4,7 +4,7 @@ * ar rcs libadd.a add.o * * Compile the Rust code with: - * EMBED_LTO_BITCODE=1 CG_RUSTFLAGS="-L native=. -Clinker-plugin-lto -Clinker=gcc" y cargo run --release + * CG_RUSTFLAGS="-L native=. -Clinker-plugin-lto -Clinker=gcc" y cargo run --release */ #[link(name="add")] diff --git a/tests/failing-lto-tests.txt b/tests/failing-lto-tests.txt deleted file mode 100644 index bf0633f7320..00000000000 --- a/tests/failing-lto-tests.txt +++ /dev/null @@ -1,33 +0,0 @@ -tests/ui/lint/unsafe_code/forge_unsafe_block.rs -tests/ui/lint/unused-qualification-in-derive-expansion.rs -tests/ui/macros/macro-quote-test.rs -tests/ui/macros/proc_macro.rs -tests/ui/panic-runtime/lto-unwind.rs -tests/ui/resolve/derive-macro-1.rs -tests/ui/resolve/derive-macro-2.rs -tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs -tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs -tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs -tests/ui/rust-2018/suggestions-not-always-applicable.rs -tests/ui/rust-2021/reserved-prefixes-via-macro.rs -tests/ui/underscore-imports/duplicate.rs -tests/ui/async-await/issues/issue-60674.rs -tests/ui/attributes/main-removed-2/main.rs -tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs -tests/ui/crate-loading/cross-compiled-proc-macro.rs -tests/ui/derives/derive-marker-tricky.rs -tests/ui/diagnostic_namespace/existing_proc_macros.rs -tests/ui/fmt/format-args-capture-issue-106408.rs -tests/ui/fmt/indoc-issue-106408.rs -tests/ui/hygiene/issue-77523-def-site-async-await.rs -tests/ui/inherent-impls-overlap-check/no-overlap.rs -tests/ui/enum-discriminant/issue-46519.rs -tests/ui/issues/issue-45731.rs -tests/ui/lint/test-allow-dead-extern-static-no-warning.rs -tests/ui/macros/macro-comma-behavior-rpass.rs -tests/ui/macros/rfc-2011-nicer-assert-messages/assert-with-custom-errors-does-not-create-unnecessary-code.rs -tests/ui/macros/rfc-2011-nicer-assert-messages/feature-gate-generic_assert.rs -tests/ui/macros/stringify.rs -tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test.rs -tests/ui/binding/fn-arg-incomplete-pattern-drop-order.rs -tests/ui/lto/debuginfo-lto-alloc.rs