From d2a4c6204a77aaec984b85e9754b5aa783192476 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Fri, 29 Apr 2005 21:46:41 +0000 Subject: [PATCH] Make a special libc version for RTLD which doesn't use TLS as it will soon be added. Don't install it, keep it in the build tree. Also build the rtld itself without TLS dependencies. Stop building and installing the normal libc as PIC archive. Discussed-with: dillon --- Makefile.inc1 | 4 ++-- lib/Makefile | 4 ++-- lib/libc/Makefile | 3 +-- lib/libc_rtld/Makefile | 31 +++++++++++++++++++++++++++++++ libexec/rtld-elf/Makefile | 12 ++++++------ 5 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 lib/libc_rtld/Makefile diff --git a/Makefile.inc1 b/Makefile.inc1 index 7a24e14d79..e629782bdf 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1,6 +1,6 @@ # # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $ -# $DragonFly: src/Makefile.inc1,v 1.65 2005/04/22 07:38:58 joerg Exp $ +# $DragonFly: src/Makefile.inc1,v 1.66 2005/04/29 21:46:41 joerg Exp $ # # Make command line options: # -DMAKE_KERBEROS5 to build Kerberos5 @@ -887,7 +887,7 @@ libraries: # _startup_libs34= gnu/lib/gcc34/libgcc _startup_libs= lib/csu/${MACHINE_ARCH} -_startup_libs+= lib/csu/common lib/libc +_startup_libs+= lib/csu/common lib/libc lib/libc_rtld _prebuild_libs= lib/libarchive _prebuild_libs+= lib/libutil diff --git a/lib/Makefile b/lib/Makefile index eecbfabd5a..e87762cafc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD: src/lib/Makefile,v 1.107.2.16 2002/10/10 19:24:35 kbyanc Exp $ -# $DragonFly: src/lib/Makefile,v 1.19 2005/04/21 16:36:34 joerg Exp $ +# $DragonFly: src/lib/Makefile,v 1.20 2005/04/29 21:46:41 joerg Exp $ # To satisfy shared library or ELF linkage when only the libraries being # built are visible: @@ -28,7 +28,7 @@ SUBDIR= ${_csu} csu/common libarchive libcom_err libcrypt msun libmd \ ${_libmilter} ${_libncp} libnetgraph libopie libpam \ libpcap libposix1e librpcsvc ${_libsm} ${_libsmb} ${_libsmdb} \ ${_libsmutil} libstand libtelnet libthread_xu libusbhid ${_libvgl} \ - libwrap libxpg4 liby libz i18n_module + libwrap libxpg4 liby libz i18n_module libc_rtld _csu=csu/${MACHINE_ARCH} diff --git a/lib/libc/Makefile b/lib/libc/Makefile index b2a4c3ce49..55fdd8a80b 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # $FreeBSD: src/lib/libc/Makefile,v 1.24 1999/09/29 15:18:29 marcel Exp $ -# $DragonFly: src/lib/libc/Makefile,v 1.8 2005/04/21 13:42:33 joerg Exp $ +# $DragonFly: src/lib/libc/Makefile,v 1.9 2005/04/29 21:46:41 joerg Exp $ # # All library objects contain rcsid strings by default; they may be # excluded as a space-saving measure. To produce a library that does @@ -12,7 +12,6 @@ SHLIB_MAJOR= 5 CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/include AINC= -I${.CURDIR}/${MACHINE_ARCH} CLEANFILES+=tags -INSTALL_PIC_ARCHIVE= yes PRECIOUSLIB= yes # diff --git a/lib/libc_rtld/Makefile b/lib/libc_rtld/Makefile new file mode 100644 index 0000000000..176d2349bc --- /dev/null +++ b/lib/libc_rtld/Makefile @@ -0,0 +1,31 @@ +# $DragonFly: src/lib/libc_rtld/Makefile,v 1.1 2005/04/29 21:46:41 joerg Exp $ + +LIB= c_rtld +INTERNALLIB= +INSTALL_PIC_ARCHIVE= +NOPROFILE= +CFLAGS+=-I${.CURDIR}/../libc/include +CFLAGS+=-I${.CURDIR}/../../include -D__thread= + +AINC= -I${.CURDIR}/../libc/${MACHINE_ARCH} +PRECIOUSLIB= yes + +# +# This is a list of syscalls that are renamed as __sys_{syscall} +# so that libc_r can provide replacement functions. +# +HIDDEN_SYSCALLS= aio_suspend.o accept.o bind.o close.o connect.o dup.o dup2.o \ + execve.o fchflags.o fchmod.o fchown.o fcntl.o \ + flock.o fpathconf.o fstat.o fstatfs.o fsync.o getdirentries.o \ + getlogin.o getpeername.o getsockname.o getsockopt.o ioctl.o \ + kevent.o kqueue.o listen.o \ + msync.o nanosleep.o open.o poll.o read.o readv.o recvfrom.o \ + recvmsg.o sched_yield.o select.o sendfile.o sendmsg.o sendto.o \ + setsockopt.o shutdown.o sigaction.o \ + sigpending.o sigprocmask.o \ + sigsuspend.o sigtimedwait.o sigwaitinfo.o socket.o \ + socketpair.o wait4.o write.o writev.o + +.include "${.CURDIR}/../libc/Makefile.inc" + +.include diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index e373071ec4..1575493426 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -1,11 +1,11 @@ # $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.10.2.6 2002/06/22 17:03:13 jdp Exp $ -# $DragonFly: src/libexec/rtld-elf/Makefile,v 1.6 2005/02/04 00:33:49 joerg Exp $ +# $DragonFly: src/libexec/rtld-elf/Makefile,v 1.7 2005/04/29 21:46:41 joerg Exp $ PROG= ld-elf.so.1 SRCS= rtld_start.S rtld.c lockdflt.c map_object.c malloc.c \ xmalloc.c debug.c reloc.c MAN= rtld.1 -CFLAGS+= -Wall -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} +CFLAGS+= -Wall -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} -D__thread= LDFLAGS+= -nostdlib -e .rtld_start INSTALLFLAGS= -fschg -C -b MLINKS= rtld.1 ld-elf.so.1.1 @@ -17,13 +17,13 @@ MLINKS= rtld.1 ld-elf.so.1.1 .ifdef LDSCRIPT OBJS+= dyn_hack.so LDFLAGS+= -Wl,-T,${LDSCRIPT} -Wl,-E -Wl,-Bstatic -DPADD= ${LIBC} -LDADD= -lc +DPADD= ${.OBJDIR}/../../lib/libc_rtld/libc_rtld.a +LDADD= -L${.OBJDIR}/../../lib/libc_rtld -lc_rtld .else CFLAGS+= -fpic -DPIC LDFLAGS+= -shared -Wl,-Bsymbolic -DPADD= ${LIBC_PIC} -LDADD= -lc_pic +DPADD= ${.OBJDIR}/../../lib/libc_rtld/libc_rtld_pic.a +LDADD= -L${.OBJDIR}/../../lib/libc_rtld -lc_rtld_pic .endif dyn_hack.so: -- 2.41.0