merge
This commit is contained in:
commit
5f0a7180d0
|
@ -1,5 +1,9 @@
|
|||
language: android
|
||||
jdk: oraclejdk8
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- realpath
|
||||
before_install:
|
||||
- "git clone --depth=1 https://github.com/secure-software-engineering/DroidBench.git /tmp/DroidBench"
|
||||
install:
|
||||
|
|
|
@ -111,7 +111,6 @@ public class JSCallGraphBuilderUtil extends com.ibm.wala.cast.js.ipa.callgraph.J
|
|||
} catch (FileNotFoundException e) {
|
||||
// I guess we need to do this on Windows sometimes? --MS
|
||||
// if this fails, we won't catch the exception
|
||||
f = provider.getFile(dir + "/" + name, JSCallGraphBuilderUtil.class.getClassLoader());
|
||||
}
|
||||
return f.toURI().toURL();
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ include ../../../com.ibm.wala.cast/source/c/Makefile.definitions
|
|||
|
||||
TEST_JNI_BRIDGE_HEADER = $(C_GENERATED)com_ibm_wala_cast_test_TestNativeTranslator.h
|
||||
|
||||
CAST_OBJS = $(wildcard $(C_GENERATED)/*.o)
|
||||
|
||||
#
|
||||
# rules
|
||||
#
|
||||
|
@ -19,10 +21,14 @@ $(TEST_JNI_BRIDGE_HEADER): $(CAST_TEST_BIN)com/ibm/wala/cast/test/TestNativeTran
|
|||
$(C_GENERATED)/smoke.o: $(TEST_JNI_BRIDGE_HEADER) smoke.cpp
|
||||
$(CC) $(ALL_FLAGS) -o $@ -c smoke.cpp
|
||||
|
||||
$(C_GENERATED)/smoke_main.o: $(TEST_JNI_BRIDGE_HEADER) smoke_main.cpp
|
||||
$(CC) $(ALL_FLAGS) -o $@ -c smoke_main.cpp
|
||||
|
||||
$(CAST_TEST_BIN)$(LIBPREFIX)xlator_test.$(DLLEXT): $(C_GENERATED)/smoke.o
|
||||
$(CC) $(CC_LDFLAGS) -Wl,-rpath -Wl,$(DOMO_AST_BIN) $(DOMO_AST_BIN)/$(LIBPREFIX)cast.$(DLLEXT) $^ -o $@
|
||||
$(CC) $(CC_LDFLAGS) -Wl,-rpath -Wl,$(DOMO_AST_BIN) $(CAST_OBJS) -o $@
|
||||
|
||||
main: $(CAST_TEST_BIN)/smoke_main
|
||||
|
||||
$(CAST_TEST_BIN)/smoke_main: $(TEST_JNI_BRIDGE_HEADER) smoke_main.cpp
|
||||
$(CC) $(ALL_FLAGS) -Wl,-rpath -Wl,$(DOMO_AST_BIN) $(DOMO_AST_BIN)/$(LIBPREFIX)cast.$(DLLEXT) -o $@ smoke_main.cpp
|
||||
$(CAST_TEST_BIN)/smoke_main: $(TEST_JNI_BRIDGE_HEADER) $(DOMO_AST_BIN)/$(LIBPREFIX)cast/launch.o $(C_GENERATED)/smoke_main.o
|
||||
$(CC) $(ALL_FLAGS) $(DOMO_AST_BIN)/$(LIBPREFIX)cast/launch.o $(C_GENERATED)/smoke_main.o $(CC_LD_PATHS) -o $@
|
||||
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
<<<<<<< HEAD
|
||||
C_DIR=`realpath $0`
|
||||
CAST_TEST_DIR=`realpath $C_DIR/../../..`
|
||||
=======
|
||||
SCRIPT_NAME=`realpath $0`
|
||||
C_DIR=`dirname $SCRIPT_NAME`
|
||||
CAST_TEST_DIR=`realpath $C_DIR/../..`
|
||||
>>>>>>> f3a38f50d825bd4e2fa6a5fb230a9664fce831c5
|
||||
|
||||
pushd $CAST_TEST_DIR/harness-src/c
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "launch.h"
|
||||
#include <stdlib.h>
|
||||
#include <strings.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char buf[ strlen(argv[1]) + 1 ];
|
||||
|
|
|
@ -24,15 +24,11 @@ import com.ibm.wala.cast.tree.impl.CAstImpl;
|
|||
import com.ibm.wala.cast.tree.rewrite.CAstRewriter.CopyKey;
|
||||
import com.ibm.wala.cast.tree.rewrite.CAstRewriter.RewriteContext;
|
||||
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
|
||||
import com.ibm.wala.util.PlatformUtil;
|
||||
import com.ibm.wala.util.io.TemporaryFile;
|
||||
|
||||
public class TestNativeTranslator {
|
||||
|
||||
static {
|
||||
if (! PlatformUtil.onMacOSX()) {
|
||||
System.loadLibrary("cast");
|
||||
}
|
||||
System.loadLibrary("xlator_test");
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
<goal>exec</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<<<<<<< HEAD
|
||||
<execution>
|
||||
<id>test-native</id>
|
||||
<phase>test</phase>
|
||||
|
@ -41,6 +42,8 @@
|
|||
<goal>exec</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
=======
|
||||
>>>>>>> f3a38f50d825bd4e2fa6a5fb230a9664fce831c5
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
@ -52,7 +55,11 @@
|
|||
<phase>test</phase>
|
||||
<configuration>
|
||||
<testClassesDirectory>${project.build.outputDirectory}</testClassesDirectory>
|
||||
<<<<<<< HEAD
|
||||
<argLine>-Djava.library.path=${project.build.outputDirectory} -ea</argLine>
|
||||
=======
|
||||
<argLine>-Djava.library.path=${project.build.outputDirectory}:${basedir}/../com.ibm.wala.cast/target/classes -ea</argLine>
|
||||
>>>>>>> f3a38f50d825bd4e2fa6a5fb230a9664fce831c5
|
||||
<redirectTestOutputToFile>true</redirectTestOutputToFile>
|
||||
</configuration>
|
||||
<goals>
|
||||
|
|
|
@ -7,7 +7,7 @@ include Makefile.definitions
|
|||
# rules
|
||||
#
|
||||
|
||||
default: $(DOMO_AST_BIN)$(LIBPREFIX)cast.$(DLLEXT)
|
||||
default: $(DOMO_AST_BIN)$(LIBPREFIX)cast.$(DLLEXT) $(DOMO_AST_BIN)$(LIBPREFIX)cast.a
|
||||
|
||||
bindir:
|
||||
mkdir -p $(C_GENERATED)
|
||||
|
@ -25,6 +25,9 @@ $(CAPA_OBJECTS): $(C_GENERATED)%.o: %.cpp $(CAPA_JNI_HEADERS) bindir
|
|||
$(DOMO_AST_BIN)$(LIBPREFIX)cast.$(DLLEXT): $(CAPA_OBJECTS)
|
||||
$(CC) $(CC_LDFLAGS) $^ -o $@
|
||||
|
||||
$(DOMO_AST_BIN)$(LIBPREFIX)cast.a: $(CAPA_OBJECTS)
|
||||
ar -r $@ $^
|
||||
|
||||
clean:
|
||||
rm -rf $(C_GENERATED) hs_err_pid*
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
JAVA_SDK = /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/
|
||||
|
||||
DOMO_AST_BIN = /Users/dolby/git/WALA/com.ibm.wala.cast/target/classes/
|
||||
|
||||
JAVAH_CLASS_PATH = :/Users/dolby/git/WALA/com.ibm.wala.cast/target/classes/
|
||||
|
||||
TRACE =
|
||||
|
||||
JNI_MD_DIR = darwin
|
||||
|
|
|
@ -57,7 +57,8 @@ else
|
|||
endif
|
||||
endif
|
||||
|
||||
CC_LDFLAGS += -L$(JAVA_SDK)jre/lib/server -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib/server -ljvm
|
||||
CC_LD_PATHS = -L$(JAVA_SDK)jre/lib/amd64/server -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib/amd64/server -L$(JAVA_SDK)jre/lib/x86_64/server -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib/x86_64/server -L$(JAVA_SDK)jre/lib/x64/server -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib/x64/server -L$(JAVA_SDK)jre/lib/server -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib/server -L$(JAVA_SDK)jre/lib -Wl,-rpath -Wl,$(JAVA_SDK)jre/lib -ljvm
|
||||
|
||||
CC_LDFLAGS += $(CC_LD_PATHS)
|
||||
|
||||
ALL_FLAGS += -std=c++11
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
C_DIR=`realpath $0`
|
||||
CAST_DIR=`realpath $C_DIR/../../..`
|
||||
SCRIPT=`realpath $0`
|
||||
C_DIR=`dirname $SCRIPT`
|
||||
CAST_DIR=`realpath $C_DIR/../..`
|
||||
|
||||
pushd $CAST_DIR/source/c
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "jni.h"
|
||||
|
||||
JNIEnv *launch(char *);
|
||||
void kill();
|
||||
extern JNIEnv *launch(char *);
|
||||
extern void kill();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
#include <jni.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include "Exceptions.h"
|
||||
#include "CAstWrapper.h"
|
||||
using namespace std;
|
||||
|
||||
JavaVM *javaVM;
|
||||
|
||||
|
@ -32,7 +30,7 @@ JNIEnv *launch(char *classpath) {
|
|||
long flag = JNI_CreateJavaVM(&javaVM, (void**)
|
||||
&jniEnv, &vmArgs);
|
||||
if (flag == JNI_ERR) {
|
||||
cout << "Error creating VM. Exiting...\n";
|
||||
fprintf(stderr, "Error creating VM. Exiting...\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -42,4 +40,3 @@ JNIEnv *launch(char *classpath) {
|
|||
void kill() {
|
||||
javaVM->DestroyJavaVM();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue