jdk/make/common/Defs-linux.gmk

Print this page




  99 endif
 100 
 101 CC_OPT/NONE     = 
 102 CC_OPT/LOWER    = -O2
 103 CC_OPT/HIGHER   = -O3
 104 CC_OPT/HIGHEST  = -O3
 105 
 106 CC_OPT          = $(CC_OPT/$(OPTIMIZATION_LEVEL))
 107 
 108 # For all platforms, do not omit the frame pointer register usage. 
 109 #    We need this frame pointer to make it easy to walk the stacks.
 110 #    This should be the default on X86, but ia64 and amd64 may not have this
 111 #    as the default.
 112 CFLAGS_REQUIRED_amd64   += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
 113 CFLAGS_REQUIRED_i586    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
 114 CFLAGS_REQUIRED_ia64    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
 115 CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
 116 LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
 117 CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
 118 LDFLAGS_COMMON_sparc    += -m32 -mcpu=v9
 119 CFLAGS_REQUIRED         =  $(CFLAGS_REQUIRED_$(ARCH))
 120 LDFLAGS_COMMON          += $(LDFLAGS_COMMON_$(ARCH))








 121 
 122 # If this is a --hash-style=gnu system, use --hash-style=both
 123 #   The gnu .hash section won't work on some Linux systems like SuSE 10.
 124 _HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | $(GREP) -- '--hash-style=gnu')
 125 ifneq ($(_HAS_HASH_STYLE_GNU),)
 126   LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
 127 endif
 128 LDFLAGS_COMMON          += $(LDFLAGS_HASH_STYLE)
 129 
 130 #
 131 # Selection of warning messages
 132 #
 133 GCC_INHIBIT     = -Wno-unused -Wno-parentheses
 134 GCC_STYLE       = 
 135 GCC_WARNINGS    = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
 136 
 137 #
 138 # Treat compiler warnings as errors, if warnings not allowed
 139 #
 140 ifeq ($(COMPILER_WARNINGS_FATAL),true)


 200 endif
 201 
 202 ifdef LIBRARY
 203   # Libraries need to locate other libraries at runtime, and you can tell
 204   #   a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
 205   #   buried inside the .so. The $ORIGIN says to look relative to where
 206   #   the library itself is and it can be followed with relative paths from
 207   #   that. By default we always look in $ORIGIN, optionally we add relative
 208   #   paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
 209   #   On Linux we add a flag -z origin, not sure if this is necessary, but 
 210   #   doesn't seem to hurt.
 211   #   The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
 212   #   Try: 'readelf -d lib*.so' to see these settings in a library.
 213   #
 214   LDFLAGS_COMMON += -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN
 215   LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN/%)
 216 endif
 217 
 218 EXTRA_LIBS += -lc
 219 
 220 LDFLAGS_DEFS_OPTION  = -z defs
 221 LDFLAGS_COMMON  += $(LDFLAGS_DEFS_OPTION)
 222 
 223 #
 224 # -L paths for finding and -ljava
 225 #
 226 LDFLAGS_OPT     = -Xlinker -O1
 227 LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
 228 LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
 229 
 230 #
 231 # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
 232 # statically link libgcc but will print a warning with the flag. We don't 
 233 # want the warning, so check gcc version first.
 234 #
 235 CC_VER_MAJOR := $(shell $(CC) -dumpversion | $(SED) 's/egcs-//' | $(CUT) -d'.' -f1)
 236 ifeq ("$(CC_VER_MAJOR)", "3")
 237 OTHER_LDFLAGS  += -static-libgcc
 238 endif
 239 
 240 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)




  99 endif
 100 
 101 CC_OPT/NONE     = 
 102 CC_OPT/LOWER    = -O2
 103 CC_OPT/HIGHER   = -O3
 104 CC_OPT/HIGHEST  = -O3
 105 
 106 CC_OPT          = $(CC_OPT/$(OPTIMIZATION_LEVEL))
 107 
 108 # For all platforms, do not omit the frame pointer register usage. 
 109 #    We need this frame pointer to make it easy to walk the stacks.
 110 #    This should be the default on X86, but ia64 and amd64 may not have this
 111 #    as the default.
 112 CFLAGS_REQUIRED_amd64   += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
 113 CFLAGS_REQUIRED_i586    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
 114 CFLAGS_REQUIRED_ia64    += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
 115 CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
 116 LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
 117 CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
 118 LDFLAGS_COMMON_sparc    += -m32 -mcpu=v9
 119 ifeq ($(ZERO_BUILD), true)
 120   CFLAGS_REQUIRED       =  $(ZERO_ARCHFLAG)
 121   ifeq ($(ZERO_ENDIANNESS), little)
 122     CFLAGS_REQUIRED     += -D_LITTLE_ENDIAN
 123   endif
 124   LDFLAGS_COMMON        += $(ZERO_ARCHFLAG)
 125 else
 126   CFLAGS_REQUIRED       =  $(CFLAGS_REQUIRED_$(ARCH))
 127   LDFLAGS_COMMON        += $(LDFLAGS_COMMON_$(ARCH))
 128 endif
 129 
 130 # If this is a --hash-style=gnu system, use --hash-style=both
 131 #   The gnu .hash section won't work on some Linux systems like SuSE 10.
 132 _HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | $(GREP) -- '--hash-style=gnu')
 133 ifneq ($(_HAS_HASH_STYLE_GNU),)
 134   LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
 135 endif
 136 LDFLAGS_COMMON          += $(LDFLAGS_HASH_STYLE)
 137 
 138 #
 139 # Selection of warning messages
 140 #
 141 GCC_INHIBIT     = -Wno-unused -Wno-parentheses
 142 GCC_STYLE       = 
 143 GCC_WARNINGS    = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
 144 
 145 #
 146 # Treat compiler warnings as errors, if warnings not allowed
 147 #
 148 ifeq ($(COMPILER_WARNINGS_FATAL),true)


 208 endif
 209 
 210 ifdef LIBRARY
 211   # Libraries need to locate other libraries at runtime, and you can tell
 212   #   a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
 213   #   buried inside the .so. The $ORIGIN says to look relative to where
 214   #   the library itself is and it can be followed with relative paths from
 215   #   that. By default we always look in $ORIGIN, optionally we add relative
 216   #   paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
 217   #   On Linux we add a flag -z origin, not sure if this is necessary, but 
 218   #   doesn't seem to hurt.
 219   #   The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
 220   #   Try: 'readelf -d lib*.so' to see these settings in a library.
 221   #
 222   LDFLAGS_COMMON += -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN
 223   LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN/%)
 224 endif
 225 
 226 EXTRA_LIBS += -lc
 227 
 228 LDFLAGS_DEFS_OPTION  = -Xlinker -z -Xlinker defs
 229 LDFLAGS_COMMON  += $(LDFLAGS_DEFS_OPTION)
 230 
 231 #
 232 # -L paths for finding and -ljava
 233 #
 234 LDFLAGS_OPT     = -Xlinker -O1
 235 LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
 236 LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
 237 
 238 #
 239 # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
 240 # statically link libgcc but will print a warning with the flag. We don't 
 241 # want the warning, so check gcc version first.
 242 #
 243 CC_VER_MAJOR := $(shell $(CC) -dumpversion | $(SED) 's/egcs-//' | $(CUT) -d'.' -f1)
 244 ifeq ("$(CC_VER_MAJOR)", "3")
 245 OTHER_LDFLAGS  += -static-libgcc
 246 endif
 247 
 248 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)