diff --git a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Context.java b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Context.java index e898711c4ee5131cd4a2798af98f8d0618cfee44..34d2a00ddf87b52bb24badd850aa5de3d5976906 100644 --- a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Context.java +++ b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Context.java @@ -75,11 +75,16 @@ final class TruffleLLVM_Context extends RFFIContext { @Override public void initializeVariables(RContext context) { super.initializeVariables(context); - callState.initializeVariables(); - TruffleLLVM_PCRE.initialize(); - TruffleLLVM_Lapack.initialize(); - TruffleLLVM_Zip.initialize(); + + // Load dependencies that don't automatically get loaded: + 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 diff --git a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Lapack.java b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Lapack.java index 8d38e10a3b304003ab95d7f2d24746f01c54eefc..30ce4603df574624ec46e549067b233f1beae106 100644 --- a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Lapack.java +++ b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Lapack.java @@ -43,7 +43,7 @@ import com.oracle.truffle.r.runtime.ffi.DLLRFFI; */ 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 * functions; additional spurious arguments. Unfortunately for this to be portable we would @@ -62,8 +62,7 @@ final class TruffleLLVM_Lapack { } // The following libraries should be loaded eagerly (i.e. with the last parameter true), - // however, - // they do not load on Linux due to unbound symbols, such as "xerbla_". + // however, they do not load on Linux due to unbound symbols, such as "xerbla_". callTarget.call(LibPaths.getBuiltinLibPath("Rblas"), false, false); callTarget.call(LibPaths.getBuiltinLibPath("Rlapack"), false, false); } diff --git a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_PCRE.java b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_PCRE.java deleted file mode 100644 index 31b6439aa361287e1cd08a43e0de580fc205bfee..0000000000000000000000000000000000000000 --- a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_PCRE.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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); - } -} diff --git a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Zip.java b/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Zip.java deleted file mode 100644 index eb4fcd3775904da1e9ae5099e982dc37a95b5eff..0000000000000000000000000000000000000000 --- a/com.oracle.truffle.r.ffi.impl/src/com/oracle/truffle/r/ffi/impl/llvm/TruffleLLVM_Zip.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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); - } -}