7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code

Cross-compilation support

Reviewed-by: ohair, andrew
This commit is contained in:
David Holmes 2011-03-16 18:54:50 -04:00
parent 5423e4402e
commit d79934dd2f
17 changed files with 184 additions and 72 deletions

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1999, 2011, 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
@ -107,6 +107,8 @@ CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9 LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9
CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9 CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9
LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN
CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN
ifeq ($(ZERO_BUILD), true) ifeq ($(ZERO_BUILD), true)
CFLAGS_REQUIRED = $(ZERO_ARCHFLAG) CFLAGS_REQUIRED = $(ZERO_ARCHFLAG)
ifeq ($(ZERO_ENDIANNESS), little) ifeq ($(ZERO_ENDIANNESS), little)
@ -143,11 +145,9 @@ endif
# #
# Misc compiler options # Misc compiler options
# #
ifeq ($(ARCH),ppc) ifneq ($(ARCH),ppc)
CFLAGS_COMMON = -fsigned-char
else # ARCH
CFLAGS_COMMON = -fno-strict-aliasing CFLAGS_COMMON = -fno-strict-aliasing
endif # ARCH endif
PIC_CODE_LARGE = -fPIC PIC_CODE_LARGE = -fPIC
PIC_CODE_SMALL = -fpic PIC_CODE_SMALL = -fpic
GLOBAL_KPIC = $(PIC_CODE_LARGE) GLOBAL_KPIC = $(PIC_CODE_LARGE)
@ -219,8 +219,19 @@ ifdef LIBRARY
# The environment variable LD_LIBRARY_PATH will over-ride these runpaths. # The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
# Try: 'readelf -d lib*.so' to see these settings in a library. # Try: 'readelf -d lib*.so' to see these settings in a library.
# #
LDFLAGS_COMMON += -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin
LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN/%) Z_ORIGIN_FLAG/i586 = -Xlinker -z -Xlinker origin
Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin
Z_ORIGIN_FLAG/ia64 = -Xlinker -z -Xlinker origin
Z_ORIGIN_FLAG/arm =
Z_ORIGIN_FLAG/ppc =
Z_ORIGIN_FLAG/zero = -Xlinker -z -Xlinker origin
LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY))
LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN
LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%)
endif endif
EXTRA_LIBS += -lc EXTRA_LIBS += -lc
@ -315,7 +326,6 @@ override LIBNSL =
override LIBTHREAD = override LIBTHREAD =
override MOOT_PRIORITIES = true override MOOT_PRIORITIES = true
override NO_INTERRUPTIBLE_IO = true override NO_INTERRUPTIBLE_IO = true
override OPENWIN_HOME = /usr/X11R6
ifeq ($(ARCH), amd64) ifeq ($(ARCH), amd64)
override OPENWIN_LIB = $(OPENWIN_HOME)/lib64 override OPENWIN_LIB = $(OPENWIN_HOME)/lib64
else else
@ -359,3 +369,9 @@ else
INCLUDE_SA = true INCLUDE_SA = true
endif endif
ifdef CROSS_COMPILE_ARCH
# X11 headers are not under /usr/include
OTHER_CFLAGS += -I$(OPENWIN_HOME)/include
OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include
OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
endif

View file

@ -115,11 +115,36 @@ endif
include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
#
# Cross-compilation Settings
#
ifdef CROSS_COMPILE_ARCH
# Can't run the tools we just built
USE_ONLY_BOOTDIR_TOOLS = true
# When cross-compiling CC generates code for the target, but
# some parts of the build generate C code that has to be compiled
# and executed on the build host - HOST_CC is the 'local' compiler.
# For linux the default is /usr/bin/gcc; other platforms need to
# set it explicitly
ifeq ($(PLATFORM), linux)
ifndef HOST_CC
HOST_CC = $(USRBIN_PATH)gcc
endif
endif
else
# Must set HOST_CC if not already set
ifndef HOST_CC
HOST_CC = $(CC)
endif
endif
# Reset the VM name for client-only builds # Reset the VM name for client-only builds
ifdef BUILD_CLIENT_ONLY ifdef BUILD_CLIENT_ONLY
VM_NAME = client VM_NAME = client
endif endif
# #
# Freetype logic is applicable to OpenJDK only # Freetype logic is applicable to OpenJDK only
# #
@ -339,8 +364,7 @@ endif
INCLUDES = -I. -I$(CLASSHDRDIR) \ INCLUDES = -I. -I$(CLASSHDRDIR) \
$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES) $(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
OTHER_CPPFLAGS = $(INCLUDES) OTHER_CPPFLAGS += $(INCLUDES)
# #
# vpaths. These are the default locations searched for source files. # vpaths. These are the default locations searched for source files.
@ -471,9 +495,11 @@ CXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \
# #
# Tool flags # Tool flags
# #
# EXTRA_CFLAGS are used to define cross-compilation options
#
ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS) ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS) CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS) $(EXTRA_CFLAGS)
CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS)
CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \ CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
$(DEFINES) $(OPTIONS:%=-D%) $(DEFINES) $(OPTIONS:%=-D%)
LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS) LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)

