Skip to content

Deprecate and remove the auto-linking feature (initially in STRICT; this would let us remove llvm-nm) #8912

Closed

Description

@kripken

Talking to @dschuff it sounds like we can avoid the current llvm-nm stage in our linking. Currently we scan the symbols that way to tell which system libraries to link in. Instead, if we used .a files for system libraries and had a default linker command that included all system libraries, then wasm-ld would do everything for us. It would be simpler, and more efficient too probably. And we could remove the .symbols files.

Emscripten has non-default system libraries too, but those should be added manually anyhow with a -s command etc., that is, we don't use llvm-nm for them.

@sbc100 what do you think?

This might need to wait for after we remove fastcomp.

Activity

  1. sbc100 commented on Jul 3, 2019

    @sbc100
    Collaborator

    I think there two different things being confused here.

    1. We have a fake linking system for fastcomp today that uses llvm-nm at link time. This is fastcomp only and will go away when fastcomp goes away. We don't run llvm-nm at link time with the wasm backend.

    2. We have a "auto-library" system tries to determine which libraries to link based on which symbols the program needs. This system is based on "symbols" files and we (the emscripten devs) use uses llvm-nm to keep those files up-to-date.

    I'm all in favor of removing the auto-linking system. We already removed auto-linking of js libraries in STRICT mode. We should do that same for auto-linking of native libraries.

    The idea with STRICT mode is that eventually thinking behind that flag will become the default.

    If you agree we my assessment perhaps you want to re-name this issue "Remove auto-detection/auto-linking of system libraries"?

  2. kripken commented on Jul 8, 2019

    @kripken
    MemberAuthor

    We have a "auto-library" system tries to determine which libraries to link based on which symbols the program needs. This system is based on "symbols" files and we (the emscripten devs) use uses llvm-nm to keep those files up-to-date.

    True, but we also use llvm-nm on the program files to find out which system libraries we need (using those symbols files). Here is example logging when building hello_libcxx.cpp:

    shared:DEBUG: executed /home/azakai/Dev/sdk/upstream/bin/llvm-nm /tmp/emscripten_temp/hello_libcxx_0.o
    system_libs:DEBUG: including libc (libc.a)
    system_libs:DEBUG: including libcompiler_rt (libcompiler_rt.a)
    system_libs:DEBUG: including libc-wasm (libc-wasm.a)
    system_libs:DEBUG: including libc++ (libc++-noexcept.a)
    system_libs:DEBUG: including libc++abi (libc++abi.a)
    system_libs:DEBUG: including libmalloc (libdlmalloc.a)
    system_libs:DEBUG: including libpthreads (libpthreads_stub.a)
    system_libs:DEBUG: including libcompiler_rt_wasm (libcompiler_rt_wasm.a)
    system_libs:DEBUG: including libc_rt_wasm (libc_rt_wasm.a)
    
  3. sbc100 commented on Jul 9, 2019

    @sbc100
    Collaborator

    I see. So the title of this bug should maybe be "Remove/deprecate the auto-library linking feature"?

    I agree. We should probably remove it in STRICT mode initially.

  4. changed the title [-]Avoid llvm-nm[/-] [+]Deprecate and remove the auto-linking feature (initially in STRICT; this would let us remove llvm-nm)[/+] on Jul 11, 2019
  5. 22 remaining items

  6. stale commented on Jul 11, 2020

    @stale

    This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

  7. sbc100 commented on Jul 11, 2020

    @sbc100
    Collaborator

    I've got a few PRs for this still lying around.

  8. stale commented on Jul 11, 2021

    @stale

    This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions