Skip to content
Snippets Groups Projects
Commit 3ae7e25a authored by stepan's avatar stepan
Browse files

Inline TruffleLLVM_PCRE and TruffleLLVM_Zip in TruffleLLVM_Context

parent 6d24a7dc
No related branches found
No related tags found
No related merge requests found
...@@ -75,11 +75,16 @@ final class TruffleLLVM_Context extends RFFIContext { ...@@ -75,11 +75,16 @@ final class TruffleLLVM_Context extends RFFIContext {
@Override @Override
public void initializeVariables(RContext context) { public void initializeVariables(RContext context) {
super.initializeVariables(context); super.initializeVariables(context);
callState.initializeVariables(); callState.initializeVariables();
TruffleLLVM_PCRE.initialize();
TruffleLLVM_Lapack.initialize(); // Load dependencies that don't automatically get loaded:
TruffleLLVM_Zip.initialize(); TruffleLLVM_Lapack.load();
String pcrePath = LibPaths.getBuiltinLibPath("pcre");
TruffleLLVM_NativeDLL.NativeDLOpenRootNode.create().getCallTarget().call(pcrePath, false, true);
String libzPath = LibPaths.getBuiltinLibPath("z");
TruffleLLVM_NativeDLL.NativeDLOpenRootNode.create().getCallTarget().call(libzPath, false, true);
} }
@Override @Override
......
...@@ -43,7 +43,7 @@ import com.oracle.truffle.r.runtime.ffi.DLLRFFI; ...@@ -43,7 +43,7 @@ import com.oracle.truffle.r.runtime.ffi.DLLRFFI;
*/ */
final class TruffleLLVM_Lapack { final class TruffleLLVM_Lapack {
static void initialize() { static void load() {
/* /*
* This is a workaround for bad LLVM generated by DragonEgg for (some) of the Lapack * This is a workaround for bad LLVM generated by DragonEgg for (some) of the Lapack
* functions; additional spurious arguments. Unfortunately for this to be portable we would * functions; additional spurious arguments. Unfortunately for this to be portable we would
...@@ -62,8 +62,7 @@ final class TruffleLLVM_Lapack { ...@@ -62,8 +62,7 @@ final class TruffleLLVM_Lapack {
} }
// The following libraries should be loaded eagerly (i.e. with the last parameter true), // The following libraries should be loaded eagerly (i.e. with the last parameter true),
// however, // however, they do not load on Linux due to unbound symbols, such as "xerbla_".
// they do not load on Linux due to unbound symbols, such as "xerbla_".
callTarget.call(LibPaths.getBuiltinLibPath("Rblas"), false, false); callTarget.call(LibPaths.getBuiltinLibPath("Rblas"), false, false);
callTarget.call(LibPaths.getBuiltinLibPath("Rlapack"), false, false); callTarget.call(LibPaths.getBuiltinLibPath("Rlapack"), false, false);
} }
......
/*
* Copyright (c) 2014, 2018, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.truffle.r.ffi.impl.llvm;
import com.oracle.truffle.r.ffi.impl.common.LibPaths;
final class TruffleLLVM_PCRE {
private TruffleLLVM_PCRE() {
}
static void initialize() {
// Need to ensure that the native pcre library is loaded
String pcrePath = LibPaths.getBuiltinLibPath("pcre");
TruffleLLVM_NativeDLL.NativeDLOpenRootNode.create().getCallTarget().call(pcrePath, false, true);
}
}
/*
* Copyright (c) 2014, 2018, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.truffle.r.ffi.impl.llvm;
import com.oracle.truffle.r.ffi.impl.common.LibPaths;
final class TruffleLLVM_Zip {
private TruffleLLVM_Zip() {
}
static void initialize() {
// Need to ensure that the native libz library is loaded
String libzPath = LibPaths.getBuiltinLibPath("z");
TruffleLLVM_NativeDLL.NativeDLOpenRootNode.create().getCallTarget().call(libzPath, false, true);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment