Commit Graph

78 Commits

Author SHA1 Message Date
256bc6ab42 Fix "/bin/sh:" errors when building without LLVM
In GNUmakefile.llvm, several variables are unconditionally populated
by expanding $(LLVMVER) and $(LLVM_CONFIG) inside shell commands.
However, when LLVM is not present, both those variables are empty,
meaning that the shell commands end up malformed and emit harmless, but
noisy, errors like this one:

  /bin/sh: --: invalid option
  Usage:	/bin/sh [GNU long option] [option] ...
  	/bin/sh [GNU long option] [option] script-file ...
  GNU long options:
  	--debug
  	--debugger
  	--dump-po-strings
  	--dump-strings
  	--help
  	--init-file
  	--login
  	--noediting
  	--noprofile
  	--norc
  	--posix
  	--pretty-print
  	--rcfile
  	--rpm-requires
  	--restricted
  	--verbose
  	--version
  Shell options:
  	-ilrsD or -c command or -O shopt_option		(invocation only)
  	-abefhkmnptuvxBCHP or -o option
  /bin/sh: line 1: test: -gt: unary operator expected
  /bin/sh: line 1: test: -lt: unary operator expected
  /bin/sh: line 1: test: -ge: unary operator expected
  /bin/sh: line 1: test: -ge: unary operator expected

Fix the problem by only populating the "downstream" variables if the
upstream ones have values.
2024-08-06 11:27:01 -07:00
31a1fbae33 Fix LLVM mode build on MacOS 2024-07-23 14:06:19 +02:00
88e2affe73 Fixing change from PR#2152, misspelled variable names 2024-07-13 21:29:41 +00:00
835a4b6497 Some fixups to the GNUmakefile.llvm
* rely less on the shell and more on GNU make to parse the versions
* fixed retrieval of minor version (for 18.1.8 it gave 8 instead of 1!)
* auto-detection of llvm-config within the supported version range
* replaced backticks by `$(...)` syntax
* tested against `busybox static-sh`, `bash`, `dash` and `csh`
2024-07-10 07:55:37 +00:00
938edab25f consider llvm 18 stable 2024-05-14 12:45:09 +02:00
=
ee07fc9f6d fix rc minor version parsing 2024-03-12 08:20:08 +00:00
=
2300088446 support parsing of llvm rc minor version 2024-03-11 10:12:53 +00:00
5ba66a8860 final touches for skipdet 2024-02-01 15:22:51 +01:00
db65dc5a0b lto llvm 12+ 2024-01-09 16:50:57 +01:00
1fc1b32db2 initial simple injection detection support 2023-12-27 13:53:11 +01:00
d97c7e4258 nits 2023-10-03 11:14:59 +02:00
5b55cf84c1 disable exceptions on LLVM/GCC plugins, decreasing further the libraries's binaries size in the process. 2023-08-05 14:21:56 +01:00
82635dc656 Use CPPFLAGS for C++ too. 2023-07-31 11:50:33 -04:00
705cdf45fc temp cmplog fixes 2023-07-23 13:05:10 +02:00
f37c4c8662 update llvm recommendations 2023-07-05 13:03:17 +02:00
234d55ccd5 build: adjust LLVM development version check
Adjust version check to only warn for LLVM 17.x and newer, which are the
development versions. Otherwise we'll get:
```bash
make LLVM_CONFIG=llvm-config-15 CC=clang-15 CXX=clang++-15
<snip>
GNUmakefile.llvm:69: you are using an in-development llvm version - this might break llvm_mode!
```

