public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Multilib support for amd64 FreeBSD
@ 2019-03-17 21:26 Andreas Tobler
  2019-03-18 21:23 ` Jeff Law
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Tobler @ 2019-03-17 21:26 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

Hi all,

this patch adds support for multilib on x86_64-unknown-freebsd*
The multilibs are 32-bit.

This patch is functionality tested on gcc8 and gcc9. Test suite testing 
is a bit tricky since the FreeBSD dynamic linker handles both, the 
32-bit and the 64-bit binaries. So, if I have a 64-bit libgcc in the 
LD_LIBRARY_PATH the test fails.
I tweaked the build tree and removed the 64-bit libgcc to test the 
32-bit binaries built. So far it looks good. Need to find a way to 
extend the testsuite to handle this situation.

Any comments about it are welcome.

Also, when would be the best time to commit this patch? Afair trunk is 
in stage4, right?
The patch itself only affects x86_64-unknown-freebsd.

TIA,
Andreas

2019-03-17  Andreas Tobler  <andreast@gcc.gnu.org>

	* config/i386/freebsd64.h: Add bits for 32-bit multilib support.
	* config/i386/t-freebsd64: New file.
	* config.gcc: Add the t-freebsd64 for multilib support.



[-- Attachment #2: amd64_multilib.diff --]
[-- Type: text/plain, Size: 2236 bytes --]

Index: config/i386/freebsd64.h
===================================================================
--- config/i386/freebsd64.h	(revision 269746)
+++ config/i386/freebsd64.h	(working copy)
@@ -31,7 +31,7 @@
 
 #undef	LINK_SPEC
 #define LINK_SPEC "\
-  %{m32:-m elf_i386_fbsd} \
+  %{m32:-m elf_i386_fbsd}%{!m32:-m elf_x86_64_fbsd} \
   %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
   %{v:-V} \
   %{assert*} %{R*} %{rpath*} %{defsym*} \
@@ -42,3 +42,6 @@
 	-dynamic-linker %(fbsd_dynamic_linker) } \
     %{static:-Bstatic}} \
   %{symbolic:-Bsymbolic}"
+
+#undef	MULTILIB_DEFAULTS
+#define MULTILIB_DEFAULTS { "m64" }
Index: config/i386/t-freebsd64
===================================================================
--- config/i386/t-freebsd64	(nonexistent)
+++ config/i386/t-freebsd64	(working copy)
@@ -0,0 +1,30 @@
+# Copyright (C) 2019 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/>.
+
+# The 32-bit libraries are found in /usr/lib32
+
+# To support i386 and x86-64, the directory structrue
+# should be:
+#
+# 	/lib has x86-64 libraries.
+# 	/lib32 has i386 libraries.
+#
+
+MULTILIB_OPTIONS    = m32
+MULTILIB_DIRNAMES   = 32
+MULTILIB_OSDIRNAMES = ../lib32
Index: config.gcc
===================================================================
--- config.gcc	(revision 269746)
+++ config.gcc	(working copy)
@@ -4925,8 +4925,11 @@
 		;;
 	i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
 		;;
-	i[34567]86-*-freebsd* | x86_64-*-freebsd*)
+	i[34567]86-*-freebsd*)
 		;;
+	x86_64-*-freebsd*)
+		tmake_file="${tmake_file} i386/t-freebsd64"
+		;;
 	ia64*-*-linux*)
 		;;
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Multilib support for amd64 FreeBSD
  2019-03-17 21:26 [patch] Multilib support for amd64 FreeBSD Andreas Tobler
@ 2019-03-18 21:23 ` Jeff Law
  2019-03-18 21:30   ` Andreas Tobler
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Law @ 2019-03-18 21:23 UTC (permalink / raw)
  To: Andreas Tobler, GCC Patches

On 3/17/19 2:40 PM, Andreas Tobler wrote:
> Hi all,
> 
> this patch adds support for multilib on x86_64-unknown-freebsd*
> The multilibs are 32-bit.
> 
> This patch is functionality tested on gcc8 and gcc9. Test suite testing
> is a bit tricky since the FreeBSD dynamic linker handles both, the
> 32-bit and the 64-bit binaries. So, if I have a 64-bit libgcc in the
> LD_LIBRARY_PATH the test fails.
> I tweaked the build tree and removed the 64-bit libgcc to test the
> 32-bit binaries built. So far it looks good. Need to find a way to
> extend the testsuite to handle this situation.
> 
> Any comments about it are welcome.
> 
> Also, when would be the best time to commit this patch? Afair trunk is
> in stage4, right?
> The patch itself only affects x86_64-unknown-freebsd.
> 
> TIA,
> Andreas
> 
> 2019-03-17  Andreas Tobler  <andreast@gcc.gnu.org>
> 
>     * config/i386/freebsd64.h: Add bits for 32-bit multilib support.
>     * config/i386/t-freebsd64: New file.
>     * config.gcc: Add the t-freebsd64 for multilib support.
> 
> 
stage4 is supposed to be regression fixes only, so it's difficult to
make a case for this patch to get into gcc-9.

I'd say defer to gcc-10.

jeff

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Multilib support for amd64 FreeBSD
  2019-03-18 21:23 ` Jeff Law
