--- a/components/gcc3/Makefile Tue Jan 26 12:07:50 2016 -0600
+++ b/components/gcc3/Makefile Mon Jan 25 17:27:47 2016 -0600
@@ -18,7 +18,7 @@
#
# CDDL HEADER END
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
#
include ../../make-rules/shared-macros.mk
@@ -47,6 +47,10 @@
PKG_MACROS += GNU_ARCH="$(GNU_ARCH)"
+# Make sure to pass -m32/64 any time the installed GCC is used
+CC += -m$(BITS)
+CXX += -m$(BITS)
+
# CC_BITS may get in the way
CC_BITS=
--- a/components/gcc48/Makefile Tue Jan 26 12:07:50 2016 -0600
+++ b/components/gcc48/Makefile Mon Jan 25 17:27:47 2016 -0600
@@ -18,7 +18,7 @@
#
# CDDL HEADER END
#
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
#
export PARFAIT_BUILD=no
@@ -56,6 +56,10 @@
PKG_MACROS += GCC_V=$(word 1,$(VERSION_NUMBERS))$(word 2,$(VERSION_NUMBERS))
PKG_MACROS += GCC_BASEDIR=usr/gcc/$(GCC_VERSION)
+# Make sure to pass -m32/64 any time the installed GCC is used
+CC += $(CC_BITS)
+CXX += $(CC_BITS)
+
CFLAGS.i386 = -mtune=opteron -march=opteron
CFLAGS.sparc = -mtune=ultrasparc -mcpu=ultrasparc -mno-unaligned-doubles
CFLAGS = -g -O2
--- a/components/gcc49/Makefile Tue Jan 26 12:07:50 2016 -0600
+++ b/components/gcc49/Makefile Mon Jan 25 17:27:47 2016 -0600
@@ -66,6 +66,10 @@
GNU_SECTIONS_MAPFILE = $(COMPONENT_DIR)/Solaris/map.gnu-sections
+# Make sure to pass -m32/64 any time the installed GCC is used
+CC += $(CC_BITS)
+CXX += $(CC_BITS)
+
CFLAGS.i386 = -mtune=opteron -march=opteron -fno-strict-aliasing
CFLAGS.sparc = -mtune=ultrasparc3 -mcpu=ultrasparc3 -mvis2 \
-mno-unaligned-doubles -mhard-float -fno-strict-aliasing