<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.3">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2023-11-13T19:48:11+00:00</updated><id>/feed.xml</id><title type="html">Matthew Cole’s Homepage</title><subtitle>Includes a curriculum vitae, publications, and blog.
</subtitle><author><name>Matthew Cole</name><email>mcole8@binghamton.edu</email></author><entry><title type="html">Accepted Paper at IEEE S&amp;amp;P ‘23</title><link href="/2022/11/10/accepted-paper-at-ieee-sp-23.html" rel="alternate" type="text/html" title="Accepted Paper at IEEE S&amp;amp;P ‘23" /><published>2022-11-10T01:24:00+00:00</published><updated>2022-11-10T01:24:00+00:00</updated><id>/2022/11/10/accepted-paper-at-ieee-sp-23</id><content type="html" xml:base="/2022/11/10/accepted-paper-at-ieee-sp-23.html">&lt;p&gt;Our paper &lt;em&gt;Control Flow and Pointer Integrity Enforcement in a Secure Tagged Architecture&lt;/em&gt; by Ravi Theja Gollapudi, Gokturk Yuksek, David Demicco, Matthew Cole, Gaurav Kothari Rohit Kulkarni, Xin Zhang, Kanad Ghose, Aravind Prakash and Zerksis Umrigar has been accepted at &lt;a href=&quot;https://www.ieee-security.org/TC/SP2023/&quot;&gt;44th IEEE Symposium on Security and Privacy (IEEE S&amp;amp;P 2023)&lt;/a&gt;.
I’m particularly proud of this work, as it’s the culmination of over five years of work under the &lt;a href=&quot;https://www.darpa.mil/program/ssith&quot;&gt;DARPA System Security Integration Through Hardware and Firmware (SSITH) Program&lt;/a&gt; to provide secure architectures for systems that are essential to modern life.&lt;/p&gt;

&lt;!--more--&gt;

&lt;div class=&quot;language-bibtex highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;@INPROCEEDINGS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;10179416&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{Gollapudi, Ravi Theja and Yuksek, Gokturk and Demicco, David and Cole, Matthew and Kothari, Gaurav and Kulkarni, Rohit and Zhang, Xin and Ghose, Kanad and Prakash, Aravind and Umrigar, Zerksis}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;booktitle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{2023 IEEE Symposium on Security and Privacy (SP)}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
  &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{Control Flow and Pointer Integrity Enforcement in a Secure Tagged Architecture}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
  &lt;span class=&quot;na&quot;&gt;year&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{2023}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;volume&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{2974-2989}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;abstract&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{Control flow attacks exploit software vulnerabilities to divert the flow of control into unintended paths to ultimately execute attack code. This paper explores the use of instruction and data tagging as a general means of thwarting such control flow attacks, including attacks that rely on violating pointer integrity. Using specific types of narrow-width data tags along with narrow-width instruction tags embedded within the binary facilitates the security policies required to protect against such attacks, leading to a practically viable solution. Co-locating instruction tags close to their corresponding instructions within cache lines eliminates the need for separate mechanisms for instruction tag accesses. Information gleaned from the analysis phase of a compiler is augmented and used to generate the instruction and data tags. A full-stack implementation that consists of a modified LLVM compiler, modified Linux OS support for tags and a FPGA-implemented CPU hardware prototype for enforcing CFI, data pointer and code pointer integrity is demonstrated. With a modest hardware enhancement, the execution time of benchmark applications on the prototype system is shown to be limited to low, single-digit percentages of a baseline system without tagging.}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;keywords&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;doi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{10.1109/SP46215.2023.10179416}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;ISSN&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{2375-1207}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;month&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{May}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>Matthew Cole</name><email>mcole8@binghamton.edu</email></author><category term="conferences" /><category term="accepted work" /><summary type="html">Our paper Control Flow and Pointer Integrity Enforcement in a Secure Tagged Architecture by Ravi Theja Gollapudi, Gokturk Yuksek, David Demicco, Matthew Cole, Gaurav Kothari Rohit Kulkarni, Xin Zhang, Kanad Ghose, Aravind Prakash and Zerksis Umrigar has been accepted at 44th IEEE Symposium on Security and Privacy (IEEE S&amp;amp;P 2023). I’m particularly proud of this work, as it’s the culmination of over five years of work under the DARPA System Security Integration Through Hardware and Firmware (SSITH) Program to provide secure architectures for systems that are essential to modern life.</summary></entry><entry><title type="html">Accepted Paper at WDFHC ‘22</title><link href="/2022/11/01/accepted-paper-at-wdfhc-22.html" rel="alternate" type="text/html" title="Accepted Paper at WDFHC ‘22" /><published>2022-11-01T11:59:00+00:00</published><updated>2022-11-01T11:59:00+00:00</updated><id>/2022/11/01/accepted-paper-at-wdfhc-22</id><content type="html" xml:base="/2022/11/01/accepted-paper-at-wdfhc-22.html">&lt;p&gt;Our paper &lt;em&gt;A Security Analysis of Labeling-Based Control-Flow Integrity Schemes&lt;/em&gt; by David Demicco, Matthew Cole, Shengdun Wang and Aravind Prakash has been accepted at &lt;a href=&quot;https://hipc.org/wdfhc/&quot;&gt;Workshop on Data Fabric for Hybrid Cloud 2022 (WDFHC ‘22)&lt;/a&gt;.&lt;/p&gt;

