Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
*.sw?
*~
*.efi
*.efi.debug
*.o
*.a
*.so
*.tar.*
*.tar
/aarch64/
/arm/
/ia32/
/ia64/
/mips64el/
/x86_64/
12 changes: 10 additions & 2 deletions Make.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ EFI_CFLAGS += -std=c11
ifeq ($(ARCH),x86_64)
ifeq ($(GCCNEWENOUGH),1)
EFI_CFLAGS += -DGNU_EFI_USE_MS_ABI
ifeq ($(GNU_EFI_EXPORT_MS_ABI),1)
EFI_CFLAGS += -mabi=ms -DGNU_EFI_EXPORT_MS_ABI
endif
ifneq ($(USING_CLANG),clang)
EFI_CFLAGS += -maccumulate-outgoing-args
endif
Expand Down Expand Up @@ -270,12 +273,17 @@ ifeq ($(IS_MINGW32),)
EFI_CFLAGS += -fPIC
endif

OPTIMIZATION_CFLAGS ?= -O2
DEBUG_CFLAGS ?= -g

ifeq ($(USING_FREEBSD),1)
EFI_CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Wstrict-prototypes -Werror \
EFI_CFLAGS += $(ARCH3264) $(OPTIMIZATION_CFLAGS) $(DEBUG_CFLAGS) \
-Wall -Wextra -Wstrict-prototypes -Werror \
-fno-strict-aliasing \
-ffreestanding -fno-stack-protector
else
EFI_CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Wstrict-prototypes -Werror \
EFI_CFLAGS += $(ARCH3264) $(OPTIMIZATION_CFLAGS) $(DEBUG_CFLAGS) \
-Wall -Wextra -Wstrict-prototypes -Werror \
-fno-strict-aliasing \
-ffreestanding -fno-stack-protector \
$(if $(findstring 0,$(USING_CLANG)),-fno-merge-all-constants,)
Expand Down
23 changes: 23 additions & 0 deletions gnuefi/crt0-efi-x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,28 @@
.globl _start
.type _start,%function
_start:

#if defined(GNU_EFI_EXPORT_MS_ABI)
pushq %rsi
movq %rdx, %rsi
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r9
movq %rcx, %r8
subq $40, %rsp

lea _DYNAMIC(%rip), %rdx
lea ImageBase(%rip), %rcx
call _relocate

addq $40, %rsp
movq %rsi, %rdx
movq %rbx, %rcx
popq %rbx
popq %rsi
jmp _entry
nop
#else
subq $8, %rsp
pushq %rcx
pushq %rdx
Expand All @@ -59,6 +81,7 @@ _start:

call _entry
addq $8, %rsp
#endif

.L_exit:
ret
Expand Down
1 change: 1 addition & 0 deletions lib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ms_va_print.c
Loading