From 72d101a4451a17143f1e50c0409d39a4bfc82c88 Mon Sep 17 00:00:00 2001 From: dholmes Date: Wed, 30 May 2012 00:37:21 -0400 Subject: [PATCH] 7171653: 32-bit cross-compile on 64-bit build host generates 64-bit data for awt/X11 leading to crash Reviewed-by: ohair, anthony --- make/sun/xawt/Makefile | 21 ++++++++++++++------- makefiles/sun/xawt/Makefile | 22 +++++++++++++++------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/make/sun/xawt/Makefile b/make/sun/xawt/Makefile index 6ed737088..791bd2dc3 100644 --- a/make/sun/xawt/Makefile +++ b/make/sun/xawt/Makefile @@ -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 @@ -225,10 +225,16 @@ ifeq ($(ARCH_DATA_MODEL), 32) 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 @@ -264,16 +270,17 @@ WRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt -$(SIZERS): $(SIZERS_C) - $(prep-target) ifndef CROSS_COMPILE_ARCH - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) -o $@ $(CPPFLAGS) $(SIZER)$(suffix $@).o +SIZERS_CC = $(CC) else - $(HOST_CC) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c - $(HOST_CC) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).o +SIZERS_CC = $(HOST_CC) endif +$(SIZERS): $(SIZERS_C) + $(prep-target) + $(SIZERS_CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c + $(SIZERS_CC) $(CFLAGS_$(subst .,,$(suffix $@))) -o $@ $(CPPFLAGS) $(SIZER)$(suffix $@).o + $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA) $(prep-target) $(BOOT_JAVAC_CMD) -d $(WRAPPER_GENERATOR_TEMPDIR) $(WRAPPER_GENERATOR_JAVA) diff --git a/makefiles/sun/xawt/Makefile b/makefiles/sun/xawt/Makefile index 14409bd18..14b065184 100644 --- a/makefiles/sun/xawt/Makefile +++ b/makefiles/sun/xawt/Makefile @@ -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 @@ -225,10 +225,16 @@ ifeq ($(ARCH_DATA_MODEL), 32) 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 @@ -264,16 +270,18 @@ WRAPPER_GENERATOR_TEMPDIR=$(TEMPDIR)/sun/awt/X11/generator WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt -$(SIZERS): $(SIZERS_C) - $(prep-target) ifndef CROSS_COMPILE_ARCH - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c - $(CC) $(CFLAGS_$(subst .,,$(suffix $@))) -o $@ $(CPPFLAGS) $(SIZER)$(suffix $@).o +SIZERS_CC = $(CC) else - $(HOST_CC) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c - $(HOST_CC) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).o +SIZERS_CC = $(HOST_CC) endif +$(SIZERS): $(SIZERS_C) + $(prep-target) + + $(SIZERS_CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -c -o $(SIZER)$(suffix $@).o $(SIZER)$(suffix $@).c + $(SIZERS_CC) $(CFLAGS_$(subst .,,$(suffix $@))) -o $@ $(CPPFLAGS) $(SIZER)$(suffix $@).o + $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA) $(prep-target) $(BOOT_JAVAC_CMD) -d $(WRAPPER_GENERATOR_TEMPDIR) $(WRAPPER_GENERATOR_JAVA) -- GitLab