add support for QNX on x86_32

All but one test is passing.  The failure is due to the fact that QNX
doesn't (in general) support calling fork(2) from a multithreaded
process.  Thus, we'll need to use spawn instead of fork/exec on QNX,
which I'll attempt in a later commit.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html
This commit is contained in:
Joel Dice 2012-07-17 18:21:17 -06:00
parent 38e1e3f521
commit 4237a19b68
5 changed files with 32 additions and 4 deletions

View File

@ -16,6 +16,8 @@
# define ONLY_ON_WINDOWS(x) x
#else
# include <netdb.h>
# include <sys/socket.h>
# include <netinet/in.h>
# define ONLY_ON_WINDOWS(x)
#endif

View File

@ -31,6 +31,7 @@
# include <errno.h>
# include <netdb.h>
# include <sys/select.h>
# include <netinet/ip.h>
# include <netinet/tcp.h>
# include <sys/socket.h>
#endif

View File

@ -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= \

View File

@ -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"

View File

@ -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])