From 7be46fbdfdf4fd3d01bbdee1f9b4e6c79da3a4eb Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Fri, 7 Aug 2015 23:45:32 +0000 Subject: Define libavl in src.libnames.mk --- share/mk/src.libnames.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 4db46ab8da72..dc51ed847e9b 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -57,6 +57,7 @@ _LIBRARIES= \ archive \ asn1 \ auditd \ + avl \ begemot \ bluetooth \ bsdxml \ -- cgit v1.2.3 From 61c20fc78239a66440b69ac90b2a1d68f079f671 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 15 Oct 2015 22:49:56 +0000 Subject: Make installing to a non-existent directory an error. Before this, if a file was installed to DESTDIR/some/dir and that directory was missing due to not having ran 'make distrib-dirs' yet, the file would be installed as 'some/dir'. For something like bsd.incs.mk with INCLUDEDIR being a sub-directory of /usr/include, this could result in all of the headers being installed to a file rather than getting a directory of them. Now it will error that the file/directory does not exist rather than hide the issue. Another option being discussed is to implement GNU's install -D flag which would auto create any missing directories. This is a mitigation of the problem. The proper order to the build is to run 'make distrib-dirs' first, but that can be forgotten if building from a sub-directory after updating the source code to the latest revision. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.confs.mk | 2 +- share/mk/bsd.files.mk | 2 +- share/mk/bsd.incs.mk | 2 +- share/mk/bsd.info.mk | 4 ++-- share/mk/bsd.lib.mk | 14 +++++++------- share/mk/bsd.man.mk | 4 ++-- share/mk/bsd.prog.mk | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index 0750a4e4fa57..36298d7da02f 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -69,7 +69,7 @@ _${group}INS: ${_${group}CONFS} ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} .else ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ - ${.ALLSRC} ${DESTDIR}${${group}DIR} + ${.ALLSRC} ${DESTDIR}${${group}DIR}/ .endif .endif diff --git a/share/mk/bsd.files.mk b/share/mk/bsd.files.mk index b9379d92b59a..6a6c66a682ff 100644 --- a/share/mk/bsd.files.mk +++ b/share/mk/bsd.files.mk @@ -75,7 +75,7 @@ _${group}INS: ${_${group}FILES} ${DESTDIR}${${group}DIR}/${${group}NAME} .else ${INSTALL} -o ${${group}OWN} -g ${${group}GRP} \ - -m ${${group}MODE} ${.ALLSRC} ${DESTDIR}${${group}DIR} + -m ${${group}MODE} ${.ALLSRC} ${DESTDIR}${${group}DIR}/ .endif .endif diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk index e1398c95dcd1..8ea97ba14fc8 100644 --- a/share/mk/bsd.incs.mk +++ b/share/mk/bsd.incs.mk @@ -70,7 +70,7 @@ _${group}INS: ${_${group}INCS} ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} .else ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ - ${.ALLSRC} ${DESTDIR}${${group}DIR} + ${.ALLSRC} ${DESTDIR}${${group}DIR}/ .endif .endif diff --git a/share/mk/bsd.info.mk b/share/mk/bsd.info.mk index 8f9131585419..7720d286d3b5 100644 --- a/share/mk/bsd.info.mk +++ b/share/mk/bsd.info.mk @@ -177,11 +177,11 @@ CLEANFILES+= ${INFO:S/$/.info.*.html/} ${INFO:S/$/.info/} install: ${INSTALLINFODIRS} .if !empty(IFILES:N*.html) ${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \ - ${IFILES:N*.html} ${DESTDIR}${INFODIR} + ${IFILES:N*.html} ${DESTDIR}${INFODIR}/ .endif .if !empty(FORMATS:Mhtml) ${INSTALL} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \ - ${INFO:S/$/.info.*.html/} ${DESTDIR}${INFODIR} + ${INFO:S/$/.info.*.html/} ${DESTDIR}${INFODIR}/ .endif .else # The indirection in the following is to avoid the null install rule diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 0ed83454ebf0..8c8a0141e186 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -339,23 +339,23 @@ realinstall: _libinstall _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR} + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}/ .endif .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR} + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR}/ .endif .if defined(SHLIB_NAME) ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ - ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR} + ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ .if ${MK_DEBUG_FILES} != "no" .if defined(DEBUGMKDIR) - ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR} + ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR}/ .endif ${INSTALL} -T debug -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ ${_INSTALLFLAGS} \ - ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR} + ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/ .endif .if defined(SHLIB_LINK) .if commands(${SHLIB_LINK:R}.ld) @@ -378,11 +378,11 @@ _libinstall: .endif # SHIB_NAME .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR} + ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/ .endif .if defined(WANT_LINT) && !defined(NO_LINT) && defined(LIB) && !empty(LIB) ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR} + ${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR}/ .endif .endif # !defined(INTERNALLIB) diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index bbb47b9df933..72aedfb5423e 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -187,7 +187,7 @@ _maninstall: ${MAN} .endfor .else .for _page _sect in ${.ALLSRC:C/\.([^.]*)$/.\1 \1/} - @d=${DESTDIR}${MANDIR}${_sect}${MANSUBDIR}; \ + @d=${DESTDIR}${MANDIR}${_sect}${MANSUBDIR}/; \ ${ECHO} ${MINSTALL} ${_page} $${d}; \ ${MINSTALL} $${page} $${d}; .endfor @@ -201,7 +201,7 @@ _maninstall: ${MAN} .else .for __page in ${MAN} ${MINSTALL} ${__page:T:S/$/${MCOMPRESS_EXT}/g} \ - ${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR} + ${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}/ .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) ${MINSTALL} ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} \ ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T:S/$/${MCOMPRESS_EXT}/} diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index dea7661eab8c..fbb6922f7f61 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -205,7 +205,7 @@ _proginstall: ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME} .if ${MK_DEBUG_FILES} != "no" .if defined(DEBUGMKDIR) - ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR} + ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR}/ .endif ${INSTALL} -T debug -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug -- cgit v1.2.3 From 29f297420d1d13397be29b8eeec7020572287899 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 16 Oct 2015 05:06:43 +0000 Subject: Similar to r289355, /usr/tests is within the base system so put the symbols into /usr/lib/debug. This covers some missing files: /usr/tests/libexec/rtld-elf/.debug /usr/tests/libexec/rtld-elf/.debug/libpythagoras.so.0.debug /usr/tests/lib/libc/tls/.debug /usr/tests/lib/libc/tls/.debug/libh_tls_dynamic.so.1.debug /usr/tests/lib/libc/tls/.debug/h_tls_dlopen.so.debug /usr/tests/lib/libthr/dlopen/.debug /usr/tests/lib/libthr/dlopen/.debug/h_pthread_dlopen.so.1.debug /usr/tests/lib/libxo/.debug /usr/tests/lib/libxo/.debug/libenc_test.so.debug Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 8c8a0141e186..e906ab7e83a6 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -140,7 +140,7 @@ SHLIB_NAME_FULL=${SHLIB_NAME}.full # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory .if ${_SHLIBDIR} == "/boot" ||\ ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\ - ${SHLIBDIR:C%/usr/lib(32)?(/.*)?%/usr/lib%} == "/usr/lib" + ${SHLIBDIR:C%/usr/(tests/)?lib(32|exec)?(/.*)?%/usr/lib%} == "/usr/lib" DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR} .else DEBUGFILEDIR=${_SHLIBDIR}/.debug -- cgit v1.2.3 From 56585ab576ff9265a9c0f44b6d4986eb4f5461e3 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 17 Oct 2015 16:42:54 +0000 Subject: Rework the 'make -n -n' feature such that '-n' recurses and '-N' does not. Bmake has a documented feature of '-N' to skip executing commands which is specifically intended for debugging top-level builds and not recursing into sub-directories. This matches the older 'make -n' behavior we added which made '-n -n' the recursing target and '-n' a non-recursing target. Removing the '-n -n' feature allows the build to work as documented in the bmake manpage with '-n' and '-N'. The older '-n -n' feature was also not documented anywhere that I could see. Note that the ${_+_} var is still needed as currently bmake incorrectly executes '+' commands when '-N' is specified. The '-n' and '-n -n' features were broken for several reasons prior to this. r251748 made '_+_' never expand with '-n -n' which resulted in many sub-directories not being visited until fixed 2 years later in r288391, and many targets were given .MAKE over the past few years which resulted in non-sub-make commands, such as rm and ln and mtree, to be executed. This should also allow removing some indirection hacks in bsd.subdir.mk and other cases of .USE that have a .MAKE by using '+'. Sponsored by: EMC / Isilon Storage Division Discussed on: arch@ (mostly silence) --- share/mk/sys.mk | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'share/mk') diff --git a/share/mk/sys.mk b/share/mk/sys.mk index e8f4892cd99d..b6c75b6f96a6 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -145,13 +145,12 @@ ECHODIR ?= true .endif .endif -.if defined(.PARSEDIR) -# _+_ appears to be a workaround for the special src .MAKE not working. -# setting it to + interferes with -N -_+_ ?= -.elif !empty(.MAKEFLAGS:M-n) && ${.MAKEFLAGS:M-n} == "-n" -# the check above matches only a single -n, so -n -n will result -# in _+_ = + +.if ${.MAKEFLAGS:M-N} +# bmake -N is supposed to skip executing anything but it does not skip +# exeucting '+' commands. The '+' feature is used where .MAKE +# is not safe for the entire target. -N is intended to skip building sub-makes +# so it executing '+' commands is not right. Work around the bug by not +# setting '+' when -N is used. _+_ ?= .else _+_ ?= + -- cgit v1.2.3 From 835f328986d614c3448fc69b179b836aa0fa70de Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sat, 17 Oct 2015 19:48:17 +0000 Subject: Only use -fstack-protector-strong with supported compilers This includes clang 3.5.0+, gcc 4.2.1, gcc 4.8.4+ This allows me to do subdirectory makes again after setting MAKESYSPATH on 10.2-RELEASE as it comes with clang 3.4.1. As a sidenote: this isn't technically correct for all vintages of gcc 4.2.1, but will be correct when gcc is rebuilt/reinstalled after r286074, so this version check should be good enough. X-MFC with: r288669 Differential Revision: https://reviews.freebsd.org/D3924 Reviewed by: emaste, pfg --- share/mk/bsd.sys.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index d5a469676d41..68351a0d22a7 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -148,9 +148,13 @@ CXXFLAGS.clang+= -Wno-c++11-extensions .if ${MK_SSP} != "no" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" +.if (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30500) || \ + (${COMPILER_TYPE} == "gcc" && \ + (${COMPILER_VERSION} == 40201 || ${COMPILER_VERSION} >= 40800)) # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?= -fstack-protector-strong CFLAGS+= ${SSP_CFLAGS} +.endif .endif # SSP && !ARM && !MIPS # Allow user-specified additional warning flags, plus compiler specific flag overrides. -- cgit v1.2.3 From a52bef9c993522519108110a9c347cca4f37eee3 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 18 Oct 2015 04:07:40 +0000 Subject: Only enable -fstack-protector-strong on gcc 4.9+ and default to -fstack-protector when -fstack-protector-strong is not available, like it was implicitly before r288669 As noted by antoine@, devel/gcc (which is 4.8.5) lacks -fstack-protector-strong support, whereas 4.8.4i (devel/gcc48) has the support. Until a version is available which has -fstack-protector-strong support, be conservative and only enable support with 4.9+. Reviewed by: pfg X-MFC with: r288669, r289465 Differential Revision: https://reviews.freebsd.org/D3924 --- share/mk/bsd.sys.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 68351a0d22a7..cad2b2f79645 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -150,11 +150,13 @@ CXXFLAGS.clang+= -Wno-c++11-extensions ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" .if (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30500) || \ (${COMPILER_TYPE} == "gcc" && \ - (${COMPILER_VERSION} == 40201 || ${COMPILER_VERSION} >= 40800)) + (${COMPILER_VERSION} == 40201 || ${COMPILER_VERSION} >= 40900)) # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?= -fstack-protector-strong -CFLAGS+= ${SSP_CFLAGS} +.else +SSP_CFLAGS?= -fstack-protector .endif +CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !ARM && !MIPS # Allow user-specified additional warning flags, plus compiler specific flag overrides. -- cgit v1.2.3 From 550d2b80ec3c504b41ade3a7aed379eb32c68418 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 18 Oct 2015 07:30:50 +0000 Subject: Make libxo depend on libutil because it uses humanize_number after r287111 Remove overlinking in lib/libxo/tests, sbin/savecore, and usr.bin/{iscsictl,wc,xo} PR: 203673 Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index e3d5baecaa29..06e451bdfa22 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -239,6 +239,7 @@ _DP_vmmapi= util _DP_ctf= z _DP_proc= rtld_db util _DP_dtrace= rtld_db pthread +_DP_xo= util # Define spacial cases LDADD_supcplusplus= -lsupc++ -- cgit v1.2.3 From e92818f2e6b4280e8d275f48dfc95fa48ced1a2c Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 19 Oct 2015 22:27:32 +0000 Subject: Add missing .PHONY for parallel subdir target. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 037a7fec37ab..9624a11a689a 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -102,7 +102,7 @@ __deps= .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${__dep} .endfor -${__target}_subdir_${__dir}: .MAKE ${__deps} +${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) @${_+_}if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \ -- cgit v1.2.3 From 65d88005efc7fa1fdbad7f368346411107015c84 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 19 Oct 2015 23:34:35 +0000 Subject: Replace all of the duplicated logic for recursing into a subdir with one implementation. It is duplicated at run-time but is more easily maintainable now. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 47 +++++++++++++++++------------------------------ 1 file changed, 17 insertions(+), 30 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 9624a11a689a..10a301684033 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -63,30 +63,25 @@ distribute: .MAKE .endfor .endif +# Subdir code shared among 'make ', 'make ' and SUBDIR_PARALLEL. +_SUBDIR_SH= \ + if test -d ${.CURDIR}/$${dir}.${MACHINE_ARCH}; then \ + dir=$${dir}.${MACHINE_ARCH}; \ + fi; \ + ${ECHODIR} "===> ${DIRPRFX}$${dir} ($${target})"; \ + cd ${.CURDIR}/$${dir}; \ + ${MAKE} $${target} DIRPRFX=${DIRPRFX}$${dir}/ + _SUBDIR: .USE .MAKE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}for entry in ${SUBDIR:N.WAIT}; do \ - if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ - ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ - edir=$${entry}.${MACHINE_ARCH}; \ - cd ${.CURDIR}/$${edir}; \ - else \ - ${ECHODIR} "===> ${DIRPRFX}$$entry (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ - edir=$${entry}; \ - cd ${.CURDIR}/$${edir}; \ - fi; \ - ${MAKE} ${.TARGET:S,realinstall,install,:S,^_sub.,,} \ - DIRPRFX=${DIRPRFX}$$edir/; \ - done + @${_+_}target=${.TARGET:S,realinstall,install,:S,^_sub.,,}; \ + for dir in ${SUBDIR:N.WAIT}; do ${_SUBDIR_SH}; done .endif ${SUBDIR:N.WAIT}: .PHONY .MAKE - ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ - cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ - else \ - cd ${.CURDIR}/${.TARGET}; \ - fi; \ - ${MAKE} all + ${_+_}@target=all; \ + dir=${.TARGET}; \ + ${_SUBDIR_SH}; # Work around parsing of .if nested in .for by putting .WAIT string into a var. __wait= .WAIT @@ -104,17 +99,9 @@ __deps+= ${__target}_subdir_${__dep} .endfor ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) - @${_+_}if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ - ${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \ - edir=${__dir}.${MACHINE_ARCH}; \ - cd ${.CURDIR}/$${edir}; \ - else \ - ${ECHODIR} "===> ${DIRPRFX}${__dir} (${__target:realinstall=install})"; \ - edir=${__dir}; \ - cd ${.CURDIR}/$${edir}; \ - fi; \ - ${MAKE} ${__target:realinstall=install} \ - DIRPRFX=${DIRPRFX}$$edir/ + @${_+_}target=${__target:realinstall=install}; \ + dir=${__dir}; \ + ${_SUBDIR_SH}; .endif .endif .endfor -- cgit v1.2.3 From 16a5c008cc080c91c0f471e04e44895a0fa6ba81 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 20 Oct 2015 20:15:25 +0000 Subject: Pass COMPILER_TYPE and COMPILER_VERSION to sub-makes to avoid redundant lookups. This uses a special variable name based on a hash of ${CC}, ${PATH}, and ${MACHINE} to ensure that a cached value is not used if any of these values changes to use a new compiler. Before this there were 34,620 fork/exec from bsd.compiler.mk during a buildworld. After this there are 608. More improvement is needed to cache a value from the top-level before descending into subdirs in the various build phases. Reviewed by: brooks (earlier version) MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3898 --- share/mk/bsd.compiler.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index dcdf5987b501..46cc8c37d198 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -25,6 +25,18 @@ .if !target(____) ____: +# Try to import COMPILER_TYPE and COMPILER_VERSION from parent make. +# The value is only used/exported for the same environment that impacts +# CC and COMPILER_* settings here. +_exported_vars= COMPILER_TYPE COMPILER_VERSION +_cc_hash= ${CC}${MACHINE}${PATH} +_cc_hash:= ${_cc_hash:hash} +.for var in ${_exported_vars} +.if defined(${var}.${_cc_hash}) +${var}= ${${var}.${_cc_hash}} +.endif +.endfor + .if ${MACHINE} == "common" # common is a pseudo machine for architecture independent # generated files - thus there is no compiler. @@ -54,6 +66,14 @@ COMPILER_VERSION!=echo ${_v:M[1-9].[0-9]*} | awk -F. '{print $$1 * 10000 + $$2 * .undef _v .endif +# Export the values so sub-makes don't have to look them up again, using the +# hash key computed above. +.for var in ${_exported_vars} +${var}.${_cc_hash}:= ${${var}} +.export-env ${var}.${_cc_hash} +.undef ${var}.${_cc_hash} +.endfor + .if ${COMPILER_TYPE} == "clang" || \ (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800) COMPILER_FEATURES= c++11 -- cgit v1.2.3 From 13569c0ae5d518d04c3f4795876853803761fbf2 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 20 Oct 2015 20:37:00 +0000 Subject: Improve safety of caching from r289659 by only importing of none of the variables are already set. This should cover odd cases such as the COMPILER_TYPE override in lib/csu/powerpc64. X-MFC-With: r289659 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.compiler.mk | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 46cc8c37d198..3ba5130b81f3 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -31,11 +31,20 @@ ____: _exported_vars= COMPILER_TYPE COMPILER_VERSION _cc_hash= ${CC}${MACHINE}${PATH} _cc_hash:= ${_cc_hash:hash} +# Only import if none of the vars are set somehow else. +_can_export= yes +.for var in ${_exported_vars} +.if defined(${var}) +_can_export= no +.endif +.endfor +.if ${_can_export} == yes .for var in ${_exported_vars} .if defined(${var}.${_cc_hash}) ${var}= ${${var}.${_cc_hash}} .endif .endfor +.endif .if ${MACHINE} == "common" # common is a pseudo machine for architecture independent -- cgit v1.2.3 From 5d6be39a4bce29c0628ba8158bdfecc7deb5b6ff Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 21 Oct 2015 00:25:18 +0000 Subject: Fix building in a directory with SUBDIRs and SUBDIR_PARALLEL. The SUBDIR_PARALLEL feature uses a .for dir in ${SUBDIR} loop. The old code here for recursing was setting SUBDIR= as a make *argument*. The SUBDIR= replacement was not actually handled until after the .for loop was unrolled. This could be seen with a '.info ${SUBDIR} ${dir}' inside of the loop which showed an empty ${SUBDIR} and a set ${dir}. Setting NO_SUBIDR= before calling ${MAKE} as an *environment* variable handles the case fine and is a more proper mechanism for disabling subdir handling. This could be seen with 'make -C tests/sys/kern -j15 SUBDIR_PARALLEL=yes'. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.progs.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index 2da30c70ebb5..dce05c7d7bda 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -116,16 +116,16 @@ x.$p= PROG_CXX=$p $p ${p}_p: .PHONY .MAKE (cd ${.CURDIR} && \ DEPENDFILE=.depend.$p \ - ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ - SUBDIR= PROG=$p ${x.$p}) + NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + PROG=$p ${x.$p}) # Pseudo targets for PROG, such as 'install'. .for t in ${PROGS_TARGETS:O:u} $p.$t: .PHONY .MAKE (cd ${.CURDIR} && \ DEPENDFILE=.depend.$p \ - ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ - SUBDIR= PROG=$p ${x.$p} ${@:E}) + NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + PROG=$p ${x.$p} ${@:E}) .endfor .endfor -- cgit v1.2.3 From 7f5f4b449db4992513bd07cc016cf86b6f55e04f Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 21 Oct 2015 16:24:44 +0000 Subject: Remove indirection of _sub target for using _SUBDIR. This reverts r266473 as the need for it, working around .MAKE and '+' issues, is no longer needed after r289460. This avoids extra log output in -j builds of '-- _sub.TARGET --' that are redundant with the '-- TARGET --' and '-- TARGET_subdir_DIR --' entries already showing. r266473 also made a subtle change in the ordering of _SUBDIR handling. Before the change, SUBDIRS were recursed into after building the TARGET due to the .USE of _SUBDIR *appending* the commands onto the TARGET. After the change though the indirection caused TARGET to depend on _sub.TARGET which had the _SUBDIR handling in it. This TARGET would run after recursing. However, the SUBDIR_PARALLEL handling from r263778 has this ordering as well. Since this has so far not been a problem, for now make this behavior for non-SUBDIR_PARALLEL use of _SUBDIR explicit by using .USEBEFORE. Further research may change this back to .USE as well as the SUBDIR_PARALLEL handling and bsd.progs.mk recursing. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 10a301684033..a6eb98cf70b5 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -72,9 +72,9 @@ _SUBDIR_SH= \ cd ${.CURDIR}/$${dir}; \ ${MAKE} $${target} DIRPRFX=${DIRPRFX}$${dir}/ -_SUBDIR: .USE .MAKE +_SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}target=${.TARGET:S,realinstall,install,:S,^_sub.,,}; \ + @${_+_}target=${.TARGET:S,realinstall,install,}; \ for dir in ${SUBDIR:N.WAIT}; do ${_SUBDIR_SH}; done .endif @@ -107,8 +107,7 @@ ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .endfor ${__target}: ${__subdir_targets} .else -${__target}: _sub.${__target} -_sub.${__target}: _SUBDIR +${__target}: _SUBDIR .endif .endfor @@ -119,8 +118,7 @@ _sub.${__target}: _SUBDIR .for __stage in build install ${__stage}${__target}: .if make(${__stage}${__target}) -${__stage}${__target}: _sub.${__stage}${__target} -_sub.${__stage}${__target}: _SUBDIR +${__stage}${__target}: _SUBDIR .endif .endfor .if !target(${__target}) -- cgit v1.2.3 From 01d591d45b2f6f21787e93f0e57b6a151d4769db Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 22 Oct 2015 04:28:22 +0000 Subject: Clean up some bsd.crunchgen.mk issues. - Remove handling of 'make -P' since that is for fmake only. - Add '+' where appropriate for sub-make calls. - Pass MK_TESTS=no to all of the sub-makes to prevent recursing into test directories for targets such as 'obj', 'clean', 'depend', etc. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index 0f0edd3c22fb..acef93bcb2bf 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -107,26 +107,27 @@ $(CONF): Makefile .endfor CRUNCHGEN?= crunchgen -# XXX Make sure we don't pass -P to crunchgen(1). -.MAKEFLAGS:= ${.MAKEFLAGS:N-P} +CRUNCHENV?= MK_TESTS=no .ORDER: $(OUTPUTS) objs $(OUTPUTS): $(CONF) .META MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${CRUNCHGEN} -fq -m $(OUTMK) \ -c $(OUTC) $(CONF) +# These 2 targets cannot use .MAKE since they depend on the generated +# ${OUTMK} above. $(PROG): $(OUTPUTS) objs - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe objs: $(OUTMK) - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. build-tools: .for _tool in $(CRUNCH_BUILDTOOLS) - cd $(.CURDIR)/../../${_tool}; \ - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools + ${_+_}cd $(.CURDIR)/../../${_tool}; \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools .endfor # Use a separate build tree to hold files compiled for this crunchgen binary @@ -137,12 +138,12 @@ cleandepend cleandir obj objlink: .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} - cd ${CRUNCH_SRCDIR_$(P)} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .else - cd $(.CURDIR)/../../${D}/${P} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .endif .endfor @@ -150,18 +151,18 @@ cleandepend cleandir obj objlink: clean: rm -f ${CLEANFILES} - if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ - MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ + ${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ fi .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} - cd ${CRUNCH_SRCDIR_$(P)} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .else - cd $(.CURDIR)/../../${D}/${P} && \ - MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .endif .endfor -- cgit v1.2.3 From 5583e49be699aea6fbd6f121005b54e70d863378 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 22 Oct 2015 04:42:17 +0000 Subject: Rewrite crunchgen target handling for progs so that it can be parallelized. This covers 'clean', 'cleandepend', 'cleandir', 'obj', 'objlink' and 'build-tools'. This uses the same method as bsd.subdir.mk. MFC after: 2 weeks X-MFC-With: r289731 Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index acef93bcb2bf..d6a32ef2ef4d 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -123,29 +123,32 @@ objs: $(OUTMK) # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. -build-tools: .for _tool in $(CRUNCH_BUILDTOOLS) +build-tools-${_tool}: ${_+_}cd $(.CURDIR)/../../${_tool}; \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools +build-tools: build-tools-${_tool} .endfor # Use a separate build tree to hold files compiled for this crunchgen binary # Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't # get that to cooperate with bsd.prog.mk. Besides, many of the standard # targets should NOT be propagated into the components. -cleandepend cleandir obj objlink: +.for __target in clean cleandepend cleandir obj objlink .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} - ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +__dir= ${CRUNCH_SRCDIR_$(P)} .else - ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +__dir= ${.CURDIR}/../../${D}/${P} .endif +${__target}_crunchdir_${P}: .PHONY .MAKE + ${_+_}cd ${__dir} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} +${__target}: ${__target}_crunchdir_${P} +.endfor .endfor .endfor @@ -154,16 +157,3 @@ clean: ${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ fi -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) -.ifdef CRUNCH_SRCDIR_${P} - ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.else - ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.endif -.endfor -.endfor -- cgit v1.2.3 From d4f564c588587f5a1353cf9a840f6757879e3ce5 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 22 Oct 2015 04:47:52 +0000 Subject: Fix style. Namely use {} rather than (). MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 107 +++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 53 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index d6a32ef2ef4d..e8beaeb1c7d9 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -13,14 +13,14 @@ # local architecture. # # Special options can be specified for individual programs -# CRUNCH_SRCDIR_$(P): base source directory for program $(P) -# CRUNCH_BUILDOPTS_$(P): additional build options for $(P) -# CRUNCH_ALIAS_$(P): additional names to be used for $(P) +# CRUNCH_SRCDIR_${P}: base source directory for program ${P} +# CRUNCH_BUILDOPTS_${P}: additional build options for ${P} +# CRUNCH_ALIAS_${P}: additional names to be used for ${P} # # By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} # will be used to generate a hard link to the resulting binary. # Specific links can be suppressed by setting -# CRUNCH_SUPPRESS_LINK_$(NAME) to 1. +# CRUNCH_SUPPRESS_LINK_${NAME} to 1. # # If CRUNCH_GENERATE_LINKS is set to no, no links will be generated. # @@ -31,101 +31,101 @@ # The following is pretty nearly a generic crunchgen-handling makefile # -CONF= $(PROG).conf -OUTMK= $(PROG).mk -OUTC= $(PROG).c -OUTPUTS=$(OUTMK) $(OUTC) $(PROG).cache +CONF= ${PROG}.conf +OUTMK= ${PROG}.mk +OUTC= ${PROG}.c +OUTPUTS=${OUTMK} ${OUTC} ${PROG}.cache CRUNCHOBJS= ${.OBJDIR} -.if defined(MAKEOBJDIRPREFIX) +.if defined{MAKEOBJDIRPREFIX} CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${.CURDIR} -.elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" -CANONICALOBJDIR:=${MAKEOBJDIR} +.elif defined{MAKEOBJDIR} && ${MAKEOBJDIR:M/*} != "" +CANONICALOBJDIR:= ${MAKEOBJDIR} .else CANONICALOBJDIR:= /usr/obj${.CURDIR} .endif -CRUNCH_GENERATE_LINKS?= yes +CRUNCH_GENERATE_LINKS?= yes -CLEANFILES+= $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h +CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h # Don't try to extract debug info from ${PROG}. -MK_DEBUG_FILES=no +MK_DEBUG_FILES= no # Program names and their aliases contribute hardlinks to 'rescue' executable, # except for those that get suppressed. -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) +.for D in ${CRUNCH_SRCDIRS} +.for P in ${CRUNCH_PROGS_${D}} .ifdef CRUNCH_SRCDIR_${P} -$(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefile +${OUTPUTS}: ${CRUNCH_SRCDIR_${P}}/Makefile .else -$(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile +${OUTPUTS}: ${.CURDIR}/../../${D}/${P}/Makefile .endif .if ${CRUNCH_GENERATE_LINKS} == "yes" .ifndef CRUNCH_SUPPRESS_LINK_${P} -LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) +LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${P} .endif -.for A in $(CRUNCH_ALIAS_$(P)) +.for A in ${CRUNCH_ALIAS_${P}} .ifndef CRUNCH_SUPPRESS_LINK_${A} -LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) +LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${A} .endif .endfor .endif .endfor .endfor -all: $(PROG) -exe: $(PROG) +all: ${PROG} +exe: ${PROG} -$(CONF): Makefile - echo \# Auto-generated, do not edit >$(.TARGET) +${CONF}: Makefile + echo \# Auto-generated, do not edit >${.TARGET} .ifdef CRUNCH_BUILDOPTS - echo buildopts $(CRUNCH_BUILDOPTS) >>$(.TARGET) + echo buildopts ${CRUNCH_BUILDOPTS} >>${.TARGET} .endif .ifdef CRUNCH_LIBS - echo libs $(CRUNCH_LIBS) >>$(.TARGET) + echo libs ${CRUNCH_LIBS} >>${.TARGET} .endif .ifdef CRUNCH_SHLIBS - echo libs_so $(CRUNCH_SHLIBS) >>$(.TARGET) + echo libs_so ${CRUNCH_SHLIBS} >>${.TARGET} .endif -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) - echo progs $(P) >>$(.TARGET) +.for D in ${CRUNCH_SRCDIRS} +.for P in ${CRUNCH_PROGS_${D}} + echo progs ${P} >>${.TARGET} .ifdef CRUNCH_SRCDIR_${P} - echo special $(P) srcdir $(CRUNCH_SRCDIR_${P}) >>$(.TARGET) + echo special ${P} srcdir ${CRUNCH_SRCDIR_${P}} >>${.TARGET} .else - echo special $(P) srcdir $(.CURDIR)/../../$(D)/$(P) >>$(.TARGET) + echo special ${P} srcdir ${.CURDIR}/../../${D}/${P} >>${.TARGET} .endif .ifdef CRUNCH_BUILDOPTS_${P} - echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ \ - $(CRUNCH_BUILDOPTS_${P}) >>$(.TARGET) + echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ \ + ${CRUNCH_BUILDOPTS_${P}} >>${.TARGET} .else - echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ >>$(.TARGET) + echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ >>${.TARGET} .endif -.for A in $(CRUNCH_ALIAS_$(P)) - echo ln $(P) $(A) >>$(.TARGET) +.for A in ${CRUNCH_ALIAS_${P}} + echo ln ${P} ${A} >>${.TARGET} .endfor .endfor .endfor CRUNCHGEN?= crunchgen CRUNCHENV?= MK_TESTS=no -.ORDER: $(OUTPUTS) objs -$(OUTPUTS): $(CONF) .META - MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${CRUNCHGEN} -fq -m $(OUTMK) \ - -c $(OUTC) $(CONF) +.ORDER: ${OUTPUTS} objs +${OUTPUTS}: ${CONF} .META + MAKE=${MAKE} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${CRUNCHGEN} -fq \ + -m ${OUTMK} -c ${OUTC} ${CONF} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. -$(PROG): $(OUTPUTS) objs - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe +${PROG}: ${OUTPUTS} objs + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f ${OUTMK} exe -objs: $(OUTMK) - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs +objs: ${OUTMK} + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f ${OUTMK} objs # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. -.for _tool in $(CRUNCH_BUILDTOOLS) +.for _tool in ${CRUNCH_BUILDTOOLS} build-tools-${_tool}: - ${_+_}cd $(.CURDIR)/../../${_tool}; \ + ${_+_}cd ${.CURDIR}/../../${_tool}; \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools build-tools: build-tools-${_tool} @@ -136,10 +136,10 @@ build-tools: build-tools-${_tool} # get that to cooperate with bsd.prog.mk. Besides, many of the standard # targets should NOT be propagated into the components. .for __target in clean cleandepend cleandir obj objlink -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) +.for D in ${CRUNCH_SRCDIRS} +.for P in ${CRUNCH_PROGS_${D}} .ifdef CRUNCH_SRCDIR_${P} -__dir= ${CRUNCH_SRCDIR_$(P)} +__dir= ${CRUNCH_SRCDIR_${P}} .else __dir= ${.CURDIR}/../../${D}/${P} .endif @@ -154,6 +154,7 @@ ${__target}: ${__target}_crunchdir_${P} clean: rm -f ${CLEANFILES} - ${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ + ${_+_}if [ -e ${.OBJDIR}/${OUTMK} ]; then \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} \ + -f ${OUTMK} clean; \ fi -- cgit v1.2.3 From cc104c812d71dc10a44ece1f0b9c747eed243612 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 22 Oct 2015 04:52:37 +0000 Subject: Fix incorrect defined() usage from style clean up in r289735. Submitted by: ngie MFC after: 2 weeks X-MFC-With: r289735 Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index e8beaeb1c7d9..f61dc686e58d 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -36,9 +36,9 @@ OUTMK= ${PROG}.mk OUTC= ${PROG}.c OUTPUTS=${OUTMK} ${OUTC} ${PROG}.cache CRUNCHOBJS= ${.OBJDIR} -.if defined{MAKEOBJDIRPREFIX} +.if defined(MAKEOBJDIRPREFIX) CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${.CURDIR} -.elif defined{MAKEOBJDIR} && ${MAKEOBJDIR:M/*} != "" +.elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" CANONICALOBJDIR:= ${MAKEOBJDIR} .else CANONICALOBJDIR:= /usr/obj${.CURDIR} -- cgit v1.2.3 From c22afe52f44e4098924cf1c2dc9d6678fe21a014 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 22 Oct 2015 22:29:25 +0000 Subject: Fix installation of manpages with WITHOUT_COMPRESS broken since r284685. This partially reverts r284685. An attempt was made in r285295 to fix this but was not enough. There were still $${} vars in the code that should have been using the ${_page} and ${_sect} vars, but the bigger problem was that .for cannot be used on .ALLSRC as it is not defined when the .for is evaluated. Using ${MAN} here in a .for loop doesn't work either as the paths are not expanded right for lib/libc/ subdirs despite having a .PATH set for all of them. Add some comments around long .else and .endif as well. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.man.mk | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 72aedfb5423e..d0992b630dfb 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -104,8 +104,8 @@ ${__target}: ${__page} .endfor .endif .endfor -.endif -.else +.endif # !empty(MAN) +.else # !defined(MANFILTER) .if defined(MAN) && !empty(MAN) CLEANFILES+= ${MAN:T:S/$/${CATEXT}/g} .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) @@ -120,9 +120,9 @@ ${__target}: ${__page} _manpages: ${MAN} .endif .endif -.endif +.endif # defined(MANFILTER) -.else +.else # ${MK_MANCOMPRESS} == "yes" ZEXT= ${MCOMPRESS_EXT} @@ -169,7 +169,7 @@ ${__target}: ${__page} .endfor .endif -.endif +.endif # ${MK_MANCOMPRESS} == "no" maninstall: _maninstall _maninstall: @@ -185,20 +185,26 @@ _maninstall: ${MAN} ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page} .endif .endfor -.else -.for _page _sect in ${.ALLSRC:C/\.([^.]*)$/.\1 \1/} - @d=${DESTDIR}${MANDIR}${_sect}${MANSUBDIR}/; \ - ${ECHO} ${MINSTALL} ${_page} $${d}; \ - ${MINSTALL} $${page} $${d}; -.endfor +.else # !defined(MANFILTER) + @set ${.ALLSRC:C/\.([^.]*)$/.\1 \1/}; \ + while : ; do \ + case $$# in \ + 0) break;; \ + 1) echo "warn: missing extension: $$1"; break;; \ + esac; \ + page=$$1; shift; sect=$$1; shift; \ + d=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}; \ + ${ECHO} ${MINSTALL} $${page} $${d}; \ + ${MINSTALL} $${page} $${d}; \ + done .if defined(MANBUILDCAT) && !empty(MANBUILDCAT) .for __page in ${MAN} ${MINSTALL} ${__page:T:S/$/${CATEXT}/} \ ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T} .endfor .endif -.endif -.else +.endif # defined(MANFILTER) +.else # ${MK_MANCOMPRESS} == "yes" .for __page in ${MAN} ${MINSTALL} ${__page:T:S/$/${MCOMPRESS_EXT}/g} \ ${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}/ @@ -207,7 +213,7 @@ _maninstall: ${MAN} ${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T:S/$/${MCOMPRESS_EXT}/} .endif .endfor -.endif +.endif # ${MK_MANCOMPRESS} == "no" .endif .if !defined(NO_MLINKS) && defined(MLINKS) && !empty(MLINKS) -- cgit v1.2.3 From 2e35a44ce5b131b9002e89eb820300267dbdac7b Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 22 Oct 2015 23:41:56 +0000 Subject: For SUBDIR_PARALLEL, when doing 'make clean*' or 'make obj' there is no need to respect SUBDIR_DEPEND_* or .WAIT. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index a6eb98cf70b5..8275afd1751a 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -83,6 +83,15 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE dir=${.TARGET}; \ ${_SUBDIR_SH}; +# .WAIT and dependencies can be skipped for some targets. +.if defined(SUBDIR_PARALLEL) +.if make(obj) || make(clean*) +_skip_subdir_ordering= 1 +SUBDIR:= ${SUBDIR:N.WAIT} +.else +_skip_subdir_ordering= 0 +.endif +.endif # defined(SUBDIR_PARALLEL) # Work around parsing of .if nested in .for by putting .WAIT string into a var. __wait= .WAIT .for __target in ${ALL_SUBDIR_TARGETS} @@ -94,9 +103,11 @@ __subdir_targets+= .WAIT .else __subdir_targets+= ${__target}_subdir_${__dir} __deps= +.if ${_skip_subdir_ordering} == 0 .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${__dep} .endfor +.endif ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) @${_+_}target=${__target:realinstall=install}; \ -- cgit v1.2.3 From 0d2a1539d1e76a37f04e95d1526bebe23ac44dcd Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 23 Oct 2015 19:41:58 +0000 Subject: Fix regression from r289734 that caused crunchgen "subdirs" to not be properly recursed. The .for loop was defining a ${__dir} variable that was being set at a different evaluation time than the target itself, so every 'cd ${__dir}' became the last value that was in ${__dir}. This resulted in 'make obj' not properly being ran in the tree that would leave .depend files scattered around when 'make all' was ran in rescue/. To fix this, define a CRUNCH_SRCDIR_* for every prog if it does not already have one and then use that variable in every relevant place. This allows simplifying some logic as well. Reported by: emaste X-MFC-With: r289734 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index f61dc686e58d..e84e5070d1c0 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -50,15 +50,18 @@ CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h # Don't try to extract debug info from ${PROG}. MK_DEBUG_FILES= no +# Set a default SRCDIR for each for simpler handling below. +.for D in ${CRUNCH_SRCDIRS} +.for P in ${CRUNCH_PROGS_${D}} +CRUNCH_SRCDIR_${P}?= ${.CURDIR}/../../${D}/${P} +.endfor +.endfor + # Program names and their aliases contribute hardlinks to 'rescue' executable, # except for those that get suppressed. .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} -.ifdef CRUNCH_SRCDIR_${P} ${OUTPUTS}: ${CRUNCH_SRCDIR_${P}}/Makefile -.else -${OUTPUTS}: ${.CURDIR}/../../${D}/${P}/Makefile -.endif .if ${CRUNCH_GENERATE_LINKS} == "yes" .ifndef CRUNCH_SUPPRESS_LINK_${P} LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${P} @@ -89,11 +92,7 @@ ${CONF}: Makefile .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} echo progs ${P} >>${.TARGET} -.ifdef CRUNCH_SRCDIR_${P} echo special ${P} srcdir ${CRUNCH_SRCDIR_${P}} >>${.TARGET} -.else - echo special ${P} srcdir ${.CURDIR}/../../${D}/${P} >>${.TARGET} -.endif .ifdef CRUNCH_BUILDOPTS_${P} echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ \ ${CRUNCH_BUILDOPTS_${P}} >>${.TARGET} @@ -138,13 +137,8 @@ build-tools: build-tools-${_tool} .for __target in clean cleandepend cleandir obj objlink .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} -.ifdef CRUNCH_SRCDIR_${P} -__dir= ${CRUNCH_SRCDIR_${P}} -.else -__dir= ${.CURDIR}/../../${D}/${P} -.endif ${__target}_crunchdir_${P}: .PHONY .MAKE - ${_+_}cd ${__dir} && \ + ${_+_}cd ${CRUNCH_SRCDIR_${P}} && \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} ${__target}: ${__target}_crunchdir_${P} -- cgit v1.2.3 From ccfb12d63a374c9579b8922bba3539f74cf0e839 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 23 Oct 2015 21:30:27 +0000 Subject: Rework r289778 to always parallelize known targets, without ordering. - Rather than allow 'make clean*' to ignore dependencies, make a static list of targets in STANDALONE_SUBDIR_TARGETS that are known to be safe. This allows a user to override them if needed and avoids adding this feature to user-defined targets that are in ${SUBDIR_TARGETS}. [1] - This now also allows to force SUBDIR_PARALLEL when calling these targets, since no dependencies are needed. Reported by: ian [1] Sponsored by: EMC / Isilon Storage Division MFC after: 3 weeks X-MFC-With: r289778 --- share/mk/bsd.subdir.mk | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 8275afd1751a..0a22fbec74a5 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -28,6 +28,10 @@ # See ALL_SUBDIR_TARGETS for list of targets that will recurse. # Custom targets can be added to SUBDIR_TARGETS in src.conf. # +# Targets defined in STANDALONE_SUBDIR_TARGETS will always be ran +# with SUBDIR_PARALLEL and will not respect .WAIT or SUBDIR_DEPEND_ +# values. +# .if !target(____) ____: @@ -38,6 +42,10 @@ ALL_SUBDIR_TARGETS= all all-man buildconfig checkdpadd clean cleandepend \ realinstall regress tags \ ${SUBDIR_TARGETS} +# Described above. +STANDALONE_SUBDIR_TARGETS?= obj checkdpadd clean cleandepend cleandir \ + cleanilinks cleanobj + .include .if !defined(NEED_SUBDIR) @@ -83,19 +91,17 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE dir=${.TARGET}; \ ${_SUBDIR_SH}; -# .WAIT and dependencies can be skipped for some targets. -.if defined(SUBDIR_PARALLEL) -.if make(obj) || make(clean*) -_skip_subdir_ordering= 1 -SUBDIR:= ${SUBDIR:N.WAIT} -.else -_skip_subdir_ordering= 0 -.endif -.endif # defined(SUBDIR_PARALLEL) # Work around parsing of .if nested in .for by putting .WAIT string into a var. __wait= .WAIT .for __target in ${ALL_SUBDIR_TARGETS} -.ifdef SUBDIR_PARALLEL +# Can ordering be skipped for this and SUBDIR_PARALLEL forced? +.if make(${__target}) && ${STANDALONE_SUBDIR_TARGETS:M${__target}} +_is_standalone_target= 1 +SUBDIR:= ${SUBDIR:N.WAIT} +.else +_is_standalone_target= 0 +.endif +.if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1 __subdir_targets= .for __dir in ${SUBDIR} .if ${__wait} == ${__dir} @@ -103,7 +109,7 @@ __subdir_targets+= .WAIT .else __subdir_targets+= ${__target}_subdir_${__dir} __deps= -.if ${_skip_subdir_ordering} == 0 +.if ${_is_standalone_target} == 0 .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${__dep} .endfor @@ -115,12 +121,12 @@ ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} ${_SUBDIR_SH}; .endif .endif -.endfor +.endfor # __dir in ${SUBDIR} ${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR -.endif -.endfor +.endif # SUBDIR_PARALLEL || _is_standalone_target +.endfor # __target in ${ALL_SUBDIR_TARGETS} # This is to support 'make includes' calling 'make buildincludes' and # 'make installincludes' in the proper order, and to support these -- cgit v1.2.3 From de606f83e00defed267325576ffdb7abbc6eb8a4 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 24 Oct 2015 04:03:29 +0000 Subject: Configs should not be under MK_INCLUDES control. 'buildconfig' is connected to 'all', but 'installconfig' is only called manually. There is not much need to conditionalize this file right now due to how it is hooked up and its impact on various build phases. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.confs.mk | 3 --- 1 file changed, 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index 36298d7da02f..533ba71e5f54 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -4,7 +4,6 @@ .error bsd.conf.mk cannot be included directly. .endif -.if ${MK_INCLUDES} != "no" CONFGROUPS?= CONFS .if !target(buildconfig) @@ -83,5 +82,3 @@ _${group}INS: ${_${group}CONFS} STAGE_TARGETS+= stage_config .endif .endif - -.endif # ${MK_INCLUDES} != "no" -- cgit v1.2.3 From 8758abd5b3f031aa793ed09dc6e050985d120bce Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 24 Oct 2015 04:03:32 +0000 Subject: Slightly rework the comments and logic for default Clang/GCC. This is because the previous version was very obscure about the fact that despite having Clang "on by default" for architectures such as powerpc, it does not actually build due to the GCC it uses not having C++11 support. Using an external compiler that supports C++11 does allow this to work. This whole block should be rethought more given "on by default" is not really default without extra work which could actually be surprising for why Clang is showing up when using a newer GCC. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.opts.mk | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'share/mk') diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index a5e78a3d9459..7aca91435da1 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -210,21 +210,22 @@ __TT=${MACHINE} .endif .include -.if !${COMPILER_FEATURES:Mc++11} -# If the compiler is not C++11 capable, disable clang and use gcc instead. -__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX -__DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC -.elif ${__T} == "aarch64" || ${__T} == "amd64" || ${__TT} == "arm" || \ - ${__T} == "i386" -# On x86 and arm, clang is enabled, and will be installed as the default cc. +# If the compiler is not C++11 capable, disable Clang and use GCC instead. +# This means that architectures that have GCC 4.2 as default can not +# build Clang without using an external compiler. + +.if ${COMPILER_FEATURES:Mc++11} && (${__T} == "aarch64" || \ + ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386") +# Clang is enabled, and will be installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX -.elif ${__T:Mpowerpc*} -# On powerpc, clang is enabled, but gcc is installed as the default cc. +.elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mpowerpc*} +# On powerpc, if an external compiler that supports C++11 is used as ${CC}, +# then Clang is enabled, but GCC is installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC .else -# Everything else disables clang, and uses gcc instead. +# Everything else disables Clang, and uses GCC instead. __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC .endif -- cgit v1.2.3 From ce3c9a36c50498fb2d63a950d457c0558fc011a2 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 24 Oct 2015 04:55:17 +0000 Subject: Add bsd.crunchgen.mk to bsd.README. MFC after: 1 week --- share/mk/bsd.README | 1 + share/mk/bsd.crunchgen.mk | 2 ++ 2 files changed, 3 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.README b/share/mk/bsd.README index cb6e41f3cf07..173a677308e2 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -17,6 +17,7 @@ files. In most cases it is only interesting to include bsd.prog.mk or bsd.lib.mk. bsd.arch.inc.mk - includes arch-specific Makefile.$arch +bsd.crunchgen.mk - building crunched binaries using crunchgen(1) bsd.compiler.mk - defined based on current compiler bsd.confs.mk - install of configuration files bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index e84e5070d1c0..9618f5e78177 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -1,5 +1,7 @@ ################################################################# # +# Generate crunched binaries using crunchgen(1). +# # General notes: # # A number of Make variables are used to generate the crunchgen config file. -- cgit v1.2.3 From 8870ad3609e49c4614ccc66a7f006eb39b7264bb Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 24 Oct 2015 05:00:20 +0000 Subject: Sort properly. MFC after: 1 week X-MFC-With: r289870 --- share/mk/bsd.README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 173a677308e2..5aa194972cbf 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -17,10 +17,10 @@ files. In most cases it is only interesting to include bsd.prog.mk or bsd.lib.mk. bsd.arch.inc.mk - includes arch-specific Makefile.$arch -bsd.crunchgen.mk - building crunched binaries using crunchgen(1) bsd.compiler.mk - defined based on current compiler bsd.confs.mk - install of configuration files bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) +bsd.crunchgen.mk - building crunched binaries using crunchgen(1) bsd.dep.mk - handle Makefile dependencies bsd.doc.mk - building troff system documents bsd.endian.mk - TARGET_ENDIAN=1234(little) or 4321 (big) for target -- cgit v1.2.3 From 7847b2337eccf905aca21750db19c140bf0ec2f9 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 26 Oct 2015 22:31:57 +0000 Subject: META MODE: bsd.files.mk and bsd.confs.mk don't handle symlinks so there is no need to set STAGE_SYMLINKS_DIR.${STAGE_SET}. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.confs.mk | 1 - share/mk/bsd.files.mk | 1 - 2 files changed, 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index 533ba71e5f54..310fe5291fc7 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -24,7 +24,6 @@ ${group}MODE?= ${CONFMODE} ${group}DIR?= ${CONFIGDIR}/ STAGE_SETS+= ${group} STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} _${group}CONFS= .for cnf in ${${group}} diff --git a/share/mk/bsd.files.mk b/share/mk/bsd.files.mk index 6a6c66a682ff..ff620d0f0953 100644 --- a/share/mk/bsd.files.mk +++ b/share/mk/bsd.files.mk @@ -30,7 +30,6 @@ ${group}DIR?= ${BINDIR} STAGE_SETS+= ${group} .endif STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} _${group}FILES= .for file in ${${group}} -- cgit v1.2.3 From b0be2b128f2acf23dee6d614a49a3573fdcb8ffc Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 26 Oct 2015 23:28:35 +0000 Subject: META MODE: Fix FILESNAME not being respected sans other FILES_group overrides. This was fixed in bsd.incs.mk in r242801 already. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.files.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.files.mk b/share/mk/bsd.files.mk index ff620d0f0953..17a99d2681b2 100644 --- a/share/mk/bsd.files.mk +++ b/share/mk/bsd.files.mk @@ -35,7 +35,7 @@ _${group}FILES= .for file in ${${group}} .if defined(${group}OWN_${file:T}) || defined(${group}GRP_${file:T}) || \ defined(${group}MODE_${file:T}) || defined(${group}DIR_${file:T}) || \ - defined(${group}NAME_${file:T}) + defined(${group}NAME_${file:T}) || defined(${group}NAME) ${group}OWN_${file:T}?= ${${group}OWN} ${group}GRP_${file:T}?= ${${group}GRP} ${group}MODE_${file:T}?= ${${group}MODE} -- cgit v1.2.3 From 99330d7a24225b7fa00c4f253daaddb66b20a624 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 27 Oct 2015 01:29:38 +0000 Subject: META MODE: Fix after addition of bsd.confs.mk: Stage in "files" set. The "files" staging name is not the same as "bsd.files.mk" but seems to just be a group of extra files that are not the essential includes or libraries, which include . Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.confs.mk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index 310fe5291fc7..c3e99804eab0 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -44,7 +44,6 @@ STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}} # XXX {group}OWN,GRP,MODE STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${group}DIR_${cnf:T}} stage_as.${cnf:T}: ${cnf} -stage_config: stage_as.${cnf:T} installconfig: _${group}INS_${cnf:T} _${group}INS_${cnf:T}: ${cnf} @@ -58,7 +57,6 @@ _${group}CONFS+= ${cnf} .endfor .if !empty(_${group}CONFS) stage_files.${group}: ${_${group}CONFS} -stage_config: stage_files.${group} installconfig: _${group}INS _${group}INS: ${_${group}CONFS} @@ -76,8 +74,12 @@ _${group}INS: ${_${group}CONFS} .endif # !target(installconfig) -.if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD) -.if !defined(NO_STAGE_CONFIG) -STAGE_TARGETS+= stage_config +.if ${MK_STAGING} != "no" +.if !empty(STAGE_SETS) +buildconfig: stage_files +.if !empty(STAGE_AS_SETS) +buildconfig: stage_as .endif .endif +.endif + -- cgit v1.2.3 From 222c700312f99012685d49fe653ab76f0047971c Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 27 Oct 2015 02:04:21 +0000 Subject: Spell CONFGROUPS properly. --- share/mk/bsd.confs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index c3e99804eab0..172f5169ead8 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -7,7 +7,7 @@ CONFGROUPS?= CONFS .if !target(buildconfig) -.for group in ${CONFSGROUPS} +.for group in ${CONFGROUPS} buildconfig: ${${group}} .endfor .endif -- cgit v1.2.3 From 523e46d486693f42295cfc026c999d35aa67f099 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 27 Oct 2015 23:49:32 +0000 Subject: Use proper CONFDIR after r289148 --- share/mk/bsd.confs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk index 172f5169ead8..aa5191f995b6 100644 --- a/share/mk/bsd.confs.mk +++ b/share/mk/bsd.confs.mk @@ -21,7 +21,7 @@ all: buildconfig ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${CONFMODE} -${group}DIR?= ${CONFIGDIR}/ +${group}DIR?= ${CONFDIR} STAGE_SETS+= ${group} STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -- cgit v1.2.3 From 0edd283235e07c8d5c5e3b433f34070b892bde4f Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 29 Oct 2015 00:41:03 +0000 Subject: Fix regression from using .USEBEFORE in _SUBDIR in r289705. Using .USEBEFORE had the unintended side-effect of changing the directory for the real target ran in the current directory. For example this meant that the 'make clean' would run in one of the SUBDIR. Sponsored by: EMC / Isilon Storage Division Pointyhat to: bdrewery --- share/mk/bsd.subdir.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 0a22fbec74a5..f9b9e979c2a6 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -83,7 +83,7 @@ _SUBDIR_SH= \ _SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) @${_+_}target=${.TARGET:S,realinstall,install,}; \ - for dir in ${SUBDIR:N.WAIT}; do ${_SUBDIR_SH}; done + for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done .endif ${SUBDIR:N.WAIT}: .PHONY .MAKE -- cgit v1.2.3 From d04fda6cc42c5b70c6dacafa21bac6cb13d15bcb Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Fri, 30 Oct 2015 06:07:41 +0000 Subject: Unbreak bsd.progs.mk with PROGS (but not PROGS_CXX) and when invoking the "one of many" targets, e.g. `make hello_world`, where hello_world is a C program Tested with: PROGS and PROGS_CXX MFC after: 1 week X-MFC with: r289289 Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.progs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index dce05c7d7bda..c84e94b7c874 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -31,7 +31,7 @@ UPDATE_DEPENDFILE_PROG = ${PROGS:[1]} # They may have asked us to build just one .for t in ${PROGS} .if make($t) -.if ${PROGS_CXX:M${t}} +.if ${PROGS_CXX:U:M${t}} PROG_CXX ?= $t .endif PROG ?= $t -- cgit v1.2.3 From 4e461ce12db768464d938ef18acab77d84ff519e Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 31 Oct 2015 02:07:30 +0000 Subject: Don't hide stderr when checking ${CC} --version. This can have important debugging information such as 'cc: not found' or 'ccache: error: Could not find compiler "cc" in PATH'. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.compiler.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 3ba5130b81f3..9ad4baee13b7 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -52,7 +52,7 @@ ${var}= ${${var}.${_cc_hash}} COMPILER_TYPE= none COMPILER_VERSION= 0 .elif !defined(COMPILER_TYPE) || !defined(COMPILER_VERSION) -_v!= ${CC} --version 2>/dev/null || echo 0.0.0 +_v!= ${CC} --version || echo 0.0.0 .if !defined(COMPILER_TYPE) . if ${CC:T:M*gcc*} -- cgit v1.2.3 From a36eca08bbd549807428439b536fea522de0dc37 Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Wed, 4 Nov 2015 07:20:55 +0000 Subject: Rename libohash to libopenbsd. libopenbsd is an internal library which to bring in compatibility stuff from OpenBSD. This will allow us to bring in more OpenBSD utilities into the FreeBSD base system. We similarly use libnetbsd for bringing in stuff from NetBSD. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D4078 --- share/mk/src.libnames.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 06e451bdfa22..542a9e4bb2de 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -39,7 +39,7 @@ _INTERNALLIBS= \ netbsd \ ntp \ ntpevent \ - ohash \ + openbsd \ opts \ parse \ readline \ @@ -313,8 +313,8 @@ LIBELFTC?= ${LIBELFTCDIR}/libelftc.a LIBREADLINEDIR= ${ROOTOBJDIR}/gnu/lib/libreadline/readline LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a -LIBOHASHDIR= ${ROOTOBJDIR}/lib/libohash -LIBOHASH?= ${LIBOHASHDIR}/libohash.a +LIBOPENBSDDIR= ${ROOTOBJDIR}/lib/libopenbsd +LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd.a LIBSMDIR= ${ROOTOBJDIR}/lib/libsm LIBSM?= ${LIBSMDIR}/libsm.a -- cgit v1.2.3 From 208f108362680e4b4486c28f103006e6678504e2 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 5 Nov 2015 22:28:31 +0000 Subject: Allow 'make buildenv' to work anywhere in the src tree. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.init.mk | 2 ++ share/mk/src.init.mk | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 share/mk/src.init.mk (limited to 'share/mk') diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk index 85303c381bae..a30ed0e7085a 100644 --- a/share/mk/local.init.mk +++ b/share/mk/local.init.mk @@ -38,3 +38,5 @@ CPP= ${HOST_CPP} HOST_CFLAGS+= -DHOSTPROG CFLAGS+= ${HOST_CFLAGS} .endif + +.-include "src.init.mk" diff --git a/share/mk/src.init.mk b/share/mk/src.init.mk new file mode 100644 index 000000000000..437489eb6ab6 --- /dev/null +++ b/share/mk/src.init.mk @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.if !target(____) +____: + +.if !target(buildenv) +buildenv: .PHONY + @env BUILDENV_DIR=${.CURDIR} ${MAKE} -C ${SRCTOP} buildenv +.endif + +.endif # !target(____) -- cgit v1.2.3 From 0e9c4ca8b1d660f933eb8ae222c9f6f7062f8fd9 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 5 Nov 2015 22:42:40 +0000 Subject: Correct a comment which appears to be mistakingly mechanically changed in r265420. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.own.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 2f20da8620be..cf3bee6b2f00 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -1,6 +1,6 @@ # $FreeBSD$ # -# The include file set common variables for owner, +# The include file set common variables for owner, # group, mode, and directories. Defaults are in brackets. # # -- cgit v1.2.3 From cf1eeb33be737ef43046e08f79f3b3d5431db4a0 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 6 Nov 2015 04:45:29 +0000 Subject: Add a FAST_DEPEND option, off by default, which speeds up the build significantly. This speeds up buildworld by 16% on my system and buildkernel by 35%. Rather than calling mkdep(1), which is just a wrapper around 'cc -E', use the modern -MD -MT -MF flags to gather and generate dependencies during compilation. This flag was introduced in GCC "a long time ago", in GCC 3.0, and is also supported by Clang. (It appears that ICC also supports this but I do not have access to test it). This avoids running the preprocessor *twice* for every build, in both 'make depend' and 'make all'. This is especially noticeable when using ccache since it does not cache preprocessor results from mkdep(1) / 'cc -E', but still speeds up compilation with the -MD flags. For 'make depend' a tree-walk is still done to ensure that all DPSRCS are generated when expected, and that beforedepend/afterdepend and _EXTRADEPEND are all still respected. In time this may change but for now I've been conservative. The time for a tree-walk with -j combined with SUBDIR_PARALLEL is not significant. For example, it takes about 9 seconds with -j15 to walk all of src/ for 'make depend' now on my system. A .depend file is still generated with the various rules that apply to the final target, or custom rules. Otherwise there are now per-built-object-file .depend files, such as .depend.filename.o. These are included directly by make rather than populating .depend with a loop and .depend lines, which only added overhead to the now almost-NOP 'make depend' phase. Before this I experimented with having mkdep(1) called in parallel per-file. While this improved the kernel and lib/libc 'make depend' phase, it resulted in slower build times overall. The -M flags are removed from CFLAGS when linking since they have no effect. Enabling this by default, for src or out-of-src, can be done once more testing has been done, such as a ports exp-run, and with more compilers. The system I used for testing was: WITNESS Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_FAST_DEPEND=yes DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log. The arc was fully populated with src tree files. RAM: 76GiB CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz 2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16 buildworld: x buildworld-before + buildworld-fastdep +-------------------------------------------------------------------------------+ |+ | |+ | |+ xx x| | |_MA___|| |A | +-------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 3744.13 3794.31 3752.25 3763.5633 26.935139 + 3 3153.34 3155.16 3154.2 3154.2333 0.91045776 Difference at 95.0% confidence -609.33 +/- 43.1943 -16.1902% +/- 1.1477% (Student's t, pooled s = 19.0569) buildkernel: x buildkernel-before + buildkernel-fastdep +-------------------------------------------------------------------------------+ |+ x | |++ xx| | A|| |A| | +-------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 571.57 573.94 571.79 572.43333 1.3094401 + 3 369.12 370.57 369.3 369.66333 0.79033748 Difference at 95.0% confidence -202.77 +/- 2.45131 -35.4225% +/- 0.428227% (Student's t, pooled s = 1.0815) Sponsored by: EMC / Isilon Storage Division MFC after: 3 weeks Relnotes: yes --- share/mk/bsd.dep.mk | 23 ++++++++++++++++++++--- share/mk/bsd.lib.mk | 2 ++ share/mk/bsd.opts.mk | 1 + share/mk/bsd.prog.mk | 8 ++++---- 4 files changed, 27 insertions(+), 7 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 965f7034bdb8..8cc814dffc3d 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -54,6 +54,18 @@ MKDEPCMD?= CC='${CC} ${DEPFLAGS}' mkdep MKDEPCMD?= mkdep .endif DEPENDFILE?= .depend +DEPENDFILES= ${DEPENDFILE} +.if ${MK_FAST_DEPEND} == "yes" +DEPENDFILES+= ${DEPENDFILE}.* +DEPEND_CFLAGS+= -MD -MP -MF${DEPENDFILE}.${.TARGET} +DEPEND_CFLAGS+= -MT${.TARGET} +CFLAGS+= ${DEPEND_CFLAGS} +DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS} +.for __obj in ${DEPENDOBJS:O:u} +.sinclude "${DEPENDFILE}.${__obj}" +DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj} +.endfor +.endif # ${MK_FAST_DEPEND} == "yes" # Keep `tags' here, before SRCS are mangled below for `depend'. .if !target(tags) && defined(SRCS) && !defined(NO_TAGS) @@ -161,7 +173,7 @@ afterdepend: beforedepend depend: beforedepend ${DEPENDFILE} afterdepend # Tell bmake not to look for generated files via .PATH -.NOPATH: ${DEPENDFILE} +.NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS} # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. @@ -172,6 +184,7 @@ MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} \ DPSRCS+= ${SRCS} ${DEPENDFILE}: ${DPSRCS} +.if ${MK_FAST_DEPEND} == "no" rm -f ${DEPENDFILE} .if !empty(DPSRCS:M*.[cS]) ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ @@ -182,7 +195,11 @@ ${DEPENDFILE}: ${DPSRCS} ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ ${MKDEP_CXXFLAGS} \ ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cpp} ${.ALLSRC:M*.cxx} +.else .endif +.else + : > ${.TARGET} +.endif # ${MK_FAST_DEPEND} == "no" .if target(_EXTRADEPEND) _EXTRADEPEND: .USE ${DEPENDFILE}: _EXTRADEPEND @@ -207,12 +224,12 @@ afterdepend: cleandepend: .if defined(SRCS) .if ${CTAGS:T} == "gtags" - rm -f ${DEPENDFILE} GPATH GRTAGS GSYMS GTAGS + rm -f ${DEPENDFILES} GPATH GRTAGS GSYMS GTAGS .if defined(HTML) rm -rf HTML .endif .else - rm -f ${DEPENDFILE} tags + rm -f ${DEPENDFILES} tags .endif .endif .endif diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index e906ab7e83a6..579e36cd9240 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -305,10 +305,12 @@ all: _manpages .endif _EXTRADEPEND: +.if ${MK_FAST_DEPEND} == "no" @TMP=_depend$$$$; \ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.So:/' < ${DEPENDFILE} \ > $$TMP; \ mv $$TMP ${DEPENDFILE} +.endif .if !defined(NO_EXTRADEPEND) && defined(SHLIB_NAME) .if defined(DPADD) && !empty(DPADD) echo ${SHLIB_NAME_FULL}: ${DPADD} >> ${DEPENDFILE} diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 88f5196db89f..a1f4ccec2aab 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -66,6 +66,7 @@ __DEFAULT_YES_OPTIONS = \ WARNS __DEFAULT_NO_OPTIONS = \ + FAST_DEPEND \ CTF \ DEBUG_FILES \ INSTALL_AS_USER \ diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index fbb6922f7f61..37ede4c94c6f 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -82,9 +82,9 @@ ${PROG_FULL}: beforelinking .endif ${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) - ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CXX} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CC} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} @@ -112,9 +112,9 @@ ${PROG_FULL}: beforelinking .endif ${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) - ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CXX} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CC} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} -- cgit v1.2.3 From 8260928dfd80a63f049f1d06b0996c38c9f0a975 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 6 Nov 2015 21:49:17 +0000 Subject: The 'buildenv' target can safely be ran with '+'. --- share/mk/src.init.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/src.init.mk b/share/mk/src.init.mk index 437489eb6ab6..2067dcdbbabc 100644 --- a/share/mk/src.init.mk +++ b/share/mk/src.init.mk @@ -5,7 +5,7 @@ ____: .if !target(buildenv) buildenv: .PHONY - @env BUILDENV_DIR=${.CURDIR} ${MAKE} -C ${SRCTOP} buildenv + ${_+_}@env BUILDENV_DIR=${.CURDIR} ${MAKE} -C ${SRCTOP} buildenv .endif .endif # !target(____) -- cgit v1.2.3 From 3cccdc9d58c47a02ac56645a417d8a26a9ba17e9 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sun, 8 Nov 2015 00:50:09 +0000 Subject: FAST_DEPEND: Don't include depend files when using 'make -V'. This is especially noticeable in the kernel obj directory since it includes so many files. X-MFC-With: r290433 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 8cc814dffc3d..eea818b49756 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -62,7 +62,9 @@ DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS} .for __obj in ${DEPENDOBJS:O:u} +.if ${.MAKEFLAGS:M-V} == "" .sinclude "${DEPENDFILE}.${__obj}" +.endif DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj} .endfor .endif # ${MK_FAST_DEPEND} == "yes" -- cgit v1.2.3 From dbced32af5023c85a220550e80f29fd90dff65c9 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sun, 8 Nov 2015 00:50:13 +0000 Subject: FAST_DEPEND: Don't enable when .MAKE.MODE=meta. This is because the .meta files generated from filemon already contain a list of all files read to generate the object. X-MFC-With: r290433 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index eea818b49756..4eb4880da3be 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -55,7 +55,7 @@ MKDEPCMD?= mkdep .endif DEPENDFILE?= .depend DEPENDFILES= ${DEPENDFILE} -.if ${MK_FAST_DEPEND} == "yes" +.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" DEPENDFILES+= ${DEPENDFILE}.* DEPEND_CFLAGS+= -MD -MP -MF${DEPENDFILE}.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} -- cgit v1.2.3 From 9160419c7a948786ef010cc398df0b857f714db3 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sun, 8 Nov 2015 00:50:18 +0000 Subject: Add built-in ccache build support via WITH_CCACHE_BUILD option. ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not used to achieve a safe pseudo-incremental build. This is explained in more detail upstream [1] [2]. It incurs about a 20%-28% hit to populate the cache, but with a full cache saves 30-50% in build times. When combined with the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the resulting dependency file, which it does not do when using mkdep(1)/'CC -E'. Stats are provided at the end of this message. This removes the need to modify /etc/make.conf with the CC:= and CXX:= lines which conflicted with external compiler support [3] (causing the bootstrap compiler to not be built which lead to obscure failures [4]), incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid Clang errors with parenthesis, and did not work with META_MODE. The option name was picked to match the existing option in ports. This feature is available for both in-src and out-of-src builds that use /usr/share/mk. Linking, assembly compiles, and pre-processing avoid using ccache since it is only overhead. ccache does nothing special in these modes, although there is no harm in calling it for them. CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap compiler to hash the content of the compiler binary to determine if it should be a cache miss. For external compilers the 'mtime' option is used as it is more efficient and likely to be correct. Future work may optimize the 'content' check using the same checks as whether a bootstrap compiler is needed to be built. The CCACHE_CPP2 pessimization is currently default in our devel/ccache port due to Clang requiring it. Clang's -Wparentheses-equality, -Wtautological-compare, and -Wself-assign warnings do not mix well with compiling already-pre-processed code that may have expanded macros that trigger the warnings. GCC has so far not had this issue so it is allowed to disable the CCACHE_CPP2 default in our port. Sharing a cache between multiple checkouts, or systems, is explained in the ccache manual. Sharing a cache over NFS would likely not be worth it, but syncing cache directories between systems may be useful for an organization. There is also a memcached backend available [5]. Due to using an object directory outside of the source directory though you will need to ensure that both are in the same prefix and all users use the same layout. A possible working layout is as follows: Source: /some/prefix/src1 Source: /some/prefix/src2 Source: /some/prefix/src3 Objdir: /some/prefix/obj Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj' This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace all absolute paths to be relative. Using something like this is required due to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache adds into its hash for the object without CCACHE_BASEDIR. distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc. I have not personally tested this and assume it will not mix well with using the bootstrap compiler. The cache from buildworld can be reused in a subdir by first running 'make buildenv' (from r290424). Note that the cache is currently different depending on whether -j is used or not due to ccache enabling -fdiagnostics-color automatically if stderr is a TTY, which bmake only does if not using -j. The system I used for testing was: WITNESS Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log. The arc was fully populated with src tree files and ccache objects. RAM: 76GiB CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz 2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16 The WITH_FAST_DEPEND feature was used for comparison here as well to show the dramatic time savings with a full cache. buildworld: x buildworld-before + buildworld-ccache-empty * buildworld-ccache-full % buildworld-ccache-full-fastdep # buildworld-fastdep +-------------------------------------------------------------------------------+ |% * # +| |% * # +| |% * # xxx +| | |A | | A| | A | |A | | A | +-------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 3744.13 3794.31 3752.25 3763.5633 26.935139 + 3 4519 4525.04 4520.73 4521.59 3.1104823 Difference at 95.0% confidence 758.027 +/- 43.4565 20.1412% +/- 1.15466% (Student's t, pooled s = 19.1726) * 3 1823.08 1827.2 1825.62 1825.3 2.0785572 Difference at 95.0% confidence -1938.26 +/- 43.298 -51.5007% +/- 1.15045% (Student's t, pooled s = 19.1026) % 3 1266.96 1279.37 1270.47 1272.2667 6.3971113 Difference at 95.0% confidence -2491.3 +/- 44.3704 -66.1952% +/- 1.17895% (Student's t, pooled s = 19.5758) # 3 3153.34 3155.16 3154.2 3154.2333 0.91045776 Difference at 95.0% confidence -609.33 +/- 43.1943 -16.1902% +/- 1.1477% (Student's t, pooled s = 19.0569) buildkernel: x buildkernel-before + buildkernel-ccache-empty * buildkernel-ccache-empty-fastdep % buildkernel-ccache-full # buildkernel-ccache-full-fastdep @ buildkernel-fastdep +-------------------------------------------------------------------------------+ |# @ % * | |# @ % * x + | |# @ % * xx ++| | MA | | MA| | A | | A | |A | | A | +-------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 3 571.57 573.94 571.79 572.43333 1.3094401 + 3 727.97 731.91 728.06 729.31333 2.2492295 Difference at 95.0% confidence 156.88 +/- 4.17129 27.4058% +/- 0.728695% (Student's t, pooled s = 1.84034) * 3 527.1 528.29 528.08 527.82333 0.63516402 Difference at 95.0% confidence -44.61 +/- 2.33254 -7.79305% +/- 0.407478% (Student's t, pooled s = 1.02909) % 3 400.4 401.05 400.62 400.69 0.3306055 Difference at 95.0% confidence -171.743 +/- 2.16453 -30.0023% +/- 0.378128% (Student's t, pooled s = 0.954969) # 3 201.94 203.34 202.28 202.52 0.73020545 Difference at 95.0% confidence -369.913 +/- 2.40293 -64.6212% +/- 0.419774% (Student's t, pooled s = 1.06015) @ 3 369.12 370.57 369.3 369.66333 0.79033748 Difference at 95.0% confidence -202.77 +/- 2.45131 -35.4225% +/- 0.428227% (Student's t, pooled s = 1.0815) [1] https://ccache.samba.org/performance.html [2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html [3] https://reviews.freebsd.org/D3484 [5] https://github.com/jrosdahl/ccache/pull/30 PR: 182944 [4] MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Relnotes: yes --- share/mk/bsd.compiler.mk | 65 ++++++++++++++++++++++++++++++++++++++++++++++ share/mk/bsd.dep.mk | 10 ++++--- share/mk/bsd.lib.mk | 16 +++++++----- share/mk/bsd.opts.mk | 1 + share/mk/bsd.prog.mk | 12 ++++++--- share/mk/local.meta.sys.mk | 6 ----- share/mk/sys.mk | 4 +-- 7 files changed, 91 insertions(+), 23 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 9ad4baee13b7..30da2aff8857 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -25,6 +25,71 @@ .if !target(____) ____: +.include + +# Handle ccache after CC is determined, but not if CC/CXX are already +# overridden with a manual setup. +.if ${MK_CCACHE_BUILD:Uno} == "yes" && \ + (${CC:M*ccache/world/*} == "" || ${CXX:M*ccache/world/*} == "") +# CC is always prepended with the ccache wrapper rather than modifying +# PATH since it is more clear that ccache is used and avoids wasting time +# for mkdep/linking/asm builds. +LOCALBASE?= /usr/local +CCACHE_WRAPPER_PATH?= ${LOCALBASE}/libexec/ccache +CCACHE_BIN?= ${LOCALBASE}/bin/ccache +.if exists(${CCACHE_BIN}) +# Export to ensure sub-makes can filter it out for mkdep/linking and +# to chain down into kernel build which won't include this file. +.export CCACHE_BIN +# Expand and export some variables so they may be based on make vars. +# This allows doing something like the following in the environment: +# CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj' +.for var in CCACHE_LOGFILE CCACHE_BASEDIR +.if defined(${var}) +${var}:= ${${var}} +.export ${var} +.endif +.endfor +# Handle bootstrapped compiler changes properly by hashing their content +# rather than checking mtime. For external compilers it should be safe +# to use the more optimal mtime check. +# XXX: CCACHE_COMPILERCHECK= string: +.if ${CC:N${CCACHE_BIN}:[1]:M/*} == "" +CCACHE_COMPILERCHECK?= content +.else +CCACHE_COMPILERCHECK?= mtime +.endif +.export CCACHE_COMPILERCHECK +# Remove ccache from the PATH to prevent double calls and wasted CPP/LD time. +PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g} +# Ensure no bogus CCACHE_PATH leaks in which might avoid the in-tree compiler. +CCACHE_PATH= +.export CCACHE_PATH +# Override various toolchain vars. +.for var in CC CXX HOST_CC HOST_CXX +.if defined(${var}) && ${${var}:M${CCACHE_BIN}} == "" +${var}:= ${CCACHE_BIN} ${${var}} +.endif +.endfor +# GCC does not need the CCACHE_CPP2 hack enabled by default in devel/ccache. +# The port enables it due to ccache passing preprocessed C to clang +# which fails with -Wparentheses-equality, -Wtautological-compare, and +# -Wself-assign on macro-expanded lines. +.if defined(COMPILER_TYPE) && ${COMPILER_TYPE} == "gcc" +CCACHE_NOCPP2= 1 +.export CCACHE_NOCPP2 +.endif +# Canonicalize CCACHE_DIR for meta mode usage. +.if defined(CCACHE_DIR) && empty(.MAKE.META.IGNORE_PATHS:M${CCACHE_DIR}) +CCACHE_DIR:= ${CCACHE_DIR:tA} +.MAKE.META.IGNORE_PATHS+= ${CCACHE_DIR} +.export CCACHE_DIR +.endif +ccache-print-options: .PHONY + @${CCACHE_BIN} -p +.endif # exists(${CCACHE_BIN}) +.endif # ${MK_CCACHE_BUILD} == "yes" + # Try to import COMPILER_TYPE and COMPILER_VERSION from parent make. # The value is only used/exported for the same environment that impacts # CC and COMPILER_* settings here. diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 4eb4880da3be..a0e989254d32 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -48,11 +48,13 @@ CTAGSFLAGS?= GTAGSFLAGS?= -o HTAGSFLAGS?= -.if ${CC} != "cc" -MKDEPCMD?= CC='${CC} ${DEPFLAGS}' mkdep -.else -MKDEPCMD?= mkdep +_MKDEPCC:= ${CC:N${CCACHE_BIN}} +# XXX: DEPFLAGS can come out once Makefile.inc1 properly passes down +# CXXFLAGS. +.if !empty(DEPFLAGS) +_MKDEPCC+= ${DEPFLAGS} .endif +MKDEPCMD?= CC='${_MKDEPCC}' mkdep DEPENDFILE?= .depend DEPENDFILES= ${DEPENDFILE} .if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 579e36cd9240..7226f3f95d28 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -109,21 +109,23 @@ PO_FLAG=-pg ${CTFCONVERT_CMD} .asm.po: - ${CC} -x assembler-with-cpp -DPROF ${PO_CFLAGS} ${ACFLAGS} \ - -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp -DPROF ${PO_CFLAGS} \ + ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .asm.So: - ${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ - -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \ + ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .S.po: - ${CC} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ + -o ${.TARGET} ${CTFCONVERT_CMD} .S.So: - ${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \ + -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .if !defined(_SKIP_BUILD) @@ -249,7 +251,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) @${INSTALL_SYMLINK} ${SHLIB_NAME} ${SHLIB_LINK} .endif - ${_LD} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ + ${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ -o ${.TARGET} -Wl,-soname,${SONAME} \ `NM='${NM}' NMFLAGS='${NMFLAGS}' lorder ${SOBJS} | tsort -q` ${LDADD} .if ${MK_CTF} != "no" diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index a1f4ccec2aab..d242da5a59fd 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -66,6 +66,7 @@ __DEFAULT_YES_OPTIONS = \ WARNS __DEFAULT_NO_OPTIONS = \ + CCACHE_BUILD \ FAST_DEPEND \ CTF \ DEBUG_FILES \ diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 37ede4c94c6f..c4c783fb0084 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -82,9 +82,11 @@ ${PROG_FULL}: beforelinking .endif ${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) - ${CXX} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \ + ${OBJS} ${LDADD} .else - ${CC} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CC:N${CCACHE_BIN}} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} \ + ${LDADD} .endif .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} @@ -112,9 +114,11 @@ ${PROG_FULL}: beforelinking .endif ${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) - ${CXX} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CXX:N${CCACHE_BIN}} ${CXXFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} \ + ${OBJS} ${LDADD} .else - ${CC} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} + ${CC:N${CCACHE_BIN}} ${CFLAGS:N-M*} ${LDFLAGS} -o ${.TARGET} ${OBJS} \ + ${LDADD} .endif .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index adc884bc5d16..9aac03d9d2c1 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -186,12 +186,6 @@ UPDATE_DEPENDFILE= NO # define the list of places that contain files we are responsible for .MAKE.META.BAILIWICK = ${SB} ${OBJROOT} ${STAGE_ROOT} -.if defined(CCACHE_DIR) -CCACHE_DIR := ${CCACHE_DIR:tA} -.MAKE.META.IGNORE_PATHS += ${CCACHE_DIR} -.export CCACHE_DIR -.endif - CSU_DIR.${MACHINE_ARCH} ?= csu/${MACHINE_ARCH} CSU_DIR := ${CSU_DIR.${MACHINE_ARCH}} diff --git a/share/mk/sys.mk b/share/mk/sys.mk index b6c75b6f96a6..ee0797e743df 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -317,11 +317,11 @@ YFLAGS ?= -d ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET} .S.o: - ${CC} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .asm.o: - ${CC} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ + ${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \ -o ${.TARGET} ${CTFCONVERT_CMD} -- cgit v1.2.3 From b03ca5c3ec333012ca35e1baeddfafb1f59dce57 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 9 Nov 2015 23:37:04 +0000 Subject: FAST_DEPEND: Fix building of wrong source files in some cases. Similar to the original reason for these dependency hints to be added, in r124637, the missing-dependency file case can lead to building of the wrong source. A clear example of this is in gnu/lib/libstdc++ where the .PATH contains both contrib/gcc and contrib/libstdc++/src. contrib/gcc has a debug.c. contrib/libstdc++/src has a debug.cc. When building for the objects of debug.o, debug.So, and debug.po, it is ambiguous for which src file to use due to the suffix transformation rules, even though the proper one is listed first in .PATH. This was normally avoided due to these dependency hints for the initial build, and then mkdep would add an explicit 'debug.o: debug.cc' dependency into the .depend file. WITH_FAST_DEPEND does not generate the .depend file with these, but puts them into .depend.debug.o instead. Rather than extending the exists() check to each object's .depend.* file, just enable the hint when when using WITH_FAST_DEPEND. It fixes the problem and seems to be safe enough to use since it is mapping SRCS back to OBJS, rather than letting make make assumptions from OBJS to SRCS. A similar check mapping objects to headers is present in some mk files but was not extended here for FAST_DEPEND since it has not yet been found to be a problem. X-MFC-With: r290433 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 6 +++--- share/mk/bsd.lib.mk | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index a0e989254d32..ffe3926f4d83 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -88,7 +88,7 @@ tags: ${SRCS} .if defined(SRCS) CLEANFILES?= -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .for _S in ${SRCS:N*.[dhly]} ${_S:R}.o: ${_S} .endfor @@ -99,7 +99,7 @@ ${_S:R}.o: ${_S} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) ${_LC:R}.o: ${_LC} .endif SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} @@ -130,7 +130,7 @@ CLEANFILES+= ${_YH} ${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) ${_YC:R}.o: ${_YC} .endif .endfor diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 7226f3f95d28..b74c034e37f8 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -417,9 +417,11 @@ lint: ${SRCS:M*.c} .include -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .if defined(LIB) && !empty(LIB) +.if ${MK_FAST_DEPEND} == "no" ${OBJS} ${STATICOBJS} ${POBJS}: ${SRCS:M*.h} +.endif .for _S in ${SRCS:N*.[hly]} ${_S:R}.po: ${_S} .endfor -- cgit v1.2.3 From 00bd6d0f08b8543f4e8aa519e8e95b02b866225a Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 11 Nov 2015 23:52:08 +0000 Subject: Move META MODE's HOST_CC/CXX/CPP setting to local.meta.sys.mk, which centralizes the handling of CC and HOST_CC. This fixes a bug with WITH_CCACHE_BUILD when using MACHINE=host since CC is overridden in local.init.mk via src.opts.mk long before bsd.compiler.mk is included. Originally the ccache implementation was placed in local.init.mk but moved to bsd.compiler.mk as it seemed more proper and avoided other ordering issues. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.init.mk | 6 ------ share/mk/local.meta.sys.mk | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'share/mk') diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk index a30ed0e7085a..8954473b2fec 100644 --- a/share/mk/local.init.mk +++ b/share/mk/local.init.mk @@ -29,12 +29,6 @@ CXXFLAGS_LAST+= -I/usr/include .if ${.MAKE.DEPENDFILE:E} != "host" UPDATE_DEPENDFILE?= no .endif -HOST_CC?= /usr/bin/cc -CC= ${HOST_CC} -HOST_CXX?= /usr/bin/c++ -CXX= ${HOST_CXX} -HOST_CPP?= /usr/bin/cpp -CPP= ${HOST_CPP} HOST_CFLAGS+= -DHOSTPROG CFLAGS+= ${HOST_CFLAGS} .endif diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 9aac03d9d2c1..87e9f0174529 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -218,6 +218,15 @@ CPP?= ${HOST_CPP} .endif .endif +.if ${MACHINE} == "host" +HOST_CC?= /usr/bin/cc +CC= ${HOST_CC} +HOST_CXX?= /usr/bin/c++ +CXX= ${HOST_CXX} +HOST_CPP?= /usr/bin/cpp +CPP= ${HOST_CPP} +.endif + .if ${MACHINE:Nhost:Ncommon} != "" && ${MACHINE} != ${HOST_MACHINE} # cross-building .if !defined(FREEBSD_REVISION) -- cgit v1.2.3 From e13d8c1244a7e6641f08a6014a13db1c2362dd26 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 13 Nov 2015 01:47:56 +0000 Subject: META MODE: Don't double stage SYMLINKS for libraries. meta.stage.mk is handling ${SYMLINKS:T} for stage_libs already. The logic in bsd.sys.mk to handle ${SYMLINKS} was brought in r247817 when it was moved out of bsd.prog.mk and bsd.lib.mk into bsd.sys.mk. The logic previously was limited to bsd.prog.mk. This fixes a race, seen easily in lib/libthr, where libpthread_p.a is created by both stage_libs and stage_symlinks resulting in 'ln: File exists'. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.sys.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index cad2b2f79645..4a4e0800d1b2 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -276,7 +276,8 @@ STAGE_SETS+= links STAGE_LINKS.links= ${LINKS} .endif -.if !empty(SYMLINKS) +# Don't handle SYMLINKS for libraries since stage_libs is already doing so. +.if !empty(SYMLINKS) && empty(_LIBS) STAGE_TARGETS+= stage_symlinks STAGE_SETS+= links STAGE_SYMLINKS.links= ${SYMLINKS} -- cgit v1.2.3 From 08682b1bdf7b884de1872c0847ecdeb2be521b1b Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 13 Nov 2015 17:27:23 +0000 Subject: bsd.doc.mk: Similar to r289391, make installing to a missing directory an error. This avoids the problems fixed in r290772. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks --- share/mk/bsd.doc.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk index c89c09d1c4aa..e82d98bc4327 100644 --- a/share/mk/bsd.doc.mk +++ b/share/mk/bsd.doc.mk @@ -136,11 +136,11 @@ realinstall: .if ${PRINTERDEVICE:Mhtml} cd ${SRCDIR}; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME} + ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}/ .endif .for _dev in ${PRINTERDEVICE:Nhtml} ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - ${DFILE.${_dev}} ${DESTDIR}${BINDIR}/${VOLUME} + ${DFILE.${_dev}} ${DESTDIR}${BINDIR}/${VOLUME}/ .endfor spell: ${SRCS} -- cgit v1.2.3 From c04d716b5584774034abc01ce343e49f2c3746c6 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 13 Nov 2015 20:25:30 +0000 Subject: Revert r290740. Discussing with sjg@, we agree the better fix is to be done in meta.stage.mk. This also broke staging of SYMLINKS for non-shared libraries, such as for lib/libcompiler_rt, which results in all Makefile.depend removing it. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.sys.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 4a4e0800d1b2..cad2b2f79645 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -276,8 +276,7 @@ STAGE_SETS+= links STAGE_LINKS.links= ${LINKS} .endif -# Don't handle SYMLINKS for libraries since stage_libs is already doing so. -.if !empty(SYMLINKS) && empty(_LIBS) +.if !empty(SYMLINKS) STAGE_TARGETS+= stage_symlinks STAGE_SETS+= links STAGE_SYMLINKS.links= ${SYMLINKS} -- cgit v1.2.3 From 2224fae179e150ac79fe3528e21b66e673cd3d40 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 13 Nov 2015 22:27:24 +0000 Subject: META MODE: Don't double stage SYMLINKS for shared libraries. This also fixes truncating the path that the links were installed to, which was most likely going to be the same directory the library was in anyhow. Let bsd.sys.mk handle SYMLINKS via stage_symlinks. stage_libs continues to handle the SHLIB_LINK though since it is not a SYMLINKS. This fixes a race, seen easily in lib/libthr, where libpthread_p.a is created by both stage_libs and stage_symlinks resulting in 'ln: File exists'. Sponsored by: EMC / Isilon Storage Division Discussed with: sjg --- share/mk/meta.stage.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/meta.stage.mk b/share/mk/meta.stage.mk index cdf3e36e733d..0f5f37dab069 100644 --- a/share/mk/meta.stage.mk +++ b/share/mk/meta.stage.mk @@ -156,7 +156,7 @@ stage_libs: .dirdep @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} \ ${SHLIB_LINKS:@t@${STAGE_LIBS:T:M$t.*} $t@} .elif !empty(SHLIB_LINK) && !empty(SHLIB_NAME) - @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} ${SYMLINKS:T} + @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} .endif .endif @touch $@ -- cgit v1.2.3 From 948f327ee41918b1480b603042bb5132d2dfde2b Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Sat, 14 Nov 2015 03:24:48 +0000 Subject: Rename META_MODE option to DIRDEPS_BUILD This allows META_FILES option to be renamed META_MODE. Also add META_COOKIE_TOUCH for use in targets that can benefit from a cookie when in meta mode. Differential Revision: https://reviews.freebsd.org/D4153 Reviewed by: bdrewery --- share/mk/bsd.dep.mk | 2 +- share/mk/bsd.subdir.mk | 2 +- share/mk/local.meta.sys.mk | 2 +- share/mk/local.sys.mk | 14 +++++++++++++- share/mk/sys.mk | 12 ++++++------ 5 files changed, 22 insertions(+), 10 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index ffe3926f4d83..2e5e48658f08 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -163,7 +163,7 @@ beforedepend: ${DHDRS} beforebuild: ${DHDRS} .endif -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" .include # this depend: bypasses that below # the dependency helps when bootstrapping diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index f9b9e979c2a6..ec2585f16412 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -49,7 +49,7 @@ STANDALONE_SUBDIR_TARGETS?= obj checkdpadd clean cleandepend cleandir \ .include .if !defined(NEED_SUBDIR) -.if ${.MAKE.LEVEL} == 0 && ${MK_META_MODE} == "yes" && !empty(SUBDIR) && !(make(clean*) || make(destroy*)) +.if ${.MAKE.LEVEL} == 0 && ${MK_DIRDEPS_BUILD} == "yes" && !empty(SUBDIR) && !(make(clean*) || make(destroy*)) .include # ignore this _SUBDIR: diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 87e9f0174529..230850cf6606 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -2,7 +2,7 @@ # local configuration specific to meta mode # XXX some of this should be in meta.sys.mk -# we assume that MK_META_MODE=yes +# we assume that MK_DIRDEPS_BUILD=yes # we need this until there is an alternative MK_INSTALL_AS_USER= yes diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk index d542f8b5de97..7022dad40891 100644 --- a/share/mk/local.sys.mk +++ b/share/mk/local.sys.mk @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" MAKE_PRINT_VAR_ON_ERROR+= \ .CURDIR \ .MAKE \ @@ -23,3 +23,15 @@ MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH .endif .include "src.sys.mk" + +.if ${.MAKE.MODE:Unormal:Mmeta*} != "" +# we can afford to use cookies to prevent some targets +# re-running needlessly +META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}} +# some targets need to be .PHONY - but not in meta mode +META_NOPHONY= +.else +META_COOKIE_TOUCH= +META_NOPHONY= .PHONY +.endif + diff --git a/share/mk/sys.mk b/share/mk/sys.mk index ee0797e743df..4ec1a6b8adab 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -20,14 +20,14 @@ MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm # Some options we need now __DEFAULT_NO_OPTIONS= \ DIRDEPS_CACHE \ + DIRDEPS_BUILD \ META_MODE \ - META_FILES \ __DEFAULT_DEPENDENT_OPTIONS= \ - AUTO_OBJ/META_MODE \ - STAGING/META_MODE \ - SYSROOT/META_MODE + AUTO_OBJ/DIRDEPS_BUILD \ + STAGING/DIRDEPS_BUILD \ + SYSROOT/DIRDEPS_BUILD __ENV_ONLY_OPTIONS:= \ ${__DEFAULT_NO_OPTIONS} \ @@ -43,9 +43,9 @@ __ENV_ONLY_OPTIONS:= \ .include -.if ${MK_META_MODE} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" .sinclude -.elif ${MK_META_FILES} == "yes" && defined(.MAKEFLAGS) +.elif ${MK_META_MODE} == "yes" && defined(.MAKEFLAGS) .if ${.MAKEFLAGS:M-B} == "" .MAKE.MODE= meta verbose .endif -- cgit v1.2.3 From f894f17244d31a2a6ac2c061d4e143c3b2d6319a Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sat, 14 Nov 2015 06:18:50 +0000 Subject: Fix URL for powerpc cpu options. Remove reference to ia64 options as no longer relevant. --- share/mk/bsd.cpu.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 112c2d5490fe..2cdf25f9572c 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -84,8 +84,7 @@ CPUTYPE = ultrasparc3 # after /etc/make.conf so it can react to the local value of CPUTYPE # defined therein. Consult: # http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html -# http://gcc.gnu.org/onlinedocs/gcc/IA_002d64-Options.html -# http://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html +# http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html # http://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html # http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html -- cgit v1.2.3 From 6c40e2d68cffbe567271060ea2a35494d29114cd Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 15 Nov 2015 18:51:48 +0000 Subject: Add NO_WERROR and WARNS to PROG_OVERRIDE_VARS for bsd.prog.mk compatibility MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.progs.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index c84e94b7c874..ad5cc184ee9a 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -41,8 +41,8 @@ PROG ?= $t .if defined(PROG) # just one of many -PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN PROGNAME \ - SRCS +PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ + PROGNAME SRCS WARNS PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD LIBADD LINKS \ LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} -- cgit v1.2.3 From dba62d8dcf57f741f505da18ca86302294deb6ef Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Mon, 16 Nov 2015 22:50:23 +0000 Subject: Default MK_META_MODE from MK_DIRDEPS_BUILD This allows most of the build to simply consider MK_META_MODE Update to latest dirdeps.mk so we can do: make -f dirdeps.mk bin/cat.i386 Reviewed by: bdrewery --- share/mk/dirdeps.mk | 17 ++++++++++++++++- share/mk/local.gendirdeps.mk | 1 + share/mk/sys.mk | 5 ++--- 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'share/mk') diff --git a/share/mk/dirdeps.mk b/share/mk/dirdeps.mk index c3c19d22d0a0..a989f953b265 100644 --- a/share/mk/dirdeps.mk +++ b/share/mk/dirdeps.mk @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: dirdeps.mk,v 1.54 2015/06/08 20:55:11 sjg Exp $ +# $Id: dirdeps.mk,v 1.55 2015/10/20 22:04:53 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -243,6 +243,21 @@ DEP_${TARGET_SPEC_VARS:[$i]} := ${_tspec:[$i]} DEP_MACHINE := ${_DEP_TARGET_SPEC} .endif +.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" +# This little trick let's us do +# +# mk -f dirdeps.mk some/dir.${TARGET_SPEC} +# +all: +${.TARGETS:Nall}: all +DIRDEPS := ${.TARGETS:M*/*} +# so that -DNO_DIRDEPS works +DEP_RELDIR := ${DIRDEPS:R:[1]} +# disable DIRDEPS_CACHE as it does not like this trick +MK_DIRDEPS_CACHE = no +.endif + + # pickup customizations # as below you can use !target(_DIRDEP_USE) to protect things # which should only be done once. diff --git a/share/mk/local.gendirdeps.mk b/share/mk/local.gendirdeps.mk index 833ac800d643..a790cbc3b978 100644 --- a/share/mk/local.gendirdeps.mk +++ b/share/mk/local.gendirdeps.mk @@ -6,6 +6,7 @@ GENDIRDEPS_HEADER= echo '\# ${FreeBSD:L:@v@$$$v$$ @:M*F*}'; # supress optional/auto dependecies # local.dirdeps.mk will put them in if necessary GENDIRDEPS_FILTER+= \ + Nbin/cat.host \ Ngnu/lib/libssp/libssp_nonshared \ Ncddl/usr.bin/ctf* \ Nlib/clang/include \ diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 4ec1a6b8adab..6b6f8477a309 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -19,13 +19,12 @@ MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm # Some options we need now __DEFAULT_NO_OPTIONS= \ - DIRDEPS_CACHE \ DIRDEPS_BUILD \ - META_MODE \ - + DIRDEPS_CACHE __DEFAULT_DEPENDENT_OPTIONS= \ AUTO_OBJ/DIRDEPS_BUILD \ + META_MODE/DIRDEPS_BUILD \ STAGING/DIRDEPS_BUILD \ SYSROOT/DIRDEPS_BUILD -- cgit v1.2.3 From f35c8b65a68c9313b20a2b95d74a704b15385cd5 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 19 Nov 2015 00:45:36 +0000 Subject: FAST_DEPEND: Similar to r290629, do always depend on headers if 'make depend' has not ran yet. This fixes building objects directly, or skipping 'make depend', not generating required headers first. This case did work without FAST_DEPEND so there's no reason it should not work here as well. An example of this can be seen building in gnu/usr.bin/binutils/libbfd without running 'make depend' first to generate config.h. Sponsored by: EMC / Isilon Storage Division MFC after: 3 weeks X-MFC-With: r290433 --- share/mk/bsd.lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index b74c034e37f8..463b3d98e455 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -419,7 +419,7 @@ lint: ${SRCS:M*.c} .if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .if defined(LIB) && !empty(LIB) -.if ${MK_FAST_DEPEND} == "no" +.if !exists(${.OBJDIR}/${DEPENDFILE}) ${OBJS} ${STATICOBJS} ${POBJS}: ${SRCS:M*.h} .endif .for _S in ${SRCS:N*.[hly]} -- cgit v1.2.3 From 129898e521d2e3617f4af5ee406474e79273fb0d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 19 Nov 2015 03:11:20 +0000 Subject: Fix mips CPUTYPE so that we can pass it through to gcc. Keep old CPUTYPEs around for compatibility. Also include a list of typical values for FreeBSD. # Split out from other changes in D4155 Differential Revision: https://reviews.freebsd.org/D4155 --- share/mk/bsd.cpu.mk | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 2cdf25f9572c..cc1a74f5204d 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -122,19 +122,18 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64 . elif ${MACHINE_ARCH} == "powerpc64" _CPUCFLAGS = -mcpu=${CPUTYPE} . elif ${MACHINE_CPUARCH} == "mips" -. if ${CPUTYPE} == "mips32" -_CPUCFLAGS = -march=mips32 -. elif ${CPUTYPE} == "mips32r2" -_CPUCFLAGS = -march=mips32r2 -. elif ${CPUTYPE} == "mips64" -_CPUCFLAGS = -march=mips64 -. elif ${CPUTYPE} == "mips64r2" -_CPUCFLAGS = -march=mips64r2 -. elif ${CPUTYPE} == "mips4kc" -_CPUCFLAGS = -march=4kc -. elif ${CPUTYPE} == "mips24kc" -_CPUCFLAGS = -march=24kc -. endif +# mips[1234], mips32, mips64, and all later releases need to have mips +# preserved (releases later than r2 require external toolchain) +. if ${CPUTYPE:Mmips32*} != "" || ${CPUTYPE:Mmips64*} != "" || \ + ${CPUTYPE:Mmips[1234]} != "" +_CPUCFLAGS = -march=${CPUTYPE} +. else +# Default -march to the CPUTYPE passed in, with mips stripped off so we +# accept either mips4kc or 4kc, mostly for historical reasons +# Typical values for cores: +# 4kc, 24kc, 34kc, 74kc, 1004kc, octeon, octeon+, octeon2, octeon3, +# sb1, xlp, xlr +_CPUCFLAGS = -march=${CPUTYPE:S/^mips//} . elif ${MACHINE_ARCH} == "sparc64" . if ${CPUTYPE} == "v9" _CPUCFLAGS = -mcpu=v9 @@ -254,6 +253,9 @@ MACHINE_CPU = ssse3 sse3 MACHINE_CPU = sse3 . endif MACHINE_CPU += amd64 sse2 sse mmx +########## Mips +. elif ${MACHINE_CPUARCH} == "mips" +MACHINE_CPU = mips ########## powerpc . elif ${MACHINE_ARCH} == "powerpc" . if ${CPUTYPE} == "e500" -- cgit v1.2.3 From 17f6dfcca0b725f3c27778cfbd38262e3d76c51e Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 19 Nov 2015 03:55:44 +0000 Subject: Fix missing endif. --- share/mk/bsd.cpu.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index cc1a74f5204d..61beb5d62841 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -134,6 +134,7 @@ _CPUCFLAGS = -march=${CPUTYPE} # 4kc, 24kc, 34kc, 74kc, 1004kc, octeon, octeon+, octeon2, octeon3, # sb1, xlp, xlr _CPUCFLAGS = -march=${CPUTYPE:S/^mips//} +. endif . elif ${MACHINE_ARCH} == "sparc64" . if ${CPUTYPE} == "v9" _CPUCFLAGS = -mcpu=v9 -- cgit v1.2.3 From 828b0885d9ae0e6574b2877b0e8fbc8dc053fbf1 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 19 Nov 2015 17:06:12 +0000 Subject: Add arm CPUTYPE values typically used on FreeBSD. --- share/mk/bsd.cpu.mk | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 61beb5d62841..56bdd8258531 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -111,6 +111,14 @@ _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 . elif ${CPUTYPE} == "cortexa" _CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp . else +# Common values for FreeBSD +# arm: +# arm920t, arm926ej-s, marvell-pj4, fa526, fa626, +# fa606te, fa626te, fa726te +# armv6: +# arm1176jzf-s, generic-armv7-a, cortex-a5, cortex-a7, cortex-a8, +# cortex-a9, cortex-a12, cortex-a15, cortex-a17, cortex-a53, cortex-a57, +# cortex-a72, exynos-m1 _CPUCFLAGS = -mcpu=${CPUTYPE} . endif . elif ${MACHINE_ARCH} == "powerpc" -- cgit v1.2.3 From 86dd2990059d176824f675a5ae717a33dabcf293 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 19 Nov 2015 22:54:37 +0000 Subject: Remove unsupported ia64. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.meta.sys.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 230850cf6606..5c91450c4b69 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -54,7 +54,7 @@ BOOT_MACHINE_DIR.amd64 = boot/i386 MACHINE_ARCH.host = ${_HOST_ARCH} # the list of machines we support -ALL_MACHINE_LIST?= amd64 arm arm64 i386 ia64 mips pc98 powerpc sparc64 +ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips pc98 powerpc sparc64 .for m in ${ALL_MACHINE_LIST:O:u} MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m} MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]} -- cgit v1.2.3 From 1da1353262b169dadc7988b9b9d6fd4284660bf5 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 20 Nov 2015 00:22:55 +0000 Subject: META MODE: Don't stage INTERNALPROGs. This is only for sys/boot. INTERNALPROG is not a build tool, it is just a way to generate OBJS from a list of SRCS and use those objects elsewhere. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.sys.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index cad2b2f79645..6eae174a7a39 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -194,13 +194,13 @@ staging stage_libs stage_files stage_as stage_links stage_symlinks: DESTDIR= ${STAGE_OBJTOP} .if commands(beforeinstall) -.if !empty(_LIBS) || ${MK_STAGING_PROG} != "no" +.if !empty(_LIBS) || (${MK_STAGING_PROG} != "no" && !defined(INTERNALPROG)) staging: beforeinstall .endif .endif # normally only libs and includes are staged -.if ${MK_STAGING_PROG} != "no" +.if ${MK_STAGING_PROG} != "no" && !defined(INTERNALPROG) STAGE_DIR.prog= ${STAGE_OBJTOP}${BINDIR} .if !empty(PROG) || !empty(PROGS) @@ -265,7 +265,7 @@ STAGE_TARGETS+= $t STAGE_TARGETS+= stage_as .endif -.if !empty(_LIBS) || ${MK_STAGING_PROG} != "no" +.if !empty(_LIBS) || (${MK_STAGING_PROG} != "no" && !defined(INTERNALPROG)) .if !empty(LINKS) STAGE_TARGETS+= stage_links -- cgit v1.2.3 From dbd69b0dc46dd1f0bfbf14ccdfb15e1933c87e59 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 20 Nov 2015 21:49:49 +0000 Subject: Add aarch64 support to CPUTYPE --- share/mk/bsd.cpu.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 56bdd8258531..b9880a340135 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -151,6 +151,8 @@ _CPUCFLAGS = -mcpu=ultrasparc . elif ${CPUTYPE} == "ultrasparc3" _CPUCFLAGS = -mcpu=ultrasparc3 . endif +. elif ${MACHINE_CPUARCH} == "aarch64" +_CPUCFLAGS = -mcpu=${CPUTYPE} . endif # Set up the list of CPU features based on the CPU type. This is an -- cgit v1.2.3 From 1765946ba9c88737335b0cd1d018c7c60842adf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Mon, 23 Nov 2015 12:48:13 +0000 Subject: Retire the NONE cipher option. --- share/mk/src.opts.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 7aca91435da1..a5862dccd5a6 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -184,7 +184,6 @@ __DEFAULT_NO_OPTIONS = \ NAND \ OFED \ OPENLDAP \ - OPENSSH_NONE_CIPHER \ SHARED_TOOLCHAIN \ SORT_THREADS \ SVN -- cgit v1.2.3 From 440ffb7e1e7a6a0ffaf907453b1f36c088249a73 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 23 Nov 2015 23:04:52 +0000 Subject: There seems to be no reason to duplicate CANONICALOBJDIR logic from bsd.obj.mk, which is included for crunchgen builds. No change in build output occurred with this change. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.crunchgen.mk | 7 ------- 1 file changed, 7 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index 9618f5e78177..9374f333593c 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -38,13 +38,6 @@ OUTMK= ${PROG}.mk OUTC= ${PROG}.c OUTPUTS=${OUTMK} ${OUTC} ${PROG}.cache CRUNCHOBJS= ${.OBJDIR} -.if defined(MAKEOBJDIRPREFIX) -CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${.CURDIR} -.elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" -CANONICALOBJDIR:= ${MAKEOBJDIR} -.else -CANONICALOBJDIR:= /usr/obj${.CURDIR} -.endif CRUNCH_GENERATE_LINKS?= yes CLEANFILES+= ${CONF} *.o *.lo *.c *.mk *.cache *.a *.h -- cgit v1.2.3 From 7b3ea376a27ada7a61eb0c3102f13040fb8c16cb Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:10:28 +0000 Subject: META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host. This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.meta.sys.mk | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'share/mk') diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 5c91450c4b69..6df0688d0d71 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -150,6 +150,13 @@ STAGE_OBJTOP:= ${STAGE_ROOT}/${STAGE_MACHINE} STAGE_COMMON_OBJTOP:= ${STAGE_ROOT}/common STAGE_HOST_OBJTOP:= ${STAGE_ROOT}/${HOST_TARGET} +# Use tools/install.sh which can avoid the need for xinstall for simple cases. +INSTALL?= sh ${SRCTOP}/tools/install.sh +# This is for stage-install to pickup from the environment. +REAL_INSTALL:= ${INSTALL} +.export REAL_INSTALL +STAGE_INSTALL= sh ${.PARSEDIR:tA}/stage-install.sh OBJDIR=${.OBJDIR:tA} + STAGE_LIBDIR= ${STAGE_OBJTOP}${_LIBDIR:U${LIBDIR:U/lib}} STAGE_INCLUDEDIR= ${STAGE_OBJTOP}${INCLUDEDIR:U/usr/include} # this is not the same as INCLUDEDIR -- cgit v1.2.3 From bb8cd0c6f0b1108a77bc466d4d092a4af9ad14d8 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:13:32 +0000 Subject: META MODE: Revert r287879 so that 'make -V' still uses AUTO_OBJ. This has caused much confusion for myself as there are quite a lot of variables that depend on having a proper ${.OBJDIR}. Sponsored by: EMC / Isilon Storage Division --- share/mk/sys.mk | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'share/mk') diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 6b6f8477a309..ff753f44b753 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -51,11 +51,9 @@ __ENV_ONLY_OPTIONS:= \ .endif .if ${MK_AUTO_OBJ} == "yes" # This needs to be done early - before .PATH is computed -# Don't do this if just running 'make -V' (but do when inspecting .OBJDIR) or -# 'make showconfig' (during makeman which enables all options when meta mode -# is not expected) -.if (${.MAKEFLAGS:M-V} == "" || ${.MAKEFLAGS:M.OBJDIR} != "") && \ - !make(showconfig) +# Don't do this for 'make showconfig' as it enables all options where meta mode +# is not expected. +.if !make(showconfig) .sinclude .endif .endif -- cgit v1.2.3 From 02d37cd3e4685320d57f0f91ec4cef56faf75a3b Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:13:39 +0000 Subject: META MODE: Don't truncate DIRDEPS for bootstrapping during gendirdeps. Reviewed by: sjg Sponsored by: EMC / Isilon Storage Division --- share/mk/meta.autodep.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/meta.autodep.mk b/share/mk/meta.autodep.mk index 548ba539cf6d..31df822e1406 100644 --- a/share/mk/meta.autodep.mk +++ b/share/mk/meta.autodep.mk @@ -191,7 +191,7 @@ gendirdeps: ${_DEPENDFILE} # anything which matches ${_OBJROOT}* but not ${_OBJTOP}* # needs to be qualified in DIRDEPS # The pseudo machine "host" is used for HOST_TARGET -DIRDEPS = \ +DIRDEPS += \ ${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} -- cgit v1.2.3 From 5e2f7161d7ef2f1e2ee5b8739fd026439a0f0cb6 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:13:42 +0000 Subject: META MODE: Define variables this file uses that were defined elsewhere. Discussed with: sjg Sponsored by: EMC / Isilon Storage Division --- share/mk/meta.autodep.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'share/mk') diff --git a/share/mk/meta.autodep.mk b/share/mk/meta.autodep.mk index 31df822e1406..85c3e61707c3 100644 --- a/share/mk/meta.autodep.mk +++ b/share/mk/meta.autodep.mk @@ -51,6 +51,9 @@ UPDATE_DEPENDFILE = NO .endif _CURDIR ?= ${.CURDIR} +_OBJDIR ?= ${.OBJDIR} +_OBJTOP ?= ${OBJTOP} +_OBJROOT ?= ${OBJROOT:U${_OBJTOP}} _DEPENDFILE := ${_CURDIR}/${.MAKE.DEPENDFILE:T} .if ${.MAKE.LEVEL} == 0 -- cgit v1.2.3 From 08b20c637cbc2dce75b1a64d7d3a87883bac24bc Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:13:45 +0000 Subject: META MODE: Don't add staged DPADDs to DIRDEPS when bootstrapping gendirdeps. This was finding libraries that were installed into DESTDIR/usr/lib, where DESTDIR is the stage directory, and then adding in usr/lib to DIRDEPS. Just exclude the STAGE_ROOT if defined. Discussed with: sjg Sponsored by: EMC / Isilon Storage Division --- share/mk/meta.autodep.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/meta.autodep.mk b/share/mk/meta.autodep.mk index 85c3e61707c3..aa41c6e2041c 100644 --- a/share/mk/meta.autodep.mk +++ b/share/mk/meta.autodep.mk @@ -196,7 +196,7 @@ gendirdeps: ${_DEPENDFILE} # The pseudo machine "host" is used for HOST_TARGET DIRDEPS += \ ${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \ - ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} + ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:N${STAGE_ROOT:U${_OBJTOP}}/*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} .endif .endif -- cgit v1.2.3 From 80dfd0d4a2be288ae14becd7a115d9d742fb9c5e Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:44:31 +0000 Subject: META MODE: Show PATH on errors. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.sys.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk index 7022dad40891..37e1a17bb078 100644 --- a/share/mk/local.sys.mk +++ b/share/mk/local.sys.mk @@ -13,6 +13,7 @@ MAKE_PRINT_VAR_ON_ERROR+= \ MAKEOBJDIRPREFIX \ MAKESYSPATH \ MAKE_VERSION\ + PATH \ SRCTOP \ OBJTOP \ ${MAKE_PRINT_VAR_ON_ERROR_XTRAS} -- cgit v1.2.3 From b791fbe6302023b0cf00807865059c8f016fe5dc Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:44:43 +0000 Subject: META MODE: Don't create .meta files when symlinking sources into the obj directory. Tracking these leads to situations where meta mode will consider the file to be out of date if /bin/sh or /bin/ln are newer than the source file. There's no reason for meta mode to do this as make is already handling the rebuild dependency fine. Sponsored by: EMC / Isilon Storage Division --- share/mk/sys.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/sys.mk b/share/mk/sys.mk index ff753f44b753..68d2db3f415e 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -272,7 +272,7 @@ YFLAGS ?= -d # non-Posix rule set -.sh: +.sh: .NOMETA cp -fp ${.IMPSRC} ${.TARGET} chmod a+x ${.TARGET} -- cgit v1.2.3 From 4aa63711a7423cb419d1225ca4576b3614658454 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:44:51 +0000 Subject: META MODE: Fix 'make bootstrap-tools'. The main problem was bitrot after elftoolchain being swapped in for the GNU toolchain. This also reworks how the list of 'host allowed' libraries is determined to only allow INTERNALLIBs, which is needed for libelftc to come in. For usr.bin/readelf use the same hack, as libelf and libdward, to bring in the needed sys/ headers for host builds. This has not yet been a problem due to readelf not being built as a host tool in buildworld. This is possible in the meta build though when building the toolchain. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.dirdeps.mk | 21 +++++++++++++-------- share/mk/local.gendirdeps.mk | 11 +++++++++++ share/mk/src.libnames.mk | 4 ++++ 3 files changed, 28 insertions(+), 8 deletions(-) (limited to 'share/mk') diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index d83e3e8c4d83..53c176e6da67 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -28,15 +28,20 @@ DIRDEPS_FILTER+= N*.host .for m in host common M_dep_qual_fixes += C;($m),[^/.,]*$$;\1; .endfor - #.info M_dep_qual_fixes=${M_dep_qual_fixes} -# we want to supress these dependencies for host tools -# but some libs are sadly needed. -_need_host_libs= \ - lib/libc++ \ - lib/libcxxrt \ - lib/libdwarf \ - lib/libmd \ + +# Cheat for including src.libnames.mk +____: +# Pull in _INTERNALLIBS +.include + +# Host libraries should mostly be excluded from the build so the +# host version in /usr/lib is used. Internal libraries need to be +# allowed to be built though since they are never installed. +_need_host_libs= +.for lib in ${_INTERNALLIBS} +_need_host_libs+= ${LIB${lib:tu}DIR:S,^${ROOTOBJDIR}/,,} +.endfor N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}} DIRDEPS_FILTER.host = \ diff --git a/share/mk/local.gendirdeps.mk b/share/mk/local.gendirdeps.mk index a790cbc3b978..dc65d169d51e 100644 --- a/share/mk/local.gendirdeps.mk +++ b/share/mk/local.gendirdeps.mk @@ -14,6 +14,7 @@ GENDIRDEPS_FILTER+= \ Ntargets/pseudo/stage* \ Ntools/* +# Exclude toolchain which is handled special. .if ${RELDIR:Mtargets*} == "" .if ${RELDIR:Nusr.bin/clang/*:Ngnu/usr.bin/cc/*:Nlib/clang*} != "" GENDIRDEPS_FILTER.host+= \ @@ -22,7 +23,17 @@ GENDIRDEPS_FILTER.host+= \ .endif GENDIRDEPS_FILTER+= \ + Nlib/clang/include.host \ + Nusr.bin/addr2line.host \ + Nusr.bin/ar.host \ Nusr.bin/clang/clang.host \ + Nusr.bin/elfcopy.host \ + Nusr.bin/elfdump.host \ + Nusr.bin/nm.host \ + Nusr.bin/readelf.host \ + Nusr.bin/size.host \ + Nusr.bin/strings.host \ + Nusr.bin/strip.host \ Ngnu/usr.bin/cc* \ Ngnu/usr.bin/binutils*.host \ diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index d78d6e21db3f..94d41e8fa965 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -7,6 +7,9 @@ .error src.libnames.mk cannot be included directly. .endif +.if !target(____) +____: + .include .if ${.OBJDIR:S,${.CURDIR},,} != ${.OBJDIR} @@ -368,3 +371,4 @@ LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a LIBAMUDIR= ${ROOTOBJDIR}/usr.sbin/amd/libamu LIBAMU?= ${LIBAMUDIR}/libamu/libamu.a +.endif # !target(____) -- cgit v1.2.3 From cf10dd450d14de2de2a0467182390c4a370dfcea Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:44:58 +0000 Subject: Stop looking up the same id(1) results in sub-makes. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.own.mk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index cf3bee6b2f00..9f33424cae20 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -133,12 +133,23 @@ CTFCONVERT_CMD= @: .endif .if ${MK_INSTALL_AS_USER} != "no" +.if !defined(_uid) _uid!= id -u +.export _uid +.endif .if ${_uid} != 0 .if !defined(USER) -USER!= id -un +# Avoid exporting USER +.if !defined(_USER) +_USER!= id -un +.export _USER +.endif +USER= ${_USER} .endif +.if !defined(_gid) _gid!= id -g +.export _gid +.endif .for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE $xOWN= ${USER} $xGRP= ${_gid} -- cgit v1.2.3 From 2802302e6463ef88cc4d26c8c0ca3714ce39c2f6 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:45:01 +0000 Subject: META MODE: Fix MACHINE=host builds. We need to not use -nostdinc since it breaks building of clang itself. Use -isystem rather than -I/usr/include and -nostdinc which gets us using the stage include directory before searching the real host headers. This allows removing more of the -I hacks to get host headers since the headers are no longer excluded. The -B seemed unneeded. This fixes building of secure/lib/libcrypto which was looking at the /usr/include/openssl/asn1.h header rather than the staged one. This fixes building of clang which wants to find its own internal headers in the STAGEDIR/usr/lib/clang/* path. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.init.mk | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'share/mk') diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk index 8954473b2fec..f0a7abfc51a7 100644 --- a/share/mk/local.init.mk +++ b/share/mk/local.init.mk @@ -9,21 +9,20 @@ .endif .endif +# XXX: This should be combined with external compiler support in Makefile.inc1 +# and local.meta.sys.mk (CROSS_TARGET_FLAGS) .if ${MK_SYSROOT} == "yes" && !empty(SYSROOT) && ${MACHINE} != "host" CFLAGS_LAST+= --sysroot=${SYSROOT} CXXFLAGS_LAST+= --sysroot=${SYSROOT} LDADD+= --sysroot=${SYSROOT} .elif ${MK_STAGING} == "yes" -CFLAGS+= -nostdinc -CFLAGS+= -I${STAGE_INCLUDEDIR} +CFLAGS+= -isystem ${STAGE_INCLUDEDIR} +# XXX: May be needed for GCC to build with libc++ rather than libstdc++. See Makefile.inc1 +#CXXFLAGS+= -std=gnu++11 +#LDADD+= -L${STAGE_LIBDIR}/libc++ +#CXXFLAGS+= -I${STAGE_INCLUDEDIR}/usr/include/c++/v1 LDADD+= -L${STAGE_LIBDIR} .endif -.if ${MACHINE} == "host" -# we cheat? -LDADD+= -B/usr/lib -CFLAGS_LAST+= -I/usr/include -CXXFLAGS_LAST+= -I/usr/include -.endif .if ${MACHINE} == "host" .if ${.MAKE.DEPENDFILE:E} != "host" -- cgit v1.2.3 From ebf076dfa5eb89d6e7b507f84c139ff1fac3f559 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 19:49:55 +0000 Subject: Define a LIBDIR for every library that LIBADD provides. This is going to be used to allow DIRDEPS to be bootstrapped off of LIBADD/DPADD. It currently works for internal libraries which have a DIR defined for them but also use the .a library from a src-mapped obj directory. It can also be useful for using -L without a --sysroot per LIBADD to use the OBJDIR version of the libraries. I didn't review every LIBADD, so it is possible this is missing some. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.libnames.mk | 2 ++ share/mk/src.libnames.mk | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 6d3bbe7b8510..7d7faf11e235 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -10,6 +10,8 @@ .sinclude +# Src directory locations are also defined in src.libnames.mk. + LIBCRT0?= ${DESTDIR}${LIBDIR}/crt0.o LIBALIAS?= ${DESTDIR}${LIBDIR}/libalias.a diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 94d41e8fa965..bb5757818cf1 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -371,4 +371,67 @@ LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a LIBAMUDIR= ${ROOTOBJDIR}/usr.sbin/amd/libamu LIBAMU?= ${LIBAMUDIR}/libamu/libamu.a +# Define a directory for each library. This is useful for adding -L in when +# not using a --sysroot or for meta mode bootstrapping when there is no +# Makefile.depend. These are sorted by directory. +LIBAVLDIR= ${ROOTOBJDIR}/cddl/lib/libavl +LIBCTFDIR= ${ROOTOBJDIR}/cddl/lib/libctf +LIBDTRACEDIR= ${ROOTOBJDIR}/cddl/lib/libdtrace +LIBNVPAIRDIR= ${ROOTOBJDIR}/cddl/lib/libnvpair +LIBUMEMDIR= ${ROOTOBJDIR}/cddl/lib/libumem +LIBUUTILDIR= ${ROOTOBJDIR}/cddl/lib/libuutil +LIBZFSDIR= ${ROOTOBJDIR}/cddl/lib/libzfs +LIBZFS_COREDIR= ${ROOTOBJDIR}/cddl/lib/libzfs_core +LIBZPOOLDIR= ${ROOTOBJDIR}/cddl/lib/libzpool +LIBDIALOGDIR= ${ROOTOBJDIR}/gnu/lib/libdialog +LIBGCOVDIR= ${ROOTOBJDIR}/gnu/lib/libgcov +LIBGOMPDIR= ${ROOTOBJDIR}/gnu/lib/libgomp +LIBGNUREGEXDIR= ${ROOTOBJDIR}/gnu/lib/libregex +LIBSSPDIR= ${ROOTOBJDIR}/gnu/lib/libssp +LIBSSP_NONSHAREDDIR= ${ROOTOBJDIR}/gnu/lib/libssp/libssp_nonshared +LIBSUPCPLUSPLUSDIR= ${ROOTOBJDIR}/gnu/lib/libsupc++ +LIBASN1DIR= ${ROOTOBJDIR}/kerberos5/lib/libasn1 +LIBGSSAPI_KRB5DIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_krb5 +LIBGSSAPI_NTLMDIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_ntlm +LIBGSSAPI_SPNEGODIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_spnego +LIBHDBDIR= ${ROOTOBJDIR}/kerberos5/lib/libhdb +LIBHEIMBASEDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimbase +LIBHEIMIPCCDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcc +LIBHEIMIPCSDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcs +LIBHEIMNTLMDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimntlm +LIBHX509DIR= ${ROOTOBJDIR}/kerberos5/lib/libhx509 +LIBKADM5CLNTDIR= ${ROOTOBJDIR}/kerberos5/lib/libkadm5clnt +LIBKADM5SRVDIR= ${ROOTOBJDIR}/kerberos5/lib/libkadm5srv +LIBKAFS5DIR= ${ROOTOBJDIR}/kerberos5/lib/libkafs5 +LIBKDCDIR= ${ROOTOBJDIR}/kerberos5/lib/libkdc +LIBKRB5DIR= ${ROOTOBJDIR}/kerberos5/lib/libkrb5 +LIBROKENDIR= ${ROOTOBJDIR}/kerberos5/lib/libroken +LIBWINDDIR= ${ROOTOBJDIR}/kerberos5/lib/libwind +LIBALIASDIR= ${ROOTOBJDIR}/lib/libalias/libalias +LIBBLOCKSRUNTIMEDIR= ${ROOTOBJDIR}/lib/libblocksruntime +LIBBSNMPDIR= ${ROOTOBJDIR}/lib/libbsnmp/libbsnmp +LIBBSDXMLDIR= ${ROOTOBJDIR}/lib/libexpat +LIBKVMDIR= ${ROOTOBJDIR}/lib/libkvm +LIBPTHREADDIR= ${ROOTOBJDIR}/lib/libthr +LIBMDIR= ${ROOTOBJDIR}/lib/msun +LIBFORMDIR= ${ROOTOBJDIR}/lib/ncurses/form +LIBFORMLIBWDIR= ${ROOTOBJDIR}/lib/ncurses/formw +LIBMENUDIR= ${ROOTOBJDIR}/lib/ncurses/menu +LIBMENULIBWDIR= ${ROOTOBJDIR}/lib/ncurses/menuw +LIBTERMCAPDIR= ${ROOTOBJDIR}/lib/ncurses/ncurses +LIBTERMCAPWDIR= ${ROOTOBJDIR}/lib/ncurses/ncursesw +LIBPANELDIR= ${ROOTOBJDIR}/lib/ncurses/panel +LIBPANELWDIR= ${ROOTOBJDIR}/lib/ncurses/panelw +LIBCRYPTODIR= ${ROOTOBJDIR}/secure/lib/libcrypto +LIBSSHDIR= ${ROOTOBJDIR}/secure/lib/libssh +LIBSSLDIR= ${ROOTOBJDIR}/secure/lib/libssl +LIBTEKENDIR= ${ROOTOBJDIR}/sys/teken/libteken +LIBEGACYDIR= ${ROOTOBJDIR}/tools/build +LIBLNDIR= ${ROOTOBJDIR}/usr.bin/lex/lib + +# Default other library directories to lib/libNAME. +.for lib in ${_LIBRARIES} +LIB${lib:tu}DIR?= ${ROOTOBJDIR}/lib/lib${lib} +.endfor + .endif # !target(____) -- cgit v1.2.3 From c3d4829ed172d93f60980c8703793c97598e6cd3 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 22:32:16 +0000 Subject: Fix the "common object" handling to not depend on ".o" if SRCS only contains headers. This resulted in 'don't know how to make .o.' errors after the changes in r289286. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.progs.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index ad5cc184ee9a..34dae6299460 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -102,7 +102,10 @@ _PROGS_ALL_SRCS+= ${s} .endfor .endfor .if !empty(_PROGS_COMMON_SRCS) -_PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:N*.h:R:S/$/.o/g} +_PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:M*.h} +.if !empty(_PROGS_COMMON_SRCS:N*.h) +_PROGS_COMMON_OBJS+= ${_PROGS_COMMON_SRCS:N*.h:R:S/$/.o/g} +.endif ${PROGS}: ${_PROGS_COMMON_OBJS} .endif -- cgit v1.2.3 From 8ffe95d60ff018df1805d782780ae66775282890 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 25 Nov 2015 22:40:14 +0000 Subject: Follow-up r291338 to handle .d, .y and .l files better as well. X-MFC-With: r291338 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.progs.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index 34dae6299460..92a5eea56b08 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -102,9 +102,9 @@ _PROGS_ALL_SRCS+= ${s} .endfor .endfor .if !empty(_PROGS_COMMON_SRCS) -_PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:M*.h} -.if !empty(_PROGS_COMMON_SRCS:N*.h) -_PROGS_COMMON_OBJS+= ${_PROGS_COMMON_SRCS:N*.h:R:S/$/.o/g} +_PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:M*.[dhly]} +.if !empty(_PROGS_COMMON_SRCS:N*.[dhly]) +_PROGS_COMMON_OBJS+= ${_PROGS_COMMON_SRCS:N*.[dhly]:R:S/$/.o/g} .endif ${PROGS}: ${_PROGS_COMMON_OBJS} .endif -- cgit v1.2.3 From 93e779a26c651610ac6e7986d67ecc9ed2cadcbf Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 26 Nov 2015 01:14:27 +0000 Subject: META MODE: These need object directories to handle staging. Sponsored by: EMC / Isilon Storage Division --- share/mk/Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/Makefile b/share/mk/Makefile index a3560b92ff5c..b088b919eb7d 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -58,7 +58,6 @@ FILES= \ sys.dependfile.mk \ version_gen.awk -NO_OBJ= FILESDIR= ${BINDIR}/mk .if ${MK_TESTS} != "no" -- cgit v1.2.3 From 11ffa20fa01d3e834e767de538762cc11184cd5a Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 26 Nov 2015 01:47:56 +0000 Subject: Standardize on OBJTOP in and outside of META MODE. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.obj.mk | 3 + share/mk/local.dirdeps.mk | 2 +- share/mk/netbsd-tests.test.mk | 2 - share/mk/src.libnames.mk | 156 ++++++++++++++++++++---------------------- 4 files changed, 79 insertions(+), 84 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk index f94181a74791..4333a828c167 100644 --- a/share/mk/bsd.obj.mk +++ b/share/mk/bsd.obj.mk @@ -55,10 +55,13 @@ CANONICALOBJDIR= ${.OBJDIR} CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} .elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" CANONICALOBJDIR:=${MAKEOBJDIR} +OBJTOP?= ${MAKEOBJDIR} .else CANONICALOBJDIR:=/usr/obj${.CURDIR} .endif +OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} + # # Warn of unorthodox object directory. # diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 53c176e6da67..762fae402d98 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -40,7 +40,7 @@ ____: # allowed to be built though since they are never installed. _need_host_libs= .for lib in ${_INTERNALLIBS} -_need_host_libs+= ${LIB${lib:tu}DIR:S,^${ROOTOBJDIR}/,,} +_need_host_libs+= ${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} .endfor N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}} diff --git a/share/mk/netbsd-tests.test.mk b/share/mk/netbsd-tests.test.mk index 92a401bf2585..5357b089879f 100644 --- a/share/mk/netbsd-tests.test.mk +++ b/share/mk/netbsd-tests.test.mk @@ -3,8 +3,6 @@ .if !target(__netbsd_tests.test.mk__) __netbsd_tests.test.mk__: -OBJTOP?= ${.OBJDIR:S/${RELDIR}//} - TESTSRC?= ${SRCTOP}/contrib/netbsd-tests/${RELDIR:H} .if !exists(${TESTSRC}/) diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index bb5757818cf1..79da325200f0 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -12,12 +12,6 @@ ____: .include -.if ${.OBJDIR:S,${.CURDIR},,} != ${.OBJDIR} -ROOTOBJDIR= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} -.elif defined(OBJTOP) && ${.OBJDIR:M${OBJTOP}*} != "" -ROOTOBJDIR= ${OBJTOP} -.endif - _PRIVATELIBS= \ atf_c \ atf_cxx \ @@ -311,127 +305,127 @@ LDADD+= ${LDADD_${_l}} .error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". .endif -LIBELFTCDIR= ${ROOTOBJDIR}/lib/libelftc +LIBELFTCDIR= ${OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc.a -LIBREADLINEDIR= ${ROOTOBJDIR}/gnu/lib/libreadline/readline +LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a -LIBOPENBSDDIR= ${ROOTOBJDIR}/lib/libopenbsd +LIBOPENBSDDIR= ${OBJTOP}/lib/libopenbsd LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd.a -LIBSMDIR= ${ROOTOBJDIR}/lib/libsm +LIBSMDIR= ${OBJTOP}/lib/libsm LIBSM?= ${LIBSMDIR}/libsm.a -LIBSMDBDIR= ${ROOTOBJDIR}/lib/libsmdb +LIBSMDBDIR= ${OBJTOP}/lib/libsmdb LIBSMDB?= ${LIBSMDBDIR}/libsmdb.a -LIBSMUTILDIR= ${ROOTOBJDIR}/lib/libsmutil +LIBSMUTILDIR= ${OBJTOP}/lib/libsmutil LIBSMUTIL?= ${LIBSMDBDIR}/libsmutil.a -LIBNETBSDDIR?= ${ROOTOBJDIR}/lib/libnetbsd +LIBNETBSDDIR?= ${OBJTOP}/lib/libnetbsd LIBNETBSD?= ${LIBNETBSDDIR}/libnetbsd.a -LIBVERSDIR?= ${ROOTOBJDIR}/kerberos5/lib/libvers +LIBVERSDIR?= ${OBJTOP}/kerberos5/lib/libvers LIBVERS?= ${LIBVERSDIR}/libvers.a -LIBSLDIR= ${ROOTOBJDIR}/kerberos5/lib/libsl +LIBSLDIR= ${OBJTOP}/kerberos5/lib/libsl LIBSL?= ${LIBSLDIR}/libsl.a -LIBIPFDIR= ${ROOTOBJDIR}/sbin/ipf/libipf +LIBIPFDIR= ${OBJTOP}/sbin/ipf/libipf LIBIPF?= ${LIBIPFDIR}/libipf.a -LIBTELNETDIR= ${ROOTOBJDIR}/lib/libtelnet +LIBTELNETDIR= ${OBJTOP}/lib/libtelnet LIBTELNET?= ${LIBTELNETDIR}/libtelnet.a -LIBCRONDIR= ${ROOTOBJDIR}/usr.sbin/cron/lib +LIBCRONDIR= ${OBJTOP}/usr.sbin/cron/lib LIBCRON?= ${LIBCRONDIR}/libcron.a -LIBNTPDIR= ${ROOTOBJDIR}/usr.sbin/ntp/libntp +LIBNTPDIR= ${OBJTOP}/usr.sbin/ntp/libntp LIBNTP?= ${LIBNTPDIR}/libntp.a -LIBNTPEVENTDIR= ${ROOTOBJDIR}/usr.sbin/ntp/libntpevent +LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/libntpevent LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent.a -LIBOPTSDIR= ${ROOTOBJDIR}/usr.sbin/ntp/libopts +LIBOPTSDIR= ${OBJTOP}/usr.sbin/ntp/libopts LIBOTPS?= ${LIBOPTSDIR}/libopts.a -LIBPARSEDIR= ${ROOTOBJDIR}/usr.sbin/ntp/libparse +LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse LIBPARSE?= ${LIBPARSEDIR}/libparse.a -LIBLPRDIR= ${ROOTOBJDIR}/usr.sbin/lpr/common_source +LIBLPRDIR= ${OBJTOP}/usr.sbin/lpr/common_source LIBLPR?= ${LIBOPTSDIR}/liblpr.a -LIBFIFOLOGDIR= ${ROOTOBJDIR}/usr.sbin/fifolog/lib +LIBFIFOLOGDIR= ${OBJTOP}/usr.sbin/fifolog/lib LIBFIFOLOG?= ${LIBOPTSDIR}/libfifolog.a -LIBBSNMPTOOLSDIR= ${ROOTOBJDIR}/usr.sbin/bsnmpd/tools/libbsnmptools +LIBBSNMPTOOLSDIR= ${OBJTOP}/usr.sbin/bsnmpd/tools/libbsnmptools LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a -LIBAMUDIR= ${ROOTOBJDIR}/usr.sbin/amd/libamu +LIBAMUDIR= ${OBJTOP}/usr.sbin/amd/libamu LIBAMU?= ${LIBAMUDIR}/libamu/libamu.a # Define a directory for each library. This is useful for adding -L in when # not using a --sysroot or for meta mode bootstrapping when there is no # Makefile.depend. These are sorted by directory. -LIBAVLDIR= ${ROOTOBJDIR}/cddl/lib/libavl -LIBCTFDIR= ${ROOTOBJDIR}/cddl/lib/libctf -LIBDTRACEDIR= ${ROOTOBJDIR}/cddl/lib/libdtrace -LIBNVPAIRDIR= ${ROOTOBJDIR}/cddl/lib/libnvpair -LIBUMEMDIR= ${ROOTOBJDIR}/cddl/lib/libumem -LIBUUTILDIR= ${ROOTOBJDIR}/cddl/lib/libuutil -LIBZFSDIR= ${ROOTOBJDIR}/cddl/lib/libzfs -LIBZFS_COREDIR= ${ROOTOBJDIR}/cddl/lib/libzfs_core -LIBZPOOLDIR= ${ROOTOBJDIR}/cddl/lib/libzpool -LIBDIALOGDIR= ${ROOTOBJDIR}/gnu/lib/libdialog -LIBGCOVDIR= ${ROOTOBJDIR}/gnu/lib/libgcov -LIBGOMPDIR= ${ROOTOBJDIR}/gnu/lib/libgomp -LIBGNUREGEXDIR= ${ROOTOBJDIR}/gnu/lib/libregex -LIBSSPDIR= ${ROOTOBJDIR}/gnu/lib/libssp -LIBSSP_NONSHAREDDIR= ${ROOTOBJDIR}/gnu/lib/libssp/libssp_nonshared -LIBSUPCPLUSPLUSDIR= ${ROOTOBJDIR}/gnu/lib/libsupc++ -LIBASN1DIR= ${ROOTOBJDIR}/kerberos5/lib/libasn1 -LIBGSSAPI_KRB5DIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_krb5 -LIBGSSAPI_NTLMDIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_ntlm -LIBGSSAPI_SPNEGODIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_spnego -LIBHDBDIR= ${ROOTOBJDIR}/kerberos5/lib/libhdb -LIBHEIMBASEDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimbase -LIBHEIMIPCCDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcc -LIBHEIMIPCSDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcs -LIBHEIMNTLMDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimntlm -LIBHX509DIR= ${ROOTOBJDIR}/kerberos5/lib/libhx509 -LIBKADM5CLNTDIR= ${ROOTOBJDIR}/kerberos5/lib/libkadm5clnt -LIBKADM5SRVDIR= ${ROOTOBJDIR}/kerberos5/lib/libkadm5srv -LIBKAFS5DIR= ${ROOTOBJDIR}/kerberos5/lib/libkafs5 -LIBKDCDIR= ${ROOTOBJDIR}/kerberos5/lib/libkdc -LIBKRB5DIR= ${ROOTOBJDIR}/kerberos5/lib/libkrb5 -LIBROKENDIR= ${ROOTOBJDIR}/kerberos5/lib/libroken -LIBWINDDIR= ${ROOTOBJDIR}/kerberos5/lib/libwind -LIBALIASDIR= ${ROOTOBJDIR}/lib/libalias/libalias -LIBBLOCKSRUNTIMEDIR= ${ROOTOBJDIR}/lib/libblocksruntime -LIBBSNMPDIR= ${ROOTOBJDIR}/lib/libbsnmp/libbsnmp -LIBBSDXMLDIR= ${ROOTOBJDIR}/lib/libexpat -LIBKVMDIR= ${ROOTOBJDIR}/lib/libkvm -LIBPTHREADDIR= ${ROOTOBJDIR}/lib/libthr -LIBMDIR= ${ROOTOBJDIR}/lib/msun -LIBFORMDIR= ${ROOTOBJDIR}/lib/ncurses/form -LIBFORMLIBWDIR= ${ROOTOBJDIR}/lib/ncurses/formw -LIBMENUDIR= ${ROOTOBJDIR}/lib/ncurses/menu -LIBMENULIBWDIR= ${ROOTOBJDIR}/lib/ncurses/menuw -LIBTERMCAPDIR= ${ROOTOBJDIR}/lib/ncurses/ncurses -LIBTERMCAPWDIR= ${ROOTOBJDIR}/lib/ncurses/ncursesw -LIBPANELDIR= ${ROOTOBJDIR}/lib/ncurses/panel -LIBPANELWDIR= ${ROOTOBJDIR}/lib/ncurses/panelw -LIBCRYPTODIR= ${ROOTOBJDIR}/secure/lib/libcrypto -LIBSSHDIR= ${ROOTOBJDIR}/secure/lib/libssh -LIBSSLDIR= ${ROOTOBJDIR}/secure/lib/libssl -LIBTEKENDIR= ${ROOTOBJDIR}/sys/teken/libteken -LIBEGACYDIR= ${ROOTOBJDIR}/tools/build -LIBLNDIR= ${ROOTOBJDIR}/usr.bin/lex/lib +LIBAVLDIR= ${OBJTOP}/cddl/lib/libavl +LIBCTFDIR= ${OBJTOP}/cddl/lib/libctf +LIBDTRACEDIR= ${OBJTOP}/cddl/lib/libdtrace +LIBNVPAIRDIR= ${OBJTOP}/cddl/lib/libnvpair +LIBUMEMDIR= ${OBJTOP}/cddl/lib/libumem +LIBUUTILDIR= ${OBJTOP}/cddl/lib/libuutil +LIBZFSDIR= ${OBJTOP}/cddl/lib/libzfs +LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core +LIBZPOOLDIR= ${OBJTOP}/cddl/lib/libzpool +LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog +LIBGCOVDIR= ${OBJTOP}/gnu/lib/libgcov +LIBGOMPDIR= ${OBJTOP}/gnu/lib/libgomp +LIBGNUREGEXDIR= ${OBJTOP}/gnu/lib/libregex +LIBSSPDIR= ${OBJTOP}/gnu/lib/libssp +LIBSSP_NONSHAREDDIR= ${OBJTOP}/gnu/lib/libssp/libssp_nonshared +LIBSUPCPLUSPLUSDIR= ${OBJTOP}/gnu/lib/libsupc++ +LIBASN1DIR= ${OBJTOP}/kerberos5/lib/libasn1 +LIBGSSAPI_KRB5DIR= ${OBJTOP}/kerberos5/lib/libgssapi_krb5 +LIBGSSAPI_NTLMDIR= ${OBJTOP}/kerberos5/lib/libgssapi_ntlm +LIBGSSAPI_SPNEGODIR= ${OBJTOP}/kerberos5/lib/libgssapi_spnego +LIBHDBDIR= ${OBJTOP}/kerberos5/lib/libhdb +LIBHEIMBASEDIR= ${OBJTOP}/kerberos5/lib/libheimbase +LIBHEIMIPCCDIR= ${OBJTOP}/kerberos5/lib/libheimipcc +LIBHEIMIPCSDIR= ${OBJTOP}/kerberos5/lib/libheimipcs +LIBHEIMNTLMDIR= ${OBJTOP}/kerberos5/lib/libheimntlm +LIBHX509DIR= ${OBJTOP}/kerberos5/lib/libhx509 +LIBKADM5CLNTDIR= ${OBJTOP}/kerberos5/lib/libkadm5clnt +LIBKADM5SRVDIR= ${OBJTOP}/kerberos5/lib/libkadm5srv +LIBKAFS5DIR= ${OBJTOP}/kerberos5/lib/libkafs5 +LIBKDCDIR= ${OBJTOP}/kerberos5/lib/libkdc +LIBKRB5DIR= ${OBJTOP}/kerberos5/lib/libkrb5 +LIBROKENDIR= ${OBJTOP}/kerberos5/lib/libroken +LIBWINDDIR= ${OBJTOP}/kerberos5/lib/libwind +LIBALIASDIR= ${OBJTOP}/lib/libalias/libalias +LIBBLOCKSRUNTIMEDIR= ${OBJTOP}/lib/libblocksruntime +LIBBSNMPDIR= ${OBJTOP}/lib/libbsnmp/libbsnmp +LIBBSDXMLDIR= ${OBJTOP}/lib/libexpat +LIBKVMDIR= ${OBJTOP}/lib/libkvm +LIBPTHREADDIR= ${OBJTOP}/lib/libthr +LIBMDIR= ${OBJTOP}/lib/msun +LIBFORMDIR= ${OBJTOP}/lib/ncurses/form +LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw +LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu +LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw +LIBTERMCAPDIR= ${OBJTOP}/lib/ncurses/ncurses +LIBTERMCAPWDIR= ${OBJTOP}/lib/ncurses/ncursesw +LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel +LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw +LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto +LIBSSHDIR= ${OBJTOP}/secure/lib/libssh +LIBSSLDIR= ${OBJTOP}/secure/lib/libssl +LIBTEKENDIR= ${OBJTOP}/sys/teken/libteken +LIBEGACYDIR= ${OBJTOP}/tools/build +LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib # Default other library directories to lib/libNAME. .for lib in ${_LIBRARIES} -LIB${lib:tu}DIR?= ${ROOTOBJDIR}/lib/lib${lib} +LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} .endfor .endif # !target(____) -- cgit v1.2.3 From 7f911abe54fff2adbb0dfea5a7fd8e81117d6527 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 27 Nov 2015 18:58:26 +0000 Subject: Add support to libkvm for reading vmcores from other architectures. - Add a kvaddr_type to represent kernel virtual addresses instead of unsigned long. - Add a struct kvm_nlist which is a stripped down version of struct nlist that uses kvaddr_t for n_value. - Add a kvm_native() routine that returns true if an open kvm descriptor is for a native kernel and memory image. - Add a kvm_open2() function similar to kvm_openfiles(). It drops the unused 'swapfile' argument and adds a new function pointer argument for a symbol resolving function. Native kernels still use _fdnlist() from libc to resolve symbols if a resolver function is not supplied, but cross kernels require a resolver. - Add a kvm_nlist2() function similar to kvm_nlist() except that it uses struct kvm_nlist instead of struct nlist. - Add a kvm_read2() function similar to kvm_read() except that it uses kvaddr_t instead of unsigned long for the kernel virtual address. - Add a new kvm_arch switch of routines needed by a vmcore backend. Each backend is responsible for implementing kvm_read2() for a given vmcore format. - Use libelf to read headers from ELF kernels and cores (except for powerpc cores). - Add internal helper routines for the common page offset hash table used by the minidump backends. - Port all of the existing kvm backends to implement a kvm_arch switch and to be cross-friendly by using private constants instead of ones that vary by platform (e.g. PAGE_SIZE). Static assertions are present when a given backend is compiled natively to ensure the private constants match the real ones. - Enable all of the existing vmcore backends on all platforms. This means that libkvm on any platform should be able to perform KVA translation and read data from a vmcore of any platform. Tested on: amd64, i386, sparc64 (marius) Differential Revision: https://reviews.freebsd.org/D3341 --- share/mk/src.libnames.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 79da325200f0..abc75be1f206 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -180,6 +180,7 @@ _DP_geom= bsdxml sbuf _DP_cam= sbuf _DP_casper= capsicum nv pjdlog _DP_capsicum= nv +_DP_kvm= elf _DP_pjdlog= util _DP_opie= md _DP_usb= pthread -- cgit v1.2.3 From 5c15e5d0442b528e77ab448c41446d2081457d43 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Mon, 30 Nov 2015 06:56:25 +0000 Subject: Add missing lib declaration. --- share/mk/src.libnames.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index abc75be1f206..20f923a538c1 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -50,6 +50,7 @@ _INTERNALLIBS= \ _LIBRARIES= \ ${_PRIVATELIBS} \ ${_INTERNALLIBS} \ + 80211 \ alias \ archive \ asn1 \ -- cgit v1.2.3 From c7f8dda11817839a75d9589278fd3d3334ee56d3 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 00:53:17 +0000 Subject: META MODE: Always define HOST_*, even if not using them. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.meta.sys.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 6df0688d0d71..c9b0a7104c16 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -225,12 +225,13 @@ CPP?= ${HOST_CPP} .endif .endif -.if ${MACHINE} == "host" HOST_CC?= /usr/bin/cc -CC= ${HOST_CC} HOST_CXX?= /usr/bin/c++ -CXX= ${HOST_CXX} HOST_CPP?= /usr/bin/cpp + +.if ${MACHINE} == "host" +CC= ${HOST_CC} +CXX= ${HOST_CXX} CPP= ${HOST_CPP} .endif -- cgit v1.2.3 From 593e46591333d8cd1b2d40abfcfdc88d9edb40ca Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 03:00:10 +0000 Subject: FAST_DEPEND: Allow not using -MP by setting DEPEND_MP blank. -MP creates empty targets for all dependency files, which can be useful when a dependency is deleted from the file system. This would otherwise cause an error for "don't know how to build FOO" since the .depend file is included with the dependency registered. This is mostly a workaround for the misc/dahdi-kmod port using '::' for one of its dependencies, while -MP uses just ':'. This results in an 'Inconsistent operator for' error. X-MFC-With: r290433 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 2e5e48658f08..30f2b8f6c305 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -59,7 +59,8 @@ DEPENDFILE?= .depend DEPENDFILES= ${DEPENDFILE} .if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" DEPENDFILES+= ${DEPENDFILE}.* -DEPEND_CFLAGS+= -MD -MP -MF${DEPENDFILE}.${.TARGET} +DEPEND_MP?= -MP +DEPEND_CFLAGS+= -MD -MF${DEPENDFILE}.${.TARGET} DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS} -- cgit v1.2.3 From b6725ecdb25725f9fb32bb809f4e9e16ac128873 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 03:09:54 +0000 Subject: FAST_DEPEND: Workaround hacks in the wild that have '..' or '/' in OBJS. This is mostly working around the converts/iconv port having '../ces/file.o' in its OBJS list which resulted in '.depend../ces/file.o'. Now it will have '.depend.._ces_file.o'. Other implementations have :T which would result in '.depend.file.o' here, but that could lead to collisions. X-MFC-With: r291554 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 30f2b8f6c305..aac932a0941f 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -60,15 +60,18 @@ DEPENDFILES= ${DEPENDFILE} .if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" DEPENDFILES+= ${DEPENDFILE}.* DEPEND_MP?= -MP -DEPEND_CFLAGS+= -MD -MF${DEPENDFILE}.${.TARGET} +# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to +# avoid collisions. +DEPEND_FILTER= C,/,_,g +DEPEND_CFLAGS+= -MD -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS} .for __obj in ${DEPENDOBJS:O:u} .if ${.MAKEFLAGS:M-V} == "" -.sinclude "${DEPENDFILE}.${__obj}" +.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" .endif -DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj} +DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} .endfor .endif # ${MK_FAST_DEPEND} == "yes" -- cgit v1.2.3 From 3c42abd89d37b7abab115781b728417ce9329cf8 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 05:18:55 +0000 Subject: META MODE: Don't trim out lib/clang/include dependency. Doing this causes more trouble than it is worth regarding cyclic dependencies. It should not be needed after cleaning up MACHINE=host builds in r291324. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.dirdeps.mk | 4 ---- share/mk/local.gendirdeps.mk | 1 - 2 files changed, 5 deletions(-) (limited to 'share/mk') diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 762fae402d98..6c684cc63692 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -86,10 +86,6 @@ DIRDEPS += \ .endif -.if ${MK_CLANG} == "yes" && ${DEP_RELDIR:Nlib/clang/lib*:Nlib/libc*} == "" -DIRDEPS+= lib/clang/include -.endif - .if ${MK_STAGING} == "yes" # we need targets/pseudo/stage to prep the stage tree .if ${DEP_RELDIR} != "targets/pseudo/stage" diff --git a/share/mk/local.gendirdeps.mk b/share/mk/local.gendirdeps.mk index dc65d169d51e..ac22471611ed 100644 --- a/share/mk/local.gendirdeps.mk +++ b/share/mk/local.gendirdeps.mk @@ -9,7 +9,6 @@ GENDIRDEPS_FILTER+= \ Nbin/cat.host \ Ngnu/lib/libssp/libssp_nonshared \ Ncddl/usr.bin/ctf* \ - Nlib/clang/include \ Nlib/libc_nonshared \ Ntargets/pseudo/stage* \ Ntools/* -- cgit v1.2.3 From 3bed45ab81b42ff4029368ec778cd8700723c535 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 05:19:02 +0000 Subject: META MODE: Rework [bootstrapped] tools PATH support. - Support more of the toolchain from TOOLSDIR. - This also improves 'make bootstrap-tools' to pass, for example, AS=/usr/bin/as to Makefile.inc1, which will tell cross-tools to use external toolchain support and avoid building things we won't be using in the build. - Always set the PATH to contain the staged TOOLSDIR directories when not building the bootstrap targets. The previous version was only setting this at MAKE.LEVEL==0 and if the TOOLSDIR existed. Both of these prevented using staged tools that were built during the build though as DIRDEPS with .host dependencies, such as the fix for needing usr.bin/localedef.host in r291311. This is not a common tool so we must build and use it during the build, and need to be prepared to change PATH as soon as it appears. This should also fix the issue of host dependencies disappearing from Makefile.depend and then reappearing due to the start of the fresh build not having the directory yet, resulting in the tools that were built not actually being used. - Only use LEGACY_TOOLS while building in Makefile.inc1. After r291317 and r291546 there is no need to add LEGACY_TOOLS into the PATH for the pseudo/targets/toolchain build. - Because the pseudo/targets/toolchain will now build its own [clang-]tblgen, the special logic in clang.build.mk is no longer needed. - LEGACY_TOOLS is no longer used outside of targets/pseudo/bootstrap-tools so is no longer passed into the environment in its build. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.meta.sys.mk | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'share/mk') diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index c9b0a7104c16..03c4723b0b10 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -204,35 +204,41 @@ TRACER= ${TIME_STAMP} ${:U} .if ${MACHINE} == "host" MK_SHARED_TOOLCHAIN= no .endif +TOOLCHAIN_VARS= AS AR CC CLANG_TBLGEN CXX CPP LD NM OBJDUMP OBJCOPY RANLIB \ + STRINGS SIZE TBLGEN +_toolchain_bin_CLANG_TBLGEN= /usr/bin/clang-tblgen +_toolchain_bin_CXX= /usr/bin/c++ .ifdef WITH_TOOLSDIR TOOLSDIR?= ${HOST_OBJTOP}/tools -.elif defined(STAGE_HOST_OBJTOP) && exists(${STAGE_HOST_OBJTOP}/usr/bin) +.elif defined(STAGE_HOST_OBJTOP) TOOLSDIR?= ${STAGE_HOST_OBJTOP} .endif -.if !empty(TOOLSDIR) -.if ${.MAKE.LEVEL} == 0 && exists(${TOOLSDIR}/usr/bin) -PATH:= ${PATH:S,:, ,g:@d@${exists(${TOOLSDIR}$d):?${TOOLSDIR}$d:}@:ts:}:${PATH} +# Don't use the bootstrap tools logic on itself. +.if ${.TARGETS:Mbootstrap-tools} == "" && \ + !defined(BOOTSTRAPPING_TOOLS) && !empty(TOOLSDIR) && ${.MAKE.LEVEL} == 0 +.for dir in /sbin /bin /usr/sbin /usr/bin +PATH:= ${TOOLSDIR}${dir}:${PATH} +.endfor .export PATH -.if exists(${TOOLSDIR}/usr/bin/cc) -HOST_CC?= ${TOOLSDIR}/usr/bin/cc -CC?= ${HOST_CC} -HOST_CXX?= ${TOOLSDIR}/usr/bin/c++ -CXX?= ${HOST_CXX} -HOST_CPP?= ${TOOLSDIR}/usr/bin/cpp -CPP?= ${HOST_CPP} -.export HOST_CC CC HOST_CXX CXX HOST_CPP CPP -.endif +# Prefer the TOOLSDIR version of the toolchain if present vs the host version. +.for var in ${TOOLCHAIN_VARS} +_toolchain_bin.${var}= ${TOOLSDIR}${_toolchain_bin_${var}:U/usr/bin/${var:tl}} +.if exists(${_toolchain_bin.${var}}) +HOST_${var}?= ${_toolchain_bin.${var}} +${var}?= ${HOST_${var}} +.export HOST_${var} ${var} .endif +.endfor .endif -HOST_CC?= /usr/bin/cc -HOST_CXX?= /usr/bin/c++ -HOST_CPP?= /usr/bin/cpp +.for var in ${TOOLCHAIN_VARS} +HOST_${var}?= ${_toolchain_bin_${var}:U/usr/bin/${var:tl}} +.endfor .if ${MACHINE} == "host" -CC= ${HOST_CC} -CXX= ${HOST_CXX} -CPP= ${HOST_CPP} +.for var in ${TOOLCHAIN_VARS} +${var}= ${HOST_${var}} +.endfor .endif .if ${MACHINE:Nhost:Ncommon} != "" && ${MACHINE} != ${HOST_MACHINE} -- cgit v1.2.3 From b1f92fa22938fe29ab7e53692ffe0ed7a0ecc4d0 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 05:23:19 +0000 Subject: META MODE: Update dependencies with 'the-lot' and add missing directories. This is not properly respecting WITHOUT or ARCH dependencies in target/. Doing so requires a massive effort to rework targets/ to do so. A better approach will be to either include the SUBDIR Makefiles directly and map to DIRDEPS or just dynamically lookup the SUBDIR. These lose the benefit of having a userland/lib, userland/libexec, etc, though and results in a massive package. The current implementation of targets/ is very unmaintainable. Currently rescue/rescue and sys/modules are still not connected. Sponsored by: EMC / Isilon Storage Division --- share/mk/Makefile.depend | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 share/mk/Makefile.depend (limited to 'share/mk') diff --git a/share/mk/Makefile.depend b/share/mk/Makefile.depend new file mode 100644 index 000000000000..f80275d86ab1 --- /dev/null +++ b/share/mk/Makefile.depend @@ -0,0 +1,11 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif -- cgit v1.2.3 From 4902050fa5d76b58479ffde81456f8ed9d5a6dd2 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 05:29:30 +0000 Subject: META MODE: Add some basic bootstrapping support for no Makefile.depend. This will not work for bootstrapping dependencies, it will only bootstrap the top-level build directory. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.dirdeps.mk | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'share/mk') diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 6c684cc63692..10d259c4366e 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -84,7 +84,71 @@ DIRDEPS += \ cddl/usr.bin/ctfmerge.host .endif +# Bootstrap support. Give hints to DIRDEPS if there is no Makefile.depend* +# generated yet. This can be based on things such as SRC files and LIBADD. +# These hints will not factor into the final Makefile.depend as only what is +# used will be added in and handled via [local.]gendirdeps.mk. This is not +# done for MACHINE=host builds. +# XXX: Include this in local.autodep.mk as well for gendirdeps without filemon. +.if ${RELDIR} == ${DEP_RELDIR} # Only do this for main build target +.for _depfile in ${.MAKE.DEPENDFILE_PREFERENCE:T} +.if !defined(_have_depfile) && exists(${.CURDIR}/${_depfile}) +_have_depfile= .endif +.endfor +.if !defined(_have_depfile) +# Has C files. The C_DIRDEPS are shared with C++ files as well. +C_DIRDEPS= \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + +.if !empty(SRCS:M*.c) +DIRDEPS+= ${C_DIRDEPS} +.endif +# Has C++ files +.if !empty(SRCS:M*.cc) || !empty(SRCS:M*.C) || !empty(SRCS:M*.cpp) || \ + !empty(SRCS:M*.cxx) +DIRDEPS+= ${C_DIRDEPS} +.if ${MK_CLANG} == "yes" +DIRDEPS+= lib/libc++ lib/libcxxrt +.else +DIRDEPS+= gnu/lib/libstdc++ gnu/lib/libsupc++ +.endif +# XXX: Clang and GCC always adds -lm currently, even when not needed. +DIRDEPS+= lib/msun +.endif +# Has yacc files. +.if !empty(SRCS:M*.y) +DIRDEPS+= usr.bin/yacc.host +.endif +.if !empty(DPADD) +# Taken from meta.autodep.mk (where it only does something with +# BUILD_AT_LEVEL0, which we don't use). +# This only works for DPADD with full OBJ/SRC paths, which is mostly just +# _INTERNALLIBS. +DIRDEPS+= \ + ${DPADD:M${OBJTOP}*:H:C,${OBJTOP}[^/]*/,,:N.:O:u} \ + ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} +.endif +.if !empty(LIBADD) +# Also handle LIBADD for non-internal libraries. +.for _lib in ${LIBADD} +_lib${_lib}reldir= ${LIB${_lib:tu}DIR:C,${OBJTOP}/,,} +.if defined(LIB${_lib:tu}DIR) && ${DIRDEPS:M${_lib${_lib}reldir}} == "" && \ + exists(${SRCTOP}/${_lib${_lib}reldir}) +DIRDEPS+= ${_lib${_lib}reldir} +.endif +.endfor +.endif # !empty(LIBADD) +.endif # no Makefile.depend* +.endif # ${RELDIR} == ${DEP_RELDIR} + +.endif # ${DEP_MACHINE} != "host" .if ${MK_STAGING} == "yes" # we need targets/pseudo/stage to prep the stage tree -- cgit v1.2.3 From 6feede08e1efb325288df316df6d0cb3700aa1e1 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 15:50:35 +0000 Subject: FAST_DEPEND: Actually use -MP from DEPEND_MP, completing r291554. X-MFC-With: r291554 MFC after: 1 week Pointyhat to: bdrewery Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index aac932a0941f..d34b9a98c4bb 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -63,7 +63,7 @@ DEPEND_MP?= -MP # Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to # avoid collisions. DEPEND_FILTER= C,/,_,g -DEPEND_CFLAGS+= -MD -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} +DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS} -- cgit v1.2.3 From 3a42764af783cd7f421105701288e07ee76353aa Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 17:38:52 +0000 Subject: Fix underlinking in lib80211 and define static dependencies in src.libnames.mk so NO_SHARED works properly. Reported by: Manfred Antar Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 20f923a538c1..1bb0c4746266 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -162,6 +162,7 @@ _LIBRARIES= \ ypclnt \ z +_DP_80211= sbuf bsdxml _DP_archive= z bz2 lzma bsdxml .if ${MK_OPENSSL} != "no" _DP_archive+= crypto -- cgit v1.2.3 From 4910373ca8b9f0ce71a5aed1e0a679925695d7a7 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 18:09:40 +0000 Subject: Add missing LIB80211 entry for DPADD needs. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.libnames.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 7d7faf11e235..a3b0e2500837 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -14,6 +14,7 @@ LIBCRT0?= ${DESTDIR}${LIBDIR}/crt0.o +LIB80211?= ${DESTDIR}${LIBDIR}/lib80211.a LIBALIAS?= ${DESTDIR}${LIBDIR}/libalias.a LIBARCHIVE?= ${DESTDIR}${LIBDIR}/libarchive.a LIBASN1?= ${DESTDIR}${LIBDIR}/libasn1.a -- cgit v1.2.3 From f3dd2bc756d5c93f823bccacab9d9b850734c283 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 20:50:14 +0000 Subject: Support LOCAL_LIBRARIES for LIBADD. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 1bb0c4746266..310941fa0e55 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -50,6 +50,7 @@ _INTERNALLIBS= \ _LIBRARIES= \ ${_PRIVATELIBS} \ ${_INTERNALLIBS} \ + ${LOCAL_LIBRARIES} \ 80211 \ alias \ archive \ -- cgit v1.2.3 From 945ceaafbc93c05d6f622eaa5cb025c64b3425f1 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 20:56:16 +0000 Subject: Only include src.conf if _WITHOUT_SRCCONF not defined. This does not really fix anything currently since _WITHOUT_SRCCONF must be defined in the environment or local.sys.*.mk, but is proper and needed for downstream fixes. I am working towards reworking src.conf inclusion still. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.sys.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share/mk') diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk index 7b84d5149316..6c1ebb753f55 100644 --- a/share/mk/src.sys.mk +++ b/share/mk/src.sys.mk @@ -5,6 +5,7 @@ # to preserve historical (and useful) behavior. Changes here need to # be reflected there so SRCCONF isn't included multiple times. +.if !defined(_WITHOUT_SRCCONF) # Allow user to configure things that only effect src tree builds. SRCCONF?= /etc/src.conf .if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_) @@ -29,6 +30,7 @@ __postrcconf_${var}:= ${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno .endfor .endif # SRCCONF +.endif # tempting, but bsd.compiler.mk causes problems this early # probably need to remove dependence on bsd.own.mk -- cgit v1.2.3 From de52e5bdca088414f71d5faecfd7ccb42b4988d1 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 1 Dec 2015 22:19:17 +0000 Subject: Define a LIB*SRCDIR for all known _LIBRARIES. This is a follow-up to r291327 which added a LIB*DIR for all known _LIBRARIES. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.libnames.mk | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index a3b0e2500837..0165b466832a 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -152,3 +152,11 @@ LDADD:= ${LDADD:N-lpthread} -lpthread LDADD:= ${LDADD:N-lc} -lc .endif .endif + +# Only do this for src builds. +.if defined(SRCTOP) +# Derive LIB*SRCDIR from LIB*DIR +.for lib in ${_LIBRARIES} +LIB${lib:tu}SRCDIR?= ${SRCTOP}/${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} +.endfor +.endif -- cgit v1.2.3 From eaa435e79482b5323df74a4a7feb490803134384 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 00:01:09 +0000 Subject: Add assertions that capture invalid configurations for new libraries. Fix current findings. Given libfoo: - Ensure that a LIBFOO is set. For INTERNALLIBS advise setting this in src.libnames.mk, otherwise bsd.libnames.mk. - Ensure that a LIBFOODIR is properly set. - Ensure that _DP_foo is set and matches the LIBADD in the build of foo's own Makefile Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.libnames.mk | 10 ++++++++ share/mk/src.libnames.mk | 60 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 62 insertions(+), 8 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 0165b466832a..1f0028a0a3cc 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -42,6 +42,7 @@ LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a +LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a @@ -98,6 +99,7 @@ LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a +LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a LIBPJDLOG?= ${DESTDIR}${LIBDIR}/libpjdlog.a LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a @@ -117,6 +119,7 @@ LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/libssp_nonshared.a LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a +LIBSTDTHREADS?= ${DESTDIR}${LIBDIR}/libstdthreads.a LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a @@ -155,6 +158,13 @@ LDADD:= ${LDADD:N-lc} -lc # Only do this for src builds. .if defined(SRCTOP) +.if defined(_LIBRARIES) && defined(LIB) && \ + ${_LIBRARIES:M${LIB}} != "" +.if !defined(LIB${LIB:tu}) +.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR}/lib${LIB}.a +.endif +.endif + # Derive LIB*SRCDIR from LIB*DIR .for lib in ${_LIBRARIES} LIB${lib:tu}SRCDIR?= ${SRCTOP}/${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 310941fa0e55..2f49fcdfc533 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -163,6 +163,8 @@ _LIBRARIES= \ ypclnt \ z +# Each library's LIBADD needs to be duplicated here for static linkage of +# 2nd+ order consumers. _DP_80211= sbuf bsdxml _DP_archive= z bz2 lzma bsdxml .if ${MK_OPENSSL} != "no" @@ -170,6 +172,7 @@ _DP_archive+= crypto .else _DP_archive+= md .endif +_DP_sqlite3= pthread _DP_ssl= crypto _DP_ssh= crypto crypt .if ${MK_LDNS} != "no" @@ -217,7 +220,7 @@ _DP_fetch= md .endif _DP_execinfo= elf _DP_dwarf= elf -_DP_dpv= dialog figpar util +_DP_dpv= dialog figpar util ncursesw _DP_dialog= ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c @@ -232,16 +235,39 @@ _DP_pam+= ssh .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif -_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc \ - pthread +_DP_readline= ncursesw +_DP_roken= crypt +_DP_kadm5clnt= com_err krb5 roken +_DP_kadm5srv= com_err hdb krb5 roken +_DP_heimntlm= crypto com_err krb5 roken +_DP_hx509= asn1 com_err crypto roken wind +_DP_hdb= asn1 com_err krb5 roken sqlite3 +_DP_asn1= com_err roken +_DP_kdc= roken hdb hx509 krb5 heimntlm asn1 crypto +_DP_wind= com_err roken +_DP_heimbase= pthread +_DP_heimipcc= heimbase roken pthread +_DP_heimipcs= heimbase roken pthread +_DP_kafs5= asn1 krb5 roken +_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc _DP_gssapi_krb5+= gssapi krb5 crypto roken asn1 com_err _DP_lzma= pthread _DP_ucl= m _DP_vmmapi= util _DP_ctf= z _DP_proc= rtld_db util -_DP_dtrace= rtld_db pthread +_DP_dtrace= ctf elf proc pthread rtld_db _DP_xo= util +# The libc dependencies are not strictly needed but are defined to make the +# assert happy. +_DP_c= compiler_rt +.if ${MK_SSP} != "no" +_DP_c+= ssp_nonshared +.endif +_DP_stdthreads= pthread +_DP_tacplus= md +_DP_panel= ncurses +_DP_panelw= ncursesw # Define spacial cases LDADD_supcplusplus= -lsupc++ @@ -291,6 +317,7 @@ DPADD_dtrace+= ${DPADD_ctf} ${DPADD_elf} ${DPADD_proc} LDADD_dtrace+= ${LDADD_ctf} ${LDADD_elf} ${LDADD_proc} # The following depends on libraries which are using pthread +# XXX: These vars are always empty DPADD_hdb+= ${DPADD_pthread} LDADD_hdb+= ${LDADD_pthread} DPADD_kadm5srv+= ${DPADD_pthread} @@ -306,9 +333,10 @@ LDADD+= ${LDADD_${_l}} .endfor .if defined(DPADD) && ${DPADD:Mmissing-dpadd_*} -.error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". +.error ${.CURDIR}: Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". .endif +# INTERNALLIB definitions. LIBELFTCDIR= ${OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc.a @@ -352,7 +380,7 @@ LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/libntpevent LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent.a LIBOPTSDIR= ${OBJTOP}/usr.sbin/ntp/libopts -LIBOTPS?= ${LIBOPTSDIR}/libopts.a +LIBOPTS?= ${LIBOPTSDIR}/libopts.a LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse LIBPARSE?= ${LIBPARSEDIR}/libparse.a @@ -416,8 +444,10 @@ LIBFORMDIR= ${OBJTOP}/lib/ncurses/form LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw -LIBTERMCAPDIR= ${OBJTOP}/lib/ncurses/ncurses -LIBTERMCAPWDIR= ${OBJTOP}/lib/ncurses/ncursesw +LIBNCURSESDIR= ${OBJTOP}/lib/ncurses/ncurses +LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw +LIBTERMCAPDIR= ${LIBNCURSESDIR} +LIBTERMCAPWDIR= ${LIBNCURSESWDIR} LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto @@ -432,4 +462,18 @@ LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} .endfor +# Sanity check that libraries are defined here properly when building them. +.if defined(LIB) && ${_LIBRARIES:M${LIB}} != "" +.if !empty(LIBADD) && \ + (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u}) +.info ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}. Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}') +.endif +.if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}) +.error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,} +.endif +.if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu}) +.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a +.endif +.endif + .endif # !target(____) -- cgit v1.2.3 From 87a2755dee45e64670c2b170712c357cd86d9bb2 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 00:17:13 +0000 Subject: Revert incomplete r291623. --- share/mk/bsd.libnames.mk | 10 -------- share/mk/src.libnames.mk | 60 +++++++----------------------------------------- 2 files changed, 8 insertions(+), 62 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 1f0028a0a3cc..0165b466832a 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -42,7 +42,6 @@ LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a -LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a @@ -99,7 +98,6 @@ LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a -LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a LIBPJDLOG?= ${DESTDIR}${LIBDIR}/libpjdlog.a LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a @@ -119,7 +117,6 @@ LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/libssp_nonshared.a LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a -LIBSTDTHREADS?= ${DESTDIR}${LIBDIR}/libstdthreads.a LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a @@ -158,13 +155,6 @@ LDADD:= ${LDADD:N-lc} -lc # Only do this for src builds. .if defined(SRCTOP) -.if defined(_LIBRARIES) && defined(LIB) && \ - ${_LIBRARIES:M${LIB}} != "" -.if !defined(LIB${LIB:tu}) -.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR}/lib${LIB}.a -.endif -.endif - # Derive LIB*SRCDIR from LIB*DIR .for lib in ${_LIBRARIES} LIB${lib:tu}SRCDIR?= ${SRCTOP}/${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 2f49fcdfc533..310941fa0e55 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -163,8 +163,6 @@ _LIBRARIES= \ ypclnt \ z -# Each library's LIBADD needs to be duplicated here for static linkage of -# 2nd+ order consumers. _DP_80211= sbuf bsdxml _DP_archive= z bz2 lzma bsdxml .if ${MK_OPENSSL} != "no" @@ -172,7 +170,6 @@ _DP_archive+= crypto .else _DP_archive+= md .endif -_DP_sqlite3= pthread _DP_ssl= crypto _DP_ssh= crypto crypt .if ${MK_LDNS} != "no" @@ -220,7 +217,7 @@ _DP_fetch= md .endif _DP_execinfo= elf _DP_dwarf= elf -_DP_dpv= dialog figpar util ncursesw +_DP_dpv= dialog figpar util _DP_dialog= ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c @@ -235,39 +232,16 @@ _DP_pam+= ssh .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif -_DP_readline= ncursesw -_DP_roken= crypt -_DP_kadm5clnt= com_err krb5 roken -_DP_kadm5srv= com_err hdb krb5 roken -_DP_heimntlm= crypto com_err krb5 roken -_DP_hx509= asn1 com_err crypto roken wind -_DP_hdb= asn1 com_err krb5 roken sqlite3 -_DP_asn1= com_err roken -_DP_kdc= roken hdb hx509 krb5 heimntlm asn1 crypto -_DP_wind= com_err roken -_DP_heimbase= pthread -_DP_heimipcc= heimbase roken pthread -_DP_heimipcs= heimbase roken pthread -_DP_kafs5= asn1 krb5 roken -_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc +_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc \ + pthread _DP_gssapi_krb5+= gssapi krb5 crypto roken asn1 com_err _DP_lzma= pthread _DP_ucl= m _DP_vmmapi= util _DP_ctf= z _DP_proc= rtld_db util -_DP_dtrace= ctf elf proc pthread rtld_db +_DP_dtrace= rtld_db pthread _DP_xo= util -# The libc dependencies are not strictly needed but are defined to make the -# assert happy. -_DP_c= compiler_rt -.if ${MK_SSP} != "no" -_DP_c+= ssp_nonshared -.endif -_DP_stdthreads= pthread -_DP_tacplus= md -_DP_panel= ncurses -_DP_panelw= ncursesw # Define spacial cases LDADD_supcplusplus= -lsupc++ @@ -317,7 +291,6 @@ DPADD_dtrace+= ${DPADD_ctf} ${DPADD_elf} ${DPADD_proc} LDADD_dtrace+= ${LDADD_ctf} ${LDADD_elf} ${LDADD_proc} # The following depends on libraries which are using pthread -# XXX: These vars are always empty DPADD_hdb+= ${DPADD_pthread} LDADD_hdb+= ${LDADD_pthread} DPADD_kadm5srv+= ${DPADD_pthread} @@ -333,10 +306,9 @@ LDADD+= ${LDADD_${_l}} .endfor .if defined(DPADD) && ${DPADD:Mmissing-dpadd_*} -.error ${.CURDIR}: Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". +.error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". .endif -# INTERNALLIB definitions. LIBELFTCDIR= ${OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc.a @@ -380,7 +352,7 @@ LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/libntpevent LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent.a LIBOPTSDIR= ${OBJTOP}/usr.sbin/ntp/libopts -LIBOPTS?= ${LIBOPTSDIR}/libopts.a +LIBOTPS?= ${LIBOPTSDIR}/libopts.a LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse LIBPARSE?= ${LIBPARSEDIR}/libparse.a @@ -444,10 +416,8 @@ LIBFORMDIR= ${OBJTOP}/lib/ncurses/form LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw -LIBNCURSESDIR= ${OBJTOP}/lib/ncurses/ncurses -LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw -LIBTERMCAPDIR= ${LIBNCURSESDIR} -LIBTERMCAPWDIR= ${LIBNCURSESWDIR} +LIBTERMCAPDIR= ${OBJTOP}/lib/ncurses/ncurses +LIBTERMCAPWDIR= ${OBJTOP}/lib/ncurses/ncursesw LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto @@ -462,18 +432,4 @@ LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} .endfor -# Sanity check that libraries are defined here properly when building them. -.if defined(LIB) && ${_LIBRARIES:M${LIB}} != "" -.if !empty(LIBADD) && \ - (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u}) -.info ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}. Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}') -.endif -.if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}) -.error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,} -.endif -.if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu}) -.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a -.endif -.endif - .endif # !target(____) -- cgit v1.2.3 From 70b19675cd9189cb60c27740aebfc2fd829b2bd8 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 00:49:39 +0000 Subject: libssh uses libz even without MK_LDNS Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 310941fa0e55..233807e85e5a 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -171,9 +171,9 @@ _DP_archive+= crypto _DP_archive+= md .endif _DP_ssl= crypto -_DP_ssh= crypto crypt +_DP_ssh= crypto crypt z .if ${MK_LDNS} != "no" -_DP_ssh+= ldns z +_DP_ssh+= ldns .endif _DP_edit= ncursesw .if ${MK_OPENSSL} != "no" -- cgit v1.2.3 From ed8addefb28e2d327db3b16123841165001f0192 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 00:49:42 +0000 Subject: Don't overlink libmt consumers with libsbuf. This change came in r281332 which was reducing overlinking in mt(1) but currently mt(1) is linked with sbuf when it does not need it due to the LDADD_mt+=${LDADD_sbuf}. Only libmt needs sbuf. Add sbuf to _DP_mt so static linkage of libmt picks it up. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 233807e85e5a..5b5af5287665 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -208,7 +208,7 @@ _DP_proc+= ctf _DP_mp= crypto _DP_memstat= kvm _DP_magic= z -_DP_mt= bsdxml +_DP_mt= sbuf bsdxml _DP_ldns= crypto .if ${MK_OPENSSL} != "no" _DP_fetch= ssl crypto @@ -284,9 +284,6 @@ LDADD_fifolog+= ${LDADD_z} DPADD_ipf+= ${DPADD_kvm} LDADD_ipf+= ${LDADD_kvm} -DPADD_mt+= ${DPADD_sbuf} -LDADD_mt+= ${LDADD_sbuf} - DPADD_dtrace+= ${DPADD_ctf} ${DPADD_elf} ${DPADD_proc} LDADD_dtrace+= ${LDADD_ctf} ${LDADD_elf} ${LDADD_proc} -- cgit v1.2.3 From 60648601bf587653eb97f789a09fa1099d1fc044 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 00:49:49 +0000 Subject: Reduce overlinking of libdtrace consumers with libctf, libelf, libproc. The proper place for this list is _DP_dtrace. Due to removing the LDADD_dtrace, more LIBADD are needed in cddl/usr.sbin/dtrace to prevent underlinking. This fixes overlinking in cddl/usr.sbin/lockstat and cddl/usr.sbin/plockstat. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 5b5af5287665..d27f24fd1f76 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -240,7 +240,7 @@ _DP_ucl= m _DP_vmmapi= util _DP_ctf= z _DP_proc= rtld_db util -_DP_dtrace= rtld_db pthread +_DP_dtrace= ctf elf proc pthread rtld_db _DP_xo= util # Define spacial cases @@ -284,9 +284,6 @@ LDADD_fifolog+= ${LDADD_z} DPADD_ipf+= ${DPADD_kvm} LDADD_ipf+= ${LDADD_kvm} -DPADD_dtrace+= ${DPADD_ctf} ${DPADD_elf} ${DPADD_proc} -LDADD_dtrace+= ${LDADD_ctf} ${LDADD_elf} ${LDADD_proc} - # The following depends on libraries which are using pthread DPADD_hdb+= ${DPADD_pthread} LDADD_hdb+= ${LDADD_pthread} -- cgit v1.2.3 From 3d07982db63966b34f99d00eebd628da893dc495 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 00:54:05 +0000 Subject: Fix truncation of _DP_proc and add missing libelf. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index d27f24fd1f76..5a293382cde1 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -205,6 +205,7 @@ _DP_proc= supcplusplus .if ${MK_CDDL} != "no" _DP_proc+= ctf .endif +_DP_proc+= elf rtld_db util _DP_mp= crypto _DP_memstat= kvm _DP_magic= z @@ -239,7 +240,6 @@ _DP_lzma= pthread _DP_ucl= m _DP_vmmapi= util _DP_ctf= z -_DP_proc= rtld_db util _DP_dtrace= ctf elf proc pthread rtld_db _DP_xo= util -- cgit v1.2.3 From 7bce8739192c4640a82a5e1b92ddb83291eb6fe4 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 01:17:09 +0000 Subject: Don't overlink pthread to libsqlite3 consumers. At least usr.bin/mandoc was overlink. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 5a293382cde1..8864c34b7035 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -170,6 +170,7 @@ _DP_archive+= crypto .else _DP_archive+= md .endif +_DP_sqlite3= pthread _DP_ssl= crypto _DP_ssh= crypto crypt z .if ${MK_LDNS} != "no" @@ -275,9 +276,6 @@ LDADD_${_l}+= ${LDADD_${_d}} DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} -DPADD_sqlite3+= ${DPADD_pthread} -LDADD_sqlite3+= ${LDADD_pthread} - DPADD_fifolog+= ${DPADD_z} LDADD_fifolog+= ${LDADD_z} -- cgit v1.2.3 From eaab62402b27f2479c607d9e53b361b4081c1e08 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 01:23:16 +0000 Subject: Don't overlink pthread to kerberos library consumers. I'm not sure why this was here, none of these use pthread themselves and none of the consumers are broken with removing this. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 8864c34b7035..e2af97e0f359 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -282,16 +282,6 @@ LDADD_fifolog+= ${LDADD_z} DPADD_ipf+= ${DPADD_kvm} LDADD_ipf+= ${LDADD_kvm} -# The following depends on libraries which are using pthread -DPADD_hdb+= ${DPADD_pthread} -LDADD_hdb+= ${LDADD_pthread} -DPADD_kadm5srv+= ${DPADD_pthread} -LDADD_kadm5srv+= ${LDADD_pthread} -DPADD_krb5+= ${DPADD_pthread} -LDADD_krb5+= ${LDADD_pthread} -DPADD_gssapi_krb5+= ${DPADD_pthread} -LDADD_gssapi_krb5+= ${LDADD_pthread} - .for _l in ${LIBADD} DPADD+= ${DPADD_${_l}:Umissing-dpadd_${_l}} LDADD+= ${LDADD_${_l}} -- cgit v1.2.3 From 5afa19725e3c632c682eb56f559337f0d5155727 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 01:24:31 +0000 Subject: Add assertions that capture invalid configurations for new libraries. Fix current findings, which should fix cases of NO_SHARED not building properly. Given libfoo: - Ensure that a LIBFOO is set. For INTERNALLIBS advise setting this in src.libnames.mk, otherwise bsd.libnames.mk. - Ensure that a LIBFOODIR is properly set. - Ensure that _DP_foo is set and matches the LIBADD in the build of foo's own Makefile Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.libnames.mk | 10 +++++++ share/mk/src.libnames.mk | 72 ++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 73 insertions(+), 9 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 0165b466832a..1f0028a0a3cc 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -42,6 +42,7 @@ LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a +LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a @@ -98,6 +99,7 @@ LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a +LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a LIBPJDLOG?= ${DESTDIR}${LIBDIR}/libpjdlog.a LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a @@ -117,6 +119,7 @@ LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/libssp_nonshared.a LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a +LIBSTDTHREADS?= ${DESTDIR}${LIBDIR}/libstdthreads.a LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a @@ -155,6 +158,13 @@ LDADD:= ${LDADD:N-lc} -lc # Only do this for src builds. .if defined(SRCTOP) +.if defined(_LIBRARIES) && defined(LIB) && \ + ${_LIBRARIES:M${LIB}} != "" +.if !defined(LIB${LIB:tu}) +.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR}/lib${LIB}.a +.endif +.endif + # Derive LIB*SRCDIR from LIB*DIR .for lib in ${_LIBRARIES} LIB${lib:tu}SRCDIR?= ${SRCTOP}/${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index e2af97e0f359..3102d63cbcb5 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -163,6 +163,8 @@ _LIBRARIES= \ ypclnt \ z +# Each library's LIBADD needs to be duplicated here for static linkage of +# 2nd+ order consumers. Auto-generating this would be better. _DP_80211= sbuf bsdxml _DP_archive= z bz2 lzma bsdxml .if ${MK_OPENSSL} != "no" @@ -188,7 +190,7 @@ _DP_kvm= elf _DP_pjdlog= util _DP_opie= md _DP_usb= pthread -_DP_unbound= pthread +_DP_unbound= ssl crypto pthread _DP_rt= pthread .if ${MK_OPENSSL} == "no" _DP_radius= md @@ -219,7 +221,7 @@ _DP_fetch= md .endif _DP_execinfo= elf _DP_dwarf= elf -_DP_dpv= dialog figpar util +_DP_dpv= dialog figpar util ncursesw _DP_dialog= ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c @@ -234,8 +236,21 @@ _DP_pam+= ssh .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif -_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc \ - pthread +_DP_readline= ncursesw +_DP_roken= crypt +_DP_kadm5clnt= com_err krb5 roken +_DP_kadm5srv= com_err hdb krb5 roken +_DP_heimntlm= crypto com_err krb5 roken +_DP_hx509= asn1 com_err crypto roken wind +_DP_hdb= asn1 com_err krb5 roken sqlite3 +_DP_asn1= com_err roken +_DP_kdc= roken hdb hx509 krb5 heimntlm asn1 crypto +_DP_wind= com_err roken +_DP_heimbase= pthread +_DP_heimipcc= heimbase roken pthread +_DP_heimipcs= heimbase roken pthread +_DP_kafs5= asn1 krb5 roken +_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc _DP_gssapi_krb5+= gssapi krb5 crypto roken asn1 com_err _DP_lzma= pthread _DP_ucl= m @@ -243,6 +258,19 @@ _DP_vmmapi= util _DP_ctf= z _DP_dtrace= ctf elf proc pthread rtld_db _DP_xo= util +# The libc dependencies are not strictly needed but are defined to make the +# assert happy. +_DP_c= compiler_rt +.if ${MK_SSP} != "no" +_DP_c+= ssp_nonshared +.endif +_DP_stdthreads= pthread +_DP_tacplus= md +_DP_panel= ncurses +_DP_panelw= ncursesw +_DP_rpcsec_gss= gssapi +_DP_smb= kiconv +_DP_ulog= md # Define spacial cases LDADD_supcplusplus= -lsupc++ @@ -273,12 +301,21 @@ LDADD_${_l}+= ${LDADD_${_d}} .endif .endfor +# These are special cases where the library is broken and anything that uses +# it needs to add more dependencies. Many _INTERNALLIBS fall into this +# category. Unless the library itself is broken then the proper place to +# define dependencies is _DP_* above. + +# libatf-c++ exposes libatf-c abi hence we need to explicit link to atf_c for +# atf_cxx DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} +# _INTERNALLIBS. +# XXX: This should likely be reworked to have LIBADD in them and use normal +# _DP_ lists just to avoid temptation to add more similar entries here. DPADD_fifolog+= ${DPADD_z} LDADD_fifolog+= ${LDADD_z} - DPADD_ipf+= ${DPADD_kvm} LDADD_ipf+= ${LDADD_kvm} @@ -288,9 +325,10 @@ LDADD+= ${LDADD_${_l}} .endfor .if defined(DPADD) && ${DPADD:Mmissing-dpadd_*} -.error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". +.error ${.CURDIR}: Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". .endif +# INTERNALLIB definitions. LIBELFTCDIR= ${OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc.a @@ -334,7 +372,7 @@ LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/libntpevent LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent.a LIBOPTSDIR= ${OBJTOP}/usr.sbin/ntp/libopts -LIBOTPS?= ${LIBOPTSDIR}/libopts.a +LIBOPTS?= ${LIBOPTSDIR}/libopts.a LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse LIBPARSE?= ${LIBPARSEDIR}/libparse.a @@ -398,8 +436,10 @@ LIBFORMDIR= ${OBJTOP}/lib/ncurses/form LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw -LIBTERMCAPDIR= ${OBJTOP}/lib/ncurses/ncurses -LIBTERMCAPWDIR= ${OBJTOP}/lib/ncurses/ncursesw +LIBNCURSESDIR= ${OBJTOP}/lib/ncurses/ncurses +LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw +LIBTERMCAPDIR= ${LIBNCURSESDIR} +LIBTERMCAPWDIR= ${LIBNCURSESWDIR} LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto @@ -414,4 +454,18 @@ LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} .endfor +# Sanity check that libraries are defined here properly when building them. +.if defined(LIB) && ${_LIBRARIES:M${LIB}} != "" +.if !empty(LIBADD) && \ + (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u}) +.error ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}. Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}') +.endif +.if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}) +.error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,} +.endif +.if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu}) +.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a +.endif +.endif + .endif # !target(____) -- cgit v1.2.3 From 2cdf1c99f0c29d1218f83a5e94718cabb126836c Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 01:47:27 +0000 Subject: bsd.subdir.mk: Only recurse on called targets, rather than dependencies. This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig' due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of 'all'. This now adds all of the '*includes', '*files' targets as subdir targets, allowing them to recurse. This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since it no longer recurses; only 'install' will recurse and call the proper 'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory. This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE} sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids various issues such as the one fixed in r289462. As such revert Makefile.inc1 back to using 'includes' which avoids an extra tree walk and parallelizes the includes phases better. Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL, added in r289438. This is so users do not get a probably broken build if they run 'make all' from the top-level. Before the change in this commit, the workaround for 'make everything' was 'par-all' which would depend on 'all' and cause a proper parallel recursion. Now that will not work so a new _PARALLEL_SUBUDIR_OK is used to allow it. This is still part of an effort to combine bsd.(files|incs|confs).mk and move some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in r289331. This commit fixes the problems found there which was mostly double recursing during 'includes' which would recurse on itself and 'buildincludes' and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk for now. I've been cautious about this commit but have experienced no breakage on the tree except for the 'par-all' case which was already a hack. If something foo is depending on something bar that should recurse, it is very likely that the foo target is being recursed on already meaning that bar will still effectively recurse once sub-directories call foo. Discussed on: arch@ MFC after: never Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 70 ++++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 34 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index ec2585f16412..12f2fa5477d9 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -36,10 +36,11 @@ .if !target(____) ____: -ALL_SUBDIR_TARGETS= all all-man buildconfig checkdpadd clean cleandepend \ - cleandir cleanilinks cleanobj depend distribute \ - installconfig lint maninstall manlint obj objlink \ - realinstall regress tags \ +ALL_SUBDIR_TARGETS= all all-man buildconfig buildfiles buildincludes \ + checkdpadd clean cleandepend cleandir cleanilinks \ + cleanobj depend distribute files includes installconfig \ + installfiles installincludes install lint maninstall \ + manlint obj objlink regress tags \ ${SUBDIR_TARGETS} # Described above. @@ -71,6 +72,27 @@ distribute: .MAKE .endfor .endif +# Convenience targets to run 'build${target}' and 'install${target}' when +# calling 'make ${target}'. +.for __target in files includes +.if !target(${__target}) +${__target}: build${__target} install${__target} +.ORDER: build${__target} install${__target} +.endif +.endfor + +# Make 'install' supports a before and after target. Actual install +# hooks are placed in 'realinstall'. +.if !target(install) +.for __stage in before real after +.if !target(${__stage}install) +${__stage}install: +.endif +.endfor +install: beforeinstall realinstall afterinstall +.ORDER: beforeinstall realinstall afterinstall +.endif + # Subdir code shared among 'make ', 'make ' and SUBDIR_PARALLEL. _SUBDIR_SH= \ if test -d ${.CURDIR}/$${dir}.${MACHINE_ARCH}; then \ @@ -82,7 +104,7 @@ _SUBDIR_SH= \ _SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}target=${.TARGET:S,realinstall,install,}; \ + @${_+_}target=${.TARGET}; \ for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done .endif @@ -101,6 +123,10 @@ SUBDIR:= ${SUBDIR:N.WAIT} .else _is_standalone_target= 0 .endif +# Only recurse on directly-called targets. I.e., don't recurse on dependencies +# such as 'install' becoming {before,real,after}install, just recurse +# 'install'. +.if make(${__target}) .if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1 __subdir_targets= .for __dir in ${SUBDIR} @@ -116,7 +142,7 @@ __deps+= ${__target}_subdir_${__dep} .endif ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) - @${_+_}target=${__target:realinstall=install}; \ + @${_+_}target=${__target}; \ dir=${__dir}; \ ${_SUBDIR_SH}; .endif @@ -126,35 +152,11 @@ ${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR .endif # SUBDIR_PARALLEL || _is_standalone_target +.elif !target(${__target}) +${__target}: +.endif # make(${__target}) .endfor # __target in ${ALL_SUBDIR_TARGETS} -# This is to support 'make includes' calling 'make buildincludes' and -# 'make installincludes' in the proper order, and to support these -# targets as SUBDIR_TARGETS. -.for __target in files includes -.for __stage in build install -${__stage}${__target}: -.if make(${__stage}${__target}) -${__stage}${__target}: _SUBDIR -.endif -.endfor -.if !target(${__target}) -${__target}: .MAKE - ${_+_}cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} -.endif -.endfor - -.endif - -.if !target(install) -.if !target(beforeinstall) -beforeinstall: -.endif -.if !target(afterinstall) -afterinstall: -.endif -install: beforeinstall realinstall afterinstall -.ORDER: beforeinstall realinstall afterinstall -.endif +.endif # !target(_SUBDIR) .endif -- cgit v1.2.3 From 70d3d39e785c7d558eaa4e2ccc8ab43117d3de8b Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 01:49:22 +0000 Subject: Revert r291633. Some files were missed. --- share/mk/bsd.subdir.mk | 70 ++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 12f2fa5477d9..ec2585f16412 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -36,11 +36,10 @@ .if !target(____) ____: -ALL_SUBDIR_TARGETS= all all-man buildconfig buildfiles buildincludes \ - checkdpadd clean cleandepend cleandir cleanilinks \ - cleanobj depend distribute files includes installconfig \ - installfiles installincludes install lint maninstall \ - manlint obj objlink regress tags \ +ALL_SUBDIR_TARGETS= all all-man buildconfig checkdpadd clean cleandepend \ + cleandir cleanilinks cleanobj depend distribute \ + installconfig lint maninstall manlint obj objlink \ + realinstall regress tags \ ${SUBDIR_TARGETS} # Described above. @@ -72,27 +71,6 @@ distribute: .MAKE .endfor .endif -# Convenience targets to run 'build${target}' and 'install${target}' when -# calling 'make ${target}'. -.for __target in files includes -.if !target(${__target}) -${__target}: build${__target} install${__target} -.ORDER: build${__target} install${__target} -.endif -.endfor - -# Make 'install' supports a before and after target. Actual install -# hooks are placed in 'realinstall'. -.if !target(install) -.for __stage in before real after -.if !target(${__stage}install) -${__stage}install: -.endif -.endfor -install: beforeinstall realinstall afterinstall -.ORDER: beforeinstall realinstall afterinstall -.endif - # Subdir code shared among 'make ', 'make ' and SUBDIR_PARALLEL. _SUBDIR_SH= \ if test -d ${.CURDIR}/$${dir}.${MACHINE_ARCH}; then \ @@ -104,7 +82,7 @@ _SUBDIR_SH= \ _SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}target=${.TARGET}; \ + @${_+_}target=${.TARGET:S,realinstall,install,}; \ for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done .endif @@ -123,10 +101,6 @@ SUBDIR:= ${SUBDIR:N.WAIT} .else _is_standalone_target= 0 .endif -# Only recurse on directly-called targets. I.e., don't recurse on dependencies -# such as 'install' becoming {before,real,after}install, just recurse -# 'install'. -.if make(${__target}) .if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1 __subdir_targets= .for __dir in ${SUBDIR} @@ -142,7 +116,7 @@ __deps+= ${__target}_subdir_${__dep} .endif ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) - @${_+_}target=${__target}; \ + @${_+_}target=${__target:realinstall=install}; \ dir=${__dir}; \ ${_SUBDIR_SH}; .endif @@ -152,11 +126,35 @@ ${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR .endif # SUBDIR_PARALLEL || _is_standalone_target -.elif !target(${__target}) -${__target}: -.endif # make(${__target}) .endfor # __target in ${ALL_SUBDIR_TARGETS} -.endif # !target(_SUBDIR) +# This is to support 'make includes' calling 'make buildincludes' and +# 'make installincludes' in the proper order, and to support these +# targets as SUBDIR_TARGETS. +.for __target in files includes +.for __stage in build install +${__stage}${__target}: +.if make(${__stage}${__target}) +${__stage}${__target}: _SUBDIR +.endif +.endfor +.if !target(${__target}) +${__target}: .MAKE + ${_+_}cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} +.endif +.endfor + +.endif + +.if !target(install) +.if !target(beforeinstall) +beforeinstall: +.endif +.if !target(afterinstall) +afterinstall: +.endif +install: beforeinstall realinstall afterinstall +.ORDER: beforeinstall realinstall afterinstall +.endif .endif -- cgit v1.2.3 From 03173d2ff0ccd53a36e09a70405febcd2e907e5d Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 01:50:22 +0000 Subject: bsd.subdir.mk: Only recurse on called targets, rather than dependencies. This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig' due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of 'all'. This now adds all of the '*includes', '*files' targets as subdir targets, allowing them to recurse. This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since it no longer recurses; only 'install' will recurse and call the proper 'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory. This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE} sub-shell but to rather just recurse on 'inclues' and 'files'. This avoids various issues such as the one fixed in r289462. As such revert Makefile.inc1 back to using 'includes' which avoids an extra tree walk and parallelizes the includes phases better. Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL, added in r289438. This is so users do not get a probably broken build if they run 'make all' from the top-level. Before the change in this commit, the workaround for 'make everything' was 'par-all' which would depend on 'all' and cause a proper parallel recursion. Now that will not work so a new _PARALLEL_SUBUDIR_OK is used to allow it. This is still part of an effort to combine bsd.(files|incs|confs).mk and move some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in r289331. This commit fixes the problems found there which was mostly double recursing during 'includes' which would recurse on itself and 'buildincludes' and 'installincludes', all in parallel. The logic is still in bsd.subdir.mk for now. I've been cautious about this commit but have experienced no breakage on the tree except for the 'par-all' case which was already a hack. If something foo is depending on something bar that should recurse, it is very likely that the foo target is being recursed on already meaning that bar will still effectively recurse once sub-directories call foo. Discussed on: arch@ MFC after: never Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 70 ++++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 34 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index ec2585f16412..12f2fa5477d9 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -36,10 +36,11 @@ .if !target(____) ____: -ALL_SUBDIR_TARGETS= all all-man buildconfig checkdpadd clean cleandepend \ - cleandir cleanilinks cleanobj depend distribute \ - installconfig lint maninstall manlint obj objlink \ - realinstall regress tags \ +ALL_SUBDIR_TARGETS= all all-man buildconfig buildfiles buildincludes \ + checkdpadd clean cleandepend cleandir cleanilinks \ + cleanobj depend distribute files includes installconfig \ + installfiles installincludes install lint maninstall \ + manlint obj objlink regress tags \ ${SUBDIR_TARGETS} # Described above. @@ -71,6 +72,27 @@ distribute: .MAKE .endfor .endif +# Convenience targets to run 'build${target}' and 'install${target}' when +# calling 'make ${target}'. +.for __target in files includes +.if !target(${__target}) +${__target}: build${__target} install${__target} +.ORDER: build${__target} install${__target} +.endif +.endfor + +# Make 'install' supports a before and after target. Actual install +# hooks are placed in 'realinstall'. +.if !target(install) +.for __stage in before real after +.if !target(${__stage}install) +${__stage}install: +.endif +.endfor +install: beforeinstall realinstall afterinstall +.ORDER: beforeinstall realinstall afterinstall +.endif + # Subdir code shared among 'make ', 'make ' and SUBDIR_PARALLEL. _SUBDIR_SH= \ if test -d ${.CURDIR}/$${dir}.${MACHINE_ARCH}; then \ @@ -82,7 +104,7 @@ _SUBDIR_SH= \ _SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}target=${.TARGET:S,realinstall,install,}; \ + @${_+_}target=${.TARGET}; \ for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done .endif @@ -101,6 +123,10 @@ SUBDIR:= ${SUBDIR:N.WAIT} .else _is_standalone_target= 0 .endif +# Only recurse on directly-called targets. I.e., don't recurse on dependencies +# such as 'install' becoming {before,real,after}install, just recurse +# 'install'. +.if make(${__target}) .if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1 __subdir_targets= .for __dir in ${SUBDIR} @@ -116,7 +142,7 @@ __deps+= ${__target}_subdir_${__dep} .endif ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) - @${_+_}target=${__target:realinstall=install}; \ + @${_+_}target=${__target}; \ dir=${__dir}; \ ${_SUBDIR_SH}; .endif @@ -126,35 +152,11 @@ ${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR .endif # SUBDIR_PARALLEL || _is_standalone_target +.elif !target(${__target}) +${__target}: +.endif # make(${__target}) .endfor # __target in ${ALL_SUBDIR_TARGETS} -# This is to support 'make includes' calling 'make buildincludes' and -# 'make installincludes' in the proper order, and to support these -# targets as SUBDIR_TARGETS. -.for __target in files includes -.for __stage in build install -${__stage}${__target}: -.if make(${__stage}${__target}) -${__stage}${__target}: _SUBDIR -.endif -.endfor -.if !target(${__target}) -${__target}: .MAKE - ${_+_}cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} -.endif -.endfor - -.endif - -.if !target(install) -.if !target(beforeinstall) -beforeinstall: -.endif -.if !target(afterinstall) -afterinstall: -.endif -install: beforeinstall realinstall afterinstall -.ORDER: beforeinstall realinstall afterinstall -.endif +.endif # !target(_SUBDIR) .endif -- cgit v1.2.3 From 4b9378e3ba0e2eac0dd671ad62762231a6748888 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 2 Dec 2015 05:23:12 +0000 Subject: Add LIBNANDFS. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.libnames.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 1f0028a0a3cc..58df94e5d0be 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -90,6 +90,7 @@ LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a LIBMT?= ${DESTDIR}${LIBDIR}/libmt.a +LIBNANDFS?= ${DESTDIR}${LIBDIR}/libnandfs.a LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a -- cgit v1.2.3 From 1c4ced8fe8815e1c3cb5eade93e7aba6a705ffa8 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Thu, 3 Dec 2015 07:42:00 +0000 Subject: Fix a typo in a comment (spacial -> special) Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 3102d63cbcb5..a17bf8b70c40 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -272,7 +272,7 @@ _DP_rpcsec_gss= gssapi _DP_smb= kiconv _DP_ulog= md -# Define spacial cases +# Define special cases LDADD_supcplusplus= -lsupc++ LIBATF_C= ${DESTDIR}${LIBDIR}/libprivateatf-c.a LIBATF_CXX= ${DESTDIR}${LIBDIR}/libprivateatf-c++.a -- cgit v1.2.3 From d6b837de97ba66b548050706f4e51fd5014e612d Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 3 Dec 2015 22:39:42 +0000 Subject: Revert r288966 as it is redundant and not right. bsd.prog.mk and bsd.lib.mk already make OBJS depend on headers when there is not .OBJDIR/.depend file, which is still true for the initial meta mode builds. If there was something to benefit the meta mode build here then it should be extended to the non-meta mode build as well. Some of the problems here were just DPSRCS being hooked up wrongly, fixed in r291330. The logic itself is flawed as 'buildfiles' is in a different part of the dependency tree than the objects and headers are, so the objects will still be built independent from 'buildfiles'. 'buildfiles' is not ordered in the build before objects. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.autodep.mk | 6 ------ 1 file changed, 6 deletions(-) (limited to 'share/mk') diff --git a/share/mk/local.autodep.mk b/share/mk/local.autodep.mk index 8ea5ca63d319..8223fec14bc0 100644 --- a/share/mk/local.autodep.mk +++ b/share/mk/local.autodep.mk @@ -14,12 +14,6 @@ LDFLAGS+= ${LDFLAGS_LAST} CLEANFILES+= .depend -.for h in ${SRCS:M*.h} -.if target($h) -buildfiles: $h -.endif -.endfor - # handy for debugging .SUFFIXES: .S .c .cc .cpp .cpp-out -- cgit v1.2.3 From bd1944cacc8cd9e506ad934f6a3ad0a8c1fc0c6a Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 03:17:04 +0000 Subject: DIRDEPS_BUILD: For the bootstrapped LIBADD from DPADD, resolve paths to RELDIR. This allows the LIBDEPS/DPADD for the clang build to not have ../../../lib/clang/* in DIRDEPS. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.dirdeps.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 10d259c4366e..a24d01278d55 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -131,9 +131,11 @@ DIRDEPS+= usr.bin/yacc.host # BUILD_AT_LEVEL0, which we don't use). # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. -DIRDEPS+= \ - ${DPADD:M${OBJTOP}*:H:C,${OBJTOP}[^/]*/,,:N.:O:u} \ +_DP_DIRDEPS+= \ + ${DPADD:M${OBJTOP}*:H:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} +# Resolve the paths to RELDIRs +DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,} .endif .if !empty(LIBADD) # Also handle LIBADD for non-internal libraries. -- cgit v1.2.3 From 249f51a492bc82730415727f8f0a4c30e6aaaae7 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 03:17:07 +0000 Subject: DIRDEPS_BUILD: Install new Makefile.depend files atomically. Sponsored by: EMC / Isilon Storage Division --- share/mk/install-new.mk | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/install-new.mk b/share/mk/install-new.mk index 469e986b2458..5e95c99be242 100644 --- a/share/mk/install-new.mk +++ b/share/mk/install-new.mk @@ -32,9 +32,23 @@ CmpCp= CmpCp() { \ cp $$src $$target; \ fi; } +# Replace the file if they are different and make a backup if desired +CmpReplace= CmpReplace() { \ + src=$$1 target=$$2 _bak=$$3; \ + if ! test -s $$target || ! cmp -s $$target $$src; then \ + trap "" 1 2 3 15; \ + if test -s $$target; then \ + if test "x$$_bak" != x; then \ + rm -f $$target$$_bak; \ + cp -f $$target $$target$$_bak; \ + fi; \ + fi; \ + mv -f $$src $$target; \ + fi; } + # If the .new file is different, we want it. # Note: this function will work as is for *.new$RANDOM" -InstallNew= ${CmpCp}; InstallNew() { \ +InstallNew= ${CmpReplace}; InstallNew() { \ _t=-e; _bak=; \ while :; do \ case "$$1" in \ @@ -46,7 +60,7 @@ InstallNew= ${CmpCp}; InstallNew() { \ for new in "$$@"; do \ if test $$_t $$new; then \ target=`expr $$new : '\(.*\).new'`; \ - CmpCp $$new $$target $$_bak; \ + CmpReplace $$new $$target $$_bak; \ fi; \ rm -f $$new; \ done; :; } -- cgit v1.2.3 From 568f2ee1583dadc7e6bc2b050146c4df25bb169f Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 03:17:10 +0000 Subject: Don't create a Makefile.depend in share/mk. This would cause it to be included everywhere in the build since it is the MAKESYSPATH. This leads to including dirdeps.mk more times than desired. Sponsored by: EMC / Isilon Storage Division --- share/mk/Makefile | 5 +++++ share/mk/Makefile.depend | 11 ----------- 2 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 share/mk/Makefile.depend (limited to 'share/mk') diff --git a/share/mk/Makefile b/share/mk/Makefile index b088b919eb7d..ac3fd94a7f07 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -6,6 +6,11 @@ # will read this Makefile since it auto includes it into -I. .if ${.CURDIR} == ${.PARSEDIR} +# Avoid creating a Makefile.depend here as it would get included anywhere +# in the build, similar to the problem above. It would cause dirdeps.mk +# to be included more times than desired. +UPDATE_DEPENDFILE= no + .include FILES= \ diff --git a/share/mk/Makefile.depend b/share/mk/Makefile.depend deleted file mode 100644 index f80275d86ab1..000000000000 --- a/share/mk/Makefile.depend +++ /dev/null @@ -1,11 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif -- cgit v1.2.3 From 7aab86d59df82d80fbeb9c3fa826255574b5193c Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 03:17:17 +0000 Subject: For INTERNALLIB always add in the corresponding _DP_ and use LIBADD in the real build file. This lessens the need to define DPADD_ and LDADD_ to just very special cases. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index a17bf8b70c40..7c0d3a1a41f1 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -271,6 +271,8 @@ _DP_panelw= ncursesw _DP_rpcsec_gss= gssapi _DP_smb= kiconv _DP_ulog= md +_DP_fifolog= z +_DP_ipf= kvm # Define special cases LDADD_supcplusplus= -lsupc++ @@ -293,7 +295,9 @@ LDADD_${_l}?= -lprivate${_l} .else LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l} .endif -.if defined(_DP_${_l}) && defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO") +# Add in all dependencies for static linkage. +.if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || \ + (defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO"))) .for _d in ${_DP_${_l}} DPADD_${_l}+= ${DPADD_${_d}} LDADD_${_l}+= ${LDADD_${_d}} @@ -302,23 +306,17 @@ LDADD_${_l}+= ${LDADD_${_d}} .endfor # These are special cases where the library is broken and anything that uses -# it needs to add more dependencies. Many _INTERNALLIBS fall into this -# category. Unless the library itself is broken then the proper place to -# define dependencies is _DP_* above. +# it needs to add more dependencies. Broken usually means that it has a +# cyclic dependency and cannot link its own dependencies. This is bad, please +# fix the library instead. +# Unless the library itself is broken then the proper place to define +# dependencies is _DP_* above. # libatf-c++ exposes libatf-c abi hence we need to explicit link to atf_c for # atf_cxx DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} -# _INTERNALLIBS. -# XXX: This should likely be reworked to have LIBADD in them and use normal -# _DP_ lists just to avoid temptation to add more similar entries here. -DPADD_fifolog+= ${DPADD_z} -LDADD_fifolog+= ${LDADD_z} -DPADD_ipf+= ${DPADD_kvm} -LDADD_ipf+= ${LDADD_kvm} - .for _l in ${LIBADD} DPADD+= ${DPADD_${_l}:Umissing-dpadd_${_l}} LDADD+= ${LDADD_${_l}} -- cgit v1.2.3 From 353092224019d0193f744076aef2aaa84b769ed0 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 03:17:21 +0000 Subject: Support all of the CDDL/ZFS libraries for LIBADD. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 7c0d3a1a41f1..a0f9e9b29bce 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -121,6 +121,7 @@ _LIBRARIES= \ netgraph \ ngatm \ nv \ + nvpair \ opie \ pam \ panel \ @@ -152,16 +153,22 @@ _LIBRARIES= \ ufs \ ugidfw \ ulog \ + umem \ usb \ usbhid \ util \ + uutil \ vmmapi \ wind \ wrap \ xo \ y \ ypclnt \ - z + z \ + zfs_core \ + zfs \ + zpool \ + # Each library's LIBADD needs to be duplicated here for static linkage of # 2nd+ order consumers. Auto-generating this would be better. @@ -273,6 +280,10 @@ _DP_smb= kiconv _DP_ulog= md _DP_fifolog= z _DP_ipf= kvm +_DP_zfs= md pthread umem util uutil m nvpair avl bsdxml geom nvpair z \ + zfs_core +_DP_zfs_core= nvpair +_DP_zpool= md pthread z nvpair avl umem # Define special cases LDADD_supcplusplus= -lsupc++ -- cgit v1.2.3 From 2fd6394d343802517b376e54de75f382eb7307d0 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 03:17:24 +0000 Subject: Rework unknown LIBADD assertion to be more clear and to not suggest adding DPADD/LDADD_ variables that are a special case. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index a0f9e9b29bce..ef3cf5043641 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -329,14 +329,10 @@ DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} .for _l in ${LIBADD} -DPADD+= ${DPADD_${_l}:Umissing-dpadd_${_l}} +DPADD+= ${DPADD_${_l}} LDADD+= ${LDADD_${_l}} .endfor -.if defined(DPADD) && ${DPADD:Mmissing-dpadd_*} -.error ${.CURDIR}: Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". -.endif - # INTERNALLIB definitions. LIBELFTCDIR= ${OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc.a @@ -463,6 +459,16 @@ LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} .endfor +# Validate that listed LIBADD are valid. +.for _l in ${LIBADD} +.if empty(_LIBRARIES:M${_l}) +_BADLIBADD+= ${_l} +.endif +.endfor +.if !empty(_BADLIBADD) +.error ${.CURDIR}: Invalid LIBADD used which may need to be added to ${_this:T}: ${_BADLIBADD} +.endif + # Sanity check that libraries are defined here properly when building them. .if defined(LIB) && ${_LIBRARIES:M${LIB}} != "" .if !empty(LIBADD) && \ -- cgit v1.2.3 From eacae6dc66aa881c102f11e2003174eea7e8af74 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 03:17:47 +0000 Subject: Fix LDADD/DPADD that should be LIBADD. Sponsored by: EMC / Isilon Storage Division --- share/mk/netbsd-tests.test.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/netbsd-tests.test.mk b/share/mk/netbsd-tests.test.mk index 5357b089879f..c1c9f91a4a6d 100644 --- a/share/mk/netbsd-tests.test.mk +++ b/share/mk/netbsd-tests.test.mk @@ -18,8 +18,7 @@ LIBNETBSD_OBJDIR= ${OBJTOP}/lib/libnetbsd CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR} -DPADD.$t+= ${LIBNETBSD} -LDADD.$t+= -lnetbsd +LIBADD.${t}+= netbsd SRCS.$t?= ${t:C/^/t_/:C/_test$//g}.c .endfor -- cgit v1.2.3 From 7b861220dfa517e25c36204d5c38270ea52b942b Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 03:17:59 +0000 Subject: Add assertion for when LIBADD should be used rather than LDADD/DPADD. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index ef3cf5043641..15d30ccb106b 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -328,6 +328,16 @@ LDADD_${_l}+= ${LDADD_${_d}} DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} +# Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here. +.for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,} +.if ${_LIBRARIES:M${_l}} +_BADLDADD+= ${_l} +.endif +.endfor +.if !empty(_BADLDADD) +.error ${.CURDIR}: These libraries should be LIBADD+=foo rather than DPADD/LDADD+=-lfoo: ${_BADLDADD} +.endif + .for _l in ${LIBADD} DPADD+= ${DPADD_${_l}} LDADD+= ${LDADD_${_l}} -- cgit v1.2.3 From b4f9ba38eec1ed9705644bb739c678852ec40f5b Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 07:54:04 +0000 Subject: Rearrange some common logic. --- share/mk/bsd.subdir.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 12f2fa5477d9..1854d99449e8 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -116,17 +116,17 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE # Work around parsing of .if nested in .for by putting .WAIT string into a var. __wait= .WAIT .for __target in ${ALL_SUBDIR_TARGETS} +# Only recurse on directly-called targets. I.e., don't recurse on dependencies +# such as 'install' becoming {before,real,after}install, just recurse +# 'install'. +.if make(${__target}) # Can ordering be skipped for this and SUBDIR_PARALLEL forced? -.if make(${__target}) && ${STANDALONE_SUBDIR_TARGETS:M${__target}} +.if ${STANDALONE_SUBDIR_TARGETS:M${__target}} _is_standalone_target= 1 SUBDIR:= ${SUBDIR:N.WAIT} .else _is_standalone_target= 0 .endif -# Only recurse on directly-called targets. I.e., don't recurse on dependencies -# such as 'install' becoming {before,real,after}install, just recurse -# 'install'. -.if make(${__target}) .if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1 __subdir_targets= .for __dir in ${SUBDIR} -- cgit v1.2.3 From 85874b565c37b208b68c0101a21fa2baaee0b6b2 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 07:54:13 +0000 Subject: Fix 'afterinstall' order not being respected after my changes in r291635. The problem was that 'afterinstall' was not coming after SUBDIRs were installed which was the expectation at least in sys/modules for kldxref. Reported by: np Pointyhat to: bdrewery Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 1854d99449e8..68096ac7be8e 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -39,7 +39,7 @@ ____: ALL_SUBDIR_TARGETS= all all-man buildconfig buildfiles buildincludes \ checkdpadd clean cleandepend cleandir cleanilinks \ cleanobj depend distribute files includes installconfig \ - installfiles installincludes install lint maninstall \ + installfiles installincludes realinstall lint maninstall \ manlint obj objlink regress tags \ ${SUBDIR_TARGETS} @@ -104,7 +104,7 @@ _SUBDIR_SH= \ _SUBDIR: .USEBEFORE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}target=${.TARGET}; \ + @${_+_}target=${.TARGET:realinstall=install}; \ for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done .endif @@ -118,8 +118,9 @@ __wait= .WAIT .for __target in ${ALL_SUBDIR_TARGETS} # Only recurse on directly-called targets. I.e., don't recurse on dependencies # such as 'install' becoming {before,real,after}install, just recurse -# 'install'. -.if make(${__target}) +# 'install'. Despite that, 'realinstall' is special due to ordering issues +# with 'afterinstall'. +.if make(${__target}) || (${__target} == realinstall && make(install)) # Can ordering be skipped for this and SUBDIR_PARALLEL forced? .if ${STANDALONE_SUBDIR_TARGETS:M${__target}} _is_standalone_target= 1 @@ -142,7 +143,7 @@ __deps+= ${__target}_subdir_${__dep} .endif ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) - @${_+_}target=${__target}; \ + @${_+_}target=${__target:realinstall=install}; \ dir=${__dir}; \ ${_SUBDIR_SH}; .endif -- cgit v1.2.3 From 0368d219ac978fd22e5baa33d20f343d0976b67d Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 07:54:16 +0000 Subject: The .if redirection on .WAIT is no longer needed with bmake. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 68096ac7be8e..dc1dbbfe182c 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -113,8 +113,6 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE dir=${.TARGET}; \ ${_SUBDIR_SH}; -# Work around parsing of .if nested in .for by putting .WAIT string into a var. -__wait= .WAIT .for __target in ${ALL_SUBDIR_TARGETS} # Only recurse on directly-called targets. I.e., don't recurse on dependencies # such as 'install' becoming {before,real,after}install, just recurse @@ -131,7 +129,7 @@ _is_standalone_target= 0 .if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1 __subdir_targets= .for __dir in ${SUBDIR} -.if ${__wait} == ${__dir} +.if ${__dir} == .WAIT __subdir_targets+= .WAIT .else __subdir_targets+= ${__target}_subdir_${__dir} -- cgit v1.2.3 From 2231cd21d84c7fd22c6e42dc8192e9c1bd687fe6 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 4 Dec 2015 07:54:19 +0000 Subject: Fix 'install*' and many other missing targets with DIRDEPS_BUILD. My changes in r291635 broke 'make install*' for DIRDEPS_BUILD but also revealed that some other targets were not guaranteed to be created if there was a SUBDIR defined. One example is 'installfiles' was never defined if SUBDIR was not empty. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.subdir.mk | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index dc1dbbfe182c..aacd1b327e7e 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -56,12 +56,6 @@ STANDALONE_SUBDIR_TARGETS?= obj checkdpadd clean cleandepend cleandir \ _SUBDIR: .endif .endif -.if !target(_SUBDIR) - -.if defined(SUBDIR) -SUBDIR:=${SUBDIR} ${SUBDIR.yes} -SUBDIR:=${SUBDIR:u} -.endif DISTRIBUTION?= base .if !target(distribute) @@ -93,6 +87,14 @@ install: beforeinstall realinstall afterinstall .ORDER: beforeinstall realinstall afterinstall .endif +# SUBDIR recursing may be disabled for MK_DIRDEPS_BUILD +.if !target(_SUBDIR) + +.if defined(SUBDIR) +SUBDIR:=${SUBDIR} ${SUBDIR.yes} +SUBDIR:=${SUBDIR:u} +.endif + # Subdir code shared among 'make ', 'make ' and SUBDIR_PARALLEL. _SUBDIR_SH= \ if test -d ${.CURDIR}/$${dir}.${MACHINE_ARCH}; then \ @@ -151,11 +153,16 @@ ${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR .endif # SUBDIR_PARALLEL || _is_standalone_target -.elif !target(${__target}) -${__target}: .endif # make(${__target}) .endfor # __target in ${ALL_SUBDIR_TARGETS} .endif # !target(_SUBDIR) +# Ensure all targets exist +.for __target in ${ALL_SUBDIR_TARGETS} +.if !target(${__target}) +${__target}: +.endif +.endfor + .endif -- cgit v1.2.3 From 72543839597e14f5e14b0b83b5f6f59cc6bb7051 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 6 Dec 2015 07:00:23 +0000 Subject: Remove redundant default TESTSDIR that is already defined in bsd.test.mk after r289158 MFC after: 1 week X-MFC with: r289158 Sponsored by: EMC / Isilon Storage Division --- share/mk/suite.test.mk | 4 ---- 1 file changed, 4 deletions(-) (limited to 'share/mk') diff --git a/share/mk/suite.test.mk b/share/mk/suite.test.mk index c447a171bf52..579ef7c3d805 100644 --- a/share/mk/suite.test.mk +++ b/share/mk/suite.test.mk @@ -8,10 +8,6 @@ .error suite.test.mk cannot be included directly. .endif -# Directory in which to install tests defined by the current Makefile. -# Makefiles have to override this to point to a subdirectory of TESTSBASE. -TESTSDIR?= . - # Name of the test suite these tests belong to. Should rarely be changed for # Makefiles built into the FreeBSD src tree. TESTSUITE?= FreeBSD -- cgit v1.2.3 From 765086c5daea4c6ee5cf14a712f4cc996c1e083c Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 6 Dec 2015 07:30:18 +0000 Subject: Remove unused atf.test.mk variables - ATF_BUILD_CC - ATF_BUILD_CPP - ATF_BUILD_CXX - ATF_SHELL - ATF_PREFIX MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- share/mk/atf.test.mk | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'share/mk') diff --git a/share/mk/atf.test.mk b/share/mk/atf.test.mk index 6f99d88fc78a..babecd9f6a84 100644 --- a/share/mk/atf.test.mk +++ b/share/mk/atf.test.mk @@ -22,29 +22,6 @@ ATF_TESTS_C?= ATF_TESTS_CXX?= ATF_TESTS_SH?= -# Path to the prefix of the installed ATF tools, if any. -# -# If atf-run and atf-report are installed from ports, we automatically define a -# realregress target below to run the tests using these tools. The tools are -# searched for in the hierarchy specified by this variable. -ATF_PREFIX?= /usr/local - -# C compiler passed to ATF tests that need to build code. -ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc -TESTS_ENV+= ATF_BUILD_CC=${ATF_BUILD_CC} - -# C preprocessor passed to ATF tests that need to build code. -ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp -TESTS_ENV+= ATF_BUILD_CPP=${ATF_BUILD_CPP} - -# C++ compiler passed to ATF tests that need to build code. -ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++ -TESTS_ENV+= ATF_BUILD_CXX=${ATF_BUILD_CXX} - -# Shell interpreter used to run atf-sh(1) based tests. -ATF_SHELL?= ${DESTDIR}/bin/sh -TESTS_ENV+= ATF_SHELL=${ATF_SHELL} - .if !empty(ATF_TESTS_C) PROGS+= ${ATF_TESTS_C} _TESTS+= ${ATF_TESTS_C} -- cgit v1.2.3 From 69afbf02758a23040bf392b9d4a48ca2962d7408 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:16 +0000 Subject: FAST_DEPEND: Only try to use dependencies from C/C++ SRCS as mkdep did. Rather than try to guess at all of the OBJS variables just use SRCS using the same patterns that mkdep does. This also fixes a mistake where dependencies were being generated with FAST_DEPEND when they were not for mkdep. This happens when OBJS!=SRCS as is the case in gnu/lib/csu where SRCS has 1 file and OBJS has several other files that does not even contain the 1 SRCS file. Generally in these cases the OBJS have custom dependencies defined in their Makefile. If we generate dependencies for those and then load a .depend file, then .IMPSRC may contain duplicate sources and lead to errors such as: cc: error: cannot specify -o when generating multiple output files MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index d34b9a98c4bb..50a53085183d 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -66,7 +66,10 @@ DEPEND_FILTER= C,/,_,g DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} -DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS} +DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} +.if !empty(DEPENDSRCS) +DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} +.endif .for __obj in ${DEPENDOBJS:O:u} .if ${.MAKEFLAGS:M-V} == "" .sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" -- cgit v1.2.3 From b9964333e0c8b895bf967ba0925147cf0ed87ab5 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:19 +0000 Subject: FAST_DEPEND: Move handling code below yacc/lex/dtrace code that modified SRCS. This fixes some of those newly added SRCS not having their depend files included. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 50a53085183d..35b9de07cca2 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -57,26 +57,6 @@ _MKDEPCC+= ${DEPFLAGS} MKDEPCMD?= CC='${_MKDEPCC}' mkdep DEPENDFILE?= .depend DEPENDFILES= ${DEPENDFILE} -.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" -DEPENDFILES+= ${DEPENDFILE}.* -DEPEND_MP?= -MP -# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to -# avoid collisions. -DEPEND_FILTER= C,/,_,g -DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} -DEPEND_CFLAGS+= -MT${.TARGET} -CFLAGS+= ${DEPEND_CFLAGS} -DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} -.if !empty(DEPENDSRCS) -DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} -.endif -.for __obj in ${DEPENDOBJS:O:u} -.if ${.MAKEFLAGS:M-V} == "" -.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" -.endif -DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} -.endfor -.endif # ${MK_FAST_DEPEND} == "yes" # Keep `tags' here, before SRCS are mangled below for `depend'. .if !target(tags) && defined(SRCS) && !defined(NO_TAGS) @@ -168,7 +148,29 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} .endfor beforedepend: ${DHDRS} beforebuild: ${DHDRS} + + +.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" +DEPENDFILES+= ${DEPENDFILE}.* +DEPEND_MP?= -MP +# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to +# avoid collisions. +DEPEND_FILTER= C,/,_,g +DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} +DEPEND_CFLAGS+= -MT${.TARGET} +CFLAGS+= ${DEPEND_CFLAGS} +DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} +.if !empty(DEPENDSRCS) +DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} +.endif +.for __obj in ${DEPENDOBJS:O:u} +.if ${.MAKEFLAGS:M-V} == "" +.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" .endif +DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} +.endfor +.endif # ${MK_FAST_DEPEND} == "yes" +.endif # defined(SRCS) .if ${MK_DIRDEPS_BUILD} == "yes" .include -- cgit v1.2.3 From 10f696a52d68f76b894d036068c53c792d0830c3 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:22 +0000 Subject: FAST_DEPEND: Only pass -MF if we care about the object being compiled. This will save time generating dependency files that we didn't expect due to cases where SRCS!=OBJS or for building custom targetted objects in Makefiles that do not end up in the DEPENDOBJS list. This uses a bmake trick to modify CFLAGS based on ${.TARGET}. A .PARSEDIR check is done for the sake of MFC safety. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 7 +++++++ share/mk/bsd.lib.mk | 2 ++ 2 files changed, 9 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 35b9de07cca2..87491fe368e1 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -158,7 +158,14 @@ DEPEND_MP?= -MP DEPEND_FILTER= C,/,_,g DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} +.if defined(.PARSEDIR) +# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS +# as those are the only ones we will include. +DEPEND_CFLAGS_CONDITION= !empty(DEPENDOBJS:M${.TARGET:${DEPEND_FILTER}}) +CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:} +.else CFLAGS+= ${DEPEND_CFLAGS} +.endif DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} .if !empty(DEPENDSRCS) DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 463b3d98e455..6e26cff5dcd3 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -182,6 +182,7 @@ lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) _LIBS+= lib${LIB_PRIVATE}${LIB}_p.a POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} +DEPENDOBJS+= ${POBJS} CLEANFILES+= ${POBJS} lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @@ -194,6 +195,7 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) SOBJS+= ${OBJS:.o=.So} +DEPENDOBJS+= ${SOBJS} CLEANFILES+= ${SOBJS} .endif -- cgit v1.2.3 From 015dfda6c6c705e8faa4964c8164a239b8edd248 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Mon, 7 Dec 2015 19:15:52 +0000 Subject: Build and install userland .debug files by default Debug data files are now built by default with 'make buildworld' and installed with 'make installworld'. This facilitates debugging but requires more disk space both during the build and for the installed world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes in src.conf(5). Reviewed by: bdrewery, eadler, vangyzen Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4018 --- share/mk/bsd.opts.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index d242da5a59fd..3c2732247336 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -50,6 +50,7 @@ ____: __DEFAULT_YES_OPTIONS = \ ASSERT_DEBUG \ + DEBUG_FILES \ DOCCOMPRESS \ INCLUDES \ INSTALLLIB \ @@ -69,7 +70,6 @@ __DEFAULT_NO_OPTIONS = \ CCACHE_BUILD \ FAST_DEPEND \ CTF \ - DEBUG_FILES \ INSTALL_AS_USER \ STALE_STAGED -- cgit v1.2.3 From 9229b1797a95d2bb9da52ff19fcf6d6b1c21393b Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 8 Dec 2015 17:09:17 +0000 Subject: Fix some makeman issues. - Don't bother looking up REVISION/BRANCH/etc from release/, or the CPUTYPE check, as these are not used for makeman and wastes time. The also invokes auto.obj.mk after I reverted auto.obj.mk ignoring -V in r291312. - Don't modify CC or PATH when WITH_CCACHE_BUILD or WITH_META_MODE is enabled as it leads to bsd.compiler.mk errors. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.compiler.mk | 1 + share/mk/local.meta.sys.mk | 1 + 2 files changed, 2 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 30da2aff8857..e5d349adf738 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -30,6 +30,7 @@ ____: # Handle ccache after CC is determined, but not if CC/CXX are already # overridden with a manual setup. .if ${MK_CCACHE_BUILD:Uno} == "yes" && \ + !make(showconfig) && \ (${CC:M*ccache/world/*} == "" || ${CXX:M*ccache/world/*} == "") # CC is always prepended with the ccache wrapper rather than modifying # PATH since it is more clear that ccache is used and avoids wasting time diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 03c4723b0b10..1e0fef8bb4c1 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -215,6 +215,7 @@ TOOLSDIR?= ${STAGE_HOST_OBJTOP} .endif # Don't use the bootstrap tools logic on itself. .if ${.TARGETS:Mbootstrap-tools} == "" && \ + !make(showconfig) && \ !defined(BOOTSTRAPPING_TOOLS) && !empty(TOOLSDIR) && ${.MAKE.LEVEL} == 0 .for dir in /sbin /bin /usr/sbin /usr/bin PATH:= ${TOOLSDIR}${dir}:${PATH} -- cgit v1.2.3 From fb9def88bd2257c7654b144782f0396a4eb1e47b Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 8 Dec 2015 17:56:40 +0000 Subject: META MODE: Define a STAGE_TARGET_OBJTOP and export it alone with STAGE_OBJTOP and STAGE_HOST_OBJTOP. These will always be overridden in sub-makes when building in-tree, but are exported for the benefit of hooking in external builds, such as ports. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.meta.sys.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'share/mk') diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 1e0fef8bb4c1..a97f6f272b59 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -148,7 +148,11 @@ STAGE_MACHINE:= ${TARGET_OBJ_SPEC} .endif STAGE_OBJTOP:= ${STAGE_ROOT}/${STAGE_MACHINE} STAGE_COMMON_OBJTOP:= ${STAGE_ROOT}/common +STAGE_TARGET_OBJTOP:= ${STAGE_ROOT}/${TARGET_OBJ_SPEC} STAGE_HOST_OBJTOP:= ${STAGE_ROOT}/${HOST_TARGET} +# These are exported for hooking in out-of-tree builds. They will always +# be overridden in sub-makes above when building in-tree. +.export STAGE_OBJTOP STAGE_TARGET_OBJTOP STAGE_HOST_OBJTOP # Use tools/install.sh which can avoid the need for xinstall for simple cases. INSTALL?= sh ${SRCTOP}/tools/install.sh -- cgit v1.2.3 From 1cee64a8c7daf06635c7802afaa1fc7957fdbb61 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 8 Dec 2015 19:19:26 +0000 Subject: Add comment explaining aarch64's BROKEN_OPTIONS In-tree bintuils and GCC do not support aarch64 or other recent architectures. --- share/mk/src.opts.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index a5862dccd5a6..094019d578d2 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -228,6 +228,7 @@ __DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC .endif +# In-tree binutils/gcc are older versions without modern architecture support. .if ${__T} == "aarch64" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB __DEFAULT_YES_OPTIONS+=ELFCOPY_AS_OBJCOPY -- cgit v1.2.3 From b7df39cc12e77c05f54a0257f4b355ea808f5408 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 8 Dec 2015 20:20:40 +0000 Subject: CCACHE_BUILD: Only export CCACHE_PATH= if it was already set with a value. Older ccache don't work with an empty CCACHE_PATH value. They will error with: ccache: FATAL: Could not find compiler "cc" in PATH make: "/mnt/bdrewery/git/onefs/src/share/mk/bsd.compiler.mk" line 134: Unable to determine compiler type for /usr/local/bin/ccache cc. Consider setting COMPILER_TYPE. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.compiler.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index e5d349adf738..d7763e4e06b4 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -64,8 +64,10 @@ CCACHE_COMPILERCHECK?= mtime # Remove ccache from the PATH to prevent double calls and wasted CPP/LD time. PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g} # Ensure no bogus CCACHE_PATH leaks in which might avoid the in-tree compiler. +.if !empty(CCACHE_PATH) CCACHE_PATH= .export CCACHE_PATH +.endif # Override various toolchain vars. .for var in CC CXX HOST_CC HOST_CXX .if defined(${var}) && ${${var}:M${CCACHE_BIN}} == "" -- cgit v1.2.3 From 5e99f8430da85660a913054efc43805ca93c21da Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 10 Dec 2015 00:07:05 +0000 Subject: Sort the LIB list. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.libnames.mk | 18 +++++++++--------- share/mk/src.libnames.mk | 5 +++-- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 58df94e5d0be..901006760073 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -27,22 +27,22 @@ LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a -LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a -LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a LIBC?= ${DESTDIR}${LIBDIR}/libc.a -LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a LIBCAM?= ${DESTDIR}${LIBDIR}/libcam.a LIBCAPSICUM?= ${DESTDIR}${LIBDIR}/libcapsicum.a LIBCASPER?= ${DESTDIR}${LIBDIR}/libcasper.a -LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a LIBCOMPAT?= ${DESTDIR}${LIBDIR}/libcompat.a LIBCOMPILER_RT?=${DESTDIR}${LIBDIR}/libcompiler_rt.a +LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a +LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a +LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a +LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a @@ -59,9 +59,9 @@ LIBFIGPAR?= ${DESTDIR}${LIBDIR}/libfigpar.a LIBFL?= "don't use LIBFL, use LIBL" LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a -LIBGPIO?= ${DESTDIR}${LIBDIR}/libgpio.a LIBGEOM?= ${DESTDIR}${LIBDIR}/libgeom.a LIBGNUREGEX?= ${DESTDIR}${LIBDIR}/libgnuregex.a +LIBGPIO?= ${DESTDIR}${LIBDIR}/libgpio.a LIBGSSAPI?= ${DESTDIR}${LIBDIR}/libgssapi.a LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR}/libgssapi_krb5.a LIBHDB?= ${DESTDIR}${LIBDIR}/libhdb.a @@ -109,8 +109,8 @@ LIBPROCSTAT?= ${DESTDIR}${LIBDIR}/libprocstat.a LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a LIBROKEN?= ${DESTDIR}${LIBDIR}/libroken.a -LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR}/librpcsec_gss.a +LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a LIBRT?= ${DESTDIR}${LIBDIR}/librt.a LIBRTLD_DB?= ${DESTDIR}${LIBDIR}/librtld_db.a LIBSBUF?= ${DESTDIR}${LIBDIR}/libsbuf.a @@ -128,18 +128,18 @@ LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP" LIBTINFO?= "don't use LIBTINFO, use LIBNCURSES" LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a +LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a -LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a -LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a +LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmapi.a LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a -LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBXO?= ${DESTDIR}${LIBDIR}/libxo.a +LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBY?= ${DESTDIR}${LIBDIR}/liby.a LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a LIBZ?= ${DESTDIR}${LIBDIR}/libz.a diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 15d30ccb106b..18f8d7c3e2f6 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -453,8 +453,6 @@ LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw LIBNCURSESDIR= ${OBJTOP}/lib/ncurses/ncurses LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw -LIBTERMCAPDIR= ${LIBNCURSESDIR} -LIBTERMCAPWDIR= ${LIBNCURSESWDIR} LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto @@ -464,6 +462,9 @@ LIBTEKENDIR= ${OBJTOP}/sys/teken/libteken LIBEGACYDIR= ${OBJTOP}/tools/build LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib +LIBTERMCAPDIR= ${LIBNCURSESDIR} +LIBTERMCAPWDIR= ${LIBNCURSESWDIR} + # Default other library directories to lib/libNAME. .for lib in ${_LIBRARIES} LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} -- cgit v1.2.3 From de1f9ee2340e22a5b47298935730c75a1f782f70 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 10 Dec 2015 00:07:11 +0000 Subject: Convert contrib/ofed libraries to LIBADD. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.libnames.mk | 13 +++++++++++++ share/mk/src.libnames.mk | 30 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 901006760073..596aa0a62faf 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -41,6 +41,7 @@ LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a +LIBCXGB4?= ${DESTDIR}${LIBDIR}/libcxgb4.a LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a @@ -69,6 +70,12 @@ LIBHEIMBASE?= ${DESTDIR}${LIBDIR}/libheimbase.a LIBHEIMNTLM?= ${DESTDIR}${LIBDIR}/libheimntlm.a LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR}/libheimsqlite.a LIBHX509?= ${DESTDIR}${LIBDIR}/libhx509.a +LIBIBCM?= ${DESTDIR}${LIBDIR}/libibcm.a +LIBIBCOMMON?= ${DESTDIR}${LIBDIR}/libibcommon.a +LIBIBMAD?= ${DESTDIR}${LIBDIR}/libibmad.a +LIBIBSDP?= ${DESTDIR}${LIBDIR}/libibsdp.a +LIBIBUMAD?= ${DESTDIR}${LIBDIR}/libibumad.a +LIBIBVERBS?= ${DESTDIR}${LIBDIR}/libibverbs.a LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec.a LIBJAIL?= ${DESTDIR}${LIBDIR}/libjail.a LIBKADM5CLNT?= ${DESTDIR}${LIBDIR}/libkadm5clnt.a @@ -88,8 +95,10 @@ LIBMD?= ${DESTDIR}${LIBDIR}/libmd.a LIBMEMSTAT?= ${DESTDIR}${LIBDIR}/libmemstat.a LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a +LIBMLX4?= ${DESTDIR}${LIBDIR}/libmlx4.a LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a LIBMT?= ${DESTDIR}${LIBDIR}/libmt.a +LIBMTHCA?= ${DESTDIR}${LIBDIR}/libmthca.a LIBNANDFS?= ${DESTDIR}${LIBDIR}/libnandfs.a LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a @@ -97,7 +106,10 @@ LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a LIBNV?= ${DESTDIR}${LIBDIR}/libnv.a LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a +LIBOPENSM?= ${DESTDIR}${LIBDIR}/libopensm.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a +LIBOSMCOMP?= ${DESTDIR}${LIBDIR}/libosmcomp.a +LIBOSMVENDOR?= ${DESTDIR}${LIBDIR}/libosmvendor.a LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a @@ -108,6 +120,7 @@ LIBPROC?= ${DESTDIR}${LIBDIR}/libproc.a LIBPROCSTAT?= ${DESTDIR}${LIBDIR}/libprocstat.a LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a +LIBRDMACM?= ${DESTDIR}${LIBDIR}/librdmacm.a LIBROKEN?= ${DESTDIR}${LIBDIR}/libroken.a LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR}/librpcsec_gss.a LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 18f8d7c3e2f6..c77cefa8f76e 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -169,6 +169,23 @@ _LIBRARIES= \ zfs \ zpool \ +.if ${MK_OFED} != "no" +_LIBRARIES+= \ + cxgb4 \ + ibcm \ + ibcommon \ + ibmad \ + ibsdp \ + ibumad \ + ibverbs \ + mlx4 \ + mthca \ + opensm \ + osmcomp \ + osmvendor \ + rdmacm \ + +.endif # Each library's LIBADD needs to be duplicated here for static linkage of # 2nd+ order consumers. Auto-generating this would be better. @@ -416,6 +433,19 @@ LIBUUTILDIR= ${OBJTOP}/cddl/lib/libuutil LIBZFSDIR= ${OBJTOP}/cddl/lib/libzfs LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core LIBZPOOLDIR= ${OBJTOP}/cddl/lib/libzpool +LIBCXGB4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libcxgb4 +LIBIBCMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcm +LIBIBCOMMONDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcommon +LIBIBMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibmad +LIBIBUMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibumad +LIBIBVERBSDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibverbs +LIBMLX4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libmlx4 +LIBMTHCADIR= ${OBJTOP}/contrib/ofed/usr.lib/libmthca +LIBOPENSMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libopensm +LIBOSMCOMPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmcomp +LIBOSMVENDORDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmvendor +LIBRDMACMDIR= ${OBJTOP}/contrib/ofed/usr.lib/librdmacm +LIBIBSDPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libsdp LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog LIBGCOVDIR= ${OBJTOP}/gnu/lib/libgcov LIBGOMPDIR= ${OBJTOP}/gnu/lib/libgomp -- cgit v1.2.3 From 9ca543438039680a5d20bb14be971f7a26124530 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 11 Dec 2015 05:39:44 +0000 Subject: Move the inclusion of bsd.cpu.mk from sys.mk to bsd.opts.mk. However, for historical behavior that ports depends on, include it if we're inside the ports tree. Differential Review: https://reviews.freebsd.org/D4383 Ports Exp run: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205021 --- share/mk/bsd.opts.mk | 2 ++ share/mk/sys.mk | 9 +++++++++ 2 files changed, 11 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 3c2732247336..e2c56acd8b5a 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -104,6 +104,8 @@ MK_${var}:=no MK_STALE_STAGED= no .endif +.include + .endif # !_WITHOUT_SRCCONF .endif diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 68d2db3f415e..632c116d3326 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -406,6 +406,15 @@ __MAKE_SHELL?=/bin/sh path=${__MAKE_SHELL} .endif +# Hack for ports compatibility. Historically, ports makefiles have +# assumed hey can examine MACHINE_CPU without including anything +# because this was automatically included in sys.mk. For /usr/src, +# this file has moved to being included from bsd.opts.mk. Until all +# the ports files are modernized, and a reasonable transitition +# period has passed, include it while we're in a ports tree here +# to preserve historic behavior. +.if exists(${.CURDIR}/../../Mk/bsd.port.mk) .include +.endif .endif # ! Posix -- cgit v1.2.3 From fd48e7a5af8314c3755ddbb209ea14eaed91aa7b Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 11 Dec 2015 05:39:45 +0000 Subject: Handle CPUTYPE=armv[4567]* better. gcc expects those to be either -march=foo or -mcpu=generic-foo. Catch the armvX* case and pass the right args for it. --- share/mk/bsd.cpu.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index b9880a340135..1ab7595272dc 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -110,7 +110,12 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 . elif ${CPUTYPE} == "cortexa" _CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp -. else +. elif ${CPUTYPE:Marmv[4567]*} != "" +# Handle all the armvX types that FreeBSD runs: +# armv4, armv4t, armv5, armv5te, armv6, armv6t2, armv7, armv7-a, armv7ve +# they require -march=. All the others require -mcpu=. +_CPUCFLAGS = -march=${CPUTYPE} +. else # Common values for FreeBSD # arm: # arm920t, arm926ej-s, marvell-pj4, fa526, fa626, @@ -120,7 +125,7 @@ _CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp # cortex-a9, cortex-a12, cortex-a15, cortex-a17, cortex-a53, cortex-a57, # cortex-a72, exynos-m1 _CPUCFLAGS = -mcpu=${CPUTYPE} -. endif +. endif . elif ${MACHINE_ARCH} == "powerpc" . if ${CPUTYPE} == "e500" _CPUCFLAGS = -Wa,-me500 -msoft-float -- cgit v1.2.3 From 682d8404961952c4a36fcfb5ff26b2748b6c3dc1 Mon Sep 17 00:00:00 2001 From: Marcelo Araujo Date: Fri, 11 Dec 2015 07:24:25 +0000 Subject: Fix minor typos introduced on r292084. Approved by: rodrigc (mentor) Differential Revision: https://reviews.freebsd.org/D4495 --- share/mk/sys.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 632c116d3326..f9ac4183185f 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -407,10 +407,10 @@ __MAKE_SHELL?=/bin/sh .endif # Hack for ports compatibility. Historically, ports makefiles have -# assumed hey can examine MACHINE_CPU without including anything +# assumed they can examine MACHINE_CPU without including anything # because this was automatically included in sys.mk. For /usr/src, # this file has moved to being included from bsd.opts.mk. Until all -# the ports files are modernized, and a reasonable transitition +# the ports files are modernized, and a reasonable transition # period has passed, include it while we're in a ports tree here # to preserve historic behavior. .if exists(${.CURDIR}/../../Mk/bsd.port.mk) -- cgit v1.2.3 From 1fdcc5e5c0dfd70bdd34c02e9e24b8496706fd95 Mon Sep 17 00:00:00 2001 From: Ruslan Bukin Date: Fri, 11 Dec 2015 22:55:23 +0000 Subject: Start support for the RISC-V 64-bit architecture developed by UC Berkeley. RISC-V is a new ISA designed to support computer research and education, and is now become a standard open architecture for industry implementations. This is a minimal set of changes required to run 'make kernel-toolchain' using external (GNU) toolchain. The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv. Reviewed by: andrew, bdrewery, emaste, imp Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4445 --- share/mk/bsd.cpu.mk | 11 +++++++++++ share/mk/bsd.endian.mk | 1 + share/mk/bsd.sys.mk | 5 +++++ share/mk/local.meta.sys.mk | 3 ++- share/mk/src.opts.mk | 7 ++++++- share/mk/sys.mk | 2 +- 6 files changed, 26 insertions(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 1ab7595272dc..d54a354ec47a 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -18,6 +18,8 @@ MACHINE_CPU = i486 MACHINE_CPU = mips . elif ${MACHINE_CPUARCH} == "powerpc" MACHINE_CPU = aim +. elif ${MACHINE_CPUARCH} == "riscv" +MACHINE_CPU = riscv . elif ${MACHINE_CPUARCH} == "sparc64" MACHINE_CPU = ultrasparc . endif @@ -148,6 +150,8 @@ _CPUCFLAGS = -march=${CPUTYPE} # sb1, xlp, xlr _CPUCFLAGS = -march=${CPUTYPE:S/^mips//} . endif +. elif ${MACHINE_CPUARCH} == "riscv" +_CPUCFLAGS = -msoft-float # -march="RV64I" # RISCVTODO . elif ${MACHINE_ARCH} == "sparc64" . if ${CPUTYPE} == "v9" _CPUCFLAGS = -mcpu=v9 @@ -277,6 +281,9 @@ MACHINE_CPU = mips . if ${CPUTYPE} == "e500" MACHINE_CPU = booke softfp . endif +########## riscv +. elif ${MACHINE_CPUARCH} == "riscv" +MACHINE_CPU = riscv ########## sparc64 . elif ${MACHINE_ARCH} == "sparc64" . if ${CPUTYPE} == "v9" @@ -313,6 +320,10 @@ CFLAGS += -mfloat-abi=softfp .endif .endif +.if ${MACHINE_CPUARCH} == "riscv" +CFLAGS += -msoft-float +.endif + # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk .if !defined(NO_CPU_CFLAGS) diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk index 2d1a53ed3685..c7ec42cb2876 100644 --- a/share/mk/bsd.endian.mk +++ b/share/mk/bsd.endian.mk @@ -4,6 +4,7 @@ ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "i386" || \ (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} == "") || \ + ${MACHINE_CPUARCH} == "riscv" || \ ${MACHINE_ARCH:Mmips*el} != "" TARGET_ENDIANNESS= 1234 .elif ${MACHINE_ARCH} == "powerpc" || \ diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 6eae174a7a39..de62195b84fd 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -109,6 +109,11 @@ CWARNFLAGS+= -Werror CWARNFLAGS+= -Wno-format .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} +# GCC 5.2.0 +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50200 +CWARNFLAGS+= -Wno-error=unused-function -Wno-error=enum-compare -Wno-error=logical-not-parentheses -Wno-error=bool-compare -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=clobbered -Wno-error=cast-align -Wno-error=extra -Wno-error=attributes -Wno-error=inline -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=strict-aliasing -Wno-error=address +.endif + # How to handle FreeBSD custom printf format specifiers. .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index a97f6f272b59..1aa749abd231 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -48,13 +48,14 @@ TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipsn32el TARGET_ARCHES_powerpc?= powerpc powerpc64 TARGET_ARCHES_pc98?= i386 +TARGET_ARCHES_riscv?= riscv64 # some corner cases BOOT_MACHINE_DIR.amd64 = boot/i386 MACHINE_ARCH.host = ${_HOST_ARCH} # the list of machines we support -ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips pc98 powerpc sparc64 +ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips pc98 powerpc riscv sparc64 .for m in ${ALL_MACHINE_LIST:O:u} MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m} MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]} diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 094019d578d2..f94e63acaf7d 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -229,12 +229,17 @@ __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC .endif # In-tree binutils/gcc are older versions without modern architecture support. -.if ${__T} == "aarch64" +.if ${__T} == "aarch64" || ${__T} == "riscv64" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB __DEFAULT_YES_OPTIONS+=ELFCOPY_AS_OBJCOPY .else __DEFAULT_NO_OPTIONS+=ELFCOPY_AS_OBJCOPY .endif +.if ${__T} == "riscv64" +BROKEN_OPTIONS+=PROFILE # "sorry, unimplemented: profiler support for RISC-V" +BROKEN_OPTIONS+=TESTS # "undefined reference to `_Unwind_Resume'" +BROKEN_OPTIONS+=CXX # "libcxxrt.so: undefined reference to `_Unwind_Resume_or_Rethrow'" +.endif # LLVM lacks support for FreeBSD 64-bit atomic operations for ARMv4/ARMv5 .if ${__T} == "arm" || ${__T} == "armeb" BROKEN_OPTIONS+=LLDB diff --git a/share/mk/sys.mk b/share/mk/sys.mk index f9ac4183185f..8fe6b68d0ac1 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX. # and/or endian. This is called MACHINE_CPU in NetBSD, but that's used # for something different in FreeBSD. # -MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} +MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/:C/riscv64/riscv/} .endif -- cgit v1.2.3 From 54f8ee8840de848bc454448f5019ac1de869b599 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 11 Dec 2015 22:55:41 +0000 Subject: DIRDEPS_BUILD: Don't force C dependencies on kernel modules for bootstrapping. These use ld(1), effectively -nostdlib, and don't need any of these normal dependencies. kmod builds also define PROG so just checking for KMOD here seems to be the easiest to handle it. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.dirdeps.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index a24d01278d55..3e088306524e 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -97,6 +97,8 @@ _have_depfile= .endif .endfor .if !defined(_have_depfile) +# KMOD does not use any stdlibs. +.if !defined(KMOD) # Has C files. The C_DIRDEPS are shared with C++ files as well. C_DIRDEPS= \ gnu/lib/csu \ @@ -121,7 +123,8 @@ DIRDEPS+= gnu/lib/libstdc++ gnu/lib/libsupc++ .endif # XXX: Clang and GCC always adds -lm currently, even when not needed. DIRDEPS+= lib/msun -.endif +.endif # CXX +.endif # !defined(KMOD) # Has yacc files. .if !empty(SRCS:M*.y) DIRDEPS+= usr.bin/yacc.host -- cgit v1.2.3 From e610b45868525b6fba2c08bdadfb8e7e042c4213 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 14 Dec 2015 21:00:00 +0000 Subject: Let termcap be used in LIBADD. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index c77cefa8f76e..089bf9e3329e 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -149,6 +149,7 @@ _LIBRARIES= \ stdthreads \ supcplusplus \ tacplus \ + termcap \ termcapw \ ufs \ ugidfw \ -- cgit v1.2.3 From 89401452f3e066affbd8eae19db36e088d57173f Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Mon, 14 Dec 2015 22:42:05 +0000 Subject: Allow overriding FILESDIRs for snmp files. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.snmpmod.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.snmpmod.mk b/share/mk/bsd.snmpmod.mk index 552f936dc656..ccd57b7c7b24 100644 --- a/share/mk/bsd.snmpmod.mk +++ b/share/mk/bsd.snmpmod.mk @@ -16,12 +16,12 @@ ${MOD}_tree.c ${MOD}_tree.h: ${MOD}_tree.def ${EXTRAMIBDEFS} .if defined(DEFS) FILESGROUPS+= DEFS -DEFSDIR= ${SHAREDIR}/snmp/defs +DEFSDIR?= ${SHAREDIR}/snmp/defs .endif .if defined(BMIBS) FILESGROUPS+= BMIBS -BMIBSDIR= ${SHAREDIR}/snmp/mibs +BMIBSDIR?= ${SHAREDIR}/snmp/mibs .endif .include -- cgit v1.2.3 From d6fb4894981bcd8641fbe8cab52057dc2a58ad3a Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 15 Dec 2015 00:05:07 +0000 Subject: Start on a new library (libsysdecode) that provides routines for decoding system call information such as system call arguments. Initially this will consist of pulling duplicated code out of truss and kdump though it may prove useful for other utilities in the future. This commit moves the shared utrace(2) record parser out of kdump into the library and updates kdump and truss to use it. One difference from the previous version is that the library version treats unknown events that start with the "RTLD" signature as unknown events. This simplifies the interface and allows the consumer to decide how to handle all non-recognized events. Instead, this function only generates a string description for known malloc() and RTLD records. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4537 --- share/mk/bsd.libnames.mk | 1 + share/mk/src.libnames.mk | 1 + 2 files changed, 2 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk index 596aa0a62faf..d22f99a89c10 100644 --- a/share/mk/bsd.libnames.mk +++ b/share/mk/bsd.libnames.mk @@ -134,6 +134,7 @@ LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/libssp_nonshared.a LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a LIBSTDTHREADS?= ${DESTDIR}${LIBDIR}/libstdthreads.a +LIBSYSDECODE?= ${DESTDIR}${LIBDIR}/libsysdecode.a LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 089bf9e3329e..4a99fa2f238a 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -148,6 +148,7 @@ _LIBRARIES= \ ssp_nonshared \ stdthreads \ supcplusplus \ + sysdecode \ tacplus \ termcap \ termcapw \ -- cgit v1.2.3 From aaa345b8ae2227beeff731a3c055d25ff5d692a4 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 15 Dec 2015 00:16:34 +0000 Subject: Follow-up r291739: Don't suggest LDADD on private libs to use LIBADD. This is because LDADD+=-lFOO is not the same as LDADD+=-lprivateFOO which is what the private libs in LIBADD are. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 4a99fa2f238a..e157e62d907d 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -348,8 +348,9 @@ DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} # Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here. +_BADLDADD= .for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,} -.if ${_LIBRARIES:M${_l}} +.if ${_LIBRARIES:M${_l}} && !${_PRIVATELIBS:M${_l}} _BADLDADD+= ${_l} .endif .endfor -- cgit v1.2.3 From 382cab60bd722dbcec89beafd31a2722f9cfd7f7 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 15 Dec 2015 00:40:04 +0000 Subject: Add comment about OBJTOP not yet being defined outside of META MODE. It is fine for the purpose of the check though. Sponsored by: EMC / Isilon Storage Division --- share/mk/src.libnames.mk | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share/mk') diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index e157e62d907d..28c23680d2fb 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -519,6 +519,8 @@ _BADLIBADD+= ${_l} (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u}) .error ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}. Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}') .endif +# Note that OBJTOP is not yet defined here but for the purpose of the check +# it is fine as it resolves to the SRC directory. .if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}) .error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,} .endif -- cgit v1.2.3 From 92cc283761879814ba49bd7ed3408485949c1b04 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 15 Dec 2015 02:27:31 +0000 Subject: DIRDEPS_BUILD: Avoid duplicates in DIRDEPS for bootstrapping. This logic is potentially included multiple times, so overwrite the temporary variable rather than append to it. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.dirdeps.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 3e088306524e..94bc2a1e7419 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -134,7 +134,7 @@ DIRDEPS+= usr.bin/yacc.host # BUILD_AT_LEVEL0, which we don't use). # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. -_DP_DIRDEPS+= \ +_DP_DIRDEPS= \ ${DPADD:M${OBJTOP}*:H:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} # Resolve the paths to RELDIRs -- cgit v1.2.3 From a09a83ca333d504921deb3b1fcb8fdc37ea48eff Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 15 Dec 2015 02:46:14 +0000 Subject: DIRDEPS_BUILD: Fix incorrectly adding in RELDIR for DIRDEPS in bootstrapping. This is not wrong, but was unexpected. Using :H results in '.' which then using the rest of the conversion was added in RELDIR. This was also causing an empty _DP_DIRDEPS to resolve to SRCTOP for DIRDEPS. Sponsored by: EMC / Isilon Storage Division --- share/mk/local.dirdeps.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 94bc2a1e7419..0f093b62633c 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -135,11 +135,13 @@ DIRDEPS+= usr.bin/yacc.host # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. _DP_DIRDEPS= \ - ${DPADD:M${OBJTOP}*:H:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ + ${DPADD:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} # Resolve the paths to RELDIRs +.if !empty(_DP_DIRDEPS) DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,} .endif +.endif # !empty(DPADD) .if !empty(LIBADD) # Also handle LIBADD for non-internal libraries. .for _lib in ${LIBADD} -- cgit v1.2.3 From 66f96a13625218c0c2816c3ea8ff93f8f459a1ea Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 15 Dec 2015 02:51:05 +0000 Subject: DIRDEPS_BUILD: Support bootstrapping from PROGS.(DPADD|LIBADD). Sponsored by: EMC / Isilon Storage Division --- share/mk/local.dirdeps.mk | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'share/mk') diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk index 0f093b62633c..ae2c00a6ec52 100644 --- a/share/mk/local.dirdeps.mk +++ b/share/mk/local.dirdeps.mk @@ -129,14 +129,28 @@ DIRDEPS+= lib/msun .if !empty(SRCS:M*.y) DIRDEPS+= usr.bin/yacc.host .endif +# Gather PROGS dependencies +.if !empty(PROGS) +_PROGS_LIBADD= +_PROGS_DPADD= +.for _prog in ${PROGS} +.if !empty(LIBADD.${_prog}) +_PROGS_LIBADD+= ${LIBADD.${_prog}} +.endif +.if !empty(DPADD.${_prog}) +_PROGS_DPADD+= ${DPADD.${_prog}} +.endif +.endfor +.endif # !empty(PROGS) .if !empty(DPADD) # Taken from meta.autodep.mk (where it only does something with # BUILD_AT_LEVEL0, which we don't use). # This only works for DPADD with full OBJ/SRC paths, which is mostly just # _INTERNALLIBS. +_DPADD= ${DPADD} ${_PROGS_DPADD} _DP_DIRDEPS= \ - ${DPADD:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ - ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} + ${_DPADD:O:u:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \ + ${_DPADD:O:u:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} # Resolve the paths to RELDIRs .if !empty(_DP_DIRDEPS) DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,} @@ -144,7 +158,8 @@ DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,} .endif # !empty(DPADD) .if !empty(LIBADD) # Also handle LIBADD for non-internal libraries. -.for _lib in ${LIBADD} +_ALL_LIBADD= ${LIBADD} ${_PROGS_LIBADD} +.for _lib in ${_ALL_LIBADD:O:u} _lib${_lib}reldir= ${LIB${_lib:tu}DIR:C,${OBJTOP}/,,} .if defined(LIB${_lib:tu}DIR) && ${DIRDEPS:M${_lib${_lib}reldir}} == "" && \ exists(${SRCTOP}/${_lib${_lib}reldir}) -- cgit v1.2.3 From d0ba16f775666d59d8c98be30751663ed84b91e5 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 16 Dec 2015 19:23:10 +0000 Subject: Enable LLDB by default on amd64 and arm64 LLDB is usable for userland core file and live debugging on amd64, and for userland core file debugging on arm64. In general it works at least as well on FreeBSD as our in-tree gdb version, so enable it by default to allow for broader use and testing. An LLDB tutorial is available at http://lldb.llvm.org/tutorial.html, and a table mapping GDB commands to LLDB commands can be found at http://lldb.llvm.org/lldb-gdb.html . LLDB also has some level of support for FreeBSD on arm, mips, i386, and powerpc, but is not yet ready to have them enabled by default. Reviewed by: gnn Relnotes: Yes --- share/mk/src.opts.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index f94e63acaf7d..65c4348ca360 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -180,7 +180,6 @@ __DEFAULT_NO_OPTIONS = \ DTRACE_TESTS \ EISA \ HESIOD \ - LLDB \ NAND \ OFED \ OPENLDAP \ @@ -240,6 +239,11 @@ BROKEN_OPTIONS+=PROFILE # "sorry, unimplemented: profiler support for RISC-V" BROKEN_OPTIONS+=TESTS # "undefined reference to `_Unwind_Resume'" BROKEN_OPTIONS+=CXX # "libcxxrt.so: undefined reference to `_Unwind_Resume_or_Rethrow'" .endif +.if ${__T} == "aarch64" || ${__T} == "amd64" +__DEFAULT_YES_OPTIONS+=LLDB +.else +__DEFAULT_NO_OPTIONS+=LLDB +.endif # LLVM lacks support for FreeBSD 64-bit atomic operations for ARMv4/ARMv5 .if ${__T} == "arm" || ${__T} == "armeb" BROKEN_OPTIONS+=LLDB -- cgit v1.2.3 From c4835f11d0b5033368c081d2dfaba44eabf60d9d Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 20 Dec 2015 05:38:06 +0000 Subject: Simplify Kyuafile generation logic with KYUAFILE == auto and related complexity with variables MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division --- share/mk/suite.test.mk | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'share/mk') diff --git a/share/mk/suite.test.mk b/share/mk/suite.test.mk index 579ef7c3d805..df6beb95d5d4 100644 --- a/share/mk/suite.test.mk +++ b/share/mk/suite.test.mk @@ -52,24 +52,20 @@ KYUAFILE?= auto # hierarchy specified by this variable. KYUA_PREFIX?= /usr/local -.if ${KYUAFILE:tl} == "yes" +.if ${KYUAFILE:tl} != "no" FILES+= Kyuafile FILESDIR_Kyuafile= ${TESTSDIR} +.endif -CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp -.elif ${KYUAFILE:tl} == "auto" -FILES+= Kyuafile.auto -FILESDIR_Kyuafile.auto= ${TESTSDIR} -FILESNAME_Kyuafile.auto= Kyuafile - -CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp +.if ${KYUAFILE:tl} == "auto" +CLEANFILES+= Kyuafile Kyuafile.auto.tmp +.endif .for _T in ${_TESTS} _TEST_METADATA.${_T}= ${TEST_METADATA} ${TEST_METADATA.${_T}} .endfor -.NOPATH: Kyuafile.auto -Kyuafile.auto: Makefile +Kyuafile: Makefile @{ \ echo '-- Automatically generated by bsd.test.mk.'; \ echo; \ @@ -77,15 +73,15 @@ Kyuafile.auto: Makefile echo; \ echo 'test_suite("${TESTSUITE}")'; \ echo; \ - } >Kyuafile.auto.tmp + } > ${.TARGET}.tmp .for _T in ${_TESTS} @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${_TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ - >>Kyuafile.auto.tmp + >>${.TARGET}.tmp .endfor .for _T in ${TESTS_SUBDIRS:N.WAIT} - @echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.auto.tmp + @echo "include(\"${_T}/Kyuafile\")" >>${.TARGET}.tmp .endfor - @mv Kyuafile.auto.tmp Kyuafile.auto + @mv ${.TARGET}.tmp ${.TARGET} .endif KYUA?= ${KYUA_PREFIX}/bin/kyua -- cgit v1.2.3 From cc696e80e7f0cfb13e477ea3d3b76a8abf41b2bc Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 20 Dec 2015 05:41:12 +0000 Subject: Fix typo in r292500 by adding missing conditional statement MFC after: 1 week X-MFC with: r292500 Pointyhat to: ngie Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Sponsored by: EMC / Isilon Storage Division --- share/mk/suite.test.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mk') diff --git a/share/mk/suite.test.mk b/share/mk/suite.test.mk index df6beb95d5d4..ca55035e65c4 100644 --- a/share/mk/suite.test.mk +++ b/share/mk/suite.test.mk @@ -65,6 +65,7 @@ CLEANFILES+= Kyuafile Kyuafile.auto.tmp _TEST_METADATA.${_T}= ${TEST_METADATA} ${TEST_METADATA.${_T}} .endfor +.if ${KYUAFILE:tl} == "auto" Kyuafile: Makefile @{ \ echo '-- Automatically generated by bsd.test.mk.'; \ -- cgit v1.2.3 From fd6f8c3710ad9083c2670c6d3f7ecf730d42fad7 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 20 Dec 2015 06:01:53 +0000 Subject: Deal with another hardcoded reference to Kyuafile in the KYUAFILE == auto case Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division --- share/mk/suite.test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/suite.test.mk b/share/mk/suite.test.mk index ca55035e65c4..26f1494d36f1 100644 --- a/share/mk/suite.test.mk +++ b/share/mk/suite.test.mk @@ -80,7 +80,7 @@ Kyuafile: Makefile >>${.TARGET}.tmp .endfor .for _T in ${TESTS_SUBDIRS:N.WAIT} - @echo "include(\"${_T}/Kyuafile\")" >>${.TARGET}.tmp + @echo "include(\"${_T}/${.TARGET}\")" >>${.TARGET}.tmp .endfor @mv ${.TARGET}.tmp ${.TARGET} .endif -- cgit v1.2.3 From 26dfa135780269786d743fab7b15320cf374b5c3 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 20 Dec 2015 06:26:15 +0000 Subject: - Use LOCALBASE instead of KYUA_PREFIX for the --prefix to kyua(1) - Use LOCALBASE instead of hardcoding /usr/local for perl MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.test.mk | 3 +++ share/mk/suite.test.mk | 9 +-------- share/mk/tap.test.mk | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) (limited to 'share/mk') diff --git a/share/mk/bsd.test.mk b/share/mk/bsd.test.mk index 86351cff3c6c..9c5961972086 100644 --- a/share/mk/bsd.test.mk +++ b/share/mk/bsd.test.mk @@ -10,6 +10,9 @@ ____: +# Third-party software (kyua, etc) prefix. +LOCALBASE?= /usr/local + # Tests install directory TESTSDIR?= ${TESTSBASE}/${RELDIR:H} diff --git a/share/mk/suite.test.mk b/share/mk/suite.test.mk index 26f1494d36f1..451762adb991 100644 --- a/share/mk/suite.test.mk +++ b/share/mk/suite.test.mk @@ -45,13 +45,6 @@ KYUAFILE?= auto # unqualified TEST_METADATA variable. #TEST_METADATA.+= key="value" -# Path to the prefix of the installed Kyua CLI, if any. -# -# If kyua is installed from ports, we automatically define a realtest target -# below to run the tests using this tool. The tools are searched for in the -# hierarchy specified by this variable. -KYUA_PREFIX?= /usr/local - .if ${KYUAFILE:tl} != "no" FILES+= Kyuafile FILESDIR_Kyuafile= ${TESTSDIR} @@ -85,7 +78,7 @@ Kyuafile: Makefile @mv ${.TARGET}.tmp ${.TARGET} .endif -KYUA?= ${KYUA_PREFIX}/bin/kyua +KYUA= ${LOCALBASE}/bin/kyua .if exists(${KYUA}) # Definition of the "make test" target and supporting variables. # diff --git a/share/mk/tap.test.mk b/share/mk/tap.test.mk index ec860882f15f..28b52af12bb3 100644 --- a/share/mk/tap.test.mk +++ b/share/mk/tap.test.mk @@ -26,7 +26,7 @@ TAP_TESTS_PERL?= TAP_TESTS_SH?= # Perl interpreter to use for test programs written in this language. -TAP_PERL_INTERPRETER?= /usr/local/bin/perl +TAP_PERL_INTERPRETER?= ${LOCALBASE}/bin/perl .if !empty(TAP_TESTS_C) PROGS+= ${TAP_TESTS_C} -- cgit v1.2.3 From 46319c98393287a6d31e6d3c364f42acc0b59e67 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 20 Dec 2015 06:27:36 +0000 Subject: Document LOCALBASE in the bsd.test.mk section MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.README | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 5aa194972cbf..b1a68e8b538e 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -492,6 +492,10 @@ KYUAFILE If 'auto' (the default), generate a Kyuafile out of the subdirectories providing helper programs or data files only). +LOCALBASE The --prefix for the kyua package. + + The value of LOCALBASE defaults to /usr/local . + ATF_TESTS_C The names of the ATF C test programs to build. ATF_TESTS_CXX The names of the ATF C++ test programs to build. -- cgit v1.2.3 From 3bbee5556ace88b641faa5aa6716b36ad28fb2f2 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 20 Dec 2015 06:29:03 +0000 Subject: Clean up Kyuafile.tmp, not Kyuafile.auto.tmp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division --- share/mk/suite.test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/suite.test.mk b/share/mk/suite.test.mk index 451762adb991..2b87d7fba602 100644 --- a/share/mk/suite.test.mk +++ b/share/mk/suite.test.mk @@ -51,7 +51,7 @@ FILESDIR_Kyuafile= ${TESTSDIR} .endif .if ${KYUAFILE:tl} == "auto" -CLEANFILES+= Kyuafile Kyuafile.auto.tmp +CLEANFILES+= Kyuafile Kyuafile.tmp .endif .for _T in ${_TESTS} -- cgit v1.2.3 From 672929783316e1845a30b892b85172a60c5869f4 Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Fri, 25 Dec 2015 10:08:42 +0000 Subject: Document that make's .POSIX: handling is broken. In fact, it has been broken ever since it was added in November 1996. --- share/mk/sys.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'share/mk') diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 8fe6b68d0ac1..51f2818480d7 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -69,6 +69,10 @@ __ENV_ONLY_OPTIONS:= \ # # The rules below use this macro to distinguish between Posix-compliant # and default behaviour. +# +# This functionality is currently broken, since make(1) processes sys.mk +# before reading any other files, and consequently has no opportunity to +# set the %POSIX macro before we read this point. .if defined(%POSIX) .SUFFIXES: .o .c .y .l .a .sh .f -- cgit v1.2.3 From f051a5b324cbe3cb64507ba59cd570b18f7309c1 Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Fri, 25 Dec 2015 11:29:18 +0000 Subject: Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, as POSIX requires for the c99 compiler. (In fact, our c99(1) already ignores -lxnet; but our make(1) doesn't set ${CC} correctly, and our cc(1) treats xnet like any other library.) Reviewed by: kib --- share/mk/bsd.lib.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'share/mk') diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 6e26cff5dcd3..2e1796fa7ff5 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -368,6 +368,9 @@ _libinstall: ${INSTALL} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} +.for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} + ${INSTALL_SYMLINK} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} +.endfor .else .if ${_SHLIBDIR} == ${_LIBDIR} ${INSTALL_SYMLINK} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} -- cgit v1.2.3 From 34cdd77646db8a3e57441b3f7d028973dc880c54 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 31 Dec 2015 14:39:45 +0000 Subject: First part of updating llvm/clang build glue: getting llvm-tblgen, clang-tblgen and clang itself built. --- share/mk/local.meta.sys.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 1aa749abd231..8aa79f11e0e2 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -210,8 +210,9 @@ TRACER= ${TIME_STAMP} ${:U} MK_SHARED_TOOLCHAIN= no .endif TOOLCHAIN_VARS= AS AR CC CLANG_TBLGEN CXX CPP LD NM OBJDUMP OBJCOPY RANLIB \ - STRINGS SIZE TBLGEN + STRINGS SIZE LLVM_TBLGEN _toolchain_bin_CLANG_TBLGEN= /usr/bin/clang-tblgen +_toolchain_bin_LLVM_TBLGEN= /usr/bin/llvm-tblgen _toolchain_bin_CXX= /usr/bin/c++ .ifdef WITH_TOOLSDIR TOOLSDIR?= ${HOST_OBJTOP}/tools -- cgit v1.2.3 From 79f08b9adf95d3bcfb16ce7df4686026b632eaed Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 31 Dec 2015 21:01:06 +0000 Subject: For determining the compiler version, quote the string to be echo'd, otherwise the command might fail. This is because clang -v now results in the following: FreeBSD clang version 3.8.0 (trunk 256633) (based on LLVM 3.8.0svn) The second "3.8.8svn)" string tripped up the shell command. --- share/mk/bsd.compiler.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mk') diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index d7763e4e06b4..dee6a1d8a288 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -138,7 +138,7 @@ COMPILER_TYPE:= clang . endif .endif .if !defined(COMPILER_VERSION) -COMPILER_VERSION!=echo ${_v:M[1-9].[0-9]*} | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' +COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .endif .undef _v .endif -- cgit v1.2.3 From c42ade6081f506ad4d05ad5b63e3e400d3cb9032 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 3 Jan 2016 04:32:04 +0000 Subject: Add new LIBSOFT option. This is similar to the LIB32 option, except for libraries that follow the soft float ABI. It's only supported on armv6 as a transition to the new hard float ABI, so mark as broken everywhere else. --- share/mk/src.opts.mk | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'share/mk') diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 65c4348ca360..47a67e02e52a 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -180,6 +180,7 @@ __DEFAULT_NO_OPTIONS = \ DTRACE_TESTS \ EISA \ HESIOD \ + LIBSOFT \ NAND \ OFED \ OPENLDAP \ @@ -248,6 +249,10 @@ __DEFAULT_NO_OPTIONS+=LLDB .if ${__T} == "arm" || ${__T} == "armeb" BROKEN_OPTIONS+=LLDB .endif +# Only doing soft float API stuff on armv6 +.if ${__T} != "armv6" +BROKEN_OPTIONS+=LIBSOFT +.endif .include -- cgit v1.2.3