Basic support for building on powerpc. Tested on ppc64le.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
# BPF is still experimental otherwise it should be available
#llvm_map_components_to_libnames(llvm_libs bpf mcjit irreader passes)
llvm_map_components_to_libnames(llvm_libs bitwriter bpfcodegen irreader linker
- mcjit objcarcopts option passes x86codegen)
+ mcjit objcarcopts option passes nativecodegen)
llvm_expand_dependencies(expanded_libs ${llvm_libs})
# order is important
const char *calling_conv_regs_x86[] = {
"di", "si", "dx", "cx", "r8", "r9"
};
+const char *calling_conv_regs_ppc[] = {"gpr[3]", "gpr[4]", "gpr[5]",
+ "gpr[6]", "gpr[7]", "gpr[8]"};
// todo: support more archs
+#if defined(__powerpc__)
+const char **calling_conv_regs = calling_conv_regs_ppc;
+#else
const char **calling_conv_regs = calling_conv_regs_x86;
+#endif
using std::map;
using std::set;
DiagnosticsEngine diags(DiagID, &*diag_opts, diag_client);
// set up the command line argument wrapper
+#if defined(__powerpc64__)
+ driver::Driver drv("", "ppc64le-unknown-linux-gnu", diags);
+#else
driver::Driver drv("", "x86_64-unknown-linux-gnu", diags);
+#endif
drv.setTitle("bcc-clang-driver");
drv.setCheckInputsExist(false);
// TODO: remove these defines when linux-libc-dev exports them properly
#ifndef __NR_bpf
+#if defined(__powerpc64__)
+#define __NR_bpf 361
+#else
#define __NR_bpf 321
#endif
+#endif
#ifndef SO_ATTACH_BPF
#define SO_ATTACH_BPF 50