From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLzUL-0000co-Ti for qemu-devel@nongnu.org; Wed, 01 Jul 2009 09:04:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLzUH-0000Xw-5o for qemu-devel@nongnu.org; Wed, 01 Jul 2009 09:04:37 -0400 Received: from [199.232.76.173] (port=33602 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLzUH-0000Xt-3X for qemu-devel@nongnu.org; Wed, 01 Jul 2009 09:04:33 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:47267) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MLzUG-0005re-K1 for qemu-devel@nongnu.org; Wed, 01 Jul 2009 09:04:32 -0400 Received: by ewy7 with SMTP id 7so967741ewy.34 for ; Wed, 01 Jul 2009 06:04:31 -0700 (PDT) MIME-Version: 1.0 From: Bartlomiej Celary Date: Wed, 1 Jul 2009 15:04:11 +0200 Message-ID: <97c31bd80907010604n72803d55qb4b79fb2d42847ce@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] MINGW: Unable to link multiboot.img + strnlen missing List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, I have recently updated my git snapshot and had 2 problems: 1. There is no strnlen function in MINGW (not sure if it has been added recently as I might be using an outdated version...) 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. Regards, Bartek Celary