Red Hat Bugzilla – Bug 143509
can't build rpm using rpmbuild -bb --target i386
Last modified: 2007-11-30 17:07:05 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Description of problem:
The kernel rpm couldn't build properly by rpmbuild
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run rpmbuild -bb --target i386 kernel-2.4.spec
Actual Results: wvlan_cs.c:1087:44: missing terminating " character
wvlan_cs.c: In function `wvlan_hw_config':
wvlan_cs.c:1088: error: syntax error before "You"
wvlan_cs.c:1088:39: invalid suffix "x" on integer constant
wvlan_cs.c:1089: error: stray '\' in program
wvlan_cs.c:1089:71: missing terminating " character
Expected Results: Kernel RPM that was builded properly.
I have tested this only with --target=i386, but I think this bug is
platform-indepedent and target-independent.
The patch for file /drivers/net/pcmcia/wvlan_cs.c is:
--- wvlan_cs.c.orig 2004-12-21 20:55:37.000000000 +0200
+++ wvlan_cs.c 2004-12-21 20:00:20.000000000 +0200
@@ -1084,9 +1084,9 @@
/* This is a PrismII card. It is is *very* similar
* to the Lucent, and the driver work 95%,
* therefore, we attempt to support it... */
- printk(KERN_NOTICE "%s: This is a PrismII
card, not a Wavelan IEEE card :-(
-You may want report firmare revision (0x%X) and what the card support.
-I will try to make it work, but you should look for a better
driver.\n", dev_info, firmware);
+ printk(KERN_NOTICE "%s: This is a PrismII
card, not a Wavelan IEEE card :-(\n"
+"You may want report firmare revision (0x%X) and what the card
+"I will try to make it work, but you should look for a better
driver.\n", dev_info, firmware);
local->has_port3 = 1;
local->has_ibssid = 0;
local->has_mwo = 0;
Oh, sorry, I forgot to show my versions of gcc and rpm:
The correct target to use is i686, as follows:
rpmbuild -bp --target i686 kernel-2.4.spec
Ok, I tried to build kernel with target i686:
rpmbuild -bb --target i686 kernel-2.4.spec
And I'v got:
i2c-algo-bit.c: In function `sclhi':
i2c-algo-bit.c:120: warning: comparison of distinct pointer types lacks a cast
i2c-ali1535.c:675:6: missing terminating " character
i2c-ali1535.c:676:89: missing terminating " character
i2c-ali1535.c:691:1: unterminated argument list invoking macro "MODULE_AUTHOR"
i2c-ali1535.c:674: error: syntax error at end of input
make: *** [i2c-ali1535.o] Error 1
make: *** [_modsubdir_i2c] Error 2
make: *** [_mod_drivers] Error 2
The problem must be in different version of gcc, but AFAIR multi-line strings
without terminating each line by \" is not a standard definition for C.
As you see, the mistake in i2c-ali1535.c is the same as in wvlan_cs.c.
Reopening and reassigning to "gcc3" component.
Multi-line string literals, which have been a GNU extension, were deprecated
in GCC 3.0, 3.1 and 3.2 and finally the support for them was removed in GCC 3.3,
Red Hat kernel-2.4.x packages don't have the needed changes to stop using
multi-line string literals, only kernel-2.6.xx packages do.
So, either use gcc-3.2.3-RH to build kernel-2.4.xx, or build 2.6 kernel, or
patch kernel yourself.
Try to compile some test i.e.
with given parameters: -Wall -W -ansi -pedantic
a.c:1: warning: ANSI C forbids newline in string constant
What do you think about writing simple script that could fix such kind of errors
of syntax in the whole kernel sources?
I suspect all these errors have been fixed already in the 2.6 kernel.