problem:

    wk@ubuntu:~/workspace/newlib-install$ /home/wk/workspace/AFL/afl-gcc fork.c -I ./include/ ./lib/libc.a /home/wk/workspace/libgloss-install/lib/libnosys.a  -static
    afl-cc 2.57b by <lcamtuf@google.com>
    afl-as 2.57b by <lcamtuf@google.com>
    [+] Instrumented 2 locations (64-bit, non-hardened mode, ratio 100%).
    /usr/bin/ld: errno: TLS definition in /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libc.a(errno.o) section .tbss mismatches non-TLS reference in ./lib/libc.a(lib_a-reent.o)
    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libc.a: error adding symbols: bad value
    collect2: error: ld returned 1 exit status

solution:

in this directory:
	/home/wk/workspace/newlib-cygwin/newlib/libc/reent
comment extern int errno, add another header file
	//extern int errno;
	#include <errno.h>

更多推荐