This should be a symlink to gcc on target so I wonder why it does not work 

First, see the coreutils’ files which installed on target.

================

  Makefile  -->created by cross-compile

  build-aux

  init.cfg     --> copied from src

  run-ptest

tests

================

In Makefile, CC is defined by aarch64-agl-linux-gcc with --sysroot=recipe-sysroot.

 CC = aarch64-agl-linux-gcc  -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=recipe-sysroot

In init.cfg, CC  is used to compile k.c file.

 $CC -Wall -shared --std=gnu99 -fPIC -O2 $* "$in" -o "$out" $gcc_shared_libs_

Because of --sysroot=recipe-sysroot, it does not work.

So, we could add -I /usr/include in Makefile or init.cfg, or delete --sysroot=recipe-sysroot from Makefile.

Which one is better?

Let me know, and I will send the patch v2.

thanks.