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

12345678910111213141516171819202122232425262728293031323334
  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. Upstream: https://github.com/namhyung/uftrace/pull/1389
  12. ---
  13. cmds/record.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. diff --git a/cmds/record.c b/cmds/record.c
  16. index e750f053..fc4eaed4 100644
  17. --- a/cmds/record.c
  18. +++ b/cmds/record.c
  19. @@ -2110,7 +2110,7 @@ int do_child_exec(int ready, struct opts *opts,
  20. if (opts->no_randomize_addr) {
  21. /* disable ASLR (Address Space Layout Randomization) */
  22. - if (personality(ADDR_NO_RANDOMIZE) < 0)
  23. + if (personality(0x0040000 /* ADDR_NO_RANDOMIZE */) < 0)
  24. pr_dbg("disabling ASLR failed\n");
  25. }
  26. --
  27. 2.30.2