incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael van der Westhuizen" <r1mi...@gmail.com>
Subject Re: config with wide has no effect on Solaris/Intel + patch
Date Sat, 07 Jul 2007 19:27:38 GMT
Aplogies for replying to my own mail.

On 7/7/07, Michael van der Westhuizen <r1mikey@gmail.com> wrote:
> Hi,
[snip]
> Note that on Solaris CXXFLAGS.wide is supposed to be -xarch=amd64, but
> this is not being used by the build system.
>
> Hunting this down, it seems that sunpro.config expects "uname -p" to
> return amd64 on 64 bit Solaris/Intel. This is not true, it returns
> i386.

Here's a better diff. This handles the correct wide flags when using
Sun C++ 5.9 or better (Studio 12).

Michael

Index: etc/config/sunpro.config
===================================================================
--- etc/config/sunpro.config    (revision 554241)
+++ etc/config/sunpro.config    (working copy)
@@ -77,21 +77,32 @@
 SINGL_CPPFLAGS =
 SINGL_LDFLAGS  =

-# (try to) determine the architecture via the (non-standard) -p option
-# recognized on (at least) Linux and Solaris
-arch=$(shell uname -p 2>/dev/null)
+CCMAJOR=$(shell echo $(CCVER) | cut -f1 -d'.')
+CCMINOR=$(shell echo $(CCVER) | cut -f2 -d'.')

-ifeq ($(arch),sparc)
-    # wide (64-bit) flags -- must be set explicitly
-    # narrow (32-bit) flags are implicit on SPARC
-    wide_flags     = -xarch=v9
-    narrow_flags   = -xarch=v8
+ifeq ($(shell expr $(CCMAJOR) \>= 5 \& $(CCMINOR) \>= 9),1)
+    wide_flags     = -m64
+    narrow_flags   = -m32
 else
-    # wide (64-bit) flags -- must be set explicitly
-    # narrow (32-bit) flags are implicit on AMD64
-    ifeq ($(arch),amd64)
-        wide_flags     = -xarch=amd64
-        narrow_flags   =
+    # (try to) determine the architecture via the (non-standard) -p option
+    # recognized on (at least) Linux and Solaris
+    arch=$(shell uname -p 2>/dev/null)
+
+    ifeq ($(arch),sparc)
+        # wide (64-bit) flags -- must be set explicitly
+        # narrow (32-bit) flags are implicit on SPARC
+        wide_flags     = -xarch=v9
+        narrow_flags   = -xarch=v8
+    else
+        # wide (64-bit) flags -- must be set explicitly
+        # narrow (32-bit) flags are implicit on AMD64
+        ifeq ($(OSNAME),SunOS)
+            arch=$(shell /usr/bin/optisa amd64)
+        endif
+        ifeq ($(arch),amd64)
+            wide_flags     = -xarch=amd64
+            narrow_flags   =
+        endif
     endif
 endif

Mime
View raw message