[ABANDONED] Linking libraries from dependency manager

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ABANDONED] Linking libraries from dependency manager

    We're using a dependency manager for our CI pipeline as well as swap in hardware modules based on board revisions. This works fine for source files and libraries, but we're struggling on how to properly link to the list of libraries an application is dependent on. We've tried using "Additional Linker Options From File", but that puts -l flags before the object files, which gcc doesn't accept.

    We'd prefer not to manually add the list of libraries in the project since we don't want upstream dependency changes to break the build. Is there a better way of doing this?
  • Hi,
    Thank you for the inquiry.

    That should not be the case. ES adds all lines from the file "as is" to the linker command line.
    If you see something else please provide the file and the output of Project -> Export Build.

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Apologies, I may not have been entirely clear.

    When using the Additional Linker Options From File option, the build command will result in something like this, where the highlighted items are from the auto-generated file:

    "(folder)/gcc/arm-none-eabi/bin/ld" -X --omagic -eReset_Handler --defsym=__vfprintf=__vfprintf_int_nwp --defsym=__vfscanf=__vfscanf_int --fatal-warnings -llib1 -llib2 -Lfolderlib1 -Lfolderlib2 -EL --gc-sections -Tproject.map -u_vectors -o project.elf --emit-relocs --start-group @project.ind --end-group

    However, in order for gcc to find the symbols in the libraries (i.e. lib1 & lib2), the build command needs to have the -l flag at the end:

    "(folder)/gcc/arm-none-eabi/bin/ld" -X --omagic -eReset_Handler --defsym=__vfprintf=__vfprintf_int_nwp --defsym=__vfscanf=__vfscanf_int --fatal-warnings -Lfolderlib1 -Lfolderlib2 -EL --gc-sections -Tproject.map -u_vectors -o project.elf --emit-relocs --start-group @project.ind --end-group -llib1 -llib2


    What I'm looking for is a way to get the library flags at the end using an auto-generated file.
  • Hello,

    Did you try project option "Additional Input Files" already?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.