From e60752deff219ec145ac9608b2c62e3d88c617b5 Mon Sep 17 00:00:00 2001 From: Nazim Uddin Bhuiyan Date: Tue, 8 Jan 2019 14:31:48 -0500 Subject: [PATCH] Add missing platform check for defining NASM_ASSEMBLER macro Fix bug that defined NASM_ASSEMBLER on unsupported platforms. Signed-off-by: Nazim Uddin Bhuiyan --- runtime/compiler/runtime/asmprotos.h | 4 ++-- runtime/jilgen/jilconsts.c | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/compiler/runtime/asmprotos.h b/runtime/compiler/runtime/asmprotos.h index 445720cbc61..185a843a981 100644 --- a/runtime/compiler/runtime/asmprotos.h +++ b/runtime/compiler/runtime/asmprotos.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2018 IBM Corp. and others + * Copyright (c) 2000, 2019 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -64,7 +64,7 @@ extern "C" { * is set for OS variants that currently use NASM and is used to * decide the version of helper names to use. */ -#if defined(OSX) || (defined(LINUX) && defined(TR_HOST_64BIT)) +#if defined(OSX) || (defined(LINUX) && defined(TR_HOST_X86) && defined(TR_HOST_64BIT)) #define NASM_ASSEMBLER #endif diff --git a/runtime/jilgen/jilconsts.c b/runtime/jilgen/jilconsts.c index 409299bb346..62586afa292 100644 --- a/runtime/jilgen/jilconsts.c +++ b/runtime/jilgen/jilconsts.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 1991, 2018 IBM Corp. and others + * Copyright (c) 1991, 2019 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -76,7 +76,11 @@ createConstant(OMRPortLibrary *OMRPORTLIB, char const *name, UDATA value) return omrstr_printf(line, sizeof(line), "#define %s %zu\n", name, value); #elif defined(LINUX) /* J9VM_ARCH_POWER || J9VM_ARCH_ARM */ #if defined(J9VM_ENV_DATA64) - return omrstr_printf(line, sizeof(line), "%%define %s %zu\n", name, value); + #if defined(J9VM_ARCH_X86) + return omrstr_printf(line, sizeof(line), "%%define %s %zu\n", name, value); + #else /* J9VM_ARCH_X86 */ + return omrstr_printf(line, sizeof(line), "%s = %zu\n", name, value); + #endif /* J9VM_ARCH_X86 */ #else /* J9VM_ENV_DATA64 */ return omrstr_printf(line, sizeof(line), "%s = %zu\n", name, value); #endif