diff --git a/classpath/java-net.cpp b/classpath/java-net.cpp index 1cfea1fbc2..76316bec00 100644 --- a/classpath/java-net.cpp +++ b/classpath/java-net.cpp @@ -16,6 +16,8 @@ # define ONLY_ON_WINDOWS(x) x #else # include +# include +# include # define ONLY_ON_WINDOWS(x) #endif diff --git a/classpath/java-nio.cpp b/classpath/java-nio.cpp index 1464121def..17b249c502 100644 --- a/classpath/java-nio.cpp +++ b/classpath/java-nio.cpp @@ -31,6 +31,7 @@ # include # include # include +# include # include # include #endif diff --git a/makefile b/makefile index eeb2ce4ffe..7a6800760e 100755 --- a/makefile +++ b/makefile @@ -5,6 +5,7 @@ version = 0.6 build-arch := $(shell uname -m \ | sed 's/^i.86$$/i386/' \ + | sed 's/^x86pc$$/i386/' \ | sed 's/^arm.*$$/arm/' \ | sed 's/ppc/powerpc/') @@ -309,6 +310,24 @@ ifeq ($(build-platform),darwin) build-lflags += -framework CoreFoundation endif +ifeq ($(platform),qnx) + target-platform = linux + cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src) + lflags = $(common-lflags) -lsocket + ifeq ($(build-platform),qnx) + build-cflags = $(common-cflags) -fPIC -fvisibility=hidden -I$(src) + build-lflags = $(common-lflags) + else + prefix = i486-pc-nto-qnx6.5.0- + endif + cxx = $(prefix)g++ + cc = $(prefix)gcc + ar = $(prefix)ar + ranlib = $(prefix)ranlib + strip = $(prefix)strip + rdynamic = -Wl,--export-dynamic +endif + ifeq ($(platform),darwin) ifeq (${OSX_SDK_SYSROOT},) OSX_SDK_SYSROOT = 10.4u @@ -994,7 +1013,7 @@ $(build)/classpath.jar: $(classpath-dep) $(classpath-jar-dep) $(classpath-object): $(build)/classpath.jar $(converter) @echo "creating $(@)" $(converter) $(<) $(@) _binary_classpath_jar_start \ - _binary_classpath_jar_end $(platform) $(arch) + _binary_classpath_jar_end $(target-platform) $(arch) $(build)/javahome.jar: @echo "creating $(@)" @@ -1005,7 +1024,7 @@ $(build)/javahome.jar: $(javahome-object): $(build)/javahome.jar $(converter) @echo "creating $(@)" $(converter) $(<) $(@) _binary_javahome_jar_start \ - _binary_javahome_jar_end $(platform) $(arch) + _binary_javahome_jar_end $(target-platform) $(arch) define compile-generator-object @echo "compiling $(@)" @@ -1066,7 +1085,7 @@ $(bootimage-generator): $(bootimage-generator-objects) arch=$(build-arch) \ target-arch=$(arch) \ platform=$(bootimage-platform) \ - target-platform=$(platform) \ + target-platform=$(target-platform) \ openjdk=$(openjdk) \ openjdk-src=$(openjdk-src) \ bootimage-generator= \ diff --git a/src/posix.cpp b/src/posix.cpp index ea3f133d37..4e45579137 100644 --- a/src/posix.cpp +++ b/src/posix.cpp @@ -28,7 +28,7 @@ #include "unistd.h" #include "pthread.h" #include "signal.h" -#include "sys/ucontext.h" +#include "ucontext.h" #include "stdint.h" #include "dirent.h" #include "sched.h" diff --git a/src/x86.h b/src/x86.h index 298cab6aaa..4d978b2a0c 100644 --- a/src/x86.h +++ b/src/x86.h @@ -64,6 +64,12 @@ # define FRAME_REGISTER(context) \ THREAD_STATE_FRAME(context->uc_mcontext->FIELD(ss)) +# elif (defined __QNX__) +# define IP_REGISTER(context) (context->uc_mcontext.cpu.eip) +# define STACK_REGISTER(context) (context->uc_mcontext.cpu.esp) +# define THREAD_REGISTER(context) (context->uc_mcontext.cpu.ebx) +# define LINK_REGISTER(context) (context->uc_mcontext.cpu.ecx) +# define FRAME_REGISTER(context) (context->uc_mcontext.cpu.ebp) # else # define IP_REGISTER(context) (context->uc_mcontext.gregs[REG_EIP]) # define STACK_REGISTER(context) (context->uc_mcontext.gregs[REG_ESP])