Skip to content

mold: error: undefined symbol: test2.o: __dso_handle #507

Closed

Description

@gcflymoto

mold @3c284f09ab2f5fab0662240560f0481bb71fec76 does not seem to like -lgcc_s

mold -o a.out -rpath='$ORIGIN'/simv.daidir -rpath=./simv.daidir -rpath=/p/tool/suse64/lib -L/p/tool/suse64/lib -rpath-link=./ sv_profile.o ovm_optimizations.o test_vcs.o stop_asserts.o objs/amcQw_d.o _10915_archive_1.so _11133_archive_1.so _11135_archive_1.so _11136_archive_1.so SIM_l.o rmapats_mop.o rmapats.o rmar.o rmar_nd.o rmar_llvm_0_1.o rmar_llvm_0_0.o -lnuma -lvirsim -lerrorinf -lsnpsmalloc -lvfs libsla.so -lrt -lsimprofile -luclinative /p/tool/suse64/lib/vcs_tls.o -whole-archive -lvcsucli -no-whole-archive ./../simv.daidir/vc_hdrs.o vcs_pli_stub.o /p/tool/suse64/lib/vcs_save_restore_new.o -ldl -lm -lc -lpthread -ldl -L /usr/lib64 -L/usr/pkgs/gcc/6.4.0/lib64/ -lstdc++ -L/usr/pkgs/gcc/11.1.0/lib64/ -lgcc_s

without it
mold: error: undefined symbol: sv_profile.o: _Unwind_Resume
mold: error: undefined symbol: ovm_optimizations.o: _Unwind_Resume
...

Activity

  1. rui314 commented on May 11, 2022

    @rui314
    Owner

    What program are you linking?

    Does this happen all the time or when you link a specific program?

  2. gcflymoto commented on May 11, 2022

    @gcflymoto
    Author

    What program are you linking?
    Internal app

    Does this happen all the time or when you link a specific program?
    Seems to happen everytime -lgcc_s is required to resolve _Unwind_Resume .. Even simple test apps
    mold -o a.out -L /usr/lib64 -ldl test2.o -L/usr/pkgs/gcc/11.1.0/lib64/ -lc -lstdc++ -lgcc_s

  3. gcflymoto commented on Jul 10, 2022

    @gcflymoto
    Author

    Getting closer!

    libgcc_s.so is a script that requires libgcc.a (it wasn't clear from the mold error message). After adding the path to libgcc.a

    mold -o a.out -L/usr/lib64 -ldl test2.o -L/usr/pkgs/gcc/12.1.0/lib64/ -lc -lstdc++ -lgcc_s -L/usr/pkgs/gcc/12.1.0/lib/gcc/x86_64-pc-linux-gnu/12.1.0/
    mold: error: undefined symbol: test2.o: __dso_handle

    Any ideas @rui314 ??

  4. changed the title [-]mold: fatal: library not found: gcc[/-] [+]mold: error: undefined symbol: test2.o: __dso_handle[/+] on Jul 10, 2022
  5. rui314 commented on Jul 11, 2022

    @rui314
    Owner

    Can you rebuild mold with the above commit and try again?

  6. gcflymoto commented on Jul 11, 2022

    @gcflymoto
    Author

    Confirmed! Working now. Thank you so much.

    I'm stuck on a build layer calling mold with -rdynamic.. but that's a separate issue I might workaround.

  7. rui314 commented on Jul 12, 2022

    @rui314
    Owner

    -rdynamic isn't a valid option for any ld command as a far as I know. It's an option for compiler drivers (e.g. cc, gcc, etc.)

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions