Bug 17122 - OSX 10.9 build failure
Summary: OSX 10.9 build failure
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.25
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-07 16:08 UTC by Andrey Smirnov
Modified: 2022-07-22 03:10 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Smirnov 2014-07-07 16:08:35 UTC
Most recent version of binutils-gdb HEAD fails to build on OSX 10.9 with:

nm.c: In function 'main':
nm.c:1699:7: error: 'sbrk' is deprecated (declared at /usr/include/unistd.h:582) [-Werror=deprecated-declarations]
       char *lim = (char *) sbrk (0);
       ^

when built with GCC 4.8.
Steps to reproduce:

./configure CC=gcc-4.8
make

The build succeeds if configured as:

./configure CC=gcc-4.8 CFLAGS="-Wno-error=deprecated-declarations"

Let me know if any additional info is needed.
Comment 1 gingold@adacore.com 2014-07-08 08:48:47 UTC
On 07 Jul 2014, at 18:08, andrew.smirnov at gmail dot com <sourceware-bugzilla@sourceware.org> wrote:

> https://sourceware.org/bugzilla/show_bug.cgi?id=17122
> 
>            Bug ID: 17122
>           Summary: OSX 10.9 build failure
>           Product: binutils
>           Version: 2.25 (HEAD)
>            Status: NEW
>          Severity: normal
>          Priority: P2
>         Component: binutils
>          Assignee: unassigned at sourceware dot org
>          Reporter: andrew.smirnov at gmail dot com
> 
> Most recent version of binutils-gdb HEAD fails to build on OSX 10.9 with:
> 
> nm.c: In function 'main':
> nm.c:1699:7: error: 'sbrk' is deprecated (declared at
> /usr/include/unistd.h:582) [-Werror=deprecated-declarations]
>       char *lim = (char *) sbrk (0);

This is not very new, and the easiest work-around is to configure with --disable-werror.
Comment 2 Andrey Smirnov 2014-07-08 13:49:10 UTC
(In reply to gingold@adacore.com from comment #1)
> On 07 Jul 2014, at 18:08, andrew.smirnov at gmail dot com
> <sourceware-bugzilla@sourceware.org> wrote:
> 
> 
> This is not very new, and the easiest work-around is to configure with
> --disable-werror.

Well yes, I am sure that issues like this existed ever since -Werror was turned on by default. And the new ones probably surface every time GCC tweaks its definition of -Werror. But just as the one mentioned in my original message this is still a work-around and it doesn't fix the underlying problem.
Comment 3 Sourceware Commits 2022-07-22 03:09:33 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6577f365ebdee7dda71cb996efa29d3714cbccd0

commit 6577f365ebdee7dda71cb996efa29d3714cbccd0
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Jul 22 12:11:24 2022 +0930

    PR17122, OSX 10.9 build failure
    
    sbrk hasn't been used in binutils/ or ld/ for quite some time (so the
    PR was fixed a while ago).  Tidy up configury.
    
            PR 17122
    binutils/
            * configure.ac: Don't check for sbrk.
            * sysdep.h (sbrk): Don't supply fallback declaration.
            * config.in: Regenerate.
            * configure: Regenerate.
    ld/
            * configure.ac: Don't check for sbrk.
            * config.in: Regenerate.
            * configure: Regenerate.
Comment 4 Alan Modra 2022-07-22 03:10:11 UTC
.