public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Library directories for tilegx
@ 2016-11-04  0:44 Joseph Myers
  2016-11-04  1:01 ` Chris Metcalf
  0 siblings, 1 reply; 12+ messages in thread
From: Joseph Myers @ 2016-11-04  0:44 UTC (permalink / raw)
  To: libc-alpha, cmetcalf

TileGX GCC believes that 64-bit libraries go in lib/ and 32-bit libraries 
and dynamic linker go in lib32/.  But the glibc port does not use 
LIBC_SLIBDIR_RTLDDIR in the 32-bit case, meaning that both get installed 
in lib/ and building a biarch GCC blows up (as found when making my 
build-many-glibcs.py script support building all GNU/Linux glibc ABIs).  
What is the correct set of directories to use?

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Library directories for tilegx
  2016-11-04  0:44 Library directories for tilegx Joseph Myers
@ 2016-11-04  1:01 ` Chris Metcalf
  2016-11-04  1:08   ` Joseph Myers
  2016-11-09  0:35   ` Joseph Myers
  0 siblings, 2 replies; 12+ messages in thread
From: Chris Metcalf @ 2016-11-04  1:01 UTC (permalink / raw)
  To: Joseph Myers, libc-alpha

On 11/3/2016 6:43 PM, Joseph Myers wrote:
> TileGX GCC believes that 64-bit libraries go in lib/ and 32-bit libraries
> and dynamic linker go in lib32/.  But the glibc port does not use
> LIBC_SLIBDIR_RTLDDIR in the 32-bit case, meaning that both get installed
> in lib/ and building a biarch GCC blows up (as found when making my
> build-many-glibcs.py script support building all GNU/Linux glibc ABIs).
> What is the correct set of directories to use?

Yes, we discovered much too late that multi-endian systems are basically required to use /lib64 and /lib.  Instead, we used /lib for 64-bit and /lib32 for 32-bit.

I will have to go look at exactly how we contrive the 32-bit installation in our commercial build; we do some nasty cross-bootstrapping from x86, which as I'm sure you recall was particularly unpleasant back in the glibc 2.12 days (our current "tip" release for tilegx is still CentOS 6.8).  And for my ongoing git testing, I always just test from the build tree, so I never noticed that 32-bit wanted to install natively in /lib.

Thanks for noticing!

-- 
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com

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

* Re: Library directories for tilegx
  2016-11-04  1:01 ` Chris Metcalf
@ 2016-11-04  1:08   ` Joseph Myers
  2016-11-04  1:50     ` Chris Metcalf
  2016-11-09  0:35   ` Joseph Myers
  1 sibling, 1 reply; 12+ messages in thread
From: Joseph Myers @ 2016-11-04  1:08 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: libc-alpha

Incidentally, I found another issue in building: GCC has a tilegxbe-* 
target name for big-endian, but sysdeps/tile/preconfigure only handles 
tilegx, not tilegxbe.  However, that's easy to work around by configuring 
glibc for a different triplet from GCC.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Library directories for tilegx
  2016-11-04  1:08   ` Joseph Myers
@ 2016-11-04  1:50     ` Chris Metcalf
  2016-11-04 13:33       ` Joseph Myers
  2016-11-07 16:26       ` Joseph Myers
  0 siblings, 2 replies; 12+ messages in thread
From: Chris Metcalf @ 2016-11-04  1:50 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On 11/3/2016 7:08 PM, Joseph Myers wrote:
> Incidentally, I found another issue in building: GCC has a tilegxbe-*
> target name for big-endian, but sysdeps/tile/preconfigure only handles
> tilegx, not tilegxbe.  However, that's easy to work around by configuring
> glibc for a different triplet from GCC.

Good point.  I don't actually test tilegxbe; I don't think we ever had a lot of interest in that version of the toolchain.  I will try to remember to add it next time I do tests, and I can push up a fix to preconfigure at that point too (or feel free to push one yourself).

-- 
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com

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

* Re: Library directories for tilegx
  2016-11-04  1:50     ` Chris Metcalf
@ 2016-11-04 13:33       ` Joseph Myers
  2016-11-04 15:12         ` Chris Metcalf
  2016-11-07 16:26       ` Joseph Myers
  1 sibling, 1 reply; 12+ messages in thread
From: Joseph Myers @ 2016-11-04 13:33 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: libc-alpha

On Thu, 3 Nov 2016, Chris Metcalf wrote:

