diff options
Diffstat (limited to 'meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch')
-rw-r--r-- | meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch b/meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch new file mode 100644 index 000000000..1142df0be --- /dev/null +++ b/meta-oe/recipes-support/gperftools/gperftools/0001-src-mmap_hook.cc-Fix-build-for-32bit-machine.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From d675808d300278a9e7143428cfecf3fda61cc9a2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Thu, 21 Mar 2024 10:59:29 +0000 | ||
4 | Subject: [PATCH] src/mmap_hook.cc: Fix build for 32bit machine | ||
5 | |||
6 | Fixed build error on 32bit machine: | ||
7 | |||
8 | ../git/src/mmap_hook.cc:309:31: error: static assertion failed | ||
9 | 309 | static_assert(sizeof(int32_t) == sizeof(off_t), ""); | ||
10 | |||
11 | This is because oe's off_t is 64bit on both 32 and 64bit system, which is the | ||
12 | default value of glibc, so the assertion would be failed on 32bit system, and | ||
13 | remove mmap() and mmap64() to fix the redefined error. | ||
14 | |||
15 | Upstream-Status: Inappropriate [OE-Specific] | ||
16 | |||
17 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
18 | --- | ||
19 | src/mmap_hook.cc | 22 ---------------------- | ||
20 | 1 file changed, 22 deletions(-) | ||
21 | |||
22 | diff --git a/src/mmap_hook.cc b/src/mmap_hook.cc | ||
23 | index 0a0f62f..27425e4 100644 | ||
24 | --- a/src/mmap_hook.cc | ||
25 | +++ b/src/mmap_hook.cc | ||
26 | @@ -302,30 +302,8 @@ void* mmap(void* start, size_t length, int prot, int flags, int fd, off_t off) _ | ||
27 | |||
28 | #define HOOKED_MMAP | ||
29 | |||
30 | -#elif defined(DEFINED_DO_MMAP) && defined(__linux__) && !GOOD_LINUX_SYSTEM | ||
31 | -// Linuxes with 32-bit off_t. We're being careful with mmap64 being | ||
32 | -// 64-bit and mmap being 32-bit. | ||
33 | - | ||
34 | -static_assert(sizeof(int32_t) == sizeof(off_t), ""); | ||
35 | - | ||
36 | -extern "C" void* mmap64(void* start, size_t length, int prot, int flags, int fd, int64_t off) | ||
37 | - __THROW ATTRIBUTE_SECTION(malloc_hook); | ||
38 | -extern "C" void* mmap(void* start, size_t length, int prot, int flags, int fd, off_t off) | ||
39 | - __THROW ATTRIBUTE_SECTION(malloc_hook); | ||
40 | - | ||
41 | -void* mmap(void *start, size_t length, int prot, int flags, int fd, off_t off) __THROW { | ||
42 | - return do_mmap_with_hooks(start, length, prot, flags, fd, off); | ||
43 | -} | ||
44 | - | ||
45 | -void* mmap64(void *start, size_t length, int prot, int flags, int fd, int64_t off) __THROW { | ||
46 | - return do_mmap_with_hooks(start, length, prot, flags, fd, off); | ||
47 | -} | ||
48 | - | ||
49 | -#define HOOKED_MMAP | ||
50 | - | ||
51 | #endif // Linux/32-bit off_t case | ||
52 | |||
53 | - | ||
54 | #ifdef HOOKED_MMAP | ||
55 | |||
56 | extern "C" int munmap(void* start, size_t length) __THROW ATTRIBUTE_SECTION(malloc_hook); | ||
57 | -- | ||
58 | 2.35.5 | ||
59 | |||