Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 2/2] package/mjpg-streamer: Fix musl build
Date: Mon, 25 Jan 2016 23:48:55 +0100	[thread overview]
Message-ID: <20160125234855.382214f8@free-electrons.com> (raw)
In-Reply-To: <1453644779-7961-2-git-send-email-bernd.kuhls@t-online.de>

Dear Bernd Kuhls,

On Sun, 24 Jan 2016 15:12:59 +0100, Bernd Kuhls wrote:

> diff --git a/package/mjpg-streamer/0001-musl_compatibility.patch b/package/mjpg-streamer/0001-musl_compatibility.patch
> new file mode 100644
> index 0000000..faebd58
> --- /dev/null
> +++ b/package/mjpg-streamer/0001-musl_compatibility.patch
> @@ -0,0 +1,20 @@
> +Fix musl build
> +
> +Patch downloaded from
> +https://github.com/openwrt/packages/blob/master/multimedia/mjpg-streamer/patches/005-musl_compatibility.patch
> +
> +Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> +
> +--- a/mjpg_streamer.h
> ++++ b/mjpg_streamer.h
> +@@ -29,6 +29,10 @@
> + #define MAX_OUTPUT_PLUGINS 10
> + #define MAX_PLUGIN_ARGUMENTS 32
> + 
> ++#define __NEED_pthread_t
> ++#define __NEED_pthread_mutex_t
> ++#define __NEED_pthread_cond_t

This is not the proper fix. This is an ugly hack. Instead, just add:

#include <pthread.h> in plugins/input.h

and things will magically build fine.

One suggestion: do *not* take the patches found in OpenWRT for granted.
No offense for the OpenWRT developers, but I have already found
numerous horrible hacks in OpenWRT patches, and dubious solutions to
build issues.

So whenever you take a patch from OpenWRT, take a step back, and always
check if it's the right solution, and whether the solution is
upstreamable.

What prompted me to check more precisely here is that the OpenWRT
solution is clearly not upstreamable, while including <pthread.h> when
the file uses pthread_* types definitely is.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2016-01-25 22:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-24 14:12 [Buildroot] [PATCH v2 1/2] package/mjpg-streamer: bump version, add hash Bernd Kuhls
2016-01-24 14:12 ` [Buildroot] [PATCH v2 2/2] package/mjpg-streamer: Fix musl build Bernd Kuhls
2016-01-25 22:48   ` Thomas Petazzoni [this message]
2016-01-25 22:45 ` [Buildroot] [PATCH v2 1/2] package/mjpg-streamer: bump version, add hash Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160125234855.382214f8@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox