From 1bd36852a027a85374d63e6f67e71d15706f2631 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Tue, 26 Jul 2016 21:41:49 +0300 Subject: [PATCH] loader: fix command paths --- usr/src/boot/sys/boot/efi/boot1/Makefile | 10 +++++----- usr/src/boot/sys/boot/efi/libefi/Makefile | 6 ++++-- usr/src/boot/sys/boot/efi/loader/Makefile | 10 ++++++---- usr/src/boot/sys/boot/ficl/Makefile.inc | 6 ++++-- usr/src/boot/sys/boot/i386/btx/btx/Makefile | 2 +- usr/src/boot/sys/boot/i386/btx/btxldr/Makefile | 2 +- usr/src/boot/sys/boot/i386/btx/lib/Makefile | 4 ++-- usr/src/boot/sys/boot/i386/cdboot/Makefile | 2 +- usr/src/boot/sys/boot/i386/gptzfsboot/Makefile | 6 ++++-- usr/src/boot/sys/boot/i386/libi386/Makefile | 8 +++++--- usr/src/boot/sys/boot/i386/loader/Makefile | 21 ++++++++++++--------- usr/src/boot/sys/boot/i386/pmbr/Makefile | 2 +- usr/src/boot/sys/boot/i386/pxeldr/Makefile | 9 +++++---- usr/src/boot/sys/boot/libstand/Makefile.com | 6 ++++-- usr/src/boot/sys/boot/zfs/Makefile.com | 6 ++++-- 15 files changed, 59 insertions(+), 41 deletions(-) diff --git a/usr/src/boot/sys/boot/efi/boot1/Makefile b/usr/src/boot/sys/boot/efi/boot1/Makefile index e6b212285f..be56681f64 100644 --- a/usr/src/boot/sys/boot/efi/boot1/Makefile +++ b/usr/src/boot/sys/boot/efi/boot1/Makefile @@ -19,8 +19,6 @@ CC= $(GCC_ROOT)/bin/gcc LD= $(GNU_ROOT)/bin/gld OBJCOPY= $(GNU_ROOT)/bin/gobjcopy OBJDUMP= $(GNU_ROOT)/bin/gobjdump -OBJCOPY= /code/binutils-gdb/binutils/objcopy -OBJDUMP= /code/binutils-gdb/binutils/objdump PROG= boot1.sym MACHINE=$(MACH64) @@ -103,13 +101,15 @@ ${PROG}: $(OBJS) $(DPADD) CLEANFILES += machine x86 machine: - ln -sf ./../../../${MACHINE}/include machine + $(RM) machine + $(SYMLINK) ./../../../${MACHINE}/include machine x86: - ln -sf ./../../../x86/include x86 + $(RM) x86 + $(SYMLINK) ./../../../x86/include x86 clean clobber: - rm -f $(CLEANFILES) $(OBJS) + $(RM) $(CLEANFILES) $(OBJS) %.o: ../loader/arch/${MACHINE}/%.S $(COMPILE.S) $< diff --git a/usr/src/boot/sys/boot/efi/libefi/Makefile b/usr/src/boot/sys/boot/efi/libefi/Makefile index e88d75035b..38a544f743 100644 --- a/usr/src/boot/sys/boot/efi/libefi/Makefile +++ b/usr/src/boot/sys/boot/efi/libefi/Makefile @@ -60,7 +60,9 @@ clobber: $(RM) $(CLEANFILES) $(OBJS) machine x86 lib$(LIB).a machine: - ln -fs ../../../amd64/include machine + $(RM) machine + $(SYMLINK) ../../../amd64/include machine x86: - ln -fs ../../../x86/include x86 + $(RM) x86 + $(SYMLINK) ../../../x86/include x86 diff --git a/usr/src/boot/sys/boot/efi/loader/Makefile b/usr/src/boot/sys/boot/efi/loader/Makefile index 67269c3cf8..5824a84ada 100644 --- a/usr/src/boot/sys/boot/efi/loader/Makefile +++ b/usr/src/boot/sys/boot/efi/loader/Makefile @@ -92,7 +92,7 @@ all: machine x86 loader.efi install: all $(ROOTBOOTFILES) vers.c: ../../common/newvers.sh ../../efi/loader/version - sh ../../common/newvers.sh version ${NEWVERSWHAT} + $(SH) ../../common/newvers.sh version ${NEWVERSWHAT} EFI_TARGET= pei-x86-64 @@ -122,13 +122,15 @@ beforedepend ${OBJS}: machine CLEANFILES += machine x86 machine: - ln -sf ../../../${MACHINE}/include machine + $(RM) machine + $(SYMLINK) ../../../${MACHINE}/include machine x86: - ln -sf ../../../x86/include x86 + $(RM) x86 + $(SYMLINK) ../../../x86/include x86 clean clobber: - rm -f $(CLEANFILES) $(OBJS) loader.sym loader.efi + $(RM) $(CLEANFILES) $(OBJS) loader.sym loader.efi %.o: %.c $(COMPILE.c) $< diff --git a/usr/src/boot/sys/boot/ficl/Makefile.inc b/usr/src/boot/sys/boot/ficl/Makefile.inc index 4bca8adf32..91920b49b9 100644 --- a/usr/src/boot/sys/boot/ficl/Makefile.inc +++ b/usr/src/boot/sys/boot/ficl/Makefile.inc @@ -29,10 +29,12 @@ libficl.a: $(OBJECTS) $(AR) $(ARFLAGS) libficl.a $(OBJECTS) machine: - ln -sf ../../../$(MACHINE)/include machine + $(RM) machine + $(SYMLINK) ../../../$(MACHINE)/include machine x86: - ln -sf ../../../x86/include x86 + $(RM) x86 + $(SYMLINK) ../../../x86/include x86 %.o: ../softcore/%.c $(HEADERS) $(COMPILE.c) $< diff --git a/usr/src/boot/sys/boot/i386/btx/btx/Makefile b/usr/src/boot/sys/boot/i386/btx/btx/Makefile index 37c30bc019..61a2468bba 100644 --- a/usr/src/boot/sys/boot/i386/btx/btx/Makefile +++ b/usr/src/boot/sys/boot/i386/btx/btx/Makefile @@ -20,7 +20,7 @@ SRCS= btx.S OBJS= btx.o AS= $(GNU_ROOT)/bin/gas -LD= /usr/bin/gld +LD= $(GNU_ROOT)/bin/gld CC= $(GCC_ROOT)/bin/gcc #.if defined(BOOT_BTX_NOHANG) diff --git a/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile b/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile index 96b4792358..1af4190690 100644 --- a/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile +++ b/usr/src/boot/sys/boot/i386/btx/btxldr/Makefile @@ -20,7 +20,7 @@ SRCS= btxldr.S OBJS= btxldr.o AS= $(GNU_ROOT)/bin/gas -LD= /usr/bin/gld +LD= $(GNU_ROOT)/bin/gld CC= $(GCC_ROOT)/bin/gcc LOADER_ADDRESS=0x200000 diff --git a/usr/src/boot/sys/boot/i386/btx/lib/Makefile b/usr/src/boot/sys/boot/i386/btx/lib/Makefile index 8c360ddbe0..a627021b66 100644 --- a/usr/src/boot/sys/boot/i386/btx/lib/Makefile +++ b/usr/src/boot/sys/boot/i386/btx/lib/Makefile @@ -15,8 +15,8 @@ include $(SRC)/Makefile.master -AS= /usr/bin/gas -LD= /usr/bin/gld +AS= $(GNU_ROOT)/bin/gas +LD= $(GNU_ROOT)/bin/gld CC= $(GCC_ROOT)/bin/gcc CPPFLAGS= -I./../../common diff --git a/usr/src/boot/sys/boot/i386/cdboot/Makefile b/usr/src/boot/sys/boot/i386/cdboot/Makefile index 102638883f..4b3ade2958 100644 --- a/usr/src/boot/sys/boot/i386/cdboot/Makefile +++ b/usr/src/boot/sys/boot/i386/cdboot/Makefile @@ -17,7 +17,7 @@ include $(SRC)/Makefile.master ROOT_BOOT = $(ROOT)/boot -LD= /usr/bin/gld +LD= $(GNU_ROOT)/bin/gld CC= $(GCC_ROOT)/bin/gcc CFLAGS = -O2 -I../common -march=i386 -ffreestanding -mno-mmx -mno-3dnow diff --git a/usr/src/boot/sys/boot/i386/gptzfsboot/Makefile b/usr/src/boot/sys/boot/i386/gptzfsboot/Makefile index fd62f7f341..6147c3a947 100644 --- a/usr/src/boot/sys/boot/i386/gptzfsboot/Makefile +++ b/usr/src/boot/sys/boot/i386/gptzfsboot/Makefile @@ -105,10 +105,12 @@ gptzfsboot.out: ${BTXCRT} ${OBJS} ${LIBZFSBOOT} ${LIBSTAND} ${LIBZFSBOOT} ${LIBSTAND} machine: - ln -sf ../../../i386/include machine + $(RM) machine + $(SYMLINK) ../../../i386/include machine x86: - ln -sf ../../../x86/include x86 + $(RM) x86 + $(SYMLINK) ../../../x86/include x86 %.o: ../common/%.c $(COMPILE.c) -o $@ $< diff --git a/usr/src/boot/sys/boot/i386/libi386/Makefile b/usr/src/boot/sys/boot/i386/libi386/Makefile index 06795a3165..f3780e856e 100644 --- a/usr/src/boot/sys/boot/i386/libi386/Makefile +++ b/usr/src/boot/sys/boot/i386/libi386/Makefile @@ -25,7 +25,7 @@ clean: clobber clobber: $(RM) machine x86 $(OBJS) libi386.a -AS= /usr/bin/gas +AS= $(GNU_ROOT)/bin/gas CC= $(GCC_ROOT)/bin/gcc OBJCOPY= $(GNU_ROOT)/bin/gobjcopy AS_FLAGS=--32 @@ -98,10 +98,12 @@ CLEANFILES += machine x86 include ../Makefile.inc machine: - ln -sf ../../../i386/include machine + $(RM) machine + $(SYMLINK) ../../../i386/include machine x86: - ln -sf ../../../x86/include x86 + $(RM) x86 + $(SYMLINK) ../../../x86/include x86 libi386.a: machine $(OBJS) $(AR) $(ARFLAGS) $@ $(OBJS) diff --git a/usr/src/boot/sys/boot/i386/loader/Makefile b/usr/src/boot/sys/boot/i386/loader/Makefile index dcbf48c1f6..5c02069d44 100644 --- a/usr/src/boot/sys/boot/i386/loader/Makefile +++ b/usr/src/boot/sys/boot/i386/loader/Makefile @@ -27,9 +27,10 @@ CPPFLAGS += -I../libi386 LIBZFSBOOT= ../../zfs/i386/libzfsboot.a LIBI386= ../libi386/libi386.a -LD= /usr/bin/gld -CC= $(GCC_ROOT)/bin/gcc -OBJCOPY= $(GNU_ROOT)/bin/gobjcopy +LD= $(GNU_ROOT)/bin/gld +CC= $(GCC_ROOT)/bin/gcc +OBJCOPY= $(GNU_ROOT)/bin/gobjcopy +GSTRIP= $(GNU_ROOT)/bin/gstrip ROOT_BOOT= $(ROOT)/boot ROOT_BOOT_DEFAULTS= $(ROOT)/boot/defaults ROOT_BOOT_FORTH= $(ROOT)/boot/forth @@ -103,18 +104,18 @@ CPPFLAGS += -I../btx/lib include ../Makefile.inc vers.c: ../../common/newvers.sh version - sh ../../common/newvers.sh version ${NEWVERSWHAT} + $(SH) ../../common/newvers.sh version ${NEWVERSWHAT} ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} $(BTXLD) -v -f aout -e ${LOADER_ADDRESS} -o $@ -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin ${LOADER}.bin: ${LOADER}.sym - cp $^ $@ - /usr/bin/gstrip -R .comment -R .note $@ + $(CP) $^ $@ + $(GSTRIP) -R .comment -R .note $@ loader.help: ../../common/help.common help.i386 - cat $^ | $(AWK) -f ../../common/merge_help.awk > $@ + $(CAT) $^ | $(AWK) -f ../../common/merge_help.awk > $@ FILES= ${LOADER} loader.help @@ -133,10 +134,12 @@ CLEANFILES += machine x86 CFLAGS += -DLOADER_PREFER_AMD64 machine: - ln -sf ../../../i386/include machine + $(RM) machine + $(SYMLINK) ../../../i386/include machine x86: - ln -sf ../../../x86/include x86 + $(RM) x86 + $(SYMLINK) ../../../x86/include x86 OBJS= $(SRCS:%.c=%.o) diff --git a/usr/src/boot/sys/boot/i386/pmbr/Makefile b/usr/src/boot/sys/boot/i386/pmbr/Makefile index 3adfc3f929..0aa056a58e 100644 --- a/usr/src/boot/sys/boot/i386/pmbr/Makefile +++ b/usr/src/boot/sys/boot/i386/pmbr/Makefile @@ -23,7 +23,7 @@ ROOT_BOOT = $(ROOT)/boot PROG= pmbr #AS= $(GNU_ROOT)/bin/gas -LD= /usr/bin/gld +LD= $(GNU_ROOT)/bin/gld STRIP= # no strip is needed FILEMODE=0444 MAN= diff --git a/usr/src/boot/sys/boot/i386/pxeldr/Makefile b/usr/src/boot/sys/boot/i386/pxeldr/Makefile index cf20f26a77..dedb38a73a 100644 --- a/usr/src/boot/sys/boot/i386/pxeldr/Makefile +++ b/usr/src/boot/sys/boot/i386/pxeldr/Makefile @@ -18,7 +18,8 @@ include $(SRC)/Makefile.master ROOT_BOOT = $(ROOT)/boot CC= $(GCC_ROOT)/bin/gcc -LD= /usr/bin/gld +LD= $(GNU_ROOT)/bin/gld +DD= /usr/bin/dd CFLAGS= -O2 -I../../.. CCASFLAGS= -Wa,--divide @@ -53,9 +54,9 @@ LOADERBIN= ../loader/zfsloader.bin CLEANFILES += ${BOOT}.tmp ${BOOT}: ${LDR} ${LOADER} - cat ${LDR} ${LOADER} > $@.tmp - dd if=$@.tmp of=$@ obs=2k conv=sync - rm $@.tmp + $(CAT) ${LDR} ${LOADER} > $@.tmp + $(DD) if=$@.tmp of=$@ obs=2k conv=sync + $(RM) $@.tmp LDFLAGS +=-e start -Ttext ${ORG} -N -S --oformat binary diff --git a/usr/src/boot/sys/boot/libstand/Makefile.com b/usr/src/boot/sys/boot/libstand/Makefile.com index 7763868db7..73c0538dbd 100644 --- a/usr/src/boot/sys/boot/libstand/Makefile.com +++ b/usr/src/boot/sys/boot/libstand/Makefile.com @@ -47,10 +47,12 @@ clobber: $(RM) $(CLEANFILES) $(OBJS) machine x86 libstand.a machine: - ln -fs ../../../$(MACHINE)/include machine + $(RM) machine + $(SYMLINK) ../../../$(MACHINE)/include machine x86: - ln -fs ../../../x86/include x86 + $(RM) x86 + $(SYMLINK) ../../../x86/include x86 %.o: $(LIBSTAND_SRC)/%.c $(COMPILE.c) $< diff --git a/usr/src/boot/sys/boot/zfs/Makefile.com b/usr/src/boot/sys/boot/zfs/Makefile.com index 40656ed45d..bb11ab91d6 100644 --- a/usr/src/boot/sys/boot/zfs/Makefile.com +++ b/usr/src/boot/sys/boot/zfs/Makefile.com @@ -42,10 +42,12 @@ CFLAGS += -Wformat -Wall -std=gnu99 CLEANFILES += machine x86 machine: - ln -sf ../../../$(MACHINE)/include machine + $(RM) machine + $(SYMLINK) ../../../$(MACHINE)/include machine x86: - ln -sf ../../../x86/include x86 + $(RM) x86 + $(SYMLINK) ../../../x86/include x86 libzfsboot.a: $(OBJS) $(AR) $(ARFLAGS) $@ $(OBJS) -- 2.11.4.GIT