From: Anthony Liguori <anthony@codemonkey.ws>
To: Bartlomiej Celary <bartlomiej.celary@gmail.com>
Cc: qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] MINGW: Unable to link multiboot.img + strnlen missing
Date: Wed, 01 Jul 2009 08:24:10 -0500 [thread overview]
Message-ID: <4A4B637A.9070804@codemonkey.ws> (raw)
In-Reply-To: <97c31bd80907010604n72803d55qb4b79fb2d42847ce@mail.gmail.com>
Bartlomiej Celary wrote:
> Hi,
> I have recently updated my git snapshot and had 2 problems:
>
Thanks for the report.
> 1. There is no strnlen function in MINGW (not sure if it has been
> added recently as I might be using an outdated version...)
>
That should be easy enough to fix. Can you send a patch?
> 2. I was not able to link multiboot.bin using mingw:
>
> for d in pc-bios/optionrom; do \
> make -C $d || exit 1 ; \
> done
> make[1]: Entering directory `/home/abc024/work/qemu/pc-bios/optionrom'
> gcc -o signrom -g -Wall signrom.c
> gcc -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer
> -fno-builtin -I/home/abc024/work/qemu -o multiboot.o -c multiboot.S
> ld --oformat binary -Ttext 0 -o multiboot.img multiboot.o
> D:\mingw\bin\ld.exe: cannot perform PE operations on non PE output
> file 'multiboot.img'.
> make[1]: *** [multiboot.img] Error 1
> rm multiboot.o
> make[1]: Leaving directory `/home/abc024/work/qemu/pc-bios/optionrom'
> make: *** [roms] Error 1
>
> And it looks that this workaround did the trick:
>
> diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
> old mode 100644
> new mode 100755
> index c4a6f42..f414eba
> --- a/pc-bios/optionrom/Makefile
> +++ b/pc-bios/optionrom/Makefile
> @@ -34,8 +34,14 @@ build-all: multiboot.bin
> %.o: %.S
> $(CC) $(CFLAGS) -o $@ -c $<
>
> -%.img: %.o
> - $(LD) --oformat binary -Ttext 0 -o $@ $<
> +%.img: %.out
> + $(OBJCOPY) -O binary -j .text $< $@
> +
> +%.out: %.o
> + $(LD) -Ttext 0 -e _start -s -o $@ $<
>
> %.bin: %.img signrom
> ./signrom $< $@
>
> Obviously objcopy needs to be defined in the config.mak file.
>
I'm not sure I understand why this works, but if you resubmit the patch
with a Signed-off-by, we can apply it.
It's unfortunate that we need to do the signrom step now that I think
about it as it's bad for cross-compilation. Maybe we should sign
anything without a checksum when doing option rom loading. What do you
think Alex?
Regards,
Anthony Liguori
> Regards,
> Bartek Celary
>
>
>
next prev parent reply other threads:[~2009-07-01 13:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-01 13:04 [Qemu-devel] MINGW: Unable to link multiboot.img + strnlen missing Bartlomiej Celary
2009-07-01 13:24 ` Anthony Liguori [this message]
2009-07-01 14:35 ` Alexander Graf
2009-07-01 15:52 ` Anthony Liguori
2009-07-01 15:55 ` Alexander Graf
2009-07-10 15:36 ` Bartlomiej Celary
2009-07-10 16:03 ` Anthony Liguori
2009-07-01 18:01 ` [Qemu-devel] [PATCH] Win32: Fix build (no strnlen) Stefan Weil
2009-07-01 18:44 ` [Qemu-devel] " Consul
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=4A4B637A.9070804@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=agraf@suse.de \
--cc=bartlomiej.celary@gmail.com \
--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.