Martin,

Yeah, I know the cause, I just wasn't at all sure about the cure.  Seems
to me it would be even easier to manually convert sprintf(buf,"%s",str)
to strcpy(buf,str) then, wouldn't it?  That's what someone did with
fs/reiserfs/prints.c


Thanks,

Mark Post

-----Original Message-----
From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of
Martin Schwidefsky
Sent: Wednesday, September 13, 2006 7:04 AM
To: LINUX-390@VM.MARIST.EDU
Subject: Re: gcc 3.4.6 converting sprintf to strcpy calls causing kernel
linkedit failure

On Tue, 2006-09-12 at 19:09 -0400, Post, Mark K wrote:
> I'm _almost_ ready to get a good compile of Linux kernel 2.4.33.3 with
> all the developerWorks patches integrated.  The last problem is
> unresolved references to strcpy in the lcs.c and qeth.c modules.  I've
> isolated the problem to a single sprintf command in each of them (out
of
> _many_ that seem fine).  The following patches seems to fix it.  It
> certainly compiles, but I am not sure it is the correct way to go
about
> it.

That is the too clever compiler that transforms a sprintf(buf,"%s",str)
to a simple strcpy. 2.4 has an inline function for strcpy but not a
non-inlined version. The compiler "optimization" requires a non-inline
function for strcpy. The easiest way to get to it is to backport
arch/s390/lib/string.c from a 2.6 kernel to 2.4.

--
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to