diff options
| author | Toomas Soome <tsoome@me.com> | 2020-01-17 09:49:43 -0800 |
|---|---|---|
| committer | Toomas Soome <tsoome@me.com> | 2020-02-05 19:00:00 +0200 |
| commit | 5801b0f01c3c34499a929ed96164a5a68b470945 (patch) | |
| tree | 50e06e6f9eb27ea820f4f4e711c485499aad6e86 /usr/src/tools | |
| parent | 948761701ebc8a0cf820a973780b2fbb931c4390 (diff) | |
| download | illumos-joyent-5801b0f01c3c34499a929ed96164a5a68b470945.tar.gz | |
12217 add ld assert-deflib and guidance to gate build
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/tools')
28 files changed, 51 insertions, 34 deletions
diff --git a/usr/src/tools/Makefile.tools b/usr/src/tools/Makefile.tools index 3659548cee..6e51622e65 100644 --- a/usr/src/tools/Makefile.tools +++ b/usr/src/tools/Makefile.tools @@ -54,7 +54,9 @@ CPPFLAGS= -D_TS_ERRNO ELFSIGN_O= $(TRUE) LDLIBS= LDFLAGS= $(MAPFILE.NES:%=-M%) $(MAPFILE.NED:%=-M%) \ - $(MAPFILE.PGA:%=-M%) + $(MAPFILE.PGA:%=-M%) \ + $(ZASSERTDEFLIB)=libc.so \ + $(BDIRECT) # Unset CW_LINKER so we run the default. We don't set LD here to avoid taking # the journey through LD_ALTEXEC unnecessarily. diff --git a/usr/src/tools/btxld/Makefile b/usr/src/tools/btxld/Makefile index 1d18254a59..599cf5f406 100644 --- a/usr/src/tools/btxld/Makefile +++ b/usr/src/tools/btxld/Makefile @@ -28,6 +28,7 @@ MAN1ONBLDFILES= btxld.1onbld SRCS= btxld.c elfh.c version.c $(UTILS_SRC) $(EINFO_SRC) $(EXTRA_SRC) OBJS= btxld.o elfh.o version.o bblk_einfo.o mboot_extra.o boot_utils.o LDLIBS += -lmd5 +NATIVE_LIBS += libmd5.so CSTD= $(CSTD_GNU99) CPPFLAGS += -I$(SRC)/uts/common -I$(COMMON_SRC) diff --git a/usr/src/tools/chk4ubin/Makefile b/usr/src/tools/chk4ubin/Makefile index 5da362350e..1c9d61fcd9 100644 --- a/usr/src/tools/chk4ubin/Makefile +++ b/usr/src/tools/chk4ubin/Makefile @@ -30,8 +30,7 @@ PROG = chk4ubin DYNFLAGS += '-R$$ORIGIN/../../lib/$(MACH)' LDLIBS += -lelf - -LINTFLAGS += -ux +NATIVE_LIBS += libelf.so .KEEP_STATE: @@ -39,8 +38,6 @@ all: $(PROG) install: all .WAIT $(ROOTONBLDMACHPROG) -lint: lint_PROG - clean: $(RM) $(PROG) diff --git a/usr/src/tools/cpcgen/Makefile b/usr/src/tools/cpcgen/Makefile index ec38f80e3d..13da2e0017 100644 --- a/usr/src/tools/cpcgen/Makefile +++ b/usr/src/tools/cpcgen/Makefile @@ -19,6 +19,7 @@ OBJS = cpcgen.o json_nvlist.o custr.o include ../Makefile.tools LDLIBS += -lnvpair +NATIVE_LIBS += libnvpair.so CPPFLAGS += -I$(SRC)/lib/json_nvlist/ -I$(SRC)/lib/libcustr/common all: $(PROG) diff --git a/usr/src/tools/cscope-fast/Makefile b/usr/src/tools/cscope-fast/Makefile index 1cf70de8f4..f675cf0c34 100644 --- a/usr/src/tools/cscope-fast/Makefile +++ b/usr/src/tools/cscope-fast/Makefile @@ -28,7 +28,7 @@ PROG= cscope-fast -OBJS= main.o dir.o crossref.o scanner.o lookup.o command.o display.o \ +OBJS= main.o dir.o crossref.o scanner.o lookup.o command.o display.o \ find.o edit.o exec.o help.o history.o input.o menu.o alloc.o \ cgrep.o compath.o invlib.o logdir.o \ mouse.o mygetenv.o mygetwd.o mypopen.o \ @@ -56,6 +56,7 @@ SMATCH=off CFLAGS += $(CCVERBOSE) LDLIBS += -lcurses -ll +NATIVE_LIBS += libcurses.so libl.so .KEEP_STATE: diff --git a/usr/src/tools/ctf/ctfconvert/Makefile.com b/usr/src/tools/ctf/ctfconvert/Makefile.com index 33268bd979..dd79ce02b0 100644 --- a/usr/src/tools/ctf/ctfconvert/Makefile.com +++ b/usr/src/tools/ctf/ctfconvert/Makefile.com @@ -16,10 +16,12 @@ include ../../Makefile.ctf CFLAGS += $(CCVERBOSE) LDLIBS += -lctf -lelf +NATIVE_LIBS += libelf.so libc.so LDFLAGS = \ -L$(ROOTONBLDLIBMACH) \ '-R$$ORIGIN/../../lib/$(MACH)' \ + $(BDIRECT) $(ZLAZYLOAD) CPPFLAGS += -include ../../common/ctf_headers.h diff --git a/usr/src/tools/ctf/ctfdiff/Makefile.com b/usr/src/tools/ctf/ctfdiff/Makefile.com index 3c5e19fb6e..6ceb863e66 100644 --- a/usr/src/tools/ctf/ctfdiff/Makefile.com +++ b/usr/src/tools/ctf/ctfdiff/Makefile.com @@ -16,10 +16,12 @@ include ../../Makefile.ctf CFLAGS += $(CCVERBOSE) LDLIBS += -lctf +NATIVE_LIBS += libc.so LDFLAGS = \ -L$(ROOTONBLDLIBMACH) \ '-R$$ORIGIN/../../lib/$(MACH)' \ + $(BDIRECT) CPPFLAGS += -include ../../common/ctf_headers.h diff --git a/usr/src/tools/ctf/ctfdump/Makefile.com b/usr/src/tools/ctf/ctfdump/Makefile.com index 66e7a170c4..3efd986e16 100644 --- a/usr/src/tools/ctf/ctfdump/Makefile.com +++ b/usr/src/tools/ctf/ctfdump/Makefile.com @@ -19,10 +19,12 @@ CSTD = $(CSTD_GNU99) C99LMODE = -Xc99=%all CFLAGS += $(CCVERBOSE) LDLIBS += -lctf +NATIVE_LIBS += libctf.so libc.so LDFLAGS = \ -L$(ROOTONBLDLIBMACH) \ '-R$$ORIGIN/../../lib/$(MACH)' \ + $(BDIRECT) CPPFLAGS += -include ../../common/ctf_headers.h diff --git a/usr/src/tools/ctf/ctfmerge/Makefile.com b/usr/src/tools/ctf/ctfmerge/Makefile.com index a073007cb4..84eb3c5969 100644 --- a/usr/src/tools/ctf/ctfmerge/Makefile.com +++ b/usr/src/tools/ctf/ctfmerge/Makefile.com @@ -21,6 +21,7 @@ LDFLAGS += \ -L$(ROOTONBLDLIBMACH) \ '-R$$ORIGIN/../../lib/$(MACH)' \ +NATIVE_LIBS += libelf.so CPPFLAGS += -include ../../common/ctf_headers.h CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += $(CNOWARN_UNINIT) diff --git a/usr/src/tools/ctf/dwarf/Makefile.com b/usr/src/tools/ctf/dwarf/Makefile.com index 52aedda3a7..374dee98f1 100644 --- a/usr/src/tools/ctf/dwarf/Makefile.com +++ b/usr/src/tools/ctf/dwarf/Makefile.com @@ -83,6 +83,7 @@ SMATCH=off DYNFLAGS += '-R$$ORIGIN/../../lib/$(MACH)' LDLIBS = -lelf -lc +NATIVE_LIBS += libelf.so libc.so .KEEP_STATE: .PARALLEL: diff --git a/usr/src/tools/ctf/libctf/Makefile.com b/usr/src/tools/ctf/libctf/Makefile.com index 89769c5521..31b5d19f4d 100644 --- a/usr/src/tools/ctf/libctf/Makefile.com +++ b/usr/src/tools/ctf/libctf/Makefile.com @@ -26,6 +26,7 @@ CPPFLAGS += -I$(SRC)/lib/libctf/common/ \ -DCTF_OLD_VERSIONS \ -DCTF_TOOLS_BUILD LDLIBS += -lc -lelf -L$(ROOTONBLDLIBMACH) -ldwarf -lavl +NATIVE_LIBS += libelf.so libavl.so libc.so DYNFLAGS += '-R$$ORIGIN/../../lib/$(MACH)' .KEEP_STATE: diff --git a/usr/src/tools/ctf/stabs/Makefile.com b/usr/src/tools/ctf/stabs/Makefile.com index 97d9cddb77..901acd2584 100644 --- a/usr/src/tools/ctf/stabs/Makefile.com +++ b/usr/src/tools/ctf/stabs/Makefile.com @@ -39,16 +39,15 @@ SRCS = \ include ../../Makefile.ctf LDLIBS += -lctf +NATIVE_LIBS += libctf.so OBJS = $(SRCS:%.c=%.o) -LINTFILES = $(SRCS:%.c=%.ln) -LINTFLAGS = -mnux -L$(ROOT)/usr/lib CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused .NO_PARALLEL: -.PARALLEL: $(OBJS) $(LINTFILES) +.PARALLEL: $(OBJS) all: $(PROG) @@ -66,10 +65,4 @@ install: $(ROOTONBLDMACHPROG) clean: $(RM) $(OBJS) $(LINTFILES) -%.ln: ../common/%.c - $(LINT.c) -c $< - -lint: $(LINTFILES) - $(LINT) $(LINTFLAGS) $(LINTFILES) $(LDLIBS) - include ../../Makefile.ctf.targ diff --git a/usr/src/tools/cw/Makefile b/usr/src/tools/cw/Makefile index 00099cb2e5..0d0908a6a5 100644 --- a/usr/src/tools/cw/Makefile +++ b/usr/src/tools/cw/Makefile @@ -44,9 +44,12 @@ $(__GNUC)CFLAGS= -O -D__sun -Wall -Wno-unknown-pragmas -Werror \ $(__SUNC)CFLAGS= -xspace -Xa -xildoff -errtags=yes -errwarn=%all \ -xc99=%all -W0,-xglobalstatic -v - -$(__GNUC)LDLIBS += -lc +$(__GNUC)LDLIBS += -Wl,-zassert-deflib=libc.so -lc $(__GNUC)LDFLAGS= $(MAPFILE.NES:%=-Wl,-M%) +$(__GNUC)ZASSERTDEFLIB = -Wl,-zassert-deflib +$(__GNUC)ZFATALWARNINGS = -Wl,-zfatal-warnings +$(__GNUC)ZGUIDANCE = -Wl,-zguidance +LDFLAGS += -Wl,$(ZDIRECT) $(ROOTONBLDMAN1ONBLDFILES) := FILEMODE= 644 CSTD= $(CSTD_GNU99) diff --git a/usr/src/tools/install.bin/Makefile b/usr/src/tools/install.bin/Makefile index 6f20638a56..4643068a48 100644 --- a/usr/src/tools/install.bin/Makefile +++ b/usr/src/tools/install.bin/Makefile @@ -34,6 +34,7 @@ CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-type-limits CPPFLAGS += -I../protocmp LDLIBS += -lgen +NATIVE_LIBS += libgen.so CLEANFILES += $(OBJS) # Assume we don't have the install.bin available yet diff --git a/usr/src/tools/make/bin/Makefile b/usr/src/tools/make/bin/Makefile index 0a65f0a4c2..e67decf357 100644 --- a/usr/src/tools/make/bin/Makefile +++ b/usr/src/tools/make/bin/Makefile @@ -37,6 +37,7 @@ include ../Makefile.com LDLIBS += ../lib/mksh/libmksh.a ../lib/vroot/libvroot.a LDLIBS += ../lib/bsd/libbsd.a -lc -lnsl -lumem +NATIVE_LIBS += libnsl.so libumem.so CPPFLAGS += -D_FILE_OFFSET_BITS=64 diff --git a/usr/src/tools/make/lib/makestate/Makefile.com b/usr/src/tools/make/lib/makestate/Makefile.com index 338cdf7a27..a503ef5775 100644 --- a/usr/src/tools/make/lib/makestate/Makefile.com +++ b/usr/src/tools/make/lib/makestate/Makefile.com @@ -25,6 +25,7 @@ LIBS = $(DYNLIB) SRCDIR = $(SRC)/cmd/make/lib/makestate MAPFILES = $(SRCDIR)/mapfile-vers LDLIBS += -lc +NATIVE_LIBS += libc.so FILEMODE= 755 diff --git a/usr/src/tools/makesoftcore/Makefile b/usr/src/tools/makesoftcore/Makefile index 36c60aa8d3..44b3f09b8d 100644 --- a/usr/src/tools/makesoftcore/Makefile +++ b/usr/src/tools/makesoftcore/Makefile @@ -26,6 +26,7 @@ CPPFLAGS += -I../../uts/common OBJS= makesoftcore.o lz4.o SRCS= makesoftcore.c $(LZ4)/lz4.c LDLIBS= -lumem +NATIVE_LIBS += libumem.so # not linted SMOFF += all_func_returns @@ -40,7 +41,7 @@ clean: $(RM) $(PROG) $(OBJS) $(PROG): $(OBJS) - $(LINK.c) $(OBJS) -o $@ $(LDLIBS) + $(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(POST_PROCESS) %.o: $(SOFTCORE)/%.c diff --git a/usr/src/tools/sgs/ld/Makefile b/usr/src/tools/sgs/ld/Makefile index fc802dea0e..b8e7b32ffd 100644 --- a/usr/src/tools/sgs/ld/Makefile +++ b/usr/src/tools/sgs/ld/Makefile @@ -27,6 +27,7 @@ include ../../Makefile.tools include $(SGSHOME)/ld/Makefile.com LDLIBS = -L../libconv -L$(ROOTONBLDLIBMACH) -lld -lelf -lconv +NATIVE_LIBS += libc.so CPPFLAGS = $(NATIVE_CPPFLAGS) CFLAGS = $(NATIVE_CFLAGS) MAPFILES = $(SRCDIR)/common/mapfile-intf diff --git a/usr/src/tools/sgs/libelf/Makefile b/usr/src/tools/sgs/libelf/Makefile index 2ee8dfeb48..d90cb937c0 100644 --- a/usr/src/tools/sgs/libelf/Makefile +++ b/usr/src/tools/sgs/libelf/Makefile @@ -31,6 +31,7 @@ CONVLIBDIR = -L../libconv CPPFLAGS = $(NATIVE_CPPFLAGS) CFLAGS = $(NATIVE_CFLAGS) SGSMSGTARG += $(SGSMSG32) +NATIVE_LIBS += libc.so CW_LINKER = .KEEP_STATE: diff --git a/usr/src/tools/sgs/libld/Makefile b/usr/src/tools/sgs/libld/Makefile index bc5ebb73e8..2760ed34dc 100644 --- a/usr/src/tools/sgs/libld/Makefile +++ b/usr/src/tools/sgs/libld/Makefile @@ -37,6 +37,7 @@ CPPFLAGS = $(NATIVE_CPPFLAGS) -DUSE_LIBLD_MALLOC -I$(SRC)/lib/libc/inc \ -I$(SRC)/uts/common/krtld -I$(SRC)/uts/sparc \ $(VAR_LIBLD_CPPFLAGS) LDLIBS += -L$(ROOTONBLDLIBMACH) -L../libconv -lconv -llddbg -lelf -lc +NATIVE_LIBS += libc.so DYNFLAGS += $(VERSREF) '-R$$ORIGIN' CFLAGS = $(NATIVE_CFLAGS) diff --git a/usr/src/tools/sgs/liblddbg/Makefile b/usr/src/tools/sgs/liblddbg/Makefile index f2bdd55c81..b15dd2f33c 100644 --- a/usr/src/tools/sgs/liblddbg/Makefile +++ b/usr/src/tools/sgs/liblddbg/Makefile @@ -34,7 +34,8 @@ CPPFLAGS = $(NATIVE_CPPFLAGS) -I$(SRC)/lib/libc/inc CFLAGS = $(NATIVE_CFLAGS) DYNFLAGS += -L../libconv SGSMSGTARG += $(SGSMSG32) -CW_LINKER= +NATIVE_LIBS += libc.so +CW_LINKER = all: $(DYNLIB) $(LIBLINKS) diff --git a/usr/src/tools/sgs/sgsmsg/Makefile b/usr/src/tools/sgs/sgsmsg/Makefile index e808245030..ecde42eb3c 100644 --- a/usr/src/tools/sgs/sgsmsg/Makefile +++ b/usr/src/tools/sgs/sgsmsg/Makefile @@ -54,6 +54,7 @@ FILEMODE= 0755 CPPFLAGS = $(NATIVE_CPPFLAGS) CFLAGS = $(NATIVE_CFLAGS) +NATIVE_LIBS += libc.so CW_LINKER = # not linted diff --git a/usr/src/tools/smatch/Makefile b/usr/src/tools/smatch/Makefile index 902c874624..8b3e401b93 100644 --- a/usr/src/tools/smatch/Makefile +++ b/usr/src/tools/smatch/Makefile @@ -31,7 +31,12 @@ sparc_CC = $(GNUC_ROOT)/bin/gcc i386_SMATCHFLAGS = -msave-args sparc_SMATCHFLAGS = +# When we use builtins, then ld's -zguidance will complain that libm is +# unused on x86 because the compiler will replace ceil(3M) with its own copy. +# However, on SPARC, it doesn't. So for now we disable builtins to make it +# consistent. CFLAGS = -O -m64 -std=gnu99 -nodefaultlibs -D__sun $($(MACH)_SMATCHFLAGS) +CFLAGS += -fno-builtin CFLAGS += -Wall -Wno-unknown-pragmas -Wno-psabi SMATCHDATADIR = $(ROOTONBLDSHARE)/smatch @@ -40,7 +45,8 @@ CFLAGS += -DSMATCHDATADIR='"$(SMATCHDATADIR)"' CFLAGS += -DGCC_BASE='"/no/such/dir"' CFLAGS += -DMULTIARCH_TRIPLET=NULL -LDLIBS += -lsqlite3 -lcrypto -lm -lgcc -lc +LDCHECKS = -Wl,$(ZASSERTDEFLIB) -Wl,$(ZGUIDANCE) -Wl,$(ZFATALWARNINGS) +LDLIBS += -Wl,$(ZLAZYLOAD) -Wl,$(ZDIRECT) -lsqlite3 -lcrypto -lgcc -lm -lc LDFLAGS = $(MAPFILE.NES:%=-Wl,-M%) LDFLAGS += -L$(NATIVE_ADJUNCT)/lib -R$(NATIVE_ADJUNCT)/lib diff --git a/usr/src/tools/stabs/Makefile b/usr/src/tools/stabs/Makefile index 4fea2c5c60..7b00f489d0 100644 --- a/usr/src/tools/stabs/Makefile +++ b/usr/src/tools/stabs/Makefile @@ -23,8 +23,6 @@ # Copyright (c) 1996-1998 by Sun Microsystems, Inc. # All rights reserved. # -#ident "%Z%%M% %I% %E% SMI" -# include ../Makefile.tools @@ -32,7 +30,6 @@ all:= TARGET= all install:= TARGET= install clean:= TARGET= clean clobber:= TARGET= clobber -lint:= TARGET= lint SUBDIRS_sparc = sparc @@ -45,7 +42,6 @@ all: $(SUBDIRS) install: $(SUBDIRS) clean: $(SUBDIRS) clobber: $(SUBDIRS) -lint: $(SUBDIRS) $(SUBDIRS): FRC @cd $@; pwd; $(MAKE) $(TARGET) diff --git a/usr/src/tools/stabs/sparc/Makefile b/usr/src/tools/stabs/sparc/Makefile index 56f04afba0..671caf6b7b 100644 --- a/usr/src/tools/stabs/sparc/Makefile +++ b/usr/src/tools/stabs/sparc/Makefile @@ -29,12 +29,11 @@ STABS_SRC = .. # Define the module and object file sets. # STABS_PROG = stabs # name doesn't conflict with Makefile.master STABS -PROG = stabs # name doesn't conflict with Makefile.master STABS +PROG = stabs # name doesn't conflict with Makefile.master STABS STABS_SRCS = $(STABS_SRC)/main.c $(STABS_SRC)/stabs.c \ $(STABS_SRC)/forth.c $(STABS_SRC)/genassym.c \ $(STABS_SRC)/squander.c STABS_OBJS = $(STABS_SRCS:$(STABS_SRC)/%.c=%.o) -LINTS = $(STABS_OBJS:%.o=%.ln) SRCS = $(STABS_SRCS) OBJECTS = $(STABS_OBJS) @@ -50,7 +49,10 @@ FILEMODE = 555 CFLAGS += $(CCVERBOSE) -INC_PATH = -I$(STABS_SRC) +INC_PATH = -I$(STABS_SRC) + +LDLIBS += -lm +NATIVE_LIBS += libm.so # # Default build targets. @@ -63,17 +65,11 @@ all: $(STABS_PROG) install: all .WAIT $(ROOTONBLDMACHPROG) -lint: $(SRCS) - @$(LINT) $(LINTFLAGS) $(SRCS) - clean: $(RM) $(CLEANFILES) -clean.lint: - $(RM) $(LINTS) - $(STABS_PROG): $(STABS_OBJS) - $(LINK.c) -o $@ $(STABS_OBJS) -lm + $(LINK.c) -o $@ $(STABS_OBJS) $(LDLIBS) $(POST_PROCESS) %.o: $(STABS_SRC)/%.c diff --git a/usr/src/tools/tic/Makefile b/usr/src/tools/tic/Makefile index eae6ad29b0..90235be144 100644 --- a/usr/src/tools/tic/Makefile +++ b/usr/src/tools/tic/Makefile @@ -31,6 +31,7 @@ include $(SRC)/tools/Makefile.tools include $(CMDDIR)/Makefile.common MAPFILES= $(CMDDIR)/$(MAPFILE.INT) +NATIVE_LIBS += libcurses.so .KEEP_STATE: diff --git a/usr/src/tools/tokenize/Makefile b/usr/src/tools/tokenize/Makefile index e1ee198e9e..b9c4b0f94a 100644 --- a/usr/src/tools/tokenize/Makefile +++ b/usr/src/tools/tokenize/Makefile @@ -41,6 +41,7 @@ MAPFILES = DYNFLAGS += $(ZINTERPOSE) LDLIBS = -lc +NATIVE_LIBS += libc.so ASFLAGS += -P -D_ASM diff --git a/usr/src/tools/vtfontcvt/Makefile b/usr/src/tools/vtfontcvt/Makefile index 1da0698b5e..49e996a908 100644 --- a/usr/src/tools/vtfontcvt/Makefile +++ b/usr/src/tools/vtfontcvt/Makefile @@ -18,6 +18,7 @@ CMDDIR= $(SRC)/cmd/vtfontcvt include ../Makefile.tools include $(CMDDIR)/Makefile.common +NATIVE_LIBS += libumem.so CPPFLAGS += -I../../uts/common .KEEP_STATE: |
