Skip to content

Commit

Permalink
Merge pull request #3237 from nbhuiyan/osx-nasm-compressedrefs
Browse files Browse the repository at this point in the history
Fix JIT on macOS crash in compressedrefs builds
  • Loading branch information
0xdaryl committed Oct 12, 2018
2 parents d779403 + 906c9ad commit db883be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions runtime/compiler/x/runtime/X86Unresolveds.pnasm
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
;
; This program and the accompanying materials are made available under
; the terms of the Eclipse Public License 2.0 which accompanies this
; distribution and is available at https:
; distribution and is available at https://www.eclipse.org/legal/epl-2.0/
; or the Apache License, Version 2.0 which accompanies this distribution and
; is available at https:
; is available at https://www.apache.org/licenses/LICENSE-2.0.
;
; This Source Code may also be made available under the following
; Secondary Licenses when the conditions for such availability set
Expand All @@ -18,8 +18,6 @@
;
; SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception

%include "x/runtime/X86PicBuilder_nasm.inc"

#include "j9cfg.h"

%ifndef TR_HOST_64BIT
Expand All @@ -36,6 +34,7 @@
eq_offsetof_J9Object_clazz equ 8 ; offset of class pointer in a J9Object

%include "jilconsts.inc"
%include "x/runtime/X86PicBuilder_nasm.inc"

segment .text

Expand Down Expand Up @@ -1123,7 +1122,8 @@ eq_offsetof_J9Object_clazz equ 8 ; offset of class pointer in a J9Objec
eq_offsetof_J9Object_clazz equ 16 ; offset of class pointer in a J9Object
#endif

%include "jilconsts.inc"
%include "jilconsts.inc"
%include "x/runtime/X86PicBuilder_nasm.inc"

segment .text

Expand Down
6 changes: 4 additions & 2 deletions runtime/jilgen/jilconsts.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ 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 */
return omrstr_printf(line, sizeof(line), "%s = %zu\n", name, value);
#elif defined(WIN32) || defined(OSX) /* LINUX */
#elif defined(WIN32) /* LINUX */
return omrstr_printf(line, sizeof(line), "%s equ %zu\n", name, value);
#elif defined(J9ZOS390) /* WIN32 */
return omrstr_printf(line, sizeof(line), "%s EQU %zu\n", name, value);
#else /* J9ZOS390 */
#elif defined(OSX) /* J9ZOS390 */
return omrstr_printf(line, sizeof(line), "%%define %s %zu\n", name, value);
#else /* OSX */
#error "Unknown constant format"
#endif /* J9VM_ARCH_POWER || J9VM_ARCH_ARM */
}
Expand Down

0 comments on commit db883be

Please sign in to comment.