Skip to content

target arm64e-apple-darwin removing functions #131811

Closed
@ds-ep

Description

@ds-ep

I tried this code:

use ctor::ctor;

#[ctor]
fn testAAAA() {
    println!("TEST123");
    panic!();
}

pub fn test123() {
    println!("TEST123");
}

I expected to see this happen:
without specifying a target everything works fine (using cargo +nightly build)

Instead, this happened:
when i specify arm64e-apple-darwin (using: cargo +nightly build -Z build-std --target arm64e-apple-darwin) my function seems to be removed.

compiling both as dylib

Meta

rustc --version --verbose:

binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: aarch64-apple-darwin
release: 1.81.0
LLVM version: 18.1.7

From aarch64-apple-darwin build in ghidra
Image
whereas on the arm64e build there is no functions at all :|
Image

CC @arttet

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions