This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] elf32-nds32: Don't define fls if it is provided by the system
- From: Alan Modra <amodra at gmail dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Fri, 21 Sep 2018 09:08:37 +0930
- Subject: Re: [PATCH] elf32-nds32: Don't define fls if it is provided by the system
- References: <20180920202247.26863-1-simon.marchi@ericsson.com>
On Thu, Sep 20, 2018 at 08:22:59PM +0000, Simon Marchi wrote:
> 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.
OK.
--
Alan Modra
Australia Development Lab, IBM