Description of problem: When compiling trinity in latest rhel9, there's conflicts between netinet headers and linux-headers, which should be resolved, otherwise some use may be affected Version-Release number of selected component (if applicable): glibc-headers-2.33-13.el9.x86_64 rpm -qf /usr/include/linux/libc-compat.h kernel-headers-5.13.0-0.rc3.25.el9.x86_64 How reproducible: always Steps to Reproduce: 1. git clone https://github.com/kernelslacker/trinity.git 2. ./configure 3. make -j $(nproc) Actual results: conflicts showed, and compile broken: CC net/proto-irda.o In file included from include/net.h:5, from net/proto-ip-raw.c:2: /usr/include/netinet/in.h:31:8: error: redefinition of ‘struct in_addr’ 31 | struct in_addr | ^~~~~~~ In file included from /usr/include/linux/icmp.h:23, from net/proto-ip-raw.c:1: /usr/include/linux/in.h:89:8: note: originally defined here 89 | struct in_addr { | ^~~~~~~ In file included from /usr/include/netinet/in.h:37, from include/net.h:5, from net/proto-ip-raw.c:2: /usr/include/bits/in.h:150:8: error: redefinition of ‘struct ip_mreqn’ 150 | struct ip_mreqn | ^~~~~~~~ In file included from /usr/include/linux/icmp.h:23, from net/proto-ip-raw.c:1: /usr/include/linux/in.h:178:8: note: originally defined here 178 | struct ip_mreqn { | ^~~~~~~~ In file included from /usr/include/netinet/in.h:37, from include/net.h:5, from net/proto-ip-raw.c:2: /usr/include/bits/in.h:158:8: error: redefinition of ‘struct in_pktinfo’ 158 | struct in_pktinfo Expected results: UAPI Additional info: From /usr/include/linux/libc-compat.h : * * This fixes the situation where the linux headers are included *after* the * libc headers. To fix the problem with the inclusion in the other order the * userspace libc headers must be fixed like this: * * * For all definitions that conflict with kernel definitions wrap those * defines in the following: * #if !__UAPI_DEF_FOO * ... * #endif * * This prevents the redefinition of a construct already defined by the kernel.
Reported upstream: https://lore.kernel.org/netdev/87im2wup0m.fsf@oldenburg.str.redhat.com/
Upstream UAPI patch submission: https://lore.kernel.org/netdev/20210603212211.335237-1-andreas.a.roeseler@gmail.com/
I see the kernel patch made it into the tree? commit e32ea44c7ae476f4c90e35ab0a29dc8ff082bc11 Author: Andreas Roeseler <andreas.a.roeseler> Date: Thu Jun 3 16:22:11 2021 -0500 icmp: fix lib conflict with trinity Including <linux/in.h> and <netinet/in.h> in the dependencies breaks compilation of trinity due to multiple definitions. <linux/in.h> is only used in <linux/icmp.h> to provide the definition of the struct in_addr, but this can be substituted out by using the datatype __be32. Signed-off-by: Andreas Roeseler <andreas.a.roeseler> Signed-off-by: David S. Miller <davem> Chunyu Hu, may we close this bug? Thanks.
(In reply to Florian Weimer from comment #5) > I see the kernel patch made it into the tree? > > commit e32ea44c7ae476f4c90e35ab0a29dc8ff082bc11 > Author: Andreas Roeseler <andreas.a.roeseler> > Date: Thu Jun 3 16:22:11 2021 -0500 > > icmp: fix lib conflict with trinity > > Including <linux/in.h> and <netinet/in.h> in the dependencies breaks > compilation of trinity due to multiple definitions. <linux/in.h> is only > used in <linux/icmp.h> to provide the definition of the struct in_addr, > but this can be substituted out by using the datatype __be32. > > Signed-off-by: Andreas Roeseler <andreas.a.roeseler> > Signed-off-by: David S. Miller <davem> > > Chunyu Hu, may we close this bug? Thanks. Thanks for info. Close this.