Skip to content

Support linker arguments when implicitly linking #4

@frno7

Description

@frno7

With for example m68k-atari-tos-gnu-gcc -o FOO.PRG foo.c -lbar the linker argument -lbar does not get passed on to the ld:

toslibc/script/target-cc

Lines 44 to 45 in 0aed1d6

cmd "'"$TARGET_CC"'" "${args[@]}"
cmd "'"$binutilsbindir/$target-ld"'" -o "$out" "$obj"

Instead, cc gets the arguments (and ignores the linker ones), and ld gets none. Fix this by retaining relevant arguments for ld.

A workaround is to manually compile and link in two steps:

$ m68k-atari-tos-gnu-gcc -c -o foo.o foo.c
$ m68k-atari-tos-gnu-ld -o FOO.PRG foo.o -lbar

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions