{ "info": { "author": "Ian A. Mason", "author_email": "iam@csl.sri.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: System :: Distributed Computing" ], "description": "|PyPI version| |Build Status|\n\nDescription\n===========\n\n`OCCAM `__ is a whole-program partial\nevaluator for LLVM bitcode that aims at debloating programs and\nshared/static libraries running in a specific deployment context.\n\nOCCAM architecture\n==================\n\n.. figure:: https://github.com/SRI-CSL/OCCAM/blob/master/OCCAM-arch.jpg?raw=true\n :alt: OCCAM architecture\n\n OCCAM architecture\n\nPrerequisites\n=============\n\nOCCAM currently works fine on Linux, OS X, and FreeBSD. It depends on an\ninstallation of LLVM. OCCAM currently requires llvm-5.0. You will also\nneed the Google protobuffer compiler ``protoc`` and the corresponding\npython `package `__.\n\nIf you need to generate application bitcode, you will want to install\nwllvm, either from the the pip\n`package `__ or the GitHub\n`repository `__.\n\nThe test harness also requires\n`lit `__ and ``FileCheck``.\n``FileCheck`` can often be found in the binary directory of your llvm\ninstallation, however if you built your own, you may need to read\n`this. `__ Hint: the build\nproduces it, but does not install it (try ``locate FileCheck``, then\ncopy it to the ``bin`` directory).\n\nDetailed configuration instructions for Ubuntu 14.04 can be gleaned from\n`bootstrap.sh `__\nas well as the Travis CI scripts for each branch\n`.travis.yml `__.\n\nBuilding and Installing\n=======================\n\nSet where OCCAM\u2019s library will be stored:\n\n::\n\n export OCCAM_HOME={path to location in your home directory}\n\nPoint to your LLVM\u2019s location, if non-standard:\n\n::\n\n export LLVM_HOME=/usr/local/llvm-5.0\n export LLVM_CONFIG=llvm-config-5.0\n\nSet where system libraries, including Google Protocol Buffers, are\nlocated:\n\n::\n\n export LD_FLAGS='-L/usr/local/lib'\n\nClone, build and install OCCAM with:\n\n::\n\n git clone --recurse-submodules https://github.com/SRI-CSL/OCCAM.git\n make\n make install\n make test\n\nUsing OCCAM\n===========\n\nYou can choose to record logs from the OCCAM tool by setting the\nfollowing variables:\n\n::\n\n export OCCAM_LOGFILE={absolute path to log location}\n export OCCAM_LOGLEVEL={INFO, WARNING, or ERROR}\n\nUsing razor\n===========\n\n``razor`` is a pip package that relies on the same dynamic library as\n``occam``, so you should first build and install ``occam`` as described\nabove. ``razor`` provides the commandline tool ``slash``. You can either\ninstall ``razor`` you can from this repository, or you can just do a\n\n::\n\n pip install razor\n\nTo install an editable version from this repository:\n\n::\n\n make -f Makefile develop\n\nThis may require sudo priviliges. Either way you can now use ``slash``:\n\n::\n\n slash [--work-dir=] [--force] [--no-strip] [--intra-spec-policy=] [--inter-spec-policy=] \n\nwhere\n\n::\n\n type=none|aggressive|nonrec-aggressive\n\nThe value ``none`` will prevent any inter or intra-module\nspecialization. The value ``aggressive`` specializes a call if any\nparameter is a constant. The value ``nonrec-aggressive`` specializes a\ncall if the function is non-recursive and any parameter is a constant.\n\nTo function correctly ``slash`` calls LLVM tools such as ``opt`` and\n``clang++``. These should be available in your ``PATH``, and be the\ncurrently supported version (5.0). Like ``wllvm``, ``slash``, will pay\nattention to the environment variables ``LLVM_OPT_NAME`` and\n``LLVM_CXX_NAME`` if your version of these tools are adorned with\nsuffixes.\n\nThe Manifest(o)\n===============\n\nThe manifest for ``slash`` should be valid JSON. The following keys have\nmeaning:\n\n- ``main`` : a path to the bitcode module containing the ``main`` entry\n point.\n\n- ``modules``: a list of paths to the other bitcode modules needed.\n\n- ``binary`` : the name of the desired executable.\n\n- ``native_libs`` : a list of flags (``-lm``, ``-lc``, ``-lpthread``)\n or paths to native objects (``.o``, ``.a``, ``.so``, ``.dylib``)\n\n- ``ldflags``: a list of linker flags such as ``--static``,\n ``--nostdlib``\n\n- ``args`` : the list of arguments you wish to specialize in the main\n of ``main``.\n\n- ``constraints`` : a list consisting of a positive integer, followed\n by some number of strings. The number indicates the expected number\n of arguments the specialized program will receive, and the remaing\n strings are the specialized arguments to the original program.\n\nNote that ``args`` and ``constraints`` are mutually exclusive. If you\nuse one you should not use the other.\n\nAs an example, (see ``examples/linux/apache``), to previrtualize apache:\n\n::\n\n { \"main\" : \"httpd.bc\"\n , \"binary\" : \"httpd_slashed\"\n , \"modules\" : [\"libapr-1.so.bc\", \"libaprutil-1.so.bc\", \"libpcre.so.bc\"]\n , \"native_libs\" : [\"-lcrypt\", \"-ldl\", \"-lpthread\"]\n , \"args\" : [\"-d\", \"/var/www\"]\n , \"name\" : \"httpd\"\n }\n\nAnother example, (see ``examples/linux/musl_nweb``), specializes\n``nweb`` with ``musl libc.c``:\n\n::\n\n { \"main\" : \"nweb.o.bc\"\n , \"binary\" : \"nweb_razor\"\n , \"modules\" : [\"libc.a.bc\"]\n , \"native_libs\" : [\"crt1.o\", \"libc.a\"]\n , \"ldflags\" : [\"-static\", \"-nostdlib\"]\n , \"args\" : [\"8181\", \"./root\"]\n , \"name\" : \"nweb\"\n }\n\nA third example, (see ``examples/portfolio/tree``), illustrates the use\nof the ``constraints`` field to partially specialize the arguments to\nthe ``tree`` utility.\n\n::\n\n { \"main\" : \"tree.bc\"\n , \"binary\" : \"tree\"\n , \"modules\" : []\n , \"native_libs\" : []\n , \"ldflags\" : [ \"-O2\" ]\n , \"name\" : \"tree\"\n , \"constraints\" : [\"1\", \"tree\", \"-J\", \"-h\"]\n }\n\nthe specialized program will output its results in JSON notation, that\nwill include a human readable size field. The specialized program\nexpects one extra argument, either a directory, or another flag to\noutput the contents of the current working directory.\n\n--------------\n\nThis material is based upon work supported by the National Science\nFoundation under Grant\n`ACI-1440800 `__.\nAny opinions, findings, and conclusions or recommendations expressed in\nthis material are those of the author(s) and do not necessarily reflect\nthe views of the National Science Foundation.\n\n.. |PyPI version| image:: https://badge.fury.io/py/razor.svg\n :target: https://badge.fury.io/py/razor\n.. |Build Status| image:: https://travis-ci.org/SRI-CSL/OCCAM.svg?branch=master\n :target: https://travis-ci.org/SRI-CSL/OCCAM\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SRI-CSL/OCCAM", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "razor", "package_url": "https://pypi.org/project/razor/", "platform": "", "project_url": "https://pypi.org/project/razor/", "project_urls": { "Homepage": "https://github.com/SRI-CSL/OCCAM" }, "release_url": "https://pypi.org/project/razor/1.1.0/", "requires_dist": [ "protobuf (>=3.5.1)" ], "requires_python": "", "summary": "The OCCAM saga", "version": "1.1.0" }, "last_serial": 5210430, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "8c3403fe862c8e021c495298bbd9fcb5", "sha256": "479bac9bb576962aa5fbd16c57a011508f8a1bcab2e06adfaa13cc0eff40ea9d" }, "downloads": -1, "filename": "razor-1.0.0.tar.gz", "has_sig": false, "md5_digest": "8c3403fe862c8e021c495298bbd9fcb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14153, "upload_time": "2016-11-16T00:00:13", "url": "https://files.pythonhosted.org/packages/52/2e/a3d0ebb062b8c0f377fc0e12d6d24a9cbabca1e2a2fae539b6b158faaf6c/razor-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "c8bfdadcd476d2fc020347acd445c7bd", "sha256": "9341a35ea3070f607ebfa975cae4542e2719d048abd9ccd26b01ca5667bf5f77" }, "downloads": -1, "filename": "razor-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c8bfdadcd476d2fc020347acd445c7bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14644, "upload_time": "2016-11-16T23:43:24", "url": "https://files.pythonhosted.org/packages/f9/84/886efa92e6b406473717b92c6de3eca803f7877e798e40d716409691015e/razor-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "31a0c58c1a27459f74befe668c681dd8", "sha256": "904e77dd9bf3836a48c83f49801baf0bc4517116ea9797b2910afc80badf81fb" }, "downloads": -1, "filename": "razor-1.0.2.tar.gz", "has_sig": false, "md5_digest": "31a0c58c1a27459f74befe668c681dd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14630, "upload_time": "2016-11-16T23:45:04", "url": "https://files.pythonhosted.org/packages/7b/29/dd504a219f0e6ca3de15707a15a15d5eabe90360b4ebd6bd8b0d15a9d57c/razor-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "1a3529d0d22a6da6dc70e7926c426753", "sha256": "a14d609607e073cc44098aedc676bf1e8f0d04cd1bd9341763e4ec7f860c123a" }, "downloads": -1, "filename": "razor-1.0.3.tar.gz", "has_sig": false, "md5_digest": "1a3529d0d22a6da6dc70e7926c426753", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19383, "upload_time": "2016-11-24T18:33:06", "url": "https://files.pythonhosted.org/packages/7a/34/6b9324a4e01460044def41aba662f45c2650467c7c716b313680393e4228/razor-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "320a8c82fdcac7dbd122f8d5d4b3ab97", "sha256": "9d4a328ed48e49f17c890ae88b226a7c2b58b8b76d126cf768e1b758e11cfc7a" }, "downloads": -1, "filename": "razor-1.0.4-py2-none-any.whl", "has_sig": false, "md5_digest": "320a8c82fdcac7dbd122f8d5d4b3ab97", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 37639, "upload_time": "2019-04-30T22:46:48", "url": "https://files.pythonhosted.org/packages/48/91/e78835a64ccb6a186f5b4e5cb8f6fdfa551686b89be3f3b0935b0971bd1b/razor-1.0.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "002aefee4762b3cc4f318408a496e1e4", "sha256": "02e96e9eeac6d4b032372f2b5351b24a7069a0f7f36153ce092243380fb21362" }, "downloads": -1, "filename": "razor-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "002aefee4762b3cc4f318408a496e1e4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 37375, "upload_time": "2019-04-30T22:46:50", "url": "https://files.pythonhosted.org/packages/4f/30/f8e7dab57da7a0d148867a522b6df70eaa725d1d12771ef342c12b389ad9/razor-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "73b0d97a83bf541b80f3897db49bc195", "sha256": "3501dd42a6ac490545d7c56a736f603defbdaca4ff31c34f823235247e1bebe4" }, "downloads": -1, "filename": "razor-1.0.4.tar.gz", "has_sig": false, "md5_digest": "73b0d97a83bf541b80f3897db49bc195", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19558, "upload_time": "2016-11-29T22:16:24", "url": "https://files.pythonhosted.org/packages/d7/b6/014bf8d768186e973fd3099ddc1e25be35ff33db0082d1d0248028ae2338/razor-1.0.4.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "3e5cda9bb743c73fffc44d1a31b0dc42", "sha256": "7eb9d85a1719fcd0957220bb1f497946d54c7b7c2098a2ac5c2037b9885bdb71" }, "downloads": -1, "filename": "razor-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3e5cda9bb743c73fffc44d1a31b0dc42", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 37429, "upload_time": "2019-04-30T22:46:52", "url": "https://files.pythonhosted.org/packages/25/8f/5ea22acac7212a31b3aecb07399e81f157c16284fccf3e8611b4d5e5873d/razor-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "44d75570f687957071681cdf33e42fc8", "sha256": "5cc40a20090cec4871b775253beec0fa1b4538c8437b4e67271c1ffd420f35b7" }, "downloads": -1, "filename": "razor-1.1.0.tar.gz", "has_sig": false, "md5_digest": "44d75570f687957071681cdf33e42fc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30921, "upload_time": "2019-04-30T22:47:55", "url": "https://files.pythonhosted.org/packages/f2/0a/6e5998d229547ffdc726df35d265fbb1cf4921316e3d44f073c7244dd91a/razor-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3e5cda9bb743c73fffc44d1a31b0dc42", "sha256": "7eb9d85a1719fcd0957220bb1f497946d54c7b7c2098a2ac5c2037b9885bdb71" }, "downloads": -1, "filename": "razor-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3e5cda9bb743c73fffc44d1a31b0dc42", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 37429, "upload_time": "2019-04-30T22:46:52", "url": "https://files.pythonhosted.org/packages/25/8f/5ea22acac7212a31b3aecb07399e81f157c16284fccf3e8611b4d5e5873d/razor-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "44d75570f687957071681cdf33e42fc8", "sha256": "5cc40a20090cec4871b775253beec0fa1b4538c8437b4e67271c1ffd420f35b7" }, "downloads": -1, "filename": "razor-1.1.0.tar.gz", "has_sig": false, "md5_digest": "44d75570f687957071681cdf33e42fc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30921, "upload_time": "2019-04-30T22:47:55", "url": "https://files.pythonhosted.org/packages/f2/0a/6e5998d229547ffdc726df35d265fbb1cf4921316e3d44f073c7244dd91a/razor-1.1.0.tar.gz" } ] }