PATCH: gcc3.0.2 workaround for 8139too
hello,
after 2.4.10 i've detected that using gcc 3.0.2 to compile the kernel always fails with the 8139too realtek networkcard driver. errormessage reports a bug in the compiler itself. 2.4.11-2.4.14 are affected by it too. that's also the only file affected by this. i have investigated into stuff and realized that there seems to be a little borkage with understanding of strcpy. i can't tell how, why and what. i went to irc.opensource.org and talked there with some people a while back, also offered a 'temporarely solution' to get things compiled and operate again (worksforme TM) and saw that a bunch of other people wanted to get it working again in any circumstances.
so please allow me to post this 'temporarely workaround' here so other people can profit of it until things with the gcc3.0.2 compiler are solved.
thank you.
Signature · 4 lines
Name....: Ali Akcaagac Status..: Student Of Computer & Economic Science E-Mail..: mailto:[email protected] WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
drivers/net/8139too.c renamed from drivers/net/8139too.c.bak +3 -3
@@ -2393,9 +2393,9 @@case ETHTOOL_GDRVINFO : {struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO }; -strcpy (info.driver,DRV_NAME ); -strcpy (info.version,DRV_VERSION ); -strcpy (info.bus_info, np->pci_dev->slot_name); +sprintf (info.driver,DRV_NAME ); +sprintf (info.version,DRV_VERSION ); +sprintf (info.bus_info, np->pci_dev->slot_name);if (copy_to_user (useraddr, &info,sizeof (info)))return -EFAULT ;return 0 ;
Quoted 3 lines · Ali Akcaagac
so please allow me to post this 'temporarely workaround' here so other people can profit of it until things with the gcc3.0.2 compiler are solved.
hello,
i've got quite a lot of response for this. oki, the problem is still there and still no solution. somehow i was forced to do minor changes to the previous *workaround*. at least to save myself from beeing bombed again :) and save whoever uses this stuff, from getting complications, please allow me to post this one.
reason: probably gcc3.0.2 bug
kernel: 2.4.10 -> X
result: solves some strange compile failure issues.
Signature · 4 lines
Name....: Ali Akcaagac Status..: Student Of Computer & Economic Science E-Mail..: mailto:[email protected] WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
drivers/net/8139too.c renamed from drivers/net/8139too.c.bak +3 -3
@@ -2393,9 +2393,9 @@case ETHTOOL_GDRVINFO : {struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO }; -strcpy (info.driver,DRV_NAME ); -strcpy (info.version,DRV_VERSION ); -strcpy (info.bus_info, np->pci_dev->slot_name); +sprintf (info.driver,"%s" ,DRV_NAME ); +sprintf (info.version,"%s" ,DRV_VERSION ); +sprintf (info.bus_info,"%s" , np->pci_dev->slot_name);if (copy_to_user (useraddr, &info,sizeof (info)))return -EFAULT ;return 0 ;
Quoted 3 lines · Ali Akcaagac
Quoted 3 lines
so please allow me to post this 'temporarely workaround' here so other people can profit of it until things with the gcc3.0.2 compiler are solved.
Type make &> foo
then the internel error comes
edit foo and remove all the lines until 8139too starts. remove the rest of the lines and the -O2 in the 8139too line. cd d*/n*
sh ../../foo
cd /linux
make
There you go!
--
Groeten / Regards, Rene J. Blokland -o)
1073KA 13 2e, the Netherlands /\\
Paai: "Windows is als pianospelen met bokshandschoenen aan" _\_v
Quoted 5 lines · Rene Blokland
cd d*/n*
sh ../../foo
cd /linux
make
There you go!
ok, i haven't tested this and don't even know if this works here. i for now belive that it will work but that error has a _reason_ to happen for some unknown issues. i'd better go for a cleaner solution right now then forcing some crashes that _may_ happen because of borked _assembly_ code that may be generated..
what i am thinking now (and i may be wrong). let's say i compile it your way everything will be fine no visible errors and so on. now i use that driver. everything works but under certain circumstances it may jump into that CASE and crash because the compilers wasn't able to create a clean code for it.
at least it was a quick solution to solve my personal needs that i wanted to share with others maybe people not so involved into fixing stuff.
but thank you. i will try this one out as soon as i update my kernel :)
Signature · 4 lines
Name....: Ali Akcaagac Status..: Student Of Computer & Economic Science E-Mail..: mailto:[email protected] WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
gcc 3.0.0, 3.0.1, 3.0.2 needs this patch:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4529&database=gcc
to compile the kernel and the 8139too.c nic driver.
-lt
=====
--
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1