&lt;!--more--&gt;

&lt;div class=&quot;language-bibtex highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;@INPROCEEDINGS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;10056531&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{Demicco, David and Cole, Matthew and Wang, Shengdun and Prakash, Aravind}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;booktitle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{2022 IEEE 29th International Conference on High Performance Computing, Data and Analytics Workshop (HiPCW)}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
  &lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{A Security Analysis of Labeling-Based Control-Flow Integrity Schemes}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
  &lt;span class=&quot;na&quot;&gt;year&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{2022}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;volume&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{47-52}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;abstract&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{Secure and transparent policy enforcement by a cloud provider is crucial in cloud infrastructures. Particularly, enforcement of control-flow integrity (CFI) policy has been widely accepted for stopping software-induced attacks. Using low-level hardware metadata to encode CFI policy is a fairly recent development. Besides moving enforcement out of the software and into the hardware for performance benefit, tagging metadata also offers other benefits in the precision of defenses. We evaluate several different metadata layouts for CFI policy enforcement, and examine the layouts' effects on the number of valid forward edges remaining in a RISC-V binary after policy enforcement. Additionally we look at related work in tag-based tools that provide CFI policy enforcement in order to get a sense of their performance and the design trade-offs they make. We evaluate our policy and the related works in terms of space and precision trade-offs for forward- and backward-edge CFI, finding that some trade-offs have a higher impact on the number of remaining forward edges, notably return address protection. Additionally, we report that existing backward edge protections can be highly effective, reducing the number of remaining backward edges in a protected binary to an average of 0.034% over an equivalent coarse-grained CFI.}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;keywords&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;doi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{10.1109/HiPCW57629.2022.00011}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;ISSN&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;month&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;{Dec}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>Matthew Cole</name><email>mcole8@binghamton.edu</email></author><category term="conferences" /><category term="accepted work" /><summary type="html">Our paper A Security Analysis of Labeling-Based Control-Flow Integrity Schemes by David Demicco, Matthew Cole, Shengdun Wang and Aravind Prakash has been accepted at Workshop on Data Fabric for Hybrid Cloud 2022 (WDFHC ‘22).</summary></entry><entry><title type="html">Accepted Paper at NordSec ‘22</title><link href="/2022/10/06/accepted-paper-at-nordsec-22.html" rel="alternate" type="text/html" title="Accepted Paper at NordSec ‘22" /><published>2022-10-06T17:42:00+00:00</published><updated>2022-10-06T17:42:00+00:00</updated><id>/2022/10/06/accepted-paper-at-nordsec-22</id><content type="html" xml:base="/2022/10/06/accepted-paper-at-nordsec-22.html">&lt;p&gt;Our paper &lt;em&gt;Simplex: Repurposing Intel Memory Protection Extensions for Secure Storage&lt;/em&gt; by Matthew Cole and Aravind Prakash has been accepted at &lt;a href=&quot;https://nordsec2022.ru.is/#accepted-papers&quot;&gt;Nordic Conference on Secure IT Systems (NordSec ‘22)&lt;/a&gt;.
The acceptance rate was 22.5%.&lt;/p&gt;

&lt;!--more--&gt;

&lt;div class=&quot;language-bibtex highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;@InProceedings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;10.1007/978-3-031-22295-5_12&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Cole, Matthew
and Prakash, Aravind&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;editor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Reiser, Hans P.
and Kyas, Marcel&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Simplex: Repurposing Intel Memory Protection Extensions for Secure Storage&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;booktitle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Secure IT Systems&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;year&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;2022&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;publisher&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Springer International Publishing&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;address&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Cham&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;215--233&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;abstract&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;The last few decades have seen several hardware-level features to enhance security, but due to security, performance, and/or usability issues these features have attracted steady criticism. One such feature is the Intel Memory Protection Extensions (MPX), an instruction set architecture extension promising spatial memory safety at a lower performance cost due to hardware-accelerated bounds checking. However, recent investigations into MPX have found that is neither as performant, accurate, nor precise as software-based spatial memory safety. Given its ubiquity, we argue that it provides an under-utilized hardware resource that can be salvaged for security purposes. We propose Simplex, an open-sourced library that re-purposes MPX registers as general purpose registers. Using Simplex, we demonstrate securely storing sensitive information directly on the hardware (e.g. encryption keys). We evaluate for performance, and find that deployment is feasible in all but the most performance-intensive code, with amortized performance overhead as low as about 1{\%}.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;isbn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;978-3-031-22295-5&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>Matthew Cole</name><email>mcole8@binghamton.edu</email></author><category term="conferences" /><category term="accepted work" /><summary type="html">Our paper Simplex: Repurposing Intel Memory Protection Extensions for Secure Storage by Matthew Cole and Aravind Prakash has been accepted at Nordic Conference on Secure IT Systems (NordSec ‘22). The acceptance rate was 22.5%.</summary></entry><entry><title type="html">Building LLVM for RISC-V Cross Compilation</title><link href="/2018/11/26/building-llvm-for-riscv-cross-compilation.html" rel="alternate" type="text/html" title="Building LLVM for RISC-V Cross Compilation" /><published>2018-11-26T20:26:00+00:00</published><updated>2018-11-26T20:26:00+00:00</updated><id>/2018/11/26/building-llvm-for-riscv-cross-compilation</id><content type="html" xml:base="/2018/11/26/building-llvm-for-riscv-cross-compilation.html">&lt;p&gt;So you want to build software for the RISC-V architecture (I’m playing with the &lt;a href=&quot;https://open-isa.org/&quot;&gt;Open ISA Vega RV32M1 development board&lt;/a&gt;)? Great, you’ll need a compiler. Although &lt;a href=&quot;https://riscv.org/software-tools/risc-v-gnu-compiler-toolchain/&quot;&gt;GCC officially supports you&lt;/a&gt;, with &lt;a href=&quot;https://riscv.org/2018/08/update-on-the-development-of-the-risc-v-software-toolchain/&quot;&gt;full upstream support as of GCC 7.1 and binutils 2.28&lt;/a&gt;, if you’re interested in &lt;em&gt;hacking&lt;/em&gt; the compiler before building software, you’ve probably chosen LLVM. In that case, you’ll need a bit more effort to get LLVM to build as a cross-compiler.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;

&lt;p&gt;This process assumes that you begin in the directory where your RISC-V GNU build tools and LLVM project directories will reside. You will need to determine the following locations, and expand them into a fully qualified path (i.e. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/user/...&lt;/code&gt; not &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/...&lt;/code&gt;) wherever they appear in a command.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;&lt;strong&gt;Location&lt;/strong&gt;&lt;/th&gt;
      &lt;th&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/th&gt;
      &lt;th&gt;&lt;strong&gt;Example Value&lt;/strong&gt;&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$TOP&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;The location where you want your cross-compiler&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;export TOP=$(pwd)&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;The location where the GNU toolchain installs itself.&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/$TOP/riscv-gnu-toolchain/install&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$LLVM_INSTALL_ROOT&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;The location where LLVM installs itself.&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/$TOP/llvm-project/install&lt;/code&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;You’ll also need some packages. This tutorial presumes Ubuntu 18.04.2 LTS, and thus gets the packages from Aptitude. These instructions will probably also work for other operating systems as well, you’re just on your own for package management.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;autoconf automake autotools-dev bison build-essential &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  cmake curl flex gawk gcc gcc-multilib gperf libmpc-dev libmpfr-dev &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  libgmp-dev libncurses5-dev make ninja-build openjdk-8-jre python python3 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  texinfo u-boot-tools zlib1g-dev 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;/h2&gt;

&lt;p&gt;Change to the directory at which you want your cross-compiler source tree and set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$TOP&lt;/code&gt; to this directory.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TOP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;get-the-risc-v-gnu-toolchain&quot;&gt;Get the RISC-V GNU Toolchain&lt;/h3&gt;

&lt;p&gt;Briefly, the RISC-V foundation maintains a RISC-V GNU toolchain for x86 cross-compilation, which you will need to cross-compile. The build tooling handles this for you, &lt;a href=&quot;https://github.com/riscv/riscv-gnu-toolchain#installation-linux&quot;&gt;more information here.&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$TOP&lt;/span&gt;
git clone &lt;span class=&quot;nt&quot;&gt;--recursive&lt;/span&gt; https://github.com/riscv/riscv-gnu-toolchain
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;riscv-gnu-toolchain
&lt;span class=&quot;nb&quot;&gt;mkdir install&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;/install
./configure &lt;span class=&quot;nt&quot;&gt;--prefix&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--with-arch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;rv32imc &lt;span class=&quot;nt&quot;&gt;--with-abi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;ilp32
make &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;get-the-llvm-project-monorepo&quot;&gt;Get the LLVM Project Monorepo&lt;/h3&gt;

&lt;p&gt;The LLVM project monorepo is the easiest way to get all of the sources and put them in the correct location. Previously, one had to acquire all of the individual LLVM projects and extract them to the correct subdirectories in order for CMake to detect that you wanted to build these subprojects. Now, we simply specify these in the CMake invocation (see &lt;strong&gt;Build LLVM&lt;/strong&gt;).&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$TOP&lt;/span&gt;
git clone https://github.com/llvm/llvm-project.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you’d like to set your repository to a particular project release, reset the repository to the release’s commit SHA (e.g. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;d0d8eb2&lt;/code&gt;) or its tag (e.g &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;llvmorg-7.0.1&lt;/code&gt;), for example:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$TOP&lt;/span&gt;/llvm-project
git reset &lt;span class=&quot;nt&quot;&gt;--hard&lt;/span&gt; llvmorg-7.0.1&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;build-llvm&quot;&gt;Build LLVM&lt;/h2&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$TOP&lt;/span&gt;/llvm-project
&lt;span class=&quot;nb&quot;&gt;mkdir &lt;/span&gt;build &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;LLVM_INSTALL_ROOT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;/install
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;build
cmake &lt;span class=&quot;nt&quot;&gt;-G&lt;/span&gt; Ninja &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DCMAKE_BUILD_TYPE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Debug&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$LLVM_INSTALL_ROOT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DBUILD_SHARED_LIBS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;True &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DLLVM_USE_SPLIT_DWARF&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;True &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DLLVM_OPTIMIZED_TABLEGEN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;True &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DLLVM_BUILD_TESTS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;True &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;RISCV&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DLLVM_ENABLE_PROJECTS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;clang;lld;debuginfo-tests&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DDEFAULT_SYSROOT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/riscv32-unknown-elf&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DGCC_INSTALL_PREFIX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-DLLVM_DEFAULT_TARGET_TRIPLE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;riscv32-unknown-elf&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  ../
cmake &lt;span class=&quot;nt&quot;&gt;--build&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--target&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install
&lt;/span&gt;cmake &lt;span class=&quot;nt&quot;&gt;--build&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--target&lt;/span&gt; check-all
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you’d prefer a simple go/no-go test on the build, instead of running the time-expensive &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;check-all&lt;/code&gt; target in the last step, inspect the return value (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;echo $?&lt;/code&gt;) of the first &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cmake --build&lt;/code&gt; command for a value of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;0&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;invoking-the-compiler&quot;&gt;Invoking the Compiler&lt;/h2&gt;

&lt;p&gt;If you set the default sysroot (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-DDEFAULT_SYSROOT&lt;/code&gt;), GCC install prefix (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-DGCC_INSTALL_PREFIX&lt;/code&gt;) and default target triple (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-DLLVM_DEFAULT_TARGET_TRIPLE&lt;/code&gt;) when building using CMake, you don’t need to pass these arguments explicitly when invoking Clang:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$LLVM_INSTALL_ROOT&lt;/span&gt;/bin/clang &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;options...] infile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Otherwise, you do have to pass these arguments when invoking Clang:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$LLVM_INSTALL_ROOT&lt;/span&gt;/bin/clang &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--sysroot&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt;/riscv32-unknown-elf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--gcc-toolchain&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;--target&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;riscv32-unknown-elf &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;options...] infile 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Since passing these arguments can be tedious, you can alias these commands:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;riscv-clang&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$LLVM_INSTALL_ROOT&lt;/span&gt;/bin/clang &lt;span class=&quot;nt&quot;&gt;--sysroot&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt;/riscv32-unknown-elf &lt;span class=&quot;nt&quot;&gt;--gcc-toolchain&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--target&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;riscv32-unknown-elf
&lt;span class=&quot;nb&quot;&gt;alias &lt;/span&gt;riscv-clang++&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$LLVM_INSTALL_ROOT&lt;/span&gt;/bin/clang++ &lt;span class=&quot;nt&quot;&gt;--sysroot&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt;/riscv32-unknown-elf &lt;span class=&quot;nt&quot;&gt;--gcc-toolchain&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$RISCV_GNU_TOOLCHAIN_INSTALL_ROOT&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--target&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;riscv32-unknown-elf
&lt;span class=&quot;nb&quot;&gt;alias&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;riscv-clang
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;links&quot;&gt;Links&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://groups.google.com/a/groups.riscv.org/forum/#!topic/sw-dev/eoV9FCLnaF0&quot;&gt;Building RISC Code with LLVM&lt;/a&gt; discusses the &lt;em&gt;unrecognized command line option ‘-fforce-enable-int128’&lt;/em&gt; error.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/lowRISC/riscv-llvm&quot;&gt;lowRISC/risc-llvm at Github&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/lowRISC/riscv-llvm/tree/master/docs&quot;&gt;A Step-by-Step Guide to the LLVM RISC-V Backend&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://llvm.org/docs/CMake.html&quot;&gt;Building LLVM with CMake&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Matthew Cole</name><email>mcole8@binghamton.edu</email></author><category term="llvm" /><category term="riscv" /><summary type="html">So you want to build software for the RISC-V architecture (I’m playing with the Open ISA Vega RV32M1 development board)? Great, you’ll need a compiler. Although GCC officially supports you, with full upstream support as of GCC 7.1 and binutils 2.28, if you’re interested in hacking the compiler before building software, you’ve probably chosen LLVM. In that case, you’ll need a bit more effort to get LLVM to build as a cross-compiler.</summary></entry><entry><title type="html">Building SPEC CPU2017 Sandboxes</title><link href="/2018/08/04/building-spec-cpu2017-sandboxes.html" rel="alternate" type="text/html" title="Building SPEC CPU2017 Sandboxes" /><published>2018-08-04T00:39:00+00:00</published><updated>2018-08-04T00:39:00+00:00</updated><id>/2018/08/04/building-spec-cpu2017-sandboxes</id><content type="html" xml:base="/2018/08/04/building-spec-cpu2017-sandboxes.html">&lt;p&gt;You may want to build a sandbox if one or more of these sound familiar:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;You want to build recognizable, representative binaries instead of toy programs for experimentation, but you also don’t want the overhead of the actual SPEC CPU2017 benchmark suite, nor a script to manage the binaries’ execution.&lt;/li&gt;
  &lt;li&gt;You want to modify the source code of the benchmarks without corrupting the SPEC CPU2017 source tree.  Modifying the source code is allowed if you use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;strict_rundir_verify=no&lt;/code&gt; option in your configuration file, or if you create a modified installation of the benchmark using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;convert_to_development&lt;/code&gt; utility. But an easier option is to create sandboxes for each benchmark program you wish to investigate, and it doesn’t corrupt the source tree if you’re reusing it with other experiments.&lt;/li&gt;
  &lt;li&gt;You want to modify the options or inputs provided to the benchmarks to investigate how the benchmark binaries respond.&lt;/li&gt;
