6470487 ld relocation errors occur when building the amd64 kernel for nevada with mars build 30
--- a/usr/src/Makefile.master Mon Oct 09 10:56:01 2006 -0700
+++ b/usr/src/Makefile.master Mon Oct 09 12:36:41 2006 -0700
@@ -100,14 +100,19 @@
STRIP_COMMENTS= $(INTERNAL_RELEASE_BUILD)
# set __GNUC= in the environment to build 32-bit with the gcc compiler.
-# The default is to use the Sun Studio 10 compiler for all processor types.
+# The default is to use the Sun Studio compiler for all processor types.
__GNUC= $(POUND_SIGN)
# set __GNUC64= in the environment to build 64-bit with the gcc compiler.
-# The default is to use the Sun Studio 10 compiler by using the __GNUC
-# setting.
+# Inherit the __GNUC value by default, and if that is set to $(POUND_SIGN)
+# then this means use the Sun Studio compiler.
__GNUC64= $(__GNUC)
+# set __SSNEXT= in the enviroment to build with the 'next' release of
+# the Sun Studio compiler. This will cause command line options specific
+# to the 'next' version of the Sun Studio compiler to be used.
+__SSNEXT= $(POUND_SIGN)
+
# CLOSED is the root of the tree that contains source which isn't released
# as open source
CLOSED= $(SRC)/../closed
@@ -328,6 +333,7 @@
sparcv9_STAND_FLAGS= -_gcc=-ffreestanding
i386_STAND_FLAGS= -_gcc=-ffreestanding
amd64_STAND_FLAGS= -Wu,-xmodel=kernel
+$(__SSNEXT)amd64_STAND_FLAGS= -xmodel=kernel
SAVEARGS= -Wu,-save_args
amd64_STAND_FLAGS += $(SAVEARGS)
--- a/usr/src/tools/cw/cw.c Mon Oct 09 10:56:01 2006 -0700
+++ b/usr/src/tools/cw/cw.c Mon Oct 09 12:36:41 2006 -0700
@@ -225,6 +225,7 @@
* -Wl,<arg> pass-thru
* -W{m,0,2,h,i,u> error/ignore
* -Wu,-xmodel=kernel -ffreestanding -mcmodel=kernel -mno-red-zone
+ * -xmodel=kernel -ffreestanding -mcmodel=kernel -mno-red-zone
* -Wu,-save_args -msave-args
* -w pass-thru
* -Xa -std=iso9899:199409 or -ansi
@@ -1178,6 +1179,18 @@
break;
error(arg);
break;
+#if defined(__x86)
+ case 'm':
+ if (strcmp(arg, "-xmodel=kernel") == 0) {
+ newae(ctx->i_ae, "-ffreestanding");
+ newae(ctx->i_ae, "-mno-red-zone");
+ model = "-mcmodel=kernel";
+ nolibc = 1;
+ break;
+ }
+ error(arg);
+ break;
+#endif /* __x86 */
case 'M':
if (strcmp(arg, "-xM") == 0) {
newae(ctx->i_ae, "-M");