Bug#1145004: Mixed native platform and eBPF compile

Michael Biebl <[email protected]>
Newsgroups gmane.linux.debian.devel.gcc
Message-ID <82ab302f-f1e1-4fd5-b4b3-ea2386044359__31190.5888769374$1787413412$gmane$org@debian.org>
Am 22.08.26 um 15:40 schrieb Michael Biebl:
> [I'm not subscribed, so please CC me on replies]
> 
> Hi Daniel
> 
> On Fri, 21 Aug 2026 22:02:05 +0200 Daniel Lange <[email protected]> wrote:
>> Hi Michael,
>>
>> the issue here is that the BPF compiler is made to consume the target 
>> architecture's glibc userspace headers as if it were compiling normal 
>> target userspace code.
>>
>> bpf-gcc is compiling for the BPF target, while the build explicitly adds:
>>
>> /usr/include/powerpc64-linux-gnu
>> /usr/include/sparc64-linux-gnu
>> /usr/include/x86_64-linux-gnux32
>>
>> Those headers eventually pull in gnu/stubs.h, whose ABI selection 
>> expects multilib glibc headers that aren't installed in the build 
>> environment.
>>
>> And should not be. Still you could provide them :).
>>
>> 1) I.e., you can add the (useless) target arch headers and make it 
>> compile:
>>
>> Build-depend on g++-multilib
> 
> The question then is: why is this only necessary on those architectures?

I tried that on a porterbox (perotto).
It did not help. The build failure is the same.

$ apt-cache policy g++-multilib
g++-multilib:
   Installed: 4:16.1.0-3
   Candidate: 4:16.1.0-3
   Version table:
  *** 4:16.1.0-3 500
         500 http://deb.debian.org/debian-ports sid/main ppc64 Packages
         100 /var/lib/dpkg/status


$ ninja
[1/58] Generating src/core/bpf/clat.bpf.unstripped.o with a custom command
FAILED: [code=1] src/core/bpf/clat.bpf.unstripped.o
/usr/bin/bpf-gcc -std=gnu17 -Wunused -Wimplicit-fallthrough 
-fno-stack-protector -fno-ssa-phiopt -O2 -mcpu=v3 -mco-re -gbtf -c 
-D__powerpc64__ -D__TARGET_ARCH_powerpc -D_CALL_ELF=2 -mbig-endian -I. 
-isystem /usr/include/powerpc64-linux-gnu -idirafter /usr/include 
../src/core/bpf/clat.bpf.c -o src/core/bpf/clat.bpf.unstripped.o
In file included from /usr/include/features.h:563,
                  from /usr/include/powerpc64-linux-gnu/sys/socket.h:22,
                  from /usr/include/linux/if.h:28,
                  from /usr/include/linux/icmp.h:23,
                  from ../src/core/bpf/clat.bpf.c:16:
/usr/include/powerpc64-linux-gnu/gnu/stubs.h:14:11: fatal error: 
gnu/stubs-64-v2.h: No such file or directory
    14 | # include <gnu/stubs-64-v2.h>
       |           ^~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEECbOsLssWnJBDRcxUauHfDWCPItwFAmqJwxYFAwAAAAAACgkQauHfDWCPItyf
jw//QFpMLOqajihdTw4EGOxo/wL46ZSYKutVsADacsliudZa0JqaBGJbemaJC7Nu1oE1ts/oygPa
MyTgfO6WeemtXeAJBpRG4JaqJg1pf6X8crGYMRlKSZWkL/IgBWKyVaO7paQwpJSom6KrtR+XX//B
eTOSTIHy76ZBqwt2vY8x+pVzWVaIfzBHhE86J403ZbJjZYuJAoHkeUU8yzX0AM4ttjK0KAHSX6uJ
46R+qRc+3SBN2l1OFg8eud8pniAmKvQgmvfz2ES2ABDsYpQ5A06SiOG1P5bN5IqLbN3EtRx0yxAn
DILuZFc+E0hlEguEm4p3J6PVDmxwTvbB0mv50quI3wNMRX2hMnb0ZZ6F0z9c1HKl9/EC2/WOE+Dx
mRpkDTaTShDSxmy6GIZ3hsWED5irqO1QOGThY2UlTnapYCPxqFgkSdLD0MC/zufcfGCnZOrS1Lzf
uuLmZnPnSIFyKp+ObY/F520vk2ysEN4F7xQ7hqpyi2gwEYujg0iEBGGdmTbXn4nYbTEVmjpLKk2G
nkraJvpBNjT2rvNtTm9iN9hhnvx9YqDBme/eI71u7RAvi4k1wkHE+Qg3zLAcaAUV0box5c4JlHxR
01fdh+WP6JpV5qIexperlisrClncstrvqIp7Nsi3daMpBCBBVyH3NezoLdjGDQGmujZF72d4mAbN
hUQ=
=99Bm
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.