0002-nptl-remove-duplicate-vfork-in-libpthread.patch 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. From c0cdfbcfd4ca6f86eae5f189290cbc1be891a398 Mon Sep 17 00:00:00 2001
  2. From: Waldemar Brodkorb <wbx@openadk.org>
  3. Date: Thu, 4 Sep 2014 15:23:36 +0200
  4. Subject: [PATCH 2/6] nptl: remove duplicate vfork() in libpthread
  5. Automatic patching via two oneliners by Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>:
  6. sed -i -e 's/[[:space:]]pt-vfork\.[csS]//' $(git grep -l pt-vfork libpthread/nptl/sysdeps)
  7. find libpthread/nptl -name "*pt-vfork*" -exec git rm {} \;
  8. Reported-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  9. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
  10. ---
  11. .../nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S | 42 --------------
  12. .../nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch | 3 +-
  13. .../nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S | 7 ---
  14. .../nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch | 3 +-
  15. .../nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S | 37 ------------
  16. .../sysdeps/unix/sysv/linux/i386/Makefile.arch | 3 +-
  17. .../nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S | 67 ----------------------
  18. .../sysdeps/unix/sysv/linux/metag/Makefile.arch | 3 +-
  19. .../nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S | 51 ----------------
  20. .../sysdeps/unix/sysv/linux/mips/Makefile.arch | 3 +-
  21. .../nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S | 37 ------------
  22. .../sysdeps/unix/sysv/linux/powerpc/Makefile.arch | 3 +-
  23. .../unix/sysv/linux/powerpc/powerpc32/pt-vfork.S | 48 ----------------
  24. .../unix/sysv/linux/powerpc/powerpc64/pt-vfork.S | 48 ----------------
  25. .../sysdeps/unix/sysv/linux/powerpc/pt-vfork.S | 5 --
  26. .../nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch | 3 +-
  27. .../nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S | 64 ---------------------
  28. .../sysdeps/unix/sysv/linux/sparc/Makefile.arch | 3 +-
  29. .../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S | 44 --------------
  30. .../sysdeps/unix/sysv/linux/x86_64/Makefile.arch | 3 +-
  31. .../nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S | 32 -----------
  32. 21 files changed, 9 insertions(+), 500 deletions(-)
  33. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
  34. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S
  35. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S
  36. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S
  37. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
  38. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
  39. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S
  40. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S
  41. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S
  42. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S
  43. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
  44. delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S
  45. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
  46. deleted file mode 100644
  47. index a6005c1..0000000
  48. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
  49. +++ /dev/null
  50. @@ -1,42 +0,0 @@
  51. -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  52. - This file is part of the GNU C Library.
  53. -
  54. - The GNU C Library is free software; you can redistribute it and/or
  55. - modify it under the terms of the GNU Lesser General Public
  56. - License as published by the Free Software Foundation; either
  57. - version 2.1 of the License, or (at your option) any later version.
  58. -
  59. - The GNU C Library is distributed in the hope that it will be useful,
  60. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  61. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  62. - Lesser General Public License for more details.
  63. -
  64. - You should have received a copy of the GNU Lesser General Public
  65. - License along with the GNU C Library; if not, see
  66. - <http://www.gnu.org/licenses/>. */
  67. -
  68. -#include <sysdep.h>
  69. -#include <tcb-offsets.h>
  70. -
  71. -#undef PSEUDO_PREPARE_ARGS
  72. -#define PSEUDO_PREPARE_ARGS \
  73. - /* Load the current cached pid value across the vfork. */ \
  74. - rduniq; \
  75. - ldl a2, PID_OFFSET(v0); \
  76. - mov v0, a1; \
  77. - /* Write back its negation, to indicate that the pid value is \
  78. - uninitialized in the the child, and in the window between \
  79. - here and the point at which we restore the value. */ \
  80. - negl a2, t0; \
  81. - stl t0, PID_OFFSET(v0);
  82. -
  83. -PSEUDO (__vfork, vfork, 0)
  84. -
  85. - /* If we're back in the parent, restore the saved pid. */
  86. - beq v0, 1f
  87. - stl a2, PID_OFFSET(a1)
  88. -1: ret
  89. -
  90. -PSEUDO_END (__vfork)
  91. -
  92. -weak_alias (__vfork, vfork)
  93. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch
  94. index 25e6fad..658aa6c 100644
  95. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch
  96. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch
  97. @@ -5,7 +5,7 @@
  98. # Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  99. #
  100. -libpthread_linux_arch_SSRC = pt-vfork.S
  101. +libpthread_linux_arch_SSRC =
  102. libpthread_linux_arch_CSRC = pthread_once.c lowlevellock.c \
  103. pt-__syscall_rt_sigaction.c pt-__syscall_error.c
  104. @@ -17,7 +17,6 @@ CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
  105. CFLAGS-pt-__syscall_rt_sigaction.c = -DNOT_IN_libc -DIS_IN_libpthread
  106. CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
  107. CFLAGS-pt-__syscall_error.c = -DNOT_IN_libc -DIS_IN_libpthread
  108. -ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread
  109. ASFLAGS-vfork.S = -DIS_IN_libc -DNOT_IN_libpthread
  110. ASFLAGS-clone.S = -DIS_IN_libc -DNOT_IN_libpthread
  111. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S
  112. deleted file mode 100644
  113. index f222dca..0000000
  114. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S
  115. +++ /dev/null
  116. @@ -1,7 +0,0 @@
  117. -/*
  118. - * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
  119. - *
  120. - * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  121. - */
  122. -
  123. -#include "vfork.S"
  124. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
  125. index 329d8a9..6f05b7d 100644
  126. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
  127. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
  128. @@ -5,7 +5,7 @@
  129. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  130. #
  131. -libpthread_linux_arch_SSRC = pt-vfork.S
  132. +libpthread_linux_arch_SSRC =
  133. libpthread_linux_arch_CSRC = pthread_once.c \
  134. pt-__syscall_rt_sigaction.c pt-__syscall_error.c \
  135. lowlevellock.c
  136. @@ -19,7 +19,6 @@ CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
  137. CFLAGS-pt-__syscall_rt_sigaction.c = -DNOT_IN_libc -DIS_IN_libpthread
  138. CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
  139. CFLAGS-pt-__syscall_error.c = -DNOT_IN_libc -DIS_IN_libpthread
  140. -ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -marm
  141. ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y)
  142. CFLAGS-fork.c = -D__USE_STDIO_FUTEXES__
  143. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S
  144. deleted file mode 100644
  145. index df18f03..0000000
  146. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S
  147. +++ /dev/null
  148. @@ -1,37 +0,0 @@
  149. -/* Copyright (C) 2005 Free Software Foundation, Inc.
  150. - This file is part of the GNU C Library.
  151. -
  152. - The GNU C Library is free software; you can redistribute it and/or
  153. - modify it under the terms of the GNU Lesser General Public
  154. - License as published by the Free Software Foundation; either
  155. - version 2.1 of the License, or (at your option) any later version.
  156. -
  157. - The GNU C Library is distributed in the hope that it will be useful,
  158. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  159. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  160. - Lesser General Public License for more details.
  161. -
  162. - You should have received a copy of the GNU Lesser General Public
  163. - License along with the GNU C Library; if not, see
  164. - <http://www.gnu.org/licenses/>. */
  165. -
  166. -#include <tcb-offsets.h>
  167. -
  168. -/* Save the PID value. */
  169. -#define SAVE_PID \
  170. - str lr, [sp, #-4]!; /* Save LR. */ \
  171. - mov r0, #0xffff0fff; /* Point to the high page. */ \
  172. - mov lr, pc; /* Save our return address. */ \
  173. - sub pc, r0, #31; /* Jump to the TLS entry. */ \
  174. - ldr lr, [sp], #4; /* Restore LR. */ \
  175. - mov r2, r0; /* Save the TLS addr in r2. */ \
  176. - ldr r3, [r2, #PID_OFFSET]; /* Load the saved PID. */ \
  177. - rsb r0, r3, #0; /* Negate it. */ \
  178. - str r0, [r2, #PID_OFFSET] /* Store the temporary PID. */
  179. -
  180. -/* Restore the old PID value in the parent. */
  181. -#define RESTORE_PID \
  182. - cmp r0, #0; /* If we are the parent... */ \
  183. - strne r3, [r2, #PID_OFFSET] /* ... restore the saved PID. */
  184. -
  185. -#include "../../../../../../../libc/sysdeps/linux/arm/vfork.S"
  186. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch
  187. index 9a34595..94fc03a 100644
  188. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch
  189. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch
  190. @@ -5,7 +5,7 @@
  191. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  192. #
  193. -libpthread_linux_arch_SSRC = pt-vfork.S clone.S pthread_spin_unlock.S pthread_once.S
  194. +libpthread_linux_arch_SSRC = clone.S pthread_spin_unlock.S pthread_once.S
  195. libpthread_linux_arch_CSRC = pthread_spin_init.c pt-__syscall_error.c
  196. libc_linux_arch_CSRC = fork.c
  197. @@ -14,7 +14,6 @@ libc_linux_arch_SSRC = clone.S vfork.S
  198. ASFLAGS += -DUSE___THREAD
  199. CFLAGS-pt-__syscall_error.c = -DNOT_IN_libc -DIS_IN_libpthread
  200. -ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  201. ASFLAGS-lowlevellock.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  202. ASFLAGS-lowlevelrobustlock.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  203. ASFLAGS-pthread_once.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  204. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S
  205. deleted file mode 100644
  206. index 5bba782..0000000
  207. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S
  208. +++ /dev/null
  209. @@ -1,67 +0,0 @@
  210. -/* Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
  211. - This file is part of the GNU C Library.
  212. - Contributed by Andreas Schwab <schwab@gnu.org>.
  213. -
  214. - The GNU C Library is free software; you can redistribute it and/or
  215. - modify it under the terms of the GNU Lesser General Public
  216. - License as published by the Free Software Foundation; either
  217. - version 2.1 of the License, or (at your option) any later version.
  218. -
  219. - The GNU C Library is distributed in the hope that it will be useful,
  220. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  221. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  222. - Lesser General Public License for more details.
  223. -
  224. - You should have received a copy of the GNU Lesser General Public
  225. - License along with the GNU C Library; if not, see
  226. - <http://www.gnu.org/licenses/>. */
  227. -
  228. -#include <sysdep.h>
  229. -#define _ERRNO_H 1
  230. -#include <bits/errno.h>
  231. -#include <bits/kernel-features.h>
  232. -#include <tcb-offsets.h>
  233. -
  234. -/* Save the PID value. */
  235. -#define SAVE_PID \
  236. - movl %gs:PID, %edx; \
  237. - movl %edx, %eax; \
  238. - negl %eax; \
  239. - movl %eax, %gs:PID
  240. -
  241. -/* Restore the old PID value in the parent. */
  242. -#define RESTORE_PID \
  243. - testl %eax, %eax; \
  244. - je 1f; \
  245. - movl %edx, %gs:PID; \
  246. -1:
  247. -
  248. -/* Clone the calling process, but without copying the whole address space.
  249. - The calling process is suspended until the new process exits or is
  250. - replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
  251. - and the process ID of the new process to the old process. */
  252. -
  253. -ENTRY (__vfork)
  254. - /* Pop the return PC value into ECX. */
  255. - popl %ecx
  256. -
  257. - SAVE_PID
  258. -
  259. - /* Stuff the syscall number in EAX and enter into the kernel. */
  260. - movl $SYS_ify (vfork), %eax
  261. - int $0x80
  262. -
  263. - RESTORE_PID
  264. -
  265. - /* Jump to the return PC. Don't jump directly since this
  266. - disturbs the branch target cache. Instead push the return
  267. - address back on the stack. */
  268. - pushl %ecx
  269. -
  270. - cmpl $-4095, %eax
  271. - jae SYSCALL_ERROR_LABEL /* Branch forward if it failed. */
  272. -L(pseudo_end):
  273. - ret
  274. -PSEUDO_END (__vfork)
  275. -
  276. -weak_alias (__vfork, vfork)
  277. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/metag/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/metag/Makefile.arch
  278. index df98875..99dec6b 100644
  279. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/metag/Makefile.arch
  280. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/metag/Makefile.arch
  281. @@ -5,7 +5,7 @@
  282. # Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  283. #
  284. -libpthread_linux_arch_SSRC = pt-vfork.S
  285. +libpthread_linux_arch_SSRC =
  286. libpthread_linux_arch_CSRC = pthread_once.c \
  287. pt-__syscall_rt_sigaction.c pt-__syscall_error.c \
  288. lowlevellock.c
  289. @@ -22,7 +22,6 @@ CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
  290. CFLAGS-pt-__syscall_error.c = -DNOT_IN_libc -DIS_IN_libpthread
  291. ASFLAGS-vfork.S = -DIS_IN_libc -DNOT_IN_libpthread
  292. ASFLAGS-clone.S = -DIS_IN_libc -DNOT_IN_libpthread
  293. -ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread
  294. ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y)
  295. CFLAGS-fork.c = -D__USE_STDIO_FUTEXES__
  296. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
  297. deleted file mode 100644
  298. index 489c749..0000000
  299. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
  300. +++ /dev/null
  301. @@ -1,51 +0,0 @@
  302. -/* Copyright (C) 2005 Free Software Foundation, Inc.
  303. - This file is part of the GNU C Library.
  304. -
  305. - The GNU C Library is free software; you can redistribute it and/or
  306. - modify it under the terms of the GNU Lesser General Public
  307. - License as published by the Free Software Foundation; either
  308. - version 2.1 of the License, or (at your option) any later version.
  309. -
  310. - The GNU C Library is distributed in the hope that it will be useful,
  311. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  312. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  313. - Lesser General Public License for more details.
  314. -
  315. - You should have received a copy of the GNU Lesser General Public
  316. - License along with the GNU C Library; if not, write to the Free
  317. - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  318. - 02111-1307 USA. */
  319. -
  320. -#include <tcb-offsets.h>
  321. -#include <asm/unistd.h>
  322. -
  323. -#ifdef __PIC__
  324. -#define __VFORK_METAG_LOAD_TP ___metag_load_tp@PLT
  325. -#else
  326. -#define __VFORK_METAG_LOAD_TP ___metag_load_tp
  327. -#endif
  328. -
  329. -/* Save the PID value. */
  330. -#define SAVE_PID \
  331. - SETL [A0StP++], D0FrT, D1RtP; \
  332. - CALLR D1RtP, __VFORK_METAG_LOAD_TP; \
  333. - SUB D0Re0, D0Re0, #TLS_PRE_TCB_SIZE; \
  334. - GETD D0FrT, [D0Re0 + #PID]; \
  335. - NEG D0FrT, D0FrT; \
  336. - SETD [D0Re0 + #PID], D0FrT; \
  337. - GETL D0FrT, D1RtP, [--A0StP];
  338. -
  339. -#define RESTORE_PID \
  340. - CMP D0Re0, #0; \
  341. - BEQ 1f; \
  342. - MSETL [A0StP++], D0Re0, D0FrT; \
  343. - CALLR D1RtP, __VFORK_METAG_LOAD_TP; \
  344. - SUB D0Re0, D0Re0, #TLS_PRE_TCB_SIZE; \
  345. - GETD D0FrT, [D0Re0 + #PID]; \
  346. - NEG D0FrT, D0FrT; \
  347. - SETD [D0Re0 + #PID], D0FrT; \
  348. - GETL D0FrT, D1RtP, [--A0StP]; \
  349. - GETL D0Re0, D1Re0, [--A0StP]; \
  350. -1:
  351. -
  352. -#include <../../../../../../../libc/sysdeps/linux/metag/vfork.S>
  353. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch
  354. index fc26a8e..a453b6b 100644
  355. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch
  356. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch
  357. @@ -5,7 +5,7 @@
  358. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  359. #
  360. -libpthread_linux_arch_SSRC = pt-vfork.S clone.S
  361. +libpthread_linux_arch_SSRC = clone.S
  362. libpthread_linux_arch_CSRC = pthread_once.c pt-__syscall_rt_sigaction.c
  363. libc_linux_arch_CSRC = fork.c
  364. @@ -21,7 +21,6 @@ CFLAGS-fork.c = -D__USE_STDIO_FUTEXES__
  365. endif
  366. CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
  367. CFLAGS-pt-__syscall_rt_sigaction.c = -DNOT_IN_libc -DIS_IN_libpthread
  368. -ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread
  369. ASFLAGS-clone.S = -D_LIBC_REENTRANT
  370. ASFLAGS-vfork.S = -D_LIBC_REENTRANT
  371. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
  372. deleted file mode 100644
  373. index 52fbde3..0000000
  374. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
  375. +++ /dev/null
  376. @@ -1,37 +0,0 @@
  377. -/* Copyright (C) 2005 Free Software Foundation, Inc.
  378. - This file is part of the GNU C Library.
  379. -
  380. - The GNU C Library is free software; you can redistribute it and/or
  381. - modify it under the terms of the GNU Lesser General Public
  382. - License as published by the Free Software Foundation; either
  383. - version 2.1 of the License, or (at your option) any later version.
  384. -
  385. - The GNU C Library is distributed in the hope that it will be useful,
  386. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  387. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  388. - Lesser General Public License for more details.
  389. -
  390. - You should have received a copy of the GNU Lesser General Public
  391. - License along with the GNU C Library; if not, see
  392. - <http://www.gnu.org/licenses/>. */
  393. -
  394. -#include <features.h>
  395. -#include <tls.h>
  396. -
  397. -/* Save the PID value. */
  398. -#define SAVE_PID \
  399. - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \
  400. - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \
  401. - subu a2, $0, a2; /* Negate it. */ \
  402. - sw a2, PID_OFFSET(v1); /* Store the temporary PID. */
  403. -
  404. -/* Restore the old PID value in the parent. */
  405. -#define RESTORE_PID \
  406. - beqz v0, 1f; /* If we are the parent... */ \
  407. - READ_THREAD_POINTER(v1); /* Get the thread pointer. */ \
  408. - lw a2, PID_OFFSET(v1); /* Load the saved PID. */ \
  409. - subu a2, $0, a2; /* Re-negate it. */ \
  410. - sw a2, PID_OFFSET(v1); /* Restore the PID. */ \
  411. -1:
  412. -
  413. -#include <../../../../../../../libc/sysdeps/linux/mips/vfork.S>
  414. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch
  415. index 8581aea..215c2aa 100644
  416. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch
  417. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch
  418. @@ -5,7 +5,7 @@
  419. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  420. #
  421. -libpthread_linux_arch_SSRC = pt-vfork.S
  422. +libpthread_linux_arch_SSRC =
  423. libpthread_linux_arch_CSRC = pthread_once.c pt-__syscall_error.c
  424. libc_linux_arch_CSRC = fork.c
  425. @@ -19,7 +19,6 @@ ASFLAGS += -DUSE___THREAD
  426. CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
  427. CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
  428. CFLAGS-pt-__syscall_error.c = -DNOT_IN_libc -DIS_IN_libpthread
  429. -ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  430. #ASFLAGS-lowlevellock.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  431. #ASFLAGS-libc-lowlevellock.S = -D_LIBC_REENTRANT
  432. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S
  433. deleted file mode 100644
  434. index 2f82504..0000000
  435. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S
  436. +++ /dev/null
  437. @@ -1,48 +0,0 @@
  438. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  439. - This file is part of the GNU C Library.
  440. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  441. -
  442. - The GNU C Library is free software; you can redistribute it and/or
  443. - modify it under the terms of the GNU Lesser General Public
  444. - License as published by the Free Software Foundation; either
  445. - version 2.1 of the License, or (at your option) any later version.
  446. -
  447. - The GNU C Library is distributed in the hope that it will be useful,
  448. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  449. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  450. - Lesser General Public License for more details.
  451. -
  452. - You should have received a copy of the GNU Lesser General Public
  453. - License along with the GNU C Library; if not, see
  454. - <http://www.gnu.org/licenses/>. */
  455. -
  456. -#include <sysdep.h>
  457. -#define _ERRNO_H 1
  458. -#include <bits/errno.h>
  459. -#include <bits/kernel-features.h>
  460. -#include <tcb-offsets.h>
  461. -
  462. -/* Clone the calling process, but without copying the whole address space.
  463. - The calling process is suspended until the new process exits or is
  464. - replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
  465. - and the process ID of the new process to the old process. */
  466. -
  467. -ENTRY (__vfork)
  468. - lwz 0,PID(2)
  469. - neg 0,0
  470. - stw 0,PID(2)
  471. -
  472. - DO_CALL (SYS_ify (vfork))
  473. -
  474. - cmpwi 1,3,0
  475. - beqlr- 1
  476. -
  477. - lwz 0,PID(2)
  478. - neg 0,0
  479. - stw 0,PID(2)
  480. -
  481. - PSEUDO_RET
  482. -
  483. -PSEUDO_END (__vfork)
  484. -
  485. -weak_alias (__vfork, vfork)
  486. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S
  487. deleted file mode 100644
  488. index 12e47b3..0000000
  489. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S
  490. +++ /dev/null
  491. @@ -1,48 +0,0 @@
  492. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  493. - This file is part of the GNU C Library.
  494. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  495. -
  496. - The GNU C Library is free software; you can redistribute it and/or
  497. - modify it under the terms of the GNU Lesser General Public
  498. - License as published by the Free Software Foundation; either
  499. - version 2.1 of the License, or (at your option) any later version.
  500. -
  501. - The GNU C Library is distributed in the hope that it will be useful,
  502. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  503. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  504. - Lesser General Public License for more details.
  505. -
  506. - You should have received a copy of the GNU Lesser General Public
  507. - License along with the GNU C Library; if not, see
  508. - <http://www.gnu.org/licenses/>. */
  509. -
  510. -#include <sysdep.h>
  511. -#define _ERRNO_H 1
  512. -#include <bits/errno.h>
  513. -#include <bits/kernel-features.h>
  514. -#include <tcb-offsets.h>
  515. -
  516. -/* Clone the calling process, but without copying the whole address space.
  517. - The calling process is suspended until the new process exits or is
  518. - replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
  519. - and the process ID of the new process to the old process. */
  520. -
  521. -ENTRY (__vfork)
  522. - lwz 0,PID(13)
  523. - neg 0,0
  524. - stw 0,PID(13)
  525. -
  526. - DO_CALL (SYS_ify (vfork))
  527. -
  528. - cmpwi 1,3,0
  529. - beqlr- 1
  530. -
  531. - lwz 0,PID(13)
  532. - neg 0,0
  533. - stw 0,PID(13)
  534. -
  535. - PSEUDO_RET
  536. -
  537. -PSEUDO_END (__vfork)
  538. -
  539. -weak_alias (__vfork, vfork)
  540. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S
  541. deleted file mode 100644
  542. index 0225219..0000000
  543. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S
  544. +++ /dev/null
  545. @@ -1,5 +0,0 @@
  546. -#if defined __powerpc64__
  547. -# include "powerpc64/pt-vfork.S"
  548. -#else
  549. -# include "powerpc32/pt-vfork.S"
  550. -#endif
  551. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch
  552. index a8249e0..9ebbda5 100644
  553. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch
  554. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch
  555. @@ -5,7 +5,7 @@
  556. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  557. #
  558. -libpthread_linux_arch_SSRC = pt-vfork.S pthread_once.S pthread_rwlock_wrlock.S \
  559. +libpthread_linux_arch_SSRC = pthread_once.S pthread_rwlock_wrlock.S \
  560. pthread_rwlock_rdlock.S pthread_rwlock_unlock.S \
  561. lowlevellock.S lowlevelrobustlock.S pthread_barrier_wait.S \
  562. pthread_cond_broadcast.S pthread_cond_signal.S \
  563. @@ -17,7 +17,6 @@ libc_linux_arch_SSRC = libc-lowlevellock.S clone.S vfork.S
  564. ASFLAGS += -DUSE___THREAD
  565. -ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  566. ASFLAGS-pthread_once.S = -D_LIBC_REENTRANT
  567. ASFLAGS-pthread_rwlock_wrlock.S = -D_LIBC_REENTRANT
  568. ASFLAGS-pthread_rwlock_rdlock.S = -D_LIBC_REENTRANT
  569. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S
  570. deleted file mode 100644
  571. index 56aa6d0..0000000
  572. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S
  573. +++ /dev/null
  574. @@ -1,64 +0,0 @@
  575. -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  576. - This file is part of the GNU C Library.
  577. -
  578. - The GNU C Library is free software; you can redistribute it and/or
  579. - modify it under the terms of the GNU Lesser General Public
  580. - License as published by the Free Software Foundation; either
  581. - version 2.1 of the License, or (at your option) any later version.
  582. -
  583. - The GNU C Library is distributed in the hope that it will be useful,
  584. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  585. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  586. - Lesser General Public License for more details.
  587. -
  588. - You should have received a copy of the GNU Lesser General Public
  589. - License along with the GNU C Library; if not, see
  590. - <http://www.gnu.org/licenses/>. */
  591. -
  592. -#include <sysdep.h>
  593. -#define _ERRNO_H 1
  594. -#include <bits/errno.h>
  595. -#include <tcb-offsets.h>
  596. -
  597. -/* Clone the calling process, but without copying the whole address space.
  598. - The calling process is suspended until the new process exits or is
  599. - replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
  600. - and the process ID of the new process to the old process. */
  601. -
  602. -ENTRY (__vfork)
  603. - /* Save the PID value. */
  604. - stc gbr, r2
  605. - mov.w .L2, r0
  606. - mov.l @(r0,r2), r4
  607. - neg r4, r1
  608. - mov.l r1, @(r0,r2)
  609. -
  610. - mov.w .L1, r3
  611. - trapa #0x10
  612. - mov r0, r1
  613. -
  614. - /* Restore the old PID value in the parent. */
  615. - tst r0, r0
  616. - bt/s 2f
  617. - stc gbr, r2
  618. - mov.w .L2, r0
  619. - mov.l r4, @(r0,r2)
  620. - mov r1, r0
  621. -2:
  622. - mov #-12, r2
  623. - shad r2, r1
  624. - not r1, r1 // r1=0 means r0 = -1 to -4095
  625. - tst r1, r1 // i.e. error in linux
  626. - bf .Lpseudo_end
  627. - SYSCALL_ERROR_HANDLER
  628. -.Lpseudo_end:
  629. - rts
  630. - nop
  631. -.L1:
  632. - .word __NR_vfork
  633. -.L2:
  634. - .word PID - TLS_PRE_TCB_SIZE
  635. -
  636. -PSEUDO_END (__vfork)
  637. -
  638. -weak_alias (__vfork, vfork)
  639. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch
  640. index 102c0da..aedad2c 100644
  641. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch
  642. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch
  643. @@ -5,7 +5,7 @@
  644. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  645. #
  646. -libpthread_linux_arch_SSRC = pt-vfork.S clone.S
  647. +libpthread_linux_arch_SSRC = clone.S
  648. libpthread_linux_arch_CSRC = pthread_once.c lowlevellock.c \
  649. pthread_barrier_init.c pthread_barrier_wait.c pthread_barrier_destroy.c \
  650. pt-__syscall_error.c
  651. @@ -17,7 +17,6 @@ librt_linux_arch_CSRC = pt-__syscall_error.c
  652. ASFLAGS += -DUSE___THREAD
  653. -ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  654. CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
  655. CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
  656. CFLAGS-pt-__syscall_error.c = -DNOT_IN_libc -DIS_IN_libpthread
  657. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
  658. deleted file mode 100644
  659. index 37231a8..0000000
  660. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
  661. +++ /dev/null
  662. @@ -1,44 +0,0 @@
  663. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  664. - This file is part of the GNU C Library.
  665. - Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
  666. -
  667. - The GNU C Library is free software; you can redistribute it and/or
  668. - modify it under the terms of the GNU Lesser General Public
  669. - License as published by the Free Software Foundation; either
  670. - version 2.1 of the License, or (at your option) any later version.
  671. -
  672. - The GNU C Library is distributed in the hope that it will be useful,
  673. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  674. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  675. - Lesser General Public License for more details.
  676. -
  677. - You should have received a copy of the GNU Lesser General Public
  678. - License along with the GNU C Library; if not, see
  679. - <http://www.gnu.org/licenses/>. */
  680. -
  681. -#include <sysdep.h>
  682. -#include <tcb-offsets.h>
  683. -
  684. - .text
  685. - .globl __syscall_error
  686. -ENTRY(__vfork)
  687. - ld [%g7 + PID], %o5
  688. - sub %g0, %o5, %o4
  689. - st %o4, [%g7 + PID]
  690. -
  691. - LOADSYSCALL(vfork)
  692. - ta 0x10
  693. - bcc 2f
  694. - mov %o7, %g1
  695. - st %o5, [%g7 + PID]
  696. - call __syscall_error
  697. - mov %g1, %o7
  698. -2: sub %o1, 1, %o1
  699. - andcc %o0, %o1, %o0
  700. - bne,a 1f
  701. - st %o5, [%g7 + PID]
  702. -1: retl
  703. - nop
  704. -END(__vfork)
  705. -
  706. -weak_alias (__vfork, vfork)
  707. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch
  708. index 71df986..7c2505f 100644
  709. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch
  710. +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch
  711. @@ -5,7 +5,7 @@
  712. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  713. #
  714. -libpthread_linux_arch_SSRC = pt-vfork.S clone.S pthread_once.S \
  715. +libpthread_linux_arch_SSRC = clone.S pthread_once.S \
  716. lowlevellock.S pthread_barrier_wait.S pthread_cond_signal.S pthread_cond_broadcast.S \
  717. sem_post.S sem_timedwait.S lowlevelrobustlock.S \
  718. sem_trywait.S sem_wait.S pthread_rwlock_rdlock.S pthread_rwlock_wrlock.S \
  719. @@ -21,7 +21,6 @@ librt_linux_arch_SSRC = librt-cancellation.S
  720. ASFLAGS += -DUSE___THREAD
  721. CFLAGS-pt-__syscall_error.c = -DNOT_IN_libc -DIS_IN_libpthread
  722. -ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  723. ASFLAGS-lowlevellock.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  724. ASFLAGS-pthread_once.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  725. ASFLAGS-cancellation.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
  726. diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S
  727. deleted file mode 100644
  728. index 08a085c..0000000
  729. --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S
  730. +++ /dev/null
  731. @@ -1,32 +0,0 @@
  732. -/* Copyright (C) 2004 Free Software Foundation, Inc.
  733. - This file is part of the GNU C Library.
  734. -
  735. - The GNU C Library is free software; you can redistribute it and/or
  736. - modify it under the terms of the GNU Lesser General Public
  737. - License as published by the Free Software Foundation; either
  738. - version 2.1 of the License, or (at your option) any later version.
  739. -
  740. - The GNU C Library is distributed in the hope that it will be useful,
  741. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  742. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  743. - Lesser General Public License for more details.
  744. -
  745. - You should have received a copy of the GNU Lesser General Public
  746. - License along with the GNU C Library; if not, see
  747. - <http://www.gnu.org/licenses/>. */
  748. -
  749. -#include <tcb-offsets.h>
  750. -
  751. -#define SAVE_PID \
  752. - movl %fs:PID, %esi; \
  753. - movl %esi, %edx; \
  754. - negl %edx; \
  755. - movl %edx, %fs:PID
  756. -
  757. -#define RESTORE_PID \
  758. - testq %rax, %rax; \
  759. - je 1f; \
  760. - movl %esi, %fs:PID; \
  761. -1:
  762. -
  763. -#include <../../../../../../../libc/sysdeps/linux/x86_64/vfork.S>
  764. --
  765. 1.8.5.2 (Apple Git-48)