[roland/nptl-sparc] Move remaining SPARC code out of nptl/.
Commit Message
Wholly untested. It should not change anything. A lot of the individual
files contained no particular Linuxisms, so I moved them to OS-independent
(but CPU-dependent) sysdeps/ directories.
OK?
Thanks,
Roland
2014-06-18 Roland McGrath <roland@hack.frob.com>
* sysdeps/unix/sysv/linux/sparc/Makefile [$(subdir) = nptl]
(libpthread-routines): Add sysdep.
* nptl/sysdeps/unix/sysv/linux/sparc/Makefile: File removed.
* sysdeps/unix/sysv/linux/sparc/Versions
(libpthread: GLIBC_2.3.3): New version set.
* nptl/sysdeps/unix/sysv/linux/sparc/Versions: File removed.
* nptl/sysdeps/unix/sysv/linux/sparc/aio_cancel.c: Moved ...
* sysdeps/unix/sysv/linux/sparc/aio_cancel.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/internaltypes.h: Moved ...
* sysdeps/sparc/nptl/internaltypes.h: ... here. Use #include_next.
* nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c:
Moved ...
* sysdeps/sparc/nptl/pthread_barrier_destroy.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c: Moved ...
* sysdeps/sparc/nptl/pthread_barrier_init.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c: Moved ...
* sysdeps/sparc/nptl/pthread_barrier_wait.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sem_init.c: Moved ...
* sysdeps/sparc/nptl/sem_init.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c: Moved ...
* sysdeps/sparc/nptl/sem_post.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c: Moved ...
* sysdeps/sparc/nptl/sem_timedwait.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c: Moved ...
* sysdeps/sparc/nptl/sem_wait.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Moved ...
* sysdeps/unix/sysv/linux/sparc/lowlevellock.h: ... here.
* sysdeps/sparc/sparc32/sparcv9/Makefile [$(subdir) = nptl]
(libpthread-routines): Add cpu_relax.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/Makefile:
File removed.
* sysdeps/unix/sysv/linux/sparc/sparc64/Versions
(librt: GLIBC_2.3.3): New version set.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/Versions: File removed.
* sysdeps/sparc/sparc64/nptl/Makefile: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/Makefile [$(subdir) = nptl]
(CFLAGS-pause.c, CFLAGS-sigsuspend.c): New variables.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/Makefile: File removed.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c: Moved ...
* sysdeps/sparc/sparc32/nptl/lowlevellock.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c:
Moved ...
* sysdeps/sparc/sparc32/nptl/pthread_barrier_wait.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c: Moved ...
* sysdeps/sparc/sparc32/nptl/sem_post.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c: Moved ...
* sysdeps/sparc/sparc32/nptl/sem_timedwait.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c: Moved ...
* sysdeps/sparc/sparc32/nptl/sem_trywait.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c: Moved ...
* sysdeps/sparc/sparc32/nptl/sem_wait.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/cpu_relax.S:
Moved ...
* sysdeps/sparc/sparc32/sparcv9/nptl/cpu_relax.S: ... here.
Update #include.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/pthread_barrier_wait.c:
Moved ...
* sysdeps/sparc/sparc32/sparcv9/nptl/pthread_barrier_wait.c: ... here.
Update #include.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_post.c:
Moved ...
* sysdeps/sparc/sparc32/sparcv9/nptl/sem_post.c: ... here.
Update #include.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_timedwait.c:
Moved ...
* sysdeps/sparc/sparc32/sparcv9/nptl/sem_timedwait.c: ... here.
Update #include.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_trywait.c:
Moved ...
* sysdeps/sparc/sparc32/sparcv9/nptl/sem_trywait.c: ... here.
Update #include.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/sem_wait.c:
Moved ...
* sysdeps/sparc/sparc32/sparcv9/nptl/sem_wait.c: ... here.
Update #include.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/cpu_relax.S: Moved ...
* sysdeps/sparc/sparc64/nptl/cpu_relax.S: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: ... here.
Comments
From: Roland McGrath <roland@hack.frob.com>
Date: Wed, 18 Jun 2014 15:36:08 -0700 (PDT)
> Wholly untested. It should not change anything. A lot of the individual
> files contained no particular Linuxisms, so I moved them to OS-independent
> (but CPU-dependent) sysdeps/ directories.
>
> OK?
This is fine with me.
I've committed it. Please draw my attention to any follow-on fixes you
find necessary (or even just desirable), so I can be on the lookout not to
repeat mistakes with other machines.
Thanks,
Roland
From: Roland McGrath <roland@hack.frob.com>
Date: Fri, 20 Jun 2014 17:16:28 -0700 (PDT)
> I've committed it. Please draw my attention to any follow-on fixes you
> find necessary (or even just desirable), so I can be on the lookout not to
> repeat mistakes with other machines.
Will do.
From: David Miller <davem@davemloft.net>
Date: Fri, 20 Jun 2014 20:13:45 -0700 (PDT)
> From: Roland McGrath <roland@hack.frob.com>
> Date: Fri, 20 Jun 2014 17:16:28 -0700 (PDT)
>
>> I've committed it. Please draw my attention to any follow-on fixes you
>> find necessary (or even just desirable), so I can be on the lookout not to
>> repeat mistakes with other machines.
>
> Will do.
There appears to be a problem with putting this stuff under sysdeps/sparc/nptl,
in that header files under nptl/sysdeps/unix/sysv/linux/ will be choosen first.
As a result, sysdeps/sparc/nptl/internaltypes.h won't be used, instead we end up
using nptl/sysdeps/unix/sysv/linux/internaltypes.h.
This leads to the build failing:
../sysdeps/sparc/nptl/pthread_barrier_destroy.c: In function ‘pthread_barrier_destroy’:
../sysdeps/sparc/nptl/pthread_barrier_destroy.c:32:25: error: dereferencing pointer to incomplete type
...
etc.
I can't think of an easy way to fix this.
> There appears to be a problem with putting this stuff under
> sysdeps/sparc/nptl, in that header files under
> nptl/sysdeps/unix/sysv/linux/ will be choosen first.
>
> As a result, sysdeps/sparc/nptl/internaltypes.h won't be used, instead we
> end up using nptl/sysdeps/unix/sysv/linux/internaltypes.h.
OK, I have three answers:
1. The quickest fix is just to move it back to sysdeps/.../linux/sparc/.
2. The sparc internaltypes.h doesn't actually define anything differently
from the common one. It just adds extra types that are used only by a
few sparc implementation .c files. So it could just be a separate
sparc-specific header by a different name. This might be what's really
the best idea, on the general principle that if you can do your
machine-specific work just as cleanly with new machine-specific files
that do not interact with shared sysdeps files, then that choice
simplifies things by reducing such interactions that you or other
maintainers have to worry about in the future.
3. The "linux" internaltypes.h in fact does not contain any deep Linuxisms.
So as part of my ongoing cleanup I was about to move this to someplace
else more common, such as nptl/ or sysdeps/nptl/. That will fix your
problem for you incidentally, and I was probably going to do that today
anyway.
Thanks,
Roland
From: Roland McGrath <roland@hack.frob.com>
Date: Mon, 23 Jun 2014 10:08:40 -0700 (PDT)
> 2. The sparc internaltypes.h doesn't actually define anything differently
> from the common one. It just adds extra types that are used only by a
> few sparc implementation .c files. So it could just be a separate
> sparc-specific header by a different name. This might be what's really
> the best idea, on the general principle that if you can do your
> machine-specific work just as cleanly with new machine-specific files
> that do not interact with shared sysdeps files, then that choice
> simplifies things by reducing such interactions that you or other
> maintainers have to worry about in the future.
I think this is the way to go, regardless of what you end up doing with
internaltypes.h
I'll work on this.
> I think this is the way to go, regardless of what you end up doing with
> internaltypes.h
>
> I'll work on this.
Thanks. I tend to agree. But you could also test the roland/nptl branch
and see if it works. :-)
From: Roland McGrath <roland@hack.frob.com>
Date: Tue, 24 Jun 2014 13:14:58 -0700 (PDT)
>> I think this is the way to go, regardless of what you end up doing with
>> internaltypes.h
>>
>> I'll work on this.
>
> Thanks. I tend to agree. But you could also test the roland/nptl branch
> and see if it works. :-)
Even with the build fixed I'm getting a lot of NPTL test failures:
FAIL: nptl/tst-cancel13
FAIL: nptl/tst-cancel15
FAIL: nptl/tst-cancelx13
FAIL: nptl/tst-cancelx15
FAIL: nptl/tst-kill6
FAIL: nptl/tst-sem11
FAIL: nptl/tst-sem11-static
FAIL: nptl/tst-sem12
FAIL: nptl/tst-sem12-static
FAIL: nptl/tst-sem14
FAIL: nptl/tst-sem2
FAIL: nptl/tst-sem5
FAIL: nptl/tst-sem6
FAIL: nptl/tst-signal3
FAIL: nptl/tst-tls2
FAIL: nptl/tst-tls3
I suspect it's something else to do with directory dependency
ordering, which I guess is the riskiest aspect of these NPTL directory
move changes.
I will not have time to investigate this today, sorry.
> I suspect it's something else to do with directory dependency
> ordering, which I guess is the riskiest aspect of these NPTL directory
> move changes.
Indeed. I've tried to do each stage of the change in such a way that it
should not change the compiled code at all. So rather than debugging the
tests, we can just debug the build, which should be a lot easier. I use
diffs of objdump -rd output a lot.
> I will not have time to investigate this today, sorry.
No problem. I will test the other builds that are easiest for me to do
(ARM, and re-test x86 in case I flubbed my previous testing), and might
find some general snafu that way. Then I'll see what I can do to
investigate the sparc build myself if you haven't gotten there first.
(I have some old pointers from you to log into a machine of yours,
and in years past I've managed to find sparc boxes I could use via
the Debian and/or GCC compile farms or maybe sourceforge.)
Thanks,
Roland
From: Roland McGrath <roland@hack.frob.com>
Date: Tue, 24 Jun 2014 13:34:52 -0700 (PDT)
>> I will not have time to investigate this today, sorry.
>
> No problem. I will test the other builds that are easiest for me to do
> (ARM, and re-test x86 in case I flubbed my previous testing), and might
> find some general snafu that way. Then I'll see what I can do to
> investigate the sparc build myself if you haven't gotten there first.
> (I have some old pointers from you to log into a machine of yours,
> and in years past I've managed to find sparc boxes I could use via
> the Debian and/or GCC compile farms or maybe sourceforge.)
Your roland/nptl branch results in a new build error, the problem is
that sysdeps/sparc/sparc32/sparcv9/nptl/sem_trywait.c tries to include
the old location of the generic Linux sem_trywait.c file which of
course no longer works.
What's the best way to handle this? I tried:
#include <nptl/sem_trywait.c>
but that still picks up sysdeps/sparc/sparc32/sparcv9/nptl/sem_trywait.c,
then I thought to try:
#include_next <nptl/sem_trywait.c>
but that won't work because 1) it will generate a warning about using
include_next being used in a primary file and 2) it will end up using
sysdeps/sparc/sparc32/nptl/sem_trywait.c rather than what I want which
is nptl/sem_trywait.c
Ugh!
deleted file mode 100644
@@ -1,2 +0,0 @@
-# pull in __syscall_error routine
-libpthread-routines += sysdep
deleted file mode 100644
@@ -1,6 +0,0 @@
-libpthread {
- GLIBC_2.3.3 {
- # Changed PTHREAD_STACK_MIN.
- pthread_attr_setstack; pthread_attr_setstacksize;
- }
-}
deleted file mode 100644
@@ -1 +0,0 @@
-libpthread-routines += cpu_relax
deleted file mode 100644
@@ -1 +0,0 @@
-#include <sparc64/cpu_relax.S>
deleted file mode 100644
@@ -1 +0,0 @@
-#include "../../pthread_barrier_wait.c"
deleted file mode 100644
@@ -1 +0,0 @@
-#include "../../sem_post.c"
deleted file mode 100644
@@ -1 +0,0 @@
-#include "../../sem_timedwait.c"
deleted file mode 100644
@@ -1 +0,0 @@
-#include "../../../sem_trywait.c"
deleted file mode 100644
@@ -1 +0,0 @@
-#include "../../sem_wait.c"
deleted file mode 100644
@@ -1,6 +0,0 @@
-libpthread-routines += cpu_relax
-
-ifeq ($(subdir),nptl)
-CFLAGS-pause.c += -fexceptions
-CFLAGS-sigsuspend.c += -fexceptions
-endif
deleted file mode 100644
@@ -1,7 +0,0 @@
-librt {
- GLIBC_2.3.3 {
- # Changed timer_t.
- timer_create; timer_delete; timer_getoverrun; timer_gettime;
- timer_settime;
- }
-}
similarity index 94%
rename from nptl/sysdeps/unix/sysv/linux/sparc/internaltypes.h
rename to sysdeps/sparc/nptl/internaltypes.h
@@ -1,5 +1,6 @@
#ifndef _INTERNALTYPES_H
-#include "../internaltypes.h"
+
+#include_next <internaltypes.h>
union sparc_pthread_barrier
{
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_destroy.c
rename to sysdeps/sparc/nptl/pthread_barrier_destroy.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_init.c
rename to sysdeps/sparc/nptl/pthread_barrier_init.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/pthread_barrier_wait.c
rename to sysdeps/sparc/nptl/pthread_barrier_wait.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sem_init.c
rename to sysdeps/sparc/nptl/sem_init.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sem_post.c
rename to sysdeps/sparc/nptl/sem_post.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sem_timedwait.c
rename to sysdeps/sparc/nptl/sem_timedwait.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sem_wait.c
rename to sysdeps/sparc/nptl/sem_wait.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c
rename to sysdeps/sparc/sparc32/nptl/lowlevellock.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c
rename to sysdeps/sparc/sparc32/nptl/pthread_barrier_wait.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c
rename to sysdeps/sparc/sparc32/nptl/sem_post.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_timedwait.c
rename to sysdeps/sparc/sparc32/nptl/sem_timedwait.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_trywait.c
rename to sysdeps/sparc/sparc32/nptl/sem_trywait.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_wait.c
rename to sysdeps/sparc/sparc32/nptl/sem_wait.c
@@ -18,3 +18,7 @@ ASFLAGS-.op += -Wa,-Av9a
ASFLAGS-.og += -Wa,-Av9a
ASFLAGS-.oS += -Wa,-Av9a
endif
+
+ifeq ($(subdir), nptl)
+libpthread-routines += cpu_relax
+endif
new file mode 100644
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/nptl/cpu_relax.S>
new file mode 100644
@@ -0,0 +1 @@
+#include <sysdeps/sparc/nptl/pthread_barrier_wait.c>
new file mode 100644
@@ -0,0 +1 @@
+#include <sysdeps/sparc/nptl/sem_post.c>
new file mode 100644
@@ -0,0 +1 @@
+#include <sysdeps/sparc/nptl/sem_timedwait.c>
new file mode 100644
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/sem_trywait.c>
new file mode 100644
@@ -0,0 +1 @@
+#include <sysdeps/sparc/nptl/sem_wait.c>
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc64/cpu_relax.S
rename to sysdeps/sparc/sparc64/nptl/cpu_relax.S
@@ -11,3 +11,8 @@ endif
ifeq ($(subdir),sysvipc)
sysdep_routines += getshmlba
endif
+
+ifeq ($(subdir),nptl)
+# pull in __syscall_error routine
+libpthread-routines += sysdep
+endif
@@ -30,6 +30,14 @@ libc {
__getshmlba;
}
}
+
+libpthread {
+ GLIBC_2.3.3 {
+ # Changed PTHREAD_STACK_MIN.
+ pthread_attr_setstack; pthread_attr_setstacksize;
+ }
+}
+
librt {
GLIBC_2.3 {
# AIO functions.
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/aio_cancel.c
rename to sysdeps/unix/sysv/linux/sparc/aio_cancel.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
rename to sysdeps/unix/sysv/linux/sparc/lowlevellock.h
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
rename to sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
@@ -7,3 +7,8 @@ LD += -melf64_sparc
ifeq ($(subdir),stdlib)
sysdep_routines += __start_context
endif
+
+ifeq ($(subdir),nptl)
+CFLAGS-pause.c += -fexceptions
+CFLAGS-sigsuspend.c += -fexceptions
+endif
@@ -9,3 +9,11 @@ libc {
wordexp;
}
}
+
+librt {
+ GLIBC_2.3.3 {
+ # Changed timer_t.
+ timer_create; timer_delete; timer_getoverrun; timer_gettime;
+ timer_settime;
+ }
+}
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
rename to sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
rename to sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
rename to sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
rename to sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
rename to sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c
similarity index 100%
rename from nptl/sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c
rename to sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c