mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 20:44:41 +02:00
8019926: PPC64 (part 106): Make hsdis build and work on Linux/PPC64
Make hsdis work on Linux/PPC64 and AIX/PPC64 Reviewed-by: kvn
This commit is contained in:
parent
ed85bb1853
commit
d656c7e2b8
3 changed files with 48 additions and 7 deletions
|
@ -27,6 +27,7 @@
|
|||
# Default arch; it is changed below as needed.
|
||||
ARCH = i386
|
||||
OS = $(shell uname)
|
||||
AR = ar
|
||||
|
||||
## OS = SunOS ##
|
||||
ifeq ($(OS),SunOS)
|
||||
|
@ -73,6 +74,7 @@ ARCH=$(ARCH1:i686=i386)
|
|||
ifdef LP64
|
||||
CFLAGS/sparcv9 += -m64
|
||||
CFLAGS/amd64 += -m64
|
||||
CFLAGS/ppc64 += -m64
|
||||
else
|
||||
ARCH=$(ARCH1:amd64=i386)
|
||||
CFLAGS/i386 += -m32
|
||||
|
@ -88,8 +90,20 @@ CFLAGS += -O
|
|||
DLDFLAGS += -shared
|
||||
LDFLAGS += -ldl
|
||||
OUTFLAGS += -o $@
|
||||
## OS = Windows ##
|
||||
else # !SunOS, !Linux => Darwin or Windows
|
||||
else
|
||||
## 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)
|
||||
CPU = $(shell uname -m)
|
||||
ARCH1=$(CPU:x86_64=amd64)
|
||||
|
@ -113,7 +127,8 @@ DLDFLAGS += -shared
|
|||
DLDFLAGS += -lz
|
||||
LDFLAGS += -ldl
|
||||
OUTFLAGS += -o $@
|
||||
else #Windows
|
||||
else
|
||||
## OS = Windows ##
|
||||
OS = windows
|
||||
CC = gcc
|
||||
CFLAGS += /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi-
|
||||
|
@ -123,6 +138,7 @@ DLDFLAGS += /dll /subsystem:windows /incremental:no \
|
|||
OUTFLAGS += /link /out:$@
|
||||
LIB_EXT = .dll
|
||||
endif # Darwin
|
||||
endif # AIX
|
||||
endif # Linux
|
||||
endif # SunOS
|
||||
|
||||
|
@ -176,7 +192,7 @@ $(LIBRARIES): $(TARGET_DIR) $(TARGET_DIR)/Makefile
|
|||
if [ ! -f $@ ]; then cd $(TARGET_DIR); make all-opcodes; fi
|
||||
|
||||
$(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)
|
||||
$(CC) $(OUTFLAGS) $(CPPFLAGS) $(CFLAGS) $(SOURCE) $(DLDFLAGS) $(LIBRARIES)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
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.
|
||||
|
||||
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
|
|||
disassembler library only. If you build demo it will build a demo
|
||||
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
|
||||
|
||||
In theory this should be buildable on Windows but getting a working
|
||||
|
@ -101,3 +112,13 @@ Now test:
|
|||
|
||||
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.
|
||||
|
||||
* 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
* 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,
|
|||
app_data->printf_stream,
|
||||
app_data->printf_callback,
|
||||
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. */
|
||||
app_data->dinfo.application_data = (void*) app_data;
|
||||
|
@ -458,6 +459,9 @@ static const char* native_arch_name() {
|
|||
#endif
|
||||
#ifdef LIBARCH_sparcv9
|
||||
res = "sparc:v9b";
|
||||
#endif
|
||||
#ifdef LIBARCH_ppc64
|
||||
res = "powerpc:common64";
|
||||
#endif
|
||||
if (res == NULL)
|
||||
res = "architecture not set in Makefile!";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue