Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp137175pxb; Fri, 17 Sep 2021 21:33:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO/vn8thTk8j2WyHkptjGz5whLuH0zbYT3pmLEuLZ1x1PtOXETQZhnN6nmLIcMtsOdwYxT X-Received: by 2002:a17:906:9742:: with SMTP id o2mr16592741ejy.532.1631939618529; Fri, 17 Sep 2021 21:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631939618; cv=none; d=google.com; s=arc-20160816; b=kw4LwsuwUuZsOONHVtyZU/hMx8+SW6SFHOxtdLrI2HVwU0grNlfcUxy1MYgLRwwb7V 4JYRy765KL55WLFgSMH7vHzO7aBX0gZxMP3nOwzy9axl8Bquyv/FK4ymt0UM7fqKEbot G8dYjOcikhXITOzJlxsvZ3KQbAEaOjOC8KBB+4y5XQyHDhpisuEMhCz2zUgFUj+P2G8o lsbzIj7Ovj1s3ALXMgVp7aO57UwPGwXUOSYqVyYwflaP2/6R9H9EjhHEfMDNMd3W5o5k rcX7EXaKPUWuUrT6eEUONCkpZY//4VjOqxQjb8oRdQLfyPoxuxNXUh7vUOMwflcGw+PS FJTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=leqqlflc5Zj8QAfEwMsGbfmJBdTHkTrafJRNrhkm1PU=; b=NcHndUeLv3nPISlWNjL9O3iB54fipr0tuh9EIiZJ0vnW01yTIXe14iDvsU5QScZETd Bn4BkZkDJQVJKt3NUgyiocomH7+L8XGA/8HZi0gknX7L9xeo1ctStG+8PhsELOCWD/it JLlKWKvcjE1fQeTUgI/qmvYOnagvQ8S1sTjpdtw1czhw2YweN/JLAkEZ61DxEYs7a+Q3 XpjD4G83rryz2RZTpEJ4A4lCF63l1TP6IGPc2YGsJTbVMNsrRTRqKHCluKg/uQ/GGYK5 2IyO2QsNXwaDoy6Q3DJUWiVNQt7GtO+MIt2/IZpnxXkMj1RMhjmHLIVwFyPXqBRso4AW XoKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=j5QDMAxi; 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 t10si8533850edw.118.2021.09.17.21.33.02; Fri, 17 Sep 2021 21:33:38 -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=j5QDMAxi; 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 S232965AbhIQUzI (ORCPT + 99 others); Fri, 17 Sep 2021 16:55:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232556AbhIQUzI (ORCPT ); Fri, 17 Sep 2021 16:55:08 -0400 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD080C061574 for ; Fri, 17 Sep 2021 13:53:45 -0700 (PDT) Received: by mail-vs1-xe35.google.com with SMTP id n17so10009455vsr.10 for ; Fri, 17 Sep 2021 13:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=leqqlflc5Zj8QAfEwMsGbfmJBdTHkTrafJRNrhkm1PU=; b=j5QDMAxibLNi52O8EyxVZNH3msXP611HED0cRsRUGeqIlizw3VqRiFC9k8YMShwvgk tjUHHvcjEtB18DQyVyfZdzGPfdpEo8uUMtpEaPhDe09y9sZLvg7smzRd8beOH1mvwxPS Ajn82i4uO6nonSrLCdpoW1PN+U0k82ElTxxiNue3NJbtkyTzKUvVoKICRVHPO5z2QiYt 6jD6Bfvag+je2Y3hXkOSHPVBr2GrD2Vt0w9xnIcEEER3XlSElQrLc5gnkHGDgPDCkr2W GMwq2MduunzNYMdqqM1RmeM5Gh1tT6Qq7+14c6VAWQLjPHQmSV9pZibV8YNT5jpdKcFm lEiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=leqqlflc5Zj8QAfEwMsGbfmJBdTHkTrafJRNrhkm1PU=; b=uPeZDA+/07uFEyDDDDp2B5k2C9YkBg8Imi71/liy/VnR0FpPlgycxVH4e8J/uezf+o gfTl+/NSPwcLjna+hVpqGV/F/x/j52vQEjsP7RDLvFU6Pejv/vPAMo87IdQEmM/yWKc4 FbLPLl93mz2CVewYoPYVit90wxe4JMsMQGbkGuNVKqOhQleZsUNyX9WjwmGi+v39jGXI 6CTa9FdKscmZHQ0exVuKg+3lCP5v8E7j5gpJyMziubiC3BDabz2rUw/wO2YxcBdxk4xV DV4Gebb4YI1FH4AkvVZzsunUYXb0JC6c1BU5ek7/xZVHK9XiIvjdEKu3WAVWl8Mm3jEJ lgrQ== X-Gm-Message-State: AOAM532+e2A/XdaTiuQHPrKHXZxxa9t3BbLoYrUqf5DfqEMKuzJzvDdV qnRueglpTzJQok44JpcXgT6XRARrayKzL8fFH+Y= X-Received: by 2002:a05:6102:21d0:: with SMTP id r16mr74618vsg.39.1631912024659; Fri, 17 Sep 2021 13:53:44 -0700 (PDT) MIME-Version: 1.0 References: <20210912204839.3018089-1-fontaine.fabrice@gmail.com> In-Reply-To: <20210912204839.3018089-1-fontaine.fabrice@gmail.com> From: Luiz Augusto von Dentz Date: Fri, 17 Sep 2021 13:53:33 -0700 Message-ID: Subject: Re: [PATCH] profiles/audio/media.c: fix build with glibc >= 2.34 To: Fabrice Fontaine Cc: "linux-bluetooth@vger.kernel.org" , "Yann E . MORIN" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Fabrice, On Sun, Sep 12, 2021 at 1:50 PM Fabrice Fontaine wrote: > > 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 Applied, thanks. -- Luiz Augusto von Dentz