Skip to content

Conversation

tk154
Copy link
Contributor

@tk154 tk154 commented Oct 29, 2024

In the musl libc environment, <sys/sysinfo.h> also defines the sysinfo struct, causing a redefinition conflict:

toolchain-x86_64_gcc-14.2.0_musl/include/linux/kernel.h:5,
                 from ../../headers/linux/hashtable.h:15,
                 from xdp_sample.c:33:
toolchain-x86_64_gcc-14.2.0_musl/include/linux/sysinfo.h:8:8: error: redefinition of 'struct sysinfo'
    8 | struct sysinfo {
      |        ^~~~~~~
In file included from xdp_sample.c:24:
toolchain-x86_64_gcc-14.2.0_musl/include/sys/sysinfo.h:10:8: note: originally defined here
   10 | struct sysinfo {
      |        ^~~~~~~

This commit removes the <sys/sysinfo.h> include.
It seems that none of its symbols are used in the xdp_sample code anyway.

In the musl libc environment, `<sys/sysinfo.h>` also defines
the `sysinfo` struct, causing a redefinition conflict:

toolchain-x86_64_gcc-14.2.0_musl/include/linux/kernel.h:5,
                 from ../../headers/linux/hashtable.h:15,
                 from xdp_sample.c:33:
toolchain-x86_64_gcc-14.2.0_musl/include/linux/sysinfo.h:8:8: error: redefinition of 'struct sysinfo'
    8 | struct sysinfo {
      |        ^~~~~~~
In file included from xdp_sample.c:24:
toolchain-x86_64_gcc-14.2.0_musl/include/sys/sysinfo.h:10:8: note: originally defined here
   10 | struct sysinfo {
      |        ^~~~~~~

This commit removes the `<sys/sysinfo.h>` include. It seems that
none of its symbols are used in the xdp_sample code anyway.

Signed-off-by: Til Kaiser <[email protected]>
Copy link
Member

@tohojo tohojo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@tohojo tohojo merged commit 164c143 into xdp-project:master Oct 29, 2024
25 of 29 checks passed
@tk154 tk154 deleted the musl branch October 29, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants