Ensure the cross assembler, linker and objcopy are used for the build32
stage, just like for the regular world stage. Reviewed by: rodrigc, imp, bapt, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D2187
This commit is contained in:
parent
0daa281ac0
commit
76e2c537bc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=280980
@ -411,8 +411,9 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
|
|||||||
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
|
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
|
||||||
MACHINE_CPU="i686 mmx sse sse2"
|
MACHINE_CPU="i686 mmx sse sse2"
|
||||||
LIB32WMAKEFLAGS= \
|
LIB32WMAKEFLAGS= \
|
||||||
AS="${AS} --32" \
|
AS="${XAS} --32" \
|
||||||
LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32"
|
LD="${XLD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
|
||||||
|
OBJCOPY="${XOBJCOPY}"
|
||||||
|
|
||||||
.elif ${TARGET_ARCH} == "powerpc64"
|
.elif ${TARGET_ARCH} == "powerpc64"
|
||||||
.if empty(TARGET_CPUTYPE)
|
.if empty(TARGET_CPUTYPE)
|
||||||
@ -422,7 +423,8 @@ LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE}
|
|||||||
.endif
|
.endif
|
||||||
LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc
|
LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc
|
||||||
LIB32WMAKEFLAGS= \
|
LIB32WMAKEFLAGS= \
|
||||||
LD="${LD} -m elf32ppc_fbsd"
|
LD="${XLD} -m elf32ppc_fbsd" \
|
||||||
|
OBJCOPY="${XOBJCOPY}"
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ crt1_c.o: crt1_c.s
|
|||||||
|
|
||||||
crt1.o: crt1_c.o crt1_s.o
|
crt1.o: crt1_c.o crt1_s.o
|
||||||
${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
|
${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
|
||||||
objcopy --localize-symbol _start1 crt1.o
|
${OBJCOPY} --localize-symbol _start1 crt1.o
|
||||||
|
|
||||||
Scrt1_c.s: crt1_c.c
|
Scrt1_c.s: crt1_c.c
|
||||||
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
|
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
|
||||||
@ -46,7 +46,7 @@ Scrt1_c.o: Scrt1_c.s
|
|||||||
|
|
||||||
Scrt1.o: Scrt1_c.o crt1_s.o
|
Scrt1.o: Scrt1_c.o crt1_s.o
|
||||||
${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
|
${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
|
||||||
objcopy --localize-symbol _start1 Scrt1.o
|
${OBJCOPY} --localize-symbol _start1 Scrt1.o
|
||||||
|
|
||||||
realinstall:
|
realinstall:
|
||||||
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||||
|
@ -61,7 +61,7 @@ boot: boot1 boot2
|
|||||||
CLEANFILES+= boot1 boot1.out boot1.o
|
CLEANFILES+= boot1 boot1.out boot1.o
|
||||||
|
|
||||||
boot1: boot1.out
|
boot1: boot1.out
|
||||||
objcopy -S -O binary boot1.out ${.TARGET}
|
${OBJCOPY} -S -O binary boot1.out ${.TARGET}
|
||||||
|
|
||||||
boot1.out: boot1.o
|
boot1.out: boot1.o
|
||||||
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
|
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
|
||||||
@ -82,7 +82,7 @@ boot2.ldr:
|
|||||||
dd if=/dev/zero of=${.TARGET} bs=512 count=1
|
dd if=/dev/zero of=${.TARGET} bs=512 count=1
|
||||||
|
|
||||||
boot2.bin: boot2.out
|
boot2.bin: boot2.out
|
||||||
objcopy -S -O binary boot2.out ${.TARGET}
|
${OBJCOPY} -S -O binary boot2.out ${.TARGET}
|
||||||
|
|
||||||
boot2.out: ${BTXCRT} boot2.o sio.o
|
boot2.out: ${BTXCRT} boot2.o sio.o
|
||||||
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
|
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
|
||||||
|
@ -55,7 +55,7 @@ gptboot: gptldr.bin gptboot.bin ${BTXKERN}
|
|||||||
CLEANFILES+= gptldr.bin gptldr.out gptldr.o
|
CLEANFILES+= gptldr.bin gptldr.out gptldr.o
|
||||||
|
|
||||||
gptldr.bin: gptldr.out
|
gptldr.bin: gptldr.out
|
||||||
objcopy -S -O binary gptldr.out ${.TARGET}
|
${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
|
||||||
|
|
||||||
gptldr.out: gptldr.o
|
gptldr.out: gptldr.o
|
||||||
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
|
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
|
||||||
@ -64,7 +64,7 @@ CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o gpt.o crc32.o drv.o \
|
|||||||
cons.o util.o
|
cons.o util.o
|
||||||
|
|
||||||
gptboot.bin: gptboot.out
|
gptboot.bin: gptboot.out
|
||||||
objcopy -S -O binary gptboot.out ${.TARGET}
|
${OBJCOPY} -S -O binary gptboot.out ${.TARGET}
|
||||||
|
|
||||||
gptboot.out: ${BTXCRT} gptboot.o sio.o gpt.o crc32.o drv.o cons.o util.o
|
gptboot.out: ${BTXCRT} gptboot.o sio.o gpt.o crc32.o drv.o cons.o util.o
|
||||||
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
|
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
|
||||||
|
@ -53,7 +53,7 @@ gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN}
|
|||||||
CLEANFILES+= gptldr.bin gptldr.out gptldr.o
|
CLEANFILES+= gptldr.bin gptldr.out gptldr.o
|
||||||
|
|
||||||
gptldr.bin: gptldr.out
|
gptldr.bin: gptldr.out
|
||||||
objcopy -S -O binary gptldr.out ${.TARGET}
|
${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
|
||||||
|
|
||||||
gptldr.out: gptldr.o
|
gptldr.out: gptldr.o
|
||||||
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
|
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
|
||||||
@ -62,7 +62,7 @@ CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
|
|||||||
drv.o gpt.o util.o
|
drv.o gpt.o util.o
|
||||||
|
|
||||||
gptzfsboot.bin: gptzfsboot.out
|
gptzfsboot.bin: gptzfsboot.out
|
||||||
objcopy -S -O binary gptzfsboot.out ${.TARGET}
|
${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET}
|
||||||
|
|
||||||
gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o
|
gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o
|
||||||
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
|
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
|
||||||
|
@ -49,7 +49,7 @@ zfsboot: zfsboot1 zfsboot2
|
|||||||
CLEANFILES+= zfsboot1 zfsldr.out zfsldr.o
|
CLEANFILES+= zfsboot1 zfsldr.out zfsldr.o
|
||||||
|
|
||||||
zfsboot1: zfsldr.out
|
zfsboot1: zfsldr.out
|
||||||
objcopy -S -O binary zfsldr.out ${.TARGET}
|
${OBJCOPY} -S -O binary zfsldr.out ${.TARGET}
|
||||||
|
|
||||||
zfsldr.out: zfsldr.o
|
zfsldr.out: zfsldr.o
|
||||||
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o
|
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o
|
||||||
@ -75,7 +75,7 @@ zfsboot.ldr:
|
|||||||
cp /dev/null ${.TARGET}
|
cp /dev/null ${.TARGET}
|
||||||
|
|
||||||
zfsboot.bin: zfsboot.out
|
zfsboot.bin: zfsboot.out
|
||||||
objcopy -S -O binary zfsboot.out ${.TARGET}
|
${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
|
||||||
|
|
||||||
zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o
|
zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o
|
||||||
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
|
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
|
||||||
|
@ -74,7 +74,7 @@ flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o
|
|||||||
${LD} ${_LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \
|
${LD} ${_LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \
|
||||||
${.ALLSRC} ${LIBSTAND}
|
${.ALLSRC} ${LIBSTAND}
|
||||||
flashboot: flashboot.elf
|
flashboot: flashboot.elf
|
||||||
objcopy -S -O binary ${.TARGET}.elf ${.TARGET}
|
${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET}
|
||||||
flashboot.md5: flashboot
|
flashboot.md5: flashboot
|
||||||
md5 flashboot > flashboot.md5
|
md5 flashboot > flashboot.md5
|
||||||
|
|
||||||
|
@ -21,6 +21,6 @@ ${BOOT}: ${BOOT}.bin
|
|||||||
cat ${BOOT}.bin /dev/zero | dd of=${BOOT} bs=1 count=7168
|
cat ${BOOT}.bin /dev/zero | dd of=${BOOT} bs=1 count=7168
|
||||||
|
|
||||||
${BOOT}.bin: ${BOOT}.out
|
${BOOT}.bin: ${BOOT}.out
|
||||||
objcopy -S -O binary ${BOOT}.out ${.TARGET}
|
${OBJCOPY} -S -O binary ${BOOT}.out ${.TARGET}
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -16,6 +16,6 @@ BOOT_BOOT0_ORG?= 0x0000
|
|||||||
LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N
|
LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N
|
||||||
|
|
||||||
${BOOT}: ${BOOT}.out
|
${BOOT}: ${BOOT}.out
|
||||||
objcopy -S -O binary ${BOOT}.out ${.TARGET}
|
${OBJCOPY} -S -O binary ${BOOT}.out ${.TARGET}
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -67,7 +67,7 @@ boot: boot1 boot2
|
|||||||
CLEANFILES+= boot1 boot1.out boot1.o
|
CLEANFILES+= boot1 boot1.out boot1.o
|
||||||
|
|
||||||
boot1: boot1.out
|
boot1: boot1.out
|
||||||
objcopy -S -O binary boot1.out ${.TARGET}
|
${OBJCOPY} -S -O binary boot1.out ${.TARGET}
|
||||||
|
|
||||||
boot1.out: boot1.o
|
boot1.out: boot1.o
|
||||||
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
|
${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
|
||||||
@ -88,7 +88,7 @@ boot2.ldr:
|
|||||||
dd if=/dev/zero of=${.TARGET} bs=276 count=1
|
dd if=/dev/zero of=${.TARGET} bs=276 count=1
|
||||||
|
|
||||||
boot2.bin: boot2.out
|
boot2.bin: boot2.out
|
||||||
objcopy -S -O binary boot2.out ${.TARGET}
|
${OBJCOPY} -S -O binary boot2.out ${.TARGET}
|
||||||
|
|
||||||
boot2.out: ${BTXCRT} boot2.o sio.o
|
boot2.out: ${BTXCRT} boot2.o sio.o
|
||||||
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
|
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
|
||||||
|
Loading…
Reference in New Issue
Block a user