Commit 409fb094 authored by Jason Hiser's avatar Jason Hiser 🚜

doing cleanup for release

parent 6c0e7292
import shutil
import os
import tarfile
Import('env')
(sysname, nodename, release, version, machine)=os.uname()
irdb_env=env.Clone()
irdb_env.Append(CXXFLAGS=" -std=c++11 -Wall -Werror -fmax-errors=2 ")
irdb_env.Append(LINKFLAGS=" -Wl,-unresolved-symbols=ignore-in-shared-libs ")
irdb_env['BASE_IRDB_LIBS']="irdb-core"
# pebliss requires iconv, which needs to be explicit on cygwin.
if "CYGWIN" in sysname:
# add tuple of 1 item!
irdb_env['BASE_IRDB_LIBS']=irdb_env['BASE_IRDB_LIBS']+("iconv",)
irdb_env['IRDB_INC']='''
$IRDB_SDK/include
$SECURITY_TRANSFORMS_HOME/include/
$SECURITY_TRANSFORMS_HOME/libEXEIO/include
$SECURITY_TRANSFORMS_HOME/libStructDiv/include
'''
irdb_env.Append(CXXFLAGS=" -std=c++11 -Wall -Werror -fmax-errors=2 " )
irdb_env.Append(LIBS= Split("irdb-core irdb-transform" ))
irdb_env.Append(CPPPATH= " $IRDB_SDK/include " )
irdb_env.Append(LIBPATH= Split(" "+os.environ['PEASOUP_HOME']+"/irdb-libs/lib "))
irdb_env.Replace(INSTALL_PATH=os.environ['PWD']+"/plugins_install" )
Export('irdb_env')
......@@ -36,12 +19,4 @@ for dir in dirs:
lib=irdb_env.SConscript(dir+"/SConscript", variant_dir='scons_build/'+dir)
libs = libs + lib
pedi = Command( target = "./testoutput",
source = "./SConscript",
action = "cd "+os.environ['SECURITY_TRANSFORMS_HOME']+" ; " +os.environ['PEDI_HOME']+"/pedi -m manifest.txt ; cd -" )
Depends(pedi,libs)
Default( pedi )
Return('pedi')
Return('libs')
import os
import sys
(sysname, nodename, release, version, machine)=os.uname()
env=Environment()
......@@ -14,8 +11,7 @@ env.Replace(CXXFLAGS="-fPIC -Wall ")
env.Replace(LINKFLAGS="-fPIC -Wall ")
# parse arguments
env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
env.Replace(SMPSA_HOME=os.environ['SMPSA_HOME'])
env.Replace(COOKBOOK_HOME=os.environ['COOKBOOK_HOME'])
env.Replace(IRDB_SDK=os.environ['IRDB_SDK'])
env.Replace(debug=ARGUMENTS.get("debug",0))
......
import os
Import('irdb_env')
# import and create a copy of the environment so we don't screw up anyone elses env.
Import('irdb_env')
myenv=irdb_env.Clone()
cpppath=myenv['IRDB_INC']
# set input files and output program name
files=Glob( Dir('.').srcnode().abspath+"/*.cpp")
pgm_name="initialize_stack.exe"
pgm="initialize_stack.exe"
LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
LIBS=Split("stars "+ myenv.subst('$BASE_IRDB_LIBS')+ " irdb-cfg irdb-util irdb-transform StructDiv ")
myenv=myenv.Clone(CPPPATH=Split(cpppath))
myenv.Append(CXXFLAGS = " -std=c++11 -Wall ")
pgm=myenv.Program(pgm, files, LIBPATH=LIBPATH, LIBS=LIBS)
install=myenv.Install("$SECURITY_TRANSFORMS_HOME/plugins_install/", pgm)
# build, install and return the program.
pgm=irdb_env.Program(pgm_name, files)
install=myenv.Install("$INSTALL_PATH/", pgm)
Default(install)
Return('install')
......@@ -4,23 +4,13 @@ Import('irdb_env')
# import and create a copy of the environment so we don't screw up anyone elses env.
myenv=irdb_env.Clone()
cpppath=irdb_env['IRDB_INC'] + " $SECURITY_TRANSFORMS_HOME/third_party/elfio-code/ "
files=Glob( Dir('.').srcnode().abspath+"/*.cpp")
myenv.Append(CXXFLAGS = " -std=c++11 ")
pgm="kill_deads.exe"
LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
LIBS=Split("stars "+ myenv.subst('$BASE_IRDB_LIBS')+ " irdb-transform irdb-deep irdb-util ")
myenv=myenv.Clone(CPPPATH=Split(cpppath))
pgm=myenv.Program(pgm, files, LIBPATH=LIBPATH, LIBS=LIBS)
install=myenv.Install("$SECURITY_TRANSFORMS_HOME/plugins_install/", pgm)
libs=Split("irdb-core irdb-transform irdb-deep irdb-util ")
pgm=myenv.Program(pgm, files, LIBS=libs)
install=myenv.Install("$INSTALL_PATH/", pgm)
Default(install)
Return('install')
export COOKBOOK_HOME=$PWD
export PSPATH=$PSPATH:$COOKBOOK_HOME/plugins_install
......@@ -2,25 +2,22 @@ import os
Import('irdb_env')
# import and create a copy of the environment so we don't screw up anyone elses env.
Import('irdb_env')
myenv=irdb_env.Clone()
cpppath=irdb_env['IRDB_INC']
# input fies and program name
files=Glob( Dir('.').srcnode().abspath+"/*.cpp")
pgm_name="libstack_stamp.so"
pgm="libstack_stamp.so"
LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
LIBS=Split("stars "+ irdb_env.subst('$BASE_IRDB_LIBS')+ " irdb-cfg irdb-util irdb-transform EXEIO ")
myenv=myenv.Clone(CPPPATH=Split(cpppath))
myenv.Append(CXXFLAGS = " -std=c++11 -Wall ")
pgm=myenv.SharedLibrary(pgm, files, LIBPATH=LIBPATH, LIBS=LIBS)
install=myenv.Install("$SECURITY_TRANSFORMS_HOME/plugins_install/", pgm)
Default(install)
# add extra libraries needed for stck stamping
myenv.Append(LIBS= Split(" irdb-cfg irdb-util irdb-transform "))
# build, install and return the program
pgm=myenv.SharedLibrary(pgm_name, files)
install=myenv.Install("$INSTALL_PATH/", pgm)
Default(install)
Return('install')
......@@ -51,12 +51,10 @@ StackStamp_t::StackStamp_t(FileIR_t *p_variantIR, StampValue_t sv, bool p_verbos
Transform(p_variantIR),
stamp_value(sv),
instructions_added(0),
m_elfiop(new EXEIO::exeio),
verbose(p_verbose),
functionsTransformed(0),
functionsNotTransformed(0)
{
m_elfiop->load("a.ncexe");
}
......@@ -71,7 +69,7 @@ bool StackStamp_t::can_stamp(Function_t* f)
return false;
// _start does not have a return address on the stack.
if(f->getEntryPoint()->getAddress()->getVirtualOffset() == (VirtualOffset_t)m_elfiop->get_entry())
if(f->getName() == "_start")
{
cout<<"Skipping instrumentation of _start. Insn is: "<<f->getEntryPoint()->getDisassembly()<<endl;
return false;
......
......@@ -24,7 +24,6 @@
#include <irdb-core>
#include <irdb-transform>
#include <memory>
#include <exeio.h>
using namespace IRDB_SDK;
......@@ -88,7 +87,6 @@ class StackStamp_t : public Transform
StampValue_t stamp_value;
int instructions_added;
std::unique_ptr<EXEIO::exeio> m_elfiop;
bool verbose;
std::map<EhProgramPlaceHolder_t, IRDB_SDK::EhProgram_t*> all_eh_pgms;
int functionsTransformed;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment