Subject: Strange build.sh problem
To: None <current-users@netbsd.org>
From: Paul Goyette <paul@whooppee.com>
List: current-users
Date: 01/25/2007 20:11:01
Folks,

I'm running into something very odd regarding build.sh...

If I start with a completely blank /usr/obj and then run a "build release" for 
amd64 followed by another "build release" for i386, both builds complete 
successfully.  However, if I then try to do a "build
-u release" for amd64, it fails, while a "build -u release" for i386 succeeds!

If I reverse the order of the initial two builds, doing i386 first followed by 
amd64, then a "build -u release" for i386 fails while the same command for 
amd64 succeeds!

So, it seems that something that doesn't get cleaned up in a "build -u" 
scenario is hanging around and getting in the way of building other
architectures.

Here's the build.sh commands I'm using:

 	rm -Rf /usr/obj/* /usr/obj/.[a-z]*
 	./build.sh -T /usr/obj/tools.x86_64.amd64 \
 		   -D /usr/obj/destdir.amd64 \
 		   -R /usr/obj/reldir -O /usr/obj \
 		   -m amd64 -x -j4 release
 	./build.sh -T /usr/obj/tools.x86_64.i386 \
 		   -D /usr/obj/destdir.i386 \
 		   -R /usr/obj/reldir -O /usr/obj \
 		   -m i386 -x -j4 release

And here's the error messages from the log file:

#     build  libc/libc.so.12.150
rm -f libc.so.12.150
/usr/obj/tools.x86_64.amd64/bin/x86_64--netbsd-gcc -Wl,-nostdlib 
-B/usr/obj/destdir.amd64/usr/lib/ -B/usr/obj/destdir.amd64/usr/lib/ 
-Wl,-rpath-link,/usr/obj/destdir.amd64/lib:/usr/obj/destdir.amd64/usr/lib 
-R/lib  -L/usr/obj/destdir.amd64/lib  -Wl,-x -shared -Wl,-soname,libc.so.12 
-o libc.so.12.150  -Wl,--whole-archive libc_pic.a  -Wl,--no-whole-archive 
-L/usr/obj/destdir.amd64/usr/lib
/usr/obj/tools.x86_64.amd64/lib/gcc/x86_64--netbsd/4.1.2/../../../../x86_64--netbsd/bin/ld: 
skipping incompatible /usr/obj/destdir.amd64/usr/lib/libgcc_pic.a when 
searching for -lgcc_pic
/usr/obj/tools.x86_64.amd64/lib/gcc/x86_64--netbsd/4.1.2/../../../../x86_64--netbsd/bin/ld: 
skipping incompatible /usr/obj/destdir.amd64/usr/lib/libgcc_pic.a when 
searching for -lgcc_pic
/usr/obj/tools.x86_64.amd64/lib/gcc/x86_64--netbsd/4.1.2/../../../../x86_64--netbsd/bin/ld: 
skipping incompatible /usr/obj/destdir.amd64/usr/lib/libgcc_pic.a when 
searching for -lgcc_pic
/usr/obj/tools.x86_64.amd64/lib/gcc/x86_64--netbsd/4.1.2/../../../../x86_64--netbsd/bin/ld: 
cannot find -lgcc_pic
collect2: ld returned 1 exit status

(The build.sh above have -j4 but the exact same errors occur without
-j4 so that's probably not the problem!)

Any clues?

----------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Network Engineer | FA29 0E3B 35AF E8AE 6651 |  paul@whooppee.com   |
|                  | 0786 F758 55DE 53BA 7731 | pgoyette@juniper.net |
----------------------------------------------------------------------