Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with linux 6.5 headers #492

Open
chvp opened this issue Sep 30, 2023 · 4 comments
Open

Build fails with linux 6.5 headers #492

chvp opened this issue Sep 30, 2023 · 4 comments

Comments

@chvp
Copy link

chvp commented Sep 30, 2023

Since this commit, sockaddr_ll includes a flex array, leading to the following build errors:

In file included from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/posix_types.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/types.h:9,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/stat.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/bits/statx.h:31,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/sys/stat.h:465,
                 from /build/source/common.h:20,
                 from /build/source/log.h:5,
                 from /build/source/log.cpp:1:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct packet_info_t'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
In file included from /build/source/misc.h:13,
                 from /build/source/log.cpp:2:
/build/source/network.h:233:11: note: next member 'i32_t packet_info_t::data_len' declared here
  233 |     i32_t data_len;
      |           ^~~~~~~~
/build/source/network.h:204:8: note: in the definition of 'struct packet_info_t'
  204 | struct packet_info_t  // todo change this to union
      |        ^~~~~~~~~~~~~
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct raw_info_t'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
/build/source/network.h:233:11: note: next member 'i32_t packet_info_t::data_len' declared here
  233 |     i32_t data_len;
      |           ^~~~~~~~
/build/source/network.h:238:8: note: in the definition of 'struct raw_info_t'
  238 | struct raw_info_t {
      |        ^~~~~~~~~~
make[2]: *** [CMakeFiles/udp2raw.dir/build.make:76: CMakeFiles/udp2raw.dir/main.cpp.o] Error 1
make[2]: *** [CMakeFiles/udp2raw.dir/build.make:146: CMakeFiles/udp2raw.dir/log.cpp.o] Error 1
In file included from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/posix_types.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/types.h:9,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/stat.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/bits/statx.h:31,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/sys/stat.h:465,
                 from /build/source/common.h:20,
                 from /build/source/common.cpp:8:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct packet_info_t'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
In file included from /build/source/misc.h:13,
                 from /build/source/common.cpp:10:
/build/source/network.h:233:11: note: next member 'i32_t packet_info_t::data_len' declared here
  233 |     i32_t data_len;
      |           ^~~~~~~~
/build/source/network.h:204:8: note: in the definition of 'struct packet_info_t'
  204 | struct packet_info_t  // todo change this to union
      |        ^~~~~~~~~~~~~
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct raw_info_t'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
/build/source/network.h:233:11: note: next member 'i32_t packet_info_t::data_len' declared here
  233 |     i32_t data_len;
      |           ^~~~~~~~
/build/source/network.h:238:8: note: in the definition of 'struct raw_info_t'
  238 | struct raw_info_t {
      |        ^~~~~~~~~~
make[2]: *** [CMakeFiles/udp2raw.dir/build.make:174: CMakeFiles/udp2raw.dir/common.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/udp2raw.dir/all] Error 2
@wangyu-
Copy link
Owner

wangyu- commented Oct 7, 2023

I tried to make a fix in d1a9bcc

/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct raw_info_t'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);

since it's complaining not at the end, I moved it to the end.

Please check if the commit fix the issue (i don't have a linux 6.5 kernel machine to test yet)

@chvp
Copy link
Author

chvp commented Oct 7, 2023

Unfortunately that still fails. These are the errors:

In file included from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/posix_types.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/types.h:9,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/stat.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/bits/statx.h:31,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/sys/stat.h:465,
                 from /build/source/common.h:20,
                 from /build/source/network.cpp:7:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct raw_info_'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
In file included from /build/source/network.cpp:8:
/build/source/network.h:240:19: note: next member 'packet_info_t raw_info_t::recv_info' declared here
  240 |     packet_info_t recv_info;
      |                   ^~~~~~~~~
/build/source/network.h:238:8: note: in the definition of 'struct raw_info_t'
  238 | struct raw_info_t {
      |        ^~~~~~~~~~
In file included from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/posix_types.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/types.h:9,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/stat.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/bits/statx.h:31,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/sys/stat.h:465,
                 from /build/source/common.h:20,
                 from /build/source/log.h:5,
                 from /build/source/log.cpp:1:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct raw_info_'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
In file included from /build/source/misc.h:13,
                 from /build/source/log.cpp:2:
/build/source/network.h:240:19: note: next member 'packet_info_t raw_info_t::recv_info' declared here
  240 |     packet_info_t recv_info;
      |                   ^~~~~~~~~
/build/source/network.h:238:8: note: in the definition of 'struct raw_info_t'
  238 | struct raw_info_t {
      |        ^~~~~~~~~~
In file included from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/posix_types.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/types.h:9,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/stat.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/bits/statx.h:31,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/sys/stat.h:465,
                 from /build/source/common.h:20,
                 from /build/source/main.cpp:1:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct raw_info_'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
In file included from /build/source/main.cpp:2:
/build/source/network.h:240:19: note: next member 'packet_info_t raw_info_t::recv_info' declared here
  240 |     packet_info_t recv_info;
      |                   ^~~~~~~~~
/build/source/network.h:238:8: note: in the definition of 'struct raw_info_t'
  238 | struct raw_info_t {
      |        ^~~~~~~~~~
make[2]: *** [CMakeFiles/udp2raw.dir/build.make:146: CMakeFiles/udp2raw.dir/log.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct conn_info_t'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
/build/source/network.h:240:19: note: next member 'packet_info_t raw_info_t::recv_info' declared here
  240 |     packet_info_t recv_info;
      |                   ^~~~~~~~~
In file included from /build/source/main.cpp:3:
/build/source/connection.h:218:8: note: in the definition of 'struct conn_info_t'
  218 | struct conn_info_t  // stores info for a raw connection.for client ,there is only one connection,for server there can be thousand of connection since server can
      |        ^~~~~~~~~~~
In file included from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/posix_types.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/types.h:9,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/stat.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/bits/statx.h:31,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/sys/stat.h:465,
                 from /build/source/common.h:20,
                 from /build/source/common.cpp:8:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct raw_info_'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
In file included from /build/source/misc.h:13,
                 from /build/source/common.cpp:10:
/build/source/network.h:240:19: note: next member 'packet_info_t raw_info_t::recv_info' declared here
  240 |     packet_info_t recv_info;
      |                   ^~~~~~~~~
/build/source/network.h:238:8: note: in the definition of 'struct raw_info_t'
  238 | struct raw_info_t {
      |        ^~~~~~~~~~
make[2]: *** [CMakeFiles/udp2raw.dir/build.make:76: CMakeFiles/udp2raw.dir/main.cpp.o] Error 1
make[2]: *** [CMakeFiles/udp2raw.dir/build.make:160: CMakeFiles/udp2raw.dir/network.cpp.o] Error 1
make[2]: *** [CMakeFiles/udp2raw.dir/build.make:174: CMakeFiles/udp2raw.dir/common.cpp.o] Error 1
In file included from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/posix_types.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/types.h:9,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/stat.h:5,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/bits/statx.h:31,
                 from /nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/sys/stat.h:465,
                 from /build/source/common.h:20,
                 from /build/source/connection.h:14,
                 from /build/source/connection.cpp:8:
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct raw_info_'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
In file included from /build/source/connection.h:16:
/build/source/network.h:240:19: note: next member 'packet_info_t raw_info_t::recv_info' declared here
  240 |     packet_info_t recv_info;
      |                   ^~~~~~~~~
/build/source/network.h:238:8: note: in the definition of 'struct raw_info_t'
  238 | struct raw_info_t {
      |        ^~~~~~~~~~
/nix/store/y8wfrgk7br5rfz4221lfb9v8w3n0cnyd-glibc-2.37-8-dev/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::<unnamed union>::<unnamed struct>::sll_addr_flex' not at end of 'struct conn_info_t'
   24 |                 __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
      |                 ^~~~~~~~~~~~~~~~~~~~
/build/source/network.h:240:19: note: next member 'packet_info_t raw_info_t::recv_info' declared here
  240 |     packet_info_t recv_info;
      |                   ^~~~~~~~~
/build/source/connection.h:218:8: note: in the definition of 'struct conn_info_t'
  218 | struct conn_info_t  // stores info for a raw connection.for client ,there is only one connection,for server there can be thousand of connection since server can
      |        ^~~~~~~~~~~
make[2]: *** [CMakeFiles/udp2raw.dir/build.make:188: CMakeFiles/udp2raw.dir/connection.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/udp2raw.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

@Wyk72
Copy link

Wyk72 commented May 2, 2024

Same problem here:

/usr/include/linux/if_packet.h:24:17: error: flexible array member 'sockaddr_ll::::::sll_addr_flex' not at end of 'struct raw_info_t'
24 | __DECLARE_FLEX_ARRAY(unsigned char, sll_addr_flex);
| ^~~~~~~~~~~~~~~~~~~~

Alpine Linux Kernel 6.6

@wangyu-
Copy link
Owner

wangyu- commented May 2, 2024

sorry I was a bit busy.

let me try to fix in this month.

it should be a simple fix, but I don't have the environment at hand.

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

No branches or pull requests

3 participants