summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2019-07-18 23:14:58 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2019-07-26 08:22:14 +0000
commit391889ecff3f697040bc0677f3fb4a002d562e31 (patch)
treeff3f02b2a6b05a908d42d029e47734fcd3f30ec3
parentec3255b6c7ec65bcbd5a7bbd2c0e9df7437b8f54 (diff)
downloadillumos-joyent-391889ecff3f697040bc0677f3fb4a002d562e31.tar.gz
11480 cw runs smatch before it is built
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: Alexander Pyhalov <apyhalov@gmail.com> Reviewed by: Gergő Mihály Doma <domag02@gmail.com> Reviewed by: John Levon <john.levon@joyent.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/tools/Makefile27
-rw-r--r--usr/src/tools/scripts/nightly.sh32
2 files changed, 35 insertions, 24 deletions
diff --git a/usr/src/tools/Makefile b/usr/src/tools/Makefile
index 74bc15396e..334e2379ce 100644
--- a/usr/src/tools/Makefile
+++ b/usr/src/tools/Makefile
@@ -30,12 +30,16 @@
include ../Makefile.master
-# Bootstrap problem: 'cw' must be built before anything else can be built.
-# 'install.bin' should be built next, being the 'install' target dependency
-# for everything else.
+# Bootstrap problem: some utilities are pre-requisites for building everything
+# else:
+# - smatch - as it is a shadow compiler
+# - cw - as it is used to drive builds
+# - install.bin - being the 'install' target dependency
+# - ctf - being used to generate CTF data
#
-# Because of somewhat cyclic dependency between them, both cw and install.bin
-# override the way we install binaries in their Makefiles.
+# Anything built before 'install.bin' is present must override binary
+# installation rules in their makefiles. This includes the Makefile for
+# 'install.bin' itself.
BOOT_SUBDIRS= \
smatch \
.WAIT \
@@ -82,16 +86,6 @@ i386_SUBDIRS= \
mbh_patch \
btxld
-LINTSUBDIRS= \
- codereview \
- ctf \
- cw \
- findunref \
- lintdump \
- ndrgen \
- protocmp \
- protolist
-
SUBDIRS= \
$($(MACH)_SUBDIRS) \
$(COMMON_SUBDIRS) \
@@ -134,7 +128,6 @@ all := TARGET= install
install := TARGET= install
clean := TARGET= clean
clobber := TARGET= clobber
-lint := TARGET= lint
_msg := TARGET= _msg
.KEEP_STATE:
@@ -158,7 +151,7 @@ clean: $(SUBDIRS)
clobber: $(SUBDIRS)
$(RM) -rf $(TOOLS_PROTO)
-lint: $(LINTSUBDIRS)
+bootstrap: $(BOOT_SUBDIRS)
_msg: $(MSGSUBDIRS)
diff --git a/usr/src/tools/scripts/nightly.sh b/usr/src/tools/scripts/nightly.sh
index 7d22694671..8641236b6c 100644
--- a/usr/src/tools/scripts/nightly.sh
+++ b/usr/src/tools/scripts/nightly.sh
@@ -354,6 +354,29 @@ function build {
}
#
+# Bootstrap build tools which are pre-requisites for the rest of the build.
+#
+function bootstrap_tools {
+ echo "\n==== Bootstrapping tools at `date` ====\n" >> $LOGFILE
+
+ typeset INSTALLOG=install-bootstrap-${MACH}
+
+ rm -f $TMPDIR/make-state ${TOOLS}/$INSTALLOG.out
+ cd ${TOOLS}
+ /bin/time $MAKE -K $TMPDIR/make-state -e TARGET=install bootstrap \
+ 2>&1 | tee -a ${TOOLS}/$INSTALLOG.out >> $LOGFILE
+
+ echo "\n==== Bootstrap build errors ====\n" >> $mail_msg_file
+
+ egrep ":" ${TOOLS}/$INSTALLOG.out |
+ egrep -e "(${MAKE}:|[ ]error[: \n])" | \
+ egrep -v warning | tee $TMPDIR/bootstrap_errors >> $mail_msg_file
+
+ [[ -s $TMPDIR/bootstrap_errors ]] && return 1
+ return 0
+}
+
+#
# Build and install the onbld tools.
#
# usage: build_tools DESTROOT
@@ -1521,13 +1544,8 @@ fi
[[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
if [[ "$t_FLAG" = "y" ]]; then
- echo "\n==== Bootstrapping cw ====\n" >> $LOGFILE
- ( cd ${TOOLS}
- set_non_debug_build_flags
- rm -f $TMPDIR/make-state
- $MAKE -K $TMPDIR/make-state -e TARGET=install cw 2>&1 >> $LOGFILE
- [[ "$?" -ne 0 ]] && fatal_error "Error: could not bootstrap cw"
- )
+ set_non_debug_build_flags
+ bootstrap_tools || fatal_error "Error: could not bootstrap tools"
# Switch ONBLD_TOOLS early if -t is specified so that
# we could use bootstrapped cw for compiler checks.