Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Ziegler <br015@umbiko.net>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: Matt Weber <matthew.weber@collins.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/lighttpd: fix build on musl
Date: Wed, 27 Oct 2021 04:58:49 +0000	[thread overview]
Message-ID: <170e09cd599fceea54a6bac8ae1fea5d@umbiko.net> (raw)
In-Reply-To: <mailman.3672.1635273538.103149.buildroot@buildroot.org>

Hi Fabrice,

On 2021-10-26 18:38, Fabrice Fontaine <fontaine.fabrice@gmail.com> 
wrote:

> Fix the following build failure on musl raised since bump to version
> 1.4.60 in commit d62b7f54f00291a50274409fb5510527fd725ffe:
> 
> In file included from buffer.h:404,
>                  from array.h:5,
>                  from array.c:3:
> ck.h:24:14: error: expected ';' before 'typedef'
>    24 | __BEGIN_DECLS
>       |              ^
>       |              ;
> ......
>    29 | typedef size_t rsize_t;
>       | ~~~~~~~
> 
> Fixes:
>  -
> http://autobuild.buildroot.org/results/0d56a44449e89773499051b35f21ec83bfab4ca6
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...-__BEGIN_DECLS-__END_DECLS-if-needed.patch | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644
> package/lighttpd/0002-core-define-__BEGIN_DECLS-__END_DECLS-if-needed.patch
> 
> diff --git
> a/package/lighttpd/0002-core-define-__BEGIN_DECLS-__END_DECLS-if-needed.patch
> b/package/lighttpd/0002-core-define-__BEGIN_DECLS-__END_DECLS-if-needed.patch
> new file mode 100644
> index 0000000000..cd64f18794
> --- /dev/null
> +++
> b/package/lighttpd/0002-core-define-__BEGIN_DECLS-__END_DECLS-if-needed.patch
> @@ -0,0 +1,39 @@
> +From cf4dfbe15ef8ead3a7eda974af7d804d447f00db Mon Sep 17 00:00:00 2001
> +From: Glenn Strauss <gstrauss@gluelogic.com>
> +Date: Mon, 4 Oct 2021 09:51:22 -0400
> +Subject: [PATCH] [core] define __BEGIN_DECLS, __END_DECLS if needed
> +
> +[Retrieved from:
> +https://github.com/lighttpd/lighttpd1.4/commit/cf4dfbe15ef8ead3a7eda974af7d804d447f00db]
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + src/first.h | 16 ++++++++++++++++
> + 1 file changed, 16 insertions(+)
> +
> +diff --git a/src/first.h b/src/first.h
> +index df747ba46..9d0428ae6 100644
> +--- a/src/first.h
> ++++ b/src/first.h
> +@@ -39,6 +39,22 @@
> + #include <sys/types.h>
> + #include <stddef.h>
> +
> ++#ifndef __BEGIN_DECLS
> ++#ifdef __cplusplus
> ++#define __BEGIN_DECLS extern "C" {
> ++#else
> ++#define __BEGIN_DECLS
> ++#endif
> ++#endif

Instead of creating your own declarations of _*_DECLS, you might just 
add the missing <sys/cdefs.h> to ck.h; this seems to be the only place 
the problem occurs.

The header is part of glibc, but not of musl; within Buildroot it is 
automatically added by musl-compat-headers, which is selected if you use 
musl.

Kind regards,
Andreas

> ++
> ++#ifndef __END_DECLS
> ++#ifdef __cplusplus
> ++#define __END_DECLS }
> ++#else
> ++#define __END_DECLS
> ++#endif
> ++#endif
> ++
> + #if defined HAVE_STDINT_H
> + # include <stdint.h>
> + #elif defined HAVE_INTTYPES_H
> --
> 2.33.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

       reply	other threads:[~2021-10-27  4:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3672.1635273538.103149.buildroot@buildroot.org>
2021-10-27  4:58 ` Andreas Ziegler [this message]
2021-10-27  7:27   ` [Buildroot] [PATCH 1/1] package/lighttpd: fix build on musl Fabrice Fontaine
2021-10-27  9:36     ` Andreas Ziegler
2021-10-26 16:45 Fabrice Fontaine
2021-11-05 16:14 ` Peter Korsgaard

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=170e09cd599fceea54a6bac8ae1fea5d@umbiko.net \
    --to=br015@umbiko.net \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    --cc=matthew.weber@collins.com \
    /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