&lt;/ul&gt;

&lt;!--more--&gt;

&lt;h2 id=&quot;about-spec-cpu2017&quot;&gt;About SPEC CPU2017&lt;/h2&gt;

&lt;p&gt;SPEC CPU2017 is a benchmark suite containing compute-intensive programs for measuring performance on a variety of computer systems. In addition to running representative programs developed from real applications with representative data sets, CPU2017 includes a driver program  – &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;runcpu&lt;/code&gt; – which calls necessary utilities for benchmarking.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;specmake&lt;/code&gt; builds the benchmark binaries. If you want to try linking a library into the benchmark binaries, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;specmake&lt;/code&gt; will not permit this because &lt;a href=&quot;https://www.spec.org/cpu2017/Docs/config.html#sectionIII.A&quot;&gt;only a subset of typical compiler options are available&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;specinvoke&lt;/code&gt; invokes the binaries and times their execution. Part of this invocation is using a specified input data set. If you want to provide your own inputs, or don’t want the timing information output to the console, this is problematic.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;specdiff&lt;/code&gt;compares the output of the benchmark to supplied outputs for the data sets. If you have modified the binary in order to perform an evaluation other than performance, these comparisons will fail, generating unnecessary errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;overview&quot;&gt;Overview&lt;/h2&gt;

