aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/build.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/csource: build executor w/o optimizationsDmitry Vyukov2024-06-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Build executor w/o optimizations for tests. Tests can build lots of versions of executor in parallel, and on overloaded machines it can be slow. On my machine this reduces executor build time from ~7.5 to ~3.5 secs. Reduces pkg/runtest tests time considerably. Before: --- PASS: TestExecutor (8.89s) --- SKIP: TestExecutor/386 (0.00s) --- PASS: TestExecutor/riscv64 (30.76s) --- PASS: TestExecutor/arm (32.56s) --- PASS: TestExecutor/arm64 (33.01s) --- PASS: TestExecutor/amd64 (31.83s) --- SKIP: TestExecutor/ppc64le (26.56s) --- PASS: TestExecutor/s390x (25.53s) --- PASS: TestExecutor/mips64le (25.65s) After: --- PASS: TestExecutor (4.74s) --- SKIP: TestExecutor/386 (0.00s) --- PASS: TestExecutor/s390x (12.27s) --- SKIP: TestExecutor/ppc64le (12.59s) --- PASS: TestExecutor/amd64 (12.84s) --- PASS: TestExecutor/riscv64 (12.89s) --- PASS: TestExecutor/arm (11.53s) --- PASS: TestExecutor/arm64 (11.88s) --- PASS: TestExecutor/mips64le (12.82s)
* Makefile: build executor with C++ compilerDmitry Vyukov2024-05-211-11/+7
| | | | | | | | | | | | Add C++ compiler and flags to the target and build executor with the C++ compiler. This will be needed to merge syz-fuzzer in to syz-executor since it will be beefier and will most likely require linking in libc++. But also this should fix #4821 since we won't use C++ flags when building C sources (we already had work-around in pkg/csource, but not in syz-extract). Fixes #4821
* executor: make flatrpc build for C++Dmitry Vyukov2024-05-031-6/+26
|
* all: use special placeholder for errorsTaras Madan2023-07-241-1/+1
|
* all: ioutil is deprecated in go1.19 (#3718)Taras Madan2023-02-231-2/+1
|
* executor: test extension pointsDmitry Vyukov2022-11-011-8/+6
| | | | Test that extension points keep stable interface and work.
* Get rid of "Cross" in variable namesAlexander Potapenko2020-05-131-1/+1
| | | | | | | | | Renamed Target.BrokenCrossCompiler to Target.BrokenCompiler and Target.CrossCFlags to Target.CFlags "Everything in Target is about Cross now." Signed-off-by: Alexander Potapenko <glider@google.com>
* sys/targets: better detection for missing/broken cross-compilersDmitry Vyukov2020-04-291-4/+0
| | | | | | | | | | | | | | 1. Detect when compiler is present, but is not functioning (can't build a simple program, common for Linux distros). 2. Be more strict with skipping tests due to missing/broken compilers on CI (on CI they should work, so fail loudly if not). 3. Dedup this logic across syz-env and pkg/csource tests. 4. Add better error reporting for syz-env. Fixes #1606
* pkg/csource: allow to ignore warnings during buildDmitry Vyukov2019-03-211-3/+14
| | | | | | | | | | | | | | | Running bisection using an older repro failed with: <stdin>: In function ‘syz_mount_image.constprop’: <stdin>:298:3: error: argument 1 null where non-null expected [-Werror=nonnull] In file included from <stdin>:26:0: /usr/include/x86_64-linux-gnu/sys/stat.h:320:12: note: in a call to function ‘mkdir’ declared here extern int mkdir (const char *__path, __mode_t __mode) Let's be safe and ignore warnings during repro/bisect. Everything that runs during tests still has all warnings. Update #501
* pkg/runtest: make tests pass on freebsdDmitry Vyukov2019-03-071-0/+2
| | | | | | The problem is stupid: <endian.h> should be included as <sys/endian.h> on freebsd. Pass actual host OS to executor build as HOSTGOOS and use it to figure out how we should include this header.
* Makefile: enable -Wunused-const-variableDmitry Vyukov2019-01-191-1/+1
| | | | | | | See discussion in PR #942. Extend support for optional flags in sys/targets as this flag is not supported by gcc 5. Make flags consistent across Makefile and pkg/csource.
* pkg/csource: reduce short testsDmitry Vyukov2018-12-031-1/+1
| | | | | | | | | | | | pkg/csource test gets OOM-killed on travis: https://travis-ci.org/google/syzkaller/jobs/461827347 https://travis-ci.org/google/syzkaller/jobs/460226110 Add several measures: - set GOMAXPROCS=1 to restrict parallel processes - remove -g from compiler invocation - reduce set of tests run in short mode to compensate for GOMAXPROCS=1 - also reduce set of tests in full mode as they timeout now
* pkg/csource: say what compiler is missingDmitry Vyukov2018-07-251-4/+1
|
* executor: overhaulDmitry Vyukov2018-07-241-1/+6
| | | | | | | | | | | | | | | | | Make as much code as possible shared between all OSes. In particular main is now common across all OSes. Make more code shared between executor and csource (in particular, loop function and threaded execution logic). Also make loop and threaded logic shared across all OSes. Make more posix/unix code shared across OSes (e.g. signal handling, pthread creation, etc). Plus other changes along similar lines. Also support test OS in executor (based on portable posix) and add 4 arches that cover all execution modes (fork server/no fork server, shmem/no shmem). This change paves way for testing of executor code and allows to preserve consistency across OSes and executor/csource.
* pkg/csource: allow to build source fom memoryDmitry Vyukov2018-06-061-8/+25
| | | | | | In most cases we have source in memory, so provide a function to build right from memory without creating temp files.
* Makefile, sys/targets: move all native compilation logic to sys/targetsDmitry Vyukov2018-06-061-7/+3
| | | | | | | | | | | | | | | We currently have native cross-compilation logic duplicated in Makefile and in sys/targets. Some pieces are missed in one place, some are in another. Only pkg/csource knows how to check for -static support. Move all CC/CFLAGS logic to sys/targets and pull results in Makefile. This should make Makefile work on distros that have broken x86_64-linux-gnu-gcc, now we will use just gcc. And this removes the need to define NOSTATIC, as it's always auto-detected. This also paves the way for making pkg/csource work on OSes other than Linux.
* pkg/osutil: introduce TempFile helperDmitry Vyukov2018-05-141-11/+9
| | | | Introduce TempFile helper and use it in several packages.
* pkg/scource: rename compiled binary to syz-executorDmitry Vyukov2018-04-241-1/+3
| | | | | | We call the binary syz-executor because it sometimes shows in bug titles, and we don't want 2 different bugs for when a crash is triggered during fuzzing and during repro.
* all: fix gometalinter warningsDmitry Vyukov2018-03-081-3/+3
| | | | Fix typos, non-canonical code, remove dead code, etc.
* pkg/csource: tidy up generated code a bitDmitry Vyukov2017-12-271-1/+1
| | | | | | | Remove dup newlines around includes. Makes int values shorter if not hurting readability. Increase line len to 80. Remove {} when not needed during copyout.
* pkg/csource: refactorDmitry Vyukov2017-12-171-0/+86
csource.go is too large and messy. Move Build/Format into buid.go. Move generation of common header into common.go. Split generation of common header into smaller managable functions.