10080 smatch Makefile changes for usr/src/cmd
1 # 2 # CDDL HEADER START 3 # 4 # The contents of this file are subject to the terms of the 5 # Common Development and Distribution License (the "License"). 6 # You may not use this file except in compliance with the License. 7 # 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 # or http://www.opensolaris.org/os/licensing. 10 # See the License for the specific language governing permissions 11 # and limitations under the License. 12 # 13 # When distributing Covered Code, include this CDDL HEADER in each 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 # If applicable, add the following below this CDDL HEADER, with the 16 # fields enclosed by brackets "[]" replaced with your own identifying 17 # information: Portions Copyright [yyyy] [name of copyright owner] 18 # 19 # CDDL HEADER END 20 # 21 22 # 23 # Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. 24 # 25 # Copyright (c) 2018, Joyent, Inc. 26 27 RTLD= ld.so.1 28 29 AVLOBJ= avl.o 30 DTROBJ= dtrace_data.o 31 TOOLOBJS= alist.o strhash.o 32 BLTOBJ= msg.o 33 ELFCAPOBJ= elfcap.o 34 OBJECTS= $(BLTOBJ) \ 35 $(AVLOBJ) \ 36 $(DTROBJ) \ 37 $(TOOLOBJS) \ 38 $(ELFCAPOBJ) \ 39 $(P_ASOBJS) $(P_COMOBJS) $(P_MACHOBJS) $(G_MACHOBJS) \ 40 $(S_ASOBJS) $(S_COMOBJS) $(S_MACHOBJS) $(CP_MACHOBJS) 41 42 COMOBJS= $(P_COMOBJS) $(S_COMOBJS) 43 ASOBJS= $(P_ASOBJS) $(S_ASOBJS) 44 MACHOBJS= $(P_MACHOBJS) $(S_MACHOBJS) 45 NOCTFOBJS= $(ASOBJS) 46 47 include $(SRC)/lib/Makefile.lib 48 include $(SRC)/cmd/sgs/Makefile.com 49 50 SRCDIR = ../common 51 ELFCAP = $(SRC)/common/elfcap 52 PLAT = $(VAR_PLAT_$(BASEPLAT)) 53 54 # DTrace needs an executable data segment. 55 MAPFILE.NED= 56 57 MAPFILES += $(MAPFILE-ORDER) 58 59 # For the libc/libthread unified world: 60 # This library needs to be placed in /lib to allow 61 # dlopen() functionality while in single-user mode. 62 ROOTFS_DYNLIB= $(RTLD:%=$(ROOTFS_LIBDIR)/%) 63 ROOTFS_DYNLIB64= $(RTLD:%=$(ROOTFS_LIBDIR64)/%) 64 65 # For the libc/libthread separated world: 66 # A version of this library needs to be placed in /etc/lib to allow 67 # dlopen() functionality while in single-user mode. 68 ETCLIBDIR= $(ROOT)/etc/lib 69 ETCDYNLIB= $(RTLD:%=$(ETCLIBDIR)/%) 70 71 ROOTDYNLIB= $(RTLD:%=$(ROOTFS_LIBDIR)/%) 72 ROOTDYNLIB64= $(RTLD:%=$(ROOTFS_LIBDIR64)/%) 73 74 75 FILEMODE = 755 76 77 CPPFLAGS += -I$(SRCBASE)/lib/libc/inc \ 78 -I$(SRCBASE)/uts/common/krtld \ 79 -I$(SRCBASE)/uts/$(PLAT) \ 80 -I$(SRCBASE)/uts/$(PLAT)/krtld \ 81 -I$(SRC)/common/sgsrtcid \ 82 -I$(ELFCAP) \ 83 $(CPPFEATUREMACROS) 84 85 ASFLAGS= -P -D_ASM $(CPPFLAGS) 86 LDLIB = -L ../../libld/$(MACH) 87 RTLDLIB = -L ../../librtld/$(MACH) 88 89 CERRWARN += -_gcc=-Wno-uninitialized 90 CERRWARN += -_gcc=-Wno-unused-variable 91 CERRWARN += -_gcc=-Wno-switch 92 93 # not linted 94 SMATCH=off 95 96 # These definitions require that libc be built in the same workspace 97 # as the run-time linker and before the run-time linker is built. 98 # This is required for the system's self-consistency in any case. 99 CPICLIB = $(VAR_RTLD_CPICLIB) 100 CPICLIB64 = $(VAR_RTLD_CPICLIB64) 101 CLIB = -lc_pic 102 103 LDLIBS += $(CONVLIBDIR) $(CONV_LIB) \ 104 $(CPICLIB) $(CLIB) \ 105 $(LDDBGLIBDIR) $(LDDBG_LIB) \ 106 $(RTLDLIB) -lrtld \ 107 $(LDLIB) $(LD_LIB) 108 109 DYNFLAGS += -i -e _rt_boot $(VERSREF) $(ZNODLOPEN) \ 110 $(ZINTERPOSE) -zdtrace=dtrace_data '-R$$ORIGIN' 111 112 BUILD.s= $(AS) $(ASFLAGS) $< -o $@ 113 114 BLTDEFS= msg.h 115 BLTDATA= msg.c 116 BLTMESG= $(SGSMSGDIR)/rtld 117 118 BLTFILES= $(BLTDEFS) $(BLTDATA) $(BLTMESG) 119 120 SGSMSGCOM= ../common/rtld.msg 121 SGSMSG32= ../common/rtld.32.msg 122 SGSMSG64= ../common/rtld.64.msg 123 SGSMSGSPARC= ../common/rtld.sparc.msg 124 SGSMSGSPARC32= ../common/rtld.sparc32.msg 125 SGSMSGSPARC64= ../common/rtld.sparc64.msg 126 SGSMSGINTEL= ../common/rtld.intel.msg 127 SGSMSGINTEL32= ../common/rtld.intel32.msg 128 SGSMSGINTEL64= ../common/rtld.intel64.msg 129 SGSMSGCHK= ../common/rtld.chk.msg 130 SGSMSGTARG= $(SGSMSGCOM) 131 SGSMSGALL= $(SGSMSGCOM) $(SGSMSG32) $(SGSMSG64) \ 132 $(SGSMSGSPARC) $(SGSMSGSPARC32) $(SGSMSGSPARC64) \ 133 $(SGSMSGINTEL) $(SGSMSGINTEL32) $(SGSMSGINTEL64) 134 135 SGSMSGFLAGS1= $(SGSMSGFLAGS) -m $(BLTMESG) 136 SGSMSGFLAGS2= $(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n rtld_msg 137 138 SRCS= $(AVLOBJ:%.o=$(VAR_AVLDIR)/%.c) \ 139 $(DTROBJ:%.o=$(VAR_DTRDIR)/%.c) \ 140 $(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \ 141 $(COMOBJS:%.o=../common/%.c) $(MACHOBJS:%.o=%.c) $(BLTDATA) \ 142 $(G_MACHOBJS:%.o=$(SRCBASE)/uts/$(PLAT)/krtld/%.c) \ 143 $(CP_MACHOBJS:%.o=../$(MACH)/%.c) \ 144 $(ASOBJS:%.o=%.s) 145 LINTSRCS= $(SRCS) ../common/lintsup.c 146 147 LINTFLAGS += -u -Dsun -D_REENTRANT -erroff=E_EMPTY_TRANSLATION_UNIT \ 148 -erroff=E_NAME_DECL_NOT_USED_DEF2 149 LINTFLAGS64 += -u -D_REENTRANT -erroff=E_CAST_INT_TO_SMALL_INT \ 150 -erroff=E_NAME_DECL_NOT_USED_DEF2 151 152 CLEANFILES += $(LINTOUTS) $(CRTS) $(BLTFILES) 153 CLOBBERFILES += $(RTLD) --- EOF ---