From 8f409b435a6ce131f83a7ab191c207fac6590701 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 9 Oct 2017 22:12:46 +0000 Subject: [PATCH] Define LIBSA* and use them instead of overloaded LIBSTAND LIBSA is the current stand alone library. LIBSA32 is the 32-bit version of the library. LIBSAU is the userboot version of libsa. Use the proper define instead of the more generic define. Sponsored by: Netflix --- sys/boot/Makefile.inc | 6 ++++++ sys/boot/arm/uboot/Makefile | 5 ++--- sys/boot/efi/boot1/Makefile | 4 ++-- sys/boot/efi/loader/Makefile | 4 ++-- sys/boot/i386/gptboot/Makefile | 4 +--- sys/boot/i386/gptzfsboot/Makefile | 4 +--- sys/boot/i386/loader/Makefile | 6 ++---- sys/boot/i386/zfsboot/Makefile | 4 +--- sys/boot/mips/beri/boot2/Makefile | 5 ++--- sys/boot/mips/beri/loader/Makefile | 5 ++--- sys/boot/mips/uboot/Makefile | 5 ++--- sys/boot/powerpc/kboot/Makefile | 5 ++--- sys/boot/powerpc/ofw/Makefile | 5 ++--- sys/boot/powerpc/ps3/Makefile | 5 ++--- sys/boot/powerpc/uboot/Makefile | 5 ++--- sys/boot/sparc64/loader/Makefile | 4 ++-- sys/boot/userboot/userboot/Makefile | 6 ++---- 17 files changed, 35 insertions(+), 47 deletions(-) diff --git a/sys/boot/Makefile.inc b/sys/boot/Makefile.inc index 727f2ec7a6f8..7e6439a3748c 100644 --- a/sys/boot/Makefile.inc +++ b/sys/boot/Makefile.inc @@ -6,6 +6,12 @@ __BOOT_MAKEFILE_INC__=${MFILE} SASRC=${SRCTOP}/lib/libstand +# Normal stand alone library +LIBSA=${OBJTOP}/lib/libstand/libstand.a +# stand alone library compiled for 32-bit version of the processor +LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a +# stand along library compiled for userboot +LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a SSP_CFLAGS= diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile index f242adb3e2e7..2b46cb4ab92d 100644 --- a/sys/boot/arm/uboot/Makefile +++ b/sys/boot/arm/uboot/Makefile @@ -112,7 +112,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from CFLAGS+= -I${SASRC} CFLAGS+= -fPIC @@ -120,8 +119,8 @@ CFLAGS+= -fPIC # clang doesn't understand %D as a specifier to printf NO_WERROR.clang= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} diff --git a/sys/boot/efi/boot1/Makefile b/sys/boot/efi/boot1/Makefile index b659dd0575e6..883d6d39d1d8 100644 --- a/sys/boot/efi/boot1/Makefile +++ b/sys/boot/efi/boot1/Makefile @@ -90,8 +90,8 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a # __aeabi_* (arm) or __divdi3 (i386). # as well as required string and memory functions for all platforms. # -DPADD+= ${LIBEFI} ${LIBSTAND} -LDADD+= ${LIBEFI} ${LIBSTAND} +DPADD+= ${LIBEFI} ${LIBSA} +LDADD+= ${LIBEFI} ${LIBSA} DPADD+= ${LDSCRIPT} diff --git a/sys/boot/efi/loader/Makefile b/sys/boot/efi/loader/Makefile index 5f4c3e30baa7..034af797f152 100644 --- a/sys/boot/efi/loader/Makefile +++ b/sys/boot/efi/loader/Makefile @@ -150,9 +150,9 @@ loader.efi: ${PROG} LIBEFI= ${.OBJDIR}/../libefi/libefi.a -DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} \ +DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} \ ${LDSCRIPT} -LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} .include diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile index b259f4b3bf87..62dc02e3f188 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/sys/boot/i386/gptboot/Makefile @@ -50,8 +50,6 @@ OPENCRYPTO_XTS= xform_aes_xts.o LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -76,7 +74,7 @@ gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} gptboot.o: ${.CURDIR}/../../common/ufsread.c diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile index dc2058d450b6..5fb0eef58d24 100644 --- a/sys/boot/i386/gptzfsboot/Makefile +++ b/sys/boot/i386/gptzfsboot/Makefile @@ -60,8 +60,6 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -87,7 +85,7 @@ gptzfsboot.bin: gptzfsboot.out gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ skein.o skein_block.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile index 9372a548353b..a629de427747 100644 --- a/sys/boot/i386/loader/Makefile +++ b/sys/boot/i386/loader/Makefile @@ -90,8 +90,6 @@ LDFLAGS= -static -Ttext 0x0 LIBI386= ${.OBJDIR}/../libi386/libi386.a CFLAGS+= -I${.CURDIR}/.. -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib @@ -127,8 +125,8 @@ FILES+= loader.rc menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} .include diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile index f9719ce6e9c1..2f4417223a61 100644 --- a/sys/boot/i386/zfsboot/Makefile +++ b/sys/boot/i386/zfsboot/Makefile @@ -40,8 +40,6 @@ CFLAGS+= -DSKEIN_LOOP=111 LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -83,7 +81,7 @@ zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o skein.o skein_block.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} SRCS= zfsboot.c diff --git a/sys/boot/mips/beri/boot2/Makefile b/sys/boot/mips/beri/boot2/Makefile index 093fe1353655..dc527a50d5a8 100644 --- a/sys/boot/mips/beri/boot2/Makefile +++ b/sys/boot/mips/beri/boot2/Makefile @@ -59,7 +59,6 @@ CFLAGS= -ffreestanding \ # where to get libstand from CFLAGS+= -I${SASRC} -LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a LDFLAGS= -nostdlib \ -static \ @@ -72,7 +71,7 @@ CFLAGS+= -I${.CURDIR}/../common flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSTAND} + ${.ALLSRC} ${LIBSA} flashboot: flashboot.elf ${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET} flashboot.md5: flashboot @@ -80,7 +79,7 @@ flashboot.md5: flashboot jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSTAND} + ${.ALLSRC} ${LIBSA} jtagboot.md5: jtagboot md5 jtagboot > jtagboot.md5 diff --git a/sys/boot/mips/beri/loader/Makefile b/sys/boot/mips/beri/loader/Makefile index 5b0a78aa9c19..2b1302bf9ea0 100644 --- a/sys/boot/mips/beri/loader/Makefile +++ b/sys/boot/mips/beri/loader/Makefile @@ -109,10 +109,9 @@ LDFLAGS= -nostdlib \ # where to get libstand from CFLAGS+= -I${SASRC} -LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a -DPADD= ${LIBFICL} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBSA} +LDADD= ${LIBFICL} ${LIBSA} loader.help: help.common help.mips cat ${.ALLSRC} | \ diff --git a/sys/boot/mips/uboot/Makefile b/sys/boot/mips/uboot/Makefile index fba4f69cb4cf..1a394622634e 100644 --- a/sys/boot/mips/uboot/Makefile +++ b/sys/boot/mips/uboot/Makefile @@ -117,14 +117,13 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from CFLAGS+= -I${SASRC} -LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a # clang doesn't understand %D as a specifier to printf #NO_WERROR.clang= #NO_WERROR= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} diff --git a/sys/boot/powerpc/kboot/Makefile b/sys/boot/powerpc/kboot/Makefile index daf8e78b3e0f..a46f5d97073b 100644 --- a/sys/boot/powerpc/kboot/Makefile +++ b/sys/boot/powerpc/kboot/Makefile @@ -94,11 +94,10 @@ CFLAGS+= -Wa,-mppc64bridge #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.kboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ diff --git a/sys/boot/powerpc/ofw/Makefile b/sys/boot/powerpc/ofw/Makefile index 79892ab95e06..a76127eae337 100644 --- a/sys/boot/powerpc/ofw/Makefile +++ b/sys/boot/powerpc/ofw/Makefile @@ -92,11 +92,10 @@ LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ diff --git a/sys/boot/powerpc/ps3/Makefile b/sys/boot/powerpc/ps3/Makefile index 57dda8d0fb0e..baf50b1a0e4a 100644 --- a/sys/boot/powerpc/ps3/Makefile +++ b/sys/boot/powerpc/ps3/Makefile @@ -91,11 +91,10 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} SC_DFLT_FONT=cp437 diff --git a/sys/boot/powerpc/uboot/Makefile b/sys/boot/powerpc/uboot/Makefile index 723a3258c81a..7de37574bb97 100644 --- a/sys/boot/powerpc/uboot/Makefile +++ b/sys/boot/powerpc/uboot/Makefile @@ -97,11 +97,10 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ diff --git a/sys/boot/sparc64/loader/Makefile b/sys/boot/sparc64/loader/Makefile index 0b0216ab9696..d268c9b3d629 100644 --- a/sys/boot/sparc64/loader/Makefile +++ b/sys/boot/sparc64/loader/Makefile @@ -85,8 +85,8 @@ CFLAGS+= -I${SASRC} # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys -DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ diff --git a/sys/boot/userboot/userboot/Makefile b/sys/boot/userboot/userboot/Makefile index 8b2df16016ef..2985ac55e98c 100644 --- a/sys/boot/userboot/userboot/Makefile +++ b/sys/boot/userboot/userboot/Makefile @@ -49,8 +49,6 @@ CFLAGS+= -DBF_DICTSIZE=15000 LIBFICL= ${.OBJDIR}/../ficl/libficl.a .endif -LIBSTAND= ${.OBJDIR}/../libstand/libstand.a - .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a @@ -61,7 +59,7 @@ LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} -LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} +DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} +LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} .include