Subject: Re: pthread__ras_lock_start compilation failure
To: one <1@ipex.ru>
From: Valeriy E. Ushakov <uwe@stderr.spb.ru>
List: current-users
Date: 06/14/2007 17:11:55
On Thu, Jun 14, 2007 at 14:42:44 +0400, one wrote:

> When trying to "build.sh distribution" I get an error -
> symbols pthread__ras_lock_start and pthread__ras_lock_end already
> defined..
> I'm trying to build 4.99.20 while booted into 4.99.15
> /var/tmp//cc0qbZgk.s: Assembler messages:
> /var/tmp//cc0qbZgk.s:205: Error: symbol `pthread__lock_ras_start' is already defined
> /var/tmp//cc0qbZgk.s:212: Error: symbol `pthread__lock_ras_end' is already defined
> /var/tmp//cc0qbZgk.s:264: Error: symbol `pthread__lock_ras_start' is already defined
> /var/tmp//cc0qbZgk.s:271: Error: symbol `pthread__lock_ras_end' is already defined
> /var/tmp//cc0qbZgk.s:317: Error: symbol `pthread__lock_ras_start' is already defined
> /var/tmp//cc0qbZgk.s:324: Error: symbol `pthread__lock_ras_end' is already defined
> /var/tmp//cc0qbZgk.s:383: Error: symbol `pthread__lock_ras_start' is already defined
> /var/tmp//cc0qbZgk.s:390: Error: symbol `pthread__lock_ras_end' is already defined
> /var/tmp//cc0qbZgk.s:431: Error: symbol `pthread__lock_ras_start' is already defined
> /var/tmp//cc0qbZgk.s:438: Error: symbol `pthread__lock_ras_end' is already defined
> 
> *** Failed target:  pthread_lock.o
> *** Failed command: /usr/src/obj/tooldir.NetBSD-4.99.15-i386/bin/i386--netbsdelf-gcc -O3 -ffast-math -mmmx -msse -msse2 -m32 -L/usr/pkg/lib -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -std=gnu99 -Werror -Wno-cast-qual -I/usr/src/lib/libpthread/arch/i386 -I/usr/src/lib/libpthread -I/usr/src/lib/libpthread/obj -D_LIBC -D__LIBPTHREAD_SOURCE__ -I/usr/src/sys -I/usr/src/lib/libpthread/../libc -nostdinc -isystem /usr/src/obj/destdir.i386/usr/include -c /usr/src/lib/libpthread/pthread_lock.c -o pthread_lock.o


Your porblem is caused by -O3.  I guess gcc tries to inline
pthread__simple_lock_try and RAS_START/END labels get defined multiple
times.  

The function should be marked __attribute__((noinline))

SY, Uwe
-- 
uwe@stderr.spb.ru                       |       Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/          |       Ist zu Grunde gehen