[commit] Fix regression on RHEL-5 systems (was: Re: [PATCH 2/2] Move code to disable ASR to nat/)
Commit Message
On Friday, January 16 2015, Ulrich Weigand wrote:
> Sergio Durigan Junior wrote:
>
>> This patch moves the shared code present on
>> gdb/linux-nat.c:linux_nat_create_inferior and
>> gdb/gdbserver/linux-low.c:linux_create_inferior to
>> nat/linux-personality.c. This code is responsible for disabling
>> address space randomization based on user setting, and using
>> <sys/personality.h> to do that. I decided to put the prototype of the
>> maybe_disable_address_space_randomization on nat/linux-osdata.h
>> because it seemed the best place to put it.
>
> This breaks building on my RHEL 5 machine:
>
> /home/uweigand/dailybuild/spu-tc-2015-01-15/binutils-gdb-head/binutils-gdb/gdb/nat/linux-personality.c: In function 'maybe_disable_address_space_randomization':
> /home/uweigand/dailybuild/spu-tc-2015-01-15/binutils-gdb-head/binutils-gdb/gdb/nat/linux-personality.c:80: error: 'ADDR_NO_RANDOMIZE' undeclared (first use in this function)
> /home/uweigand/dailybuild/spu-tc-2015-01-15/binutils-gdb-head/binutils-gdb/gdb/nat/linux-personality.c:80: error: (Each undeclared identifier is reported only once
> /home/uweigand/dailybuild/spu-tc-2015-01-15/binutils-gdb-head/binutils-gdb/gdb/nat/linux-personality.c:80: error: for each function it appears in.)
Ops. Thanks for letting me know, Ulrich.
> It looks like this is because you replaced:
>> -# if !HAVE_DECL_ADDR_NO_RANDOMIZE
> by:
>> +# ifndef HAVE_DECL_ADDR_NO_RANDOMIZE
>
> but config.h on my machine without ADDR_NO_RANDOMIZE contains:
> #define HAVE_DECL_ADDR_NO_RANDOMIZE 0
I took the liberty to go ahead and push the following patch as obvious.
Please let me know if there is anything else needed.
Thanks,
@@ -1,3 +1,10 @@
+2015-01-16 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * nat/linux-personality.c: Replace "#ifndef
+ HAVE_DECL_ADDR_NO_RANDOMIZE" by "#if
+ !HAVE_DECL_ADDR_NO_RANDOMIZE", fixing a regression in RHEL-5
+ systems.
+
2015-01-16 Eli Zaretskii <eliz@gnu.org>
* tui/tui-win.c (tui_rehighlight_all, tui_set_var_cmd): New
@@ -22,7 +22,7 @@
#ifdef HAVE_PERSONALITY
# include <sys/personality.h>
-# ifndef HAVE_DECL_ADDR_NO_RANDOMIZE
+# if !HAVE_DECL_ADDR_NO_RANDOMIZE
# define ADDR_NO_RANDOMIZE 0x0040000
# endif /* ! HAVE_DECL_ADDR_NO_RANDOMIZE */
#endif /* HAVE_PERSONALITY */