&lt;p&gt;See these two pieces of official documentation (but don’t follow them at this time):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.spec.org/cpu2017/Docs/runcpu-avoidance.html&quot;&gt;Avoiding runcpu&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.spec.org/cpu2017/Docs/config.html#sectionIII.E&quot;&gt;Sandbox Creation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Briefly, we use &lt;a href=&quot;https://www.spec.org/cpu2017/Docs/runcpu.html#action&quot;&gt;runspec –action buildsetup&lt;/a&gt; to create a standalone build directory and build the desired binaries. Then we invoke the binaries from the command line.&lt;/p&gt;

&lt;h1 id=&quot;sandbox-creation-and-employment&quot;&gt;Sandbox Creation and Employment&lt;/h1&gt;

&lt;h2 id=&quot;configure-the-sandbox&quot;&gt;Configure the Sandbox&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Copy &lt;strong&gt;sandbox.cfg&lt;/strong&gt; and &lt;strong&gt;sandbox.sh&lt;/strong&gt; from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$SPEC/config/tiny-examples/&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$SPEC/config/&lt;/code&gt; (note that by default, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;runspec&lt;/code&gt; will search &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$SPEC/config/&lt;/code&gt; for &lt;strong&gt;sandbox.cfg&lt;/strong&gt; and halts creation if it’s not found; the official instructions don’t mention this).&lt;/li&gt;
  &lt;li&gt;Modify &lt;strong&gt;sandbox.cfg&lt;/strong&gt; as required. Note that this is where you’re going to specify any special &lt;a href=&quot;https://www.spec.org/cpu2017/Docs/makevars.html&quot;&gt;specmake variables&lt;/a&gt; on a benchmark-by-benchmark basis.&lt;/li&gt;
  &lt;li&gt;Source &lt;strong&gt;sandbox.sh&lt;/strong&gt; to generate the sandbox.&lt;/li&gt;
  &lt;li&gt;Make modifications to source file as desired. Note that it may be required to copy over input files from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$SPEC/benchspec/CPU/$BENCHMARK/data/**&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;build-and-run-the-sandbox-binaries&quot;&gt;Build and Run the Sandbox Binaries&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;Be sure to source &lt;strong&gt;$SPEC/shrc&lt;/strong&gt; if specmake is not in your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$PATH&lt;/code&gt; (try &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;which specmake&lt;/code&gt; to determine if this is required). If you don’t, you will receive a &lt;em&gt;specmake: command not found&lt;/em&gt; error in step 3. Your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$PWD&lt;/code&gt; must be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$SPEC&lt;/code&gt; when you source shrc or else you will receive a &lt;em&gt;Can’t find the top of your SPEC tree&lt;/em&gt; error.&lt;/li&gt;
  &lt;li&gt;Change directory to the benchmark’s build directory within the sandbox. The sandbox itself defaults to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp/demo_buildsetup&lt;/code&gt; as specified by the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;output_root&lt;/code&gt; variable in &lt;strong&gt;sandbox.cfg&lt;/strong&gt;, and thus the build directories are located at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/tmp/demo_buildsetup/benchspec/CPU/**/build/&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Do a &lt;a href=&quot;https://www.spec.org/cpu2017/Docs/utility.html#specmake&quot;&gt;specmake –dry-run&lt;/a&gt; to verify that specmake will build the benchmark properly. Particularly observe that your specmake special variables’ ordering is sane, such that the compilation and linking commands are each well formed.&lt;/li&gt;
  &lt;li&gt;Run specmake to actually build your binary.&lt;/li&gt;
  &lt;li&gt;Execute the binary using the command line interface specified in the &lt;a href=&quot;https://www.spec.org/cpu2017/Docs/index.html#benchmarks&quot;&gt;benchmark descriptions&lt;/a&gt;. You can also find examples of invocation within &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$SPEC/result/CPU2017.*.log&lt;/code&gt; files.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;example-configuration-and-scripting&quot;&gt;Example configuration and scripting&lt;/h3&gt;

&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!$SPEC/bin/runcpu
# $SPEC/config/sandbox.cfg
&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Edit these variables to link a library to the sandbox
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%define&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;MYLIB_PATH&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;/home/matthew/github/bingseclab/MYLIB&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;%define&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;MYLIB_LIB_PATH&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;%{MYLIB_PATH}/lib&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;%define&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;MYLIB_INCL_PATH&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;%{MYLIB_PATH}/incl&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Edit these variables to configure your sandbox
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;%define&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;SANDBOX&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;MYLIB&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;buildsetup&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;%{SANDBOX}-base&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;output_root&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/tmp/sandbox_%{SANDBOX}&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;runlist&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;519.lbm, 531.deepsjeng&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;tune&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;base&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;base:&lt;/span&gt;
  &lt;span class=&quot;py&quot;&gt;OPTIMIZE&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;-march=native -fno-unsafe-math-optimizations&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Configure benchmark builds (passed to specmake)
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;519.lbm_r,619.lbm_s:&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#lang='C'
&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;COBJOPT&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;-c -g -O0 -o $@&lt;/span&gt;
 &lt;span class=&quot;py&quot;&gt;EXTRA_CFLAGS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;-I%{MYLIB_INCL_PATH} -L%{MYLIB_LIB_PATH}&lt;/span&gt;
 &lt;span class=&quot;py&quot;&gt;EXTRA_LDFLAGS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;-I%{MYLIB_INCL_PATH} -L%{MYLIB_LIB_PATH}&lt;/span&gt;
 &lt;span class=&quot;py&quot;&gt;EXTRA_LIBS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;-lMYLIB&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;531.deepsjeng_r,631.deepsjeng_s:&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;#lang='CXX'
