diff options
2 files changed, 36 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools/core/0001-memory.h-Always-define-strlcpy-for-glibc-based-syste.patch b/meta-oe/recipes-devtools/android-tools/android-tools/core/0001-memory.h-Always-define-strlcpy-for-glibc-based-syste.patch new file mode 100644 index 0000000000..82e97152be --- /dev/null +++ b/meta-oe/recipes-devtools/android-tools/android-tools/core/0001-memory.h-Always-define-strlcpy-for-glibc-based-syste.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | From db3a3714be07c8ab51b9ae7b035e4afe9f39c645 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 7 Sep 2022 13:20:22 -0700 | ||
| 4 | Subject: [PATCH] memory.h: Always define strlcpy for glibc based systems | ||
| 5 | |||
| 6 | android-config.h file includes on compiler cmdline sets HAVE_STRLCPY | ||
| 7 | unconditionally, since bionic supports it, its no big deal on android | ||
| 8 | and also no problem when using musl since implementation exists for musl | ||
| 9 | too, but glibc does not provide this. So either we include libbsd or use | ||
| 10 | the implementation provided by android-tools here. We are currently | ||
| 11 | using the in tree implementation for systems which do not provide it | ||
| 12 | |||
| 13 | Upstream-Status: Pending | ||
| 14 | |||
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 16 | --- | ||
| 17 | include/cutils/memory.h | 2 +- | ||
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 19 | |||
| 20 | diff --git a/include/cutils/memory.h b/include/cutils/memory.h | ||
| 21 | index e725cdd032..9e99353c58 100644 | ||
| 22 | --- a/include/cutils/memory.h | ||
| 23 | +++ b/include/cutils/memory.h | ||
| 24 | @@ -30,7 +30,7 @@ void android_memset16(uint16_t* dst, uint16_t value, size_t size); | ||
| 25 | /* size is given in bytes and must be multiple of 4 */ | ||
| 26 | void android_memset32(uint32_t* dst, uint32_t value, size_t size); | ||
| 27 | |||
| 28 | -#if !HAVE_STRLCPY | ||
| 29 | +#if !HAVE_STRLCPY || defined(__GLIBC__) | ||
| 30 | /* Declaration of strlcpy() for platforms that don't already have it. */ | ||
| 31 | size_t strlcpy(char *dst, const char *src, size_t size); | ||
| 32 | #endif | ||
| 33 | -- | ||
| 34 | 2.37.3 | ||
| 35 | |||
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb index 37e72de2a6..abd140c7b8 100644 --- a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb +++ b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb | |||
| @@ -45,6 +45,7 @@ SRC_URI = " \ | |||
| 45 | file://core/0015-libsparse-Split-off-most-of-sparse_file_read_normal-.patch;patchdir=system/core \ | 45 | file://core/0015-libsparse-Split-off-most-of-sparse_file_read_normal-.patch;patchdir=system/core \ |
| 46 | file://core/0016-libsparse-Add-hole-mode-to-sparse_file_read.patch;patchdir=system/core \ | 46 | file://core/0016-libsparse-Add-hole-mode-to-sparse_file_read.patch;patchdir=system/core \ |
| 47 | file://core/0017-img2simg-Add-support-for-converting-holes-to-don-t-c.patch;patchdir=system/core \ | 47 | file://core/0017-img2simg-Add-support-for-converting-holes-to-don-t-c.patch;patchdir=system/core \ |
| 48 | file://core/0001-memory.h-Always-define-strlcpy-for-glibc-based-syste.patch;patchdir=system/core \ | ||
| 48 | file://extras/0001-ext4_utils-remove-selinux-extensions.patch;patchdir=system/extras \ | 49 | file://extras/0001-ext4_utils-remove-selinux-extensions.patch;patchdir=system/extras \ |
| 49 | file://extras/0002-ext4_utils-add-o-argument-to-preserve-ownership.patch;patchdir=system/extras \ | 50 | file://extras/0002-ext4_utils-add-o-argument-to-preserve-ownership.patch;patchdir=system/extras \ |
| 50 | file://libselinux/0001-Remove-bionic-specific-calls.patch;patchdir=external/libselinux \ | 51 | file://libselinux/0001-Remove-bionic-specific-calls.patch;patchdir=external/libselinux \ |
