$ echo "#include <linux/ethtool.h>" > test.c $ gcc -c test.c In file included from test.c:1: /usr/include/linux/ethtool.h:330: error: syntax error before "u32" /usr/include/linux/ethtool.h:343: error: syntax error before "u32" /usr/include/linux/ethtool.h:345: error: syntax error before "u32" /usr/include/linux/ethtool.h:347: error: syntax error before "u32" /usr/include/linux/ethtool.h:349: error: syntax error before "u32" /usr/include/linux/ethtool.h:353: error: syntax error before "u32" I've rsync-ed and re-emerged sys-kernel/linux-headers-2.6.11-r5 today. Replacing the broken u32 to __u32 seems to fix these issues. I'm running ~x86.
maybe: sed 's/\(__\)\?\([us]\(8\|16\|32\|64\)\)/__\2/g' would fix the problem?
Created attachment 86205 [details, diff] kernel-2.eclass.patch diff -ud orig/linux/ethtool.h linux/ethtool.h --- orig/linux/ethtool.h 2006-05-05 17:04:26.000000000 +0200 +++ linux/ethtool.h 2006-05-05 17:31:20.000000000 +0200 @@ -42,7 +42,7 @@ /* For PCI devices, use pci_name(pci_dev). */ char reserved1[32]; char reserved2[16]; - __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ + __u32 n_stats; /* number of __u64's from ETHTOOL_GSTATS */ __u32 testinfo_len; __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ @@ -248,7 +248,7 @@ /* for dumping NIC-specific statistics */ struct ethtool_stats { __u32 cmd; /* ETHTOOL_GSTATS */ - __u32 n_stats; /* number of u64's being returned */ + __u32 n_stats; /* number of __u64's being returned */ __u64 data[0]; }; @@ -327,7 +327,7 @@ void (*get_wol)(struct net_device *, struct ethtool_wolinfo *); int (*set_wol)(struct net_device *, struct ethtool_wolinfo *); __u32 (*get_msglevel)(struct net_device *); - void (*set_msglevel)(struct net_device *, u32); + void (*set_msglevel)(struct net_device *, __u32); int (*nway_reset)(struct net_device *); __u32 (*get_link)(struct net_device *); int (*get_eeprom_len)(struct net_device *); @@ -340,17 +340,17 @@ void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*); int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*); __u32 (*get_rx_csum)(struct net_device *); - int (*set_rx_csum)(struct net_device *, u32); + int (*set_rx_csum)(struct net_device *, __u32); __u32 (*get_tx_csum)(struct net_device *); - int (*set_tx_csum)(struct net_device *, u32); + int (*set_tx_csum)(struct net_device *, __u32); __u32 (*get_sg)(struct net_device *); - int (*set_sg)(struct net_device *, u32); + int (*set_sg)(struct net_device *, __u32); __u32 (*get_tso)(struct net_device *); - int (*set_tso)(struct net_device *, u32); + int (*set_tso)(struct net_device *, __u32); int (*self_test_count)(struct net_device *); void (*self_test)(struct net_device *, struct ethtool_test *, __u64 *); void (*get_strings)(struct net_device *, __u32 stringset, __u8 *); - int (*phys_id)(struct net_device *, u32); + int (*phys_id)(struct net_device *, __u32); int (*get_stats_count)(struct net_device *); void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, __u64 *); int (*begin)(struct net_device *);
Created attachment 86243 [details, diff] kernel-2.eclass.patch symbols like __fs16 are safe now. Please note sys-kernel/linux-headers-2.6.16 needs to be instructed to ignore asm/types.h.
's:\<\([us]\(8\|16\|32\|64\)\)\>:__\1:g' ^^ Want to just try that instead? I'm not sure where the fsXX types are used (and if types.h defines those I doubt they'd conflict in userspace anyway).
word match, smart! ethtool.h seems to be fixed correctly. you are right about asm/types.h which doesn't break userspace but the kernel-2.eclass seems to run 'make oldconfig' which defines __KERNEL__. There are more headers broken, I'm also having the same problems with mii.h and ext3_fs.h. fsXX isn't a problem with your regexp either, you can find them by using: egrep '[A-Za-z0-9][us](8|16|32|64)' /usr/include/linux -r
(In reply to comment #5) > There are more headers broken, I'm also having the same problems with mii.h and > ext3_fs.h. Hmm, did you rerun the updated sed on those headers as well? If they still break post compiler errors please.
I'm commenting about linux-headers-2.6.11-r5 which seems to patch jiffies.h and ethtool.h, could you please add mii.h and ext3_fs.h to this list?
Now fixed in CVS; sorry about the delay! Thanks...