mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
e66277943d
The files have only been touched by a subset of three people: pdknsk, Philip Withnall, and Marc-André Lureau. Their copyrights are assigned to pdknsk, Endless OS Foundation and Red Hat. The default license for GLib at the time of writing these files was (and still is) LGPL-2.1-or-later. `driver.c` came from LLVM and is under a different license: https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/fuzzer/standalone/StandaloneFuzzTargetMain.c. That doesn’t affect the license of GLib overall, since it’s only used for testing during development. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
70 lines
2.3 KiB
Meson
70 lines
2.3 KiB
Meson
# Copyright 2018 pdknsk
|
||
# Copyright 2020, 2021, 2022 Endless OS Foundation, LLC
|
||
#
|
||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||
#
|
||
# This library is free software; you can redistribute it and/or
|
||
# modify it under the terms of the GNU Lesser General Public
|
||
# License as published by the Free Software Foundation; either
|
||
# version 2.1 of the License, or (at your option) any later version.
|
||
#
|
||
# This library is distributed in the hope that it will be useful,
|
||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
# Lesser General Public License for more details.
|
||
#
|
||
# You should have received a copy of the GNU Lesser General Public
|
||
# License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||
|
||
fuzz_targets = [
|
||
'fuzz_bookmark',
|
||
'fuzz_canonicalize_filename',
|
||
'fuzz_date_parse',
|
||
'fuzz_date_time_new_from_iso8601',
|
||
'fuzz_dbus_message',
|
||
'fuzz_inet_address_mask_new_from_string',
|
||
'fuzz_inet_address_new_from_string',
|
||
'fuzz_inet_socket_address_new_from_string',
|
||
'fuzz_key',
|
||
'fuzz_network_address_parse',
|
||
'fuzz_network_address_parse_uri',
|
||
'fuzz_paths',
|
||
'fuzz_resolver',
|
||
'fuzz_uri_escape',
|
||
'fuzz_uri_parse',
|
||
'fuzz_uri_parse_params',
|
||
'fuzz_variant_binary',
|
||
'fuzz_variant_text',
|
||
]
|
||
|
||
deps = [libgmodule_dep, libgio_dep, libglib_dep, libgobject_dep]
|
||
|
||
extra_sources = []
|
||
extra_c_args = cc.get_supported_arguments('-Werror=unused-function')
|
||
|
||
# Links in a static library provided by oss-fuzz, else a standalone driver.
|
||
# https://google.github.io/oss-fuzz/getting-started/new-project-guide/#buildsh-script-environment
|
||
fuzzing_engine = cxx.find_library('FuzzingEngine', required : get_option('oss_fuzz'))
|
||
if fuzzing_engine.found()
|
||
deps += fuzzing_engine
|
||
else
|
||
extra_sources += 'driver.c'
|
||
endif
|
||
|
||
foreach target_name : fuzz_targets
|
||
exe = executable(target_name, [extra_sources, target_name + '.c'],
|
||
c_args : extra_c_args,
|
||
dependencies : deps,
|
||
)
|
||
|
||
# If the FuzzingEngine isn’t available, build some unit tests to check that
|
||
# the fuzzing files do basically work. This doesn’t do any actual fuzzing though.
|
||
# Pass in the README as an arbitrary fuzzing input, just so we have something.
|
||
if not fuzzing_engine.found()
|
||
test(target_name, exe,
|
||
args : files('README.md'),
|
||
suite : 'fuzzing',
|
||
)
|
||
endif
|
||
endforeach
|