Instead of defining the __GLIBC_USE macro on every OS, we are just
defining it based on a parameter. That parameter is set to false for all
OSs except for fuchsia.
When I try to run `make extract` for fuchsia, the clang compiler
complains that __GLIBC_USE is undefined.
This CL just defines it to be an always false function-like macro if it
was not defined.
make extract recently broke for powerpc on linux-next with:
include/uapi/linux/byteorder/big_endian.h:6:2: error: #error "Unsupported endianness, check your toolchain"
#error "Unsupported endianness, check your toolchain"
Turns out we always built ppc64le headers as big-endian.
First, kernel was configured as BE.
Then, we used gcc to build an executable program for host
and on x86 gcc does not define __LITTLE_ENDIAN__ so kernel
thought that the toolchain is BE too.
Configure kernel as LE and define __LITTLE_ENDIAN__.
This actually changes values of some consts,
but fortunately just few of them.
Print each constant on separate line.
When compiler prints error messages it prints whole line
containing an error. So currently it prints all constants (thousands).
With this change it prints just the problematic constant.
At some point extract for linux/arm started to fail with:
extracting from key.txt
failed to run compiler: exit status 1
/tmp/ccT6o7iZ.s: Assembler messages:
/tmp/ccT6o7iZ.s:4: Error: unknown pseudo-op: `.syntax'
This is caused by arch/arm/include/asm/unified.h:
__asm__(".syntax unified");
Ignore all __asm__ directives as we are cross compiling.
When manager is stopped there are sometimes runaway qemu
processes still running. Set PDEATHSIG for all subprocesses.
We never need child processes outliving parents.
commit 3520854be0 ("syz-extract: select declaring printf or not")
broke 'make extract' because it introduced invalid syntax in a text
template. Fix it.
Kernels are standalone implementations and can have their own
implementations of functions that have different prototypes than
the standard ones. In the NetBSD case the kernel printf returns
void, and it is declared in <sys/systm.h> so avoid re-declaring it.
Select if we are going to declare printf or not depending on the OS.
Each arch duplicates significant portion of logic
to compile the extract source file.
Factor this logic into a separate function and reuse
it across all OSes.
This breaks circular dependency between:
sysgen -> sys/linux -> sys -> sysgen
With this circular dependency it is very difficult to
update format of generated descriptions because sysgen does not build.