PERFORCE change 48362 for review
Peter Wemm
peter at FreeBSD.org
Sun Mar 7 11:40:45 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=48362
Change 48362 by peter at peter_daintree on 2004/03/07 11:39:56
Get out the big hammer and hack the tree to build ld-elf32.so.1
Affected files ...
.. //depot/projects/hammer/Makefile.inc1#41 edit
.. //depot/projects/hammer/etc/mtree/BSD.local.dist#15 edit
.. //depot/projects/hammer/etc/mtree/BSD.root.dist#6 edit
.. //depot/projects/hammer/etc/mtree/BSD.usr.dist#19 edit
.. //depot/projects/hammer/etc/mtree/BSD.x11-4.dist#5 edit
.. //depot/projects/hammer/etc/mtree/BSD.x11.dist#2 edit
.. //depot/projects/hammer/lib/Makefile#31 edit
.. //depot/projects/hammer/lib/libc/Makefile#13 edit
.. //depot/projects/hammer/lib/libc/alpha/gen/Makefile.inc#4 edit
.. //depot/projects/hammer/lib/libc/compat-43/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/db/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/db/btree/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/db/db/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/db/hash/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/db/man/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/db/mpool/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/db/recno/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/gdtoa/Makefile.inc#5 edit
.. //depot/projects/hammer/lib/libc/gen/Makefile.inc#11 edit
.. //depot/projects/hammer/lib/libc/gmon/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/locale/Makefile.inc#16 edit
.. //depot/projects/hammer/lib/libc/net/Makefile.inc#7 edit
.. //depot/projects/hammer/lib/libc/nls/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/posix1e/Makefile.inc#7 edit
.. //depot/projects/hammer/lib/libc/quad/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/regex/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/regex/grot/Makefile#2 edit
.. //depot/projects/hammer/lib/libc/rpc/Makefile.inc#6 edit
.. //depot/projects/hammer/lib/libc/sparc64/fpu/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/sparc64/sys/Makefile.inc#4 edit
.. //depot/projects/hammer/lib/libc/stdio/Makefile.inc#10 edit
.. //depot/projects/hammer/lib/libc/stdlib/Makefile.inc#10 edit
.. //depot/projects/hammer/lib/libc/stdtime/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/string/Makefile.inc#7 edit
.. //depot/projects/hammer/lib/libc/sys/Makefile.inc#12 edit
.. //depot/projects/hammer/lib/libc/uuid/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc/xdr/Makefile.inc#4 edit
.. //depot/projects/hammer/lib/libc/yp/Makefile.inc#3 edit
.. //depot/projects/hammer/lib/libc32/Makefile#1 add
.. //depot/projects/hammer/libexec/Makefile#20 edit
.. //depot/projects/hammer/libexec/rtld-elf/Makefile#8 edit
.. //depot/projects/hammer/libexec/rtld-elf/debug.h#2 edit
.. //depot/projects/hammer/libexec/rtld-elf/libmap.c#11 edit
.. //depot/projects/hammer/libexec/rtld-elf/libmap.h#3 edit
.. //depot/projects/hammer/libexec/rtld-elf/rtld.c#17 edit
.. //depot/projects/hammer/libexec/rtld-elf/rtld.h#6 edit
.. //depot/projects/hammer/libexec/rtld-elf32/Makefile#1 add
.. //depot/projects/hammer/share/mk/bsd.lib.mk#13 edit
.. //depot/projects/hammer/sys/compat/ia32/ia32_sysvec.c#11 edit
Differences ...
==== //depot/projects/hammer/Makefile.inc1#41 (text+ko) ====
@@ -256,8 +256,8 @@
mkdir -p ${WORLDTMP}/legacy/${_dir}
.endfor
.for _dir in \
- lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
- usr/libexec usr/share/misc usr/share/bsnmp/defs usr/share/bsnmp/mibs
+ lib lib32 usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
+ usr/lib32 usr/libexec usr/share/misc usr/share/bsnmp/defs usr/share/bsnmp/mibs
mkdir -p ${WORLDTMP}/${_dir}
.endfor
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
==== //depot/projects/hammer/etc/mtree/BSD.local.dist#15 (text+ko) ====
@@ -19,6 +19,8 @@
..
lib
..
+ lib32
+ ..
libdata
..
libexec
==== //depot/projects/hammer/etc/mtree/BSD.root.dist#6 (text+ko) ====
@@ -63,6 +63,8 @@
..
lib
..
+ lib32
+ ..
libexec
..
mnt
==== //depot/projects/hammer/etc/mtree/BSD.usr.dist#19 (text+ko) ====
@@ -19,6 +19,8 @@
..
..
..
+ lib32
+ ..
libdata
doscmd
fonts
==== //depot/projects/hammer/etc/mtree/BSD.x11-4.dist#5 (text+ko) ====
@@ -347,6 +347,8 @@
..
..
..
+ lib32
+ ..
libdata
pkgconfig
..
==== //depot/projects/hammer/etc/mtree/BSD.x11.dist#2 (text+ko) ====
@@ -191,6 +191,8 @@
modules
..
..
+ lib32
+ ..
libdata
..
libexec
==== //depot/projects/hammer/lib/Makefile#31 (text+ko) ====
@@ -32,7 +32,7 @@
${_libngatm} libopie libpam libpanel libpcap \
${_libpthread} ${_libsdp} ${_libsm} ${_libsmb} ${_libsmdb} \
${_libsmutil} libstand libtelnet ${_libthr} libufs libugidfw \
- ${_libusbhid} ${_libvgl} libwrap libxpg4 liby libz
+ ${_libusbhid} ${_libvgl} libwrap libxpg4 liby libz ${_libc32}
.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
_csu=csu/${MACHINE_ARCH}-elf
@@ -49,6 +49,11 @@
.endif
.endif
+# build libc_pic.a for rtld-elf-32 on amd64
+.if ${MACHINE_ARCH} == "amd64"
+_libc32= libc32
+.endif
+
.if !defined(NOATM)
_libatm= libatm
_libngatm= libngatm
==== //depot/projects/hammer/lib/libc/Makefile#13 (text+ko) ====
@@ -10,11 +10,15 @@
LIB=c
# If you bump SHLIB_MAJOR, remove the kluge from gen/gethostname.c.
# If you bump SHLIB_MAJOR, see standards/55112.
+.if !defined(${NOSHLIB})
SHLIB_MAJOR= 5
SHLIBDIR?= /lib
+.endif
WARNS?= 2
-CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
-CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
+TARGET?=${MACHINE_ARCH}
+LIBCSRC?=${.CURDIR}
+CFLAGS+=-I${LIBCSRC}/include -I${LIBCSRC}/../../include
+CFLAGS+=-I${LIBCSRC}/${TARGET}
CLEANFILES+=tags
INSTALL_PIC_ARCHIVE= yes
PRECIOUSLIB= yes
@@ -30,36 +34,36 @@
#
# If there is a machine dependent makefile, use it:
#
-.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
+.if exists(${LIBCSRC}/${TARGET}/Makefile.inc)
+.include "${LIBCSRC}/${TARGET}/Makefile.inc"
.endif
-.include "${.CURDIR}/db/Makefile.inc"
-.include "${.CURDIR}/compat-43/Makefile.inc"
-.include "${.CURDIR}/gdtoa/Makefile.inc"
-.include "${.CURDIR}/gen/Makefile.inc"
-.if ${MACHINE_ARCH} != "powerpc"
-.include "${.CURDIR}/gmon/Makefile.inc"
+.include "${LIBCSRC}/db/Makefile.inc"
+.include "${LIBCSRC}/compat-43/Makefile.inc"
+.include "${LIBCSRC}/gdtoa/Makefile.inc"
+.include "${LIBCSRC}/gen/Makefile.inc"
+.if ${TARGET} != "powerpc"
+.include "${LIBCSRC}/gmon/Makefile.inc"
.endif
-.include "${.CURDIR}/locale/Makefile.inc"
-.include "${.CURDIR}/net/Makefile.inc"
-.include "${.CURDIR}/nls/Makefile.inc"
-.include "${.CURDIR}/posix1e/Makefile.inc"
+.include "${LIBCSRC}/locale/Makefile.inc"
+.include "${LIBCSRC}/net/Makefile.inc"
+.include "${LIBCSRC}/nls/Makefile.inc"
+.include "${LIBCSRC}/posix1e/Makefile.inc"
.if !defined(NO_QUAD)
-.include "${.CURDIR}/quad/Makefile.inc"
+.include "${LIBCSRC}/quad/Makefile.inc"
.endif
-.include "${.CURDIR}/regex/Makefile.inc"
-.include "${.CURDIR}/stdio/Makefile.inc"
-.include "${.CURDIR}/stdlib/Makefile.inc"
-.include "${.CURDIR}/stdtime/Makefile.inc"
-.include "${.CURDIR}/string/Makefile.inc"
-.include "${.CURDIR}/sys/Makefile.inc"
-.include "${.CURDIR}/rpc/Makefile.inc"
-.include "${.CURDIR}/uuid/Makefile.inc"
-.include "${.CURDIR}/xdr/Makefile.inc"
+.include "${LIBCSRC}/regex/Makefile.inc"
+.include "${LIBCSRC}/stdio/Makefile.inc"
+.include "${LIBCSRC}/stdlib/Makefile.inc"
+.include "${LIBCSRC}/stdtime/Makefile.inc"
+.include "${LIBCSRC}/string/Makefile.inc"
+.include "${LIBCSRC}/sys/Makefile.inc"
+.include "${LIBCSRC}/rpc/Makefile.inc"
+.include "${LIBCSRC}/uuid/Makefile.inc"
+.include "${LIBCSRC}/xdr/Makefile.inc"
.if !defined(NO_YP_LIBC)
CFLAGS+= -DYP
-.include "${.CURDIR}/yp/Makefile.inc"
+.include "${LIBCSRC}/yp/Makefile.inc"
.endif
.if !defined(NO_HESIOD_LIBC)
CFLAGS+= -DHESIOD
@@ -86,14 +90,14 @@
KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
strcat.c strcmp.c strcpy.c strlen.c strncpy.c
-libkern: libkern.gen libkern.${MACHINE_ARCH}
+libkern: libkern.gen libkern.${TARGET}
libkern.gen: ${KQSRCS} ${KSRCS}
- cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
+ cp -p ${LIBCSRC}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
-libkern.${MACHINE_ARCH}:: ${KMSRCS}
+libkern.${TARGET}:: ${KMSRCS}
.if defined(KMSRCS) && !empty(KMSRCS)
- cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
+ cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${TARGET}
.endif
.include <bsd.lib.mk>
==== //depot/projects/hammer/lib/libc/alpha/gen/Makefile.inc#4 (text+ko) ====
@@ -14,34 +14,34 @@
CLEANFILES+= __remqu.S __remq.S __remlu.S __reml.S
-__divqu.S: ${.CURDIR}/alpha/gen/divrem.m4
+__divqu.S: ${LIBCSRC}/alpha/gen/divrem.m4
m4 -DNAME=__divqu -DOP=div -DS=false -DWORDSIZE=64 \
${.ALLSRC} > ${.TARGET}
-__divq.S: ${.CURDIR}/alpha/gen/divrem.m4
+__divq.S: ${LIBCSRC}/alpha/gen/divrem.m4
m4 -DNAME=__divq -DOP=div -DS=true -DWORDSIZE=64 \
${.ALLSRC} > ${.TARGET}
-__divlu.S: ${.CURDIR}/alpha/gen/divrem.m4
+__divlu.S: ${LIBCSRC}/alpha/gen/divrem.m4
m4 -DNAME=__divlu -DOP=div -DS=false -DWORDSIZE=32 \
${.ALLSRC} > ${.TARGET}
-__divl.S: ${.CURDIR}/alpha/gen/divrem.m4
+__divl.S: ${LIBCSRC}/alpha/gen/divrem.m4
m4 -DNAME=__divl -DOP=div -DS=true -DWORDSIZE=32 \
${.ALLSRC} > ${.TARGET}
-__remqu.S: ${.CURDIR}/alpha/gen/divrem.m4
+__remqu.S: ${LIBCSRC}/alpha/gen/divrem.m4
m4 -DNAME=__remqu -DOP=rem -DS=false -DWORDSIZE=64 \
${.ALLSRC} > ${.TARGET}
-__remq.S: ${.CURDIR}/alpha/gen/divrem.m4
+__remq.S: ${LIBCSRC}/alpha/gen/divrem.m4
m4 -DNAME=__remq -DOP=rem -DS=true -DWORDSIZE=64 \
${.ALLSRC} > ${.TARGET}
-__remlu.S: ${.CURDIR}/alpha/gen/divrem.m4
+__remlu.S: ${LIBCSRC}/alpha/gen/divrem.m4
m4 -DNAME=__remlu -DOP=rem -DS=false -DWORDSIZE=32 \
${.ALLSRC} > ${.TARGET}
-__reml.S: ${.CURDIR}/alpha/gen/divrem.m4
+__reml.S: ${LIBCSRC}/alpha/gen/divrem.m4
m4 -DNAME=__reml -DOP=rem -DS=true -DWORDSIZE=32 \
${.ALLSRC} > ${.TARGET}
==== //depot/projects/hammer/lib/libc/compat-43/Makefile.inc#3 (text+ko) ====
@@ -2,7 +2,7 @@
# $FreeBSD: src/lib/libc/compat-43/Makefile.inc,v 1.12 2002/11/18 09:50:54 ru Exp $
# compat-43 sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/compat-43 ${.CURDIR}/compat-43
+.PATH: ${LIBCSRC}/${TARGET}/compat-43 ${LIBCSRC}/compat-43
SRCS+= creat.c gethostid.c getwd.c killpg.c sethostid.c setpgrp.c \
setrgid.c setruid.c sigcompat.c
==== //depot/projects/hammer/lib/libc/db/Makefile.inc#3 (text+ko) ====
@@ -3,9 +3,9 @@
#
CFLAGS+=-D__DBINTERFACE_PRIVATE
-.include "${.CURDIR}/db/btree/Makefile.inc"
-.include "${.CURDIR}/db/db/Makefile.inc"
-.include "${.CURDIR}/db/hash/Makefile.inc"
-.include "${.CURDIR}/db/man/Makefile.inc"
-.include "${.CURDIR}/db/mpool/Makefile.inc"
-.include "${.CURDIR}/db/recno/Makefile.inc"
+.include "${LIBCSRC}/db/btree/Makefile.inc"
+.include "${LIBCSRC}/db/db/Makefile.inc"
+.include "${LIBCSRC}/db/hash/Makefile.inc"
+.include "${LIBCSRC}/db/man/Makefile.inc"
+.include "${LIBCSRC}/db/mpool/Makefile.inc"
+.include "${LIBCSRC}/db/recno/Makefile.inc"
==== //depot/projects/hammer/lib/libc/db/btree/Makefile.inc#3 (text+ko) ====
@@ -1,7 +1,7 @@
# from @(#)Makefile.inc 8.2 (Berkeley) 7/14/94
# $FreeBSD: src/lib/libc/db/btree/Makefile.inc,v 1.4 2002/11/18 09:50:54 ru Exp $
-.PATH: ${.CURDIR}/db/btree
+.PATH: ${LIBCSRC}/db/btree
SRCS+= bt_close.c bt_conv.c bt_debug.c bt_delete.c bt_get.c bt_open.c \
bt_overflow.c bt_page.c bt_put.c bt_search.c bt_seq.c bt_split.c \
==== //depot/projects/hammer/lib/libc/db/db/Makefile.inc#3 (text+ko) ====
@@ -1,6 +1,6 @@
# from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD: src/lib/libc/db/db/Makefile.inc,v 1.4 2002/11/18 09:50:54 ru Exp $
-.PATH: ${.CURDIR}/db/db
+.PATH: ${LIBCSRC}/db/db
SRCS+= db.c
==== //depot/projects/hammer/lib/libc/db/hash/Makefile.inc#3 (text+ko) ====
@@ -1,7 +1,7 @@
# from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD: src/lib/libc/db/hash/Makefile.inc,v 1.5 2002/11/18 09:50:54 ru Exp $
-.PATH: ${.CURDIR}/db/hash
+.PATH: ${LIBCSRC}/db/hash
SRCS+= hash.c hash_bigkey.c hash_buf.c hash_func.c hash_log2.c \
hash_page.c ndbm.c
==== //depot/projects/hammer/lib/libc/db/man/Makefile.inc#3 (text+ko) ====
@@ -1,7 +1,7 @@
# from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD: src/lib/libc/db/man/Makefile.inc,v 1.11 2002/11/18 09:50:54 ru Exp $
-.PATH: ${.CURDIR}/db/man
+.PATH: ${LIBCSRC}/db/man
MAN+= btree.3 dbm.3 dbopen.3 hash.3 mpool.3 recno.3
==== //depot/projects/hammer/lib/libc/db/mpool/Makefile.inc#3 (text+ko) ====
@@ -1,6 +1,6 @@
# from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD: src/lib/libc/db/mpool/Makefile.inc,v 1.4 2002/11/18 09:50:55 ru Exp $
-.PATH: ${.CURDIR}/db/mpool
+.PATH: ${LIBCSRC}/db/mpool
SRCS+= mpool.c
==== //depot/projects/hammer/lib/libc/db/recno/Makefile.inc#3 (text+ko) ====
@@ -1,7 +1,7 @@
# from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD: src/lib/libc/db/recno/Makefile.inc,v 1.4 2002/11/18 09:50:55 ru Exp $
-.PATH: ${.CURDIR}/db/recno
+.PATH: ${LIBCSRC}/db/recno
SRCS+= rec_close.c rec_delete.c rec_get.c rec_open.c rec_put.c rec_search.c \
rec_seq.c rec_utils.c
==== //depot/projects/hammer/lib/libc/gdtoa/Makefile.inc#5 (text+ko) ====
@@ -1,21 +1,21 @@
# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.6 2004/01/18 10:32:49 das Exp $
# netlib gdtoa sources
-.PATH: ${.CURDIR}/gdtoa
+.PATH: ${LIBCSRC}/gdtoa
MISRCS+=_hdtoa.c _ldtoa.c glue.c
GDTOASRCS=dmisc.c dtoa.c gdtoa.c gethex.c gmisc.c \
hd_init.c hexnan.c misc.c smisc.c \
strtoIg.c strtod.c strtodg.c strtof.c strtord.c sum.c ulp.c
-.if exists(${.CURDIR}/${MACHINE_ARCH}/stdlib/gdtoa.mk)
-.include "${.CURDIR}/${MACHINE_ARCH}/stdlib/gdtoa.mk"
+.if exists(${LIBCSRC}/${TARGET}/stdlib/gdtoa.mk)
+.include "${LIBCSRC}/${TARGET}/stdlib/gdtoa.mk"
.endif
-CFLAGS+=-I${.CURDIR}/../../contrib/gdtoa
+CFLAGS+=-I${LIBCSRC}/../../contrib/gdtoa
.for src in ${GDTOASRCS}
MISRCS+=gdtoa_${src}
CLEANFILES+=gdtoa_${src}
gdtoa_${src}:
- ln -sf ${.CURDIR}/../../contrib/gdtoa/${src} ${.TARGET}
+ ln -sf ${LIBCSRC}/../../contrib/gdtoa/${src} ${.TARGET}
.endfor
==== //depot/projects/hammer/lib/libc/gen/Makefile.inc#11 (text+ko) ====
@@ -2,7 +2,7 @@
# $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.109 2004/01/15 17:27:28 ru Exp $
# machine-independent gen sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen
+.PATH: ${LIBCSRC}/${TARGET}/gen ${LIBCSRC}/gen
SRCS+= __xuname.c _pthread_stubs.c _rand48.c _spinlock_stub.c _thread_init.c \
alarm.c arc4random.c assert.c basename.c check_utility_compat.c \
@@ -33,8 +33,8 @@
valloc.c vis.c wait.c wait3.c waitpid.c wordexp.c
# machine-dependent gen sources
-.if exists(${.CURDIR}/${MACHINE_ARCH}/gen/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/gen/Makefile.inc"
+.if exists(${LIBCSRC}/${TARGET}/gen/Makefile.inc)
+.include "${LIBCSRC}/${TARGET}/gen/Makefile.inc"
.endif
MAN+= alarm.3 arc4random.3 \
==== //depot/projects/hammer/lib/libc/gmon/Makefile.inc#3 (text+ko) ====
@@ -2,7 +2,7 @@
# $FreeBSD: src/lib/libc/gmon/Makefile.inc,v 1.9 2002/11/18 09:50:55 ru Exp $
# gmon sources
-.PATH: ${.CURDIR}/gmon
+.PATH: ${LIBCSRC}/gmon
SRCS+= gmon.c mcount.c
==== //depot/projects/hammer/lib/libc/locale/Makefile.inc#16 (text+ko) ====
@@ -2,7 +2,7 @@
# $FreeBSD: src/lib/libc/locale/Makefile.inc,v 1.53 2003/12/07 06:33:52 tjr Exp $
# locale sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/locale ${.CURDIR}/locale
+.PATH: ${LIBCSRC}/${TARGET}/locale ${LIBCSRC}/locale
SRCS+= big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c frune.c \
gb18030.c gb2312.c gbk.c isctype.c iswctype.c \
==== //depot/projects/hammer/lib/libc/net/Makefile.inc#7 (text+ko) ====
@@ -2,7 +2,7 @@
# $FreeBSD: src/lib/libc/net/Makefile.inc,v 1.50 2003/11/14 18:53:22 bms Exp $
# machine-independent net sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/net ${.CURDIR}/net
+.PATH: ${LIBCSRC}/${TARGET}/net ${LIBCSRC}/net
SRCS+= addr2ascii.c ascii2addr.c base64.c ether_addr.c getaddrinfo.c \
gethostbydns.c gethostbyht.c gethostbynis.c gethostnamadr.c \
@@ -35,8 +35,8 @@
sed -e '/YY_BUF_SIZE/s/16384/1024/' >${.TARGET}
# machine-dependent net sources
-.if exists(${.CURDIR}/${MACHINE_ARCH}/net/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/net/Makefile.inc"
+.if exists(${LIBCSRC}/${TARGET}/net/Makefile.inc)
+.include "${LIBCSRC}/${TARGET}/net/Makefile.inc"
.endif
MAN+= addr2ascii.3 byteorder.3 ethers.3 getaddrinfo.3 gethostbyname.3 \
==== //depot/projects/hammer/lib/libc/nls/Makefile.inc#3 (text+ko) ====
@@ -1,7 +1,7 @@
# from $NetBSD: Makefile.inc,v 1.7 1995/02/27 13:06:20 cgd Exp $
# $FreeBSD: src/lib/libc/nls/Makefile.inc,v 1.8 2002/11/18 09:50:55 ru Exp $
-.PATH: ${.CURDIR}/nls
+.PATH: ${LIBCSRC}/nls
SRCS+= msgcat.c
==== //depot/projects/hammer/lib/libc/posix1e/Makefile.inc#7 (text+ko) ====
@@ -2,7 +2,7 @@
MAINTAINER= rwatson at FreeBSD.org
-.PATH: ${.CURDIR}/posix1e
+.PATH: ${LIBCSRC}/posix1e
SRCS+= acl_calc_mask.c \
acl_copy.c \
==== //depot/projects/hammer/lib/libc/quad/Makefile.inc#3 (text+ko) ====
@@ -2,9 +2,9 @@
# $FreeBSD: src/lib/libc/quad/Makefile.inc,v 1.9 2002/11/18 09:50:56 ru Exp $
# Quad support, if needed
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/quad ${.CURDIR}/quad
+.PATH: ${LIBCSRC}/${TARGET}/quad ${LIBCSRC}/quad
-.if ${MACHINE_ARCH} == "i386"
+.if ${TARGET} == "i386"
SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c
==== //depot/projects/hammer/lib/libc/regex/Makefile.inc#3 (text+ko) ====
@@ -2,7 +2,7 @@
# $FreeBSD: src/lib/libc/regex/Makefile.inc,v 1.7 2002/11/18 09:50:56 ru Exp $
# regex sources
-.PATH: ${.CURDIR}/regex
+.PATH: ${LIBCSRC}/regex
CFLAGS+=-DPOSIX_MISTAKE
==== //depot/projects/hammer/lib/libc/regex/grot/Makefile#2 (text+ko) ====
@@ -5,7 +5,7 @@
# Do not take -DPOSIX_MISTAKE out. REGCFLAGS isn't important to you (it's
# for my use in some special contexts).
-PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include
+PATHS= ${LIBCSRC}/.. ${LIBCSRC}/../../locale ${LIBCSRC}/../../../../include
.PATH: ${PATHS}
CFLAGS+= -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS)
==== //depot/projects/hammer/lib/libc/rpc/Makefile.inc#6 (text+ko) ====
@@ -1,7 +1,7 @@
# @(#)Makefile 5.11 (Berkeley) 9/6/90
# $FreeBSD: src/lib/libc/rpc/Makefile.inc,v 1.26 2004/01/11 17:14:54 ru Exp $
-.PATH: ${.CURDIR}/rpc ${.CURDIR}/.
+.PATH: ${LIBCSRC}/rpc ${LIBCSRC}/.
SRCS+= auth_none.c auth_unix.c authunix_prot.c bindresvport.c clnt_bcast.c \
clnt_dg.c clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c \
clnt_vc.c rpc_dtablesize.c getnetconfig.c getnetpath.c getrpcent.c \
@@ -26,7 +26,7 @@
SRCS+= crypt_clnt.c crypt_xdr.c crypt.h
CFLAGS+= -DBROKEN_DES -DPORTMAP -DDES_BUILTIN
-CFLAGS+= -I${.CURDIR}/rpc
+CFLAGS+= -I${LIBCSRC}/rpc
CLEANFILES+= crypt_clnt.c crypt_xdr.c crypt.h
==== //depot/projects/hammer/lib/libc/sparc64/fpu/Makefile.inc#3 (text+ko) ====
@@ -1,8 +1,8 @@
# $FreeBSD: src/lib/libc/sparc64/fpu/Makefile.inc,v 1.5 2002/11/18 09:50:56 ru Exp $
-.PATH: ${.CURDIR}/sparc64/fpu
+.PATH: ${LIBCSRC}/sparc64/fpu
-CFLAGS+= -I${.CURDIR}/sparc64/sys
+CFLAGS+= -I${LIBCSRC}/sparc64/sys
SRCS+= fpu.c fpu_add.c fpu_compare.c fpu_div.c fpu_explode.c fpu_implode.c \
fpu_mul.c fpu_qp.c fpu_reg.S fpu_sqrt.c fpu_subr.c
==== //depot/projects/hammer/lib/libc/sparc64/sys/Makefile.inc#4 (text+ko) ====
@@ -10,7 +10,7 @@
__sparc_utrap_setup.c \
sigcode.S
-CFLAGS+= -I${.CURDIR}/sparc64/fpu
+CFLAGS+= -I${LIBCSRC}/sparc64/fpu
MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction.S
==== //depot/projects/hammer/lib/libc/stdio/Makefile.inc#10 (text+ko) ====
@@ -2,7 +2,7 @@
# $FreeBSD: src/lib/libc/stdio/Makefile.inc,v 1.32 2003/01/10 06:22:28 tjr Exp $
# stdio sources
-.PATH: ${.CURDIR}/stdio
+.PATH: ${LIBCSRC}/stdio
SRCS+= _flock_stub.c asprintf.c clrerr.c fclose.c fdopen.c feof.c ferror.c \
fflush.c fgetc.c fgetln.c fgetpos.c fgets.c fgetwc.c fgetws.c \
==== //depot/projects/hammer/lib/libc/stdlib/Makefile.inc#10 (text+ko) ====
@@ -2,7 +2,7 @@
# $FreeBSD: src/lib/libc/stdlib/Makefile.inc,v 1.47 2004/02/24 08:07:26 ache Exp $
# machine-independent stdlib sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/stdlib ${.CURDIR}/stdlib
+.PATH: ${LIBCSRC}/${TARGET}/stdlib ${LIBCSRC}/stdlib
MISRCS+=_Exit.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
bsearch.c calloc.c div.c exit.c getenv.c getopt.c getopt_long.c \
@@ -14,8 +14,8 @@
system.c tdelete.c tfind.c tsearch.c twalk.c
# machine-dependent stdlib sources
-.if exists(${.CURDIR}/${MACHINE_ARCH}/stdlib/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/stdlib/Makefile.inc"
+.if exists(${LIBCSRC}/${TARGET}/stdlib/Makefile.inc)
+.include "${LIBCSRC}/${TARGET}/stdlib/Makefile.inc"
.endif
MAN+= abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \
==== //depot/projects/hammer/lib/libc/stdtime/Makefile.inc#3 (text+ko) ====
@@ -1,7 +1,7 @@
# Makefile.inc,v 1.2 1994/09/13 21:26:01 wollman Exp
# $FreeBSD: src/lib/libc/stdtime/Makefile.inc,v 1.14 2002/11/18 09:50:56 ru Exp $
-.PATH: ${.CURDIR}/stdtime ${.CURDIR}/../locale
+.PATH: ${LIBCSRC}/stdtime ${LIBCSRC}/../locale
SRCS+= asctime.c difftime.c localtime.c strftime.c strptime.c timelocal.c \
time32.c
==== //depot/projects/hammer/lib/libc/string/Makefile.inc#7 (text+ko) ====
@@ -1,9 +1,9 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD: src/lib/libc/string/Makefile.inc,v 1.34 2004/01/13 16:05:47 des Exp $
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/string ${.CURDIR}/string
+.PATH: ${LIBCSRC}/${TARGET}/string ${LIBCSRC}/string
-CFLAGS+= -I${.CURDIR}/locale
+CFLAGS+= -I${LIBCSRC}/locale
# machine-independent string sources
MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffsl.c fls.c flsl.c index.c memccpy.c \
@@ -22,8 +22,8 @@
# machine-dependent string sources
-.if exists(${.CURDIR}/${MACHINE_ARCH}/string/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/string/Makefile.inc"
+.if exists(${LIBCSRC}/${TARGET}/string/Makefile.inc)
+.include "${LIBCSRC}/${TARGET}/string/Makefile.inc"
.endif
MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \
==== //depot/projects/hammer/lib/libc/sys/Makefile.inc#12 (text+ko) ====
@@ -2,19 +2,19 @@
# $FreeBSD: src/lib/libc/sys/Makefile.inc,v 1.109 2004/01/14 21:22:10 ru Exp $
# sys sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/sys ${.CURDIR}/sys
+.PATH: ${LIBCSRC}/${TARGET}/sys ${LIBCSRC}/sys
# Include the generated makefile containing the *complete* list
# of syscall names in MIASM.
-.include "${.CURDIR}/../../sys/sys/syscall.mk"
+.include "${LIBCSRC}/../../sys/sys/syscall.mk"
# Include machine dependent definitions.
#
# MDASM names override the default syscall names in MIASM.
# NOASM will prevent the default syscall code from being generated.
#
-.if exists(${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc"
+.if exists(${LIBCSRC}/${TARGET}/sys/Makefile.inc)
+.include "${LIBCSRC}/${TARGET}/sys/Makefile.inc"
.endif
# Sources common to both syscall interfaces:
==== //depot/projects/hammer/lib/libc/uuid/Makefile.inc#3 (text+ko) ====
@@ -2,7 +2,7 @@
# DCE 1.1 UUID implementation sources
-.PATH: ${.CURDIR}/uuid
+.PATH: ${LIBCSRC}/uuid
SRCS+= uuid_compare.c uuid_create.c uuid_create_nil.c uuid_equal.c \
uuid_from_string.c uuid_hash.c uuid_is_nil.c uuid_to_string.c
==== //depot/projects/hammer/lib/libc/xdr/Makefile.inc#4 (text+ko) ====
@@ -1,7 +1,7 @@
# @(#)Makefile 5.11 (Berkeley) 9/6/90
# $FreeBSD: src/lib/libc/xdr/Makefile.inc,v 1.14 2002/11/18 09:50:57 ru Exp $
-.PATH: ${.CURDIR}/xdr ${.CURDIR}/.
+.PATH: ${LIBCSRC}/xdr ${LIBCSRC}/.
SRCS+= xdr.c xdr_array.c xdr_float.c xdr_mem.c \
xdr_rec.c xdr_reference.c xdr_stdio.c
==== //depot/projects/hammer/lib/libc/yp/Makefile.inc#3 (text+ko) ====
@@ -2,7 +2,7 @@
# $FreeBSD: src/lib/libc/yp/Makefile.inc,v 1.9 2002/11/18 09:50:57 ru Exp $
# yp sources
-.PATH: ${.CURDIR}/yp
+.PATH: ${LIBCSRC}/yp
SRCS+= xdryp.c yp.h yp_xdr.c yplib.c
CLEANFILES+= yp.h yp_xdr.c
==== //depot/projects/hammer/libexec/Makefile#20 (text+ko) ====
@@ -26,6 +26,7 @@
rpc.sprayd \
rshd \
${_rtld-elf} \
+ ${_rtld-elf32} \
save-entropy \
${_smrsh} \
talkd \
@@ -40,6 +41,9 @@
.if !defined(NOPIC)
_rtld-elf= rtld-elf
+.if ${MACHINE_ARCH} == "amd64"
+_rtld-elf32= rtld-elf32
+.endif
.endif
.if !defined(NO_SENDMAIL)
==== //depot/projects/hammer/libexec/rtld-elf/Makefile#8 (text+ko) ====
@@ -1,12 +1,14 @@
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.25 2003/09/13 21:50:35 mdodd Exp $
-PROG= ld-elf.so.1
+PROG?= ld-elf.so.1
SRCS= rtld_start.S rtld.c rtld_lock.c map_object.c malloc.c \
xmalloc.c debug.c reloc.c libmap.c
MAN= rtld.1
CSTD?= gnu99
+TARGET?= ${MACHINE_ARCH}
+RTLDSRC?= ${.CURDIR}
CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD
-CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
+CFLAGS+= -I${RTLDSRC}/${TARGET} -I${RTLDSRC}
LDFLAGS+= -nostdlib -e .rtld_start
INSTALLFLAGS= -fschg -C -b
BINDIR= /libexec
@@ -14,8 +16,8 @@
MLINKS= rtld.1 ld-elf.so.1.1 \
rtld.1 ld.so.1
-.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
+.if exists(${RTLDSRC}/${TARGET}/Makefile.inc)
+.include "${RTLDSRC}/${TARGET}/Makefile.inc"
.endif
# If LDSCRIPT is defined, we build the dynamic linker as an
@@ -48,6 +50,6 @@
beforeinstall:
-chflags noschg ${DESTDIR}/usr/libexec/${PROG}
-.PATH: ${.CURDIR}/${MACHINE_ARCH}
+.PATH: ${RTLDSRC} ${RTLDSRC}/${TARGET}
.include <bsd.prog.mk>
==== //depot/projects/hammer/libexec/rtld-elf/debug.h#2 (text+ko) ====
@@ -50,10 +50,17 @@
#define dbg(format, args...) ((void) 0)
#endif
+#ifndef COMPAT_32BIT
+#define _MYNAME "ld-elf.so.1"
+#else
+#define _MYNAME "ld-elf32.so.1"
+#endif
+
#define assert(cond) ((cond) ? (void) 0 : \
- (msg("ld-elf.so.1: assert failed: " __FILE__ ":" \
+ (msg(_MYNAME ": assert failed: " __FILE__ ":" \
__XSTRING(__LINE__) "\n"), abort()))
#define msg(s) write(STDOUT_FILENO, s, strlen(s))
-#define trace() msg("ld-elf.so.1: " __XSTRING(__LINE__) "\n")
+#define trace() msg(_MYNAME ": " __XSTRING(__LINE__) "\n")
+
#endif /* DEBUG_H */
==== //depot/projects/hammer/libexec/rtld-elf/libmap.c#11 (text+ko) ====
@@ -17,6 +17,11 @@
#define _PATH_LIBMAP_CONF "/etc/libmap.conf"
#endif
+#ifdef COMPAT_32BIT
+#undef _PATH_LIBMAP_CONF
+#define _PATH_LIBMAP_CONF "/etc/libmap32.conf"
+#endif
+
TAILQ_HEAD(lm_list, lm);
struct lm {
char *f;
@@ -211,6 +216,27 @@
return (NULL);
}
+#ifdef COMPAT_32BIT
+char *
+lm_findn (const char *p, const char *f, const int n)
+{
+ char pathbuf[64], *s, *t;
+
+ if (n < sizeof(pathbuf) - 1) {
+ memcpy(pathbuf, f, n);
+ pathbuf[n] = '\0';
+ s = pathbuf;
+ } else {
+ s = xmalloc(n + 1);
+ strcpy(s, f);
+ }
+ t = lm_find(p, s);
+ if (s != pathbuf)
+ free(s);
+ return (t);
+}
+#endif
+
static char *
lml_find (struct lm_list *lmh, const char *f)
{
@@ -219,8 +245,7 @@
dbg("%s(%p, \"%s\")", __func__, lmh, f);
TAILQ_FOREACH(lm, lmh, lm_link)
- if ((strncmp(f, lm->f, strlen(lm->f)) == 0) &&
- (strlen(f) == strlen(lm->f)))
+ if (strcmp(f, lm->f) == 0)
return (lm->t);
return NULL;
}
@@ -233,8 +258,7 @@
dbg("%s(\"%s\")", __func__, n);
TAILQ_FOREACH(lmp, &lmp_head, lmp_link)
- if ((strncmp(n, lmp->p, strlen(lmp->p)) == 0) &&
- (strlen(n) == strlen(lmp->p)))
+ if (strcmp(n, lmp->p) == 0)
return (&lmp->lml);
return (NULL);
}
==== //depot/projects/hammer/libexec/rtld-elf/libmap.h#3 (text+ko) ====
@@ -5,3 +5,6 @@
int lm_init (void);
void lm_fini (void);
char * lm_find (const char *, const char *);
+#ifdef COMPAT_32BIT
+char * lm_findn (const char *, const char *, const int);
+#endif
==== //depot/projects/hammer/libexec/rtld-elf/rtld.c#17 (text+ko) ====
@@ -54,7 +54,11 @@
#include "rtld.h"
#include "libmap.h"
+#ifndef COMPAT_32BIT
#define PATH_RTLD "/libexec/ld-elf.so.1"
+#else
+#define PATH_RTLD "/libexec/ld-elf32.so.1"
+#endif
/* Types. */
typedef void (*func_ptr_type)();
@@ -261,14 +265,14 @@
trust = !issetugid();
- ld_bind_now = getenv("LD_BIND_NOW");
+ ld_bind_now = getenv(LD_ "BIND_NOW");
if (trust) {
- ld_debug = getenv("LD_DEBUG");
- libmap_disable = getenv("LD_LIBMAP_DISABLE") != NULL;
- ld_library_path = getenv("LD_LIBRARY_PATH");
- ld_preload = getenv("LD_PRELOAD");
+ ld_debug = getenv(LD_ "DEBUG");
+ libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL;
+ ld_library_path = getenv(LD_ "LIBRARY_PATH");
+ ld_preload = getenv(LD_ "PRELOAD");
}
- ld_tracing = getenv("LD_TRACE_LOADED_OBJECTS");
+ ld_tracing = getenv(LD_ "TRACE_LOADED_OBJECTS");
if (ld_debug != NULL && *ld_debug != '\0')
debug = 1;
@@ -360,7 +364,7 @@
exit(0);
}
- if (getenv("LD_DUMP_REL_PRE") != NULL) {
+ if (getenv(LD_ "DUMP_REL_PRE") != NULL) {
dump_relocations(obj_main);
exit (0);
}
@@ -373,7 +377,7 @@
if (do_copy_relocations(obj_main) == -1)
die();
- if (getenv("LD_DUMP_REL_POST") != NULL) {
+ if (getenv(LD_ "DUMP_REL_POST") != NULL) {
dump_relocations(obj_main);
exit (0);
}
@@ -1460,6 +1464,9 @@
static void *
path_enumerate(const char *path, path_enum_proc callback, void *arg)
{
+#ifdef COMPAT_32BIT
+ const char *trans;
+#endif
if (path == NULL)
return (NULL);
@@ -1469,6 +1476,12 @@
char *res;
len = strcspn(path, ":;");
+#ifdef COMPAT_32BIT
+ trans = lm_findn(NULL, path, len);
+ if (trans)
+ res = callback(trans, strlen(trans), arg);
+ else
+#endif
res = callback(path, len, arg);
if (res != NULL)
@@ -2259,16 +2272,16 @@
char *fmt1, *fmt2, *fmt, *main_local, *list_containers;
int c;
- if ((main_local = getenv("LD_TRACE_LOADED_OBJECTS_PROGNAME")) == NULL)
+ if ((main_local = getenv(LD_ "TRACE_LOADED_OBJECTS_PROGNAME")) == NULL)
main_local = "";
- if ((fmt1 = getenv("LD_TRACE_LOADED_OBJECTS_FMT1")) == NULL)
+ if ((fmt1 = getenv(LD_ "TRACE_LOADED_OBJECTS_FMT1")) == NULL)
fmt1 = "\t%o => %p (%x)\n";
- if ((fmt2 = getenv("LD_TRACE_LOADED_OBJECTS_FMT2")) == NULL)
+ if ((fmt2 = getenv(LD_ "TRACE_LOADED_OBJECTS_FMT2")) == NULL)
fmt2 = "\t%o (%x)\n";
- list_containers = getenv("LD_TRACE_LOADED_OBJECTS_ALL");
+ list_containers = getenv(LD_ "TRACE_LOADED_OBJECTS_ALL");
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list