diff mbox

ARC: Make vfork weak in libc

Message ID 1394714318-8331-1-git-send-email-vgupta@synopsys.com
State Accepted
Commit 00b07e8ca5664985bbbbdc1d375407ac36124317
Headers show

Commit Message

Vineet Gupta March 13, 2014, 12:38 p.m. UTC
Anton reported:

------------------->8---------------------
Package iperf cannot be built in Buildroot due to following error:

/home/akolesov/env/autobuild/tmp/host/usr/bin/arc-buildroot-linux-uclibc-g++
-Wall -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-pipe -Os    --static -o iperf -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64  -pipe -Os   -pthread  -DHAVE_CONFIG_H Client.o
Extractor.o Launch.o List.o Listener.o Locale.o PerfSocket.o ReportCSV.o
ReportDefault.o Reporter.o Server.o Settings.o SocketAddr.o gnu_getopt.o
gnu_getopt_long.o main.o service.o sockets.o stdio.o tcp_window_size.o
../compat/libcompat.a
/home/akolesov/env/autobuild/tmp/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(vfork.os):
In function `vfork':
(.text+0x0): multiple definition of `vfork'
/home/akolesov/env/autobuild/tmp/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(ptfork.os):ptfork.c:(.text+0xc0):
first defined here
collect2: error: ld returned 1 exit status
------------------->8---------------------

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
Cc: Francois Bedard <Francois.Bedard@synopsys.com>
---
 libc/sysdeps/linux/arc/vfork.S | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Vineet Gupta April 1, 2014, 5:18 a.m. UTC | #1
Ping !

On Thursday 13 March 2014 06:08 PM, Vineet Gupta wrote:
> Anton reported:
> 
> ------------------->8---------------------
> Package iperf cannot be built in Buildroot due to following error:
> 
> /home/akolesov/env/autobuild/tmp/host/usr/bin/arc-buildroot-linux-uclibc-g++
> -Wall -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> -pipe -Os    --static -o iperf -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64  -pipe -Os   -pthread  -DHAVE_CONFIG_H Client.o
> Extractor.o Launch.o List.o Listener.o Locale.o PerfSocket.o ReportCSV.o
> ReportDefault.o Reporter.o Server.o Settings.o SocketAddr.o gnu_getopt.o
> gnu_getopt_long.o main.o service.o sockets.o stdio.o tcp_window_size.o
> ../compat/libcompat.a
> /home/akolesov/env/autobuild/tmp/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(vfork.os):
> In function `vfork':
> (.text+0x0): multiple definition of `vfork'
> /home/akolesov/env/autobuild/tmp/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(ptfork.os):ptfork.c:(.text+0xc0):
> first defined here
> collect2: error: ld returned 1 exit status
> ------------------->8---------------------
> 
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
> Cc: Francois Bedard <Francois.Bedard@synopsys.com>
> ---
>  libc/sysdeps/linux/arc/vfork.S | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libc/sysdeps/linux/arc/vfork.S b/libc/sysdeps/linux/arc/vfork.S
> index 542239fb8421..11959b66b34c 100644
> --- a/libc/sysdeps/linux/arc/vfork.S
> +++ b/libc/sysdeps/linux/arc/vfork.S
> @@ -15,7 +15,7 @@
>  #define CLONE_VFORK		0x00004000
>  #define CLONE_FLAGS_FOR_VFORK	(CLONE_VM|CLONE_VFORK|SIGCHLD)
>  
> -ENTRY(vfork)
> +ENTRY(__vfork)
>  	mov	r0, CLONE_FLAGS_FOR_VFORK
>  	mov_s	r1, sp
>  	mov	r8, __NR_clone
> @@ -25,5 +25,7 @@ ENTRY(vfork)
>  	jge	[blink]	; pid >=0 return, else detour via tailcall to errno
>  
>  	b   __syscall_error
> -END(vfork)
> +END(__vfork)
> +
> +weak_alias(__vfork,vfork)
>  libc_hidden_def(vfork)
>
Bernhard Reutner-Fischer April 1, 2014, 9:38 a.m. UTC | #2
On Thu, Mar 13, 2014 at 06:08:38PM +0530, Vineet Gupta wrote:
> Anton reported:
> 
> ------------------->8---------------------
> Package iperf cannot be built in Buildroot due to following error:
> 
> /home/akolesov/env/autobuild/tmp/host/usr/bin/arc-buildroot-linux-uclibc-g++
> -Wall -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> -pipe -Os    --static -o iperf -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64  -pipe -Os   -pthread  -DHAVE_CONFIG_H Client.o
> Extractor.o Launch.o List.o Listener.o Locale.o PerfSocket.o ReportCSV.o
> ReportDefault.o Reporter.o Server.o Settings.o SocketAddr.o gnu_getopt.o
> gnu_getopt_long.o main.o service.o sockets.o stdio.o tcp_window_size.o
> ../compat/libcompat.a
> /home/akolesov/env/autobuild/tmp/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(vfork.os):
> In function `vfork':
> (.text+0x0): multiple definition of `vfork'
> /home/akolesov/env/autobuild/tmp/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(ptfork.os):ptfork.c:(.text+0xc0):
> first defined here
> collect2: error: ld returned 1 exit status
> ------------------->8---------------------
> 
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
> Cc: Francois Bedard <Francois.Bedard@synopsys.com>

Applied, thanks!
diff mbox

Patch

diff --git a/libc/sysdeps/linux/arc/vfork.S b/libc/sysdeps/linux/arc/vfork.S
index 542239fb8421..11959b66b34c 100644
--- a/libc/sysdeps/linux/arc/vfork.S
+++ b/libc/sysdeps/linux/arc/vfork.S
@@ -15,7 +15,7 @@ 
 #define CLONE_VFORK		0x00004000
 #define CLONE_FLAGS_FOR_VFORK	(CLONE_VM|CLONE_VFORK|SIGCHLD)
 
-ENTRY(vfork)
+ENTRY(__vfork)
 	mov	r0, CLONE_FLAGS_FOR_VFORK
 	mov_s	r1, sp
 	mov	r8, __NR_clone
@@ -25,5 +25,7 @@  ENTRY(vfork)
 	jge	[blink]	; pid >=0 return, else detour via tailcall to errno
 
 	b   __syscall_error
-END(vfork)
+END(__vfork)
+
+weak_alias(__vfork,vfork)
 libc_hidden_def(vfork)