[v2] nptl: remove duplicate vfork() in libpthread

Submitted by Waldemar Brodkorb on Sept. 8, 2014, 4:44 p.m.

Details

Message ID 20140908164453.GA21256@waldemar-brodkorb.de
State New
Headers show

Commit Message

Waldemar Brodkorb Sept. 8, 2014, 4:44 p.m.
Automatic patching via two oneliners by Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>:
sed -i -e 's/[[:space:]]pt-vfork\.[csS]//' -e '/^ASFLAGS-pt-vfork\./d' $(git grep -l pt-vfork libpthread/nptl/sysdeps)
find libpthread/nptl -name "*pt-vfork*" -exec git rm {} \;

Reported-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

---
Changes in v2:
 * removed ASFLAGS suggested by Eugene Rudoy <gene.devel@gmail.com>

---
 .../nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S  | 42 --------------
 .../nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S    |  7 ---
 .../nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S    | 37 ------------
 .../sysdeps/unix/sysv/linux/i386/Makefile.arch     |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S   | 67 ----------------------
 .../sysdeps/unix/sysv/linux/metag/Makefile.arch    |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S  | 51 ----------------
 .../sysdeps/unix/sysv/linux/mips/Makefile.arch     |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S   | 37 ------------
 .../sysdeps/unix/sysv/linux/powerpc/Makefile.arch  |  3 +-
 .../unix/sysv/linux/powerpc/powerpc32/pt-vfork.S   | 48 ----------------
 .../unix/sysv/linux/powerpc/powerpc64/pt-vfork.S   | 48 ----------------
 .../sysdeps/unix/sysv/linux/powerpc/pt-vfork.S     |  5 --
 .../nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch  |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S     | 64 ---------------------
 .../sysdeps/unix/sysv/linux/sparc/Makefile.arch    |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S  | 44 --------------
 .../sysdeps/unix/sysv/linux/x86_64/Makefile.arch   |  3 +-
 .../nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S | 32 -----------
 21 files changed, 9 insertions(+), 500 deletions(-)
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
 delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S

Comments

Yann E. MORIN Nov. 16, 2014, 10 a.m.
All,

On 2014-09-08 18:44 +0200, Waldemar Brodkorb spake thusly:
> Automatic patching via two oneliners by Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>:
> sed -i -e 's/[[:space:]]pt-vfork\.[csS]//' -e '/^ASFLAGS-pt-vfork\./d' $(git grep -l pt-vfork libpthread/nptl/sysdeps)
> find libpthread/nptl -name "*pt-vfork*" -exec git rm {} \;
> 
> Reported-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

Ping?

This indeed fixes the problem seen by Thomas, and we already cary that
patch in Buildroot.

But if this does not get applied, it means toolchains built by other
means will continue to be broken.

Regards,
Yann E. MORIN.
Alexey Brodkin July 22, 2015, 3:05 p.m.
Hi Bernard,

On Mon, 2014-09-08 at 18:44 +0200, Waldemar Brodkorb wrote:
> Automatic patching via two oneliners by Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>:
> sed -i -e 's/[[:space:]]pt-vfork\.[csS]//' -e '/^ASFLAGS-pt-vfork\./d' $(git grep -l pt-vfork libpthread/nptl/sysdeps)
> find libpthread/nptl -name "*pt-vfork*" -exec git rm {} \;
> 
> Reported-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> 
> ---
> Changes in v2:
>  * removed ASFLAGS suggested by Eugene Rudoy <gene.devel@gmail.com>
> 
> ---
>  .../nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S  | 42 --------------
>  .../nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch |  3 +-
>  .../nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S    |  7 ---
>  .../nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch |  3 +-
>  .../nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S    | 37 ------------
>  .../sysdeps/unix/sysv/linux/i386/Makefile.arch     |  3 +-
>  .../nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S   | 67 ----------------------
>  .../sysdeps/unix/sysv/linux/metag/Makefile.arch    |  3 +-
>  .../nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S  | 51 ----------------
>  .../sysdeps/unix/sysv/linux/mips/Makefile.arch     |  3 +-
>  .../nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S   | 37 ------------
>  .../sysdeps/unix/sysv/linux/powerpc/Makefile.arch  |  3 +-
>  .../unix/sysv/linux/powerpc/powerpc32/pt-vfork.S   | 48 ----------------
>  .../unix/sysv/linux/powerpc/powerpc64/pt-vfork.S   | 48 ----------------
>  .../sysdeps/unix/sysv/linux/powerpc/pt-vfork.S     |  5 --
>  .../nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch  |  3 +-
>  .../nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S     | 64 ---------------------
>  .../sysdeps/unix/sysv/linux/sparc/Makefile.arch    |  3 +-
>  .../nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S  | 44 --------------
>  .../sysdeps/unix/sysv/linux/x86_64/Makefile.arch   |  3 +-
>  .../nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S | 32 -----------
>  21 files changed, 9 insertions(+), 500 deletions(-)
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
>  delete mode 100644 libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S

This patch indeed fixes problems with duplicate vfork in both libc and libpthread.
I'm wondering if there's a chance for this patch to be applied still?

Fortunately it applies cleanly on top of current master still.

-Alexey
aldot July 24, 2015, 6:26 a.m.
On July 22, 2015 5:05:34 PM GMT+02:00, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
>Hi Bernard,

>This patch indeed fixes problems with duplicate vfork in both libc and
>libpthread.
>I'm wondering if there's a chance for this patch to be applied still?

Well, but it's wrong, isn't it. pt-vfork.o should instead live in, say,  libpthread_nonshared.a and be at the end of the libs so it is picked up by the linker when static linking, no?

Thanks,
Vineet Gupta July 24, 2015, 7:17 a.m.
On Friday 24 July 2015 09:26 AM, Bernhard Reutner-Fischer wrote:
> On July 22, 2015 5:05:34 PM GMT+02:00, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
>> >Hi Bernard,
>> >This patch indeed fixes problems with duplicate vfork in both libc and
>> >libpthread.
>> >I'm wondering if there's a chance for this patch to be applied still?
> Well, but it's wrong, isn't it. 

Is it ? It makes pthread also use the libc version. The only difference between
them was pthread version had a small optimization which could be done away
altogether with if u read thru the tread below.

https://sourceware.org/ml/libc-alpha/2014-05/msg00238.html

> pt-vfork.o should instead live in, say,  libpthread_nonshared.a and be at the end of the libs so it is picked up by the linker when static linking, no?

Could be done that way too but not needed if above is sufficient.

-Vineet
aldot July 30, 2015, 6:53 p.m.
On July 24, 2015 9:17:27 AM GMT+02:00, Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote:
>On Friday 24 July 2015 09:26 AM, Bernhard Reutner-Fischer wrote:
>> On July 22, 2015 5:05:34 PM GMT+02:00, Alexey Brodkin
><Alexey.Brodkin@synopsys.com> wrote:
>>> >Hi Bernard,
>>> >This patch indeed fixes problems with duplicate vfork in both libc
>and
>>> >libpthread.
>>> >I'm wondering if there's a chance for this patch to be applied
>still?
>> Well, but it's wrong, isn't it. 
>
>Is it ? It makes pthread also use the libc version. The only difference
>between
>them was pthread version had a small optimization which could be done
>away
>altogether with if u read thru the tread below.
>
>https://sourceware.org/ml/libc-alpha/2014-05/msg00238.html
>
>> pt-vfork.o should instead live in, say,  libpthread_nonshared.a and
>be at the end of the libs so it is picked up by the linker when static
>linking, no?
>
>Could be done that way too but not needed if above is sufficient.

Above makes RESET_PID superfluous, doesn't it.

Care to send an updated patch?
Thanks,
>
>-Vineet
Vineet Gupta Aug. 4, 2015, 8:42 a.m.
On Friday 31 July 2015 12:23 AM, Bernhard Reutner-Fischer wrote:
> On July 24, 2015 9:17:27 AM GMT+02:00, Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote:
>> On Friday 24 July 2015 09:26 AM, Bernhard Reutner-Fischer wrote:
>>> On July 22, 2015 5:05:34 PM GMT+02:00, Alexey Brodkin
>> <Alexey.Brodkin@synopsys.com> wrote:
>>>>> Hi Bernard,
>>>>> This patch indeed fixes problems with duplicate vfork in both libc
>> and
>>>>> libpthread.
>>>>> I'm wondering if there's a chance for this patch to be applied
>> still?
>>> Well, but it's wrong, isn't it. 
>> Is it ? It makes pthread also use the libc version. The only difference
>> between
>> them was pthread version had a small optimization which could be done
>> away
>> altogether with if u read thru the tread below.
>>
>> https://sourceware.org/ml/libc-alpha/2014-05/msg00238.html
>>
>>> pt-vfork.o should instead live in, say,  libpthread_nonshared.a and
>> be at the end of the libs so it is picked up by the linker when static
>> linking, no?
>>
>> Could be done that way too but not needed if above is sufficient.
> Above makes RESET_PID superfluous, doesn't it.

RESET_PID applies to clone; while{SAVE,RESTORE}_PID apply to vfork. I presume u
meant latter ? Perhaps clone can be tweaked too - but thats for another patch !

Assuming above is correct, you want those macros to be removed from
nptl/*/**/vfork.S as well as libc/sysdeps/linux/*/vfork.S and preferably replace
with a comment in case of latter set of files.

Can this be done in 2 steps, so the first patch from Waldemar be applied as it is
and then we do the cleanup to remove _PID from all the files (or is it too much
churn cross arches)

After this, it would be even better if we get rid of the vfork files in NPTL as it
is confusing at best (as file building for libc resides in thread library). Why
not build libc/sysdeps/linux/*/vfork.S in place for libc. But you are better off
doing such project wide tweaks than us mere mortals.

Thx,
-Vineet

> Care to send an updated patch?
> Thanks,
Vineet Gupta Sept. 16, 2015, 10:09 p.m.
Hi Bernhard,


