Skip to content

Commit

Permalink
6117 Many small bugs prevent a clean build on SPARC
Browse files Browse the repository at this point in the history
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
  • Loading branch information
jgmills authored and richlowe committed Sep 19, 2015
1 parent 79c28b7 commit fca4268
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 54 deletions.
3 changes: 2 additions & 1 deletion usr/src/Makefile.master
Expand Up @@ -24,6 +24,7 @@
# Copyright (c) 2012 by Delphix. All rights reserved.
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2015 Gary Mills
#

#
Expand Down Expand Up @@ -149,7 +150,7 @@ CP= /usr/bin/cp -f
MCS= /usr/ccs/bin/mcs
CAT= /usr/bin/cat
ELFDUMP= /usr/ccs/bin/elfdump
M4= /usr/ccs/bin/m4
M4= /usr/bin/m4
STRIP= /usr/ccs/bin/strip
LEX= /usr/ccs/bin/lex
FLEX= /usr/bin/flex
Expand Down
56 changes: 56 additions & 0 deletions usr/src/cmd/mdb/sparc/v7/libfksmbsrv/Makefile
@@ -0,0 +1,56 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
# Copyright 2015 Gary Mills
#

MODULE = libfksmbsrv.so
MDBTGT = proc

MODSRCS = smbsrv.c list.c

include ../../../../Makefile.cmd
include ../../Makefile.sparcv7
include ../../../Makefile.module

MODSRCS_DIR = ../../../common/modules/smbsrv
GENUNIX_DIR = ../../../common/modules/genunix

# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
CPPFLAGS.first += -I../../../../../lib/smbsrv/libfksmbsrv/common
CPPFLAGS.first += -I../../../../../lib/libfakekernel/common

CPPFLAGS += -I../../../../../uts/common

C99MODE= -xc99=%all
C99LMODE= -Xc99=%all

dmod/%.o: $(GENUNIX_DIR)/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)

dmod/%.ln: $(GENUNIX_DIR)/%.c
$(LINT.c) -c $<
57 changes: 57 additions & 0 deletions usr/src/cmd/mdb/sparc/v9/libfksmbsrv/Makefile
@@ -0,0 +1,57 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright 2013 Nexenta Systems, Inc. All rights reserved.
# Copyright 2015 Gary Mills
#

MODULE = libfksmbsrv.so
MDBTGT = proc

MODSRCS = smbsrv.c list.c

include ../../../../Makefile.cmd
include ../../../../Makefile.cmd.64
include ../../Makefile.sparcv9
include ../../../Makefile.module

MODSRCS_DIR = ../../../common/modules/smbsrv
GENUNIX_DIR = ../../../common/modules/genunix

# Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
CPPFLAGS.first += -I../../../../../lib/smbsrv/libfksmbsrv/common
CPPFLAGS.first += -I../../../../../lib/libfakekernel/common

CPPFLAGS += -I../../../../../uts/common

C99MODE= -xc99=%all
C99LMODE= -Xc99=%all

dmod/%.o: $(GENUNIX_DIR)/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)

dmod/%.ln: $(GENUNIX_DIR)/%.c
$(LINT.c) -c $<
13 changes: 10 additions & 3 deletions usr/src/cmd/sgs/lex/Makefile.com
Expand Up @@ -19,6 +19,7 @@
# CDDL HEADER END
#
#
# Copyright 2015 Gary Mills
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down Expand Up @@ -58,7 +59,12 @@ SRCS= $(MACHSRCS) $(LIBSRCS)

LIBS = $(DYNLIB) $(LINTLIB)

# Append to LINTFLAGS and LINTFLAGS64 from lib/Makefile.lib
LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2 -erroff=E_FUNC_RET_MAYBE_IGNORED2
LINTFLAGS64 += -erroff=E_NAME_MULTIPLY_DEF2 -erroff=E_FUNC_RET_MAYBE_IGNORED2

LINTSRCS= ../common/llib-l$(LIBNAME)
$(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC)

INCLIST= $(INCLIST_$(MACH)) -I../../include -I../../include/$(MACH)
DEFLIST= -DELF
Expand All @@ -76,10 +82,9 @@ pics/%_e.o:= DEFLIST = -DEUC -DJLSLEX -DEOPTION -D$*=$*_e

CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
BUILD.AR= $(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)`
LINTFLAGS= -amux

LINTPOUT= lint.out

$(LINTLIB):= LINTFLAGS = -nvx
$(ROOTPROG):= FILEMODE = 0555

ROOTFORMS= $(FORMS:%=$(ROOTSHLIBCCS)/%)
Expand All @@ -94,7 +99,9 @@ DYNLINKLIB= $(LIBLINKS:%=$(DYNLINKLIBDIR)/%)
$(DYNLIB) := CFLAGS += $(CCVERBOSE)
$(DYNLIB) := CFLAGS64 += $(CCVERBOSE)

$(DYNLIB) := LDLIBS += -lc
LDLIBS += -lc

CLEANFILES += ../common/parser.c $(LINTPOUT)
CLOBBERFILES += $(LIBS) $(LIBRARY)

lint: lintcheck
18 changes: 5 additions & 13 deletions usr/src/cmd/sgs/lex/Makefile.targ
Expand Up @@ -19,10 +19,10 @@
# CDDL HEADER END
#
#
# Copyright 2015 Gary Mills
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#

$(PROG): objs .WAIT $(POBJS)
Expand Down Expand Up @@ -89,17 +89,9 @@ $(DYNLINKLIBDIR)/%: %$(VERS)
clean:
$(RM) $(POBJS) $(OBJS) $(PICS) $(CLEANFILES)

lint: $(LINTPOUT) $(LINTLIB)
$(LINTLIB): $$(SRCS)
$(LINT.c) -o $(LIBNAME) $(SRCS) > $(LINTOUT) 2>&1

LINT_HDR= perl ../../tools/lint_hdr.pl
lintcheck: $$(SRCS)
$(LINT.c) $(LINTCHECKFLAGS) $(SRCS) $(LDLIBS)

$(LINTPOUT): $(SRCS)
$(LINT_HDR) $(PROG) > $(LINTPOUT)
$(LINT_HDR) -s lex >> $(LINTPOUT)
$(LINT.c) $(MACHSRCS) $(LDLIBS) 2>&1 | tee -a $(LINTPOUT)

$(LINT_HDR) -s libl.so.1 >> $(LINTPOUT)
$(LINT.c) $(LIBSRCS) $(LDLIBS) 2>&1 | tee -a $(LINTPOUT)

$(LINTLIB): $(LINTSRCS)
$(LINT.c) -o $(LIBNAME) $(LINTSRCS)
4 changes: 3 additions & 1 deletion usr/src/cmd/sgs/libelf/Makefile.com
Expand Up @@ -19,12 +19,12 @@
# CDDL HEADER END
#
#
# Copyright 2015 Gary Mills
# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
#

LIBRARY= libelf.a
VERS= .1
M4= m4

MACHOBJS=
COMOBJS= ar.o begin.o cntl.o cook.o \
Expand All @@ -50,6 +50,8 @@ OBJECTS= $(BLTOBJS) $(MACHOBJS) $(COMOBJS) $(CLASSOBJS) $(MISCOBJS)

include $(SRC)/lib/Makefile.lib

# Use the value of M4 set in Makefile.master via Makefile.lib

DEMOFILES= Makefile 00README acom.c dcom.c \
pcom.c tpcom.c dispsyms.c
DEMOFILESRCDIR= ../demo
Expand Down
15 changes: 11 additions & 4 deletions usr/src/cmd/sgs/yacc/Makefile.com
Expand Up @@ -19,6 +19,7 @@
# CDDL HEADER END
#
#
# Copyright 2015 Gary Mills
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down Expand Up @@ -48,18 +49,23 @@ SRCS= $(COMSRCS) $(LIBSRCS)

LIBS = $(DYNLIB) $(LINTLIB)

# Append to LINTFLAGS and LINTFLAGS64 from lib/Makefile.lib
LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
LINTFLAGS64 += -erroff=E_NAME_MULTIPLY_DEF2

# Tune ZDEFS to ignore undefined symbols for building the yacc shared library
# since these symbols (mainly yyparse) are to be resolved elsewhere.
#
$(DYNLIB):= ZDEFS = $(ZNODEFS)
$(DYNLIBCCC):= ZDEFS = $(ZNODEFS)
LINTSRCS= ../common/llib-l$(LIBNAME)
$(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC)

INCLIST= -I../../include -I../../include/$(MACH)
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
LDLIBS= $(LDLIBS.cmd)
$(PROG):= LDLIBS = $(LDLIBS.cmd)
BUILD.AR= $(AR) $(ARFLAGS) $@ `$(LORDER) $(OBJS) | $(TSORT)`
LINTFLAGS= -amux

LINTPOUT= lint.out

C99MODE= $(C99_ENABLE)
Expand All @@ -68,7 +74,6 @@ CFLAGS64 += $(CCVERBOSE)
CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += -_gcc=-Wno-uninitialized

$(LINTLIB):= LINTFLAGS = -nvx
$(ROOTPROG):= FILEMODE = 0555

ROOTYACCPAR= $(YACCPAR:%=$(ROOTSHLIBCCS)/%)
Expand All @@ -79,7 +84,9 @@ ROOTLINT= $(LINTSRCS:../common/%=$(ROOTLINTDIR)/%)
DYNLINKLIBDIR= $(ROOTLIBDIR)
DYNLINKLIB= $(LIBLINKS:%=$(DYNLINKLIBDIR)/%)

$(DYNLIB) := LDLIBS += -lc
LDLIBS += -lc

CLEANFILES += $(LINTPOUT)
CLOBBERFILES += $(LIBS) $(LIBRARY)

lint: lintcheck
20 changes: 5 additions & 15 deletions usr/src/cmd/sgs/yacc/Makefile.targ
Expand Up @@ -19,10 +19,10 @@
# CDDL HEADER END
#
#
# Copyright 2015 Gary Mills
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#

$(PROG): objs .WAIT $(POBJS)
Expand Down Expand Up @@ -85,19 +85,9 @@ $(DYNLINKLIBDIR)/%: %$(VERS)
clean:
$(RM) $(POBJS) $(OBJS) $(PICS) $(CLEANFILES)

lint: $(LINTPOUT) $(LINTLIB)
$(LINTLIB): $$(SRCS)
$(LINT.c) -o $(LIBNAME) $(SRCS) > $(LINTOUT) 2>&1

lintcheck: $$(SRCS)
$(LINT.c) $(LINTCHECKFLAGS) $(SRCS) $(LDLIBS)

LINT_HDR= perl ../../tools/lint_hdr.pl

$(LINTPOUT): $(SRCS)
$(LINT_HDR) $(PROG) > $(LINTPOUT)
$(LINT_HDR) -s yacc >> $(LINTPOUT)
$(LINT.c) $(COMSRCS) $(LDLIBS) 2>&1 | tee -a $(LINTPOUT)

$(LINT_HDR) -s liby.so.1 >> $(LINTPOUT)
$(LINT.c) $(LIBSRCS) $(LDLIBS) 2>&1 | tee -a $(LINTPOUT)


$(LINTLIB): $(LINTSRCS)
$(LINT.c) -o $(LIBNAME) $(LINTSRCS)

0 comments on commit fca4268

Please sign in to comment.