Skip to content

Commit

Permalink
Added support for Windows 64 bit MSYS2 Build (LP64)
Browse files Browse the repository at this point in the history
Signed-off-by: Edison M. Castro <edisonmcastro@hotmail.com>
  • Loading branch information
tavip authored Feb 27, 2017
2 parents b227366 + 5d769ec commit 32b25c3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions arch/lkl/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ config LKL
select HAS_DMA
select PHYS_ADDR_T_64BIT if 64BIT
select 64BIT if OUTPUT_FORMAT = "elf64-x86-64"
select 64BIT if OUTPUT_FORMAT = "pe-x86-64"
select HAVE_UNDERSCORE_SYMBOL_PREFIX if OUTPUT_FORMAT = "pe-i386"
select 64BIT if OUTPUT_FORMAT = "elf64-x86-64-freebsd"
select IP_PNP
Expand Down
4 changes: 3 additions & 1 deletion arch/lkl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ KBUILD_CFLAGS += -fno-builtin

ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64 elf64-x86-64-freebsd elf32-littlearm ))
KBUILD_CFLAGS += -fPIC
else ifeq ($(OUTPUT_FORMAT),pe-i386)
else ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386 pe-x86-64 ))
ifneq ($(OUTPUT_FORMAT),pe-x86-64)
prefix=_
endif
# workaround for #include_next<stdarg.h> errors
LINUXINCLUDE := -isystem arch/lkl/include/system $(LINUXINCLUDE)
# workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991
Expand Down
13 changes: 11 additions & 2 deletions tools/lkl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,17 @@ ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64 elf32-i386 elf64-x86-64-freebsd e
CFLAGS += -DCONFIG_AUTO_LKL_VIRTIO_NET_VDE
LDLIBS += $(shell pkg-config --libs vdeplug)
endif
else ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386))
else ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386 pe-x86-64 ))
KOPT = "KALLSYMS_EXTRA_PASS=1"
LDLIBS += -lws2_32
EXESUF := .exe
SOSUF := .dll
export CONFIG_AUTO_LKL_NT_HOST=y
CFLAGS += -DCONFIG_AUTO_LKL_NT_HOST
ifneq (,$(filter $(OUTPUT_FORMAT),pe-x86-64))
CFLAGS += -Wl,--enable-auto-image-base -Wl,--image-base -Wl,0x10000000 -Wl,--out-implib=$(OUTPUT)liblkl.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import
LDFLAGS +=-Wl,--image-base -Wl,0x10000000 -Wl,--enable-auto-image-base -Wl,--out-implib=$(OUTPUT)liblkl.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import
endif
else
$(error Unrecognized platform: $(OUTPUT_FORMAT))
endif
Expand All @@ -85,8 +89,13 @@ OUTPUT := $(CURDIR)/
endif
export OUTPUT

ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386 pe-x86-64 ))
ALL_PROGRAMS :=
ALL_LIBRARIES := $(OUTPUT)liblkl.a $(OUTPUT)liblkl$(SOSUF)
else
ALL_PROGRAMS := $(OUTPUT)lklfuse$(EXESUF) $(OUTPUT)cptofs$(EXESUF) $(OUTPUT)cpfromfs$(EXESUF) $(OUTPUT)fs2tar$(EXESUF)
ALL_LIBRARIES := $(OUTPUT)liblkl.a $(OUTPUT)liblkl$(SOSUF) $(OUTPUT)liblkl-hijack$(SOSUF)
endif

static: $(OUTPUT)liblkl.a
shared: $(OUTPUT)liblkl$(SOSUF)
Expand All @@ -104,7 +113,7 @@ $(OUTPUT)lklfuse$(EXESUF): LDLIBS += -lfuse

$(OUTPUT)fs2tar$(EXESUF): $(OUTPUT)fs2tar-in.o $(OUTPUT)liblkl.a
$(OUTPUT)fs2tar$(EXESUF): LDLIBS += -larchive
ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64-freebsd))
ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64-freebsd pe-x86-64))
$(OUTPUT)fs2tar$(EXESUF): LDLIBS += -largp
endif

Expand Down

0 comments on commit 32b25c3

Please sign in to comment.