Subject: Bootstrapping
To: None <tech-pkg@netbsd.org>
From: Christer Solskogen <solskogen@carebears.mine.nu>
List: tech-pkg
Date: 10/08/2005 22:23:44
Bootstrapping with Arch Linux w/gcc-4. 

Begin forwarded message:

Date: Sat, 8 Oct 2005 18:29:24 +0200
From: Christer Solskogen <solskogen@carebears.mine.nu>
To: pkglinux-tech@pkglinux.antarctica.no
Subject: Re: [Pkglinux-tech] Bootstrapping


On Sat, 8 Oct 2005 08:43:48 -0700 (PDT)
"Jeremy C. Reed" <reed@reedmedia.net> wrote:

> On Sat, 8 Oct 2005, Christer Solskogen wrote:
> 
> >> Bootstrapping pkgsrc with gcc 4.0.2 is not very easy.
> >> First, NetBSD Problem Report #19316 comes up again. (by reversing
> >> the patch, i got it to compile) And second sha2hl.c(in
> >> libnbcompat) is having problems.
> 
> Do you mean getting rid of the Linux check:
> 
>    #if (!defined(HAVE___ATTRIBUTE__) && !defined(__linux__))
>    # define __attribute__(x)
>    #endif
> 

No, at the end of config.h.in(in bmake directory) is this:
/* Define if your compiler has __attribute__ */
#define HAVE___ATTRIBUTE__

#ifndef HAVE___ATTRIBUTE__
# define __attribute__(x)
#endif

If not, bootstrap failed with:
gcc -I. -I. -DHAVE_CONFIG_H  -I../libnbcompat -I./missing
-DNEED_HOST_CDEFS_H "-D_PATH_DEFSYSPATH=\"/usr/pkg/share/mk\""
-DMAKE_BOOTSTRAP    -c -o compat.o compat.c compat.c: In function
'CompatRunCommand': compat.c:318: error: incompatible type for argument
1 of 'wait' make: *** [compat.o] Error 1 ===> exited with status 2
aborted.
[root@build bootstrap]# gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.2/configure --prefix=/usr --enable-shared
--enable-languages=c,c++,objc --enable-threads=posix
--enable-__cxa_atexit Thread model: posix gcc version 4.0.2

If I #define HAVE__ATTRIBUTE__ bootstrap failes with this(digest):

gcc -DHAVE_CONFIG_H -I. -I. -DHOST=\"i686-pc-linux-gnu\"
-DVERSION=\"20050731\"  -g -O2 -c sha2hl.c -o sha2hl.o sha2hl.c: In
function 'SHA256_File': sha2hl.c:99: warning: passing argument 2 of
'SHA256_Update' from incompatible pointer type sha2hl.c:104: warning:
pointer targets in passing argument 2 of 'SHA256_End' differ in
signedness sha2hl.c: In function 'SHA256_End': sha2hl.c:119: warning:
passing argument 1 of 'SHA256_Final' from incompatible pointer type
sha2hl.c:131: warning: pointer targets in return differ in signedness
sha2hl.c: At top level: sha2hl.c:136: error: conflicting types for
'SHA256_Data' ./sha2.h:102: error: previous declaration of
'SHA256_Data' was here sha2hl.c: In function 'SHA256_Data':
sha2hl.c:140: warning: passing argument 2 of 'SHA256_Update' from
incompatible pointer type sha2hl.c: In function 'SHA384_File':
sha2hl.c:160: warning: passing argument 2 of 'SHA384_Update' from
incompatible pointer type sha2hl.c: In function 'SHA384_End':
sha2hl.c:178: warning: pointer targets in assignment differ in
signedness sha2hl.c:179: warning: passing argument 1 of 'SHA384_Final'
from incompatible pointer type sha2hl.c:191: warning: pointer targets
in return differ in signedness sha2hl.c: At top level:
sha2hl.c:196: error: conflicting types for 'SHA384_Data'
./sha2.h:109: error: previous declaration of 'SHA384_Data' was here
sha2hl.c: In function 'SHA384_Data':
sha2hl.c:200: warning: passing argument 2 of 'SHA384_Update' from
incompatible pointer type sha2hl.c: In function 'SHA512_File':
sha2hl.c:220: warning: passing argument 2 of 'SHA512_Update' from
incompatible pointer type sha2hl.c: In function 'SHA512_End':
sha2hl.c:238: warning: pointer targets in assignment differ in
signedness sha2hl.c:239: warning: passing argument 1 of 'SHA512_Final'
from incompatible pointer type sha2hl.c:251: warning: pointer targets
in return differ in signedness sha2hl.c: At top level:
sha2hl.c:256: error: conflicting types for 'SHA512_Data'
./sha2.h:116: error: previous declaration of 'SHA512_Data' was here
sha2hl.c: In function 'SHA512_Data':
sha2hl.c:260: warning: passing argument 2 of 'SHA512_Update' from
incompatible pointer type make: *** [sha2hl.o] Error 1
===> exited with status 2
aborted.



-- 
cso,