llvm: Remove BPF from targets

To use clang with BPF for v4l-utils, libbpf must be installed but it's
not a BLFS package.  And I doubt if any BLFS user really uses an IR
remote control on the BLFS system.  So let's not make all BLFS users
build something useless.

Note that if both clang and libbpf both exist, v4l-utils will attempt to
use "clang -target bpf" anyway even if -Dbpf=disabled is explicitly
specified (we've got enough surprise from v4l-utils building system
these days!!), so add a note to v4l-utils for people installing non-BLFS
libbpf.
This commit is contained in:
Xi Ruoyao 2023-12-03 13:56:37 +08:00
parent 528007cf64
commit c39ddc6c3d
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3
2 changed files with 28 additions and 15 deletions

View File

@ -310,18 +310,18 @@ sed '/^set(LLVM_COMMON_CMAKE_UTILS/d' \
<screen><userinput>mkdir -v build &amp;&amp;
cd build &amp;&amp;
CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU;BPF" \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DCLANG_DEFAULT_PIE_ON_LINUX=ON \
-Wno-dev -G Ninja .. &amp;&amp;
CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DCLANG_DEFAULT_PIE_ON_LINUX=ON \
-Wno-dev -G Ninja .. &amp;&amp;
ninja</userinput></screen>
<para>
@ -465,10 +465,10 @@ rmdir -v --ignore-fail-on-non-empty /usr/share/doc/LLVM</userinput></screen>
</para>
<para>
<parameter>-DLLVM_TARGETS_TO_BUILD="host;AMDGPU;BPF"</parameter>: This
<parameter>-DLLVM_TARGETS_TO_BUILD="host;AMDGPU"</parameter>: This
switch enables building for the same target as the host, and also for
the r600 AMD GPU used by the Mesa r600 and radeonsi drivers. The BPF
target is required to build <xref linkend="v4l-utils"/>. The Default is
the r600 AMD GPU used by the Mesa r600 and radeonsi drivers.
The default is
all of the targets. You can use a semicolon separated list. Valid targets
are: host, X86, Sparc, PowerPC, ARM, AArch64, Mips, Hexagon, Xcore,
M68K, MSP430, NVPTX, SystemZ, AMDGPU, BPF, CppBackend, or all.

View File

@ -101,6 +101,19 @@
<sect2 role="installation">
<title>Installation of v4l-utils</title>
<note>
<para>
If you've installed both LLVM and libbpf (not in BLFS), either
enable the BPF target (via
<option>-DLLVM_TARGETS_TO_BUILD=</option>) building LLVM, or disable
the infrared remote control decoders based on BPF:
</para>
<!-- not "nodump" because it's harmless for BLFS anyway -->
<screen><userinput>sed '/^ir_bpf_enabled/s/=.*/= false/' \
-i utils/keytable/meson.build</userinput></screen>
</note>
<para>
Install <application>v4l-utils</application> by running
the following commands: