On 10/6/26 11:19 AM, Torbjörn Svensson via Sourceware Forge wrote:
From: Torbjörn SVENSSON <[email protected]>

Use -nostdlib and temporarily clear board ldflags and libs for
incremental LTO links, then restore the board settings.

This was discovered while testing newlib built without
--disable-newlib-supplied-syscalls. In this case, the libc.a contains
semihosting function that, due to ldflags for the board definition, will
be pulled in, that contain non-LTO object files.

This was discovered while testing newlib built without
--disable-newlib-supplied-syscalls. In this configuration, the board’s
linker flags pull in a semihosting function from libc.a, and that
function is compiled into a non-LTO object file.

gcc/testsuite/ChangeLog:

        * lib/lto.exp (lto-link-and-maybe-run): Disable board provided
        ldflags during incremental link.

Signed-off-by: Torbjörn SVENSSON <[email protected]>
---
Similar to r17-3275-g1b9420378621b9, the board ldflags and libs can cause the 
incr link to fail.
This patch temporarily disables board defined ldflags and libs during incr link.

Regtested with arm-none-eabi on r17-4804-gf7094fe5ff882f.

Ok for trunk?
OK
jeff

Reply via email to