From 8932b02c3b6aa0232b310f39ac21bf3a2313b343 Mon Sep 17 00:00:00 2001 From: Lubos Dolezel Date: Fri, 26 Feb 2016 22:57:37 +0100 Subject: [PATCH] Cleanup benchmarks, misc and tools directories --- benchmarks/runtest | 92 ---- benchmarks/runtest32 | 1 - benchmarks/runtest64 | 1 - benchmarks/src/objc_msgSend.m | 29 -- benchmarks/src/objc_stret.m | 37 -- misc/darling-new.svg | 584 ----------------------- misc/darling.svg | 849 ++++++++++++++++++++++------------ misc/links.txt | 22 - tools/gdb_maloader.py | 71 --- tools/unpack_xcode.sh | 97 ---- 10 files changed, 543 insertions(+), 1240 deletions(-) delete mode 100755 benchmarks/runtest delete mode 120000 benchmarks/runtest32 delete mode 120000 benchmarks/runtest64 delete mode 100644 benchmarks/src/objc_msgSend.m delete mode 100644 benchmarks/src/objc_stret.m delete mode 100644 misc/darling-new.svg delete mode 100644 misc/links.txt delete mode 100644 tools/gdb_maloader.py delete mode 100755 tools/unpack_xcode.sh diff --git a/benchmarks/runtest b/benchmarks/runtest deleted file mode 100755 index d809fb5db..000000000 --- a/benchmarks/runtest +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -BUILDSERVER="osx" -CPPFLAGS="" -DYLD="dyld" - -set -e - -failure() { - tput setaf 1 - tput bold - echo "Benchmark failure - the last command failed to execute" - tput sgr0 -} - -runtest() { - trap failure ERR - - source="$1" - extension="${source##*.}" - source_fn=$(echo "$source" | sed 's/\//_/g') - - cflags="$(grep '// CFLAGS' "$source" || true)" - cflags="-O3 $CPPFLAGS -w $(echo "$cflags" | cut -b 12-)" - - case "$extension" in - "cpp") - darwin_tool="g++" - native_tool="clang++" - ;; - "c") - darwin_tool="gcc" - native_tool="clang" - ;; - "m") - darwin_tool="gcc" - native_tool="clang" - cflags_native="-l:libobjc.so.4 -lgnustep-base" - cflags_darwin="-lobjc" - ;; - *) - echo "Unsupported file type: $extension" - exit 1 - esac - - tput bold - echo "=====" - echo "Running benchmark '$source'" - echo "=====" - tput sgr0 - - cflags="$(grep '// CFLAGS' "$source" || true)" - cflags="$CPPFLAGS -w $(echo "$cflags" | cut -b 12-)" - - echo "Copying the source code to Darwin..." - scp "$source" "$BUILDSERVER:/tmp/$$.$source_fn" >/dev/null - echo "Building the source code for Darwin..." - ssh "$BUILDSERVER" "$darwin_tool $cflags $cflags_darwin '/tmp/$$.$source_fn' -o '/tmp/$$.$source_fn.bin'" - echo "Copying the binary over..." - scp "$BUILDSERVER:/tmp/$$.$source_fn.bin" "/tmp" >/dev/null - ssh "$BUILDSERVER" "rm -f /tmp/$$.$source_fn*" - - echo "Running Darwin binary..." - tput bold - time $DYLD "/tmp/$$.$source_fn.bin" - tput sgr0 - rm -f "/tmp/$$.$source_fn.bin" - - echo "Compiling native..." - $native_tool $cflags $cflags_native "$source" -o "/tmp/$$.$source_fn.bin" - echo "Running native binary..." - tput bold - time "/tmp/$$.$source_fn.bin" - tput sgr0 - - rm -f "/tmp/$$.$source_fn.bin" -} - -if [[ "$0" == *runtest32 ]]; then - CPPFLAGS="-m32" - DYLD="dyld32" - echo "32-bit mode" -fi -if [[ "$0" == *runtest64 ]]; then - DYLD="dyld64" - echo "64-bit mode" -fi - -for test in "$@"; do - runtest "$test" -done - diff --git a/benchmarks/runtest32 b/benchmarks/runtest32 deleted file mode 120000 index 41dd14534..000000000 --- a/benchmarks/runtest32 +++ /dev/null @@ -1 +0,0 @@ -runtest \ No newline at end of file diff --git a/benchmarks/runtest64 b/benchmarks/runtest64 deleted file mode 120000 index 41dd14534..000000000 --- a/benchmarks/runtest64 +++ /dev/null @@ -1 +0,0 @@ -runtest \ No newline at end of file diff --git a/benchmarks/src/objc_msgSend.m b/benchmarks/src/objc_msgSend.m deleted file mode 100644 index beca4d11c..000000000 --- a/benchmarks/src/objc_msgSend.m +++ /dev/null @@ -1,29 +0,0 @@ -#include -#import - -@interface helloclass : NSObject { -} - -+ (int)mult:(int)a :(int)b; -@end - -@implementation helloclass -+ (int)mult:(int)a :(int)b -{ - return a*b; -} -@end - -int main() -{ - int i; - volatile int j; - for (i = 0; i < 10000000; i++) - { - j += [helloclass mult:1:2]; - } - - return 0; -} - - diff --git a/benchmarks/src/objc_stret.m b/benchmarks/src/objc_stret.m deleted file mode 100644 index 7b8879b6e..000000000 --- a/benchmarks/src/objc_stret.m +++ /dev/null @@ -1,37 +0,0 @@ -#include -#import - -struct st -{ - float f1; - int buf[50]; -}; - -@interface helloclass : NSObject { -} - -+ (struct st)mult:(float)a :(float)b; -@end - -@implementation helloclass -+ (struct st)mult:(float)a :(float)b -{ - struct st s; - s.f1 = a+b; - return s; -} -@end - -int main() -{ - int i; - for (i = 0; i < 10000000; i++) - { - struct st v = [helloclass mult:1.0f:2.0f]; - v.f1; - } - - return 0; -} - - diff --git a/misc/darling-new.svg b/misc/darling-new.svg deleted file mode 100644 index 6d14b546b..000000000 --- a/misc/darling-new.svg +++ /dev/null @@ -1,584 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - $ dar ling - - - - - - - - - diff --git a/misc/darling.svg b/misc/darling.svg index cbdda396d..6d14b546b 100644 --- a/misc/darling.svg +++ b/misc/darling.svg @@ -7,341 +7,578 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="192.34206" - height="215.57864" - id="svg2" - inkscape:label="Pozadí" + width="141.87364" + height="150.13608" + id="svg4249" version="1.1" - inkscape:version="0.48.3.1 r9886" - sodipodi:docname="darling.svg" - inkscape:export-filename="/tmp/darling.png" - inkscape:export-xdpi="64.292084" - inkscape:export-ydpi="64.292084"> + inkscape:version="0.91 r13725" + sodipodi:docname="darling-new.svg" + inkscape:export-filename="/tmp/darling270.png" + inkscape:export-xdpi="170.62" + inkscape:export-ydpi="170.62"> + id="defs4251"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + showgrid="true" + fit-margin-top="5" + fit-margin-left="5" + fit-margin-right="5" + fit-margin-bottom="5" + inkscape:window-width="1524" + inkscape:window-height="1281" + inkscape:window-x="1993" + inkscape:window-y="150" + inkscape:window-maximized="0" + showguides="true"> + + + id="metadata4254"> image/svg+xml - + + transform="translate(-243.34889,-328.84772)"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + style="fill:url(#linearGradient4085-3-8-5-8);fill-opacity:1;stroke:none" + id="path4075-2-6-5-1" + sodipodi:cx="89.380104" + sodipodi:cy="-356.54465" + sodipodi:rx="14.460939" + sodipodi:ry="17.731192" + d="m 103.84104,-356.54465 a 14.460939,17.731192 0 0 1 -14.460936,17.73119 14.460939,17.731192 0 0 1 -14.460939,-17.73119 14.460939,17.731192 0 0 1 14.460939,-17.73119 14.460939,17.731192 0 0 1 14.460936,17.73119 z" + transform="translate(218.11416,711.60607)" /> + + + + + + $ dar ling + id="flowRoot4019-8-1-5-8" + style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-size:16px;line-height:125%;font-family:TlwgMono;-inkscape-font-specification:'TlwgMono Medium';text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none" + transform="translate(482.22388,538.05132)">$ dar ling + + + + + + + + diff --git a/misc/links.txt b/misc/links.txt deleted file mode 100644 index d31236213..000000000 --- a/misc/links.txt +++ /dev/null @@ -1,22 +0,0 @@ -Error codes by platform: -http://www.ioplex.com/~miallen/errcmp.html - -GCC inline asm: -http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html - -Darwin syscalls: -http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/ - -Darwin tasks: -http://www.foldr.org/~michaelw/log/computers/macosx/task-info-fun-with-mach - -NetBSD paper: -http://2004.eurobsdcon.org/uploads/media/EBSD04_21.pdf - -Crosscompilation: -http://nathancoulson.com/proj_cross.php#x86_64-apple-darwin10 - -Unix apps for OS X: -http://code.google.com/p/rudix/ - - diff --git a/tools/gdb_maloader.py b/tools/gdb_maloader.py deleted file mode 100644 index b77ef4caa..000000000 --- a/tools/gdb_maloader.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2011 Shinichiro Hamaji. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials -# provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY Shinichiro Hamaji ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Shinichiro Hamaji OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -import gdb -import os -import re -import sys - -def bt(demangle=True): - # Find the newest frame. - frame = gdb.selected_frame() - while True: - next = frame.newer() - if not next: - break - frame = next - - if demangle: - pipe = os.popen('c++filt', 'w') - else: - pipe = sys.stdout - - i = 0 - while frame: - s = gdb.execute('p dumpSymbol((void*)0x%x)' % frame.pc(), - to_string=True) - m = re.match(r'.*"(.*)"$', s) - if m: - pipe.write("#%-2d %s\n" % (i, m.group(1))) - else: - sal = frame.find_sal() - lineno = '' - if sal.symtab: - lineno = 'at %s:%d' % (sal.symtab, sal.line) - else: - soname = gdb.solib_name(frame.pc()) - if soname: - lineno = 'from %s' % (soname) - framename = frame.name() - if not framename: - framename = '??' - pipe.write("#%-2d 0x%016x in %s () %s\n" % - (i, frame.pc(), framename, lineno)) - frame = frame.older() - i += 1 - - pipe.close() diff --git a/tools/unpack_xcode.sh b/tools/unpack_xcode.sh deleted file mode 100755 index 0fe51cd56..000000000 --- a/tools/unpack_xcode.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# -# Copyright 2011 Shinichiro Hamaji. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials -# provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY Shinichiro Hamaji ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Shinichiro Hamaji OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# Usage: -# -# %./unpack_xcode.sh xcode_3.2.6_and_ios_sdk_4.3__final.dmg -# -# The above commandline will put CLI tools in the dmg package into -# ./xcode_3.2.6_and_ios_sdk_4.3__final/root . -# -# This script was inspired by this document: -# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt - -set -e - -dmg=$1 -dir=`basename $dmg .dmg` - -if echo $dmg | grep xcode_4.1; then - PKGS="MacOSX10.6 gcc4.2 llvm-gcc4.2 DeveloperToolsCLI clang" - XCODE=xcode_4.1 - PKG_DIR="Applications/Install Xcode.app/Contents/Resources/Packages" -elif echo $dmg | grep xcode_3; then - PKGS="MacOSX10.6 gcc4.2 gcc4.0 llvm-gcc4.2 DeveloperToolsCLI clang" - XCODE=xcode_3 - PKG_DIR="*/Packages" -else - PKGS="MacOSX10.6 gcc4.2 llvm-gcc4.2 DeveloperToolsCLI clang" - XCODE=xcode_4.0 - PKG_DIR="*/Packages" -fi - -rm -fr $dir -mkdir $dir -cd $dir - -7z x ../$dmg -7z x 5.hfs - -if [ $XCODE = "xcode_4.1" ]; then - 7z x -y "Install Xcode/InstallXcode.pkg" - 7z x -y InstallXcode.pkg/Payload -fi - -for pkg in $PKGS; do - 7z x -y "$PKG_DIR/$pkg.pkg" - 7z x -y Payload - mkdir -p $pkg - cd $pkg - cpio -i < ../Payload~ - cd .. - rm -f Payload* -done - -rm -fr root -mkdir root -for pkg in $PKGS; do - if [ $pkg = "MacOSX10.6" ]; then - cp -R $pkg/SDKs/*/* root - else - cd $pkg || continue - tar -c * | tar -xC ../root - cd .. - fi -done - -ln -sf "../../System/Library/Frameworks root/Library/Frameworks" -cd root/usr/lib -ln -s system/* . - -echo "The package was unpacked into $dir/root"