&lt;/span&gt; &lt;span class=&quot;py&quot;&gt;CXX&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/usr/bin/g++&lt;/span&gt;
 &lt;span class=&quot;py&quot;&gt;CXXOBJOPT&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;-c -g -O0 -o $@&lt;/span&gt;
 &lt;span class=&quot;py&quot;&gt;EXTRA_CXXFLAGS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;-I%{MYLIB_INCL_PATH} -L%{MYLIB_LIB_PATH}&lt;/span&gt;
 &lt;span class=&quot;py&quot;&gt;EXTRA_LDFLAGS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;-I%{MYLIB_INCL_PATH} -L%{MYLIB_LIB_PATH}&lt;/span&gt;
 &lt;span class=&quot;py&quot;&gt;EXTRA_LIBS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;-lMYLIB&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# sandbox.sh&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# see &quot;Stupid Assumptions&quot; in $(SPEC)/config/tiny-examples/contents&lt;/span&gt;

runcpu &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;sandbox | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;log
&lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;Makefile.spec /tmp/sandbox-MYLIB/result/CPU2017.001.log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>Matthew Cole</name><email>mcole8@binghamton.edu</email></author><category term="cpu2017" /><category term="benchmarks" /><summary type="html">You may want to build a sandbox if one or more of these sound familiar: You want to build recognizable, representative binaries instead of toy programs for experimentation, but you also don’t want the overhead of the actual SPEC CPU2017 benchmark suite, nor a script to manage the binaries’ execution. You want to modify the source code of the benchmarks without corrupting the SPEC CPU2017 source tree. Modifying the source code is allowed if you use the strict_rundir_verify=no option in your configuration file, or if you create a modified installation of the benchmark using the convert_to_development utility. But an easier option is to create sandboxes for each benchmark program you wish to investigate, and it doesn’t corrupt the source tree if you’re reusing it with other experiments. You want to modify the options or inputs provided to the benchmarks to investigate how the benchmark binaries respond.</summary></entry><entry><title type="html">Source Code Analysis for Design Patterns</title><link href="/2018/05/27/design-pattern-discovery-tools.html" rel="alternate" type="text/html" title="Source Code Analysis for Design Patterns" /><published>2018-05-27T00:00:00+00:00</published><updated>2018-05-27T00:00:00+00:00</updated><id>/2018/05/27/design-pattern-discovery-tools</id><content type="html" xml:base="/2018/05/27/design-pattern-discovery-tools.html">&lt;p&gt;Design pattern extraction tools analyze source code and attempt to match the code to a collection of specimen design patterns. We reviewed tools announced by peer-reviewed literature, and found that the existing tools are unsatisfactory for use by modern C++ developers and analysts.&lt;/p&gt;

