public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@gnu.org>
To: gcc-patches@gcc.gnu.org
Cc: Thomas Schwinge <thomas@codesourcery.com>, bug-hurd@gnu.org
Subject: [PATCH] hurd: Add multilib paths for gnu-x86_64
Date: Sat, 6 May 2023 13:50:36 +0200	[thread overview]
Message-ID: <20230506115036.pvng4w6wztcimzrh@begin> (raw)
In-Reply-To: <874jrt25bb.fsf@euler.schwinge.homeip.net>

We need the multilib paths in gcc to find e.g. glibc crt files on
Debian.  This is essentially based on t-linux64 version.

gcc/ChangeLog:

	* gcc/config/i386/t-gnu64: New file.
	* gcc/config.gcc [x86_64-*-gnu*): Add i386/t-gnu64 to
	tmake_file.

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 671c7e3b018..6b1939b9f09 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -5828,6 +5828,9 @@ case ${target} in
 	visium-*-*)
 		target_cpu_default2="TARGET_CPU_$with_cpu"
 		;;
+	x86_64-*-gnu*)
+		tmake_file="$tmake_file i386/t-gnu64"
+		;;
 esac
 
 t=
diff --git a/gcc/config/i386/t-gnu64 b/gcc/config/i386/t-gnu64
index e69de29bb2d..23ee6823d65 100644
--- a/gcc/config/i386/t-gnu64
+++ b/gcc/config/i386/t-gnu64
@@ -0,0 +1,38 @@
+# Copyright (C) 2002-2023 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.
+# 	/libx32 has x32 libraries.
+#
+comma=,
+MULTILIB_OPTIONS    = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+MULTILIB_DIRNAMES   = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-gnu)
+MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-gnu)
+MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-gnux32)

  reply	other threads:[~2023-05-06 11:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13 15:50 RFA: Add makefile for cross-configuration torture test Joern Rennecke
2011-04-13 16:07 ` Rainer Orth
2011-04-13 16:24   ` Joern Rennecke
2011-04-13 16:27 ` Joseph S. Myers
     [not found]   ` <20110413140647.provnjxog4og0o84-nzlynne@webmail.spamcop.net>
     [not found]     ` <Pine.LNX.4.64.1104131911080.8645@digraph.polyomino.org.uk>
2011-04-13 21:02       ` Joern Rennecke
2011-04-13 22:10         ` Joseph S. Myers
2011-04-13 22:15           ` Douglas B Rupp
2011-04-14  5:51         ` Ralf Wildenhues
2011-04-14  8:12           ` Joern Rennecke
2011-04-14 14:15             ` Jan-Benedict Glaw
2011-04-23 12:14               ` Joern Rennecke
2011-04-23 15:23             ` Patch ping: " Joern Rennecke
2011-05-02 17:20               ` Patch ping^2: " Joern Rennecke
2011-05-04  3:19                 ` Alexandre Oliva
2023-02-10 10:16 ` [GCC] In 'contrib/config-list.mk', clarify i686-symbolics-gnu to i686-gnu (was: RFA: Add makefile for cross-configuration torture test) Thomas Schwinge
2023-05-06 11:50   ` Samuel Thibault [this message]
2023-05-06 13:26     ` [PATCH] hurd: Add multilib paths for gnu-x86_64 Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230506115036.pvng4w6wztcimzrh@begin \
    --to=samuel.thibault@gnu.org \
    --cc=bug-hurd@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).