Subject: Re: libpthread.so.1.60 on NetBSD 1.3.3
To: Christoph Badura <bad@oreilly.de>
From: Roger Brown <rogerhb@xtra.co.nz>
List: port-mac68k
Date: 09/08/1999 07:25:54
The error from the compile is ... 

cc -O -O -Werror  -I/usr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6
-I/u
sr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6/include
-I/usr/pkgsrc/deve
l/mit-pthreads/work/pthreads-1_60_beta6/include -DPTHREAD_KERNEL  -Werror 
-I/us
r/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6
-I/usr/pkgsrc/devel/mit-pth
reads/work/pthreads-1_60_beta6/include
-I/usr/pkgsrc/devel/mit-pthreads/work/pth
reads-1_60_beta6/include -DPTHREAD_KERNEL -c
/usr/pkgsrc/devel/mit-pthreads/work
/pthreads-1_60_beta6/machdep.c
cc1: warnings being treated as errors
/usr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6/machdep.c: In
function `
machdep_sys_ftruncate':
/usr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6/machdep.c:243:
warning:
type mismatch with previous external decl
/usr/pkgsrc/devel/mit-pthreads/work/pthreads-1_60_beta6/machdep.c:233:
warning:
previous external decl of `__syscall'
*** Error code 1

Here it does not mention 'machdep_sys_lseek' but this is the immediately
preceeding function which defines __syscall.

On my machine if you have the code...

int a(char *p)
{
    extern char *f();

    p=f();
}

int b(int c)
{
    c=f();
}

It complains with 

q.c: In function `b':
q.c:10: warning: type mismatch with previous external decl
q.c:3: warning: previous external decl of `f'

So here the function prototype for 'f()' is not only scoped within function
'a()' but appears to be acting globally.

Regards

Roger

----------
>From: Christoph Badura <bad@oreilly.de>
>To: andyf@vei.net (Andy Finnell)
>Cc: rogerhb@xtra.co.nz (Roger Brown), bad@oreilly.de (Christoph Badura),
port-mac68k@netbsd.org
>Subject: Re: libpthread.so.1.60 on NetBSD 1.3.3
>Date: Tue, Sep 7, 1999, 9:54 am
>

>Andy Finnell wrote:
>> Roger Brown wrote:
>> > 
>> > I have just repeated the build using the 'NetBSD-current' pkgsrc on
>> > 'NetBSD-1.3.3' and got the same results (can't build machdep_sys_lseek due
>> > to redef of syscall and duplicated symbols sigsuspend/sigprocmask).
>
>> Where is syscall being duplicated?  Look at the code; it should only be
>> a declaration.
>
>That machdep_sys_lseek thing is mysterious.  It works on 1.3.3/i386 and
>1.3.3/sparc.  Posting the actual error messages might provide some
>clues.
>
>> For the sigsuspend/sigprocmask look in the syscall.S and
>> syscall-template.S file.  In your case ( NetBSD 1.3.X ), these two
>> functions should be generated in syscall.S, but not in
>> syscall-template.S.  Can you verify that this is happening ( or in fact
>> no happening )?
>
>Well, the sigsuspend/sigprocmask error is clear.  The 1.3 compat
>syscalls were introduced *after* the 1.3 release (i.e. in -current).
>1.3.x has just the regular SYS_sigsuspend etc. #defines.
>So, that should just be SYS_sigprocmask etc in syscall-m68000-netbsd.S.
>
>-- 
>Christoph Badura     www.netbsd.org
>
> Anything that can be done in O(N) can be done in O(N^2).
> -- Ralf Schuettau (after looking at a particular piece of code)