Commit 7aa486fe6bac2a471b92c3c4aef1ba5c214f06df
1 parent
b8c0e7d7
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>
Showing
2 changed files
with
11 additions
and
3 deletions
configure
... | ... | @@ -34,6 +34,8 @@ ar="ar" |
34 | 34 | make="make" |
35 | 35 | install="install" |
36 | 36 | strip="strip" |
37 | +objcopy="objcopy" | |
38 | +ld="ld" | |
37 | 39 | |
38 | 40 | # parse CC options first |
39 | 41 | for opt do |
... | ... | @@ -53,6 +55,8 @@ done |
53 | 55 | cc="${cross_prefix}${cc}" |
54 | 56 | ar="${cross_prefix}${ar}" |
55 | 57 | strip="${cross_prefix}${strip}" |
58 | +objcopy="${cross_prefix}${objcopy}" | |
59 | +ld="${cross_prefix}${ld}" | |
56 | 60 | |
57 | 61 | # check that the C compiler works. |
58 | 62 | cat > $TMPC <<EOF |
... | ... | @@ -1483,6 +1487,8 @@ echo "INSTALL_PROG=$install -m0755 -p" >> $config_mak |
1483 | 1487 | echo "CC=$cc" >> $config_mak |
1484 | 1488 | echo "HOST_CC=$host_cc" >> $config_mak |
1485 | 1489 | echo "AR=$ar" >> $config_mak |
1490 | +echo "OBJCOPY=$objcopy" >> $config_mak | |
1491 | +echo "LD=$ld" >> $config_mak | |
1486 | 1492 | # XXX: only use CFLAGS and LDFLAGS ? |
1487 | 1493 | # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross |
1488 | 1494 | # compilation of dyngen tool (useful for win32 build on Linux host) | ... | ... |
pc-bios/optionrom/Makefile
... | ... | @@ -3,7 +3,6 @@ all: build-all |
3 | 3 | include ../../config-host.mak |
4 | 4 | |
5 | 5 | VPATH=$(SRC_PATH)/pc-bios/optionrom |
6 | -OBJCOPY=objcopy | |
7 | 6 | |
8 | 7 | # from kernel sources - scripts/Kbuild.include |
9 | 8 | # try-run |
... | ... | @@ -35,9 +34,12 @@ build-all: multiboot.bin |
35 | 34 | $(CC) $(CFLAGS) -o $@ -c $< |
36 | 35 | |
37 | 36 | %.img: %.o |
38 | - $(LD) --oformat binary -Ttext 0 -o $@ $< | |
37 | + $(LD) -Ttext 0 -e _start -s -o $@ $< | |
39 | 38 | |
40 | -%.bin: %.img | |
39 | +%.raw: %.img | |
40 | + $(OBJCOPY) -O binary -j .text $< $@ | |
41 | + | |
42 | +%.bin: %.raw | |
41 | 43 | $(SRC_PATH)/pc-bios/optionrom/signrom.sh $< $@ |
42 | 44 | cp $@ $(SRC_PATH)/pc-bios/ |
43 | 45 | ... | ... |