From: Keith Packard Date: Sat, 31 Jan 2026 14:00:26 +0000 (-0700) Subject: [PATCH] picolibc: Use %:find-file for both test and access to picolibc.ld X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9839ae8f24180d20d8aea5de60a94f41dbfdcda8;p=thirdparty%2Fgcc.git [PATCH] picolibc: Use %:find-file for both test and access to picolibc.ld If the gcc driver and linker don't agree on what the search path for linker scripts is, then the driver may discover a file that the linker won't end up using. This results in linking failures when applications don't specific an explicit linker script. Fix this by duplicating the call to %:find-file for both test and in the parameter passed to the linker. gcc/ * config/picolibc-spec.h (LIBC_LINK_SPEC): Use find-file for test and access to picolibc.ld. --- diff --git a/gcc/config/picolibc-spec.h b/gcc/config/picolibc-spec.h index d1024ced3e7..def290ee0b1 100644 --- a/gcc/config/picolibc-spec.h +++ b/gcc/config/picolibc-spec.h @@ -39,7 +39,7 @@ * Define vfscanf if --scanf is set */ #define LIBC_LINK_SPEC \ - " %{!shared:%{!r:%{!T*: %:if-exists-then-else(%:find-file(" PICOLIBC_LD ") -T" PICOLIBC_LD ")}}}" \ + " %{!shared:%{!r:%{!T*: %:if-exists-then-else(%:find-file(" PICOLIBC_LD ") -T%:find-file(" PICOLIBC_LD "))}}}" \ " %{-printf=*:--defsym=" USER_LABEL_PREFIX "vfprintf=" USER_LABEL_PREFIX "__%*_vfprintf}" \ " %{-scanf=*:--defsym=" USER_LABEL_PREFIX "vfscanf=" USER_LABEL_PREFIX "__%*_vfscanf}"