Print this page
7438 intermittent build failures from the new boot loader
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>
   1 #
   2 # This file and its contents are supplied under the terms of the
   3 # Common Development and Distribution License ("CDDL"), version 1.0.
   4 # You may only use this file in accordance with the terms of version
   5 # 1.0 of the CDDL.
   6 #
   7 # A full copy of the text of the CDDL should have accompanied this
   8 # source.  A copy of the CDDL is also available via the Internet at
   9 # http://www.illumos.org/license/CDDL.
  10 #
  11 
  12 #
  13 # Copyright 2016 Toomas Soome <tsoome@me.com>

  14 #
  15 
  16 include $(SRC)/Makefile.master
  17 
  18 CC=             $(GCC_ROOT)/bin/gcc
  19 LD=             $(GNU_ROOT)/bin/gld
  20 OBJCOPY=        $(GNU_ROOT)/bin/gobjcopy
  21 OBJDUMP=        $(GNU_ROOT)/bin/gobjdump
  22 
  23 PROG=           loader.sym
  24 MACHINE=        $(MACH64)
  25 
  26 # architecture-specific loader code
  27 SRCS=   autoload.c bootinfo.c conf.c copy.c devicename.c main.c self_reloc.c \
  28         smbios.c biosacpi.c vers.c
  29 OBJS= autoload.o bootinfo.o conf.o copy.o devicename.o main.o self_reloc.o \
  30         smbios.o biosacpi.o vers.o
  31 
  32 ASFLAGS=-m64 -fPIC
  33 CFLAGS= -O2


  71 #.endif
  72 
  73 # Always add MI sources
  74 include ./Makefile.common
  75 CPPFLAGS +=     -I../../common
  76 
  77 FILES=  loader.efi
  78 FILEMODE=       0555
  79 ROOT_BOOT=      $(ROOT)/boot
  80 ROOTBOOTFILES=$(FILES:%=$(ROOT_BOOT)/%)
  81 
  82 LDSCRIPT=       ./arch/${MACHINE}/ldscript.${MACHINE}
  83 LDFLAGS =       -nostdlib --eh-frame-hdr -znocombreloc
  84 LDFLAGS +=      -shared --hash-style=both --enable-new-dtags
  85 LDFLAGS +=      -T${LDSCRIPT} -Bsymbolic
  86 
  87 CLEANFILES=     vers.c loader.efi
  88 
  89 NEWVERSWHAT=    "EFI loader" ${MACHINE}
  90 
  91 all: machine x86 loader.efi

  92 install: all $(ROOTBOOTFILES)
  93 
  94 vers.c: ../../common/newvers.sh ../../efi/loader/version
  95         $(SH) ../../common/newvers.sh version ${NEWVERSWHAT}
  96 
  97 EFI_TARGET=     pei-x86-64
  98 
  99 loader.efi: loader.sym
 100         if [ `${OBJDUMP} -t loader.sym | fgrep '*UND*' | wc -l` != 0 ]; then \
 101                 ${OBJDUMP} -t loader.sym | fgrep '*UND*'; \
 102                 exit 1; \
 103         fi
 104         ${OBJCOPY} --readonly-text -j .peheader -j .text -j .sdata -j .data \
 105                 -j .dynamic -j .dynsym -j .rel.dyn \
 106                 -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
 107                 --output-target=${EFI_TARGET} --subsystem efi-app loader.sym $@
 108 
 109 LIBEFI=         ../libefi/libefi.a
 110 
 111 DPADD=          ${LIBFICL} ${LIBZFSBOOT} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} \
 112                 ${LIBSTAND} ${LDSCRIPT}
 113 LDADD=          ${LIBFICL} ${LIBZFSBOOT} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} \
 114                 ${LIBSTAND}
 115 
 116 
 117 loader.sym:     $(OBJS) $(DPADD)
 118         $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LDADD)
 119 
 120 beforedepend ${OBJS}: machine
 121 
 122 CLEANFILES +=   machine x86
 123 
 124 machine:
 125         $(RM) machine
 126         $(SYMLINK) ../../../${MACHINE}/include machine
 127 
 128 x86:
 129         $(RM) x86
 130         $(SYMLINK) ../../../x86/include x86


 131 
 132 clean clobber:
 133         $(RM) $(CLEANFILES) $(OBJS) loader.sym loader.efi
 134 
 135 %.o:    %.c
 136         $(COMPILE.c) $<
 137 
 138 %.o:    ./arch/${MACHINE}/%.c
 139         $(COMPILE.c) $<
 140 
 141 %.o:    ./arch/${MACHINE}/%.S
 142         $(COMPILE.S) $<
 143 
 144 %.o:    ../../common/%.c
 145         $(COMPILE.c) $<
 146 
 147 %.o:    ../../common/linenoise/%.c
 148         $(COMPILE.c) $<
 149 
 150 %.o: ../../i386/libi386/%.c
   1 #
   2 # This file and its contents are supplied under the terms of the
   3 # Common Development and Distribution License ("CDDL"), version 1.0.
   4 # You may only use this file in accordance with the terms of version
   5 # 1.0 of the CDDL.
   6 #
   7 # A full copy of the text of the CDDL should have accompanied this
   8 # source.  A copy of the CDDL is also available via the Internet at
   9 # http://www.illumos.org/license/CDDL.
  10 #
  11 
  12 #
  13 # Copyright 2016 Toomas Soome <tsoome@me.com>
  14 # Copyright 2016 RackTop Systems.
  15 #
  16 
  17 include $(SRC)/Makefile.master
  18 
  19 CC=             $(GCC_ROOT)/bin/gcc
  20 LD=             $(GNU_ROOT)/bin/gld
  21 OBJCOPY=        $(GNU_ROOT)/bin/gobjcopy
  22 OBJDUMP=        $(GNU_ROOT)/bin/gobjdump
  23 
  24 PROG=           loader.sym
  25 MACHINE=        $(MACH64)
  26 
  27 # architecture-specific loader code
  28 SRCS=   autoload.c bootinfo.c conf.c copy.c devicename.c main.c self_reloc.c \
  29         smbios.c biosacpi.c vers.c
  30 OBJS= autoload.o bootinfo.o conf.o copy.o devicename.o main.o self_reloc.o \
  31         smbios.o biosacpi.o vers.o
  32 
  33 ASFLAGS=-m64 -fPIC
  34 CFLAGS= -O2


  72 #.endif
  73 
  74 # Always add MI sources
  75 include ./Makefile.common
  76 CPPFLAGS +=     -I../../common
  77 
  78 FILES=  loader.efi
  79 FILEMODE=       0555
  80 ROOT_BOOT=      $(ROOT)/boot
  81 ROOTBOOTFILES=$(FILES:%=$(ROOT_BOOT)/%)
  82 
  83 LDSCRIPT=       ./arch/${MACHINE}/ldscript.${MACHINE}
  84 LDFLAGS =       -nostdlib --eh-frame-hdr -znocombreloc
  85 LDFLAGS +=      -shared --hash-style=both --enable-new-dtags
  86 LDFLAGS +=      -T${LDSCRIPT} -Bsymbolic
  87 
  88 CLEANFILES=     vers.c loader.efi
  89 
  90 NEWVERSWHAT=    "EFI loader" ${MACHINE}
  91 
  92 all: loader.efi
  93 
  94 install: all $(ROOTBOOTFILES)
  95 
  96 vers.c: ../../common/newvers.sh ../../efi/loader/version
  97         $(SH) ../../common/newvers.sh version ${NEWVERSWHAT}
  98 
  99 EFI_TARGET=     pei-x86-64
 100 
 101 loader.efi: loader.sym
 102         if [ `${OBJDUMP} -t loader.sym | fgrep '*UND*' | wc -l` != 0 ]; then \
 103                 ${OBJDUMP} -t loader.sym | fgrep '*UND*'; \
 104                 exit 1; \
 105         fi
 106         ${OBJCOPY} --readonly-text -j .peheader -j .text -j .sdata -j .data \
 107                 -j .dynamic -j .dynsym -j .rel.dyn \
 108                 -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
 109                 --output-target=${EFI_TARGET} --subsystem efi-app loader.sym $@
 110 
 111 LIBEFI=         ../libefi/libefi.a
 112 
 113 DPADD=          ${LIBFICL} ${LIBZFSBOOT} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} \
 114                 ${LIBSTAND} ${LDSCRIPT}
 115 LDADD=          ${LIBFICL} ${LIBZFSBOOT} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} \
 116                 ${LIBSTAND}
 117 
 118 
 119 loader.sym:     $(OBJS) $(DPADD)
 120         $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LDADD)
 121 


 122 CLEANFILES +=   machine x86
 123 
 124 machine:
 125         $(RM) machine
 126         $(SYMLINK) ../../../${MACHINE}/include machine
 127 
 128 x86:
 129         $(RM) x86
 130         $(SYMLINK) ../../../x86/include x86
 131 
 132 $(OBJS): machine x86
 133 
 134 clean clobber:
 135         $(RM) $(CLEANFILES) $(OBJS) loader.sym loader.efi
 136 
 137 %.o:    %.c
 138         $(COMPILE.c) $<
 139 
 140 %.o:    ./arch/${MACHINE}/%.c
 141         $(COMPILE.c) $<
 142 
 143 %.o:    ./arch/${MACHINE}/%.S
 144         $(COMPILE.S) $<
 145 
 146 %.o:    ../../common/%.c
 147         $(COMPILE.c) $<
 148 
 149 %.o:    ../../common/linenoise/%.c
 150         $(COMPILE.c) $<
 151 
 152 %.o: ../../i386/libi386/%.c