From 3d65b0545ee8446d8069a39ae3c29fdb9798ab58 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 26 Sep 2021 14:17:49 -0700 Subject: [PATCH 1/3] Try __libc_ symbol prefix --- impl/src/linker.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/impl/src/linker.rs b/impl/src/linker.rs index fc0c97e..5ad2151 100644 --- a/impl/src/linker.rs +++ b/impl/src/linker.rs @@ -2,31 +2,33 @@ pub mod linux { use syn::Ident; pub fn section(ident: &Ident) -> String { - format!("linkme_{}", ident) + format!("__libc_{}", ident) } pub fn section_start(ident: &Ident) -> String { - format!("__start_linkme_{}", ident) + format!("__start___libc_{}", ident) } pub fn section_stop(ident: &Ident) -> String { - format!("__stop_linkme_{}", ident) + format!("__stop___libc_{}", ident) } } pub mod macos { use syn::Ident; + // __libc_ prefix: see https://github.com/dtolnay/linkme/issues/41. This + // makes recent versions of lld recognize the symbol as retained. pub fn section(ident: &Ident) -> String { - format!("__DATA,__linkme{}", crate::hash(ident)) + format!("__DATA,__libc_{}", crate::hash(ident)) } pub fn section_start(ident: &Ident) -> String { - format!("\x01section$start$__DATA$__linkme{}", crate::hash(ident)) + format!("\x01section$start$__DATA$__libc_{}", crate::hash(ident)) } pub fn section_stop(ident: &Ident) -> String { - format!("\x01section$end$__DATA$__linkme{}", crate::hash(ident)) + format!("\x01section$end$__DATA$__libc_{}", crate::hash(ident)) } } From 9c96a8673cff2fff8c0342de52a05eab5e723caf Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 26 Sep 2021 14:18:40 -0700 Subject: [PATCH 2/3] Revert "Ignore Cortex-M job failure for now" This reverts commit 289f5b10306ac1a7331116af3c541572ca9a34e4. --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4543a27..7804688 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,8 +59,6 @@ jobs: sudo apt-get install -y qemu-system-arm - run: cargo run --release working-directory: tests/cortex - # https://github.com/dtolnay/linkme/issues/40 - continue-on-error: true clippy: name: Clippy From 0be20bbca65ed615aa8368f6d320591b3fd913da Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 26 Sep 2021 14:18:45 -0700 Subject: [PATCH 3/3] Revert "Ignore macOS job" This reverts commit 3d94f970f5ddbdf9e33a58cfbf8ad28f029290ca. --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7804688..adf5165 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,11 +31,10 @@ jobs: toolchain: ${{matrix.rust}} - run: cargo check --manifest-path tests/crate/Cargo.toml - run: cargo test - # macos: https://github.com/dtolnay/linkme/issues/41 - # windows-gnu: https://github.com/dtolnay/linkme/issues/25 - continue-on-error: ${{matrix.os == 'macos' || matrix.rust == 'nightly-x86_64-pc-windows-gnu'}} + # https://github.com/dtolnay/linkme/issues/25 + continue-on-error: ${{matrix.rust == 'nightly-x86_64-pc-windows-gnu'}} - run: cargo test --release - continue-on-error: ${{matrix.os == 'macos' || matrix.rust == 'nightly-x86_64-pc-windows-gnu'}} + continue-on-error: ${{matrix.rust == 'nightly-x86_64-pc-windows-gnu'}} msrv: name: Rust 1.31.0