Bug 80095

Summary: Cannot build with kernel headers <= 3.13
Product: systemd Reporter: Jean-André Santoni <jean.andre.santoni>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Add IFLA_VTI defines to missing.h

Description Jean-André Santoni 2014-06-16 13:30:03 UTC
I'm trying to build using 3.4 kernel headers, and get these errors:

/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:51:10: error: 'IFLA_MACVLAN_FLAGS' undeclared here (not in a funct[221/1905]
         [IFLA_MACVLAN_FLAGS] = { .type = NLA_U16 },
          ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:51:9: error: array index in initializer not of integer type
         [IFLA_MACVLAN_FLAGS] = { .type = NLA_U16 },
         ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:51:9: error: (near initialization for 'rtnl_link_info_data_macvlan_types')
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:51:9: warning: excess elements in array initializer
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:51:9: warning: (near initialization for 'rtnl_link_info_data_macvlan_types')
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:54:54: error: 'IFLA_BRIDGE_MAX' undeclared here (not in a function)
 static const NLType rtnl_link_info_data_bridge_types[IFLA_BRIDGE_MAX + 1] = {
                                                      ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:55:10: error: 'IFLA_BRIDGE_FLAGS' undeclared here (not in a function)
         [IFLA_BRIDGE_FLAGS]     = { .type = NLA_U16 },
          ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:55:9: error: array index in initializer not of integer type
         [IFLA_BRIDGE_FLAGS]     = { .type = NLA_U16 },
         ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:55:9: error: (near initialization for 'rtnl_link_info_data_bridge_types')
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:55:9: error: field name not in record or union initializer
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:55:9: error: (near initialization for 'rtnl_link_info_data_bridge_types')
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:56:10: error: 'IFLA_BRIDGE_MODE' undeclared here (not in a function)
         [IFLA_BRIDGE_MODE]      = { .type = NLA_U16 },
          ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:56:9: error: array index in initializer not of integer type
         [IFLA_BRIDGE_MODE]      = { .type = NLA_U16 },
         ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:56:9: error: (near initialization for 'rtnl_link_info_data_bridge_types')
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:56:9: error: field name not in record or union initializer
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:56:9: error: (near initialization for 'rtnl_link_info_data_bridge_types')
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:70:10: error: 'IFLA_VLAN_PROTOCOL' undeclared here (not in a function)
         [IFLA_VLAN_PROTOCOL]    = { .type = NLA_U16 },
          ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:70:9: error: array index in initializer not of integer type
         [IFLA_VLAN_PROTOCOL]    = { .type = NLA_U16 },
         ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:70:9: error: (near initialization for 'rtnl_link_info_data_vlan_types')
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:105:53: error: 'IFLA_IPTUN_MAX' undeclared here (not in a function)
 static const NLType rtnl_link_info_data_iptun_types[IFLA_IPTUN_MAX + 1] = {
                                                     ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:106:10: error: 'IFLA_IPTUN_LINK' undeclared here (not in a function)
         [IFLA_IPTUN_LINK]                = { .type = NLA_U32 },
          ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:106:9: error: array index in initializer not of integer type
         [IFLA_IPTUN_LINK]                = { .type = NLA_U32 },
         ^
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:106:9: error: (near initialization for 'rtnl_link_info_data_iptun_types')
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:106:9: error: field name not in record or union initializer
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:106:9: error: (near initialization for 'rtnl_link_info_data_iptun_types')
/home/kivutar/Lakka/build.Lakka-Cubieboard2.arm-devel/systemd-214/src/libsystemd/sd-rtnl/rtnl-types.c:107:10: error: 'IFLA_IPTUN_LOCAL' undeclared here (not in a function)
         [IFLA_IPTUN_LOCAL]               = { .type = NLA_IN_ADDR },
Comment 1 Zbigniew Jedrzejewski-Szmek 2014-06-21 02:08:08 UTC
Should be fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=81577dc. I tested with kernel-headers-3.6.10-4.fc18.x86_64 because that was the oldest I could find...
Comment 2 Jean-André Santoni 2014-07-16 19:51:57 UTC
Sorry, looks like this bug is not fixed by http://cgit.freedesktop.org/systemd/systemd/commit/?id=81577dc

I gave another try with systemd-215 that seams to include this patch, and I get the same error log when building with a 3.4 kernel.

IFLA_MACVLAN_FLAGS for example should be defined in missing.h, if I got it right, and it is not the case.

Is there a workaround? Can I build systemd without network support?
Comment 3 Zbigniew Jedrzejewski-Szmek 2014-07-16 20:49:20 UTC
I added IFLA_MACVLAN_FLAGS in http://cgit.freedesktop.org/systemd/systemd/commit/?id=75616a1332. This covers everything in the original bug report. I don't have such old systems to test, so if something more is needed, than please add the missing values using the same technique as commit 75616a1332.
Comment 4 Jean-André Santoni 2014-07-21 12:32:26 UTC
Created attachment 103189 [details] [review]
Add IFLA_VTI defines to missing.h

This allow to build with a 3.4 kernel
Comment 5 Jean-André Santoni 2014-07-21 12:34:37 UTC
Your patch works, but IFLA_VTI defines are needed too. I attached a patch finally allowing to build with 3.4. You may have to ifdef it maybe.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.