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

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