All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Stefan Weil <weil@mail.berlios.de>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] mingw32: Only link against libiberty if required
Date: Sun, 24 Jul 2011 13:48:52 +0200	[thread overview]
Message-ID: <4E2C06A4.2090608@web.de> (raw)
In-Reply-To: <4E2BFC35.6040202@mail.berlios.de>

[-- Attachment #1: Type: text/plain, Size: 2212 bytes --]

On 2011-07-24 13:04, Stefan Weil wrote:
> Am 24.07.2011 12:12, schrieb Jan Kiszka:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> Not all (didn't find any) mingw32 cross-toolchains ship a binutils-devel
>> package, thus lack libiberty.a. According to 08f3896a, -liberty is only
>> needed for getopt when building for 64 bit. Test for the availability
>> of a getopt implementation and only pull in libiberty when linking
>> without it failed.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> configure | 11 ++++++++++-
>> 1 files changed, 10 insertions(+), 1 deletions(-)
> 
> Hi,
> 
> I also had problems with some MinGW build environments
> which don't provide libiberty.a. Debian's gcc-mingw32
> cross toolchain which I normally use provides it.
> 
> libiberty.a not only includes getopt(), but also several other
> useful functions. Especially ffs() is needed for compilations
> without optimization and was the main reason for commit 08f3896a.
> ffs() normally is inline code, and an implementation in
> QEMU code was removed after 08f3896a.
> 
> So at least for Debian cross compilation without optimization,
> your patch will break 32 bit builds because ffs() would be missing.
> 
> The latest commits to QEMU git master added a lot of new requirements
> for MinGW builds (glib ...). Maybe some of these also require
> libiberty.a. Therefore I suggest to wait until git master is
> working again with MinGW32.

Builds fine here (except for the usual warnings) with Blue's fix for
qemu-char.c. Same is true when passing in CFLAGS=-O0.

> 
> Could you describe your build requirements in the QEMU Wiki
> (http://wiki.qemu.org/Hosts/W32)? Then we can see better how
> the different needs of native builds and cross builds with
> different distributions can be met, both for w32 and w64.

Done.

> 
> If there are MinGW (cross) build environments which really
> don't need libiberty.a, we could modify the check to add
> linker option -liberty only when the library is available.

That was my original idea, at least for 32-bit builds (my toolchain
carries 'w64' in its name, but only support w32). How to express this best?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

      reply	other threads:[~2011-07-24 11:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-24 10:12 [Qemu-devel] [PATCH] mingw32: Only link against libiberty if required Jan Kiszka
2011-07-24 11:04 ` Stefan Weil
2011-07-24 11:48   ` Jan Kiszka [this message]

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=4E2C06A4.2090608@web.de \
    --to=jan.kiszka@web.de \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /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.