Subject: pkg/25756: pkgsrc/emulators/peace refuses to build on NetBSD 2.1 (aka current)
To: None <>
From: None <>
List: pkgsrc-bugs
Date: 05/30/2004 16:45:59
>Number:         25756
>Category:       pkg
>Synopsis:       several compiler errors because of missing statfs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 30 14:50:00 UTC 2004
>Originator:     Andreas Wiese
>Release:        NetBSD 2.0F
Linux User Group Halberstadt
System: NetBSD schroeder.singeklub.invalid 2.0F NetBSD 2.0F (SCHROEDER) #2: Sun May 30 13:37:17 CEST 2004 root@schroeder.singeklub.invalid:/sys/arch/i386/compile/SCHROEDER i386
Architecture: i386
Machine: i386
The build of peace fails with 

/usr/pkgsrc/emulators/peace/work/peace-0.0.20040309/libexec/ld.pe_so/libc/opendir.c: In function `__opendir2':
/usr/pkgsrc/emulators/peace/work/peace-0.0.20040309/libexec/ld.pe_so/libc/opendir.c:86: error: storage size of `sfb' isn't known
/usr/pkgsrc/emulators/peace/work/peace-0.0.20040309/libexec/ld.pe_so/libc/opendir.c:118: warning: implicit declaration of function `fstatfs'
/usr/pkgsrc/emulators/peace/work/peace-0.0.20040309/libexec/ld.pe_so/libc/opendir.c:86: warning: unused variable `sfb'

This could be solved by replacing all occurences of `statfs' in the file with
`statvfs' and adjusting the statvfs-struct members accordingly to this changes
(f_flags -> f_flag).  

With this done, the build continues and fails with

/usr/pkgsrc/emulators/peace/work/peace-0.0.20040309/libexec/ld.pe_so/elf/paths.c:134: error: redifinition of `struct sysctldesc'

because the name sysctldesc is already used for a struct from <sys/sysctl.h>.
This problem can for example be solved by renaming sysctldesc to sysctldesc2
in paths.c.

After this it compiles after all but fails linking with

opendir.o(.text+0x111):opendir.c: undefined reference to `_fstatvfs'
fstatfs.o(.text+0x9):fstatfs.S: undefined reference to `SYS_fstatfs'
collect2: ld returned 1 exit status

I don't understand the first message, because fstatvfs is in libc.  And I'm
not able to write in assembler so that I can't solve the second thing, too.


# cd /usr/pkgsrc/emulators/peace && make

On NetBSD-current ;)
See above.