fix cygwin/msys bootimage build

This commit is contained in:
Joel Dice 2009-06-01 12:12:29 -06:00
parent 2d2940b13e
commit a4d4db8eb4
3 changed files with 19 additions and 9 deletions

View File

@ -14,7 +14,9 @@ build-platform = \
| sed 's/^cygwin.*$$/cygwin/') | sed 's/^cygwin.*$$/cygwin/')
arch = $(build-arch) arch = $(build-arch)
platform = $(subst cygwin,windows,$(subst mingw32,windows,$(build-platform))) bootimage-platform = \
$(subst cygwin,windows,$(subst mingw32,windows,$(build-platform)))
platform = $(bootimage-platform)
ifeq ($(platform),windows) ifeq ($(platform),windows)
arch = i386 arch = i386
@ -273,7 +275,7 @@ bootimage-generator-sources = $(src)/bootimage.cpp
bootimage-generator-objects = \ bootimage-generator-objects = \
$(call cpp-objects,$(bootimage-generator-sources),$(src),$(native-build)) $(call cpp-objects,$(bootimage-generator-sources),$(src),$(native-build))
bootimage-generator = \ bootimage-generator = \
$(build)/$(build-platform)-$(build-arch)$(options)/bootimage-generator $(build)/$(bootimage-platform)-$(build-arch)$(options)/bootimage-generator
bootimage-bin = $(native-build)/bootimage.bin bootimage-bin = $(native-build)/bootimage.bin
bootimage-object = $(native-build)/bootimage-bin.o bootimage-object = $(native-build)/bootimage-bin.o
@ -489,7 +491,7 @@ $(static-library): $(vm-objects) $(jni-objects) $(vm-heapwalk-objects)
$(ranlib) $(@) $(ranlib) $(@)
$(bootimage-bin): $(bootimage-generator) $(bootimage-bin): $(bootimage-generator)
$(<) $(classpath-build) > $(@) $(<) $(classpath-build) $(@)
$(bootimage-object): $(bootimage-bin) $(binaryToMacho) $(bootimage-object): $(bootimage-bin) $(binaryToMacho)
@echo "creating $(@)" @echo "creating $(@)"
@ -524,7 +526,7 @@ make-bootimage-generator:
(unset MAKEFLAGS && \ (unset MAKEFLAGS && \
make mode=$(mode) \ make mode=$(mode) \
arch=$(build-arch) \ arch=$(build-arch) \
platform=$(build-platform) \ platform=$(bootimage-platform) \
bootimage=$(bootimage) \ bootimage=$(bootimage) \
heapdump=$(heapdump) \ heapdump=$(heapdump) \
bootimage-generator= \ bootimage-generator= \

View File

@ -373,8 +373,8 @@ writeBootImage(Thread* t, FILE* out, BootImage* image, uint8_t* code,
int int
main(int ac, const char** av) main(int ac, const char** av)
{ {
if (ac < 2 or ac > 5) { if (ac < 3 or ac > 6) {
fprintf(stderr, "usage: %s <classpath> " fprintf(stderr, "usage: %s <classpath> <output file> "
"[<class name> [<method name> [<method spec>]]]\n", av[0]); "[<class name> [<method name> [<method spec>]]]\n", av[0]);
return -1; return -1;
} }
@ -395,9 +395,17 @@ main(int ac, const char** av)
enter(t, Thread::ActiveState); enter(t, Thread::ActiveState);
enter(t, Thread::IdleState); enter(t, Thread::IdleState);
FILE* output = fopen(av[2], "wb");
if (output == 0) {
fprintf(stderr, "unable to open %s\n", av[2]);
return -1;
}
writeBootImage writeBootImage
(t, stdout, &image, code, CodeCapacity, (t, output, &image, code, CodeCapacity,
(ac > 2 ? av[2] : 0), (ac > 3 ? av[3] : 0), (ac > 4 ? av[4] : 0)); (ac > 3 ? av[3] : 0), (ac > 4 ? av[4] : 0), (ac > 5 ? av[5] : 0));
fclose(output);
if (t->exception) { if (t->exception) {
printTrace(t, t->exception); printTrace(t, t->exception);

View File

@ -1325,7 +1325,7 @@ class Thread {
#endif // VM_STRESS #endif // VM_STRESS
}; };
typedef uint64_t (*FastNativeFunction)(Thread*, object, uintptr_t*); typedef uint64_t (JNICALL *FastNativeFunction)(Thread*, object, uintptr_t*);
inline object inline object
objectClass(Thread*, object o) objectClass(Thread*, object o)