@ 2019-03-18 21:30   ` Andreas Tobler
  2019-04-25 20:09     ` Andreas Tobler
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Tobler @ 2019-03-18 21:30 UTC (permalink / raw)
  To: Jeff Law, GCC Patches

On 18.03.19 22:22, Jeff Law wrote:
> On 3/17/19 2:40 PM, Andreas Tobler wrote:
>> Hi all,
>>
>> this patch adds support for multilib on x86_64-unknown-freebsd*
>> The multilibs are 32-bit.
>>
>> This patch is functionality tested on gcc8 and gcc9. Test suite testing
>> is a bit tricky since the FreeBSD dynamic linker handles both, the
>> 32-bit and the 64-bit binaries. So, if I have a 64-bit libgcc in the
>> LD_LIBRARY_PATH the test fails.
>> I tweaked the build tree and removed the 64-bit libgcc to test the
>> 32-bit binaries built. So far it looks good. Need to find a way to
>> extend the testsuite to handle this situation.
>>
>> Any comments about it are welcome.
>>
>> Also, when would be the best time to commit this patch? Afair trunk is
>> in stage4, right?
>> The patch itself only affects x86_64-unknown-freebsd.
>>
>> TIA,
>> Andreas
>>
>> 2019-03-17  Andreas Tobler  <andreast@gcc.gnu.org>
>>
>>      * config/i386/freebsd64.h: Add bits for 32-bit multilib support.
>>      * config/i386/t-freebsd64: New file.
>>      * config.gcc: Add the t-freebsd64 for multilib support.
>>
>>
> stage4 is supposed to be regression fixes only, so it's difficult to
> make a case for this patch to get into gcc-9.
> 
> I'd say defer to gcc-10.

Ok, fine with me.
Once gcc-10 opens, I will commit this patch also to all open and active 
branches.
Thank you for the statement.
Andreas


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Multilib support for amd64 FreeBSD
  2019-03-18 21:30   ` Andreas Tobler
@ 2019-04-25 20:09     ` Andreas Tobler
  2019-05-11 20:47       ` Andreas Tobler
  2019-05-11 20:57       ` Andreas Tobler
  0 siblings, 2 replies; 6+ messages in thread
From: Andreas Tobler @ 2019-04-25 20:09 UTC (permalink / raw)
  To: GCC Patches

On 18.03.19 22:28, Andreas Tobler wrote:
> On 18.03.19 22:22, Jeff Law wrote:
>> On 3/17/19 2:40 PM, Andreas Tobler wrote:
>>> Hi all,
>>>
>>> this patch adds support for multilib on x86_64-unknown-freebsd*
>>> The multilibs are 32-bit.
>>>
>>> This patch is functionality tested on gcc8 and gcc9. Test suite testing
>>> is a bit tricky since the FreeBSD dynamic linker handles both, the
>>> 32-bit and the 64-bit binaries. So, if I have a 64-bit libgcc in the
>>> LD_LIBRARY_PATH the test fails.
>>> I tweaked the build tree and removed the 64-bit libgcc to test the
>>> 32-bit binaries built. So far it looks good. Need to find a way to
>>> extend the testsuite to handle this situation.
>>>
>>> Any comments about it are welcome.
>>>
>>> Also, when would be the best time to commit this patch? Afair trunk is
>>> in stage4, right?
>>> The patch itself only affects x86_64-unknown-freebsd.
>>>
>>> TIA,
>>> Andreas
>>>
>>> 2019-03-17  Andreas Tobler  <andreast@gcc.gnu.org>
>>>
>>>       * config/i386/freebsd64.h: Add bits for 32-bit multilib support.
>>>       * config/i386/t-freebsd64: New file.
>>>       * config.gcc: Add the t-freebsd64 for multilib support.
>>>
>>>
>> stage4 is supposed to be regression fixes only, so it's difficult to
>> make a case for this patch to get into gcc-9.
>>
>> I'd say defer to gcc-10.
> 
> Ok, fine with me.
> Once gcc-10 opens, I will commit this patch also to all open and active
> branches.

Pushed to trunk, branches will follow.