for versions that are supported, and not in development.
2023-06-06 10:29:54 +01:00
9324f3f628 rewrote PCGUARD 2023-06-01 12:19:45 +02:00
e956f23a77 Source Code Coverage support for Nyx (Part 1) (#1720)
* Additional source code reformatting in afl-compiler-rt

* Add source code coverage support to afl-compiler-rt (for use with Nyx)
2023-04-28 11:35:22 +02:00
3e84d6a2ae afl++ -> AFL++ 2023-04-27 11:49:00 +02:00
120d009e7d wasm support 2023-04-15 11:36:58 +02:00
afd2ea90df LLVM plugin 16+ support proposal.
- Lifting the standard to C++17.
- Beyond the cosmetic changes, it boils down to BasicBlock::getInstList being
  no longer available (and reading the header it is no accident).
2023-01-20 22:12:35 +00:00
e02753fd7d Silent more deprecation warning for clang 15 and onwards 2022-12-07 19:48:20 +00:00
4b7126c46c nits 2022-11-17 10:58:20 +01:00
b2f12c3712 llvm debug 2022-11-10 16:12:37 +01:00
9a77a6fa92 nits 2022-10-19 08:50:17 +02:00
680e6e91a1 Support building LTO on Gentoo 2022-10-08 09:51:26 +02:00
9b6ad933cd Allow building LTO component with LLVM 15 2022-09-14 11:35:55 +02:00
0fe39e4768 egrep -> grep -e 2022-09-05 13:57:32 +02:00
6dfc9aaab0 disable LTO for llvm 15 :-( 2022-05-23 10:52:34 +02:00
4c0281adc8 Fix missing dependency
add `instrumentation/afl-llvm-common.o` to `SanitizerCoverageLTO.so`'s
dependency list
2022-05-16 16:10:07 +08:00
7f56a93f5d GNUmakefile.llvm: Avoid creating circular links
Building into a DESTDIR gives circular links such as:

lrwxrwxrwx. 1 rjones rjones 17 Mar 31 18:09 /home/rjones/rpmbuild/BUILDROOT/american-fuzzy-lop-4.00c-3.git285a5cb3.fc37.x86_64/usr/lib64/afl/afl-compiler-rt.o -> afl-compiler-rt.o

I have to admit I've no idea what the original link command is trying
to achieve, but it's clearly wrong and deleting it fixes the problem.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2022-03-31 18:20:43 +01:00
fa2b040476 fix LTO with cmplog and laf 2022-03-18 15:00:24 +01:00
e4f201707f make LTO pass work too plus some fixes 2022-03-17 14:35:15 +01:00
db360332c4 make llvm 14-dev working. again. 2021-12-09 14:33:56 +01:00
39e2003630 further fixes for new pass manager 2021-11-23 19:20:51 +01:00
9325a4fcbb http->https 2021-11-06 10:28:22 +01:00
e25f7cefdc announce llvm 13 support 2021-08-25 12:29:44 +02:00
183d9a3f07 MacOS nits 2021-07-22 15:16:19 +02:00
046a9520f3 Inline cmplog (#996)
* inline cmplog check

* better switch support

* add cmplog-switches-pass.cc
2021-06-28 09:14:41 +02:00
cd95dfe1e7 reenable LLVM 3.8 ( Ubuntu 16.04 ) 2021-06-08 08:51:19 +02:00
ddd9154e78 give hint how to set env var for path to llvm-config tool 2021-06-05 17:02:35 +02:00
3b5fa3632b drop support for llvm < 6.0 2021-04-19 11:05:49 +02:00
3c846859ee cleanup 2021-04-04 20:05:02 +02:00
0029c1a83e remove InsTrim 2021-03-25 15:35:06 +01:00
687dd9cb67 add missing links for afl-clang-fast*.8 man pages 2021-03-20 13:15:56 +01:00
129a5adaf1 fix 2021-02-13 09:29:35 +01:00
d827bc4580 dont break on llvm 13 2021-02-13 09:12:36 +01:00
c2c65fd9c1 mark llvm 13 as unsupported (yet) 2021-02-07 09:42:28 +01:00
9bc8c7518f enable warnings for LTO mode 's/warn /warning /' 2021-01-27 22:39:33 -05:00
f7ceafab1c fix BSD 2020-12-21 13:21:40 +01:00