Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1281902pxb; Sun, 12 Sep 2021 13:50:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOOTSWoYwTEiMTYLrfnXL3zDaypsHygdldSuTZgvprAPK6/rMYPv8+t5nEqKqeFJJbA2vT X-Received: by 2002:a05:6638:1301:: with SMTP id r1mr6844549jad.32.1631479839031; Sun, 12 Sep 2021 13:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631479839; cv=none; d=google.com; s=arc-20160816; b=A9n3wUoEl3rNANNjBl9oo3AKEFznfFiDtcBvkcH5g6plKMCLxjKZ1wK7iec28tieEL ArjTndBxHvvXzjZ4oVOpNMjhwtQeIDzLcj12u615VXZPj1OiNT2cCPEVoUJMOEyGRVoA SrqAE0ZdULhvbfHfZhQwQsOn876C/DDwpavPFswyZzy6uHDg+fJQXEgnMv+H4yvF55Ly TbiXozL/By3zq4DSB4l5zUiPJRigogqHchFJrsbrOHtvcytA1iZe5zCxQ2sohfaZ398O BPRNvl0GphfD9m8Ds5Vsz9MnR8f0ocaNCdBISv1/v5WWXXagN7ShExWyeVmNhNAfQNXb Vjpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=VZOUrRkmvwBUoZmO3CLNms/hwkn8p+DZ2ZalDsTC0uo=; b=XkOqbSw93eOtyAM/uck4do/hd/qJ25TIDPtDc3E8RAAVGfeT2mZA+gv86a0p5mUgMG 52KGYcKGDM9wm/p11Tn1PTZgl9bZOukbKswt04xWwlW+OvbFPZmTyOHcT9P1Rk6rqnta olbQ/qT6jB9990jd982c5duUvdGQ9coYZNhmCn4MJHnmZm6Veh4FPkX4EAdKNWTWHvoX /mCzs9HFFVq4VJu5IdawTsaMj9cax6Pe/3XJOX1hlAhpyd7/FbVT4WsdZ7DG5fYJFUuF gzyqDC4beECNPTr/xXrg/3fO0hlg8HVanqAO4EfRGzzfC3M1A2vPe5fgVD5QIjM3HVWK jsBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="CRX/X2f/"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x17si4938057ilc.170.2021.09.12.13.50.07; Sun, 12 Sep 2021 13:50:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="CRX/X2f/"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236221AbhILUuO (ORCPT + 99 others); Sun, 12 Sep 2021 16:50:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231560AbhILUuL (ORCPT ); Sun, 12 Sep 2021 16:50:11 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34681C061574 for ; Sun, 12 Sep 2021 13:48:57 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id d6so11386803wrc.11 for ; Sun, 12 Sep 2021 13:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VZOUrRkmvwBUoZmO3CLNms/hwkn8p+DZ2ZalDsTC0uo=; b=CRX/X2f/2DUewgJ6l36+yiuWvgwnoesI7pIQ5pSj301N1Q/XQHI9fsgRdCBvWXaVLj P2UXjyQKMBA6It7DNqkV15YmTAHCZmABG/SCe+hjvr3bJoqFiUiNojQH1b7aqeYmI1nd zOb9JVmNe37eLi8VYqlO2Ql1m5zqWY0uhAs3wrnVqz9lmjhsLz6t+17GmR6pc0hJ923/ iUQElAMISDjtuXwWz1o6lZ/GwZa+PQRrTywOM/D5UucywCAdRxUyd4TWG16ZUuCl0rQt UNDAqTC3UTixR0LDt4npCIu4e5czK0MGUvwRoAeN86YJtLOPLn0tDddrBhcn4YIbfjN9 Scjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VZOUrRkmvwBUoZmO3CLNms/hwkn8p+DZ2ZalDsTC0uo=; b=D7+Qu7lmUN27H+Ii5o5tCbQWvVq1e90hNDrbQDUSyi0FNrc7pRiBMYDRMsrYNe9i4L Uzib5WlrYOjnzlfXg1sFYDYvBCPxHEQjHyq+QmjPbtPmwdtfKGUdn7/5Ck+evA8MrXdm VNii8dw8CSA90jf+vFfFC0JBtXXWSv/jRIfvfkqHxJOxi52Dm5sqhdR+5nOjQ3eQuiM4 mfJYP09w8828yGhacpf/iBP5AamZUdG7qRKarvJaOA7p7m3TxvICjg4bSYxYv5/mKE+O mXHZniyKRhcxLrl/raa+5t86OwpaGlq8aJb/acW1mZhchb2HXDSGaryD+SvPyJn4KPej iTMg== X-Gm-Message-State: AOAM533Gme/lzX9aShfUb8s7g9H1atrBWhFhn3JpGDw+hW7zn6Juh5Sk 8XGebr67gjni9OMN94bGeg6S5jCaXME= X-Received: by 2002:adf:db8e:: with SMTP id u14mr6684890wri.55.1631479735500; Sun, 12 Sep 2021 13:48:55 -0700 (PDT) Received: from kali.home (lfbn-ren-1-2139-166.w92-167.abo.wanadoo.fr. [92.167.218.166]) by smtp.gmail.com with ESMTPSA id z5sm5076266wmf.33.2021.09.12.13.48.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 13:48:55 -0700 (PDT) From: Fabrice Fontaine To: linux-bluetooth@vger.kernel.org Cc: Fabrice Fontaine , "Yann E . MORIN" Subject: [PATCH] profiles/audio/media.c: fix build with glibc >= 2.34 Date: Sun, 12 Sep 2021 22:48:39 +0200 Message-Id: <20210912204839.3018089-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org pause() is defined in glibc since the very early times; it appears in upstream commit 28f540f45bba (initial import) in 1995 [0]. Bluez has been defining a function named pause() for ages too, since commit caab74c97542 (media: Implement new callbacks for pass-through operations) in 2013 [1] With the recent bump to glibc 2.34.xxx, the build now fails because the two pause() clash: profiles/audio/media.c:1284:13: error: conflicting types for 'pause' 1284 | static bool pause(void *user_data) | ^~~~~ In file included from /tmp/instance-0/output-1/per-package/bluez5_utils/host/s390x-buildroot-linux-gnu/sysroot/usr/include/bits/sigstksz.h:24, from /tmp/instance-0/output-1/per-package/bluez5_utils/host/s390x-buildroot-linux-gnu/sysroot/usr/include/signal.h:328, from /tmp/instance-0/output-1/per-package/bluez5_utils/host/bin/../s390x-buildroot-linux-gnu/sysroot/usr/include/glib-2.0/glib/gbacktrace.h:36, from /tmp/instance-0/output-1/per-package/bluez5_utils/host/bin/../s390x-buildroot-linux-gnu/sysroot/usr/include/glib-2.0/glib.h:34, from profiles/audio/media.c:21: /tmp/instance-0/output-1/per-package/bluez5_utils/host/s390x-buildroot-linux-gnu/sysroot/usr/include/unistd.h:489:12: note: previous declaration of 'pause' was here 489 | extern int pause (void); | ^~~~~ The culprit is indeed glibc 2.34, as can be seen in this result matrix: \ bluez5_utils glibc \ 5.60 | 5.61 -------\-------+-------- 2.33 | OK | OK -------+-------+-------- 2.34 | KO | KO The underlying reason that pause() is now causing issues with glibc 2.34 is not obvious: glibc is a big beast, and finding such issues is not easy. However, we can see that the pause() provided by NPTL has been dropped in favour of the generic one, so maybe this is causing symbol visibility or weakness to change or something... We fix that by renaming the local pause() in bluez5_utils with a namespace-prefix, like some other functions there already have. Fixes: - http://autobuild.buildroot.org/results/c4fbface34be8815838fd7201621d7a8fddd32c5 - http://autobuild.buildroot.org/results/62b88740f19fbe4a1ad7959dc141d539eb88c1f8 [0] https://sourceware.org/git/?p=glibc.git;a=commit;h=28f540f45bbacd939bfd07f213bcad2bf730b1bf [1] https://github.com/bluez/bluez/commit/caab74c97542a56b591f0b16b44ab6ba4b40f0f5 Signed-off-by: Fabrice Fontaine Signed-off-by: Yann E. MORIN --- profiles/audio/media.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 267722542..f93b74e67 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1281,7 +1281,7 @@ static bool stop(void *user_data) return media_player_send(mp, "Stop"); } -static bool pause(void *user_data) +static bool media_player_pause(void *user_data) { struct media_player *mp = user_data; @@ -1331,7 +1331,7 @@ static struct avrcp_player_cb player_cb = { .set_volume = set_volume, .play = play, .stop = stop, - .pause = pause, + .pause = media_player_pause, .next = next, .previous = previous, }; -- 2.33.0