On Tuesday 04 August 2015 01:42 AM, Vineet Gupta wrote:
> On Friday 31 July 2015 12:23 AM, Bernhard Reutner-Fischer wrote:
>> On July 24, 2015 9:17:27 AM GMT+02:00, Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote:
>>> On Friday 24 July 2015 09:26 AM, Bernhard Reutner-Fischer wrote:
>>>> On July 22, 2015 5:05:34 PM GMT+02:00, Alexey Brodkin
>>> <Alexey.Brodkin@synopsys.com> wrote:
>>>>>> Hi Bernard,
>>>>>> This patch indeed fixes problems with duplicate vfork in both libc
>>> and
>>>>>> libpthread.
>>>>>> I'm wondering if there's a chance for this patch to be applied
>>> still?
>>>> Well, but it's wrong, isn't it. 
>>> Is it ? It makes pthread also use the libc version. The only difference
>>> between
>>> them was pthread version had a small optimization which could be done
>>> away
>>> altogether with if u read thru the tread below.
>>>
>>> https://sourceware.org/ml/libc-alpha/2014-05/msg00238.html
>>>
>>>> pt-vfork.o should instead live in, say,  libpthread_nonshared.a and
>>> be at the end of the libs so it is picked up by the linker when static
>>> linking, no?
>>>
>>> Could be done that way too but not needed if above is sufficient.
>> Above makes RESET_PID superfluous, doesn't it.
> 
> RESET_PID applies to clone; while{SAVE,RESTORE}_PID apply to vfork. I presume u
> meant latter ? Perhaps clone can be tweaked too - but thats for another patch !
> 
> Assuming above is correct, you want those macros to be removed from
> nptl/*/**/vfork.S as well as libc/sysdeps/linux/*/vfork.S and preferably replace
> with a comment in case of latter set of files.
> 
> Can this be done in 2 steps, so the first patch from Waldemar be applied as it is
> and then we do the cleanup to remove _PID from all the files (or is it too much
> churn cross arches)
> 
> After this, it would be even better if we get rid of the vfork files in NPTL as it
> is confusing at best (as file building for libc resides in thread library). Why
> not build libc/sysdeps/linux/*/vfork.S in place for libc. But you are better off
> doing such project wide tweaks than us mere mortals.
> 
> Thx,
> -Vineet
> 

What do u think abt this ?

