diff mbox series

[bpf] samples/bpf: Update README.rst for manually compiling LLVM and clang

Message ID 1610959982-6420-1-git-send-email-yangtiezhu@loongson.cn (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series [bpf] samples/bpf: Update README.rst for manually compiling LLVM and clang | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 13 of 13 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Tiezhu Yang Jan. 18, 2021, 8:53 a.m. UTC
In the current samples/bpf/README.rst, the url of llvm and clang git
may be out of date, they are unable to access:

$ git clone http://llvm.org/git/llvm.git
Cloning into 'llvm'...
fatal: unable to access 'http://llvm.org/git/llvm.git/': Maximum (20) redirects followed
$ git clone --depth 1 http://llvm.org/git/clang.git
Cloning into 'clang'...
fatal: unable to access 'http://llvm.org/git/clang.git/': Maximum (20) redirects followed

The Clang Getting Started page [1] might have more accurate information,
I verified the procedure and it is proved to be feasible, so we should
update it to reflect the reality.

[1] https://clang.llvm.org/get_started.html

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 samples/bpf/README.rst | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Yonghong Song Jan. 18, 2021, 6:01 p.m. UTC | #1
On 1/18/21 12:53 AM, Tiezhu Yang wrote:
> In the current samples/bpf/README.rst, the url of llvm and clang git
> may be out of date, they are unable to access:
> 
> $ git clone http://llvm.org/git/llvm.git
> Cloning into 'llvm'...
> fatal: unable to access 'http://llvm.org/git/llvm.git/ ': Maximum (20) redirects followed
> $ git clone --depth 1 http://llvm.org/git/clang.git
> Cloning into 'clang'...
> fatal: unable to access 'http://llvm.org/git/clang.git/ ': Maximum (20) redirects followed
> 
> The Clang Getting Started page [1] might have more accurate information,
> I verified the procedure and it is proved to be feasible, so we should
> update it to reflect the reality.
> 
> [1] https://clang.llvm.org/get_started.html
> 
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>   samples/bpf/README.rst | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/samples/bpf/README.rst b/samples/bpf/README.rst
> index dd34b2d..f606c08 100644
> --- a/samples/bpf/README.rst
> +++ b/samples/bpf/README.rst
> @@ -65,11 +65,9 @@ To generate a smaller llc binary one can use::
>   Quick sniplet for manually compiling LLVM and clang
>   (build dependencies are cmake and gcc-c++)::
>   
> - $ git clone http://llvm.org/git/llvm.git
> - $ cd llvm/tools
> - $ git clone --depth 1 http://llvm.org/git/clang.git
> - $ cd ..; mkdir build; cd build
> - $ cmake .. -DLLVM_TARGETS_TO_BUILD="BPF;X86"
> + $ git clone https://github.com/llvm/llvm-project.git
> + $ cd llvm-project; mkdir build; cd build
> + $ cmake -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD="BPF;X86" -G "Unix Makefiles" ../llvm
>    $ make -j $(getconf _NPROCESSORS_ONLN)

Thanks for the patch. Indeed llvm.org/git/llvm has been deprecated. We 
have recommended to use llvm-project at 
kernel/Documentation/bpf/bpf_devel_QA.rst.
 
https://github.com/torvalds/linux/blob/master/Documentation/bpf/bpf_devel_QA.rst#q-got-it-so-how-do-i-build-llvm-manually-anyway

Could you use the same scripts in the above link here?
There are different ways to build llvm/clang, I just want to be
consistent between bpf_devel_QA.rst and there.

I am also thinking whether we should just provide a link here to
bpf_devel_QA.rst. Looking at samples/bpf/README.rst, it all contains
direct commands for people to build/test, so copy-pasting the llvm
build scripts here should be fine.

>   
>   It is also possible to point make to the newly compiled 'llc' or
>
diff mbox series

Patch

diff --git a/samples/bpf/README.rst b/samples/bpf/README.rst
index dd34b2d..f606c08 100644
--- a/samples/bpf/README.rst
+++ b/samples/bpf/README.rst
@@ -65,11 +65,9 @@  To generate a smaller llc binary one can use::
 Quick sniplet for manually compiling LLVM and clang
 (build dependencies are cmake and gcc-c++)::
 
- $ git clone http://llvm.org/git/llvm.git
- $ cd llvm/tools
- $ git clone --depth 1 http://llvm.org/git/clang.git
- $ cd ..; mkdir build; cd build
- $ cmake .. -DLLVM_TARGETS_TO_BUILD="BPF;X86"
+ $ git clone https://github.com/llvm/llvm-project.git
+ $ cd llvm-project; mkdir build; cd build
+ $ cmake -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD="BPF;X86" -G "Unix Makefiles" ../llvm
  $ make -j $(getconf _NPROCESSORS_ONLN)
 
 It is also possible to point make to the newly compiled 'llc' or