summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2003-09-02 19:37:11 +0000
committerkan <kan@FreeBSD.org>2003-09-02 19:37:11 +0000
commit6d12300f90fad2255ee8886b22df9d054ead72cb (patch)
treed21b15d891848e43c52ff2c31d9fa141449b3af3 /lib
parenta69ecba559088d42f19d6acd96fa0fb4d8caf7c0 (diff)
downloadFreeBSD-src-6d12300f90fad2255ee8886b22df9d054ead72cb.zip
FreeBSD-src-6d12300f90fad2255ee8886b22df9d054ead72cb.tar.gz
Rethink the way thr_libc.So is generated. Relying on GCC to extract
only needed symbols from libc_pic is not working on sparc64. Requested by: jake
Diffstat (limited to 'lib')
-rw-r--r--lib/libkse/Makefile6
-rw-r--r--lib/libkse/support/Makefile.inc36
-rw-r--r--lib/libpthread/Makefile6
-rw-r--r--lib/libpthread/support/Makefile.inc36
4 files changed, 64 insertions, 20 deletions
diff --git a/lib/libkse/Makefile b/lib/libkse/Makefile
index 31c09dc..3d7c890 100644
--- a/lib/libkse/Makefile
+++ b/lib/libkse/Makefile
@@ -39,9 +39,3 @@ PRECIOUSLIB= yes
.include "${.CURDIR}/thread/Makefile.inc"
.include <bsd.lib.mk>
-
-# Can't put thr_support.c in SRCS but want it in .depend.
-${DEPENDFILE}: thr_support.c
-
-# LIBC_PIC is defined only after <bsd.lib.mk> is included.
-thr_libc.So: ${LIBC_PIC}
diff --git a/lib/libkse/support/Makefile.inc b/lib/libkse/support/Makefile.inc
index 1b445ab..c8176b3 100644
--- a/lib/libkse/support/Makefile.inc
+++ b/lib/libkse/support/Makefile.inc
@@ -1,9 +1,37 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/support
+.PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string
+
+CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_ARCH}
+
+SYSCALLS= clock_gettime \
+ kse_create \
+ kse_exit \
+ kse_release \
+ kse_thr_interrupt \
+ kse_wakeup \
+ sigaction \
+ sigprocmask \
+ sigtimedwait \
+ write
+
+SYSCALL_SRC= ${SYSCALLS:S/$/.S/}
+SYSCALL_OBJ= ${SYSCALLS:S/$/.So/}
+
+${SYSCALL_SRC}:
+ printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' > ${.TARGET}
+
+LIBC_OBJS= sigsetops.So \
+ bcopy.So \
+ bzero.So \
+ memcpy.So \
+ memset.So \
+ strcpy.So \
+ strlen.So
SOBJS+= thr_libc.So
-CLEANFILES+= thr_support.So
+CLEANFILES+= ${SYSCALL_SRC} ${SYSCALL_OBJ} ${LIBC_OBJS}
+
+thr_libc.So: ${SYSCALL_OBJ} ${LIBC_OBJS}
+ ${CC} -fPIC -nostdlib -o ${.TARGET} -r ${.ALLSRC}
-thr_libc.So: thr_support.So
- ${CC} -nostdlib -o ${.TARGET} -r thr_support.So -lc_pic
diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile
index 31c09dc..3d7c890 100644
--- a/lib/libpthread/Makefile
+++ b/lib/libpthread/Makefile
@@ -39,9 +39,3 @@ PRECIOUSLIB= yes
.include "${.CURDIR}/thread/Makefile.inc"
.include <bsd.lib.mk>
-
-# Can't put thr_support.c in SRCS but want it in .depend.
-${DEPENDFILE}: thr_support.c
-
-# LIBC_PIC is defined only after <bsd.lib.mk> is included.
-thr_libc.So: ${LIBC_PIC}
diff --git a/lib/libpthread/support/Makefile.inc b/lib/libpthread/support/Makefile.inc
index 1b445ab..c8176b3 100644
--- a/lib/libpthread/support/Makefile.inc
+++ b/lib/libpthread/support/Makefile.inc
@@ -1,9 +1,37 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/support
+.PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string
+
+CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_ARCH}
+
+SYSCALLS= clock_gettime \
+ kse_create \
+ kse_exit \
+ kse_release \
+ kse_thr_interrupt \
+ kse_wakeup \
+ sigaction \
+ sigprocmask \
+ sigtimedwait \
+ write
+
+SYSCALL_SRC= ${SYSCALLS:S/$/.S/}
+SYSCALL_OBJ= ${SYSCALLS:S/$/.So/}
+
+${SYSCALL_SRC}:
+ printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' > ${.TARGET}
+
+LIBC_OBJS= sigsetops.So \
+ bcopy.So \
+ bzero.So \
+ memcpy.So \
+ memset.So \
+ strcpy.So \
+ strlen.So
SOBJS+= thr_libc.So
-CLEANFILES+= thr_support.So
+CLEANFILES+= ${SYSCALL_SRC} ${SYSCALL_OBJ} ${LIBC_OBJS}
+
+thr_libc.So: ${SYSCALL_OBJ} ${LIBC_OBJS}
+ ${CC} -fPIC -nostdlib -o ${.TARGET} -r ${.ALLSRC}
-thr_libc.So: thr_support.So
- ${CC} -nostdlib -o ${.TARGET} -r thr_support.So -lc_pic
OpenPOWER on IntegriCloud