> On 11/3/2016 7:08 PM, Joseph Myers wrote:
> > Incidentally, I found another issue in building: GCC has a tilegxbe-*
> > target name for big-endian, but sysdeps/tile/preconfigure only handles
> > tilegx, not tilegxbe.  However, that's easy to work around by configuring
> > glibc for a different triplet from GCC.
> 
> Good point.  I don't actually test tilegxbe; I don't think we ever had a lot
> of interest in that version of the toolchain.  I will try to remember to add
> it next time I do tests, and I can push up a fix to preconfigure at that point
> too (or feel free to push one yourself).

Fix pushed thus.

Handle tilegx* machine names.

This patch makes sysdeps/tile/preconfigure handle tilegx* machine
names instead of just plain tilegx.  That matches GCC, and in
particular allows a big-endian toolchain to use the tilegxbe-linux-gnu
name when configuring both GCC and glibc.

Tested with compilation for tilegxbe-linux-gnu, both 32-bit and 64-bit
(building a subsequent GCC against that glibc still falls over because
of both 32-bit and 64-bit libraries going in the lib directory, as
noted at
<https://sourceware.org/ml/libc-alpha/2016-11/msg00129.html>).

2016-11-04  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/tile/preconfigure: Accept tilegx* instead of tilegx.

diff --git a/sysdeps/tile/preconfigure b/sysdeps/tile/preconfigure
index dfe050c..f3e5d7e 100644
--- a/sysdeps/tile/preconfigure
+++ b/sysdeps/tile/preconfigure
@@ -2,7 +2,7 @@
 case "$machine" in
     tilepro)
 	base_machine=tile machine=tile/tilepro ;;
-    tilegx)
+    tilegx*)
 	base_machine=tile
 	if $CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep -q __LP64__; then
 	    machine=tile/tilegx/tilegx64


-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Library directories for tilegx
  2016-11-04 13:33       ` Joseph Myers
@ 2016-11-04 15:12         ` Chris Metcalf
  0 siblings, 0 replies; 12+ messages in thread
From: Chris Metcalf @ 2016-11-04 15:12 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On 11/4/2016 7:32 AM, Joseph Myers wrote:
> On Thu, 3 Nov 2016, Chris Metcalf wrote:
>
>> On 11/3/2016 7:08 PM, Joseph Myers wrote:
>>> Incidentally, I found another issue in building: GCC has a tilegxbe-*
>>> target name for big-endian, but sysdeps/tile/preconfigure only handles
>>> tilegx, not tilegxbe.  However, that's easy to work around by configuring
>>> glibc for a different triplet from GCC.
>> Good point.  I don't actually test tilegxbe; I don't think we ever had a lot
>> of interest in that version of the toolchain.  I will try to remember to add
>> it next time I do tests, and I can push up a fix to preconfigure at that point
>> too (or feel free to push one yourself).
> Fix pushed thus.

Thanks, looks good.

-- 
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com

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

* Re: Library directories for tilegx
  2016-11-04  1:50     ` Chris Metcalf
  2016-11-04 13:33       ` Joseph Myers
@ 2016-11-07 16:26       ` Joseph Myers
  2016-11-07 21:48         ` Chris Metcalf
  1 sibling, 1 reply; 12+ messages in thread
From: Joseph Myers @ 2016-11-07 16:26 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: libc-alpha

On Thu, 3 Nov 2016, Chris Metcalf wrote:

> On 11/3/2016 7:08 PM, Joseph Myers wrote:
> > Incidentally, I found another issue in building: GCC has a tilegxbe-*
> > target name for big-endian, but sysdeps/tile/preconfigure only handles
> > tilegx, not tilegxbe.  However, that's easy to work around by configuring
> > glibc for a different triplet from GCC.
> 
> Good point.  I don't actually test tilegxbe; I don't think we ever had a lot
> of interest in that version of the toolchain.  I will try to remember to add
> it next time I do tests, and I can push up a fix to preconfigure at that point
> too (or feel free to push one yourself).

In fact there are more problems:

* Using GCC 6 branch, the tilegxbe build fails with an ICE building libgcc 
in the first GCC build.

* Using GCC mainline, I get ICEs building libgcc for both tilegx and 
tilegxbe.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Library directories for tilegx
  2016-11-07 16:26       ` Joseph Myers
@ 2016-11-07 21:48         ` Chris Metcalf
  0 siblings, 0 replies; 12+ messages in thread
