test-gtk2-infobar.bin \
test-hello.bin \
test-libbfd.bin \
+ test-libbfd-threadsafe.bin \
test-disassembler-four-args.bin \
test-disassembler-init-styled.bin \
test-reallocarray.bin \
$(OUTPUT)test-libbfd.bin:
$(BUILD_BFD)
+$(OUTPUT)test-libbfd-threadsafe.bin:
+ $(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz
+
$(OUTPUT)test-disassembler-four-args.bin:
$(BUILD_BFD) -lopcodes || $(BUILD_BFD) -lopcodes -liberty || \
$(BUILD_BFD) -lopcodes -liberty -lz
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0
+#include <bfd.h>
+
+static bool lock(void *unused)
+{
+ return true;
+}
+
+static bool unlock(void *unused)
+{
+ return true;
+}
+
+int main(void)
+{
+ /* Check for presence of new thread safety API (version 2.42) */
+ return !bfd_thread_init(lock, unlock, NULL);
+}
$(call feature_check,libbfd)
$(call feature_check,disassembler-four-args)
$(call feature_check,disassembler-init-styled)
+ $(call feature_check,libbfd-threadsafe)
$(call feature_check,libbfd-liberty)
$(call feature_check,libbfd-liberty-z)
+ ifneq ($(feature-libbfd-threadsafe), 1)
+ $(error binutils 2.42 or later is required for non-distro builds)
+ endif
+
# we may be on a system that requires -liberty and (maybe) -lz
# to link against -lbfd; test each case individually here
ifeq ($(feature-libbfd), 1)