Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755286AbbFKRnJ (ORCPT ); Thu, 11 Jun 2015 13:43:09 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36189 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932867AbbFKRmm (ORCPT ); Thu, 11 Jun 2015 13:42:42 -0400 Message-ID: <5579C891.7020703@plumgrid.com> Date: Thu, 11 Jun 2015 10:42:41 -0700 From: Alexei Starovoitov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Wangnan (F)" , Namhyung Kim CC: acme@kernel.org, brendan.d.gregg@gmail.com, daniel@iogearbox.net, masami.hiramatsu.pt@hitachi.com, paulus@samba.org, a.p.zijlstra@chello.nl, mingo@redhat.com, jolsa@kernel.org, dsahern@gmail.com, linux-kernel@vger.kernel.org, lizefan@huawei.com, hekuang@huawei.com, xiakaixu@huawei.com, pi3orama@163.com Subject: Re: [RFC PATCH v6 24/32] perf record: Compile scriptlets if pass '.c' to --event References: <1433829036-23687-1-git-send-email-wangnan0@huawei.com> <1433829036-23687-25-git-send-email-wangnan0@huawei.com> <55775F3A.9080204@plumgrid.com> <55777F79.2080605@huawei.com> <20150611071936.GA11184@sejong> <55793A5B.6080202@huawei.com> In-Reply-To: <55793A5B.6080202@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1207 Lines: 36 On 6/11/15 12:35 AM, Wangnan (F) wrote: > Now I'm trying this: > > "$CLANG_EXEC $CLANG_OPTIONS $KERNEL_INC_OPTIONS " > "-Wno-unused-value -Wno-pointer-sign " > "-working-directory $WORKING_DIR " > " -c \"$CLANG_SOURCE\" -march=bpf -O2 -o -" > > WORKING_DIR is appended because we will get relative include directory > using the > Makefile trick. clang bpf support is in. so please pull the latest llvm and clang, rebuild and you should be able to use: clang -O2 -target bpf -c file.c Just like any other arch use -S to generate .s and so on. Old style 'clang -emit-llvm -o - | llc -march=bpf' is fine too. To build llvm/clang do: git clone https://github.com/llvm-mirror/llvm.git git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang mkdir llvm/build/ cd llvm/build/ cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_TARGETS_TO_BUILD="X86;BPF" \ -DCMAKE_INSTALL_PREFIX=/opt/local/llvm make -j sudo make install -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/