[Buildroot] [PATCH 1/1] package/bluez5_utils: fix build

Yann E. MORIN yann.morin.1998 at free.fr
Sun Sep 12 20:34:39 UTC 2021


Fabrice, All,

On 2021-09-12 14:22 +0200, Fabrice Fontaine spake thusly:
> Fix the following build failure which is only raised once on
> autobuilders even if pause is defined in glibc since at least 1995 and
> https://sourceware.org/git/?p=glibc.git;a=commit;h=28f540f45bbacd939bfd07f213bcad2bf730b1bf
> and in bluez5_utils since version 5.5 and
> https://github.com/bluez/bluez/commit/caab74c97542a56b591f0b16b44ab6ba4b40f0f5:

I was very confused about that, so I investigated a bit.

So, to speed up the build, I tried a build on ARM with a prebuilt
Bootlin toolchain: no failure.

Ah, but the s390x [0][1] and arc [2] failures all use an internal
toolchain. And indeed, I could reproduce the arc failure.

And guess what happened recently with the internal toolchain? We bumped
the glibc version to 2.34.

And indeed, reverting to glibc 2.33 makes the issue disappear.

So, here are the results for an arm build:

         \   bluez5_utils
    glibc \  5.60  |  5.61
    -------\-------+--------
    2.33   |  OK   |   OK
    -------+-------+--------
    2.34   |  KO   |   KO

So, even bluez5_utils 5.60 would have failed with glibc 2.33 if we
hadn't bump glibc "so fast" after we bumped bluez5_utils.

And it did not fail with pre-built toolchains becasue none is using
glibc 2.34 yet.

So, what changed in glibc between 2.33 and 2.34 that makes 'pause()'
conflict? That's a bit hard to see... Indeed, the source file for pause
hasn't changed in a meaningful way in ages.

All that I could notice about it, was that the pause() from NPTL was
dropped, to use the generic pause()... Not sure however if that's the
real cause...

Anyway, the issue is triggerred by glibc 2.34.

And your patch does make sense anyway, so do not forget to send it
upstream with the explanations about glibc 2.34. ;-)

I've tweaked the commit message too, and applied to master, thanks.

Regards,
Yann E. MORIN.

[0] http://autobuild.buildroot.org/results/c4f/c4fbface34be8815838fd7201621d7a8fddd32c5/
[1] http://autobuild.buildroot.org/results/853/85376fcfea208850542e9102f014c17ffda01e67/
[2] http://autobuild.buildroot.org/results/62b/62b88740f19fbe4a1ad7959dc141d539eb88c1f8/

> 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);
>       |            ^~~~~
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/c4f/c4fbface34be8815838fd7201621d7a8fddd32c5/build-end.log
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> ---
>  ...-profiles-audio-media.c-rename-pause.patch | 52 +++++++++++++++++++
>  1 file changed, 52 insertions(+)
>  create mode 100644 package/bluez5_utils/0002-profiles-audio-media.c-rename-pause.patch
> 
> diff --git a/package/bluez5_utils/0002-profiles-audio-media.c-rename-pause.patch b/package/bluez5_utils/0002-profiles-audio-media.c-rename-pause.patch
> new file mode 100644
> index 0000000000..a7fabc9edd
> --- /dev/null
> +++ b/package/bluez5_utils/0002-profiles-audio-media.c-rename-pause.patch
> @@ -0,0 +1,52 @@
> +From 0bb5785a68a2799db003364770be3764af9b9034 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> +Date: Sun, 12 Sep 2021 13:55:49 +0200
> +Subject: [PATCH] profiles/audio/media.c: rename pause
> +
> +Rename pause to media_player_pause to avoid the following build failure:
> +
> +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);
> +      |            ^~~~~
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/c4fbface34be8815838fd7201621d7a8fddd32c5
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> +---
> + 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
> +
> -- 
> 2.33.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at lists.buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'


More information about the buildroot mailing list