<commit_before>#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

'''
This script extracts sub-components from a fully populated
toolchain/pnacl_linux_XXX/ directory to create custom toolchains.
It is intentioanlly kept simple.

For usage information run:
     pnacl/tc_component_packager.py -h
'''

import glob
import optparse
import os
import sys

######################################################################
# BEGINING OF TABLES
######################################################################
COMPONENTS = {}

COMPONENTS['bitcode_newlib_frontend'] = [
    # basics
    'newlib/lib/',      # this probably includes too much
    'newlib/sysroot/',
    'newlib/usr/include/',
    'pkg/llvm/lib/clang/3.1/include/',

    # bitcode libs
    'newlib/usr/lib/libc.a',
    'newlib/usr/lib/libm.a',
    'newlib/usr/lib/libstdc++.a',

    # more libs and headers (from nacl-ports)
    'newlib/sdk/',

    # magic file
    'newlib/bin/newlib.cfg',

    # tool wrappers
    'newlib/bin/driver_*',
    'newlib/bin/*tools.py',
    'newlib/bin/pnacl-driver',
    'newlib/bin/pnacl-clang*',
    'newlib/bin/pnacl-nm',
    'newlib/bin/pnacl-opt',
    'newlib/bin/pnacl-ar',
    'newlib/bin/pnacl-ld',
    'newlib/bin/pnacl-ranlib',
    'newlib/bin/pnacl-strip',
    'newlib/bin/pnacl-nop',       # probably not really need but tiny
    'newlib/bin/pnacl-illegal',   # probably not really need but tiny

    # actual tools
    'pkg/llvm/bin/clang*',
    'pkg/llvm/bin/llvm-ar',
    'pkg/llvm/bin/llvm-nm',
    'pkg/llvm/bin/llvm-ranlib',
    'pkg/llvm/bin/llvm-ld',
    'pkg/llvm/bin/llvm-link',
    'pkg/llvm/bin/opt',
    'pkg/binutils/bin/arm-pc-nacl-ar',
    'pkg/binutils/bin/arm-pc-nacl-ranlib',
    'pkg/llvm/lib/libLLVMgold.so',    # symlink
    'pkg/llvm/lib/LLVMgold.so',
    'pkg/llvm/lib/libLTO.so',
    'pkg/binutils/lib/bfd-plugins', # used by arm-pc-nacl-ranlib (important!)
    'pkg/binutils/bin/arm-pc-nacl-ld.gold',
]
<commit_msg>Add pnacl-dis to the tools being considered part of the bitcode TC.<commit_after>#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

'''
This script extracts sub-components from a fully populated
toolchain/pnacl_linux_XXX/ directory to create custom toolchains.
It is intentioanlly kept simple.

For usage information run:
     pnacl/tc_component_packager.py -h
'''

import glob
import optparse
import os
import sys

######################################################################
# BEGINING OF TABLES
######################################################################
COMPONENTS = {}

COMPONENTS['bitcode_newlib_frontend'] = [
    # basics
    'newlib/lib/',      # this probably includes too much
    'newlib/sysroot/',
    'newlib/usr/include/',
    'pkg/llvm/lib/clang/3.1/include/',

    # bitcode libs
    'newlib/usr/lib/libc.a',
    'newlib/usr/lib/libm.a',
    'newlib/usr/lib/libstdc++.a',

    # more libs and headers (from nacl-ports)
    'newlib/sdk/',

    # magic file
    'newlib/bin/newlib.cfg',

    # tool wrappers
    'newlib/bin/driver_*',
    'newlib/bin/*tools.py',
    'newlib/bin/pnacl-driver',
    'newlib/bin/pnacl-clang*',
    'newlib/bin/pnacl-dis',
    'newlib/bin/pnacl-nm',
    'newlib/bin/pnacl-opt',
    'newlib/bin/pnacl-ar',
    'newlib/bin/pnacl-ld',
    'newlib/bin/pnacl-ranlib',
    'newlib/bin/pnacl-strip',
    'newlib/bin/pnacl-nop',       # probably not really need but tiny
    'newlib/bin/pnacl-illegal',   # probably not really need but tiny

    # actual tools
    'pkg/llvm/bin/clang*',
    'pkg/llvm/bin/llvm-ar',
    'pkg/llvm/bin/llvm-dis',
    'pkg/llvm/bin/llvm-nm',
    'pkg/llvm/bin/llvm-ranlib',
    'pkg/llvm/bin/llvm-ld',
    'pkg/llvm/bin/llvm-link',
    'pkg/llvm/bin/opt',
    'pkg/binutils/bin/arm-pc-nacl-ar',
    'pkg/binutils/bin/arm-pc-nacl-ranlib',
    'pkg/llvm/lib/libLLVMgold.so',    # symlink
    'pkg/llvm/lib/LLVMgold.so',
    'pkg/llvm/lib/libLTO.so',
    'pkg/binutils/lib/bfd-plugins', # used by arm-pc-nacl-ranlib (important!)
    'pkg/binutils/bin/arm-pc-nacl-ld.gold',
]

{'fraction_non_alphanumeric': 0.20913965959431102, 'fraction_numerical': 0.002797854977850315, 'mean_word_length': 3.121037463976945, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3720676', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1544, 'n_words': 293}