title: Why system call stubs in NewLib are needed only on Linux and not on Windows?
body: <p>I have a project in MCUXpresso with a custom linker file. The project builds fine on Windows but it fails on Linux. On Linux, the linker fails with the following error (the compiler paths are shortened):</p>
  <pre><code>arm-none-eabi/bin/ld: arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-abort.o): in function `abort':
  abort.c:(.text.abort+0xa): undefined reference to `_exit'
  arm-none-eabi/bin/ld: arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-signalr.o): in function `_kill_r':
  signalr.c:(.text._kill_r+0xe): undefined reference to `_kill'
  arm-none-eabi/bin/ld: arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-signalr.o): in function `_getpid_r':
  signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'
  arm-none-eabi/bin/ld: arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-writer.o): in function `_write_r':
  writer.c:(.text._write_r+0x10): undefined reference to `_write'
  arm-none-eabi/bin/ld: arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-closer.o): in function `_close_r':
  closer.c:(.text._close_r+0xc): undefined reference to `_close'
  arm-none-eabi/bin/ld: arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-fstatr.o): in function `_fstat_r':
  fstatr.c:(.text._fstat_r+0xe): undefined reference to `_fstat'
  arm-none-eabi/bin/ld: arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-isattyr.o): in function `_isatty_r':
  isattyr.c:(.text._isatty_r+0xc): undefined reference to `_isatty'
  arm-none-eabi/bin/ld: arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-lseekr.o): in function `_lseek_r':
  lseekr.c:(.text._lseek_r+0x10): undefined reference to `_lseek'
  arm-none-eabi/bin/ld: arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(lib_a-readr.o): in function `_read_r':
  readr.c:(.text._read_r+0x10): undefined reference to `_read'
  </code></pre>
  <p>The linker file originally &quot;includes&quot; the following static libraries:</p>
  <pre><code>GROUP (
    &quot;libgcc.a&quot;
    &quot;libc_nano.a&quot;
    &quot;libm.a&quot;
    &quot;libcr_newlib_none.a&quot;
  )
  </code></pre>
  <p>Now, I can get the linker successfully do its job by adding <code>&quot;libnosys.a&quot;</code> to the GROUP statement. That's where it gets confusing for me. Why do these new stubs in libnosys.a are needed only on Linux? How and where are they defined in Windows? What am I missing?</p>
  <p>GCC version on my Windows and Linux are <code>8.3.1</code> and <code>10.2.1</code>, respectively, as they come bundled with different versions of MCUXpresso.</p>
  <p>Thanks in advance!</p>