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