&lt;!--more--&gt;

&lt;h1 id=&quot;summary&quot;&gt;Summary&lt;/h1&gt;

&lt;p&gt;We explored the corpus of existing design pattern extraction tools. We found papers for 9 tools. Additionally, we found citations for three other tools within the corpus, but the links to these tools were broken.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;6/9 supported C++. 1/9 claimed to be at least nominally language agnostic because its annotation/markup scheme can be applied to any text file.&lt;/li&gt;
  &lt;li&gt;2/9 claimed open source status.&lt;/li&gt;
  &lt;li&gt;6/9 were &lt;em&gt;design pattern miners&lt;/em&gt;, that is, given source code they claim to be able to identify design patterns within the source code. The others were &lt;em&gt;design pattern discoverers&lt;/em&gt;, that is, given annotated source code, they identify intra-class relationships that suggest that they may form a design pattern (but they cannot observe code and say “this class matches the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;singleton&lt;/code&gt; pattern” or “that method implements &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;singleton::getInstance()&lt;/code&gt;”.&lt;/li&gt;
  &lt;li&gt;0/9 were all of open source, available for download, support C++, and are design pattern miners.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’ll continue to look for design pattern miners that meet our needs. Without design pattern extraction capabilities, our solution will require manual annotation and this will not scale. &lt;strong&gt;We believe that design pattern discovery remains an open problem, and is profitable for reverse engineering.&lt;/strong&gt;&lt;/p&gt;

&lt;h1 id=&quot;reviewed-works&quot;&gt;Reviewed Works&lt;/h1&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Tool or Paper&lt;/th&gt;
      &lt;th&gt;Languages&lt;/th&gt;
      &lt;th&gt;Open Source?&lt;/th&gt;
      &lt;th&gt;Pattern Discovery or Mining?&lt;/th&gt;
      &lt;th&gt;Notes&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;http://ieeexplore.ieee.org/abstract/document/4148953/?reload=true&quot;&gt;DP-Miner&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;Java&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;Discovery&lt;/td&gt;
      &lt;td&gt;Needs a pre-constructed XMI file for project. Authors claim XMI can be generated with tools like Rational Rose.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;http://ieeexplore.ieee.org/abstract/document/4148953/?reload=true&quot;&gt;DeMIMA&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;C++, Java&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;Discovery&lt;/td&gt;
      &lt;td&gt;Requires documenting components with OMT class diagrams&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://www.cs.unc.edu/~smithja/SPQR.html&quot;&gt;SPQR&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;?&lt;/td&gt;
      &lt;td&gt;No (patent pending)&lt;/td&gt;
      &lt;td&gt;Mining&lt;/td&gt;
      &lt;td&gt;Introduces concept of &lt;em&gt;Elemental Design Patterns&lt;/em&gt;: 26 patterns authors found simple enough to express in logical systems. Only works on these Elemental Design Patterns.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=4015512&quot;&gt;Design Pattern Detection Using Similarity Scoring&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;Java&lt;/td&gt;
      &lt;td&gt;No. Authors don’t claim open-source status, and could not find source.&lt;/td&gt;
      &lt;td&gt;Mining&lt;/td&gt;
      &lt;td&gt;Uses similarity scoring on graph of class inheritance using Java byte code. Does not appear to be able to identify class method:pattern function mapping.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://pdfs.semanticscholar.org/27b0/1043ebdf1acc3a34a69380708b7814d9546f.pdf&quot;&gt;DPET&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;C++&lt;/td&gt;
      &lt;td&gt;Authors do not claim open-source status, and could not find source.&lt;/td&gt;
      &lt;td&gt;Mining&lt;/td&gt;
      &lt;td&gt;-&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;http://www.jot.fm/issues/issue_2006_01/article6.pdf&quot;&gt;An efficient tool for recovering Design Patterns from C++ Code&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;C++&lt;/td&gt;
      &lt;td&gt;Uses proprietary software (“Understand for C++”) to generate a SQL database, which their solution then analyzes. Did not provide analysis artifact reference.&lt;/td&gt;
      &lt;td&gt;Mining&lt;/td&gt;
      &lt;td&gt;Introduces ability to infer aggregations.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://www.inf.u-szeged.hu/~ferenc/research/balanyizs_designpatterns.pdf&quot;&gt;Mining Design Patterns from C++ Source Code&lt;/a&gt; (&lt;em&gt;Columbus&lt;/em&gt;, &lt;em&gt;DPML&lt;/em&gt;)&lt;/td&gt;
      &lt;td&gt;C++&lt;/td&gt;
      &lt;td&gt;Authors do not claim open-source status, and could not find source.&lt;/td&gt;
      &lt;td&gt;Mining and Discovery&lt;/td&gt;
      &lt;td&gt;Introduces DPML, extending existing DP annotation schemes to mark “inheritance, composition, aggregation and association,… call delegation, object creation and operation overriding”. One of first to look at function bodies, not just class’ structure.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.133.922&amp;amp;rep=rep1&amp;amp;type=pdf&quot;&gt;Evaluating C++ Design Pattern Miner Tools&lt;/a&gt; (&lt;em&gt;Columbus&lt;/em&gt;/&lt;em&gt;CAN&lt;/em&gt;)&lt;/td&gt;
      &lt;td&gt;C++&lt;/td&gt;
      &lt;td&gt;Yes.&lt;/td&gt;
      &lt;td&gt;Mining and Discovery&lt;/td&gt;
      &lt;td&gt;Extends/Improves Columbus. Announces availability through FrontEndArt. &lt;a href=&quot;http://www.frontendart.com/download.html&quot;&gt;Download link&lt;/a&gt; is dead.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://people.cs.clemson.edu/~malloy/publications/papers/est07/paper.pdf&quot;&gt;A Toolchain for Reverse Engineering C++ Applications&lt;/a&gt; (&lt;em&gt;G4RE&lt;/em&gt;/&lt;em&gt;G4API&lt;/em&gt;)&lt;/td&gt;
      &lt;td&gt;C++&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
      &lt;td&gt;Neither&lt;/td&gt;
      &lt;td&gt;Paper only claims ability to perform reverse engineering analysis that may reveal design patterns.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h1 id=&quot;dead-ends&quot;&gt;Dead Ends&lt;/h1&gt;

&lt;p&gt;The following were cited as possible Design Pattern mining solutions, but links are dead:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;FUJABA : &lt;a href=&quot;http://www.cs.uni-paderborn.de/cs/fujaba/&quot;&gt;http://www.cs.uni-paderborn.de/cs/fujaba/&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;PTIDEJ: &lt;a href=&quot;http://ptidej.iro.umontreal.ca/&quot;&gt;http://ptidej.iro.umontreal.ca&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;CPPX: &lt;a href=&quot;http://swag.uwaterloo.ca/~cppx/download.html&quot;&gt;http://swag.uwaterloo.ca/~cppx/download.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Matthew Cole</name><email>mcole8@binghamton.edu</email></author><category term="design patterns" /><category term="analysis" /><summary type="html">Design pattern extraction tools analyze source code and attempt to match the code to a collection of specimen design patterns. We reviewed tools announced by peer-reviewed literature, and found that the existing tools are unsatisfactory for use by modern C++ developers and analysts.</summary></entry><entry><title type="html">Accepted Paper at ACSAC ‘17</title><link href="/2017/08/19/accepted-paper-at-acsac-17.html" rel="alternate" type="text/html" title="Accepted Paper at ACSAC ‘17" /><published>2017-08-19T22:29:00+00:00</published><updated>2017-08-19T22:29:00+00:00</updated><id>/2017/08/19/accepted-paper-at-acsac-17</id><content type="html" xml:base="/2017/08/19/accepted-paper-at-acsac-17.html">&lt;p&gt;Our paper &lt;em&gt;Supplementing Modern Software Defenses with Stack-Pointer Sanity&lt;/em&gt; by Anh Quach, Matthew Cole and Aravind Prakash has been accepted at &lt;a href=&quot;https://www.acsac.org/2017/&quot;&gt;ACSAC ‘17&lt;/a&gt;.
The acceptance rate was 19.7%.&lt;/p&gt;

&lt;!--more--&gt;

&lt;div class=&quot;language-bibtex highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;@inproceedings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;10.1145/3134600.3134641&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;author&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{Quach, Anh and Cole, Matthew and Prakash, Aravind}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{Supplementing Modern Software Defenses with Stack-Pointer Sanity}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;year&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{2017}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;isbn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{9781450353458}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;publisher&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{Association for Computing Machinery}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;address&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{New York, NY, USA}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{https://doi.org/10.1145/3134600.3134641}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;doi&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{10.1145/3134600.3134641}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{The perpetual cat-and-mouse game between attackers and software defenders has highlighted the need for strong and robust security. With performance as a key concern, most modern defenses focus on control-flow integrity (CFI), a program property that requires runtime execution of a program to adhere to a statically determined control-flow graph (CFG). Despite its success in preventing traditional return-oriented programming (ROP), CFI is known to be ineffective against modern attacks that adhere to a statically recovered CFG (e.g., COOP).This paper introduces stack-pointer integrity (SPI) as a means to supplement CFI and other modern defense techniques. Due to its ability to influence indirect control targets, stack pointer is a key artifact in attacks. We define SPI as a property comprising of two key sub-properties - Stack Localization and Stack Conservation - and implement a LLVM-based compiler prototype codenamed SPIglass that enforces SPI. We demonstrate a low implementation overhead and incremental deployability, two of the most desirable features for practical deployment. Our performance experiments show that the overhead of our defense is low in practice. We opensource SPIglass for the benefit of the community.}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;booktitle&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{Proceedings of the 33rd Annual Computer Security Applications Conference}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;pages&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{116–127}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;numpages&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{12}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{Orlando, FL, USA}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;series&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;{ACSAC '17}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name>Matthew Cole</name><email>mcole8@binghamton.edu</email></author><category term="conferences" /><category term="accepted work" /><summary type="html">Our paper Supplementing Modern Software Defenses with Stack-Pointer Sanity by Anh Quach, Matthew Cole and Aravind Prakash has been accepted at ACSAC ‘17. The acceptance rate was 19.7%.</summary></entry></feed>