build/solaris/makefiles/gcc.make

Wed, 02 Apr 2008 12:09:59 -0700

author
jrose
date
Wed, 02 Apr 2008 12:09:59 -0700
changeset 535
c7c777385a15
parent 435
a61af66fc99e
permissions
-rw-r--r--

6667042: PrintAssembly option does not work without special plugin
Summary: remove old private plugin interface, simplify, rework old plugin to use unchanged Gnu sources
Reviewed-by: kvn, rasbold

     1 #
     2 # Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.
     8 #
     9 # This code is distributed in the hope that it will be useful, but WITHOUT
    10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    12 # version 2 for more details (a copy is included in the LICENSE file that
    13 # accompanied this code).
    14 #
    15 # You should have received a copy of the GNU General Public License version
    16 # 2 along with this work; if not, write to the Free Software Foundation,
    17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    18 #
    19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20 # CA 95054 USA or visit www.sun.com if you need additional information or
    21 # have any questions.
    22 #  
    23 #
    25 #------------------------------------------------------------------------
    26 # CC, CPP & AS
    28 CPP = g++
    29 CC  = gcc
    30 AS  = $(CC) -c
    32 Compiler = gcc
    34 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
    35 # prints the numbers (e.g. "2.95", "3.2.1")
    36 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
    37 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
    39 # Check for the versions of C++ and C compilers ($CPP and $CC) used. 
    41 # Get the last thing on the line that looks like x.x+ (x is a digit).
    42 COMPILER_REV := \
    43 $(shell $(CPP) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
    44 C_COMPILER_REV := \
    45 $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
    48 # check for precompiled headers support
    49 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
    50 USE_PRECOMPILED_HEADER=1
    51 PRECOMPILED_HEADER_DIR=.
    52 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch
    53 endif
    56 #------------------------------------------------------------------------
    57 # Compiler flags
    59 # position-independent code
    60 PICFLAG = -fPIC
    62 VM_PICFLAG/LIBJVM = $(PICFLAG)
    63 VM_PICFLAG/AOUT   =
    64 VM_PICFLAG        = $(VM_PICFLAG/$(LINK_INTO))
    66 CFLAGS += $(VM_PICFLAG)
    67 CFLAGS += -fno-rtti
    68 CFLAGS += -fno-exceptions
    69 CFLAGS += -D_REENTRANT
    70 CFLAGS += -fcheck-new
    72 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
    74 ARCHFLAG/sparc   = -m32 -mcpu=v9
    75 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
    76 ARCHFLAG/i486    = -m32 -march=i586
    77 ARCHFLAG/amd64   = -m64 -march=k8
    80 # Optional sub-directory in /usr/lib where BUILDARCH libraries are kept.
    81 ISA_DIR=$(ISA_DIR/$(BUILDARCH))
    82 ISA_DIR/amd64=/amd64
    83 ISA_DIR/i486=
    84 ISA_DIR/sparcv9=/64
    87 CFLAGS     += $(ARCHFLAG)
    88 AOUT_FLAGS += $(ARCHFLAG)
    89 LFLAGS     += $(ARCHFLAG)
    90 ASFLAGS    += $(ARCHFLAG)
    92 ifeq ($(BUILDARCH), amd64)
    93 ASFLAGS += -march=k8  -march=amd64
    94 LFLAGS += -march=k8 
    95 endif
    98 # Use C++ Interpreter
    99 ifdef CC_INTERP
   100   CFLAGS += -DCC_INTERP
   101 endif
   103 # Keep temporary files (.ii, .s)
   104 ifdef NEED_ASM
   105   CFLAGS += -save-temps
   106 else
   107   CFLAGS += -pipe
   108 endif
   111 # Compiler warnings are treated as errors 
   112 WARNINGS_ARE_ERRORS = -Werror 
   113 # Enable these warnings. See 'info gcc' about details on these options
   114 ADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare 
   115 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ADDITIONAL_WARNINGS) 
   116 # Special cases 
   117 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))  
   119 # The flags to use for an Optimized g++ build
   120 OPT_CFLAGS += -O3
   122 # Hotspot uses very unstrict aliasing turn this optimization off
   123 OPT_CFLAGS += -fno-strict-aliasing
   125 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp 
   126 # if we use expensive-optimizations
   127 # Note: all ia64 setting reflect the ones for linux
   128 # No actial testing was performed: there is no Solaris on ia64 presently
   129 ifeq ($(BUILDARCH), ia64)
   130 OPT_CFLAGS/bytecodeInterpreter.o += -fno-expensive-optimizations
   131 endif
   133 OPT_CFLAGS/NOOPT=-O0
   134 #------------------------------------------------------------------------
   135 # Linker flags
   137 # statically link libstdc++.so, work with gcc but ignored by g++
   138 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
   140 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
   141 ifneq ("${CC_VER_MAJOR}", "2")
   142 STATIC_LIBGCC += -static-libgcc
   143 endif
   145 ifeq ($(BUILDARCH), ia64)
   146 # Note: all ia64 setting reflect the ones for linux
   147 # No actial testing was performed: there is no Solaris on ia64 presently
   148 LFLAGS += -Wl,-relax
   149 endif
   151 ifdef USE_GNULD
   152 # Enable linker optimization
   153 LFLAGS += -Xlinker -O1
   155 # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
   156 MAPFLAG = -Xlinker --version-script=FILENAME 
   157 else 
   158 MAPFLAG = -Xlinker -M -Xlinker FILENAME 
   159 endif 
   161 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
   162 SONAMEFLAG = -Xlinker -soname=SONAME
   164 # Build shared library
   165 SHARED_FLAG = -shared
   167 #------------------------------------------------------------------------
   168 # Debug flags
   170 # Use the stabs format for debugging information (this is the default 
   171 # on gcc-2.91). It's good enough, has all the information about line 
   172 # numbers and local variables, and libjvm_g.so is only about 16M. 
   173 # Change this back to "-g" if you want the most expressive format. 
   174 # (warning: that could easily inflate libjvm_g.so to 150M!) 
   175 # Note: The Itanium gcc compiler crashes when using -gstabs. 
   176 DEBUG_CFLAGS/ia64  = -g 
   177 DEBUG_CFLAGS/amd64 = -g 
   178 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) 
   179 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) 
   180 DEBUG_CFLAGS += -gstabs 
   181 endif 
   183 MCS = /usr/ccs/bin/mcs

mercurial