blob: 29cf34349e79e869afda5807340fefd50c55e04d [file]
diff --git a/meson.build b/meson.build
index a9cfa04..085653f 100644
--- a/meson.build
+++ b/meson.build
@@ -382,7 +382,13 @@ endif
cdata.set10('ARCH_PPC64LE', host_machine.cpu() == 'ppc64le')
-if cc.symbols_have_underscore_prefix()
+# Meson's symbols_have_underscore_prefix() function returns true incorrectly
+# if -fprofile-instr-generate is specified in CFLAGS. This is similar to the
+# problem symbols_have_underscore_prefix() has with -flto mentioned in
+# https://github.com/mesonbuild/meson/issues/5482. Since oss-fuzz uses
+# -fprofile-instr-generate in CFLAGS only on Linux, add a special case for
+# Linux to work around this Meson bug.
+if host_machine.system() != 'linux' and cc.symbols_have_underscore_prefix()
cdata.set10('PREFIX', true)
cdata_asm.set10('PREFIX', true)
endif