On Wed, May 25, 2005 at 08:39:10AM -0400, Kumba wrote:
> Date: Wed, 25 May 2005 08:39:10 -0400
> From: Kumba <firstname.lastname@example.org>
> To: Jerry <email@example.com>
> CC: Ralf Baechle <firstname.lastname@example.org>,
> linux-mips <email@example.com>
> Subject: Re: relocation truncated to fit
> Content-Type: text/plain; charset=UTF-8;
> Ralf Baechle wrote:
> > On Wed, May 25, 2005 at 11:51:43AM +0300, Jerry wrote:
> >>drivers/sound/sounddrivers.o: In function `sound_insert_unit':
> >>sound_core.c:(.text+0x1ac): undefined reference to `strcpy'
> >>sound_core.c:(.text+0x1ac): relocation truncated to fit: R_MIPS_26 against
> >>make: *** [vmlinux] Ошибка 1
> >>make: Leaving directory `/work/video/kernel'
> >>make: *** [vmlinux] Ошибка 2
> >>It's not a "sound drivers" problem, howewer without it kernel compiles
> >>and run succesfully. Seems like gcc/bunitils bug/feature. What have to
> >>be done to eliminate this error?
> >>GNU ld version 2.15.96 20050308
> >>gcc version 3.4.3
> > Don't use gcc 3.4 to compile Linux 2.4. It may work for some kernel
> > configurations but it will fail for others.
> > Ralf
> I would've thought this was fixed in 2.4.x now. You might try using newer
> sources. The below patch fixes the issue:
> As the original patch I found stated about gcc-3.4.x:
> From: Jan Hubicka <firstname.lastname@example.org>
> GCC now converts sprintf (a,"%s",b) to strcpy. This lose on kernel as
> strcpy is not inlined and not present in library, so one gets linker
> failure. It seems to make sense to apply this optimization by hand.
That fixes just the tip of the iceberg. You want to rebuild with
-ffreestanding which 2.6 already does. With that applied still some
2.4 kernel configurations will run into a bunch of other gcc 3.4-related
bug and not last loads of warnings.