Skip to contentSkip to conversation

Problem to build Kernel 2.4.0 with gcc version "2.96-ia64-000717"

Linux-ia64 Faccini, Bruno 2 participants 2 messages Jan 11, 2001 – Jan 12, 2001

lore
Share & tools
lore
#0 lore raw

When trying to build Kernel 2.4.0 (from "http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.0.tar.gz" + "http://www.kernel.org/pub/linux/kernel/ports/ia64//linux-2.4.0-ia64-010109. 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.

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

#1 lore raw

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

Quoted 2 lines

experienced compilation errors with the specific
"net/ipv4/netfilter/ip_tables.c" source file.

See the file ftp.cygnus.com:pub/ia64-linux/snap-001117/WORKAROUND.cpp.kernel, available since Nov 17.

The gcc c preprocessor was rewritten 3 or 4 times this year, and this particular bug was fixed in the last rewrite which was sometime in late October I think. However, since there is no guarantee that the final rewrite is perfect, so it is safer to work around the problem for now.

Quoted 5 lines

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 ...

As part of the many rewrites, the C preprocessor now has better compliance to ISO C, and some GNU extensions have been deprecated. However, you shouldn't pay too much attention to the warnings you get from this July FSF snapshot, because this cpp behaviour changed several times after that. Better to try the current FSF gcc sources and worry about those warnings. I'd suspect other people have already done this.

Your comment about a "generic" gcc for kernel builds makes no sense. This is the gcc to use for kernel builds. There is no other IA-64 gcc that is usable.

Jim