Skip to content

Commit

Permalink
Merge pull request #1 from ethteck/ci
Browse files Browse the repository at this point in the history
CI
  • Loading branch information
ethteck authored Sep 21, 2021
2 parents 01e4307 + df38ff4 commit eafba28
Show file tree
Hide file tree
Showing 40 changed files with 2,624 additions and 19 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Recompile ido and publish releases

on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
ido: [5.3, 7.1]

name: Recompiling ido ${{ matrix.ido }} for ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Install dependencies (Ubuntu)
shell: bash
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential bison file gperf libcapstone-dev python3
- name: Install dependencies (MacOS)
shell: bash
if: matrix.os == 'macos-latest'
run: |
brew install capstone
- name: Run the build script
shell: bash
run: |
python3 build.py ido/${{ matrix.ido }} -O2
- name: Create release archive
shell: bash
run: |
cd build${{ matrix.ido }}/out
tar -czvf ../../ido-${{ matrix.ido }}-recomp-${{ matrix.os }}.tar.gz *
- name: Upload archive
uses: actions/upload-artifact@v2
with:
name: ido-${{ matrix.ido }}-recomp-${{ matrix.os }}
path: |
ido-${{ matrix.ido }}-recomp-${{ matrix.os }}.tar.gz
- name: Update release
uses: johnwbyrd/update-release@v1.0.0
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/per-function' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ido-${{ matrix.ido }}-recomp-${{ matrix.os }}.tar.gz
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea/
build53/
build71/
build5.3/
build7.1/
.vscode/
49 changes: 33 additions & 16 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,30 @@
import threading
import shutil

BINS = [
"/usr/lib/as1",
"/usr/lib/cfe",
"/usr/lib/ugen",
"/usr/lib/uopt",
"/usr/bin/cc",
]
BINS = {
"5.3": [
"/usr/bin/cc",
"/usr/lib/acpp",
"/usr/lib/as0",
"/usr/lib/as1",
"/usr/lib/cfe",
"/usr/lib/copt",
"/usr/lib/ugen",
"/usr/lib/ujoin",
"/usr/lib/uld",
"/usr/lib/umerge",
"/usr/lib/uopt",
"/usr/lib/usplit",
],
"7.1": [
"/usr/bin/cc",
"/usr/lib/as1",
"/usr/lib/cfe",
"/usr/lib/ugen",
"/usr/lib/umerge",
"/usr/lib/uopt",
]
}


def call(args, output_file=None):
Expand All @@ -36,15 +53,13 @@ def process_prog(prog, ido_path, ido_flag, build_dir, out_dir, args, recomp_path
with open(c_file_path, "w") as cFile:
call(recomp_path + " " + ido_path + prog, cFile)

flags = " -g -fno-strict-aliasing"
if args.O2:
flags += " -O2"
flags = " -fno-strict-aliasing -lm"

flags = " -g -fno-strict-aliasing -lm"
if platform.system() == "Darwin":
flags += " -fno-pie"
else:
flags += " -no-pie"
flags += " -g -no-pie"

if args.O2:
flags += " -O2"

Expand All @@ -62,12 +77,14 @@ def main(args):
print("Detected IDO version 7.1")
ido_flag = " -DIDO71"
ugen_flag = ""
build_dir = "build71"
build_dir = "build7.1"
bins = BINS["7.1"]
elif "5.3" in ido_dir:
print("Detected IDO version 5.3")
ido_flag = " -DIDO53"
ugen_flag = " -Dugen53"
build_dir = "build53"
build_dir = "build5.3"
bins = BINS["5.3"]
else:
sys.exit("Unsupported ido dir: " + ido_dir)

Expand All @@ -94,7 +111,7 @@ def main(args):
call("g++ recomp.cpp -o " + recomp_path + " -g -lcapstone" + std_flag + ugen_flag)

threads = []
for prog in BINS:
for prog in bins:
if args.multhreading:
t = threading.Thread(target=process_prog, args=(prog, ido_path, ido_flag, build_dir, out_dir, args, recomp_path))
threads.append(t)
Expand All @@ -111,7 +128,7 @@ def main(args):
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Static ido recompilation build utility")
parser.add_argument("ido_path", help="Path to ido")
parser.add_argument("-O2", help="Build binaries with -O2 (warning: may take forever)", action='store_true')
parser.add_argument("-O2", help="Build binaries with -O2", action='store_true')
parser.add_argument("-onlylibc", help="Builds libc_impl.c only", action='store_true')
parser.add_argument("-multhreading", help="Enables multi threading (deprecated with O2)", action='store_true')
rgs = parser.parse_args()
Expand Down
18 changes: 18 additions & 0 deletions ido/5.3/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Silicon Graphics Freeware Legal Notice
## Copyright 1995, Silicon Graphics, Inc. -- ALL RIGHTS RESERVED

You may copy, modify, use and distribute this software, (i) provided that you include the entirety of this reservation of rights notice in all such copies, and (ii) you comply with any additional or different obligations and/or use restrictions specified by any third party owner or supplier of the software in other notices that may be included with the software.

**SGI DISCLAIMS ALL WARRANTIES WITH RESPECT TO THIS SOFTWARE, EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ALL WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. SGI SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST REVENUES, LOST PROFITS, OR LOSS OF PROSPECTIVE ECONOMIC ADVANTAGE, RESULTING FROM THE USE OR MISUSE OF THIS SOFTWARE.**

**U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:**

Use, duplication or disclosure by the Government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement. Unpublished - rights reserved under the Copyright Laws of United States. Contractor/manufacturer is Silicon Graphics, Inc., 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.

## Product Support

Freeware products are not supported by Silicon Graphics or any of its support providers. The software contained in this package is made available through the generous efforts of their authors. Although they are interested in your feedback, they are under no obligation to address bugs, enhancements, or answer questions.

----

**NOTE:** This license was copied verbatim from https://web.archive.org/web/19991008090202/http://toolbox.sgi.com/TasteOfDT/public/freeware1.0/legal_notice.html .
Binary file added ido/5.3/lib/libmalloc.so
Binary file not shown.
Binary file added ido/5.3/lib/libmalloc_old.so
Binary file not shown.
Binary file added ido/5.3/lib/rld
Binary file not shown.
Binary file added ido/5.3/usr/bin/cc
Binary file not shown.
Binary file added ido/5.3/usr/lib/acpp
Binary file not shown.
Binary file added ido/5.3/usr/lib/as0
Binary file not shown.
Binary file added ido/5.3/usr/lib/as1
Binary file not shown.
Binary file added ido/5.3/usr/lib/cfe
Binary file not shown.
Binary file added ido/5.3/usr/lib/copt
Binary file not shown.
Binary file added ido/5.3/usr/lib/crt1.o
Binary file not shown.
Loading

0 comments on commit eafba28

Please sign in to comment.