0001-cmds-records-replace-ADDR_NO_RANDOMIZE-by-its-value.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. From dc0a75b1679debbc3712b262e5127e90961f92db Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  3. Date: Fri, 23 Apr 2021 22:57:56 +0200
  4. Subject: [PATCH] cmds/records: replace ADDR_NO_RANDOMIZE by its value
  5. uClibc-ng lacks the definition of ADDR_NO_RANDOMIZE, causing a build
  6. failure. A patch was submitted to upstream uClibc-ng to address this
  7. issue, but in the mean time, use an hardcoded value.
  8. Using a #ifdef ... #endif test doesn't work as this value is defined
  9. through an enum in glibc.
  10. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  11. ---
  12. cmds/record.c | 2 +-
  13. 1 file changed, 1 insertion(+), 1 deletion(-)
  14. diff --git a/cmds/record.c b/cmds/record.c
  15. index e750f053..fc4eaed4 100644
  16. --- a/cmds/record.c
  17. +++ b/cmds/record.c
  18. @@ -2110,7 +2110,7 @@ int do_child_exec(int ready, struct opts *opts,
  19. if (opts->no_randomize_addr) {
  20. /* disable ASLR (Address Space Layout Randomization) */
  21. - if (personality(ADDR_NO_RANDOMIZE) < 0)
  22. + if (personality(0x0040000 /* ADDR_NO_RANDOMIZE */) < 0)
  23. pr_dbg("disabling ASLR failed\n");
  24. }
  25. --
  26. 2.30.2