< prev index next >

hotspot/make/bsd/makefiles/gcc.make

Print this page


   1 #
   2 # Copyright (c) 1999, 2015, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #


 354 
 355 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
 356 ifeq ($(USE_PRECOMPILED_HEADER),0)
 357 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
 358 endif
 359 
 360 ifeq ($(OS_VENDOR), Darwin)
 361   # Setting these parameters makes it an error to link to macosx APIs that are
 362   # newer than the given OS version and makes the linked binaries compatible even
 363   # if built on a newer version of the OS.
 364   # The expected format is X.Y.Z
 365   ifeq ($(MACOSX_VERSION_MIN),)
 366     MACOSX_VERSION_MIN=10.7.0
 367   endif
 368   # The macro takes the version with no dots, ex: 1070
 369   CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
 370             -mmacosx-version-min=$(MACOSX_VERSION_MIN)
 371   LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
 372 endif
 373 






 374 
 375 #------------------------------------------------------------------------
 376 # Assembler flags
 377 
 378 # Enforce prerpocessing of .s files
 379 ASFLAGS += -x assembler-with-cpp
 380 
 381 #------------------------------------------------------------------------
 382 # Linker flags
 383 
 384 # statically link libstdc++.so, work with gcc but ignored by g++
 385 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
 386 
 387 # Ensure use libstdc++ on clang, not libc++
 388 ifeq ($(USE_CLANG), true)

 389   LFLAGS += -stdlib=libstdc++

 390 endif
 391 
 392 ifeq ($(USE_CLANG),)
 393   # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
 394   ifneq ($(CC_VER_MAJOR), 2)
 395     STATIC_LIBGCC += -static-libgcc
 396   endif
 397 
 398   ifneq ($(OS_VENDOR), Darwin)
 399     ifneq (, findstring(debug,$(BUILD_FLAVOR)))
 400       # for relocations read-only
 401       LFLAGS += -Xlinker -z -Xlinker relro
 402 
 403       ifeq ($(BUILD_FLAVOR), debug)
 404         # disable incremental relocations linking
 405         LFLAGS += -Xlinker -z -Xlinker now
 406       endif
 407     endif
 408   endif
 409 


   1 #
   2 # Copyright (c) 1999, 2016, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #


 354 
 355 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
 356 ifeq ($(USE_PRECOMPILED_HEADER),0)
 357 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
 358 endif
 359 
 360 ifeq ($(OS_VENDOR), Darwin)
 361   # Setting these parameters makes it an error to link to macosx APIs that are
 362   # newer than the given OS version and makes the linked binaries compatible even
 363   # if built on a newer version of the OS.
 364   # The expected format is X.Y.Z
 365   ifeq ($(MACOSX_VERSION_MIN),)
 366     MACOSX_VERSION_MIN=10.7.0
 367   endif
 368   # The macro takes the version with no dots, ex: 1070
 369   CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
 370             -mmacosx-version-min=$(MACOSX_VERSION_MIN)
 371   LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
 372 endif
 373 
 374 # clang on OpenBSD does not support '__thread'.
 375 ifeq ($(USE_CLANG), true)
 376   ifeq ($(OS_VENDOR), OpenBSD)
 377     CFLAGS += -DUSE_LIBRARY_BASED_TLS_ONLY
 378   endif
 379 endif
 380 
 381 #------------------------------------------------------------------------
 382 # Assembler flags
 383 
 384 # Enforce prerpocessing of .s files
 385 ASFLAGS += -x assembler-with-cpp
 386 
 387 #------------------------------------------------------------------------
 388 # Linker flags
 389 
 390 # statically link libstdc++.so, work with gcc but ignored by g++
 391 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
 392 
 393 # Ensure use libstdc++ on clang, not libc++
 394 ifeq ($(USE_CLANG), true)
 395   ifeq ($(OS_VENDOR), Darwin)
 396     LFLAGS += -stdlib=libstdc++
 397   endif
 398 endif
 399 
 400 ifeq ($(USE_CLANG),)
 401   # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
 402   ifneq ($(CC_VER_MAJOR), 2)
 403     STATIC_LIBGCC += -static-libgcc
 404   endif
 405 
 406   ifneq ($(OS_VENDOR), Darwin)
 407     ifneq (, findstring(debug,$(BUILD_FLAVOR)))
 408       # for relocations read-only
 409       LFLAGS += -Xlinker -z -Xlinker relro
 410 
 411       ifeq ($(BUILD_FLAVOR), debug)
 412         # disable incremental relocations linking
 413         LFLAGS += -Xlinker -z -Xlinker now
 414       endif
 415     endif
 416   endif
 417 


< prev index next >