diff mbox

[x32] Change x32 library path to libx32

Message ID 20110216203218.GA4689@intel.com
State New
Headers show

Commit Message

H.J. Lu Feb. 16, 2011, 8:32 p.m. UTC
Hi,

I checked in this patch to change x32 LIBPATH_SUFFIX to x32, per
x32 psABI draft verion 0.2:

https://sites.google.com/site/x32abi/

H.J.
---
From f2b64f76a345eba08d660f095d749284e0b59d3e Mon Sep 17 00:00:00 2001
From: H.J. Lu <hjl.tools@gmail.com>
Date: Wed, 16 Feb 2011 11:03:45 -0800
Subject: [PATCH 3/4] Change x32 library path to libx32.

---
 gcc/ChangeLog.x32          |    7 +++++++
 gcc/config/i386/linux64.h  |    2 +-
 gcc/config/i386/t-linuxx32 |   31 ++++++++++++++++++++++++++++---
 3 files changed, 36 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32
index 3a7e980..4219032 100644
--- a/gcc/ChangeLog.x32
+++ b/gcc/ChangeLog.x32
@@ -1,5 +1,12 @@ 
 2011-02-16  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* config/i386/linux64.h (GLIBC_DYNAMIC_LINKERX32): Update
+	ld.so path.
+
+	* config/i386/t-linuxx32: Change x32 library path to libx32.
+
+2011-02-16  H.J. Lu  <hongjiu.lu@intel.com>
+
 	PR target/47766
 	* config/i386/i386.md (PTR): New.
 	(stack_protect_set: Check TARGET_LP64 instead of TARGET_64BIT.
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index 0855cb7..bf5be73 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -61,7 +61,7 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
-#define GLIBC_DYNAMIC_LINKERX32 "/lib32/ld-linux-x32.so.2"
+#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
 
 #if TARGET_64BIT_DEFAULT
 #define SPEC_32 "m32"
diff --git a/gcc/config/i386/t-linuxx32 b/gcc/config/i386/t-linuxx32
index a4741e1..92acf91 100644
--- a/gcc/config/i386/t-linuxx32
+++ b/gcc/config/i386/t-linuxx32
@@ -1,13 +1,38 @@ 
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# On Debian, Ubuntu and other derivative distributions, the 32bit libraries
+# are found in /lib32 and /usr/lib32, /lib64 and /usr/lib64 are symlinks to
+# /lib and /usr/lib, while other distributions install libraries into /lib64
+# and /usr/lib64.  The LSB does not enforce the use of /lib64 and /usr/lib64,
+# it doesn't tell anything about the 32bit libraries on those systems.  Set
+# MULTILIB_OSDIRNAMES according to what is found on the target.
+
 # To support i386, x86-64 and x32 libraries, the directory structrue
 # should be:
 #
 # 	/lib has i386 libraries.
 # 	/lib64 has x86-64 libraries.
-# 	/lib32 has x32 libraries.
-
+# 	/libx32 has x32 libraries.
+#
 MULTILIB_OPTIONS = m64/m32/mx32
 MULTILIB_DIRNAMES = 64 32 x32
-MULTILIB_OSDIRNAMES = ../lib64 ../lib ../lib32
+MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) ../libx32
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib