Commit Graph

26 Commits

Author SHA1 Message Date
Dmitry Vyukov
96b8132aaf sys/syz-extract: fix too long line 2019-07-16 16:34:29 +02:00
Marco Vanotti
6aad7497a8 sys/syz-extract: Add "DefineGlibcUse" flag.
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.
2019-07-16 16:34:29 +02:00
Marco Vanotti
1472562444 sys/syz-extract: define __GLIBC_USE if not defined.
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.
2019-07-16 16:34:29 +02:00
Dmitry Vyukov
000f08bb18 sys/linux: switch ppc64le to little-endian
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.
2019-05-13 10:26:57 +02:00
Dmitry Vyukov
d72db19b2a sys/syz-extract: support more identifier quoting options
That's insanity compilers shuffle them in all possible combinations.
2019-03-14 15:30:58 +01:00
Dmitry Vyukov
9fb3ae4dfd pkg/osutil: introduce TempFile helper
Introduce TempFile helper and use it in several packages.
2018-05-14 11:17:23 +02:00
Dmitry Vyukov
63ef537b14 sys/syz-extract: improve compier error messages
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.
2018-05-11 15:48:33 +02:00
Dmitry Vyukov
78b251cbd7 all: fix too long lines
Not sure why I have not seen warnings about
these lines on another machine...
2018-05-05 16:00:01 +02:00
Dmitry Vyukov
374050e904 sys/syz-extract: fix linux/arm
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.
2018-04-02 20:09:30 +02:00
Dmitry Vyukov
e4f20040fb sys/syz-extract: fix compiler invocation 2017-11-20 15:41:35 +01:00
Dmitry Vyukov
c4d43f4773 pkg/osutil: don't leace runaway processes
When manager is stopped there are sometimes runaway qemu
processes still running. Set PDEATHSIG for all subprocesses.
We never need child processes outliving parents.
2017-11-16 12:48:02 +01:00
Eric Biggers
3f85f7fc46 syz-extract: fix printf conditional in template
commit 3520854be0 ("syz-extract: select declaring printf or not")
broke 'make extract' because it introduced invalid syntax in a text
template.  Fix it.
2017-11-07 11:21:47 +03:00
zoulasc
3520854be0 syz-extract: select declaring printf or not
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.
2017-11-06 11:27:45 +03:00
Dmitry Vyukov
8793f74c6c sys/fuchsia: more descriptions 2017-10-16 19:23:13 +02:00
Dmitry Vyukov
7553c19941 sys/syz-extract: support akaros 2017-10-16 14:21:54 +02:00
Dmitry Vyukov
02a7a54019 sys/syz-extract: factor out compilation function
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.
2017-10-12 18:16:25 +02:00
Dmitry Vyukov
e9c477a5b3 sys/syz-extract: support fuchsia 2017-09-25 08:47:48 +02:00
Dmitry Vyukov
da1873aadd sys/targets: move targets from sys package
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.
2017-09-15 16:02:37 +02:00
Dmitry Vyukov
4503776d2b sys/syz-extract: generate build files out of tree
This does not pollute user kernel dir (we do make mrproper, though)
and enables parallel generation.
2017-09-15 16:02:37 +02:00
Dmitry Vyukov
75ddf7ab90 sys/syz-extract: switch to consolidated target info in sys package 2017-09-15 16:02:37 +02:00
Dmitry Vyukov
b16ba6390d sys/syz-extract: parallelize over files 2017-09-15 16:02:37 +02:00
Dmitry Vyukov
a3857c4e90 pkg/compiler, sys/syz-sysgen: move const handling to pkg/compiler
Now pkg/compiler deals with consts.
2017-08-27 11:51:40 +02:00
Dmitry Vyukov
6aad5879f7 sys: support arm arch
Not tested, but const extraction and build works.

Update #324
Update #191
2017-08-19 10:41:24 +02:00
Dmitry Vyukov
9630a49ef9 sys/syz-extract: reformat 2017-06-26 10:56:18 +02:00
Yuzhe Han
7077339b70 Parse incdir "incdir" in syscall description file to add custom include directories. (#180)
* Parse #incdir "incdir" in syscall description file to add custom include directories.

* add flagLinux

* remove '#' in incdir flag

* Update sys/README.md AUTHORS CONTRIBUTORS.
2017-06-26 10:52:47 +02:00
Dmitry Vyukov
c9ee712bc8 sys/syz-extract: move from syz-extract 2017-06-17 14:41:15 +02:00