From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaldo Carvalho de Melo Subject: Re: [PATCH bpf-next v5 00/10] BTF: BPF Type Format Date: Thu, 14 Jun 2018 14:47:59 -0300 Message-ID: <20180614174759.GI30043@kernel.org> References: <20180607190510.qtj7gq4wbfewcn4g@kafai-mbp> <20180607193029.GG17292@kernel.org> <20180607200701.bvsjzoq56rnggwfd@kafai-mbp> <20180612203124.GB22039@kernel.org> <20180612204126.GC22039@kernel.org> <20180613232638.yyhktiovl6oeawgt@kafai-mbp> <20180614150334.GF30043@kernel.org> <20180614162227.r72d7wk57unfhqvo@kafai-mbp.dhcp.thefacebook.com> <20180614171806.GG30043@kernel.org> <1e7a418d-53e8-ee72-5a13-7e2df5a48000@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Martin KaFai Lau , netdev@vger.kernel.org, Daniel Borkmann , kernel-team@fb.com, Wang Nan , Jiri Olsa , Namhyung Kim , Ingo Molnar To: Alexei Starovoitov Return-path: Received: from mail.kernel.org ([198.145.29.99]:46562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755385AbeFNRsJ (ORCPT ); Thu, 14 Jun 2018 13:48:09 -0400 Content-Disposition: inline In-Reply-To: <1e7a418d-53e8-ee72-5a13-7e2df5a48000@fb.com> Sender: netdev-owner@vger.kernel.org List-ID: Em Thu, Jun 14, 2018 at 10:21:30AM -0700, Alexei Starovoitov escreveu: > On 6/14/18 10:18 AM, Arnaldo Carvalho de Melo wrote: > > Just out of curiosity, is there any plan to have this as a clang option? > I think > clang ... -mllvm -mattr=dwarfris > should work. [root@jouet bpf]# cat ~/.perfconfig [llvm] dump-obj = true clang-opt = -g -mllvm -mattr=dwarfris [root@jouet bpf]# trace -e openat,hello.c touch /tmp/kafai clang (LLVM option parsing): Unknown command line argument '-mattr=dwarfris'. Try: 'clang (LLVM option parsing) -help' clang (LLVM option parsing): Did you mean '-mxgot=dwarfris'? ERROR: unable to compile hello.c Hint: Check error message shown above. Hint: You can also pre-compile it into .o using: clang -target bpf -O2 -c hello.c with proper -I and -D options. event syntax error: 'hello.c' \___ Failed to load hello.c from source: Error when compiling BPF scriptlet (add -v to see detail) [root@jouet bpf]# [root@jouet bpf]# trace -e openat,hello.c touch /tmp/kafai |& grep clang clang (LLVM option parsing): Unknown command line argument '-mattr=dwarfris'. Try: 'clang (LLVM option parsing) -help' clang (LLVM option parsing): Did you mean '-mxgot=dwarfris'? clang -target bpf -O2 -c hello.c [root@jouet bpf]# trace -v -e openat,hello.c touch /tmp/kafai |& grep clang set env: CLANG_EXEC=/usr/local/bin/clang llvm compiling command : /usr/local/bin/clang -D__KERNEL__ -D__NR_CPUS__=4 -DLINUX_VERSION_CODE=0x41100 -g -mllvm -mattr=dwarfris -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/7/include -I/home/acme/git/linux/arch/x86/include -I./arch/x86/include/generated -I/home/acme/git/linux/include -I./include -I/home/acme/git/linux/arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I/home/acme/git/linux/include/uapi -I./include/generated/uapi -include /home/acme/git/linux/include/linux/kconfig.h -I/home/acme/lib/include/perf/bpf -Wno-unused-value -Wno-pointer-sign -working-directory /lib/modules/4.17.0-rc5/build -c /home/acme/bpf/hello.c -target bpf -O2 -o - clang (LLVM option parsing): Unknown command line argument '-mattr=dwarfris'. Try: 'clang (LLVM option parsing) -help' clang (LLVM option parsing): Did you mean '-mxgot=dwarfris'? clang -target bpf -O2 -c hello.c [root@jouet bpf]# The message "(LLVM option parsing)" implies what you suggest, but didn't worked :-\ -mllvm Additional arguments to forward to LLVM's option processing Almost there tho :-\ - Arnaldo