public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
@ 2021-11-06 12:20 ps.report at gmx dot net
  2021-11-08 17:15 ` [Bug build/28555] " simark at simark dot ca
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: ps.report at gmx dot net @ 2021-11-06 12:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

            Bug ID: 28555
           Summary: uclibc compile failure since commit
                    4655f8509fd44e6efabefa373650d9982ff37fd6
           Product: gdb
           Version: 11.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: ps.report at gmx dot net
  Target Milestone: ---

The buildroot cross-compile of gdb with uclibc fails for 11.1 since commit
4655f8509fd44e6efabefa373650d9982ff37fd6 ([1]), see [2] for details:

      ../../gdbserver/../gdb/nat/linux-personality.c: In constructor
‘maybe_disable_address_space_randomization::maybe_disable_address_space_randomization(int)’:
      ../../gdbserver/../gdb/nat/linux-personality.c:36:48: error:
‘ADDR_NO_RANDOMIZE’ was not declared in this scope
         36 |       if (errno == 0 && !(m_personality_orig &
ADDR_NO_RANDOMIZE))
            |                                                ^~~~~~~~~~~~~~~~~
      ../../gdbserver/../gdb/nat/linux-personality.c:42:37: error:
‘ADDR_NO_RANDOMIZE’ was not declared in this scope
         42 |     && !(personality (0xffffffff) & ADDR_NO_RANDOMIZE)))
            |                                     ^~~~~~~~~~~~~~~~~


>From the commit changelog:

    [...]
    If for some odd reason, some remotely modern system still needs a
    configure check, then we can revert this commit but drop the
    AC_RUN_IFELSE in favor of always doing the AC_LINK_IFELSE
    cross-compile fallback.
    [...]

[1]
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=4655f8509fd44e6efabefa373650d9982ff37fd6

[2] http://lists.busybox.net/pipermail/buildroot/2021-November/627651.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
@ 2021-11-08 17:15 ` simark at simark dot ca
  2021-11-08 17:15 ` simark at simark dot ca
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2021-11-08 17:15 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
So, the issue is just that the uclibc libc did not have an ADDR_NO_RANDOMIZE
value.  But all the kernels it runs on presumably do support that personality
call.  So we could just define the value in our code ourselves.  Unfortunately,
it is not exposed as a macro, so it's not as simple as:

#if !defined(ADDR_NO_RANDOMIZE)
# define ADDR_NO_RANDOMIZE ...
#endif

So we could add back an AC_COMPILE_IFELSE configure test to see if the value is
provided by the system, and we could define it ourselves otherwise.  Or
simpler, since this value is not likely to change ever, would be to just do:

#define GDB_ADDR_NO_RANDOMIZE 0x0040000

and use that.

In the mean time, I see that Thomas (from Buildroot) has patched uclibc to add
the ADDR_NO_RANDOMIZE value, so future releases / deployments will include it:

https://repo.or.cz/uclibc-ng.git/commit/85ac4f04d94e98389a8315e720630d0f95bfdfd6

I have also tried to change the code to include the Linux kernel-provided
header <linux/personality.h>, but that does not work.  If I include it instead
of <sys/personality.h>, then the code doesn't see the personality function that
wraps the syscall (provided by the libc).  If I include it in addition to
<sys/personality.h>, then there are duplicate enum definitions.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
  2021-11-08 17:15 ` [Bug build/28555] " simark at simark dot ca
@ 2021-11-08 17:15 ` simark at simark dot ca
  2021-11-08 18:00 ` pedro at palves dot net
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2021-11-08 17:15 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pedro at palves dot net

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
  2021-11-08 17:15 ` [Bug build/28555] " simark at simark dot ca
  2021-11-08 17:15 ` simark at simark dot ca
@ 2021-11-08 18:00 ` pedro at palves dot net
  2021-11-08 19:16 ` simark at simark dot ca
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pedro at palves dot net @ 2021-11-08 18:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

