changeset 5259:3fc3d4ae7e47

7171653: 32-bit cross-compile on 64-bit build host generates 64-bit data for awt/X11 leading to crash Reviewed-by: ohair, anthony
author dholmes
date Thu, 31 May 2012 04:58:38 -0400
parents 11987e85555f
children e1c679a00712
files make/sun/xawt/Makefile
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/make/sun/xawt/Makefile	Wed May 30 23:36:32 2012 -0700
+++ b/make/sun/xawt/Makefile	Thu May 31 04:58:38 2012 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2012, 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
@@ -232,10 +232,16 @@
 SIZERS = $(SIZER).32
 SIZERS_C = $(SIZER_32_C)
 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
+ifdef CROSS_COMPILE_ARCH
+CFLAGS_32 = -m32
+endif
 else # !32
 SIZERS = $(SIZER).64
 SIZERS_C = $(SIZER_64_C)
 SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.64
+ifdef CROSS_COMPILE_ARCH
+CFLAGS_64 = -m64
+endif
 endif # 32
 endif # !macosx
 endif # solaris
@@ -271,13 +277,15 @@
 WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class 
 XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt
 
+ifndef CROSS_COMPILE_ARCH
+SIZERS_CC = $(CC)
+else
+SIZERS_CC = $(HOST_CC)
+endif
+
 $(SIZERS): $(SIZERS_C) 
 	$(prep-target)
-ifndef CROSS_COMPILE_ARCH
-	$(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
-else
-	$(HOST_CC) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
-endif
+	$(SIZERS_CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
 
 $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA)
 	$(prep-target)