Skip to content

Commit fcc3280

Browse files
Namhyung Kimacmel
authored andcommitted
perf tools: Fix LIBELF_MMAP checking
Currently checking mmap support in libelf failed due to wrong flags. CHK libelf CHK libdw CHK libunwind CHK -DLIBELF_MMAP /tmp/ccYJwdR0.o: In function `main': :(.text+0x18): undefined reference to `elf_begin' collect2: error: ld returned 1 exit status This cannot happen since we checked the elf_begin() when checking libelf and it succeeded. Fix it by using a same flag with libelf checking. Signed-off-by: Namhyung Kim <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent cf3aa10 commit fcc3280

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/perf/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
541541
else # NO_LIBELF
542542
BASIC_CFLAGS += -DLIBELF_SUPPORT
543543

544-
ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON),-DLIBELF_MMAP),y)
544+
FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
545+
ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
545546
BASIC_CFLAGS += -DLIBELF_MMAP
546547
endif
547548

0 commit comments

Comments
 (0)