summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpetede <none@none>2006-07-25 13:52:56 -0700
committerpetede <none@none>2006-07-25 13:52:56 -0700
commit9dd828891378a0a6a509ab601b4c5c20ca5562ec (patch)
tree4165389f824e51224d0f051458310fcd527ead85
parent937435419de303fde6598a9eda8f579228a6ee3c (diff)
downloadillumos-gate-9dd828891378a0a6a509ab601b4c5c20ca5562ec.tar.gz
6311077 Enabling ON compilation with Sun Studio 11 (Venus)
-rw-r--r--usr/src/Makefile.master36
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/Makefile.com2
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/sparc/Makefile4
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/sparcv9/Makefile4
-rw-r--r--usr/src/psm/stand/boot/i386/Makefile.com9
-rw-r--r--usr/src/tools/cw/cw.c19
-rw-r--r--usr/src/uts/sparc/Makefile.sparc.shared2
-rw-r--r--usr/src/uts/sun4u/Makefile.sun4u.shared2
-rw-r--r--usr/src/uts/sun4v/Makefile.sun4v.shared2
-rw-r--r--usr/src/uts/sun4v/arcfour/Makefile9
-rw-r--r--usr/src/uts/sun4v/arcfour2048/Makefile9
-rw-r--r--usr/src/uts/sun4v/md5/Makefile2
12 files changed, 73 insertions, 27 deletions
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index a5d1f81c9d..7518009d63 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -279,6 +279,8 @@ V9ABIWARN=
CCREGSYM= -Wc,-Qiselect-regsym=0
CCCREGSYM= -Qoption cg -Qiselect-regsym=0
+# prevent static symbols being optimized out
+CCSTATICSYM= -Wc,-Qassembler-ounrefsym=0
#
# generate 32-bit addresses in the v9 kernel. Saves memory.
CCABS32= -Wc,-xcode=abs32
@@ -358,7 +360,8 @@ C99LMODE= $(C99MODE:-xc99%=-Xc99%)
# In most places, assignments to these macros should be appended with +=
# (CPPFLAGS.master allows values to be prepended to CPPFLAGS).
sparc_CFLAGS= $(sparc_XARCH)
-sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM)
+sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \
+ $(CCSTATICSYM)
i386_CFLAGS= $(i386_XARCH)
amd64_CFLAGS= $(amd64_XARCH)
@@ -389,12 +392,18 @@ CDWARFSTR= -_gcc=-fno-dwarf2-indirect-strings
CALLSYMS= -W0,-xdbggen=no%usedonly
#
+# Default debug format for Sun Studio 11 is dwarf, so force it to
+# generate stabs.
+#
+DEBUGFORMAT= -xdebugformat=stabs
+
+#
# Flags used to build in debug mode for ctf generation. Bugs in the Devpro
# compilers currently prevent us from building with cc-emitted DWARF.
#
CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
CTF_FLAGS_i386 = -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
-CTF_FLAGS = $(CTF_FLAGS_$(MACH))
+CTF_FLAGS = $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT)
#
# Flags used with genoffsets
@@ -412,14 +421,27 @@ OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
#
# tradeoff time for space (smaller is better)
#
-sparc_SPACEFLAG = -xspace -W0,-Lt -W2,-Rcond_elim
-sparcv9_SPACEFLAG = -xspace -W0,-Lt -W2,-Rcond_elim
+sparc_SPACEFLAG = -xspace -W0,-Lt
+sparcv9_SPACEFLAG = -xspace -W0,-Lt
i386_SPACEFLAG = -xspace
amd64_SPACEFLAG =
SPACEFLAG = $($(MACH)_SPACEFLAG)
SPACEFLAG64 = $($(MACH64)_SPACEFLAG)
+#
+# The Sun Studio 11 compiler has changed the behaviour of integer
+# wrap arounds and so a flag is needed to use the legacy behaviour
+# (without this flag panics/hangs could be exposed within the source).
+#
+sparc_IROPTFLAG = -W2,-xwrap_int
+sparcv9_IROPTFLAG = -W2,-xwrap_int
+i386_IROPTFLAG =
+amd64_IROPTFLAG =
+
+IROPTFLAG = $($(MACH)_IROPTFLAG)
+IROPTFLAG64 = $($(MACH64)_IROPTFLAG)
+
sparc_XREGSFLAG = -xregs=no%appl
sparcv9_XREGSFLAG = -xregs=no%appl
i386_XREGSFLAG =
@@ -429,9 +451,9 @@ XREGSFLAG = $($(MACH)_XREGSFLAG)
XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
- $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND)
+ $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG)
CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \
- $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND)
+ $(ILDOFF) $(CERRWARN) $(C99MODE) $(CCUNBOUND) $(IROPTFLAG64)
NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \
$(ILDOFF) $(CERRWARN) $(C99MODE) $($(NATIVE_MACH)_CCUNBOUND)
@@ -580,7 +602,7 @@ NATIVE_MACH= $(MACH:amd64=i386)
# Defined here so it can be overridden by developer.
#
SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro
-SPRO_VROOT= $(SPRO_ROOT)/SOS10
+SPRO_VROOT= $(SPRO_ROOT)/SS11
GNU_ROOT= $(SFW_ROOT)
# Specify platform compiler versions for languages
diff --git a/usr/src/lib/gss_mechs/mech_krb5/Makefile.com b/usr/src/lib/gss_mechs/mech_krb5/Makefile.com
index ca044f5220..0d39b26c16 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/Makefile.com
+++ b/usr/src/lib/gss_mechs/mech_krb5/Makefile.com
@@ -199,8 +199,6 @@ include $(REL_PATH)/../../Makefile.lib
# Must come after Makefile.lib so CPPFLAGS doesn't get overwritten
include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
-sparcv9_C_PICFLAGS = -K PIC
-
K5LIBLINK=$(LIBRARY:%.a=lib%.so)
# override default text domain
diff --git a/usr/src/lib/gss_mechs/mech_krb5/sparc/Makefile b/usr/src/lib/gss_mechs/mech_krb5/sparc/Makefile
index 0e76bbaca2..76ddfcd781 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/sparc/Makefile
+++ b/usr/src/lib/gss_mechs/mech_krb5/sparc/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -9,6 +9,8 @@
MAPDIR= ../spec/sparc
include ../Makefile.com
+sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
+
.KEEP_STATE:
all: $(LIBS)
diff --git a/usr/src/lib/gss_mechs/mech_krb5/sparcv9/Makefile b/usr/src/lib/gss_mechs/mech_krb5/sparcv9/Makefile
index 9bf5228321..6d11fcc758 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/sparcv9/Makefile
+++ b/usr/src/lib/gss_mechs/mech_krb5/sparcv9/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "%Z%%M% %I% %E% SMI"
@@ -10,6 +10,8 @@ MAPDIR= ../spec/sparcv9
include ../Makefile.com
include ../../../Makefile.lib.64
+sparcv9_C_PICFLAGS = $(C_BIGPICFLAGS64)
+
.KEEP_STATE:
all: $(LIBS)
diff --git a/usr/src/psm/stand/boot/i386/Makefile.com b/usr/src/psm/stand/boot/i386/Makefile.com
index a57dd079a2..06e00ac095 100644
--- a/usr/src/psm/stand/boot/i386/Makefile.com
+++ b/usr/src/psm/stand/boot/i386/Makefile.com
@@ -2,9 +2,8 @@
# 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.
+# Common Development and Distribution License (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.
@@ -114,6 +113,10 @@ CFLAGS += -xcache=0/16/0:0/16/0
# This should be globally enabled!
#
CFLAGS += $(CCVERBOSE)
+#
+# Inherit the debug format
+#
+CFLAGS += $(DEBUGFORMAT)
YFLAGS = -d
diff --git a/usr/src/tools/cw/cw.c b/usr/src/tools/cw/cw.c
index 9d2e88f6fb..933ee9cf56 100644
--- a/usr/src/tools/cw/cw.c
+++ b/usr/src/tools/cw/cw.c
@@ -1010,6 +1010,14 @@ do_gcc(cw_ictx_t *ctx)
"-fno-eliminate-unused-debug-types");
break;
}
+ if (strcmp(arg, "-W2,-xwrap_int") == 0) {
+ /*
+ * Use the legacy behaviour (pre-SS11)
+ * for integer wrapping.
+ * gcc does not need this.
+ */
+ break;
+ }
if (strcmp(arg, "-W2,-Rcond_elim") == 0) {
/*
* Elimination and expansion of conditionals;
@@ -1038,6 +1046,13 @@ do_gcc(cw_ictx_t *ctx)
*/
break;
}
+ if (strcmp(arg, "-Wc,-Qassembler-ounrefsym=0") == 0) {
+ /*
+ * Prevents optimizing away of static variables.
+ * gcc does not do this, so it's not needed.
+ */
+ break;
+ }
#if defined(__x86)
if (strcmp(arg, "-Wu,-no_got_reloc") == 0) {
newae(ctx->i_ae, "-fno-jump-tables");
@@ -1621,10 +1636,10 @@ main(int argc, char **argv)
if ((dir = getenv("SPRO_VROOT")) != NULL) {
(void) snprintf(cc_buf, MAXPATHLEN, "%s/bin", dir);
} else if ((dir = getenv("SPRO_ROOT")) != NULL) {
- (void) snprintf(cc_buf, MAXPATHLEN, "%s/SOS10/bin", dir);
+ (void) snprintf(cc_buf, MAXPATHLEN, "%s/SS11/bin", dir);
} else if ((dir = getenv("BUILD_TOOLS")) != NULL) {
(void) snprintf(cc_buf, MAXPATHLEN,
- "%s/SUNWspro/SOS10/bin", dir);
+ "%s/SUNWspro/SS11/bin", dir);
}
if (dir != NULL) {
dirs[CIDX(CW_C_CC, 0)] = (const char *)cc_buf;
diff --git a/usr/src/uts/sparc/Makefile.sparc.shared b/usr/src/uts/sparc/Makefile.sparc.shared
index 33f27c463f..b7353edd3c 100644
--- a/usr/src/uts/sparc/Makefile.sparc.shared
+++ b/usr/src/uts/sparc/Makefile.sparc.shared
@@ -136,6 +136,8 @@ CFLAGS += $(CERRWARN)
CFLAGS += $(CTF_FLAGS)
CFLAGS += $(C99MODE)
CFLAGS += $(CCUNBOUND)
+CFLAGS += $(CCSTATICSYM)
+CFLAGS += $(IROPTFLAG)
CFLAGS += -xregs=no%float
ASFLAGS += $(XARCH)
diff --git a/usr/src/uts/sun4u/Makefile.sun4u.shared b/usr/src/uts/sun4u/Makefile.sun4u.shared
index 4ae2993ff2..33044a374b 100644
--- a/usr/src/uts/sun4u/Makefile.sun4u.shared
+++ b/usr/src/uts/sun4u/Makefile.sun4u.shared
@@ -205,6 +205,8 @@ CFLAGS += $(CERRWARN)
CFLAGS += $(CTF_FLAGS)
CFLAGS += $(C99MODE)
CFLAGS += $(CCUNBOUND)
+CFLAGS += $(CCSTATICSYM)
+CFLAGS += $(IROPTFLAG)
CFLAGS += -xregs=no%float
ASFLAGS += $(AS_XARCH)
diff --git a/usr/src/uts/sun4v/Makefile.sun4v.shared b/usr/src/uts/sun4v/Makefile.sun4v.shared
index 817dd7993f..a3e6a41e35 100644
--- a/usr/src/uts/sun4v/Makefile.sun4v.shared
+++ b/usr/src/uts/sun4v/Makefile.sun4v.shared
@@ -167,6 +167,8 @@ CFLAGS += $(CERRWARN)
CFLAGS += $(CTF_FLAGS)
CFLAGS += $(C99MODE)
CFLAGS += $(CCUNBOUND)
+CFLAGS += $(CCSTATICSYM)
+CFLAGS += $(IROPTFLAG)
CFLAGS += -xregs=no%float
CPPFLAGS += -DGLREG
diff --git a/usr/src/uts/sun4v/arcfour/Makefile b/usr/src/uts/sun4v/arcfour/Makefile
index 55b9b59470..0a7abb5b3f 100644
--- a/usr/src/uts/sun4v/arcfour/Makefile
+++ b/usr/src/uts/sun4v/arcfour/Makefile
@@ -2,9 +2,8 @@
# 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.
+# Common Development and Distribution License (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.
@@ -22,7 +21,7 @@
#
# uts/sun4v/arcfour/Makefile
#
-# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "%Z%%M% %I% %E% SMI"
@@ -80,7 +79,7 @@ COPTIMIZE = -xO5 -xbuiltin=%all
#
# Override the default -xspace setting
#
-sparc_SPACEFLAG = -W0,-Lt -W2,-Rcond_elim
+sparc_SPACEFLAG = -W0,-Lt
#
# Default build targets.
diff --git a/usr/src/uts/sun4v/arcfour2048/Makefile b/usr/src/uts/sun4v/arcfour2048/Makefile
index dcbb88d920..3cd7b549d1 100644
--- a/usr/src/uts/sun4v/arcfour2048/Makefile
+++ b/usr/src/uts/sun4v/arcfour2048/Makefile
@@ -2,9 +2,8 @@
# 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.
+# Common Development and Distribution License (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.
@@ -20,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "%Z%%M% %I% %E% SMI"
@@ -70,7 +69,7 @@ COPTIMIZE = -xO5 -xbuiltin=%all
#
# Override the default -xspace setting
#
-sparc_SPACEFLAG = -W0,-Lt -W2,-Rcond_elim
+sparc_SPACEFLAG = -W0,-Lt
#
# Turn on doubleword alignment for 64 bit registers
diff --git a/usr/src/uts/sun4v/md5/Makefile b/usr/src/uts/sun4v/md5/Makefile
index e99af50999..535be83119 100644
--- a/usr/src/uts/sun4v/md5/Makefile
+++ b/usr/src/uts/sun4v/md5/Makefile
@@ -65,7 +65,7 @@ CFLAGS += $(CCVERBOSE)
#
# Override the default -xspace setting
#
-sparc_SPACEFLAG = -W0,-Lt -W2,-Rcond_elim
+sparc_SPACEFLAG = -W0,-Lt
#
# md5 depends on the kcf framework