Pedro Alves <pedro at palves dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Pedro Alves <pedro at palves dot net> ---
Tromey also ran into something similar on RH ES5:

 https://sourceware.org/pipermail/gdb-patches/2021-May/178801.html

> Or simpler, since this value is not likely to change ever, would be to just do:
> #define GDB_ADDR_NO_RANDOMIZE 0x0040000
> and use that.

That seems fine to me.  This value isn't going to ever change since changing it
would be an ABI break.  The actual trouble would be if different architectures
defined the constant differently, which I don't think is the case.

I have no idea whether uclibc users are able to build unpatched gdb, or if the
uclibc project carries some local patches.  If the latter, maybe we can just
ignore this since it's been fixed for the next release.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
                   ` (2 preceding siblings ...)
  2021-11-08 18:00 ` pedro at palves dot net
@ 2021-11-08 19:16 ` simark at simark dot ca
  2021-11-08 19:42 ` tromey at sourceware dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2021-11-08 19:16 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

--- Comment #3 from Simon Marchi <simark at simark dot ca> ---
> I have no idea whether uclibc users are able to build unpatched gdb, or if
> the uclibc project carries some local patches.  If the latter, maybe we can
> just ignore this since it's been fixed for the next release.

Buildroot can carry a local GDB patch, but it doesn't really make sense for
uclibc (or I don't understand what you mean).  The idea would be to change GDB
to have it build on existing uclibc systems, because the change in uclibc will
take some time to reach users.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
                   ` (3 preceding siblings ...)
  2021-11-08 19:16 ` simark at simark dot ca
@ 2021-11-08 19:42 ` tromey at sourceware dot org
  2021-11-08 20:42 ` simark at simark dot ca
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2021-11-08 19:42 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Pedro Alves from comment #2)
> Tromey also ran into something similar on RH ES5:
> 
>  https://sourceware.org/pipermail/gdb-patches/2021-May/178801.html

I can send the full patch if someone wants it, just let me know.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
                   ` (4 preceding siblings ...)
  2021-11-08 19:42 ` tromey at sourceware dot org
@ 2021-11-08 20:42 ` simark at simark dot ca
  2021-11-08 21:29 ` tromey at sourceware dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: simark at simark dot ca @ 2021-11-08 20:42 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

--- Comment #5 from Simon Marchi <simark at simark dot ca> ---
(In reply to Tom Tromey from comment #4)
> (In reply to Pedro Alves from comment #2)
> > Tromey also ran into something similar on RH ES5:
> > 
> >  https://sourceware.org/pipermail/gdb-patches/2021-May/178801.html
> 
> I can send the full patch if someone wants it, just let me know.

The patch you describe sounds like what I suggested above, so if you can send
it, I think we can merge it without much effort.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
                   ` (5 preceding siblings ...)
  2021-11-08 20:42 ` simark at simark dot ca
@ 2021-11-08 21:29 ` tromey at sourceware dot org
  2021-11-09 15:29 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2021-11-08 21:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2021-November/183256.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
                   ` (6 preceding siblings ...)
  2021-11-08 21:29 ` tromey at sourceware dot org
@ 2021-11-09 15:29 ` cvs-commit at gcc dot gnu.org
  2021-11-09 15:30 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-09 15:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

--- Comment #7 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

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

commit 0b03c6f03d51f441d999e0cee92f81af543d9373
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed May 12 12:39:22 2021 -0600

    Fix build on rhES5

    The rhES5 build failed due to an upstream import a while back.  The
    bug here is that, while the 'personality' function exists,
    ADDR_NO_RANDOMIZE is only defined in <linux/personality.h>, not
    <sys/personality.h>.

    However, <linux/personality.h> does not declare the 'personality'
    function, and <sys/personality.h> and <linux/personality.h> cannot
    both be included.

    This patch restores one of the removed configure checks and updates
    the code to check it.

    We had this as a local patch at AdaCore, because it seemed like there
    was no interest upstream.  However, now it turns out that this fixes
    PR build/28555, so I'm sending it now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
                   ` (7 preceding siblings ...)
  2021-11-09 15:29 ` cvs-commit at gcc dot gnu.org
@ 2021-11-09 15:30 ` tromey at sourceware dot org
  2021-11-09 18:01 ` ps.report at gmx dot net
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2021-11-09 15:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
I think this is fixed on trunk now.
Can you try it?  If it works, I can backport the fix to the gdb 11 branch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
                   ` (8 preceding siblings ...)
  2021-11-09 15:30 ` tromey at sourceware dot org
@ 2021-11-09 18:01 ` ps.report at gmx dot net
  2021-11-09 21:26 ` cvs-commit at gcc dot gnu.org
  2021-11-09 21:26 ` tromey at sourceware dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ps.report at gmx dot net @ 2021-11-09 18:01 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

--- Comment #9 from Peter Seiderer <ps.report at gmx dot net> ---
(In reply to Tom Tromey from comment #8)
> I think this is fixed on trunk now.
> Can you try it?  If it works, I can backport the fix to the gdb 11 branch.

Thanks for the fix, works for the buildroot use case (with pre-build toolchain
using an version of uclibc-ng predating the mentioned fix) too (see [1] for
details)...

[1] http://lists.busybox.net/pipermail/buildroot/2021-November/628266.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
                   ` (9 preceding siblings ...)
  2021-11-09 18:01 ` ps.report at gmx dot net
@ 2021-11-09 21:26 ` cvs-commit at gcc dot gnu.org
  2021-11-09 21:26 ` tromey at sourceware dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-09 21:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

--- Comment #10 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-11-branch branch has been updated by Tom Tromey
<tromey@sourceware.org>:

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

commit df9ebc472a162306dee8ba6e02b99963c2babb7c
Author: Tom Tromey <tromey@adacore.com>
Date:   Wed May 12 12:39:22 2021 -0600

    Fix build on rhES5

    The rhES5 build failed due to an upstream import a while back.  The
    bug here is that, while the 'personality' function exists,
    ADDR_NO_RANDOMIZE is only defined in <linux/personality.h>, not
    <sys/personality.h>.

    However, <linux/personality.h> does not declare the 'personality'
    function, and <sys/personality.h> and <linux/personality.h> cannot
    both be included.

    This patch restores one of the removed configure checks and updates
    the code to check it.

    We had this as a local patch at AdaCore, because it seemed like there
    was no interest upstream.  However, now it turns out that this fixes
    PR build/28555, so I'm sending it now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug build/28555] uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6
  2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
                   ` (10 preceding siblings ...)
  2021-11-09 21:26 ` cvs-commit at gcc dot gnu.org
@ 2021-11-09 21:26 ` tromey at sourceware dot org
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2021-11-09 21:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28555

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |11.2

--- Comment #11 from Tom Tromey <tromey at sourceware dot org> ---
Fixed on the branch now too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-11-09 21:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06 12:20 [Bug build/28555] New: uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6 ps.report at gmx dot net
2021-11-08 17:15 ` [Bug build/28555] " simark at simark dot ca
2021-11-08 17:15 ` simark at simark dot ca
2021-11-08 18:00 ` pedro at palves dot net
2021-11-08 19:16 ` simark at simark dot ca
2021-11-08 19:42 ` tromey at sourceware dot org
2021-11-08 20:42 ` simark at simark dot ca
2021-11-08 21:29 ` tromey at sourceware dot org
2021-11-09 15:29 ` cvs-commit at gcc dot gnu.org
2021-11-09 15:30 ` tromey at sourceware dot org
2021-11-09 18:01 ` ps.report at gmx dot net
2021-11-09 21:26 ` cvs-commit at gcc dot gnu.org
2021-11-09 21:26 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).