-1

我有一个使用Autotools Mythbuster作为构建系统的 Linux 库。这是Makefile.am图书馆的:

EXTRA_DIST =

EXTRA_SAMPLE_DEFINES =
EXTRA_SAMPLE_INCLUDES =
EXTRA_SAMPLE_LIBS =
EXTRA_SAMPLE_FLAGS =

AM_CFLAGS = \
  -I$(top_srcdir)/include \
  $(EXTRA_SAMPLE_FLAGS)

lib_LTLIBRARIES = libsample.la

libsample_la_LDFLAGS =

libsample_ladir = $(moduledir)

libsample_la_SOURCES = sample.c sample_data.c sample_data.h

libsample_la_LIBADD =

我想为这个库创建一个 libfuzzer,因此我继续在一个名为的文件上为我的 fuzzer 创建了一个简单的入口点sampletest.c

int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
  return 0;
}

并编写以下内容Makefile.am来构建我的 libfuzzer

EXTRA_DIST =

EXTRA_INCLUDES =
EXTRA_LIBS =
EXTRA_FLAGS = -fsanitize=address,fuzzer

AM_CPPFLAGS = \
  -I$(top_srcdir)/include \
  $(EXTRA_INCLUDES)

bin_PROGRAMS = sampletest

sampletest_SOURCES = sampletest.c

sampletest_LDADD = \
  $(top_builddir)/src/libsample.la $(EXTRA_LIBS)

sampletest_LDFLAGS = $(EXTRA_FLAGS)

但是如果我继续输入make,我会收到以下错误:

gcc: error: unrecognized argument to '-fsanitize=' option: 'fuzzer'

如果我不包括我的“模糊器”部分Makefile.am,那么它会说:

(.text+0x24): undefined reference to 主要'`

我应该怎么办 ?

4

0 回答 0