mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
Fix multiboot.bin build on mingw32
This combination of ld/object was suggested by Bartlomiej Celary Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
b8c0e7d7c4
commit
7aa486fe6b
2 changed files with 11 additions and 3 deletions
6
configure
vendored
6
configure
vendored
|
@ -34,6 +34,8 @@ ar="ar"
|
|||
make="make"
|
||||
install="install"
|
||||
strip="strip"
|
||||
objcopy="objcopy"
|
||||
ld="ld"
|
||||
|
||||
# parse CC options first
|
||||
for opt do
|
||||
|
@ -53,6 +55,8 @@ done
|
|||
cc="${cross_prefix}${cc}"
|
||||
ar="${cross_prefix}${ar}"
|
||||
strip="${cross_prefix}${strip}"
|
||||
objcopy="${cross_prefix}${objcopy}"
|
||||
ld="${cross_prefix}${ld}"
|
||||
|
||||
# check that the C compiler works.
|
||||
cat > $TMPC <<EOF
|
||||
|
@ -1483,6 +1487,8 @@ echo "INSTALL_PROG=$install -m0755 -p" >> $config_mak
|
|||
echo "CC=$cc" >> $config_mak
|
||||
echo "HOST_CC=$host_cc" >> $config_mak
|
||||
echo "AR=$ar" >> $config_mak
|
||||
echo "OBJCOPY=$objcopy" >> $config_mak
|
||||
echo "LD=$ld" >> $config_mak
|
||||
# XXX: only use CFLAGS and LDFLAGS ?
|
||||
# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
|
||||
# compilation of dyngen tool (useful for win32 build on Linux host)
|
||||
|
|
|
@ -3,7 +3,6 @@ all: build-all
|
|||
include ../../config-host.mak
|
||||
|
||||
VPATH=$(SRC_PATH)/pc-bios/optionrom
|
||||
OBJCOPY=objcopy
|
||||
|
||||
# from kernel sources - scripts/Kbuild.include
|
||||
# try-run
|
||||
|
@ -35,9 +34,12 @@ build-all: multiboot.bin
|
|||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
%.img: %.o
|
||||
$(LD) --oformat binary -Ttext 0 -o $@ $<
|
||||
$(LD) -Ttext 0 -e _start -s -o $@ $<
|
||||
|
||||
%.bin: %.img
|
||||
%.raw: %.img
|
||||
$(OBJCOPY) -O binary -j .text $< $@
|
||||
|
||||
%.bin: %.raw
|
||||
$(SRC_PATH)/pc-bios/optionrom/signrom.sh $< $@
|
||||
cp $@ $(SRC_PATH)/pc-bios/
|
||||
|
||||
|
|
Loading…
Reference in a new issue