svadev AT lists.siebelschool.illinois.edu
Subject: Svadev mailing list
List archive
- From: Baozeng <sploving1 AT gmail.com>
- To: mentor <criswell AT illinois.edu>
- Cc: svadev AT cs.illinois.edu
- Subject: [svadev] How to test SoftBound in SAFECode
- Date: Mon, 7 May 2012 19:06:41 +0800
- List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
- List-id: <svadev.cs.uiuc.edu>
Dear mentor,
Before enable BBC in SAFECode, I would like to dive into SoftBound source code first. In its README file, it says there are two ways to compile a program with SoftBound:
1. STEP0: Generate softbound instrumentation bitcode
a) Copy softboundcets.c, softboundcets-checks.c and
softboundcets-wrappers.c softboundcets.h to the current working
directory. Then execute the following set of commands:
clang -c -emit-llvm -D__SOFTBOUNDCETS_TRIE -D__SOFTBOUNDCETS_SPATIAL_TEMPORAL softboundcets-checks.c -o softboundcets-checks.bc
clang -c -emit-llvm -D__SOFTBOUNDCETS_TRIE -D__SOFTBOUNDCETS_SPATIAL_TEMPORAL softboundcets.c -o softboundcets.bc
clang -c -emit-llvm -D__SOFTBOUNDCETS_TRIE -D__SOFTBOUNDCETS_SPATIAL_TEMPORAL softboundcets-wrappers.c -o softboundcets-wrappers.bc
STEP1: compile each individual source file
clang -c -emit-llvm test/test1a.c -o test1a.bc
clang -c -emit-llvm test/test1b.c -o test1b.bc
STEP2: create a single module using llvm-ld by using all the source files
llvm-ld test1a.bc test1b.bc -o test1
STEP3: link the softbound checks file
llvm-link softboundcets-checks.bc test1.bc > test-linked.bc
STEP4: run the softbound instrumentation
SoftBoundCETS -softboundcets_spatial_safety -softboundcets_temporal_safety test-linked.bc
STEP5: link the wrappers
llvm-link softboundcets.bc test-linked.bc.sbpass.bc softboundcets-wrappers.bc > test-softbound.bc
STEP6: generate native code
llvm-ld -native -lm -lcrypt -lpthread test-softbound.bc -o test-softbound.out -lm
./test-softbound.out
2. Use clang with -fsoftbound as the flag to run SoftBound+CETS.
If I understand it correctly, -fsoftbound in the second way does all the things in the first way, am I right? so I tried the second way, like this:
clang -g -fsoftbound -o test test.c (the test file is the example in the safecode/docs/UsersGuide.html)
it shows the following error:
/usr/local/lib/libsoftbound_rt.a(softboundcets-wrappers.o): In function `__softboundcets_metadata_store':
/home/sploving/llvm/projects/safecode/runtime/SoftBoundRuntime/softboundcets.h:636: multiple definition of `__softboundcets_metadata_store'
/usr/local/lib/libsoftbound_rt.a(softboundcets.o):/home/sploving/llvm/projects/safecode/runtime/SoftBoundRuntime/softboundcets.h:636: first defined here
/usr/local/lib/libsoftbound_rt.a(softboundcets-wrappers.o): In function `__softboundcets_metadata_load':
/home/sploving/llvm/projects/safecode/runtime/SoftBoundRuntime/softboundcets.h:722: multiple definition of `__softboundcets_metadata_load'
/usr/local/lib/libsoftbound_rt.a(softboundcets.o):/home/sploving/llvm/projects/safecode/runtime/SoftBoundRuntime/softboundcets.h:722: first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What is the matter? It says that SoftBound has been
tested with LLVM-3.0 on 64-bit x86 machines with a 64-bit linux OS, then in my 32-bit Linux (FC16), does it not work?
thanks.
--
Best Regards,
Baozeng Ding
OSTG,NFS,ISCAS
- [svadev] How to test SoftBound in SAFECode, Baozeng, 05/07/2012
Archive powered by MHonArc 2.6.16.