Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn libffi into a static link library #1900

Merged
merged 1 commit into from
May 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 13 additions & 30 deletions runtime/libffi/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2014, 2017 IBM Corp. and others
Copyright (c) 2014, 2018 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
Expand All @@ -21,36 +21,8 @@ OpenJDK Assembly Exception [2].
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
-->
<module>
<exports group="raw_api">
<export name="ffi_raw_call" />
<export name="ffi_ptrarray_to_raw" />
</exports>

<artifact type="shared" name="ffi" bundle="jvm" loadgroup="">
<options>
<option name="isRequired" />
<option name="prototypeHeaderFileNames" data="ffi.h" />
<option name="nonIBMCopyright" data="libFFI foreign function interface library Copyright (C) 2011 Anthony Green" />
<option name="dllDescription" data="libFFI" />
</options>
<artifact type="static" name="ffi" bundle="jvm" loadgroup="">
<phase>core</phase>
<exports>
<group name="raw_api">
<exclude-if condition="spec.win_x86-64.*" />
</group>
<export name="ffi_prep_cif" />
<export name="ffi_call" />
<export name="ffi_type_void" />
<export name="ffi_type_uint8" />
<export name="ffi_type_sint8" />
<export name="ffi_type_sint16" />
<export name="ffi_type_uint16" />
<export name="ffi_type_sint32" />
<export name="ffi_type_sint64" />
<export name="ffi_type_float" />
<export name="ffi_type_double" />
<export name="ffi_type_pointer" />
</exports>
<includes>
<include path="j9include" />
</includes>
Expand Down Expand Up @@ -174,6 +146,17 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<makefilestub data="FFI_COPY_template = $(UMA_PATH_TO_ROOT)include/$(notdir $(strip $1)) : $1 ; cp -f $$&lt; $$@" />
<makefilestub data="$(foreach H,$(FFI_HEADERS),$(eval $(call FFI_COPY_template,$H)))" />
<makefilestub data="UMA_OBJECTS_PREREQS += $(addprefix $(UMA_PATH_TO_ROOT)include/,$(notdir $(FFI_HEADERS)))" />
<!-- TODO: Temporary workaround for OpenJ9 JDK9 builds referring directly to the ffi shared library -->
<!-- TODO: Remove once the makefiles no longer refer to the ffi shared library -->
<makefilestub data="workaround:" />
<makefilestub data="&#x9;cp -f $(UMA_PATH_TO_ROOT)libj9thr29.so $(UMA_PATH_TO_ROOT)libffi29.so">
<exclude-if condition="spec.win_x86.*" />
</makefilestub>
<makefilestub data="&#x9;cp -f $(UMA_PATH_TO_ROOT)j9thr29.dll $(UMA_PATH_TO_ROOT)ffi29.dll">
<include-if condition="spec.win_x86.*" />
</makefilestub>
<makefilestub data="TARGETS+=workaround" />
<!-- TODO: End of temporary workaround -->
</makefilestubs>
<vpaths>
<!-- vpaths for PPC -->
Expand Down
1 change: 1 addition & 0 deletions runtime/vm/BytecodeInterpreter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "ut_j9vm.h"
#include "vm_internal.h"
#include "jni.h"
#define FFI_BUILDING /* Needed on Windows to link libffi statically */
#include "ffi.h"
#include "jitregmap.h"
#include "j2sever.h"
Expand Down