Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 403be24

Browse files
author
Octavian Purdila
committed
Merge pull request torvalds#104 from ngkaho1234/fix-makefile
lkl: Don't specify different compiler/linker flags for elf32-littlearm.
2 parents 7746789 + dd31a56 commit 403be24

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tools/lkl/Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export CFLAGS += -Iinclude -Wall -g -O2 -Wextra -Wno-unused-parameter \
4141

4242
OUTPUT_FORMAT = $(shell $(LD) -r -print-output-format)
4343

44-
ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64 elf32-i386 elf64-x86-64-freebsd))
44+
ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64 elf32-i386 elf64-x86-64-freebsd elf32-littlearm))
45+
OUTPUT_DEF = $(shell echo | $(CC) -dM -E -)
4546
CFLAGS += -fPIC -pthread
46-
LDLIBS += -lrt -lpthread
47-
export CONFIG_AUTO_LKL_POSIX_HOST=y
48-
else ifneq (,$(filter $(OUTPUT_FORMAT),elf32-littlearm))
49-
CFLAGS += -fPIC
47+
ifeq (,$(filter $(OUTPUT_DEF),__ANDROID__))
48+
LDLIBS += -lrt -lpthread
49+
endif
5050
export CONFIG_AUTO_LKL_POSIX_HOST=y
5151
else ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386))
5252
KOPT = "KALLSYMS_EXTRA_PASS=1"
@@ -118,8 +118,12 @@ cpfromfs$(EXESUF): cptofs$(EXESUF)
118118
# because of argp and fuse, none of the binaries will compile on windows
119119
# because of libdl, liblkl-hijack will not compile on windows
120120
# arm-android neither for the moment
121-
ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386 elf32-littlearm))
121+
ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386))
122122
all: $(filter-out liblkl-hijack$(SOSUF), $(ALL_LIBRARIES))
123+
else ifneq (,$(filter $(OUTPUT_DEF),__ANDROID__))
124+
all: $(filter-out liblkl-hijack$(SOSUF), $(ALL_LIBRARIES))
125+
else ifneq (,$(filter $(OUTPUT_FORMAT),elf32-littlearm))
126+
all: $(filter-out liblkl-hijack$(SOSUF), $(ALL_LIBRARIES)) $(ALL_PROGRAMS)
123127
else
124128
all: $(ALL_PROGRAMS) $(ALL_LIBRARIES)
125129
endif

0 commit comments

Comments
 (0)