git: 724123b9f4d3 - main - libcompat: Use WORLDTMP sysroot
Date: Fri, 01 Jul 2022 07:33:25 UTC
The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=724123b9f4d3ae7600b029ce7c81b5708c1e13b8 commit 724123b9f4d3ae7600b029ce7c81b5708c1e13b8 Author: Brooks Davis <brooks@FreeBSD.org> AuthorDate: 2022-07-01 07:33:16 +0000 Commit: Brooks Davis <brooks@FreeBSD.org> CommitDate: 2022-07-01 07:33:16 +0000 libcompat: Use WORLDTMP sysroot Now that -m32 is fixed, just install libs in ${WORLDTMP}/lib/lib32 and use the installed headers. Reviewed by: imp, jhb Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D34697 --- Makefile.libcompat | 34 ++++------------------------------ share/mk/bsd.compat.mk | 14 +++++++------- 2 files changed, 11 insertions(+), 37 deletions(-) diff --git a/Makefile.libcompat b/Makefile.libcompat index e1b66f4a6ab2..a1f683c77a49 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -12,7 +12,7 @@ __<${_this:T}>__: LIBCOMPATWMAKEENV+= \ INSTALL="${INSTALL_CMD} -U" \ PATH=${TMPPATH} \ - SYSROOT=${LIBCOMPATTMP} \ + SYSROOT=${WORLDTMP} \ LIBDIR=/usr/lib${libcompat} \ SHLIBDIR=/usr/lib${libcompat} \ DTRACE="${LIB$COMPATDTRACE:U${DTRACE}}" @@ -23,7 +23,7 @@ LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ CXX="${XCXX} ${LIBCOMPATCXXFLAGS} ${LIBCOMPATCFLAGS}" \ CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ - DESTDIR=${LIBCOMPATTMP} \ + DESTDIR=${WORLDTMP} \ -DNO_CPU_CFLAGS \ MK_BOOT=no \ MK_CTF=no \ @@ -62,38 +62,12 @@ build${libcompat}: .PHONY @echo "--------------------------------------------------------------" @echo ">>> stage 4.3: building lib${libcompat} shim libraries" @echo "--------------------------------------------------------------" -.if ${MK_CLEAN} == "yes" - rm -rf ${LIBCOMPATTMP} -.else - ${_+_}@if [ -e "${LIBCOMPATTMP}" ]; then \ - echo ">>> Deleting stale files in build${libcompat} tree..."; \ - cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ - DESTDIR=${LIBCOMPATTMP} \ - delete-old delete-old-libs >/dev/null; \ - fi -.endif # MK_CLEAN == "yes" - - mkdir -p ${LIBCOMPATTMP}/usr/include - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ - -p ${LIBCOMPATTMP}/usr >/dev/null - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ - -p ${LIBCOMPATTMP}/usr/include >/dev/null ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \ - -p ${LIBCOMPATTMP}/usr >/dev/null + -p ${WORLDTMP}/usr >/dev/null .if ${MK_DEBUG_FILES} != "no" - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ - -p ${LIBCOMPATTMP}/usr/lib >/dev/null ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \ - -p ${LIBCOMPATTMP}/usr/lib/debug/usr >/dev/null + -p ${WORLDTMP}/usr/lib/debug/usr >/dev/null .endif - mkdir -p ${WORLDTMP} - ln -sf ${.CURDIR}/sys ${WORLDTMP} -.for _t in ${_obj} includes -.for _dir in ${_LC_INCDIRS} - ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} MK_INCLUDES=yes \ - DIRPRFX=${_dir}/ ${_t} -.endfor -.endfor .for _dir in lib/ncurses/tinfo ${_libmagic} ${_jevents} .for _t in ${_obj} build-tools ${_+_}cd ${.CURDIR}/${_dir}; \ diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk index e99281775b84..db6c82e099d9 100644 --- a/share/mk/bsd.compat.mk +++ b/share/mk/bsd.compat.mk @@ -95,34 +95,34 @@ _LIBCOMPAT:= ${WANT_COMPAT} # Set defaults based on type. libcompat= ${_LIBCOMPAT:tl} _LIBCOMPAT_MAKEVARS= _OBJTOP TMP CPUFLAGS CFLAGS CXXFLAGS LDFLAGS \ - _MACHINE _MACHINE_ARCH WMAKEENV WMAKEFLAGS WMAKE + _MACHINE _MACHINE_ARCH \ + WMAKEENV WMAKEFLAGS WMAKE WORLDTMP .for _var in ${_LIBCOMPAT_MAKEVARS} .if !empty(LIB${_LIBCOMPAT}${_var}) LIBCOMPAT${_var}?= ${LIB${_LIBCOMPAT}${_var}} .endif .endfor +WORLDTMP?= ${SYSROOT} + # Shared flags LIBCOMPAT_OBJTOP?= ${OBJTOP}/obj-lib${libcompat} -LIBCOMPATTMP?= ${LIBCOMPAT_OBJTOP}/tmp LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ - --sysroot=${LIBCOMPATTMP} \ + --sysroot=${WORLDTMP} \ ${BFLAGS} -LIBCOMPATLDFLAGS+= -L${LIBCOMPATTMP}/usr/lib${libcompat} +LIBCOMPATLDFLAGS+= -L${WORLDTMP}/usr/lib${libcompat} LIBCOMPATWMAKEENV+= MACHINE=${LIBCOMPAT_MACHINE} LIBCOMPATWMAKEENV+= MACHINE_ARCH=${LIBCOMPAT_MACHINE_ARCH} # -B is needed to find /usr/lib32/crti.o for gcc. -LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} +LIBCOMPATCFLAGS+= -B${WORLDTMP}/usr/lib${libcompat} .if defined(WANT_COMPAT) LIBDIR_BASE:= /usr/lib${libcompat} _LIB_OBJTOP= ${LIBCOMPAT_OBJTOP} -LIBDESTDIR:= ${LIBCOMPATTMP} -SYSROOT:= ${LIBCOMPATTMP} CFLAGS+= ${LIBCOMPATCFLAGS} LDFLAGS+= ${CFLAGS} ${LIBCOMPATLDFLAGS} MACHINE= ${LIBCOMPAT_MACHINE}