From: Chris Metcalf @ 2016-11-07 21:48 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On 11/7/2016 11:25 AM, Joseph Myers wrote:
> On Thu, 3 Nov 2016, Chris Metcalf wrote:
>
>> On 11/3/2016 7:08 PM, Joseph Myers wrote:
>>> Incidentally, I found another issue in building: GCC has a tilegxbe-*
>>> target name for big-endian, but sysdeps/tile/preconfigure only handles
>>> tilegx, not tilegxbe.  However, that's easy to work around by configuring
>>> glibc for a different triplet from GCC.
>> Good point.  I don't actually test tilegxbe; I don't think we ever had a lot
>> of interest in that version of the toolchain.  I will try to remember to add
>> it next time I do tests, and I can push up a fix to preconfigure at that point
>> too (or feel free to push one yourself).
> In fact there are more problems:
>
> * Using GCC 6 branch, the tilegxbe build fails with an ICE building libgcc
> in the first GCC build.
>
> * Using GCC mainline, I get ICEs building libgcc for both tilegx and
> tilegxbe.

Thanks - I've passed these on to our compiler team as well.

-- 
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com

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

* Re: Library directories for tilegx
  2016-11-04  1:01 ` Chris Metcalf
  2016-11-04  1:08   ` Joseph Myers
@ 2016-11-09  0:35   ` Joseph Myers
  2016-11-14 20:12     ` Chris Metcalf
  1 sibling, 1 reply; 12+ messages in thread
From: Joseph Myers @ 2016-11-09  0:35 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: libc-alpha

On Thu, 3 Nov 2016, Chris Metcalf wrote:

> I will have to go look at exactly how we contrive the 32-bit installation in
> our commercial build; we do some nasty cross-bootstrapping from x86, which as
> I'm sure you recall was particularly unpleasant back in the glibc 2.12 days
> (our current "tip" release for tilegx is still CentOS 6.8).  And for my
> ongoing git testing, I always just test from the build tree, so I never
> noticed that 32-bit wanted to install natively in /lib.

FYI: this patch makes the library directories match what GCC expects, so 
allowing the build to work (then I see the same check-installed-headers 
failures for sys/dataplane.h as for tilepro, but otherwise the 
compile-only test results are clean with GCC 5).

Make tilegx32 install libraries in lib32 directories.

This patch makes tilegx32 install libraries in lib32 directories,
matching what GCC expects and avoiding conflict with 64-bit libraries
installed in lib directories.

Tested (compilation only) for tilegx (32-bit and 64-bit, BE and LE,
GCC 5).

2016-11-09  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/unix/sysv/linux/tile/tilegx/configure.ac: Use
	LIBC_SLIBDIR_RTLDDIR for tilegx32.
	* sysdeps/unix/sysv/linux/tile/tilegx/configure: Regenerated.

diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/configure b/sysdeps/unix/sysv/linux/tile/tilegx/configure
index 0a6a63f..36e42e0 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/configure
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/configure
@@ -2,3 +2,20 @@
  # Local configure fragment for sysdeps/unix/sysv/linux/tile/tilegx
 
 ldd_rewrite_script=$dir/ldd-rewrite.sed
+
+case $machine in
+tile/tilegx/tilegx32)
+  test -n "$libc_cv_slibdir" ||
+case "$prefix" in
+/usr | /usr/)
+  libc_cv_slibdir=/lib32
+  libc_cv_rtlddir=/lib32
+  if test "$libdir" = '${exec_prefix}/lib'; then
+    libdir='${exec_prefix}/lib32';
+    # Locale data can be shared between 32-bit and 64-bit libraries.
+    libc_cv_complocaledir='${exec_prefix}/lib/locale'
+  fi
+  ;;
+esac
+  ;;
+esac
diff --git a/sysdeps/unix/sysv/linux/tile/tilegx/configure.ac b/sysdeps/unix/sysv/linux/tile/tilegx/configure.ac
index 87d86bd..baca1f6 100644
--- a/sysdeps/unix/sysv/linux/tile/tilegx/configure.ac
+++ b/sysdeps/unix/sysv/linux/tile/tilegx/configure.ac
@@ -2,3 +2,9 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/unix/sysv/linux/tile/tilegx
 
 ldd_rewrite_script=$dir/ldd-rewrite.sed
