From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EBD2C138334 for ; Tue, 25 Jun 2019 06:42:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F2792E087E; Tue, 25 Jun 2019 06:42:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D474BE087E for ; Tue, 25 Jun 2019 06:42:16 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 94AE43469B0 for ; Tue, 25 Jun 2019 06:42:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 886EB5E2 for ; Tue, 25 Jun 2019 06:42:13 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1561444745.ed72f5d07f627464a95ab377cd101d90d4d10c7d.slyfox@gentoo> Subject: [gentoo-commits] proj/sandbox:master commit in: libsandbox/ X-VCS-Repository: proj/sandbox X-VCS-Files: libsandbox/trace.c X-VCS-Directories: libsandbox/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: ed72f5d07f627464a95ab377cd101d90d4d10c7d X-VCS-Branch: master Date: Tue, 25 Jun 2019 06:42:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7d18917e-c6aa-4ab8-83dc-b0dbb07e136c X-Archives-Hash: ea2ecfaef89f98f77911ba127d63cf0b commit: ed72f5d07f627464a95ab377cd101d90d4d10c7d Author: Sergei Trofimovich gentoo org> AuthorDate: Sun Jun 23 20:48:26 2019 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Tue Jun 25 06:39:05 2019 +0000 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=ed72f5d0 libsandbox/trace.c: tweak ptrace command type for musl glibc defines ptrace as: long ptrace(enum __ptrace_request request, pid_t pid, void *addr, void *data); musl defines ptrace as: long ptrace(int, ...); This causes build failure in for of: ../../sandbox-2.17/libsandbox/trace/linux/x86_64.c: In function 'trace_set_ret': ../../sandbox-2.17/libsandbox/trace/linux/x86_64.c:99:2: error: type of formal parameter 1 is incomplete trace_set_regs(regs); ^~~~~~~~~~~~~~ Let's clobber to 'int' lowest common denominator. Bug: https://bugs.gentoo.org/549108 Signed-off-by: Sergei Trofimovich gentoo.org> libsandbox/trace.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libsandbox/trace.c b/libsandbox/trace.c index fb1fc32..3efef23 100644 --- a/libsandbox/trace.c +++ b/libsandbox/trace.c @@ -10,7 +10,16 @@ #include "sb_nr.h" static long do_peekdata(long offset); -static long _do_ptrace(enum __ptrace_request request, const char *srequest, void *addr, void *data); +/* Note on _do_ptrace argument types: + glibc defines ptrace as: + long ptrace(enum __ptrace_request request, pid_t pid, void *addr, void *data); + musl defines ptrace as: + long ptrace(int, ...); + + Let's clobber to 'int' lowest common denominator. + */ +typedef int sb_ptrace_req_t; +static long _do_ptrace(sb_ptrace_req_t request, const char *srequest, void *addr, void *data); #define do_ptrace(request, addr, data) _do_ptrace(request, #request, addr, data) #define _trace_possible(data) true @@ -44,7 +53,7 @@ static void trace_exit(int status) _exit(status); } -static long _do_ptrace(enum __ptrace_request request, const char *srequest, void *addr, void *data) +static long _do_ptrace(sb_ptrace_req_t request, const char *srequest, void *addr, void *data) { long ret; try_again: