mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-11-23 21:20:25 -10:00
This commit adds 3 patches that fix various implicit declarations error that arise with GCC 14.x. Fixes host-android-tools build issues: http://autobuild.buildroot.net/results/1fd0d0a9547d4ad2a24916eb79230d49a825e694 http://autobuild.buildroot.net/results/9e3bb951d7db1c8a8725b5570c54f6dec0e8b344 http://autobuild.buildroot.net/results/8c9345fcad6e935c13b16c318bbb27282de10ac1 http://autobuild.buildroot.net/results/4e8a2ce69bfb8a86da2711cb32a99ad51b0bdf5f http://autobuild.buildroot.net/results/ca6310cfcb0a9787eb5cec3c33aab903f4964cab http://autobuild.buildroot.net/results/a77509d4df8281d666d870faeb008f9196d3bbc3 http://autobuild.buildroot.net/results/74cdcbcbe8bab244b1c368260162e3cef133376f http://autobuild.buildroot.net/results/225b2722b030b1ea1706db8dd54d62da81d8725b As well as android-tools build issues: http://autobuild.buildroot.net/results/abfaf53328d0b29c778f75e105cc7043f2ad44fe http://autobuild.buildroot.net/results/d2467a2ac4a915d850cc8bc2341d9803346604a9 http://autobuild.buildroot.net/results/a4cf59ce479b7db7f0a3269c0462ce1ccc9f600e http://autobuild.buildroot.net/results/667a49bff45b226dec4349d54f977c8bd6abadd5 http://autobuild.buildroot.net/results/92cf3eea0e0d7531220cd9850993e269a3a4744d Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
53 lines
1.7 KiB
Diff
53 lines
1.7 KiB
Diff
From 2b5060146b0890f7f1a63ef891af1358b8cdf9bc Mon Sep 17 00:00:00 2001
|
|
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
Date: Sun, 14 Jul 2024 12:57:22 +0200
|
|
Subject: [PATCH] core/adbd/adb.c: open code capset()
|
|
|
|
capset() is apparently implemented by C libraries (at least glibc and
|
|
musl), but not exposed through a header as an official public API.
|
|
|
|
In addition capset(2) says:
|
|
|
|
Note: glibc provides no wrappers for these system calls,
|
|
necessitating the use of syscall(2)
|
|
|
|
The lack of a header with a prototype for capset() was not causing any
|
|
problem so far, but GCC 14.x has become stricter on implicit
|
|
declarations, causing the build to fail with:
|
|
|
|
core/adbd/adb.c:1296:9: error: implicit declaration of function 'capset' [-Wimplicit-function-declaration]
|
|
|
|
So fix that by open-coding it using syscall() as suggested by the man
|
|
page.
|
|
|
|
Upstream: N/A, we're too far from upstream
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
---
|
|
core/adbd/adb.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/core/adbd/adb.c b/core/adbd/adb.c
|
|
index 7fe6445..98b1de1 100644
|
|
--- a/core/adbd/adb.c
|
|
+++ b/core/adbd/adb.c
|
|
@@ -41,6 +41,7 @@
|
|
#if !ADB_HOST
|
|
#include "android_filesystem_config.h"
|
|
#include <linux/capability.h>
|
|
+#include <sys/syscall.h>
|
|
#include <linux/prctl.h>
|
|
#include <sys/mount.h>
|
|
#else
|
|
@@ -1293,7 +1294,7 @@ int adb_main(int is_daemon, int server_port)
|
|
header.pid = 0;
|
|
cap[CAP_TO_INDEX(CAP_SYS_BOOT)].effective |= CAP_TO_MASK(CAP_SYS_BOOT);
|
|
cap[CAP_TO_INDEX(CAP_SYS_BOOT)].permitted |= CAP_TO_MASK(CAP_SYS_BOOT);
|
|
- capset(&header, cap);
|
|
+ syscall(SYS_capset, &header, cap);
|
|
|
|
D("Local port disabled\n");
|
|
} else {
|
|
--
|
|
2.45.2
|
|
|