Subject: toolchain/36421: gcc -pg bug with fstat()
To: None <,,>
From: None <>
List: netbsd-bugs
Date: 06/01/2007 09:15:00
>Number:         36421
>Category:       toolchain
>Synopsis:       gcc-4.1.2 with -pg fails to link because __fstat30 is missing
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 01 09:15:00 +0000 2007
>Originator:     Feico Dillema
>Release:        NetBSD 4.0_BETA2
University of Tromso
System: NetBSD 4.0_BETA2 NetBSD 4.0_BETA2 (TACO1) #1: Sat Mar 10 11:22:39 CET 2007 i386
Architecture: i386
Machine: i386

gcc-4.1.2 on NetBSD 4.0_BETA2 fails to compile code with profiling when it contains a
call to fstat.


# cat test.c

#include <sys/stat.h>
#include <sys/fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int ac,char* *av)
 struct stat stb;
 int fd = open("test.c",O_RDONLY,"r");
 if (fstat(fd,&stb) < 0) exit(-1);

# gcc -pg -o test test.c
test.c: In function 'main':
/var/tmp//cc0WuCWc.o: In function `main':
test.c:(.text+0x39): undefined reference to `__fstat30'