Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Florian Franzmann (52128b0847c3ec382c1f9574ded217325d6e2e95)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Florian Franzmann <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Florian Franzmann (52128b0847c3ec382c1f9574ded217325d6e2e95)
  • Date: Tue, 28 May 2013 13:06:41 -0500

GIT changes to master grimoire by Florian Franzmann
<siflfran AT hawo.stw.uni-erlangen.de>:

ChangeLog | 3 +
devel/oclint/BUILD | 6 +++
devel/oclint/DETAILS | 45 +++++++++++++++++++++++++++
devel/oclint/HISTORY | 3 +
devel/oclint/INSTALL | 4 ++
devel/oclint/PRE_BUILD | 16 +++++++++
devel/oclint/Tools.cpp.patch | 70
+++++++++++++++++++++++++++++++++++++++++++
7 files changed, 147 insertions(+)

New commits:
commit 52128b0847c3ec382c1f9574ded217325d6e2e95
Author: Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
Commit: Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>

devel/oclint: new spell, a static analyzer for C/C++/Objective C code

diff --git a/ChangeLog b/ChangeLog
index f8be222..bdbb1df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2013-05-28 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
+ * devel/oclint: new spell, a static analyzer for C/C++/Objective C
code
+
2013-05-26 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
* devel/zarith: new spell, arbitrary precision integers for ocaml
* devel/why: new spell, a software verification platform
diff --git a/devel/oclint/BUILD b/devel/oclint/BUILD
new file mode 100755
index 0000000..b495064
--- /dev/null
+++ b/devel/oclint/BUILD
@@ -0,0 +1,6 @@
+cd ${SOURCE_DIRECTORY}/oclint-scripts &&
+./buildClang.sh release &&
+./buildCore.sh &&
+./buildMetrics.sh &&
+./buildRules.sh &&
+./buildRelease.sh
diff --git a/devel/oclint/DETAILS b/devel/oclint/DETAILS
new file mode 100755
index 0000000..3798ebd
--- /dev/null
+++ b/devel/oclint/DETAILS
@@ -0,0 +1,45 @@
+ SPELL=oclint
+ TMPFS=off
+ VERSION=0.6
+ MINOR_VERSION=0.110
+ LLVM_VERSION=3.2
+ SOURCE="${SPELL}-${VERSION}.src.tar.gz"
+ SOURCE_URL[0]=http://archives.${SPELL}.org/releases/0.6/${SOURCE}
+
SOURCE_HASH=sha512:36025b0f350317c64bac1fde940d2f1c924f275d63402d2d2558cd7d0a2c8c907aa7d65455493fbca4e122619acc9d63506a6a54038fcff340ca2527f6288a3a
+ SOURCE2=llvm-${LLVM_VERSION}.src.tar.gz
+ SOURCE2_URL[0]=http://llvm.org/releases/${LLVM_VERSION}/${SOURCE2}
+
SOURCE2_HASH=sha512:cc66171322dbbe40bcac0e0ea5b09df8ff52df63ded304f841f32f702270d6ab1512216413ee52498c3ebee8cd39c4cd23e3855d591944bc2ac0ae76f5be62cc
+ SOURCE3="clang-${LLVM_VERSION}.src.tar.gz"
+ SOURCE3_URL[0]="http://llvm.org/releases/${LLVM_VERSION}/${SOURCE3}";
+
SOURCE3_HASH=sha512:99fc57d19b76c42af9821eaaa762056a926eb68178f6b7dd5e8bf092c9ee201a554b91d760d5a30a57f38102eae340e080ef8c6a39327f6881eda391b20b108d
+SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}.${MINOR_VERSION}"
+ WEB_SITE="http://oclint.org/";
+ LICENSE[0]=BSD
+ ENTERED=20130528
+ SHORT="a static code analysis tool for improving quality and
reducing defects in C/C++ code"
+cat << EOF
+OCLint is a static code analysis tool for improving quality and reducing
+defects by inspecting C, C++ and Objective-C code and looking for potential
+problems like:
+
+ * Possible bugs - empty if/else/try/catch/finally statements * Unused
+ code - unused local variables and parameters * Complicated code - high
+ cyclomatic complexity, NPath complexity and high NCSS * Redundant code -
+ redundant if statement and useless parentheses * Code smells - long method
+ and long parameter list * Bad practices - inverted logic and parameter
+ reassignment * ...
+
+Static code analysis is a critical technique to detect defects that aren't
+visible to compilers. OCLint automates this inspection process with advanced
+features:
+
+ * Relying on the abstract syntax tree of the source code for better
accuracy
+ and efficiency; False positives are mostly reduced to avoid useful
+ results sinking in them.
+ * Dynamically loading rules into system, even in the runtime. * Flexible
+ and extensible configurations ensure users in customizing the
+ behaviors of the tool.
+ * Command line invocation facilitates continuous integration and continuous
+ inspection of the code while being developed, so that technical debts
+ can be fixed early on to reduce the maintenance cost.
+EOF
diff --git a/devel/oclint/HISTORY b/devel/oclint/HISTORY
new file mode 100644
index 0000000..b95fbcd
--- /dev/null
+++ b/devel/oclint/HISTORY
@@ -0,0 +1,3 @@
+2013-05-28 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
+ * BUILD, DETAILS, INSTALL, PRE_BUILD, Tools.cpp.patch: spell created
+
diff --git a/devel/oclint/INSTALL b/devel/oclint/INSTALL
new file mode 100755
index 0000000..8b4ad11
--- /dev/null
+++ b/devel/oclint/INSTALL
@@ -0,0 +1,4 @@
+install -m755
${SOURCE_DIRECTORY}/build/oclint-release/bin/{oclint-${VERSION},oclint-json-compilation-database}
\
+ ${INSTALL_ROOT}/usr/bin/ &&
+ln -sf /usr/bin/oclint-${VERSION} ${INSTALL_ROOT}/usr/bin/oclint &&
+cp -Rp ${SOURCE_DIRECTORY}/build/oclint-release/lib/*
${INSTALL_ROOT}/usr/lib/
diff --git a/devel/oclint/PRE_BUILD b/devel/oclint/PRE_BUILD
new file mode 100755
index 0000000..64ffdc4
--- /dev/null
+++ b/devel/oclint/PRE_BUILD
@@ -0,0 +1,16 @@
+default_pre_build &&
+cd ${SOURCE_DIRECTORY} &&
+unpack_file 2 &&
+mv llvm-${LLVM_VERSION}.src llvm &&
+cd llvm/tools &&
+unpack_file 3 &&
+mv clang-${LLVM_VERSION}.src clang &&
+patch -p2 < ${SPELL_DIRECTORY}/Tools.cpp.patch &&
+cd ${SOURCE_DIRECTORY}/oclint-scripts &&
+for script in buildCore.sh \
+ buildMetrics.sh \
+ buildClang.sh \
+ buildRules.sh \
+ buildRelease.sh; do
+ sedit "s:^\s*make:make -j${MAKE_NJOBS}:" $script
+done
diff --git a/devel/oclint/Tools.cpp.patch b/devel/oclint/Tools.cpp.patch
new file mode 100644
index 0000000..45e119c
--- /dev/null
+++ b/devel/oclint/Tools.cpp.patch
@@ -0,0 +1,70 @@
+diff -Naupr a/tools/clang/lib/Driver/Tools.cpp
b/tools/clang/lib/Driver/Tools.cpp
+--- a/tools/clang/lib/Driver/Tools.cpp 2012-11-21 08:56:23.000000000 +0100
++++ b/tools/clang/lib/Driver/Tools.cpp 2013-03-23 23:56:54.002059797 +0100
+@@ -1777,8 +1777,8 @@ void Clang::ConstructJob(Compilation &C,
+ // any flavor of the '-fno-...' arguments, both PIC and PIE are disabled.
Any
+ // PIE option implicitly enables PIC at the same level.
+ bool PIE = false;
+- bool PIC = getToolChain().isPICDefault();
+- bool IsPICLevelTwo = PIC;
++ bool pic = getToolChain().isPICDefault();
++ bool IsPICLevelTwo = pic;
+ if (Arg *A = Args.getLastArg(options::OPT_fPIC, options::OPT_fno_PIC,
+ options::OPT_fpic, options::OPT_fno_pic,
+ options::OPT_fPIE, options::OPT_fno_PIE,
+@@ -1787,26 +1787,26 @@ void Clang::ConstructJob(Compilation &C,
+ if (O.matches(options::OPT_fPIC) || O.matches(options::OPT_fpic) ||
+ O.matches(options::OPT_fPIE) || O.matches(options::OPT_fpie)) {
+ PIE = O.matches(options::OPT_fPIE) || O.matches(options::OPT_fpie);
+- PIC = PIE || O.matches(options::OPT_fPIC) ||
O.matches(options::OPT_fpic);
++ pic = PIE || O.matches(options::OPT_fPIC) ||
O.matches(options::OPT_fpic);
+ IsPICLevelTwo = O.matches(options::OPT_fPIE) ||
+ O.matches(options::OPT_fPIC);
+ } else {
+- PIE = PIC = false;
++ PIE = pic = false;
+ }
+ }
+ // Check whether the tool chain trumps the PIC-ness decision. If the
PIC-ness
+ // is forced, then neither PIC nor PIE flags will have no effect.
+ if (getToolChain().isPICDefaultForced()) {
+ PIE = false;
+- PIC = getToolChain().isPICDefault();
+- IsPICLevelTwo = PIC;
++ pic = getToolChain().isPICDefault();
++ IsPICLevelTwo = pic;
+ }
+
+ // Inroduce a Darwin-specific hack. If the default is PIC but the flags
+ // specified while enabling PIC enabled level 1 PIC, just force it back to
+ // level 2 PIC instead. This matches the behavior of Darwin GCC (based on
my
+ // informal testing).
+- if (PIC && getToolChain().getTriple().isOSDarwin())
++ if (pic && getToolChain().getTriple().isOSDarwin())
+ IsPICLevelTwo |= getToolChain().isPICDefault();
+
+ // Note that these flags are trump-cards. Regardless of the order w.r.t.
the
+@@ -1816,9 +1816,9 @@ void Clang::ConstructJob(Compilation &C,
+ Args.hasArg(options::OPT_fapple_kext)) &&
+ (Triple.getOS() != llvm::Triple::IOS ||
+ Triple.isOSVersionLT(6)))
+- PIC = PIE = false;
++ pic = PIE = false;
+ if (Args.hasArg(options::OPT_static))
+- PIC = PIE = false;
++ pic = PIE = false;
+
+ if (Arg *A = Args.getLastArg(options::OPT_mdynamic_no_pic)) {
+ // This is a very special mode. It trumps the other modes, almost no one
+@@ -1843,9 +1843,9 @@ void Clang::ConstructJob(Compilation &C,
+ // Currently, LLVM only knows about PIC vs. static; the PIE differences
are
+ // handled in Clang's IRGen by the -pie-level flag.
+ CmdArgs.push_back("-mrelocation-model");
+- CmdArgs.push_back(PIC ? "pic" : "static");
++ CmdArgs.push_back(pic ? "pic" : "static");
+
+- if (PIC) {
++ if (pic) {
+ CmdArgs.push_back("-pic-level");
+ CmdArgs.push_back(IsPICLevelTwo ? "2" : "1");
+ if (PIE) {



  • [SM-Commit] GIT changes to master grimoire by Florian Franzmann (52128b0847c3ec382c1f9574ded217325d6e2e95), Florian Franzmann, 05/28/2013

Archive powered by MHonArc 2.6.24.

Top of Page