[Linux-ia64] Problem to build Kernel 2.4.0 with gcc version "2.96-ia64-000717" + snap "001117"

From: Faccini, Bruno <bruno.faccini_at_intel.com>
Date: 2001-01-12 10:45:47
When trying to build Kernel 2.4.0 (from
"http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.0.tar.gz" +
diff.gz" downloads) with gcc version "2.96-ia64-000717" + snap "001117" we
experienced compilation errors with the specific
"net/ipv4/netfilter/ip_tables.c" source file.
After some investigations, it appeared to be due to a problem/regression
with version "2.96-ia64-000717" (+ snap "001117" applied, the gcc pkg
shipped as part of RedHat64 "December-2000" Beta release) to deal with the
following macro in "include/linux/netfilter_ipv4/ip_tables.h" header : 
#define IPT_MATCH_ITERATE(e, fn, args...)	\
({						\
	unsigned int __i;			\
	int __ret = 0;				\
	struct ipt_entry_match *__m;		\
	for (__i = sizeof(struct ipt_entry);	\
	     __i < (e)->target_offset;		\
	     __i += __m->u.match_size) {	\
		__m = (void *)(e) + __i;	\
		__ret = fn(__m , ## args);	\
		if (__ret != 0)			\
			break;			\
	}					\
	__ret;					\
where "## args" substitution was wrongly done (the first argument in the
"...[,...]" list was garbled depending on its first character, "*" or "&"
are missing if specified and if none the full argument/variable name is
fully missing !!, leading to the compiler error because of 2x"," in a row ).
The simplest way to bypass this was to generate a pre-processed only C
source file, to manually edit+fix the problems/missing characters/names and
to use it as the original source file.
This points to some regression between latest gcc versions vs Linux Kernel
source files content and the syntax used (there was a lot of warnings about
"depracated" use of "##" constructs during the Kernel build but the only
error found) and may be highlights the need of a "generic" gcc ship+use for
Kernel builds ...

 <<Bruno Faccini (E-mail).vcf>> 

Received on Thu Jan 11 15:52:00 2001

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:01 EST