View file

@ -83,7 +83,7 @@ ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems
endif endif
endif endif
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
LDFLAGS += -Wl,-z -Wl,origin LDFLAGS += $(LDFLAG_Z_ORIGIN)
LDFLAGS += -Wl,--allow-shlib-undefined LDFLAGS += -Wl,--allow-shlib-undefined
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2005, 2011, 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
@ -102,6 +102,14 @@ else
COMPILER_PATH =/usr/bin/ COMPILER_PATH =/usr/bin/
endif endif
# OPENWIN_HOME: path to where the X11 environment is installed.
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifneq ($(ALT_OPENWIN_HOME),)
OPENWIN_HOME :=$(call PrefixPath,$(ALT_OPENWIN_HOME))
else
OPENWIN_HOME =/usr/X11R6/
endif
# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.) # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
# NOTE: Must end with / so that it could be empty, allowing PATH usage. # NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined" ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined"
@ -181,6 +189,7 @@ HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
# Macro to check it's input file for banned dependencies and verify the # Macro to check it's input file for banned dependencies and verify the
# binary built properly. Relies on process exit code. # binary built properly. Relies on process exit code.
ifndef CROSS_COMPILE_ARCH
define binary_file_verification # binary_file define binary_file_verification # binary_file
( \ ( \
$(ECHO) "Checking for mapfile use in: $1" && \ $(ECHO) "Checking for mapfile use in: $1" && \
@ -193,4 +202,10 @@ define binary_file_verification # binary_file
( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \ ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
) )
endef endef
else
define binary_file_verification
( \
$(ECHO) "Skipping binary file verification for cross-compile build" \
)
endef
endif

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2005, 2011, 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
@ -190,6 +190,7 @@ HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
# Macro to check it's input file for banned dependencies and verify the # Macro to check it's input file for banned dependencies and verify the
# binary built properly. Relies on process exit code. # binary built properly. Relies on process exit code.
ifndef CROSS_COMPILE_ARCH
define binary_file_verification # binary_file define binary_file_verification # binary_file
( \ ( \
$(ECHO) "Checking for mapfile use in: $1" && \ $(ECHO) "Checking for mapfile use in: $1" && \
@ -202,4 +203,10 @@ define binary_file_verification # binary_file
( $(DUMP) -L -v $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \ ( $(DUMP) -L -v $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
) )
endef endef
else
define binary_file_verification
( \
$(ECHO) "Skipping binary file verification for cross-compile build" \
)
endef
endif

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2005, 2011, 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
@ -68,9 +68,23 @@ ifeq ($(PLATFORM),windows)
endif endif
# Utilities # Utilities
ADB = $(UTILS_COMMAND_PATH)adb ifdef CROSS_COMPILE_ARCH
AR = $(COMPILER_PATH)ar
AS = $(COMPILER_PATH)as
LD = $(COMPILER_PATH)ld
MCS = $(COMPILER_PATH)mcs
NM = $(COMPILER_PATH)nm
STRIP = $(COMPILER_PATH)strip
else
AR = $(UTILS_CCS_BIN_PATH)ar AR = $(UTILS_CCS_BIN_PATH)ar
AS = $(UTILS_CCS_BIN_PATH)as AS = $(UTILS_CCS_BIN_PATH)as
LD = $(UTILS_CCS_BIN_PATH)ld
MCS = $(UTILS_CCS_BIN_PATH)mcs
NM = $(UTILS_CCS_BIN_PATH)nm
STRIP = $(UTILS_CCS_BIN_PATH)strip
endif
ADB = $(UTILS_COMMAND_PATH)adb
BASENAME = $(UTILS_COMMAND_PATH)basename BASENAME = $(UTILS_COMMAND_PATH)basename
BZIP2 = $(UTILS_COMMAND_PATH)bzip2 BZIP2 = $(UTILS_COMMAND_PATH)bzip2
CAT = $(UTILS_COMMAND_PATH)cat CAT = $(UTILS_COMMAND_PATH)cat
@ -99,19 +113,16 @@ HEAD = $(UTILS_USR_BIN_PATH)head
ID = $(UTILS_COMMAND_PATH)id ID = $(UTILS_COMMAND_PATH)id
ISAINFO = $(UTILS_COMMAND_PATH)isainfo ISAINFO = $(UTILS_COMMAND_PATH)isainfo
KSH = $(UTILS_COMMAND_PATH)ksh KSH = $(UTILS_COMMAND_PATH)ksh
LD = $(UTILS_CCS_BIN_PATH)ld
LDD = $(UTILS_USR_BIN_PATH)ldd LDD = $(UTILS_USR_BIN_PATH)ldd
LEX = $(UTILS_CCS_BIN_PATH)lex LEX = $(UTILS_CCS_BIN_PATH)lex
LN = $(UTILS_COMMAND_PATH)ln LN = $(UTILS_COMMAND_PATH)ln
LS = $(UTILS_COMMAND_PATH)ls LS = $(UTILS_COMMAND_PATH)ls
MCS = $(UTILS_CCS_BIN_PATH)mcs
M4 = $(UTILS_CCS_BIN_PATH)m4 M4 = $(UTILS_CCS_BIN_PATH)m4
MKDIR = $(UTILS_COMMAND_PATH)mkdir MKDIR = $(UTILS_COMMAND_PATH)mkdir
MKSINFO = $(UTILS_COMMAND_PATH)mksinfo MKSINFO = $(UTILS_COMMAND_PATH)mksinfo
MSGFMT = $(UTILS_USR_BIN_PATH)msgfmt MSGFMT = $(UTILS_USR_BIN_PATH)msgfmt
MV = $(UTILS_COMMAND_PATH)mv MV = $(UTILS_COMMAND_PATH)mv
NAWK = $(UTILS_USR_BIN_PATH)nawk NAWK = $(UTILS_USR_BIN_PATH)nawk
NM = $(UTILS_CCS_BIN_PATH)nm
PKGMK = $(UTILS_COMMAND_PATH)pkgmk PKGMK = $(UTILS_COMMAND_PATH)pkgmk
PRINTF = $(UTILS_USR_BIN_PATH)printf PRINTF = $(UTILS_USR_BIN_PATH)printf
PWD = $(UTILS_COMMAND_PATH)pwd PWD = $(UTILS_COMMAND_PATH)pwd
@ -123,7 +134,6 @@ SED = $(UTILS_COMMAND_PATH)sed
SH = $(UTILS_COMMAND_PATH)sh SH = $(UTILS_COMMAND_PATH)sh
SHOWREV = $(UTILS_USR_BIN_PATH)showrev SHOWREV = $(UTILS_USR_BIN_PATH)showrev
SORT = $(UTILS_COMMAND_PATH)sort SORT = $(UTILS_COMMAND_PATH)sort
STRIP = $(UTILS_CCS_BIN_PATH)strip
TAIL = $(UTILS_USR_BIN_PATH)tail TAIL = $(UTILS_USR_BIN_PATH)tail
TAR = $(UTILS_COMMAND_PATH)tar TAR = $(UTILS_COMMAND_PATH)tar
TEST = $(UTILS_USR_BIN_PATH)test TEST = $(UTILS_USR_BIN_PATH)test
@ -186,14 +196,16 @@ ifeq ($(PLATFORM),linux)
# Intrinsic unix command, with backslash-escaped character interpretation # Intrinsic unix command, with backslash-escaped character interpretation
ECHO = /bin/echo -e ECHO = /bin/echo -e
# These are really in UTILS_USR_BIN_PATH on Linux # These are really in UTILS_USR_BIN_PATH on Linux
ifndef CROSS_COMPILE_ARCH
AR = $(UTILS_USR_BIN_PATH)ar AR = $(UTILS_USR_BIN_PATH)ar
AS = $(UTILS_USR_BIN_PATH)as AS = $(UTILS_USR_BIN_PATH)as
LD = $(UTILS_USR_BIN_PATH)ld LD = $(UTILS_USR_BIN_PATH)ld
LEX = $(UTILS_USR_BIN_PATH)lex
MCS = $(UTILS_USR_BIN_PATH)mcs MCS = $(UTILS_USR_BIN_PATH)mcs
M4 = $(UTILS_USR_BIN_PATH)m4
NM = $(UTILS_USR_BIN_PATH)nm NM = $(UTILS_USR_BIN_PATH)nm
STRIP = $(UTILS_USR_BIN_PATH)strip STRIP = $(UTILS_USR_BIN_PATH)strip
endif
LEX = $(UTILS_USR_BIN_PATH)lex
M4 = $(UTILS_USR_BIN_PATH)m4
YACC = $(UTILS_USR_BIN_PATH)yacc YACC = $(UTILS_USR_BIN_PATH)yacc
endif endif

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2009, 2011, 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
@ -138,12 +138,16 @@ ifeq ($(PLATFORM), solaris)
endif endif
REQUIRED_COMPILER_NAME = Sun Studio 12 Update 1 REQUIRED_COMPILER_NAME = Sun Studio 12 Update 1
REQUIRED_COMPILER_VERSION = SS12u1 REQUIRED_COMPILER_VERSION = SS12u1
# Cross-compilation compiler versions are target specific
# so don't set a required version if cross-compiling
ifndef CROSS_COMPILE_ARCH
ifeq ($(CC_VERSION),sun) ifeq ($(CC_VERSION),sun)
REQUIRED_CC_VER = 5.10 REQUIRED_CC_VER = 5.10
endif endif
ifeq ($(CC_VERSION),gcc) ifeq ($(CC_VERSION),gcc)
REQUIRED_CC_VER = 3.4.3 REQUIRED_CC_VER = 3.4.3
endif endif
endif
REQUIRED_GCC_VER = 2.95.2 REQUIRED_GCC_VER = 2.95.2
endif endif
@ -158,6 +162,9 @@ ifeq ($(PLATFORM), linux)
REQUIRED_COMPILER_NAME = GCC4 REQUIRED_COMPILER_NAME = GCC4
REQUIRED_COMPILER_VERSION = GCC4 REQUIRED_COMPILER_VERSION = GCC4
REQUIRED_GCC_VER = 2.95 REQUIRED_GCC_VER = 2.95
# Cross-compilation compiler versions are target specific
# so don't set a required version if cross-compiling
ifndef CROSS_COMPILE_ARCH
ifeq ($(CC_VERSION),gcc) ifeq ($(CC_VERSION),gcc)
REQUIRED_CC_VER = 4.3.0 REQUIRED_CC_VER = 4.3.0
endif endif
@ -165,6 +172,7 @@ ifeq ($(PLATFORM), linux)
REQUIRED_CC_VER = 5.10 REQUIRED_CC_VER = 5.10
endif endif
endif endif
endif
# Windows specific # Windows specific
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1997, 20010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1997, 2011, 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
@ -155,7 +155,11 @@ endif
ifeq ($(SYSTEM_UNAME), Linux) ifeq ($(SYSTEM_UNAME), Linux)
PLATFORM = linux PLATFORM = linux
# Arch and OS name/version # Arch and OS name/version
ifdef CROSS_COMPILE_ARCH
mach := $(CROSS_COMPILE_ARCH)
else
mach := $(shell uname -m) mach := $(shell uname -m)
endif
archExpr = case "$(mach)" in \ archExpr = case "$(mach)" in \
i[3-9]86) \ i[3-9]86) \
echo i586 \ echo i586 \
@ -192,11 +196,13 @@ ifeq ($(SYSTEM_UNAME), Linux)
ARCH=sparcv9 ARCH=sparcv9
endif endif
else else
# i586 is 32-bit, amd64 is 64-bit # Most archs are 32-bit
ifndef ARCH_DATA_MODEL ifndef ARCH_DATA_MODEL
ifeq ($(ARCH), i586)
ARCH_DATA_MODEL=32 ARCH_DATA_MODEL=32
else ifeq ($(ARCH), amd64)
ARCH_DATA_MODEL=64
endif
ifeq ($(ARCH), ia64)
ARCH_DATA_MODEL=64 ARCH_DATA_MODEL=64
endif endif
endif endif

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2005, 2011, 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
@ -104,7 +104,11 @@ ifeq ($(PLATFORM),windows)
endif endif
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_NAME) ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_NAME)
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_VERSION) ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_VERSION)
ifdef REQUIRED_CC_VER
ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER) ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER)
else
ALL_SETTINGS+=$(call addOptionalSetting,CC_VER)
endif
ifeq ($(PLATFORM),solaris) ifeq ($(PLATFORM),solaris)
ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(ARCH_DATA_MODEL), 32)
ifndef OPENJDK ifndef OPENJDK