-Vineet
aldot Sept. 17, 2015, 7:35 a.m.
On September 17, 2015 12:09:17 AM GMT+02:00, Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote:
>Hi Bernhard,
>
>
>On Tuesday 04 August 2015 01:42 AM, Vineet Gupta wrote:
>> On Friday 31 July 2015 12:23 AM, Bernhard Reutner-Fischer wrote:
>>> On July 24, 2015 9:17:27 AM GMT+02:00, Vineet Gupta
><Vineet.Gupta1@synopsys.com> wrote:
>>>> On Friday 24 July 2015 09:26 AM, Bernhard Reutner-Fischer wrote:
>>>>> On July 22, 2015 5:05:34 PM GMT+02:00, Alexey Brodkin
>>>> <Alexey.Brodkin@synopsys.com> wrote:
>>>>>>> Hi Bernard,
>>>>>>> This patch indeed fixes problems with duplicate vfork in both
>libc
>>>> and
>>>>>>> libpthread.
>>>>>>> I'm wondering if there's a chance for this patch to be applied
>>>> still?
>>>>> Well, but it's wrong, isn't it. 
>>>> Is it ? It makes pthread also use the libc version. The only
>difference
>>>> between
>>>> them was pthread version had a small optimization which could be
>done
>>>> away
>>>> altogether with if u read thru the tread below.
>>>>
>>>> https://sourceware.org/ml/libc-alpha/2014-05/msg00238.html
>>>>
>>>>> pt-vfork.o should instead live in, say,  libpthread_nonshared.a
>and
>>>> be at the end of the libs so it is picked up by the linker when
>static
>>>> linking, no?
>>>>
>>>> Could be done that way too but not needed if above is sufficient.
>>> Above makes RESET_PID superfluous, doesn't it.
>> 
>> RESET_PID applies to clone; while{SAVE,RESTORE}_PID apply to vfork. I
>presume u
>> meant latter ? Perhaps clone can be tweaked too - but thats for
>another patch !
>> 
>> Assuming above is correct, you want those macros to be removed from
>> nptl/*/**/vfork.S as well as libc/sysdeps/linux/*/vfork.S and
>preferably replace
>> with a comment in case of latter set of files.
>> 
>> Can this be done in 2 steps, so the first patch from Waldemar be
>applied as it is
>> and then we do the cleanup to remove _PID from all the files (or is
>it too much
>> churn cross arches)

2-step is fine for me too, as you prefer.

>> 
>> After this, it would be even better if we get rid of the vfork files
>in NPTL as it
>> is confusing at best (as file building for libc resides in thread
>library). Why

Yes, the only reason was the PID handling, AFAIR.
Thanks,
Vineet Gupta Sept. 21, 2015, 3:58 a.m.
On Thursday 17 September 2015 01:05 PM, Bernhard Reutner-Fischer wrote:
> On September 17, 2015 12:09:17 AM GMT+02:00, Vineet Gupta <Vineet.Gupta1@synopsys.com> wrote:
>> Hi Bernhard,
>>
>>
>> On Tuesday 04 August 2015 01:42 AM, Vineet Gupta wrote:
>>> On Friday 31 July 2015 12:23 AM, Bernhard Reutner-Fischer wrote:
>>>> On July 24, 2015 9:17:27 AM GMT+02:00, Vineet Gupta
>> <Vineet.Gupta1@synopsys.com> wrote:
>>>>> On Friday 24 July 2015 09:26 AM, Bernhard Reutner-Fischer wrote:
>>>>>> On July 22, 2015 5:05:34 PM GMT+02:00, Alexey Brodkin
>>>>> <Alexey.Brodkin@synopsys.com> wrote:
>>>>>>>> Hi Bernard,
>>>>>>>> This patch indeed fixes problems with duplicate vfork in both
>> libc
>>>>> and
>>>>>>>> libpthread.
>>>>>>>> I'm wondering if there's a chance for this patch to be applied
>>>>> still?
>>>>>> Well, but it's wrong, isn't it. 
>>>>> Is it ? It makes pthread also use the libc version. The only
>> difference
>>>>> between
>>>>> them was pthread version had a small optimization which could be
>> done
>>>>> away
>>>>> altogether with if u read thru the tread below.
>>>>>
>>>>> https://sourceware.org/ml/libc-alpha/2014-05/msg00238.html
>>>>>
>>>>>> pt-vfork.o should instead live in, say,  libpthread_nonshared.a
>> and
>>>>> be at the end of the libs so it is picked up by the linker when
>> static
>>>>> linking, no?
>>>>>
>>>>> Could be done that way too but not needed if above is sufficient.
>>>> Above makes RESET_PID superfluous, doesn't it.
>>>
>>> RESET_PID applies to clone; while{SAVE,RESTORE}_PID apply to vfork. I
>> presume u
>>> meant latter ? Perhaps clone can be tweaked too - but thats for
>> another patch !
>>>
>>> Assuming above is correct, you want those macros to be removed from
>>> nptl/*/**/vfork.S as well as libc/sysdeps/linux/*/vfork.S and
>> preferably replace
>>> with a comment in case of latter set of files.
>>>
>>> Can this be done in 2 steps, so the first patch from Waldemar be
>> applied as it is
>>> and then we do the cleanup to remove _PID from all the files (or is
>> it too much
>>> churn cross arches)
> 
> 2-step is fine for me too, as you prefer.

Waldermar's patch below while still valid, doesn't apply cleanly due to conflict
in a line(s) nuked already by your cleanup patch. Care to apply below with manual
fixups.
http://lists.uclibc.org/pipermail/uclibc/2014-September/048613.html


Regarding removing _PID stuff - I took a stab at it - so we inline the code
corresponding to {SAVE,RESTORE}_PID macros, however then it won't be valid/build
for LT.old - since tls.h / tcb_offset.h are not present there.

-Vineet
Vineet Gupta Oct. 20, 2015, 8:10 a.m.
On Monday 21 September 2015 09:28 AM, Vineet Gupta wrote:
>>>> >>> Assuming above is correct, you want those macros to be removed from
>>>> >>> nptl/*/**/vfork.S as well as libc/sysdeps/linux/*/vfork.S and
>>> >> preferably replace
>>>> >>> with a comment in case of latter set of files.
>>>> >>>
>>>> >>> Can this be done in 2 steps, so the first patch from Waldemar be
>>> >> applied as it is
>>>> >>> and then we do the cleanup to remove _PID from all the files (or is
>>> >> it too much
>>>> >>> churn cross arches)
>> > 
>> > 2-step is fine for me too, as you prefer.
> Waldermar's patch below while still valid, doesn't apply cleanly due to conflict
> in a line(s) nuked already by your cleanup patch. Care to apply below with manual
> fixups.
> http://lists.uclibc.org/pipermail/uclibc/2014-September/048613.html
> 
> 
> Regarding removing _PID stuff - I took a stab at it - so we inline the code
> corresponding to {SAVE,RESTORE}_PID macros, however then it won't be valid/build
> for LT.old - since tls.h / tcb_offset.h are not present there.
> 
> -Vineet


Ping !
Vineet Gupta Dec. 23, 2015, 12:33 p.m.
On Tuesday 20 October 2015 01:40 PM, Vineet Gupta wrote:
> On Monday 21 September 2015 09:28 AM, Vineet Gupta wrote:
>>>>>>>> Assuming above is correct, you want those macros to be removed from
>>>>>>>> nptl/*/**/vfork.S as well as libc/sysdeps/linux/*/vfork.S and
>>>>>> preferably replace
>>>>>>>> with a comment in case of latter set of files.
>>>>>>>>
>>>>>>>> Can this be done in 2 steps, so the first patch from Waldemar be
>>>>>> applied as it is
>>>>>>>> and then we do the cleanup to remove _PID from all the files (or is
>>>>>> it too much
>>>>>>>> churn cross arches)
>>>>
>>>> 2-step is fine for me too, as you prefer.
>> Waldermar's patch below while still valid, doesn't apply cleanly due to conflict
>> in a line(s) nuked already by your cleanup patch. Care to apply below with manual
>> fixups.
>> http://lists.uclibc.org/pipermail/uclibc/2014-September/048613.html
>>
>>
>> Regarding removing _PID stuff - I took a stab at it - so we inline the code
>> corresponding to {SAVE,RESTORE}_PID macros, however then it won't be valid/build
>> for LT.old - since tls.h / tcb_offset.h are not present there.
>>
>> -Vineet
> 
> 
> Ping !
> 

Ping !

Patch hide | download patch | download mbox

diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
deleted file mode 100644
index a6005c1..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/pt-vfork.S
+++ /dev/null
@@ -1,42 +0,0 @@ 
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   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/>.  */
-
-#include <sysdep.h>
-#include <tcb-offsets.h>
-
-#undef PSEUDO_PREPARE_ARGS
-#define PSEUDO_PREPARE_ARGS						\
-	/* Load the current cached pid value across the vfork.  */	\
-	rduniq;								\
-	ldl	a2, PID_OFFSET(v0);					\
-	mov	v0, a1;							\
-	/* Write back its negation, to indicate that the pid value is	\
-	   uninitialized in the the child, and in the window between	\
-	   here and the point at which we restore the value.  */	\
-	negl	a2, t0;							\
-	stl	t0, PID_OFFSET(v0);
-
-PSEUDO (__vfork, vfork, 0)
-
-	/* If we're back in the parent, restore the saved pid.  */
-	beq	v0, 1f
-	stl	a2, PID_OFFSET(a1)
-1:	ret
-
-PSEUDO_END (__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch
index 25e6fad..658aa6c 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/Makefile.arch
@@ -5,7 +5,7 @@ 
 # Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
 #
 
-libpthread_linux_arch_SSRC = pt-vfork.S
+libpthread_linux_arch_SSRC =
 libpthread_linux_arch_CSRC = pthread_once.c lowlevellock.c \
 	pt-__syscall_rt_sigaction.c pt-__syscall_error.c
 
@@ -17,7 +17,6 @@  CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pt-__syscall_rt_sigaction.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pt-__syscall_error.c =  -DNOT_IN_libc -DIS_IN_libpthread
-ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread
 
 ASFLAGS-vfork.S = -DIS_IN_libc -DNOT_IN_libpthread
 ASFLAGS-clone.S = -DIS_IN_libc -DNOT_IN_libpthread
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S
deleted file mode 100644
index f222dca..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/pt-vfork.S
+++ /dev/null
@@ -1,7 +0,0 @@ 
-/*
- * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
- *
- * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
- */
-
-#include "vfork.S"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
index 329d8a9..6f05b7d 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
@@ -5,7 +5,7 @@ 
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-libpthread_linux_arch_SSRC = pt-vfork.S
+libpthread_linux_arch_SSRC =
 libpthread_linux_arch_CSRC = pthread_once.c \
 	pt-__syscall_rt_sigaction.c pt-__syscall_error.c \
 	lowlevellock.c
@@ -19,7 +19,6 @@  CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pt-__syscall_rt_sigaction.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pt-__syscall_error.c =  -DNOT_IN_libc -DIS_IN_libpthread
-ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -marm
 
 ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y)
 CFLAGS-fork.c = -D__USE_STDIO_FUTEXES__
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S
deleted file mode 100644
index df18f03..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/pt-vfork.S
+++ /dev/null
@@ -1,37 +0,0 @@ 
-/* Copyright (C) 2005 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   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/>.  */
-
-#include <tcb-offsets.h>
-
-/* Save the PID value.  */
-#define SAVE_PID \
-	str	lr, [sp, #-4]!;		/* Save LR.  */			\
-	mov	r0, #0xffff0fff;	/* Point to the high page.  */	\
-	mov	lr, pc;			/* Save our return address.  */	\
-	sub	pc, r0, #31;		/* Jump to the TLS entry.  */	\
-	ldr	lr, [sp], #4;		/* Restore LR.  */		\
-	mov	r2, r0;			/* Save the TLS addr in r2.  */	\
-	ldr	r3, [r2, #PID_OFFSET];	/* Load the saved PID.  */	\
-	rsb	r0, r3, #0;		/* Negate it.  */		\
-	str	r0, [r2, #PID_OFFSET]	/* Store the temporary PID.  */
-
-/* Restore the old PID value in the parent.  */
-#define RESTORE_PID \
-	cmp	r0, #0;			/* If we are the parent... */	\
-	strne	r3, [r2, #PID_OFFSET]	/* ... restore the saved PID.  */
-
-#include "../../../../../../../libc/sysdeps/linux/arm/vfork.S"
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch
index 9a34595..94fc03a 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch
@@ -5,7 +5,7 @@ 
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-libpthread_linux_arch_SSRC = pt-vfork.S clone.S pthread_spin_unlock.S pthread_once.S
+libpthread_linux_arch_SSRC = clone.S pthread_spin_unlock.S pthread_once.S
 libpthread_linux_arch_CSRC = pthread_spin_init.c pt-__syscall_error.c
 
 libc_linux_arch_CSRC = fork.c
@@ -14,7 +14,6 @@  libc_linux_arch_SSRC = clone.S vfork.S
 ASFLAGS += -DUSE___THREAD
 
 CFLAGS-pt-__syscall_error.c =  -DNOT_IN_libc -DIS_IN_libpthread
-ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 ASFLAGS-lowlevellock.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 ASFLAGS-lowlevelrobustlock.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 ASFLAGS-pthread_once.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S
deleted file mode 100644
index 5bba782..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/pt-vfork.S
+++ /dev/null
@@ -1,67 +0,0 @@ 
-/* Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Andreas Schwab <schwab@gnu.org>.
-
-   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/>.  */
-
-#include <sysdep.h>
-#define _ERRNO_H	1
-#include <bits/errno.h>
-#include <bits/kernel-features.h>
-#include <tcb-offsets.h>
-
-/* Save the PID value.  */
-#define SAVE_PID \
-	movl	%gs:PID, %edx; 						      \
-	movl	%edx, %eax;						      \
-	negl	%eax;							      \
-	movl	%eax, %gs:PID
-
-/* Restore the old PID value in the parent.  */
-#define RESTORE_PID \
-	testl	%eax, %eax;						      \
-	je	1f;							      \
-	movl	%edx, %gs:PID;						      \
-1:
-
-/* Clone the calling process, but without copying the whole address space.
-   The calling process is suspended until the new process exits or is
-   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
-   and the process ID of the new process to the old process.  */
-
-ENTRY (__vfork)
-	/* Pop the return PC value into ECX.  */
-	popl	%ecx
-
-	SAVE_PID
-
-	/* Stuff the syscall number in EAX and enter into the kernel.  */
-	movl	$SYS_ify (vfork), %eax
-	int	$0x80
-
-	RESTORE_PID
-
-	/* Jump to the return PC.  Don't jump directly since this
-	   disturbs the branch target cache.  Instead push the return
-	   address back on the stack.  */
-	pushl	%ecx
-
-	cmpl	$-4095, %eax
-	jae	SYSCALL_ERROR_LABEL	/* Branch forward if it failed.  */
-L(pseudo_end):
-	ret
-PSEUDO_END (__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/metag/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/metag/Makefile.arch
index df98875..99dec6b 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/metag/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/metag/Makefile.arch
@@ -5,7 +5,7 @@ 
 # Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
 #
 
-libpthread_linux_arch_SSRC = pt-vfork.S
+libpthread_linux_arch_SSRC =
 libpthread_linux_arch_CSRC = pthread_once.c \
 	pt-__syscall_rt_sigaction.c pt-__syscall_error.c \
 	lowlevellock.c
@@ -22,7 +22,6 @@  CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pt-__syscall_error.c =  -DNOT_IN_libc -DIS_IN_libpthread
 ASFLAGS-vfork.S = -DIS_IN_libc -DNOT_IN_libpthread
 ASFLAGS-clone.S = -DIS_IN_libc -DNOT_IN_libpthread
-ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread
 
 ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y)
 CFLAGS-fork.c = -D__USE_STDIO_FUTEXES__
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
deleted file mode 100644
index 489c749..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
+++ /dev/null
@@ -1,51 +0,0 @@ 
-/* Copyright (C) 2005 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <tcb-offsets.h>
-#include <asm/unistd.h>
-
-#ifdef __PIC__
-#define __VFORK_METAG_LOAD_TP ___metag_load_tp@PLT
-#else
-#define __VFORK_METAG_LOAD_TP ___metag_load_tp
-#endif
-
-/* Save the PID value.  */
-#define SAVE_PID \
-	SETL	[A0StP++], D0FrT, D1RtP; \
-	CALLR	D1RtP, __VFORK_METAG_LOAD_TP; \
-	SUB	D0Re0, D0Re0, #TLS_PRE_TCB_SIZE; \
-	GETD	D0FrT, [D0Re0 + #PID]; \
-	NEG	D0FrT, D0FrT; \
-	SETD	[D0Re0 + #PID], D0FrT; \
-	GETL	D0FrT, D1RtP, [--A0StP];
-
-#define RESTORE_PID \
-	CMP 	D0Re0, #0; \
-	BEQ	1f; \
-	MSETL	[A0StP++], D0Re0, D0FrT; \
-	CALLR	D1RtP, __VFORK_METAG_LOAD_TP; \
-	SUB	D0Re0, D0Re0, #TLS_PRE_TCB_SIZE; \
-	GETD	D0FrT, [D0Re0 + #PID]; \
-	NEG	D0FrT, D0FrT; \
-	SETD	[D0Re0 + #PID], D0FrT; \
-	GETL	D0FrT, D1RtP, [--A0StP]; \
-	GETL	D0Re0, D1Re0, [--A0StP]; \
-1:
-
-#include <../../../../../../../libc/sysdeps/linux/metag/vfork.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch
index fc26a8e..a453b6b 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch
@@ -5,7 +5,7 @@ 
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-libpthread_linux_arch_SSRC = pt-vfork.S clone.S
+libpthread_linux_arch_SSRC = clone.S
 libpthread_linux_arch_CSRC = pthread_once.c pt-__syscall_rt_sigaction.c
 
 libc_linux_arch_CSRC = fork.c
@@ -21,7 +21,6 @@  CFLAGS-fork.c = -D__USE_STDIO_FUTEXES__
 endif
 CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pt-__syscall_rt_sigaction.c = -DNOT_IN_libc -DIS_IN_libpthread
-ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread
 
 ASFLAGS-clone.S = -D_LIBC_REENTRANT
 ASFLAGS-vfork.S = -D_LIBC_REENTRANT
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
deleted file mode 100644
index 52fbde3..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pt-vfork.S
+++ /dev/null
@@ -1,37 +0,0 @@ 
-/* Copyright (C) 2005 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   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/>.  */
-
-#include <features.h>
-#include <tls.h>
-
-/* Save the PID value.  */
-#define SAVE_PID \
-	READ_THREAD_POINTER(v1);	/* Get the thread pointer.  */	\
-	lw	a2, PID_OFFSET(v1);	/* Load the saved PID.  */	\
-	subu	a2, $0, a2;		/* Negate it.  */		\
-	sw	a2, PID_OFFSET(v1);	/* Store the temporary PID.  */
-
-/* Restore the old PID value in the parent.  */
-#define RESTORE_PID \
-	beqz	v0, 1f;			/* If we are the parent... */	\
-	READ_THREAD_POINTER(v1);	/* Get the thread pointer.  */	\
-	lw	a2, PID_OFFSET(v1);	/* Load the saved PID.  */	\
-	subu	a2, $0, a2;		/* Re-negate it.  */		\
-	sw	a2, PID_OFFSET(v1);	/* Restore the PID.  */		\
-1:
-
-#include <../../../../../../../libc/sysdeps/linux/mips/vfork.S>
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch
index 8581aea..215c2aa 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch
@@ -5,7 +5,7 @@ 
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-libpthread_linux_arch_SSRC = pt-vfork.S
+libpthread_linux_arch_SSRC =
 libpthread_linux_arch_CSRC = pthread_once.c pt-__syscall_error.c
 
 libc_linux_arch_CSRC = fork.c
@@ -19,7 +19,6 @@  ASFLAGS += -DUSE___THREAD
 CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pt-__syscall_error.c =  -DNOT_IN_libc -DIS_IN_libpthread
-ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 #ASFLAGS-lowlevellock.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 
 #ASFLAGS-libc-lowlevellock.S = -D_LIBC_REENTRANT
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
deleted file mode 100644
index 2f82504..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/pt-vfork.S
+++ /dev/null
@@ -1,48 +0,0 @@ 
-/* Copyright (C) 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
-
-   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/>.  */
-
-#include <sysdep.h>
-#define _ERRNO_H	1
-#include <bits/errno.h>
-#include <bits/kernel-features.h>
-#include <tcb-offsets.h>
-
-/* Clone the calling process, but without copying the whole address space.
-   The calling process is suspended until the new process exits or is
-   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
-   and the process ID of the new process to the old process.  */
-
-ENTRY (__vfork)
-	lwz	0,PID(2)
-	neg	0,0
-	stw	0,PID(2)
-
-	DO_CALL (SYS_ify (vfork))
-
-	cmpwi	1,3,0
-	beqlr-	1
-
-	lwz	0,PID(2)
-	neg	0,0
-	stw	0,PID(2)
-
-	PSEUDO_RET
-
-PSEUDO_END (__vfork)
-
-weak_alias (__vfork, vfork)
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
deleted file mode 100644
index 12e47b3..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/powerpc64/pt-vfork.S
+++ /dev/null
@@ -1,48 +0,0 @@ 
-/* Copyright (C) 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
-
-   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/>.  */
-
-#include <sysdep.h>
-#define _ERRNO_H	1
-#include <bits/errno.h>
-#include <bits/kernel-features.h>
-#include <tcb-offsets.h>
-
-/* Clone the calling process, but without copying the whole address space.
-   The calling process is suspended until the new process exits or is
-   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
-   and the process ID of the new process to the old process.  */
-
-ENTRY (__vfork)
-	lwz	0,PID(13)
-	neg	0,0
-	stw	0,PID(13)
-
-	DO_CALL (SYS_ify (vfork))
-
-	cmpwi	1,3,0
-	beqlr-	1
-
-	lwz	0,PID(13)
-	neg	0,0
-	stw	0,PID(13)
-
-	PSEUDO_RET
-
-PSEUDO_END (__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S
deleted file mode 100644
index 0225219..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-vfork.S
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#if defined __powerpc64__
-# include "powerpc64/pt-vfork.S"
-#else
-# include "powerpc32/pt-vfork.S"
-#endif
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch
index a8249e0..9ebbda5 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch
@@ -5,7 +5,7 @@ 
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-libpthread_linux_arch_SSRC = pt-vfork.S pthread_once.S pthread_rwlock_wrlock.S \
+libpthread_linux_arch_SSRC = pthread_once.S pthread_rwlock_wrlock.S \
 			pthread_rwlock_rdlock.S pthread_rwlock_unlock.S \
 			lowlevellock.S lowlevelrobustlock.S pthread_barrier_wait.S \
 			pthread_cond_broadcast.S pthread_cond_signal.S \
@@ -17,7 +17,6 @@  libc_linux_arch_SSRC = libc-lowlevellock.S clone.S vfork.S
 
 ASFLAGS += -DUSE___THREAD
 
-ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 ASFLAGS-pthread_once.S = -D_LIBC_REENTRANT
 ASFLAGS-pthread_rwlock_wrlock.S = -D_LIBC_REENTRANT
 ASFLAGS-pthread_rwlock_rdlock.S = -D_LIBC_REENTRANT
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S
deleted file mode 100644
index 56aa6d0..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pt-vfork.S
+++ /dev/null
@@ -1,64 +0,0 @@ 
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   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/>.  */
-
-#include <sysdep.h>
-#define _ERRNO_H	1
-#include <bits/errno.h>
-#include <tcb-offsets.h>
-
-/* Clone the calling process, but without copying the whole address space.
-   The calling process is suspended until the new process exits or is
-   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
-   and the process ID of the new process to the old process.  */
-
-ENTRY (__vfork)
-	/* Save the PID value.  */
-	stc	gbr, r2
-	mov.w	.L2, r0
-	mov.l	@(r0,r2), r4
-	neg	r4, r1
-	mov.l	r1, @(r0,r2)
-
-	mov.w	.L1, r3
-	trapa	#0x10
-	mov     r0, r1
-
-	/* Restore the old PID value in the parent.  */
-	tst	r0, r0
-	bt/s	2f
-	 stc	gbr, r2
-	mov.w	.L2, r0
-	mov.l	r4, @(r0,r2)
-	mov	r1, r0
-2:
-	mov	#-12, r2
-	shad	r2, r1
-	not	r1, r1			// r1=0 means r0 = -1 to -4095
-	tst	r1, r1			// i.e. error in linux
-	bf	.Lpseudo_end
-	SYSCALL_ERROR_HANDLER
-.Lpseudo_end:
-	rts
-	 nop
-.L1:
-	.word	__NR_vfork
-.L2:
-	.word	PID - TLS_PRE_TCB_SIZE
-
-PSEUDO_END (__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch
index 102c0da..aedad2c 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch
@@ -5,7 +5,7 @@ 
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-libpthread_linux_arch_SSRC = pt-vfork.S clone.S
+libpthread_linux_arch_SSRC = clone.S
 libpthread_linux_arch_CSRC = pthread_once.c lowlevellock.c \
 	pthread_barrier_init.c pthread_barrier_wait.c pthread_barrier_destroy.c \
 	pt-__syscall_error.c
@@ -17,7 +17,6 @@  librt_linux_arch_CSRC = pt-__syscall_error.c
 
 ASFLAGS += -DUSE___THREAD
 
-ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pt-__syscall_error.c =  -DNOT_IN_libc -DIS_IN_libpthread
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
deleted file mode 100644
index 37231a8..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/pt-vfork.S
+++ /dev/null
@@ -1,44 +0,0 @@ 
-/* Copyright (C) 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
-
-   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/>.  */
-
-#include <sysdep.h>
-#include <tcb-offsets.h>
-
-	.text
-	.globl		__syscall_error
-ENTRY(__vfork)
-	ld	[%g7 + PID], %o5
-	sub	%g0, %o5, %o4
-	st	%o4, [%g7 + PID]
-
-	LOADSYSCALL(vfork)
-	ta	0x10
-	bcc	2f
-	 mov	%o7, %g1
-	st	%o5, [%g7 + PID]
-	call	__syscall_error
-	 mov	%g1, %o7
-2:	sub	%o1, 1, %o1
-	andcc	%o0, %o1, %o0
-	bne,a	1f
-	 st	%o5, [%g7 + PID]
-1:	retl
-	 nop
-END(__vfork)
-
-weak_alias (__vfork, vfork)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch
index 71df986..7c2505f 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch
@@ -5,7 +5,7 @@ 
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-libpthread_linux_arch_SSRC = pt-vfork.S clone.S pthread_once.S \
+libpthread_linux_arch_SSRC = clone.S pthread_once.S \
 	lowlevellock.S pthread_barrier_wait.S pthread_cond_signal.S pthread_cond_broadcast.S \
 	sem_post.S sem_timedwait.S lowlevelrobustlock.S \
 	sem_trywait.S sem_wait.S pthread_rwlock_rdlock.S pthread_rwlock_wrlock.S \
@@ -21,7 +21,6 @@  librt_linux_arch_SSRC = librt-cancellation.S
 ASFLAGS += -DUSE___THREAD
 
 CFLAGS-pt-__syscall_error.c =  -DNOT_IN_libc -DIS_IN_libpthread
-ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 ASFLAGS-lowlevellock.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 ASFLAGS-pthread_once.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 ASFLAGS-cancellation.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
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
deleted file mode 100644
index 08a085c..0000000
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/pt-vfork.S
+++ /dev/null
@@ -1,32 +0,0 @@ 
-/* Copyright (C) 2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   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/>.  */
-
-#include <tcb-offsets.h>
-
-#define SAVE_PID \
-	movl	%fs:PID, %esi;						      \
-	movl	%esi, %edx;						      \
-	negl	%edx;							      \
-	movl	%edx, %fs:PID
-
-#define RESTORE_PID \
-	testq	%rax, %rax;						      \
-	je	1f;							      \
-	movl	%esi, %fs:PID;						      \
-1:
-
-#include <../../../../../../../libc/sysdeps/linux/x86_64/vfork.S>