From 18a366f3a01c96e9bb5b684ad825f600340ccb30 Mon Sep 17 00:00:00 2001 From: jb Date: Thu, 30 Apr 1998 09:13:48 +0000 Subject: Build __error.c into libc, but not libc_r. The weak symbol in the file works with libpthread, but when built into libc_r which has a non-weak symbol of the same name, the linker behaves unpredicatably and sometimes links the wrong symbol. The linker behaviour is a byproduct of what the program calls from object to object so it is like winning a lottery if the program actually works. The odds are quite good - 95:1, I think. We need a sure thing, though, so weak symbols can't be used instead of renaming things. --- lib/libc/sys/Makefile.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index d36a7a2..02208ba 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.3 (Berkeley) 10/24/94 -# $Id: Makefile.inc,v 1.49 1998/03/23 21:04:06 jb Exp $ +# $Id: Makefile.inc,v 1.50 1998/03/28 11:48:48 dufault Exp $ # sys sources .PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys ${.CURDIR}/../libc/sys @@ -26,7 +26,12 @@ SRCS+= netbsd_getdirentries.c netbsd_msync.c netbsd_stat.c netbsd_swapon.c .endif # Sources common to both syscall interfaces: -SRCS+= __error.c ftruncate.c lseek.c mmap.c truncate.c +SRCS+= ftruncate.c lseek.c mmap.c truncate.c + +# Build __error() into libc, but not libc_r which has it's own: +.if ${LIB} == "c" +SRCS+= __error.c +.endif # Add machine dependent asm sources: SRCS+=${MDASM} -- cgit v1.1