Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion efi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ VPATH = $(SRC)
include $(MAKEDIR)/lib.mk
include $(MAKEDIR)/efi.mk

CC_FOR_BUILD ?= $(CC)

# Upstream gnu-efi has old-style function definitions.
CFLAGS += -Wno-strict-prototypes

Expand Down Expand Up @@ -78,7 +80,7 @@ syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
# cp $^ $@

wrapper: wrapper.c
$(CC) $^ -o $@
$(CC_FOR_BUILD) $^ -o $@

#
# Build the wrapper app and wrap our .so to produce a .efi
Expand Down
2 changes: 1 addition & 1 deletion efi/build-gnu-efi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi
mkdir -p "$objdir/gnu-efi"
cd "$objdir/gnu-efi"

EFIDIR="$(readlink -f "$objdir/../gnu-efi/gnu-efi-3.0")"
EFIDIR="$(readlink -f "$objdir/../gnu-efi")"

make SRCDIR="$EFIDIR" TOPDIR="$EFIDIR" -f "$EFIDIR/Makefile" ARCH=$ARCH
make SRCDIR="$EFIDIR" TOPDIR="$EFIDIR" -f "$EFIDIR/Makefile" ARCH=$ARCH PREFIX="$objdir" install
Expand Down
2 changes: 1 addition & 1 deletion efi/clean-gnu-efi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ objdir=$(readlink -f "$2")

if [ -d "$objdir/gnu-efi" ];then
cd "$objdir/gnu-efi"
EFIDIR="$(readlink -f "$objdir/../gnu-efi/gnu-efi-3.0")"
EFIDIR="$(readlink -f "$objdir/../gnu-efi")"
make SRCDIR="$EFIDIR" TOPDIR="$EFIDIR" -f "$EFIDIR/Makefile" ARCH=$ARCH clean
fi

Expand Down
9 changes: 0 additions & 9 deletions efi/fio.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
#define MAX_EFI_ARGS 64
#define WS(c16) (c16 == L' ' || c16 == CHAR_TAB)

/* VPrint is not in export declarations in gnu-efi lib yet
* although it is a global function; declare it here
*/
extern UINTN
VPrint (
IN CHAR16 *fmt,
va_list args
);

extern EFI_STATUS efi_errno;

void efi_memcpy(unsigned char *dst, unsigned char *src, size_t len);
Expand Down
5 changes: 2 additions & 3 deletions efi/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <syslinux/firmware.h>
#include <syslinux/linux.h>
#include <sys/ansi.h>
#include <setjmp.h>

#include "efi.h"
#include "fio.h"
Expand Down Expand Up @@ -185,7 +184,7 @@ __export void local_boot(uint16_t ax)
* Inform the firmware that we failed to execute correctly, which
* will trigger the next entry in the EFI Boot Manager list.
*/
longjmp(load_error_buf, 1);
longjmp(&load_error_buf, 1);
}

void bios_timer_cleanup(void)
Expand Down Expand Up @@ -1383,7 +1382,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *table)
status = uefi_call_wrapper(in->ReadKeyStroke, 2, in, &key);
} while (status == EFI_SUCCESS);

if (!setjmp(load_error_buf))
if (!setjmp(&load_error_buf))
load_env32(NULL);

/* load_env32() failed.. cancel timer and bailout */
Expand Down
2 changes: 1 addition & 1 deletion gnu-efi
Submodule gnu-efi updated from ab54e2 to af5d14
2 changes: 1 addition & 1 deletion memdisk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ memdisk16.o: memdisk16.asm
$(NASM) -f bin $(NASMOPT) $(NFLAGS) $(NINCLUDE) -o $@ -l $*.lst $<

memdisk_%.o: memdisk_%.bin
$(LD) -r -b binary -o $@ $<
$(LD) --oformat elf32-i386 -r -b binary -o $@ $<

memdisk16.elf: $(OBJS16)
$(LD) -Ttext 0 -o $@ $^
Expand Down
14 changes: 8 additions & 6 deletions utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
VPATH = $(SRC)
include $(MAKEDIR)/syslinux.mk

CFLAGS = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC)
LDFLAGS = -O2
CC_FOR_BUILD ?= $(CC)

CFLAGS = $(CFLAGS_FOR_BUILD) $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC)
LDFLAGS = $(LDFLAGS_FOR_BUILD) -O2

C_TARGETS = isohybrid gethostip memdiskfind
SCRIPT_TARGETS = mkdiskimage
Expand All @@ -35,7 +37,7 @@ ISOHDPFX = $(addprefix $(OBJ)/,../mbr/isohdpfx.bin ../mbr/isohdpfx_f.bin \
all: $(TARGETS)

%.o: %.c
$(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
$(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<

mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl
$(PERL) $(SRC)/bin2hex.pl < $(OBJ)/../mbr/mbr.bin | cat $(SRC)/mkdiskimage.in - > $@
Expand All @@ -51,13 +53,13 @@ isohdpfx.c: $(ISOHDPFX) isohdpfxarray.pl
$(PERL) $(SRC)/isohdpfxarray.pl $(ISOHDPFX) > $@

isohybrid: isohybrid.o isohdpfx.o
$(CC) $(LDFLAGS) -o $@ $^ -luuid
$(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^ -luuid

gethostip: gethostip.o
$(CC) $(LDFLAGS) -o $@ $^
$(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^

memdiskfind: memdiskfind.o
$(CC) $(LDFLAGS) -o $@ $^
$(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^

tidy dist:
rm -f *.o .*.d isohdpfx.c
Expand Down