View file

@ -817,7 +817,7 @@ sane-cacerts:
###################################################### ######################################################
ifdef OPENJDK ifdef OPENJDK
ifndef CROSS_COMPILE_ARCH
# The freetypecheck Makefile prints out "Failed" if not good enough # The freetypecheck Makefile prints out "Failed" if not good enough
$(TEMPDIR)/freetypeinfo: FRC $(TEMPDIR)/freetypeinfo: FRC
@$(prep-target) @$(prep-target)
@ -830,7 +830,10 @@ sane-freetype: $(TEMPDIR)/freetypeinfo
" or higher is required. \n" \ " or higher is required. \n" \
"`$(CAT) $<` \n" >> $(ERROR_FILE) ; \ "`$(CAT) $<` \n" >> $(ERROR_FILE) ; \
fi fi
else
#do nothing (cross-compiling)
sane-freetype:
endif
else else
#do nothing (not OpenJDK) #do nothing (not OpenJDK)
sane-freetype: sane-freetype:
@ -1343,8 +1346,11 @@ endif
###################################################### ######################################################
# Check the compiler version(s) # Check the compiler version(s)
###################################################### ######################################################
ifdef REQUIRED_CC_VER
CC_CHECK :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER)) CC_CHECK :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
endif
sane-compiler: sane-link sane-compiler: sane-link
ifdef REQUIRED_CC_VER
@if [ "$(CC_CHECK)" = "missing" ]; then \ @if [ "$(CC_CHECK)" = "missing" ]; then \
$(ECHO) "ERROR: The Compiler version is undefined. \n" \ $(ECHO) "ERROR: The Compiler version is undefined. \n" \
"" >> $(ERROR_FILE) ; \ "" >> $(ERROR_FILE) ; \
@ -1359,6 +1365,7 @@ ifndef OPENJDK
"" >> $(WARNING_FILE) ; \ "" >> $(WARNING_FILE) ; \
fi fi
endif endif
endif
###################################################### ######################################################
# Check that ALSA headers and libs are installed and # Check that ALSA headers and libs are installed and

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2003, 2011, 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
@ -109,7 +109,7 @@ else
LDFLAGS += -R \$$ORIGIN/jli LDFLAGS += -R \$$ORIGIN/jli
endif endif
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
LDFLAGS += -Wl,-z -Wl,origin LDFLAGS += $(LDFLAG_Z_ORIGIN)
LDFLAGS += -Wl,--allow-shlib-undefined LDFLAGS += -Wl,--allow-shlib-undefined
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli
endif endif

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2000, 2011, 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
@ -820,7 +820,7 @@ $(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
$(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC) $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
$(prep-target) $(prep-target)
($(CD) $(TEMPDIR); $(CC) $(CPPFLAGS) $(LDDFLAGS) \ ($(CD) $(TEMPDIR); $(HOST_CC) $(CPPFLAGS) $(LDDFLAGS) \
-o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC)) -o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
$(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE) $(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
@ -851,7 +851,7 @@ GENUC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENUC_SRC) | \
$(GENUC_EXE) : $(GENUC_SRC) $(GENUC_EXE) : $(GENUC_SRC)
$(prep-target) $(prep-target)
$(CC) $(CPPFLAGS) -o $@ $(GENUC_SRC) $(HOST_CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
$(SFS_GEN)/UnixConstants.java: $(GENUC_EXE) $(SFS_GEN)/UnixConstants.java: $(GENUC_EXE)
$(prep-target) $(prep-target)
@ -867,7 +867,7 @@ GENSC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSC_SRC) | \
$(GENSC_EXE) : $(GENSC_SRC) $(GENSC_EXE) : $(GENSC_SRC)
$(prep-target) $(prep-target)
$(CC) $(CPPFLAGS) -o $@ $(GENSC_SRC) $(HOST_CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
$(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE) $(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE)
$(prep-target) $(prep-target)

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2002, 2011, 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
@ -73,6 +73,15 @@ else
ifeq ($(ARCH), amd64) ifeq ($(ARCH), amd64)
CPPFLAGS += -DX_ARCH=X_AMD64 CPPFLAGS += -DX_ARCH=X_AMD64
endif # ARCH amd64 endif # ARCH amd64
ifeq ($(ARCH), arm)
CPPFLAGS += -DX_ARCH=X_ARM
endif # ARCH arm
ifeq ($(ARCH), ppc)
CPPFLAGS += -DX_ARCH=X_PPC
endif # ARCH ppc
endif endif

View file

@ -61,7 +61,7 @@ ifneq ($(PLATFORM), windows)
# ODBC_LIBRARY_LOCATION, and delete the variable assignments below. # ODBC_LIBRARY_LOCATION, and delete the variable assignments below.
# #
# Tell linker to ignore missing externals when building this shared library. # Tell linker to ignore missing externals when building this shared library.
LDFLAGS_DEFS_OPTION = -z nodefs LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker nodefs
# Define a place to create the fake libraries and their names. # Define a place to create the fake libraries and their names.
ODBC_LIBRARY_LOCATION = $(TEMPDIR) ODBC_LIBRARY_LOCATION = $(TEMPDIR)
ODBC_FAKE_LIBRARIES = $(ODBC_LIBRARY_LOCATION)/libodbcinst.so $(ODBC_LIBRARY_LOCATION)/libodbc.so ODBC_FAKE_LIBRARIES = $(ODBC_LIBRARY_LOCATION)/libodbcinst.so $(ODBC_LIBRARY_LOCATION)/libodbc.so

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1998, 2011, 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
@ -30,6 +30,7 @@
BUILDDIR = .. BUILDDIR = ..
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
# Note: freetypecheck is built by Sanity.gmk if needed
SUBDIRS = \ SUBDIRS = \
addjsum \ addjsum \
buildmetaindex \ buildmetaindex \
@ -38,7 +39,6 @@ SUBDIRS = \
compile_properties \ compile_properties \
dir_diff \ dir_diff \
dtdbuilder \ dtdbuilder \
freetypecheck \
generate_break_iterator \ generate_break_iterator \
GenerateCharacter \ GenerateCharacter \
generatecurrencydata \ generatecurrencydata \

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2011, 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
@ -39,6 +39,8 @@
#define X_IA64 4 #define X_IA64 4
#define X_AMD64 5 #define X_AMD64 5
#define X_ZERO 6 #define X_ZERO 6
#define X_ARM 7
#define X_PPC 8
// ********************************** // **********************************
// Make sure you set X_PLATFORM and X_ARCH defines correctly. // Make sure you set X_PLATFORM and X_ARCH defines correctly.

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2011, 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
@ -28,7 +28,7 @@
#ifdef __NEWVALID /* special setup for Sun test regime */ #ifdef __NEWVALID /* special setup for Sun test regime */
#if defined(i386) || defined(i486) || \ #if defined(i386) || defined(i486) || \
defined(intel) || defined(x86) || \ defined(intel) || defined(x86) || defined(arm) || \
defined(i86pc) || defined(_M_IA64) || defined(ia64) defined(i86pc) || defined(_M_IA64) || defined(ia64)
#define _LITTLE_ENDIAN #define _LITTLE_ENDIAN
#endif #endif