Skip to content

Commit 341c1c7

Browse files
keith-packardnashif
authored andcommitted
picolibc: Don't add -Tpicolibc.ld with -shared
Shared libraries are also relocatable and shouldn't use the default linker script designed for stand-alone apps. Signed-off-by: Keith Packard <[email protected]>
1 parent 4be5217 commit 341c1c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gcc/config/picolibc-spec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
" %{-scanf=*: -D_PICOLIBC_SCANF='%*'}"
3636

3737
/*
38-
* Add picolibc.ld if not using -r or -T and we can find it.
38+
* Add picolibc.ld if not using -shared, -r or -T and we can find it.
3939
* Define vfprintf if --printf is set
4040
* Define vfscanf if --scanf is set
4141
*/
4242
#undef LINK_LIBC_SPEC
4343
#define LINK_LIBC_SPEC \
44-
"%{!r:%{!T*: %:if-exists-then-else(%:find-file(" PICOLIBC_LD ") -T" PICOLIBC_LD ")}}" \
44+
"%{!shared:%{!r:%{!T*: %:if-exists-then-else(%:find-file(" PICOLIBC_LD ") -T" PICOLIBC_LD ")}}}" \
4545
" %{-printf=*:--defsym=" USER_LABEL_PREFIX "vfprintf=" USER_LABEL_PREFIX "__%*_vfprintf}" \
4646
" %{-scanf=*:--defsym=" USER_LABEL_PREFIX "vfscanf=" USER_LABEL_PREFIX "__%*_vfscanf}"
4747

0 commit comments

Comments
 (0)