Andreas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Multilib support for amd64 FreeBSD
  2019-04-25 20:09     ` Andreas Tobler
@ 2019-05-11 20:47       ` Andreas Tobler
  2019-05-11 20:57       ` Andreas Tobler
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Tobler @ 2019-05-11 20:47 UTC (permalink / raw)
  To: GCC Patches

On 25.04.19 22:07, Andreas Tobler wrote:
> On 18.03.19 22:28, Andreas Tobler wrote:
>> On 18.03.19 22:22, Jeff Law wrote:
>>> On 3/17/19 2:40 PM, Andreas Tobler wrote:
>>>> Hi all,
>>>>
>>>> this patch adds support for multilib on x86_64-unknown-freebsd*
>>>> The multilibs are 32-bit.
>>>>
>>>> This patch is functionality tested on gcc8 and gcc9. Test suite testing
>>>> is a bit tricky since the FreeBSD dynamic linker handles both, the
>>>> 32-bit and the 64-bit binaries. So, if I have a 64-bit libgcc in the
>>>> LD_LIBRARY_PATH the test fails.
>>>> I tweaked the build tree and removed the 64-bit libgcc to test the
>>>> 32-bit binaries built. So far it looks good. Need to find a way to
>>>> extend the testsuite to handle this situation.
>>>>
>>>> Any comments about it are welcome.
>>>>
>>>> Also, when would be the best time to commit this patch? Afair trunk is
>>>> in stage4, right?
>>>> The patch itself only affects x86_64-unknown-freebsd.
>>>>
>>>> TIA,
>>>> Andreas
>>>>
>>>> 2019-03-17  Andreas Tobler  <andreast@gcc.gnu.org>
>>>>
>>>>        * config/i386/freebsd64.h: Add bits for 32-bit multilib support.
>>>>        * config/i386/t-freebsd64: New file.
>>>>        * config.gcc: Add the t-freebsd64 for multilib support.
>>>>
>>>>
>>> stage4 is supposed to be regression fixes only, so it's difficult to
>>> make a case for this patch to get into gcc-9.
>>>
>>> I'd say defer to gcc-10.
>>
>> Ok, fine with me.
>> Once gcc-10 opens, I will commit this patch also to all open and active
>> branches.
> 
> Pushed to trunk, branches will follow.

Commit to branch gcc9 done.

Andreas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] Multilib support for amd64 FreeBSD
  2019-04-25 20:09     ` Andreas Tobler
  2019-05-11 20:47       ` Andreas Tobler
@ 2019-05-11 20:57       ` Andreas Tobler
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Tobler @ 2019-05-11 20:57 UTC (permalink / raw)
  To: GCC Patches

On 25.04.19 22:07, Andreas Tobler wrote:
> On 18.03.19 22:28, Andreas Tobler wrote:
>> On 18.03.19 22:22, Jeff Law wrote:
>>> On 3/17/19 2:40 PM, Andreas Tobler wrote:
>>>> Hi all,
>>>>
>>>> this patch adds support for multilib on x86_64-unknown-freebsd*
>>>> The multilibs are 32-bit.
>>>>
>>>> This patch is functionality tested on gcc8 and gcc9. Test suite testing
>>>> is a bit tricky since the FreeBSD dynamic linker handles both, the
>>>> 32-bit and the 64-bit binaries. So, if I have a 64-bit libgcc in the
>>>> LD_LIBRARY_PATH the test fails.
>>>> I tweaked the build tree and removed the 64-bit libgcc to test the
>>>> 32-bit binaries built. So far it looks good. Need to find a way to
>>>> extend the testsuite to handle this situation.
>>>>
>>>> Any comments about it are welcome.
>>>>
>>>> Also, when would be the best time to commit this patch? Afair trunk is
>>>> in stage4, right?
>>>> The patch itself only affects x86_64-unknown-freebsd.
>>>>
>>>> TIA,
>>>> Andreas
>>>>
>>>> 2019-03-17  Andreas Tobler  <andreast@gcc.gnu.org>
>>>>
>>>>        * config/i386/freebsd64.h: Add bits for 32-bit multilib support.
>>>>        * config/i386/t-freebsd64: New file.
>>>>        * config.gcc: Add the t-freebsd64 for multilib support.
>>>>
>>>>
>>> stage4 is supposed to be regression fixes only, so it's difficult to
>>> make a case for this patch to get into gcc-9.
>>>
>>> I'd say defer to gcc-10.
>>
>> Ok, fine with me.
>> Once gcc-10 opens, I will commit this patch also to all open and active
>> branches.

Commit to branch gcc8 done.

Andreas

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-11 20:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-17 21:26 [patch] Multilib support for amd64 FreeBSD Andreas Tobler
2019-03-18 21:23 ` Jeff Law
2019-03-18 21:30   ` Andreas Tobler
2019-04-25 20:09     ` Andreas Tobler
2019-05-11 20:47       ` Andreas Tobler
2019-05-11 20:57       ` Andreas Tobler

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).