+
+case $machine in
+tile/tilegx/tilegx32)
+  LIBC_SLIBDIR_RTLDDIR([lib32], [lib32])
+  ;;
+esac

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Library directories for tilegx
  2016-11-09  0:35   ` Joseph Myers
@ 2016-11-14 20:12     ` Chris Metcalf
  2016-11-14 22:59       ` Joseph Myers
  0 siblings, 1 reply; 12+ messages in thread
From: Chris Metcalf @ 2016-11-14 20:12 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On 11/8/2016 7:34 PM, Joseph Myers wrote:
> On Thu, 3 Nov 2016, Chris Metcalf wrote:
>
>> >I will have to go look at exactly how we contrive the 32-bit installation in
>> >our commercial build; we do some nasty cross-bootstrapping from x86, which as
>> >I'm sure you recall was particularly unpleasant back in the glibc 2.12 days
>> >(our current "tip" release for tilegx is still CentOS 6.8).  And for my
>> >ongoing git testing, I always just test from the build tree, so I never
>> >noticed that 32-bit wanted to install natively in /lib.
> FYI: this patch makes the library directories match what GCC expects, so
> allowing the build to work (then I see the same check-installed-headers
> failures for sys/dataplane.h as for tilepro, but otherwise the
> compile-only test results are clean with GCC 5).
>
> Make tilegx32 install libraries in lib32 directories.
>
> This patch makes tilegx32 install libraries in lib32 directories,
> matching what GCC expects and avoiding conflict with 64-bit libraries
> installed in lib directories.
>
> Tested (compilation only) for tilegx (32-bit and 64-bit, BE and LE,
> GCC 5).
>
> 2016-11-09  Joseph Myers<joseph@codesourcery.com>
>
> 	* sysdeps/unix/sysv/linux/tile/tilegx/configure.ac: Use
> 	LIBC_SLIBDIR_RTLDDIR for tilegx32.
> 	* sysdeps/unix/sysv/linux/tile/tilegx/configure: Regenerated.

Are you planning on pushing this yourself, or did you want me to push it?
It sounds like you tested it sufficiently to just push it yourself, but let me
know if not.

Thanks again.

-- 
Chris Metcalf, Mellanox Technologies
http://www.mellanox.com

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

* Re: Library directories for tilegx
  2016-11-14 20:12     ` Chris Metcalf
@ 2016-11-14 22:59       ` Joseph Myers
  2016-11-14 23:25         ` Chris Metcalf
  0 siblings, 1 reply; 12+ messages in thread
From: Joseph Myers @ 2016-11-14 22:59 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: libc-alpha

On Mon, 14 Nov 2016, Chris Metcalf wrote:

> Are you planning on pushing this yourself, or did you want me to push it?

I was awaiting confirmation that GCC is acting as intended here (i.e. that 
64-bit libraries belong in lib and 32-bit ones in lib32), and so this 
glibc change is correct.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Library directories for tilegx
  2016-11-14 22:59       ` Joseph Myers
@ 2016-11-14 23:25         ` Chris Metcalf
  0 siblings, 0 replies; 12+ messages in thread
From: Chris Metcalf @ 2016-11-14 23:25 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha


> On Nov 14, 2016, at 5:59 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> 
>> On Mon, 14 Nov 2016, Chris Metcalf wrote:
>> 
>> Are you planning on pushing this yourself, or did you want me to push it?
> 
> I was awaiting confirmation that GCC is acting as intended here (i.e. that 
> 64-bit libraries belong in lib and 32-bit ones in lib32), and so this 
> glibc change is correct.

Yes, that's correct. 

> 
> -- 
> Joseph S. Myers
> joseph@codesourcery.com

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

end of thread, other threads:[~2016-11-14 23:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-04  0:44 Library directories for tilegx Joseph Myers
2016-11-04  1:01 ` Chris Metcalf
2016-11-04  1:08   ` Joseph Myers
2016-11-04  1:50     ` Chris Metcalf
2016-11-04 13:33       ` Joseph Myers
2016-11-04 15:12         ` Chris Metcalf
2016-11-07 16:26       ` Joseph Myers
2016-11-07 21:48         ` Chris Metcalf
2016-11-09  0:35   ` Joseph Myers
2016-11-14 20:12     ` Chris Metcalf
2016-11-14 22:59       ` Joseph Myers
2016-11-14 23:25         ` Chris Metcalf

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