[PATCH 2/3] libgloss: arc: Add _link stub for nSIM

Yuriy Kolerov <[email protected]> Thu, 12 Mar 2026 15:53:29 -0700
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Building of C++ applications may fail without this stub if
libraries are not built with -ffunction-sections.

Signed-off-by: Yuriy Kolerov <[email protected]>
---
 libgloss/arc/nsim-syscalls.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libgloss/arc/nsim-syscalls.c b/libgloss/arc/nsim-syscalls.c
index 65ad3e009..5e754799c 100644
--- a/libgloss/arc/nsim-syscalls.c
+++ b/libgloss/arc/nsim-syscalls.c
@@ -233,6 +233,13 @@ _clock (void)
     return -1;
 }
 
+int
+_link (const char *old_name, const char *new_name)
+{
+  errno = ENOSYS;
+  return -1;
+}
+
 /* Some system calls are implemented in nSIM hostlink, but are available only
    on Linux hosts.  To minimize potential compatibility issues they are by
    default disabled in libgloss build.  */
-- 
2.44.2