From a767a1c4d3c7c5dd2f32cc106a21c1e01eddebcc Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 21 Sep 2018 10:27:30 -0400 Subject: elf32-nds32: Don't define fls if it is provided by the system The fls function already exists on macOS and FreeBSD (and probably others), leading to this error: /Users/simark/src/binutils-gdb/bfd/elf32-nds32.c:5074:1: error: static declaration of 'fls' follows non-static declaration fls (register unsigned int x) ^ /usr/include/strings.h:87:6: note: previous declaration is here int fls(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); ^ Add a configure-time check for it, and only define it if the system doesn't provide it. bfd/ChangeLog: * configure.ac: Check for fls. * elf32-nds32.c (fls): Only define if !HAVE_FLS. * config.in: Re-generate. * configure: Re-generate. --- bfd/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bfd/configure.ac') diff --git a/bfd/configure.ac b/bfd/configure.ac index 787ac7f..270e54e 100644 --- a/bfd/configure.ac +++ b/bfd/configure.ac @@ -229,7 +229,7 @@ AC_HEADER_TIME AC_HEADER_DIRENT ACX_HEADER_STRING -AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno) +AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno fls) AC_CHECK_FUNCS(strtoull getrlimit) AC_CHECK_DECLS(basename) -- cgit v1.1