public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* tilepro glibc problems
@ 2016-11-04 22:05 Joseph Myers
  2016-11-04 22:25 ` Chris Metcalf
  2016-11-14 16:56 ` [PATCH] Make tile's set_dataplane API compatibility-only Chris Metcalf
  0 siblings, 2 replies; 5+ messages in thread
From: Joseph Myers @ 2016-11-04 22:05 UTC (permalink / raw)
  To: libc-alpha, cmetcalf

Compile testing of glibc for tilepro (GCC 5, binutils master) shows up two 
problems:

* C++ linking doesn't work (which causes C++ tests in glibc to be 
disabled):

/scratch/jmyers/glibc/many5/install/compilers/tilepro-linux-gnu/lib/gcc/tilepro-glibc-linux-gnu/5.4.1/../../../../tilepro-glibc-linux-gnu/bin/ld: 
a.out: hidden symbol `__atomic_fetch_add_4' in 
/scratch/jmyers/glibc/many5/install/compilers/tilepro-linux-gnu/lib/gcc/tilepro-glibc-linux-gnu/5.4.1/libgcc.a(atomic.o) 
is referenced by DSO
/scratch/jmyers/glibc/many5/install/compilers/tilepro-linux-gnu/lib/gcc/tilepro-glibc-linux-gnu/5.4.1/../../../../tilepro-glibc-linux-gnu/bin/ld: 
final link failed: Bad value
collect2: error: ld returned 1 exit status

(This seems to me like your GCC port should be using t-slibgcc-libgcc in 
libgcc/config.host, but I haven't tested that.)

* sys/dataplane.h includes a header asm/dataplane.h and thereby fails the 
check-installed-headers test because no such header exists in the Linux 
kernel.  How is this meant to work?  I imagine this would fail for tilegx 
as well if that build didn't fail at an earlier stage.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: tilepro glibc problems
  2016-11-04 22:05 tilepro glibc problems Joseph Myers
@ 2016-11-04 22:25 ` Chris Metcalf
  2016-11-14 16:56 ` [PATCH] Make tile's set_dataplane API compatibility-only Chris Metcalf
  1 sibling, 0 replies; 5+ messages in thread
From: Chris Metcalf @ 2016-11-04 22:25 UTC (permalink / raw)
  To: Joseph Myers, libc-alpha

On 11/4/2016 4:05 PM, Joseph Myers wrote:
> Compile testing of glibc for tilepro (GCC 5, binutils master) shows up two
> problems:
>
> * C++ linking doesn't work (which causes C++ tests in glibc to be
> disabled):
>
> /scratch/jmyers/glibc/many5/install/compilers/tilepro-linux-gnu/lib/gcc/tilepro-glibc-linux-gnu/5.4.1/../../../../tilepro-glibc-linux-gnu/bin/ld:
> a.out: hidden symbol `__atomic_fetch_add_4' in
> /scratch/jmyers/glibc/many5/install/compilers/tilepro-linux-gnu/lib/gcc/tilepro-glibc-linux-gnu/5.4.1/libgcc.a(atomic.o)
> is referenced by DSO
> /scratch/jmyers/glibc/many5/install/compilers/tilepro-linux-gnu/lib/gcc/tilepro-glibc-linux-gnu/5.4.1/../../../../tilepro-glibc-linux-gnu/bin/ld:
> final link failed: Bad value
> collect2: error: ld returned 1 exit status
>
> (This seems to me like your GCC port should be using t-slibgcc-libgcc in
> libgcc/config.host, but I haven't tested that.)

Thanks.  I'll forward that on to our compiler guys.

> * sys/dataplane.h includes a header asm/dataplane.h and thereby fails the
> check-installed-headers test because no such header exists in the Linux
> kernel.  How is this meant to work?  I imagine this would fail for tilegx
> as well if that build didn't fail at an earlier stage.

This header was submitted basically as part of the original glibc patch
series, overlooking the fact that kernel support was not yet upstreamed.

It was intended to support the task isolation patch series in the kernel [1],
but the sys/dataplane.h header targets what you might call the "v0" of that
patch series, namely the version that Tilera shipped customers prior to
starting to upstream it.  (At that time it was called "dataplane" support.)

The current API proposal is handled entirely out of linux/prctl.h, so this
header will no longer be necessary; I'll just go ahead and remove it.

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

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

* [PATCH] Make tile's set_dataplane API compatibility-only
  2016-11-04 22:05 tilepro glibc problems Joseph Myers
  2016-11-04 22:25 ` Chris Metcalf
@ 2016-11-14 16:56 ` Chris Metcalf
  2016-11-14 17:00   ` Joseph Myers
  1 sibling, 1 reply; 5+ messages in thread
From: Chris Metcalf @ 2016-11-14 16:56 UTC (permalink / raw)
  To: Joseph Myers, libc-alpha; +Cc: Chris Metcalf

The set_dataplane() API in <sys/dataplane.h> originally supported the
Tilera version of Linux as shipped to our customers.  Once we started
upstreaming the dataplane support in the kernel, the API changed
to use fcntl() as part of the current task-isolation patch series.

It doesn't seem like continuing to support the old API is useful
for newly-compiled code, and even supporting the old glibc binary
API on an upstream kernel that supports the new task isolation mode
isn't straightforward, since the semantics have changed in ways that
make it hard to map the old semantics precisely to the new ones,
so just return ENOSYS.
---

2016-11-14  Chris Metcalf  <cmetcalf@mellanox.com>

	* sysdeps/unix/sysv/linux/tile/set_dataplane.c
	(__old_set_dataplane): Rename from set_dataplane and make a
	compatibility symbol.
	* sysdeps/unix/sysv/linux/tile/sys/dataplane.h: Remove file.
	* sysdeps/unix/sysv/linux/tile/Makefile (sysdep_headers): Remove
	sys/dataplane.h.

 sysdeps/unix/sysv/linux/tile/Makefile        |  3 +--
 sysdeps/unix/sysv/linux/tile/set_dataplane.c |  8 +++++--
 sysdeps/unix/sysv/linux/tile/sys/dataplane.h | 33 ----------------------------
 3 files changed, 7 insertions(+), 37 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/tile/sys/dataplane.h

diff --git a/sysdeps/unix/sysv/linux/tile/Makefile b/sysdeps/unix/sysv/linux/tile/Makefile
index 43acea363350..04605a69acde 100644
--- a/sysdeps/unix/sysv/linux/tile/Makefile
+++ b/sysdeps/unix/sysv/linux/tile/Makefile
@@ -8,8 +8,7 @@ sysdep_headers += sys/reg.h
 sysdep_headers += sys/cachectl.h
 sysdep_routines += cacheflush
 
-# Control dataplane properties of current thread.
-sysdep_headers += sys/dataplane.h
+# Control dataplane properties of current thread (compatibility only).
 sysdep_routines += set_dataplane
 
 endif
diff --git a/sysdeps/unix/sysv/linux/tile/set_dataplane.c b/sysdeps/unix/sysv/linux/tile/set_dataplane.c
index 5a4bffe4f311..e2ea896e88d0 100644
--- a/sysdeps/unix/sysv/linux/tile/set_dataplane.c
+++ b/sysdeps/unix/sysv/linux/tile/set_dataplane.c
@@ -23,9 +23,9 @@
 #include <sys/dataplane.h>
 #endif
 
-/* Request dataplane modes from the kernel. */
+/* Request dataplane modes from the kernel (compatibility only). */
 int
-set_dataplane (int flags)
+__old_set_dataplane (int flags)
 {
 #ifdef __NR_set_dataplane
   return INLINE_SYSCALL (set_dataplane, 1, flags);
@@ -34,3 +34,7 @@ set_dataplane (int flags)
   return -1;
 #endif
 }
+
+#if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_25)
+compat_symbol (libc, __old_set_dataplane, set_dataplane, GLIBC_2_12);
+#endif
diff --git a/sysdeps/unix/sysv/linux/tile/sys/dataplane.h b/sysdeps/unix/sysv/linux/tile/sys/dataplane.h
deleted file mode 100644
index 82677f1f5f13..000000000000
--- a/sysdeps/unix/sysv/linux/tile/sys/dataplane.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_DATAPLANE_H
-#define _SYS_DATAPLANE_H 1
-
-#include <features.h>
-
-/* Get the kernel definition for the flag bits.  */
-#include <asm/dataplane.h>
-
-__BEGIN_DECLS
-
-extern int set_dataplane (int flags);
-
-__END_DECLS
-
-#endif /* sys/dataplane.h */
-- 
2.7.2

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

* Re: [PATCH] Make tile's set_dataplane API compatibility-only
  2016-11-14 16:56 ` [PATCH] Make tile's set_dataplane API compatibility-only Chris Metcalf
@ 2016-11-14 17:00   ` Joseph Myers
  2016-11-14 20:05     ` [PATCH v2] " Chris Metcalf
  0 siblings, 1 reply; 5+ messages in thread
From: Joseph Myers @ 2016-11-14 17:00 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: libc-alpha

On Mon, 14 Nov 2016, Chris Metcalf wrote:

> diff --git a/sysdeps/unix/sysv/linux/tile/set_dataplane.c b/sysdeps/unix/sysv/linux/tile/set_dataplane.c
> index 5a4bffe4f311..e2ea896e88d0 100644
> --- a/sysdeps/unix/sysv/linux/tile/set_dataplane.c
> +++ b/sysdeps/unix/sysv/linux/tile/set_dataplane.c
> @@ -23,9 +23,9 @@
>  #include <sys/dataplane.h>
>  #endif
>  
> -/* Request dataplane modes from the kernel. */
> +/* Request dataplane modes from the kernel (compatibility only). */
>  int
> -set_dataplane (int flags)
> +__old_set_dataplane (int flags)
>  {
>  #ifdef __NR_set_dataplane
>    return INLINE_SYSCALL (set_dataplane, 1, flags);
> @@ -34,3 +34,7 @@ set_dataplane (int flags)
>    return -1;
>  #endif
>  }
> +
> +#if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_25)
> +compat_symbol (libc, __old_set_dataplane, set_dataplane, GLIBC_2_12);
> +#endif

I'd expect the function definition to be under the SHLIB_COMPAT 
conditional as well, so the object file has no code in the static libc.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* [PATCH v2] Make tile's set_dataplane API compatibility-only
  2016-11-14 17:00   ` Joseph Myers
@ 2016-11-14 20:05     ` Chris Metcalf
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Metcalf @ 2016-11-14 20:05 UTC (permalink / raw)
  To: Joseph Myers, libc-alpha; +Cc: Chris Metcalf

The set_dataplane() API in <sys/dataplane.h> originally supported the
Tilera version of Linux as shipped to our customers.  Once we started
upstreaming the dataplane support in the kernel, the API changed
to use fcntl() as part of the current task-isolation patch series.

It doesn't seem like continuing to support the old API is useful
for newly-compiled code, and even supporting the old glibc binary
API on an upstream kernel that supports the new task isolation mode
isn't straightforward, since the semantics have changed in ways that
make it hard to map the old semantics precisely to the new ones,
so just return ENOSYS.
---
v2:
  include __old_set_dataplane() in the SHLIB_COMPAT guard
  add attribute_compat_text_section for consistency with other compat funcs

2016-11-14  Chris Metcalf  <cmetcalf@mellanox.com>

	* sysdeps/unix/sysv/linux/tile/set_dataplane.c
	(__old_set_dataplane): Rename from set_dataplane and make a
	compatibility symbol.
	* sysdeps/unix/sysv/linux/tile/sys/dataplane.h: Remove file.
	* sysdeps/unix/sysv/linux/tile/Makefile (sysdep_headers): Remove
	sys/dataplane.h.

 sysdeps/unix/sysv/linux/tile/Makefile        |  3 +--
 sysdeps/unix/sysv/linux/tile/set_dataplane.c | 13 ++++++-----
 sysdeps/unix/sysv/linux/tile/sys/dataplane.h | 33 ----------------------------
 3 files changed, 9 insertions(+), 40 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/tile/sys/dataplane.h

diff --git a/sysdeps/unix/sysv/linux/tile/Makefile b/sysdeps/unix/sysv/linux/tile/Makefile
index 43acea363350..04605a69acde 100644
--- a/sysdeps/unix/sysv/linux/tile/Makefile
+++ b/sysdeps/unix/sysv/linux/tile/Makefile
@@ -8,8 +8,7 @@ sysdep_headers += sys/reg.h
 sysdep_headers += sys/cachectl.h
 sysdep_routines += cacheflush
 
-# Control dataplane properties of current thread.
-sysdep_headers += sys/dataplane.h
+# Control dataplane properties of current thread (compatibility only).
 sysdep_routines += set_dataplane
 
 endif
diff --git a/sysdeps/unix/sysv/linux/tile/set_dataplane.c b/sysdeps/unix/sysv/linux/tile/set_dataplane.c
index 5a4bffe4f311..552716b60db3 100644
--- a/sysdeps/unix/sysv/linux/tile/set_dataplane.c
+++ b/sysdeps/unix/sysv/linux/tile/set_dataplane.c
@@ -19,13 +19,13 @@
 #include <errno.h>
 #include <stddef.h>
 #include <unistd.h>
-#ifdef __NR_set_dataplane
-#include <sys/dataplane.h>
-#endif
+#include <shlib-compat.h>
 
-/* Request dataplane modes from the kernel. */
+/* Request dataplane modes from the kernel (compatibility only). */
+#if SHLIB_COMPAT (libc, GLIBC_2_12, GLIBC_2_25)
 int
-set_dataplane (int flags)
+attribute_compat_text_section
+__old_set_dataplane (int flags)
 {
 #ifdef __NR_set_dataplane
   return INLINE_SYSCALL (set_dataplane, 1, flags);
@@ -34,3 +34,6 @@ set_dataplane (int flags)
   return -1;
 #endif
 }
+
+compat_symbol (libc, __old_set_dataplane, set_dataplane, GLIBC_2_12);
+#endif
diff --git a/sysdeps/unix/sysv/linux/tile/sys/dataplane.h b/sysdeps/unix/sysv/linux/tile/sys/dataplane.h
deleted file mode 100644
index 82677f1f5f13..000000000000
--- a/sysdeps/unix/sysv/linux/tile/sys/dataplane.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_DATAPLANE_H
-#define _SYS_DATAPLANE_H 1
-
-#include <features.h>
-
-/* Get the kernel definition for the flag bits.  */
-#include <asm/dataplane.h>
-
-__BEGIN_DECLS
-
-extern int set_dataplane (int flags);
-
-__END_DECLS
-
-#endif /* sys/dataplane.h */
-- 
2.7.2

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-04 22:05 tilepro glibc problems Joseph Myers
2016-11-04 22:25 ` Chris Metcalf
2016-11-14 16:56 ` [PATCH] Make tile's set_dataplane API compatibility-only Chris Metcalf
2016-11-14 17:00   ` Joseph Myers
2016-11-14 20:05     ` [PATCH v2] " 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).