< prev index next >

make/autoconf/flags-ldflags.m4

Print this page


   1 #
   2 # Copyright (c) 2011, 2019, 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.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  71 
  72     # Add -z defs, to forbid undefined symbols in object files.
  73     BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs"
  74 
  75     BASIC_LDFLAGS_JVM_ONLY="-Wl,-O1 -Wl,-z,relro"
  76 
  77 
  78   elif test "x$TOOLCHAIN_TYPE" = xclang; then
  79     BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \
  80         -fPIC"
  81 
  82   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
  83     BASIC_LDFLAGS="-Wl,-z,defs"
  84     BASIC_LDFLAGS_ONLYCXX="-norunpath"
  85     BASIC_LDFLAGS_ONLYCXX_JDK_ONLY="-xnolib"
  86 
  87     BASIC_LDFLAGS_JDK_ONLY="-ztext"
  88     BASIC_LDFLAGS_JVM_ONLY="-library=%none -mt -z noversion"
  89 
  90   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
  91     BASIC_LDFLAGS="-b64 -brtl -bnorwexec -bnolibpath -bexpall -bernotok -btextpsize:64K \
  92         -bdatapsize:64K -bstackpsize:64K"
  93     # libjvm.so has gotten too large for normal TOC size; compile with qpic=large and link with bigtoc
  94     BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r -bbigtoc"
  95 
  96   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
  97     BASIC_LDFLAGS="-nologo -opt:ref"
  98     BASIC_LDFLAGS_JDK_ONLY="-incremental:no"
  99     BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
 100   fi
 101 
 102   if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
 103     if test -n "$HAS_NOEXECSTACK"; then
 104       BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,noexecstack"
 105     fi
 106   fi
 107 
 108   # Setup OS-dependent LDFLAGS
 109   if test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xgcc; then
 110     if test "x$OPENJDK_TARGET_OS" = xmacosx; then
 111       # Assume clang or gcc.


   1 #
   2 # Copyright (c) 2011, 2018, 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.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  71 
  72     # Add -z defs, to forbid undefined symbols in object files.
  73     BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs"
  74 
  75     BASIC_LDFLAGS_JVM_ONLY="-Wl,-O1 -Wl,-z,relro"
  76 
  77 
  78   elif test "x$TOOLCHAIN_TYPE" = xclang; then
  79     BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \
  80         -fPIC"
  81 
  82   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
  83     BASIC_LDFLAGS="-Wl,-z,defs"
  84     BASIC_LDFLAGS_ONLYCXX="-norunpath"
  85     BASIC_LDFLAGS_ONLYCXX_JDK_ONLY="-xnolib"
  86 
  87     BASIC_LDFLAGS_JDK_ONLY="-ztext"
  88     BASIC_LDFLAGS_JVM_ONLY="-library=%none -mt -z noversion"
  89 
  90   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
  91     BASIC_LDFLAGS="-b64 -brtl -bnolibpath -bexpall -bernotok -btextpsize:64K \
  92         -bdatapsize:64K -bstackpsize:64K"
  93     # libjvm.so has gotten too large for normal TOC size; compile with qpic=large and link with bigtoc
  94     BASIC_LDFLAGS_JVM_ONLY="-Wl,-lC_r -bbigtoc"
  95 
  96   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
  97     BASIC_LDFLAGS="-nologo -opt:ref"
  98     BASIC_LDFLAGS_JDK_ONLY="-incremental:no"
  99     BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
 100   fi
 101 
 102   if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
 103     if test -n "$HAS_NOEXECSTACK"; then
 104       BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,noexecstack"
 105     fi
 106   fi
 107 
 108   # Setup OS-dependent LDFLAGS
 109   if test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xgcc; then
 110     if test "x$OPENJDK_TARGET_OS" = xmacosx; then
 111       # Assume clang or gcc.


< prev index next >