Skip to content

Stop exporting amain for android. #10875

Closed

Description

@ILyoan

rustc exports amain when build library for android to provide an start point that initiate rust runtime.
Now we have start_on_main_thread exported publicaly, a rust library is able to provide an entry function without amain hack .

#[no_mangle]
pub extern fn entry(argc: int, argv: **u8) -> int {
    do std::rt::start_on_main_thread(argc, argv) {
        // do what you want.
    }
}

Thus I don't think we need amain hack any longer.

Activity

  1. ILyoan commented on Dec 9, 2013

    @ILyoan
    ContributorAuthor

    Related to #4404

  2. alexcrichton commented on Dec 10, 2013

    @alexcrichton
    Member

    Does this also mean that we could remove the logic of sometimes naming the entry point main and sometimes amain?

  3. ILyoan commented on Dec 11, 2013

    @ILyoan
    ContributorAuthor

    @alexcrichton Yes.
    I don't think android libraries need an entry point to start runtime at all. we can remove all related code tagged as "FIXME #4404"

  4. added a commit that references this issue on Jun 30, 2023
  5. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-androidOperating system: Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions