提交 028a9196 编写于 作者: S simonis

8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64

Summary: Make hsdis work on Linux/PPC64 and AIX/PPC64
Reviewed-by: kvn
上级 177680c4
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
# Default arch; it is changed below as needed. # Default arch; it is changed below as needed.
ARCH = i386 ARCH = i386
OS = $(shell uname) OS = $(shell uname)
AR = ar
## OS = SunOS ## ## OS = SunOS ##
ifeq ($(OS),SunOS) ifeq ($(OS),SunOS)
...@@ -73,6 +74,7 @@ ARCH=$(ARCH1:i686=i386) ...@@ -73,6 +74,7 @@ ARCH=$(ARCH1:i686=i386)
ifdef LP64 ifdef LP64
CFLAGS/sparcv9 += -m64 CFLAGS/sparcv9 += -m64
CFLAGS/amd64 += -m64 CFLAGS/amd64 += -m64
CFLAGS/ppc64 += -m64
else else
ARCH=$(ARCH1:amd64=i386) ARCH=$(ARCH1:amd64=i386)
CFLAGS/i386 += -m32 CFLAGS/i386 += -m32
...@@ -88,8 +90,20 @@ CFLAGS += -O ...@@ -88,8 +90,20 @@ CFLAGS += -O
DLDFLAGS += -shared DLDFLAGS += -shared
LDFLAGS += -ldl LDFLAGS += -ldl
OUTFLAGS += -o $@ OUTFLAGS += -o $@
## OS = Windows ## else
else # !SunOS, !Linux => Darwin or Windows ## OS = AIX ##
ifeq ($(OS),AIX)
OS = aix
ARCH = ppc64
CC = xlc_r
CFLAGS += -DAIX -g -qpic=large -q64
CFLAGS/ppc64 += -q64
AR = ar -X64
DLDFLAGS += -qmkshrobj -lz
OUTFLAGS += -o $@
LIB_EXT = .so
else
## OS = Darwin ##
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
CPU = $(shell uname -m) CPU = $(shell uname -m)
ARCH1=$(CPU:x86_64=amd64) ARCH1=$(CPU:x86_64=amd64)
...@@ -113,7 +127,8 @@ DLDFLAGS += -shared ...@@ -113,7 +127,8 @@ DLDFLAGS += -shared
DLDFLAGS += -lz DLDFLAGS += -lz
LDFLAGS += -ldl LDFLAGS += -ldl
OUTFLAGS += -o $@ OUTFLAGS += -o $@
else #Windows else
## OS = Windows ##
OS = windows OS = windows
CC = gcc CC = gcc
CFLAGS += /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi- CFLAGS += /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi-
...@@ -123,6 +138,7 @@ DLDFLAGS += /dll /subsystem:windows /incremental:no \ ...@@ -123,6 +138,7 @@ DLDFLAGS += /dll /subsystem:windows /incremental:no \
OUTFLAGS += /link /out:$@ OUTFLAGS += /link /out:$@
LIB_EXT = .dll LIB_EXT = .dll
endif # Darwin endif # Darwin
endif # AIX
endif # Linux endif # Linux
endif # SunOS endif # SunOS
...@@ -176,7 +192,7 @@ $(LIBRARIES): $(TARGET_DIR) $(TARGET_DIR)/Makefile ...@@ -176,7 +192,7 @@ $(LIBRARIES): $(TARGET_DIR) $(TARGET_DIR)/Makefile
if [ ! -f $@ ]; then cd $(TARGET_DIR); make all-opcodes; fi if [ ! -f $@ ]; then cd $(TARGET_DIR); make all-opcodes; fi
$(TARGET_DIR)/Makefile: $(TARGET_DIR)/Makefile:
(cd $(TARGET_DIR); CC=$(CC) CFLAGS="$(CFLAGS)" $(BINUTILSDIR)/configure --disable-nls $(CONFIGURE_ARGS)) (cd $(TARGET_DIR); CC=$(CC) CFLAGS="$(CFLAGS)" AR="$(AR)" $(BINUTILSDIR)/configure --disable-nls $(CONFIGURE_ARGS))
$(TARGET): $(SOURCE) $(LIBS) $(LIBRARIES) $(TARGET_DIR) $(TARGET): $(SOURCE) $(LIBS) $(LIBRARIES) $(TARGET_DIR)
$(CC) $(OUTFLAGS) $(CPPFLAGS) $(CFLAGS) $(SOURCE) $(DLDFLAGS) $(LIBRARIES) $(CC) $(OUTFLAGS) $(CPPFLAGS) $(CFLAGS) $(SOURCE) $(DLDFLAGS) $(LIBRARIES)
......
Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it This code is free software; you can redistribute it and/or modify it
...@@ -54,6 +54,17 @@ explicitly build the 64 bit version. By default this will build the ...@@ -54,6 +54,17 @@ explicitly build the 64 bit version. By default this will build the
disassembler library only. If you build demo it will build a demo disassembler library only. If you build demo it will build a demo
program that attempts to exercise the library. program that attempts to exercise the library.
With recent version of binutils (i.e. binutils-2.23.2) you may get the
following build error:
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
...
This is because of "Bug 15345 - binutils-2.23.2 tarball doesn't build
without makeinfo" [2]. The easiest way to work around this problem is
by doing a "touch $BINUTILS/bfd/doc/bfd.info".
Windows Windows
In theory this should be buildable on Windows but getting a working In theory this should be buildable on Windows but getting a working
...@@ -101,3 +112,13 @@ Now test: ...@@ -101,3 +112,13 @@ Now test:
If the product mode of the JVM does not accept -XX:+PrintAssembly, If the product mode of the JVM does not accept -XX:+PrintAssembly,
you do not have a version new enough to use the hsdis plugin. you do not have a version new enough to use the hsdis plugin.
* Wiki
More information can be found in the OpenJDK HotSpot Wiki [1].
Resources:
[1] https://wiki.openjdk.java.net/display/HotSpot/PrintAssembly
[2] http://sourceware.org/bugzilla/show_bug.cgi?id=15345
/* /*
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -307,7 +307,8 @@ static void setup_app_data(struct hsdis_app_data* app_data, ...@@ -307,7 +307,8 @@ static void setup_app_data(struct hsdis_app_data* app_data,
app_data->printf_stream, app_data->printf_stream,
app_data->printf_callback, app_data->printf_callback,
native_bfd, native_bfd,
app_data->insn_options); /* On PowerPC we get warnings, if we pass empty options */
(caller_options == NULL) ? NULL : app_data->insn_options);
/* Finish linking together the various callback blocks. */ /* Finish linking together the various callback blocks. */
app_data->dinfo.application_data = (void*) app_data; app_data->dinfo.application_data = (void*) app_data;
...@@ -458,6 +459,9 @@ static const char* native_arch_name() { ...@@ -458,6 +459,9 @@ static const char* native_arch_name() {
#endif #endif
#ifdef LIBARCH_sparcv9 #ifdef LIBARCH_sparcv9
res = "sparc:v9b"; res = "sparc:v9b";
#endif
#ifdef LIBARCH_ppc64
res = "powerpc:common64";
#endif #endif
if (res == NULL) if (res == NULL)
res = "architecture not set in Makefile!"; res = "architecture not set in Makefile!";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册