#402 closed defect (fixed)

gcc - Wrong LIB_SPECS

Reported by: Ralf Corsepius Owned by: Joel Sherrill
Priority: normal Milestone: 2
Component: tool Version: unknown
Severity: major Keywords:
Cc: bugs@…, ralf.corsepius@… Blocked By:
Blocking:

Description

Several gccs apply a bogus LIB_SPEC ("lib:" in gcc's spec files). This causes autoconf link checks to fail bogusly.

These failures cause RTEMS configure scripts to report bogus results - Fortunately, all places where these bogus results occur, currently fall back gracefully, not causing further damage.

Example: sparc-rtems-gcc

/opt/rtems/lib/gcc-lib/sparc-rtems/3.2.1/collect2 -o tmp /opt/rtems/lib/gcc-lib/sparc-rtems/3.2.1/../../../../sparc-rtems/lib/crt0.o -L/opt/rtems/lib/gcc-lib/sparc-rtems/3.2.1 -L/opt/rtems/lib/gcc-lib/sparc-rtems/3.2.1/../../../../sparc-rtems/lib /tmp/cc3JnoId.o -lgcc -lgcc

/opt/rtems/lib/gcc-lib/sparc-rtems/3.2.1/../../../../sparc-rtems/bin/ld: warning: cannot find entry symbol _start; defaulting to 00010074
/tmp/cc3JnoId.o: In function `main':
/tmp/cc3JnoId.o(.text+0x10): undefined reference to `strlcat'
/tmp/cc3JnoId.o(.text+0x14): undefined reference to `strlcat'
/tmp/cc3JnoId.o(.data+0x0): undefined reference to `strlcat'
collect2: ld returned 1 exit status

In this case, -lc is missing from the call to the linker.

Until now I found to be affected:
mips-rtems-gcc
sparc-rtems-gcc
powerpc-rtems-gcc

Not affected:
h8300-rtems-gcc
i386-rtems-gcc
sh-rtems-gcc

Release:
All versions of gcc

How-To-Repeat:
<target>-rtems-gcc -v -o foo foo.c

cat foo.c
#include <string.h>
int main()
{

char dest[10];
strlcat(dest,"foo",10);

}

Change History (1)

comment:1 Changed on May 26, 2003 at 2:47:13 PM by Joel Sherrill

Status: assignedclosed

State-Changed-From-To: analyzed->closed
State-Changed-Why: Patch included in gcc3.2.3newlib1.11.0-3.

Note: See TracTickets for help on using tickets.