Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34c4a427 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo-20161205' of...

Merge tag 'perf-core-for-mingo-20161205' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

Fixes:

 - Do not show a bogus target address in 'perf annotate' for targetless powerpc
   jump instructions such as 'bctr' (Ravi Bangoria)

 - Fix tools/build race conditions with the fixdep utility (Jiri Olsa)

 - Fix building objtool with clang (Peter Foley)

Infrastructure changes:

- Support linking perf with clang and LLVM libraries, initially statically, but
  this limitation will be lifted and shared libraries, when available, will
  be preferred to the static build, that should, as with other features, be
  enabled explicitly (Wang Nan)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 78987584 bec60e50
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ dep-cmd = $(if $(wildcard $(fixdep)),
           printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \
           printf '\# using basic dep data\n\n' >> $(dot-target).cmd;           \
           cat $(depfile) >> $(dot-target).cmd;                                 \
           printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
           printf '\n%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)

###
# if_changed_dep  - execute command if any prerequisite is newer than
@@ -89,12 +89,12 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
# - per target C flags
# - per object C flags
# - BUILD_STR macro to allow '-D"$(variable)"' constructs
c_flags_1 = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
c_flags_1 = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1))
c_flags   = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2))
cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj))
cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj))

###
## HOSTCC C flags

host_c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))
host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))
+69 −51
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ FILES := $(addprefix $(OUTPUT),$(FILES))
CC := $(CROSS_COMPILE)gcc -MD
CXX := $(CROSS_COMPILE)g++ -MD
PKG_CONFIG := $(CROSS_COMPILE)pkg-config
LLVM_CONFIG ?= llvm-config

all: $(FILES)

@@ -229,6 +230,23 @@ $(OUTPUT)test-cxx.bin:
$(OUTPUT)test-jvmti.bin:
	$(BUILD)

$(OUTPUT)test-llvm.bin:
	$(BUILDXX) -std=gnu++11 					\
		-I$(shell $(LLVM_CONFIG) --includedir) 		\
		-L$(shell $(LLVM_CONFIG) --libdir)		\
		$(shell $(LLVM_CONFIG) --libs Core BPF)		\
		$(shell $(LLVM_CONFIG) --system-libs)

$(OUTPUT)test-clang.bin:
	$(BUILDXX) -std=gnu++11 					\
		-I$(shell $(LLVM_CONFIG) --includedir) 		\
		-L$(shell $(LLVM_CONFIG) --libdir)		\
		-Wl,--start-group -lclangBasic -lclangDriver	\
		  -lclangFrontend -lclangEdit -lclangLex	\
		  -lclangAST -Wl,--end-group 			\
		$(shell $(LLVM_CONFIG) --libs Core option)	\
		$(shell $(LLVM_CONFIG) --system-libs)

-include $(OUTPUT)*.d

###############################
+21 −0
Original line number Diff line number Diff line
#include "clang/Basic/VirtualFileSystem.h"
#include "clang/Driver/Driver.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_ostream.h"

using namespace clang;
using namespace clang::driver;

int main()
{
	IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
	IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();

	DiagnosticsEngine Diags(DiagID, &*DiagOpts);
	Driver TheDriver("test", "bpf-pc-linux", Diags);

	llvm::llvm_shutdown();
	return 0;
}
+8 −0
Original line number Diff line number Diff line
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_ostream.h"
int main()
{
	llvm::errs() << "Hello World!\n";
	llvm::llvm_shutdown();
	return 0;
}
+3 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ static void parse_dep_file(void *map, size_t len)
	char *end = m + len;
	char *p;
	char s[PATH_MAX];
	int is_target;
	int is_target, has_target = 0;
	int saw_any_target = 0;
	int is_first_dep = 0;

@@ -67,7 +67,8 @@ static void parse_dep_file(void *map, size_t len)
		if (is_target) {
			/* The /next/ file is the first dependency */
			is_first_dep = 1;
		} else {
			has_target = 1;
		} else if (has_target) {
			/* Save this token/filename */
			memcpy(s, m, p-m);
			s[p - m] = 0;
Loading