aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2012-02-18 06:12:40 +0000
committerDoug Kwan <dougkwan@google.com>2012-02-18 06:12:40 +0000
commitdce8ad161ed9303ef7e43370b44610aa900fdbe5 (patch)
tree18e60095b3b3797ea811ea283b6d928a95d45dba
parentecc1095e521991f86147d76b36f8189d2b355390 (diff)
2012-02-17 Doug Kwan <dougkwan@google.com>
* gcc/config.gcc (powerpc*-*-linux): Pull in GRTEv2 spec changes if target matches *-grtev2-*. * gcc/config/rs6000/linux64.h (GLIB_DYNAMIC_LINKER{32,64}): Add runtime root prefix to glibc's dynamic linker. * gcc/config/rs6000/linux-grtev2.h: New file. * gcc/config/rs6000/sysv4.h (GLIB_DYNAMIC_LINKER): Add runtime root prefix to glibc's dynamic linker. (LINUX_GRTE_EXTRA_SPECS): Define to be empty if no definition found. (SUBTARGET_EXTRA_SPECS): Include LINUX_GRTE_EXTRA_SPECS. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/google/integration@184370 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.google-integration12
-rw-r--r--gcc/config.gcc6
-rw-r--r--gcc/config/rs6000/linux-grtev2.h43
-rw-r--r--gcc/config/rs6000/linux64.h4
-rw-r--r--gcc/config/rs6000/sysv4.h11
5 files changed, 73 insertions, 3 deletions
diff --git a/ChangeLog.google-integration b/ChangeLog.google-integration
index 7f8b0b15e1f..c191db0d462 100644
--- a/ChangeLog.google-integration
+++ b/ChangeLog.google-integration
@@ -1,3 +1,15 @@
+2012-02-17 Doug Kwan <dougkwan@google.com>
+
+ * gcc/config.gcc (powerpc*-*-linux): Pull in GRTEv2 spec changes if
+ target matches *-grtev2-*.
+ * gcc/config/rs6000/linux64.h (GLIB_DYNAMIC_LINKER{32,64}): Add
+ runtime root prefix to glibc's dynamic linker.
+ * gcc/config/rs6000/linux-grtev2.h: New file.
+ * gcc/config/rs6000/sysv4.h (GLIB_DYNAMIC_LINKER): Add
+ runtime root prefix to glibc's dynamic linker.
+ (LINUX_GRTE_EXTRA_SPECS): Define to be empty if no definition found.
+ (SUBTARGET_EXTRA_SPECS): Include LINUX_GRTE_EXTRA_SPECS.
+
2011-10-12 Diego Novillo <dnovillo@google.com>
* README.google-integration: Remove.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 5189de93d2a..e4afaaeacd9 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2040,6 +2040,12 @@ powerpc-*-linux* | powerpc64-*-linux*)
if test x${enable_secureplt} = xyes; then
tm_file="rs6000/secureplt.h ${tm_file}"
fi
+ # Pull in spec changes for GRTEv2 configurations.
+ case ${target} in
+ *-grtev2-*)
+ tm_file="${tm_file} rs6000/linux-grtev2.h"
+ ;;
+ esac
;;
powerpc-wrs-vxworks|powerpc-wrs-vxworksae)
tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h"
diff --git a/gcc/config/rs6000/linux-grtev2.h b/gcc/config/rs6000/linux-grtev2.h
new file mode 100644
index 00000000000..f809ea667a5
--- /dev/null
+++ b/gcc/config/rs6000/linux-grtev2.h
@@ -0,0 +1,43 @@
+/* Definitions for Linux-based GRTE (Google RunTime Environment) version 2.
+ Copyright (C) 2009,2010,2011,2012 Free Software Foundation, Inc.
+ Contributed by Chris Demetriou and Ollie Wild.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* Overrides LIB_LINUX_SPEC from sysv4.h. */
+#undef LIB_LINUX_SPEC
+#define LIB_LINUX_SPEC \
+ "%{pthread:-lpthread} \
+ %{shared:-lc} \
+ %{!shared:%{mieee-fp:-lieee} %{profile:%(libc_p)}%{!profile:%(libc)}}"
+
+/* When GRTE links statically, it needs its NSS and resolver libraries
+ linked in as well. Note that when linking statically, these are
+ enclosed in a group by LINK_GCC_C_SEQUENCE_SPEC. */
+#undef LINUX_GRTE_EXTRA_SPECS
+#define LINUX_GRTE_EXTRA_SPECS \
+ { "libc", "%{static:%(libc_static);:-lc}" }, \
+ { "libc_p", "%{static:%(libc_p_static);:-lc_p}" }, \
+ { "libc_static", \
+ "-lc -lnss_borg -lnss_cache -lnss_dns -lnss_files -lresolv" }, \
+ { "libc_p_static", \
+ "-lc_p -lnss_borg_p -lnss_cache_p -lnss_dns_p -lnss_files_p -lresolv_p" },
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 972f353061a..7471ac6a2ce 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -367,8 +367,8 @@ extern int dot_symbols;
#undef LINK_OS_DEFAULT_SPEC
#define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
+#define GLIBC_DYNAMIC_LINKER32 RUNTIME_ROOT_PREFIX "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER64 RUNTIME_ROOT_PREFIX "/lib64/ld64.so.1"
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
#if DEFAULT_LIBC == LIBC_UCLIBC
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 1978629e55c..8254bce95fc 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -803,7 +803,10 @@ extern int fixuplabelno;
#define LINK_START_LINUX_SPEC ""
-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+#ifndef RUNTIME_ROOT_PREFIX
+#define RUNTIME_ROOT_PREFIX ""
+#endif
+#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld.so.1"
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
#if DEFAULT_LIBC == LIBC_UCLIBC
#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
@@ -881,6 +884,11 @@ ncrtn.o%s"
#define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
#endif
+/* These may be provided by rs6000/linux-grtev2.h. */
+#ifndef LINUX_GRTE_EXTRA_SPECS
+#define LINUX_GRTE_EXTRA_SPECS
+#endif
+
/* Define any extra SPECS that the compiler needs to generate. */
/* Override rs6000.h definition. */
#undef SUBTARGET_EXTRA_SPECS
@@ -949,6 +957,7 @@ ncrtn.o%s"
{ "cpp_os_openbsd", CPP_OS_OPENBSD_SPEC }, \
{ "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \
{ "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }, \
+ LINUX_GRTE_EXTRA_SPECS \
SUBSUBTARGET_EXTRA_SPECS
#define SUBSUBTARGET_EXTRA_SPECS