All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rainer Müller" <raimue@codingfarm.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Fix build break during configuration on musl-libc based Linux systems.
Date: Thu, 6 Apr 2017 20:15:19 +0200	[thread overview]
Message-ID: <oc60j5$ceq$1@blaine.gmane.org> (raw)
In-Reply-To: <CAFEAcA_3jE9F92F6+p6eDfmPwV2LL=fKV-htfTHpCoCOAgJAMg@mail.gmail.com>

On 2017-02-17 17:57, Peter Maydell wrote:
> On 17 February 2017 at 11:20, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 17/02/2017 11:18, Peter Maydell wrote:
>>> Defining _XOPEN_SOURCE is easy enough, and I think we should
>>> do it unconditionally. We should check what effect this has
>>> on the BSD hosts though I guess. (You could argue that we
>>> should be defining _XOPEN_SOURCE anyway for the benefit of
>>> the non-glibc BSD/Solaris/etc platforms.)
>>
>> Sounds good, then I think we should define it to 700 just like glibc does.
> 
> Unfortunately this idea turns out to break OSX compiles,
> because on OSX saying _XOPEN_SOURCE=anything disables
> all the non-X/Open APIs (which you get by default, and
> some of which like mkdtemp we use).

A bit late to this thread, but the original problem was also reported
for Mac OS X with --enable-curses in MacPorts. The build fails with the
same symptoms as in the original report.

https://trac.macports.org/ticket/53929

As you identified, the problem is that ncurses expects the define
_XOPEN_SOURCE >= 500 to enable the wide-char function declarations.

The solution to retain access to non-standard API on Mac OS X would be
to also define _DARWIN_C_SOURCE which enables extensions.

$ cat foo.c
#include <unistd.h>
int main() {
    mkdtemp("/tmp/test-XXXXXX");
}
$ cc -D_XOPEN_SOURCE=500 -c foo.c
foo.c:4:5: warning: implicit declaration of function 'mkdtemp' is
invalid in C99 [-Wimplicit-function-declaration]
    mkdtemp("/tmp/test-XXXXXX");
    ^
1 warning generated.
$ cc -D_XOPEN_SOURCE=500 -D_DARWIN_C_SOURCE -c foo.c
$

A quick test on current master with configure patched to define
  QEMU_CFLAGS="-D_XOPEN_SOURCE=500 -D_DARWIN_C_SOURCE $QEMU_CFLAGS"
compiled fine for both a default configure and with --enable-curses.

Rainer

  reply	other threads:[~2017-04-06 18:15 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 16:30 [Qemu-trivial] Fix build break during configuration on musl-libc based Linux systems Chad Joan
2017-02-16 16:30 ` [Qemu-devel] " Chad Joan
2017-02-16 16:58 ` [Qemu-trivial] " Paolo Bonzini
2017-02-16 16:58   ` [Qemu-devel] " Paolo Bonzini
2017-02-16 17:23   ` [Qemu-trivial] " Laszlo Ersek
2017-02-16 17:23     ` Laszlo Ersek
2017-02-16 17:47     ` [Qemu-trivial] " Chad Joan
2017-02-16 17:47       ` Chad Joan
2017-02-17  6:43       ` [Qemu-trivial] " Fam Zheng
2017-02-17  6:43         ` Fam Zheng
2017-02-17  9:23         ` [Qemu-trivial] " Laszlo Ersek
2017-02-17  9:23           ` Laszlo Ersek
2017-02-17 10:11           ` [Qemu-trivial] " Fam Zheng
2017-02-17 10:11             ` Fam Zheng
2017-02-17  9:28         ` [Qemu-trivial] " Peter Maydell
2017-02-17  9:28           ` Peter Maydell
2017-02-17 15:34           ` [Qemu-trivial] " Eric Blake
2017-02-17 15:34             ` Eric Blake
2017-02-17 16:54             ` [Qemu-trivial] " Chad Joan
2017-02-17 16:54               ` Chad Joan
2017-02-17 16:56               ` [Qemu-trivial] " Peter Maydell
2017-02-17 16:56                 ` Peter Maydell
2017-02-17 16:57               ` [Qemu-trivial] " Paolo Bonzini
2017-02-17 16:57                 ` Paolo Bonzini
2017-02-17 17:07                 ` [Qemu-trivial] " Chad Joan
2017-02-17 17:07                   ` Chad Joan
2017-02-17 17:15               ` [Qemu-trivial] " Peter Maydell
2017-02-17 17:15                 ` Peter Maydell
2017-02-19  7:22                 ` [Qemu-trivial] " Chad Joan
2017-02-19  7:22                   ` Chad Joan
2017-02-19 12:12                   ` [Qemu-trivial] " Peter Maydell
2017-02-19 12:12                     ` Peter Maydell
2017-02-21  2:53                 ` [Qemu-trivial] " Eric Blake
2017-02-21  2:53                   ` Eric Blake
2017-02-17 17:17               ` [Qemu-trivial] " Eric Blake
2017-02-17 17:17                 ` Eric Blake
2017-02-19  7:02                 ` [Qemu-trivial] " Chad Joan
2017-02-19  7:02                   ` Chad Joan
2017-02-21  3:02                   ` [Qemu-trivial] " Eric Blake
2017-02-21  3:02                     ` Eric Blake
2017-02-21  9:41                     ` [Qemu-trivial] " Markus Armbruster
2017-02-21  9:41                       ` Markus Armbruster
2017-02-21  9:58                       ` [Qemu-trivial] " Peter Maydell
2017-02-21  9:58                         ` Peter Maydell
2017-02-17 18:13             ` [Qemu-trivial] " John Snow
2017-02-17 18:13               ` John Snow
2017-02-17  8:45     ` [Qemu-trivial] " Paolo Bonzini
2017-02-17  8:45       ` [Qemu-devel] " Paolo Bonzini
2017-02-17  8:56     ` [Qemu-trivial] " Paolo Bonzini
2017-02-17  8:56       ` [Qemu-devel] " Paolo Bonzini
2017-02-17  9:17       ` [Qemu-trivial] " Laszlo Ersek
2017-02-17  9:17         ` [Qemu-devel] " Laszlo Ersek
2017-02-17 11:11         ` [Qemu-trivial] " Paolo Bonzini
2017-02-17 11:11           ` [Qemu-devel] " Paolo Bonzini
2017-02-17 11:43           ` [Qemu-trivial] " Chad Joan
2017-02-17 11:43             ` [Qemu-devel] " Chad Joan
2017-02-17 10:18       ` [Qemu-trivial] " Peter Maydell
2017-02-17 10:18         ` Peter Maydell
2017-02-17 11:20         ` [Qemu-trivial] " Paolo Bonzini
2017-02-17 11:20           ` Paolo Bonzini
2017-02-17 16:57           ` [Qemu-trivial] " Peter Maydell
2017-02-17 16:57             ` Peter Maydell
2017-04-06 18:15             ` Rainer Müller [this message]
2017-04-06 18:36               ` Peter Maydell
2017-06-02 13:58                 ` Peter Maydell
2017-02-16 16:59 ` [Qemu-trivial] " Eric Blake
2017-02-16 16:59   ` Eric Blake
2017-02-16 17:05 ` [Qemu-trivial] " Peter Maydell
2017-02-16 17:05   ` Peter Maydell

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='oc60j5$ceq$1@blaine.gmane.org' \
    --to=raimue@codingfarm.de \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.