diff --git a/.github/workflows/licenses.yml b/.github/workflows/licenses.yml new file mode 100644 index 0000000..ed7855f --- /dev/null +++ b/.github/workflows/licenses.yml @@ -0,0 +1,85 @@ +name: License checks + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + cargo-licenses: + name: Cargo dependency licenses + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Validate native distribution and publication gates + run: | + ruby ci/check_native_distribution.rb + python -I -m unittest discover -s ci -p test_native_distribution_contract.py -v + - uses: EmbarkStudios/cargo-deny-action@b66acf5e9fe20f8aba065be86778a8a4c846f902 + with: + command: check licenses + + npm-licenses: + name: npm dependency licenses + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "24" + - run: npm ci --ignore-scripts + - name: Check npm lockfile + run: | + node --input-type=module <<'NODE' + import assert from "node:assert/strict"; + import { readFileSync } from "node:fs"; + const allowed = new Set(["MIT", "Apache-2.0", "MIT OR Apache-2.0", "Apache-2.0 OR MIT"]); + function check(lock) { + if (lock?.lockfileVersion !== 3 || !lock.packages || typeof lock.packages !== "object" || Array.isArray(lock.packages) || !lock.packages[""]) throw new Error("Invalid npm lockfile"); + return Object.entries(lock.packages).filter(([path, pkg]) => path !== "" && !allowed.has(pkg?.license)).map(([path, pkg]) => `${path}: ${JSON.stringify(pkg?.license)}`); + } + assert.equal(check({ lockfileVersion: 3, packages: { "": {}, x: { license: "MIT AND GPL-3.0-only" } } }).length, 1); + assert.equal(check({ lockfileVersion: 3, packages: { "": {}, x: {} } }).length, 1); + assert.equal(check({ lockfileVersion: 3, packages: { "": {}, x: { license: "MIT" } } }).length, 0); + const failures = check(JSON.parse(readFileSync("package-lock.json", "utf8"))); + if (failures.length) { console.error(failures.join("\n")); process.exitCode = 1; } + NODE + + composer-licenses: + name: Composer dependency licenses (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ["7.4", "8.2", "8.3"] + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + - uses: actions/setup-node@v4 + with: + node-version: "24" + - name: Resolve dependencies without scripts or plugins + run: composer update --no-interaction --no-progress --no-scripts --no-plugins --prefer-dist + - run: composer licenses --format=json > "$RUNNER_TEMP/composer-licenses.json" + - name: Check all Composer dependency licenses + run: | + node --input-type=module <<'NODE' + import assert from "node:assert/strict"; + import { readFileSync } from "node:fs"; + const allowed = new Set(["MIT", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "ISC", "MIT OR Apache-2.0", "Apache-2.0 OR MIT"]); + function check(report) { + if (!report?.dependencies || typeof report.dependencies !== "object" || Array.isArray(report.dependencies)) throw new Error("Invalid Composer license report"); + return Object.entries(report.dependencies).filter(([, pkg]) => !Array.isArray(pkg?.license) || pkg.license.length === 0 || pkg.license.some((license) => !allowed.has(license))).map(([name, pkg]) => `${name}: ${JSON.stringify(pkg?.license)}`); + } + assert.equal(check({ dependencies: { a: { license: ["MIT"] } } }).length, 0); + assert.equal(check({ dependencies: { a: { license: [] } } }).length, 1); + assert.equal(check({ dependencies: { a: { license: ["MIT AND GPL-3.0-only"] } } }).length, 1); + const failures = check(JSON.parse(readFileSync(`${process.env.RUNNER_TEMP}/composer-licenses.json`, "utf8"))); + if (failures.length) { console.error(failures.join("\n")); process.exitCode = 1; } + NODE diff --git a/.github/workflows/native-distribution-check.yml b/.github/workflows/native-distribution-check.yml new file mode 100644 index 0000000..73ba0ab --- /dev/null +++ b/.github/workflows/native-distribution-check.yml @@ -0,0 +1,13 @@ +name: Native distribution check + +on: + pull_request: + +permissions: + contents: read + +jobs: + native-distribution: + uses: ./.github/workflows/native-distribution.yml + with: + source-ref: c979b98d6decfb3c2808c8177eecf5d34dbc8634 diff --git a/.github/workflows/native-distribution.yml b/.github/workflows/native-distribution.yml new file mode 100644 index 0000000..baa88ac --- /dev/null +++ b/.github/workflows/native-distribution.yml @@ -0,0 +1,293 @@ +name: Verified native distribution + +on: + workflow_call: + inputs: + source-ref: + description: Exact source commit to build + required: true + type: string + +permissions: + contents: read + +env: + CARGO_TERM_COLOR: always + +jobs: + windows-gnu: + uses: ./.github/workflows/windows-gnu-cabi-candidate.yml + with: + source-ref: ${{ inputs.source-ref }} + + build-native: + name: native / ${{ matrix.settings.asset }} + runs-on: ${{ matrix.settings.os }} + env: + SOURCE_REF: ${{ inputs.source-ref }} + strategy: + fail-fast: false + matrix: + settings: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + asset: libktav_cabi-linux-amd64.so + artifact: libktav_cabi.so + use-zigbuild: true + + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + asset: libktav_cabi-linux-arm64.so + artifact: libktav_cabi.so + use-zigbuild: true + + - os: macos-latest + target: x86_64-apple-darwin + asset: libktav_cabi-darwin-amd64.dylib + artifact: libktav_cabi.dylib + use-zigbuild: false + + - os: macos-latest + target: aarch64-apple-darwin + asset: libktav_cabi-darwin-arm64.dylib + artifact: libktav_cabi.dylib + use-zigbuild: false + + + steps: + - uses: actions/checkout@v4 + - name: Preserve notice tooling and metadata hook + shell: python + run: | + import os + import re + import shutil + from pathlib import Path + if not re.fullmatch(r'[0-9a-f]{40}', os.environ['SOURCE_REF']): + raise SystemExit('source-ref must be an exact commit SHA') + stage = Path(os.environ['RUNNER_TEMP']) / 'native-notice-tools' + stage.mkdir() + files = [ + 'scripts/rust_compiler_notices.py', 'ci/rust-compiler-notices.json', 'ci/test_rust_compiler_notices.py', 'ci/licenses/rust-compiler-originals/compiler-builtins-LICENSE.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-Cargo.toml.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-build.rs.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-aarch64.rs.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-aarch64-outline-atomics.rs.txt', 'ci/licenses/rust-compiler-originals/compiler-rt-aarch64-lse.S.txt', 'ci/licenses/rust-compiler-originals/compiler-rt-aarch64-cpu-model.c.txt', 'ci/licenses/rust-compiler-originals/compiler-rt-LICENSE.TXT', 'ci/licenses/rust-compiler-originals/compiler-rt-CREDITS.TXT', 'ci/licenses/rust-compiler-originals/compiler-builtins-math-mod.rs.txt', 'ci/licenses/rust-compiler-originals/libm-trunc.rs.txt', 'ci/licenses/rust-compiler-originals/libm-LICENSE.txt', 'ci/licenses/rust-compiler-originals/libm-generic-trunc.rs.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-float-conv.rs.txt', + 'crates/cabi/build.rs', 'scripts/prepare_cabi_notices.py', + 'scripts/check_embedded_notices.py', 'scripts/cargo_notice_bundle.py', + 'scripts/collect_cargo_notices.py', 'ci/about.toml', + 'ci/test_embedded_notices.py', 'ci/test_zig_link_capture.py', + 'scripts/capture-zig-link.sh', 'scripts/zig_runtime_notices.py', + 'ci/zig-runtime-catalog.json', 'ci/test_zig_runtime_notices.py', + ] + for name in files: + target = stage / name + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(name, target) + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.source-ref }} + submodules: recursive + persist-credentials: false + - name: Apply metadata-only packaging hook + shell: python + run: | + import hashlib + import json + import os + import shutil + import subprocess + from pathlib import Path + revision = subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip() + if revision != os.environ['SOURCE_REF']: + raise SystemExit('unexpected native source revision') + stage = Path(os.environ['RUNNER_TEMP']) / 'native-notice-tools' + for path in stage.rglob('*'): + if not path.is_file(): + continue + target = Path(path.relative_to(stage)) + if target.as_posix() == 'crates/cabi/build.rs' and target.exists() and target.read_bytes() != path.read_bytes(): + raise SystemExit('existing C ABI build hook requires review') + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(path, target) + protected = ['Cargo.toml', 'crates/cabi/Cargo.toml', 'composer.json', 'composer.lock', 'src', 'tests', 'root-docs'] + subprocess.run(['git', 'diff', '--exit-code', '--', *protected], check=True) + source = Path('crates/cabi/src/lib.rs') + original = source.read_bytes() + hook = b'include!(concat!(env!("OUT_DIR"), "/native_notices.rs"));' + if hook not in original: + source.write_bytes(original + bytes([10, 10]) + hook + bytes([10])) + elif original.count(hook) != 1: + raise SystemExit('duplicate native notice include') + provenance = { + 'source_ref': revision, + 'tooling_ref': os.environ['GITHUB_SHA'], + 'original_cabi_source_sha256': hashlib.sha256(original).hexdigest(), + 'packaged_cabi_source_sha256': hashlib.sha256(source.read_bytes()).hexdigest(), + } + record = Path(os.environ['RUNNER_TEMP']) / 'native-source-provenance.json' + with record.open('x', encoding='utf-8') as output: + json.dump(provenance, output, sort_keys=True, indent=2) + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - uses: dtolnay/rust-toolchain@1.99.1 + with: + targets: ${{ matrix.settings.target }} + components: rust-docs + - uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.settings.target }} + + - name: Install zig + if: matrix.settings.use-zigbuild + uses: mlugg/setup-zig@v2 + with: + version: 0.14.0 + - name: Install cargo-zigbuild + if: matrix.settings.use-zigbuild + uses: taiki-e/install-action@v2 + with: + tool: cargo-zigbuild + + - name: Verify published Rust core provenance + shell: bash + run: | + set -euo pipefail + cargo generate-lockfile + cargo update -p ktav --precise 0.8.1 + python3 - <<'PY' + import tomllib + with open('Cargo.lock', 'rb') as source: + packages = tomllib.load(source)['package'] + core = [package for package in packages if package['name'] == 'ktav'] + if len(core) != 1: + raise SystemExit('expected exactly one ktav core') + expected = { + 'version': '0.8.1', + 'source': 'registry+https://github.com/rust-lang/crates.io-index', + 'checksum': '7140dfe2fa6c320e74768cd6a637828c2d26f81746254f4fcd805f3993bd3fd5', + } + for field, value in expected.items(): + if core[0].get(field) != value: + raise SystemExit(f'ktav {field} mismatch: {core[0].get(field)!r}') + print('published ktav 0.8.1 core provenance verified') + PY + + - uses: taiki-e/install-action@v2 + with: + tool: cargo-about@0.9.3 + - name: Prepare locked native notice resource + shell: python + run: | + import os + import shutil + import subprocess + import sys + from pathlib import Path + evidence = Path(os.environ['RUNNER_TEMP']) / 'native-notices' + subprocess.run([sys.executable, 'scripts/prepare_cabi_notices.py', str(evidence)], check=True) + shutil.copy2(Path(os.environ['RUNNER_TEMP']) / 'native-source-provenance.json', evidence / 'source-provenance.json') + with Path(os.environ['GITHUB_ENV']).open('a', encoding='utf-8') as output: + output.write(f'KTAV_NATIVE_NOTICES={(evidence / "NOTICE.json.gz").as_posix()}\n') + - name: Verify notice resource guards + run: | + python -m unittest discover -s ci -p test_embedded_notices.py -v + python -I -m unittest discover -s ci -p test_rust_compiler_notices.py -v + - name: Include verified Zig runtime notices + if: matrix.settings.use-zigbuild + shell: bash + run: | + set -euo pipefail + python -m unittest discover -s ci -p test_zig_runtime_notices.py -v + python scripts/zig_runtime_notices.py prepare "$RUNNER_TEMP/native-notices" + - name: Build (zigbuild) + if: matrix.settings.use-zigbuild + shell: bash + run: | + set -euo pipefail + zig version > "$RUNNER_TEMP/native-notices/zig-version.txt" + sha256sum "$(command -v cargo-zigbuild)" > "$RUNNER_TEMP/native-notices/cargo-zigbuild.sha256" + python -m unittest discover -s ci -p test_zig_link_capture.py -v + export KTAV_REAL_ZIG="$(command -v zig)" + export KTAV_LINK_MAP="$RUNNER_TEMP/native-notices/native-link.map" + export CARGO_ZIGBUILD_ZIG_COMMAND="$PWD/scripts/capture-zig-link.sh" + unset CARGO_ZIGBUILD_ZIG_COMMAND_ARGS + chmod +x "$CARGO_ZIGBUILD_ZIG_COMMAND" + RUSTFLAGS="${RUSTFLAGS:+$RUSTFLAGS }-C link-arg=-Wl,--print-map" \ + cargo zigbuild --locked --release -p ktav-cabi --target ${{ matrix.settings.target }}.2.17 + test -s "$RUNNER_TEMP/native-notices/native-link.map" + python scripts/zig_runtime_notices.py verify "$RUNNER_TEMP/native-notices" + + - name: Build (native) + if: ${{ !matrix.settings.use-zigbuild }} + run: cargo build --locked --release -p ktav-cabi --target ${{ matrix.settings.target }} + + - name: Rename artifact + shell: bash + run: | + src="target/${{ matrix.settings.target }}/release/${{ matrix.settings.artifact }}" + ls -la "$src" + cp "$src" "${{ matrix.settings.asset }}" + + - name: Verify embedded resource and write distribution sidecars + shell: python + env: + NATIVE_ASSET: ${{ matrix.settings.asset }} + run: | + import os + import shutil + import subprocess + import sys + from pathlib import Path + evidence = Path(os.environ['RUNNER_TEMP']) / 'native-notices' + asset = Path(os.environ['NATIVE_ASSET']) + if Path('Cargo.lock').read_bytes() != (evidence / 'Cargo.lock').read_bytes(): + raise SystemExit('Cargo.lock changed after notice preparation') + report = subprocess.check_output([sys.executable, 'scripts/check_embedded_notices.py', str(asset), str(evidence / 'NOTICE.json')]) + Path(str(asset) + '.NOTICE.manifest.json').write_bytes(report) + shutil.copy2(evidence / 'NOTICE.json', str(asset) + '.NOTICE.json') + - uses: shivammathur/setup-php@v2 + if: ${{ (startsWith(matrix.settings.target, 'aarch64-') && runner.arch == 'ARM64') || (startsWith(matrix.settings.target, 'x86_64-') && runner.arch == 'X64') }} + with: + php-version: '8.2' + extensions: ffi, json, mbstring, xdebug + ini-values: ffi.enable=1, xdebug.mode=off + coverage: xdebug + - name: Run PHP tests on matching target architecture + shell: python + env: + NATIVE_ASSET: ${{ matrix.settings.asset }} + NATIVE_TARGET: ${{ matrix.settings.target }} + NATIVE_FILENAME: ${{ matrix.settings.artifact }} + run: | + import os + import platform + import shutil + import subprocess + import sys + from pathlib import Path + host = {'amd64': 'x86_64', 'x86_64': 'x86_64', 'arm64': 'aarch64', 'aarch64': 'aarch64'}.get(platform.machine().lower()) + target = 'aarch64' if os.environ['NATIVE_TARGET'].startswith('aarch64-') else 'x86_64' + if host != target: + print('Cross-target resource verified; PHP execution requires matching architecture') + else: + asset = Path(os.environ['NATIVE_ASSET']).resolve() + default = Path('target/release') / os.environ['NATIVE_FILENAME'] + default.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(asset, default) + env = {**os.environ, 'KTAV_LIB_PATH': str(asset), 'KTAV_ENABLED_BACKENDS': 'native,pure'} + composer = ['cmd', '/c', 'composer'] if sys.platform == 'win32' else ['composer'] + subprocess.run([*composer, 'install', '--prefer-dist', '--no-progress', '--no-interaction'], env=env, check=True) + subprocess.run(['php', 'vendor/bin/kahlan', '--reporter=verbose'], env=env, check=True) + - uses: actions/upload-artifact@v4 + with: + name: native-distribution-${{ matrix.settings.target }} + path: | + ${{ matrix.settings.asset }} + ${{ matrix.settings.asset }}.NOTICE.json + ${{ matrix.settings.asset }}.NOTICE.manifest.json + if-no-files-found: error + - uses: actions/upload-artifact@v4 + if: always() + with: + name: native-license-evidence-${{ matrix.settings.target }} + path: ${{ runner.temp }}/native-notices/ + if-no-files-found: warn + diff --git a/.github/workflows/php-arm-host-probe.yml b/.github/workflows/php-arm-host-probe.yml new file mode 100644 index 0000000..0f28ae0 --- /dev/null +++ b/.github/workflows/php-arm-host-probe.yml @@ -0,0 +1,39 @@ +name: Native ARM64 PHP host feasibility + +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + php-arm-host: + runs-on: windows-11-arm + timeout-minutes: 120 + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/checkout@v4 + with: + repository: php/php-sdk-binary-tools + ref: 81b356186db123ce9cd65149cee4683211a59ebd + path: .ci-tools/php-sdk + persist-credentials: false + - uses: actions/checkout@v4 + with: + repository: microsoft/vcpkg + ref: 9a5dfef5d1a0438a7d24856a85bd60f309d355e9 + path: .ci-tools/vcpkg + persist-credentials: false + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Build and inspect genuine ARM64 PHP CLI and FFI host + run: python -I scripts/probe_php_arm_host.py + - uses: actions/upload-artifact@v4 + if: always() + with: + name: php-arm-host-evidence + path: ${{ runner.temp }}/php-arm-host/evidence/ + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f9276b..7774bd4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,112 +18,9 @@ jobs: # single asset named the way NativeLoader expects. # ------------------------------------------------------------------ build-native: - name: native / ${{ matrix.settings.asset }} - runs-on: ${{ matrix.settings.os }} - strategy: - fail-fast: false - matrix: - settings: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - asset: libktav_cabi-linux-amd64.so - artifact: libktav_cabi.so - use-zigbuild: true - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu - asset: libktav_cabi-linux-arm64.so - artifact: libktav_cabi.so - use-zigbuild: true - - os: macos-latest - target: x86_64-apple-darwin - asset: libktav_cabi-darwin-amd64.dylib - artifact: libktav_cabi.dylib - use-zigbuild: false - - os: macos-latest - target: aarch64-apple-darwin - asset: libktav_cabi-darwin-arm64.dylib - artifact: libktav_cabi.dylib - use-zigbuild: false - - os: windows-latest - target: x86_64-pc-windows-msvc - asset: ktav_cabi-windows-amd64.dll - artifact: ktav_cabi.dll - use-zigbuild: false - - os: windows-latest - target: aarch64-pc-windows-msvc - asset: ktav_cabi-windows-arm64.dll - artifact: ktav_cabi.dll - use-zigbuild: false - - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.settings.target }} - - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.settings.target }} - - - name: Install zig - if: matrix.settings.use-zigbuild - uses: mlugg/setup-zig@v2 - with: - version: 0.14.0 - - name: Install cargo-zigbuild - if: matrix.settings.use-zigbuild - uses: taiki-e/install-action@v2 - with: - tool: cargo-zigbuild - - # Provenance gate before ANY release build (mirrors ci.yml): - # generate Cargo.lock, pin the published ktav 0.8.1 core via a - # real TOML parse; the native build below then runs --locked and - # the zigbuild build relies on the verified lock. ubuntu-latest - # ships python3. - - name: Verify the published ktav 0.8.1 core (provenance) - shell: bash - run: | - set -e - cargo generate-lockfile - python3 - <<'PY' - import sys, tomllib - with open('Cargo.lock', 'rb') as f: - data = tomllib.load(f) - pkgs = [p for p in data.get('package', []) if p.get('name') == 'ktav'] - if len(pkgs) != 1: - sys.exit('expected exactly one ktav [[package]] entry, found %d' % len(pkgs)) - p = pkgs[0] - if p.get('version') != '0.8.1': - sys.exit('ktav version %r != 0.8.1' % p.get('version')) - if p.get('source') != 'registry+https://github.com/rust-lang/crates.io-index': - sys.exit('ktav source %r is not the crates.io registry' % p.get('source')) - if p.get('checksum') != '7140dfe2fa6c320e74768cd6a637828c2d26f81746254f4fcd805f3993bd3fd5': - sys.exit('ktav checksum %r mismatch' % p.get('checksum')) - print('ktav 0.8.1 provenance verified:', p['source']) - PY - - # The lock was verified and pinned above; zigbuild has no --locked - # flag, so it relies on the just-generated, verified Cargo.lock. - - name: Build (zigbuild) - if: matrix.settings.use-zigbuild - run: cargo zigbuild --release -p ktav-cabi --target ${{ matrix.settings.target }}.2.17 - - - name: Build (native) - if: ${{ !matrix.settings.use-zigbuild }} - run: cargo build --release -p ktav-cabi --target ${{ matrix.settings.target }} --locked - - - name: Rename artifact - shell: bash - run: | - src="target/${{ matrix.settings.target }}/release/${{ matrix.settings.artifact }}" - ls -la "$src" - cp "$src" "${{ matrix.settings.asset }}" - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.settings.asset }} - path: ${{ matrix.settings.asset }} - if-no-files-found: error + uses: ./.github/workflows/native-distribution.yml + with: + source-ref: ${{ github.sha }} release: name: Publish @@ -137,6 +34,7 @@ jobs: - uses: actions/download-artifact@v4 with: + pattern: native-distribution-* path: artifacts merge-multiple: true diff --git a/.github/workflows/windows-gnu-cabi-candidate.yml b/.github/workflows/windows-gnu-cabi-candidate.yml new file mode 100644 index 0000000..52441db --- /dev/null +++ b/.github/workflows/windows-gnu-cabi-candidate.yml @@ -0,0 +1,454 @@ +name: PHP Windows GNU LLVM candidate evidence + +on: + workflow_call: + inputs: + source-ref: + description: Exact reviewed original PHP 0.8.1 source + required: true + type: string + workflow_dispatch: + +permissions: + contents: read + +env: + SOURCE_REF: ${{ inputs.source-ref || 'c979b98d6decfb3c2808c8177eecf5d34dbc8634' }} + +jobs: + cabi-gnullvm: + name: PHP GNU C ABI / ${{ matrix.target }} + runs-on: windows-latest + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-pc-windows-gnullvm + compiler: x86_64-w64-mingw32-clang.exe + machine: 34404 + - target: aarch64-pc-windows-gnullvm + compiler: aarch64-w64-mingw32-clang.exe + machine: 43620 + env: + CABI_TARGET: ${{ matrix.target }} + CABI_COMPILER: ${{ matrix.compiler }} + CABI_MACHINE: ${{ matrix.machine }} + steps: + - uses: actions/checkout@v4 + - name: Preserve reviewed PHP notice tooling and lock + shell: python + run: | + import hashlib + import json + import os + import shutil + from pathlib import Path + stage = Path(os.environ['RUNNER_TEMP']) / 'cabi-gnullvm-tools' + stage.mkdir() + profile = Path('ci/rust-compiler-notices.json').read_bytes() + if hashlib.sha256(profile).hexdigest() != '39cbf18420d5e0c0a35fb2d5e5fbed4db755488ea0ca11414944ead9fbabab92': + raise SystemExit('compiler profile differs') + files = ['crates/cabi/build.rs', 'scripts/prepare_cabi_notices.py', 'scripts/cargo_notice_bundle.py', 'scripts/collect_cargo_notices.py', 'scripts/check_embedded_notices.py', 'ci/about.toml', 'ci/test_embedded_notices.py', 'scripts/rust_compiler_notices.py', 'ci/rust-compiler-notices.json', 'ci/test_rust_compiler_notices.py', 'scripts/cabi_gnullvm_notices.py', 'ci/licenses/cabi-gnullvm-runtime.json', 'ci/test_cabi_gnullvm_notices.py', 'ci/php-windows-gnu.lock'] + files.extend(item['path'] for item in json.loads(profile)['materials']) + for name in files: + destination = stage / name + destination.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(name, destination) + - uses: actions/checkout@v4 + with: + ref: ${{ env.SOURCE_REF }} + submodules: recursive + persist-credentials: false + - name: Bind original PHP source and reviewed lock + shell: python + run: | + import hashlib + import json + import os + import shutil + import subprocess + from pathlib import Path + if subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip() != os.environ['SOURCE_REF']: + raise SystemExit('unexpected PHP candidate source') + source = Path('crates/cabi/src/lib.rs') + original = source.read_bytes() + if hashlib.sha256(original).hexdigest() != '19b09c00fb7491b4a27a974b7cf4aec84dd629f1e253febfa78dcd073279cf61': + raise SystemExit('original PHP C ABI source differs') + stage = Path(os.environ['RUNNER_TEMP']) / 'cabi-gnullvm-tools' + overlay = ['crates/cabi/build.rs', 'crates/cabi/src/lib.rs'] + baseline = {name: hashlib.sha256(Path(name).read_bytes()).hexdigest() if Path(name).is_file() else None for name in overlay} + for path in stage.rglob('*'): + if path.is_file(): + destination = Path(path.relative_to(stage)) + destination.parent.mkdir(parents=True, exist_ok=True) + if destination.as_posix() == 'crates/cabi/build.rs' and destination.exists() and destination.read_bytes() != path.read_bytes(): + raise SystemExit('existing PHP build hook requires review') + shutil.copyfile(path, destination) + hook = b'include!(concat!(env!("OUT_DIR"), "/native_notices.rs"));' + if hook in original: + raise SystemExit('unexpected original notice overlay') + source.write_bytes(original + bytes([10, 10]) + hook + bytes([10])) + protected = ['Cargo.toml', 'crates', 'src', 'tests', 'examples', 'composer.json', 'composer.lock', 'kahlan-config.php', 'root-docs'] + changed = set(subprocess.check_output(['git', 'diff', '--name-only', '--', *protected], text=True).splitlines()) + changed.update(subprocess.check_output(['git', 'ls-files', '--others', '--exclude-standard', '--', *protected], text=True).splitlines()) + if changed != set(overlay): + raise SystemExit('PHP candidate changed protected source beyond notice metadata') + lock = Path('ci/php-windows-gnu.lock').read_bytes() + if hashlib.sha256(lock).hexdigest() != 'a7066ecc92727ae12c3905cbf1a2b73266da609773356f725e931682381b7a8b': + raise SystemExit('reviewed PHP lock differs') + Path('Cargo.lock').write_bytes(lock) + record = {name: {'baseline_sha256': baseline[name], 'compiled_sha256': hashlib.sha256(Path(name).read_bytes()).hexdigest()} for name in overlay} + (Path(os.environ['RUNNER_TEMP']) / 'cabi-gnullvm-source-overlay.json').write_text(json.dumps(record, sort_keys=True, indent=2) + '\n', encoding='utf-8') + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - uses: dtolnay/rust-toolchain@1.99.1 + with: + targets: ${{ matrix.target }} + components: rust-docs + - uses: taiki-e/install-action@v2 + with: + tool: cargo-about@0.9.3 + - name: Verify PHP notice and SDK input guards + shell: python + run: | + import subprocess + import sys + for pattern in ['test_embedded_notices.py', 'test_rust_compiler_notices.py', 'test_cabi_gnullvm_notices.py']: + subprocess.run([sys.executable, '-I', '-m', 'unittest', 'discover', '-s', 'ci', '-p', pattern, '-v'], check=True) + - name: Prepare locked PHP Cargo compiler and runtime grants + shell: python + run: | + import json + import os + import shutil + import subprocess + import sys + import tomllib + from pathlib import Path + core = [item for item in tomllib.loads(Path('Cargo.lock').read_text())['package'] if item['name'] == 'ktav'] + if len(core) != 1 or core[0]['version'] != '0.8.1' or core[0]['checksum'] != '7140dfe2fa6c320e74768cd6a637828c2d26f81746254f4fcd805f3993bd3fd5': + raise SystemExit('original registry core identity differs') + evidence = Path(os.environ['RUNNER_TEMP']) / 'cabi-gnullvm-evidence' + subprocess.run([sys.executable, 'scripts/prepare_cabi_notices.py', str(evidence)], check=True) + for name in ['LICENSE-MIT', 'LICENSE-APACHE']: + shutil.copyfile(name, evidence / name) + profile = json.loads(Path('ci/rust-compiler-notices.json').read_bytes()) + for name in ['ci/rust-compiler-notices.json', *[item['path'] for item in profile['materials']]]: + destination = evidence / name + destination.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(name, destination) + subprocess.run([sys.executable, '-I', 'scripts/cabi_gnullvm_notices.py', 'prepare', str(evidence), os.environ['CABI_TARGET']], check=True) + with Path(os.environ['GITHUB_ENV']).open('a', encoding='utf-8') as destination: + destination.write('KTAV_NATIVE_NOTICES=' + str(evidence / 'NOTICE.json.gz') + '\n') + - name: Install the exact previously reviewed LLVM MinGW SDK + shell: python + run: | + import hashlib + import json + import os + import stat + import subprocess + import urllib.request + import zipfile + from pathlib import Path, PurePosixPath + root = Path(os.environ['RUNNER_TEMP']) + sdk = root / 'cabi-gnullvm-sdk' + sdk.mkdir() + archive_path = sdk / 'sdk.zip' + url = 'https://github.com/mstorsjo/llvm-mingw/releases/download/20261020/llvm-mingw-20261020-ucrt-x86_64.zip' + checksum = hashlib.sha256() + total = 0 + with urllib.request.urlopen(url, timeout=120) as response, archive_path.open('xb') as output: + while chunk := response.read(1024 * 1024): + total += len(chunk) + if total > 256 * 1024 * 1024: + raise SystemExit('candidate SDK size bound exceeded') + checksum.update(chunk) + output.write(chunk) + if checksum.hexdigest() != 'fd5462b7f5d93b2ff981fcd3f9c7e427e47f3203c64ea91c27bcc444eebd74cd': + raise SystemExit('candidate SDK differs from reviewed archive') + with zipfile.ZipFile(archive_path) as archive: + seen = set() + for item in archive.infolist(): + path = PurePosixPath(item.filename) + if path.is_absolute() or '..' in path.parts or '\\' in item.filename or ':' in item.filename or item.filename.casefold() in seen or stat.S_IFMT(item.external_attr >> 16) == stat.S_IFLNK: + raise SystemExit('unsafe or duplicate candidate SDK path') + seen.add(item.filename.casefold()) + archive.extractall(sdk) + install = sdk / 'llvm-mingw-20261020-ucrt-x86_64' + compiler = install / 'bin' / os.environ['CABI_COMPILER'] + if not compiler.is_file(): + raise SystemExit('candidate compiler missing') + evidence = root / 'cabi-gnullvm-evidence' + (evidence / 'compiler-version.txt').write_bytes(subprocess.check_output([str(compiler), '--version'])) + record = {'source_ref': os.environ['SOURCE_REF'], 'tooling_ref': os.environ['GITHUB_SHA'], 'target': os.environ['CABI_TARGET'], 'sdk_archive_sha256': checksum.hexdigest(), 'sdk_source': url, 'notice_overlay': json.loads((root / 'cabi-gnullvm-source-overlay.json').read_text(encoding='utf-8')), 'coverage': 'Original PHP 0.8.1 C ABI GNU candidate; separate host-language consumers required before production integration. No historical asset clearance.'} + (evidence / 'source-provenance.json').write_text(json.dumps(record, sort_keys=True, indent=2) + '\n', encoding='utf-8') + key = 'CARGO_TARGET_' + os.environ['CABI_TARGET'].upper().replace('-', '_') + '_LINKER' + flags = ['-C', 'target-feature=+crt-static', '-C', 'link-arg=-Wl,-Map,' + (evidence / 'native-link.map').as_posix(), '-C', 'link-arg=-Wl,--reproduce=' + (root / 'cabi-gnullvm-link.tar').as_posix()] + with Path(os.environ['GITHUB_ENV']).open('a', encoding='utf-8') as output: + for name, value in [(key, str(compiler)), ('CARGO_ENCODED_RUSTFLAGS', chr(31).join(flags)), ('LLVM_MINGW_CANDIDATE', str(install))]: + output.write(name + '=' + value + '\n') + with Path(os.environ['GITHUB_PATH']).open('a', encoding='utf-8') as output: + output.write(str(install / 'bin') + '\n') + - name: Build original C ABI APIs with the reviewed notice resource + run: cargo build --locked --release -p ktav-cabi --target ${{ matrix.target }} + - name: Capture exact PE, link inputs and original SDK legal documents + shell: python + run: | + import base64 + import hashlib + import json + import os + import re + import shutil + import struct + import subprocess + import sys + import tarfile + from pathlib import Path, PurePosixPath + root = Path(os.environ['RUNNER_TEMP']) + evidence = root / 'cabi-gnullvm-evidence' + original = Path('target') / os.environ['CABI_TARGET'] / 'release/ktav_cabi.dll' + binary = evidence / 'ktav_cabi.dll' + shutil.copyfile(original, binary) + data = binary.read_bytes() + if len(data) < 64 or len(data) > 128 * 1024 * 1024 or data[:2] != b'MZ': + raise SystemExit('expected bounded PE library') + offset = int.from_bytes(data[60:64], 'little') + if offset + 24 > len(data) or data[offset:offset + 4] != b'PE\0\0' or struct.unpack_from(' 512 * 1024 * 1024: + raise SystemExit('missing or oversized linker reproduction') + inputs = [] + seen = set() + total = 0 + with tarfile.open(reproduction, mode='r:') as archive: + for item in archive: + path = PurePosixPath(item.name) + if path.is_absolute() or '..' in path.parts or '\\' in item.name or item.name in seen or item.issym() or item.islnk(): + raise SystemExit('unsafe linker input record') + seen.add(item.name) + if item.isdir(): + continue + if not item.isfile() or item.size > 128 * 1024 * 1024: + raise SystemExit('invalid linker input type/size') + total += item.size + if total > 512 * 1024 * 1024 or len(seen) > 8192: + raise SystemExit('link input inventory exceeds bound') + source = archive.extractfile(item) + checksum = hashlib.sha256() + size = 0 + while chunk := source.read(1024 * 1024): + checksum.update(chunk) + size += len(chunk) + if size != item.size: + raise SystemExit('truncated linker input') + inputs.append({'path': item.name, 'bytes': size, 'sha256': checksum.hexdigest()}) + if not any(item['path'].endswith('/response.txt') for item in inputs): + raise SystemExit('missing actual linker command evidence') + (evidence / 'link-input-fingerprints.json').write_text(json.dumps(inputs, sort_keys=True, indent=2) + '\n', encoding='utf-8') + legal = [] + total = 0 + for path in sorted(sdk.rglob('*')): + if not path.is_file() or not re.match(r'(?i)^(?:license|copying|copyright|notice|authors|disclaimer)', path.name): + continue + if path.stat().st_size > 4 * 1024 * 1024: + raise SystemExit('SDK legal document exceeds bound') + data = path.read_bytes() + total += len(data) + if total > 32 * 1024 * 1024: + raise SystemExit('SDK legal inventory exceeds bound') + try: + text = data.decode('utf-8') + except UnicodeDecodeError: + text = None + legal.append({'path': path.relative_to(sdk).as_posix(), 'sha256': hashlib.sha256(data).hexdigest(), 'raw_bytes_base64': base64.b64encode(data).decode('ascii'), 'utf8_text': text}) + (evidence / 'sdk-legal.json').write_text(json.dumps(legal, ensure_ascii=False, indent=2) + '\n', encoding='utf-8') + if Path('Cargo.lock').read_bytes() != (evidence / 'Cargo.lock').read_bytes(): + raise SystemExit('candidate changed the reviewed Cargo lock') + result = {'target': os.environ['CABI_TARGET'], 'binary_sha256': hashlib.sha256(binary.read_bytes()).hexdigest(), 'map_sha256': hashlib.sha256(link_map.read_bytes()).hexdigest(), 'machine': int(os.environ['CABI_MACHINE']), 'imports': imports, 'exports': [name.decode('ascii') for name in exports], 'sdk_legal_files': len(legal), 'coverage': 'Actual PE/input identity; source-bound runtime/resource verification is recorded separately in native-runtime-verification.json.'} + (evidence / 'native-verification.json').write_text(json.dumps(result, sort_keys=True, indent=2) + '\n', encoding='utf-8') + subprocess.run([sys.executable, '-I', 'scripts/cabi_gnullvm_notices.py', 'verify', str(evidence), str(binary), os.environ['CABI_TARGET']], check=True) + - name: Load the actual x64 C ABI with SDK paths removed + if: matrix.target == 'x86_64-pc-windows-gnullvm' + shell: python + run: | + import hashlib + import json + import os + import shutil + import subprocess + import sys + from pathlib import Path + evidence = Path(os.environ['RUNNER_TEMP']) / 'cabi-gnullvm-evidence' + probe = Path(os.environ['RUNNER_TEMP']) / 'cabi-gnullvm-clean-path' + probe.mkdir() + binary = probe / 'ktav_cabi.dll' + shutil.copyfile(evidence / binary.name, binary) + windows = Path(os.environ['SystemRoot']) + environment = {**os.environ, 'PATH': str(windows / 'System32') + os.pathsep + str(windows)} + script = 'import ctypes; library=ctypes.CDLL("./ktav_cabi.dll"); [getattr(library,name) for name in ["ktav_version","ktav_loads","ktav_free"]]; print("C ABI library loaded and exports resolved")' + result = subprocess.run([sys.executable, '-I', '-c', script], cwd=probe, env=environment, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=30) + (evidence / 'loader-stdout.txt').write_bytes(result.stdout) + (evidence / 'loader-stderr.txt').write_bytes(result.stderr) + if result.returncode != 0: + raise SystemExit('actual C ABI library failed to load with SDK paths removed') + record = {'sdk_path_removed': True, 'only_own_dll_staged': True, 'exit_code': result.returncode, 'binary_sha256': hashlib.sha256(binary.read_bytes()).hexdigest(), 'scope': 'Matching-x64 DLL loader/export probe only; no Bun/Deno or parser-corpus claim. ARM DLL not executed.'} + (evidence / 'loader-probe.json').write_text(json.dumps(record, sort_keys=True, indent=2) + '\n', encoding='utf-8') + - uses: actions/upload-artifact@v4 + with: + name: php-cabi-gnu-candidate-${{ matrix.target }} + path: ${{ runner.temp }}/cabi-gnullvm-evidence/ + include-hidden-files: true + if-no-files-found: error + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: php-cabi-gnu-diagnostics-${{ matrix.target }} + path: | + ${{ runner.temp }}/cabi-gnullvm-evidence/*.json + ${{ runner.temp }}/cabi-gnullvm-evidence/*.txt + ${{ runner.temp }}/cabi-gnullvm-evidence/*.map + ${{ runner.temp }}/cabi-gnullvm-evidence/*.lock + if-no-files-found: warn + + php-consumers: + name: Genuine PHP GNU consumer / ${{ matrix.arch }} + needs: cabi-gnullvm + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + arch: x64 + target: x86_64-pc-windows-gnullvm + - os: windows-11-arm + arch: arm64 + target: aarch64-pc-windows-gnullvm + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Preserve reviewed consumer and native host tooling + shell: python + run: | + import os + import shutil + from pathlib import Path + stage = Path(os.environ['RUNNER_TEMP']) / 'php-gnu-consumer-tools' + stage.mkdir() + for name in ['probe_php_arm_host.py', 'check_php_gnu_consumer.py']: + shutil.copyfile(Path('scripts') / name, stage / name) + - uses: actions/checkout@v4 + with: + ref: ${{ env.SOURCE_REF }} + submodules: recursive + persist-credentials: false + - uses: actions/checkout@v4 + if: matrix.arch == 'arm64' + with: + repository: php/php-sdk-binary-tools + ref: 81b356186db123ce9cd65149cee4683211a59ebd + path: .ci-tools/php-sdk + persist-credentials: false + - uses: actions/checkout@v4 + if: matrix.arch == 'arm64' + with: + repository: microsoft/vcpkg + ref: 9a5dfef5d1a0438a7d24856a85bd60f309d355e9 + path: .ci-tools/vcpkg + persist-credentials: false + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install original Composer development dependencies + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + extensions: ffi, json, mbstring, xdebug + ini-values: ffi.enable=1, xdebug.mode=off + coverage: xdebug + - run: composer install --prefer-dist --no-progress --no-interaction + - name: Build genuine ARM64 PHP consumer host + if: matrix.arch == 'arm64' + shell: pwsh + run: python -I "$env:RUNNER_TEMP/php-gnu-consumer-tools/probe_php_arm_host.py" + - uses: actions/download-artifact@v4 + with: + name: php-cabi-gnu-candidate-${{ matrix.target }} + path: ${{ runner.temp }}/php-gnu-delivered + - name: Execute unchanged original PHP suites on the genuine CPU + shell: pwsh + env: + EXPECTED_ARCH: ${{ matrix.arch }} + EXPECTED_TARGET: ${{ matrix.target }} + ACTUAL_RUNNER_ARCH: ${{ runner.arch }} + run: python -I "$env:RUNNER_TEMP/php-gnu-consumer-tools/check_php_gnu_consumer.py" + - uses: actions/upload-artifact@v4 + if: always() + with: + name: php-gnu-consumer-${{ matrix.arch }} + path: | + ${{ runner.temp }}/php-gnu-consumer/ + ${{ runner.temp }}/php-arm-host/evidence/ + if-no-files-found: warn + + stage-release: + name: Stage verified PHP GNU / ${{ matrix.settings.target }} + needs: [cabi-gnullvm, php-consumers] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + settings: + - target: x86_64-pc-windows-gnullvm + asset: ktav_cabi-windows-amd64.dll + - target: aarch64-pc-windows-gnullvm + asset: ktav_cabi-windows-arm64.dll + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - uses: actions/download-artifact@v4 + with: + name: php-cabi-gnu-candidate-${{ matrix.settings.target }} + path: ${{ runner.temp }}/php-gnu-delivered + - name: Stage exact verified DLL and full notice sidecars + shell: bash + run: | + set -euo pipefail + python -I scripts/stage_php_gnu_release.py "$RUNNER_TEMP/php-gnu-delivered" "$RUNNER_TEMP/php-gnu-release" '${{ matrix.settings.target }}' + - uses: actions/upload-artifact@v4 + with: + name: native-distribution-${{ matrix.settings.target }} + path: ${{ runner.temp }}/php-gnu-release/ + if-no-files-found: error + diff --git a/README.md b/README.md index 26e90a0..402addf 100644 --- a/README.md +++ b/README.md @@ -465,6 +465,30 @@ it needs no native library, even with `ext-ffi` disabled. - Prebuilt binaries for: `linux/amd64`, `linux/arm64`, `darwin/amd64`, `darwin/arm64`, `windows/amd64`, `windows/arm64`. +## Prepared Windows native runtime + +The prepared **0.8.1** Windows C ABI uses genuine +`x86_64-pc-windows-gnullvm` and `aarch64-pc-windows-gnullvm` targets with +the pinned LLVM MinGW UCRT SDK instead of the MSVC build path. Public DLL +filenames are unchanged. PHP process CPU must match the DLL; an x64 PHP +process on Windows ARM64 still needs the x64 DLL. + +Original native/pure suites run on genuine x64 and ARM64 PHP CLI before +release staging. The source-built ARM64 PHP host is a CI tool, not a +bundled interpreter or a consumer dependency. Consumers need their PHP +runtime and `ext-ffi`, not Rust or a native compiler; pure mode remains +self-contained with standard `ext-json` only. + +Each DLL retains its embedded Cargo/std, Rust compiler and GNU runtime +source/grant resource. Adjacent `.NOTICE.json` and `.NOTICE.manifest.json` +retain the complete original materials and binary/source identities. +Windows system/UCRT APIs remain OS dependencies. + +Six previously documented canonical round-trip gaps remain unchanged. +The two no-expectation cycle specifications also require separate bounded +native/pure child execution. This runtime preparation does not publish a +package, accept Microsoft redistribution terms or repair historical assets. + ## License MIT OR Apache-2.0 — see [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE). diff --git a/ci/about.toml b/ci/about.toml new file mode 100644 index 0000000..9ef5947 --- /dev/null +++ b/ci/about.toml @@ -0,0 +1,11 @@ +accepted = [ + "MIT", + "ISC", + "BSD-2-Clause", + "BSD-3-Clause", + "Zlib", + "BSL-1.0", + "Apache-2.0 WITH LLVM-exception", + "Apache-2.0", + "Unicode-3.0", +] diff --git a/ci/check_native_distribution.rb b/ci/check_native_distribution.rb new file mode 100644 index 0000000..4434eb5 --- /dev/null +++ b/ci/check_native_distribution.rb @@ -0,0 +1,64 @@ +require 'yaml' + +path = './.github/workflows/native-distribution.yml' +workflow = YAML.load_file(path) +triggers = workflow['on'] || workflow[true] +abort 'missing native workflow contract' unless triggers.fetch('workflow_call').fetch('inputs').fetch('source-ref').fetch('required') +job = workflow.fetch('jobs').fetch('build-native') +settings = job.fetch('strategy').fetch('matrix').fetch('settings') +expected = { + 'x86_64-unknown-linux-gnu' => 'libktav_cabi-linux-amd64.so', + 'aarch64-unknown-linux-gnu' => 'libktav_cabi-linux-arm64.so', + 'x86_64-apple-darwin' => 'libktav_cabi-darwin-amd64.dylib', + 'aarch64-apple-darwin' => 'libktav_cabi-darwin-arm64.dylib', + 'x86_64-pc-windows-gnullvm' => 'ktav_cabi-windows-amd64.dll', + 'aarch64-pc-windows-gnullvm' => 'ktav_cabi-windows-arm64.dll' +} +gnu_path = './.github/workflows/windows-gnu-cabi-candidate.yml' +gnu_call = workflow.fetch('jobs').fetch('windows-gnu') +abort 'wrong GNU producer caller' unless gnu_call.fetch('uses') == gnu_path +abort 'GNU source is not forwarded' unless gnu_call.fetch('with').fetch('source-ref') == '${{ inputs.source-ref }}' +gnu = YAML.load_file(gnu_path) +gnu_triggers = gnu['on'] || gnu[true] +abort 'missing GNU exact-source contract' unless gnu_triggers.fetch('workflow_call').fetch('inputs').fetch('source-ref').fetch('required') +abort 'duplicate GNU PR producer' if gnu_triggers.key?('pull_request') +gnu_jobs = gnu.fetch('jobs') +gnu_targets = gnu_jobs.fetch('cabi-gnullvm').fetch('strategy').fetch('matrix').fetch('include').map { |item| item.fetch('target') } +abort 'wrong GNU target matrix' unless gnu_targets.sort == %w[x86_64-pc-windows-gnullvm aarch64-pc-windows-gnullvm].sort +consumers = gnu_jobs.fetch('php-consumers') +abort 'missing GNU producer dependency' unless consumers.fetch('needs') == 'cabi-gnullvm' +actual = consumers.fetch('strategy').fetch('matrix').fetch('include').map { |item| [item.fetch('os'), item.fetch('arch'), item.fetch('target')] } +required = [['windows-latest', 'x64', 'x86_64-pc-windows-gnullvm'], ['windows-11-arm', 'arm64', 'aarch64-pc-windows-gnullvm']] +abort 'incomplete genuine PHP consumer matrix' unless actual.sort == required.sort +consumer_step = consumers.fetch('steps').find { |item| item['name'] == 'Execute unchanged original PHP suites on the genuine CPU' } +abort 'missing mandatory PHP consumer execution' unless consumer_step && !consumer_step.key?('if') && !consumer_step['continue-on-error'] && consumer_step.fetch('run').include?('check_php_gnu_consumer.py') +staging = gnu_jobs.fetch('stage-release') +abort 'missing complete GNU consumer gate' unless staging.fetch('needs').sort == %w[cabi-gnullvm php-consumers].sort +windows = staging.fetch('strategy').fetch('matrix').fetch('settings') +abort 'native target or asset matrix changed' unless settings.length == 4 && windows.length == 2 && (settings + windows).to_h { |item| [item.fetch('target'), item.fetch('asset')] } == expected +steps = staging.fetch('steps') +abort 'missing GNU staging command' unless steps.any? { |item| item['run'].to_s.include?('python -I scripts/stage_php_gnu_release.py') && !item.key?('if') && !item['continue-on-error'] } +outputs = steps.select { |item| item['uses'].to_s.start_with?('actions/upload-artifact@') } +abort 'wrong GNU distribution artifact role' unless outputs.length == 1 && outputs[0].fetch('with').fetch('name') == 'native-distribution-${{ matrix.settings.target }}' && outputs[0].fetch('with').fetch('path') == '${{ runner.temp }}/php-gnu-release/' && outputs[0].fetch('with').fetch('if-no-files-found') == 'error' && !outputs[0].key?('if') && !outputs[0]['continue-on-error'] +stager = File.read('scripts/stage_php_gnu_release.py') +%w[ktav_cabi-windows-amd64.dll ktav_cabi-windows-arm64.dll .NOTICE.json .NOTICE.manifest.json check_embedded_notices.py source_ref target].each do |role| + abort "missing GNU delivery role #{role}" unless stager.include?(role) +end +caller = YAML.load_file('.github/workflows/native-distribution-check.yml').fetch('jobs').fetch('native-distribution') +abort 'wrong native CI caller' unless caller.fetch('uses') == path +abort 'native CI source is not published PHP 0.8.1' unless caller.fetch('with').fetch('source-ref') == 'c979b98d6decfb3c2808c8177eecf5d34dbc8634' +release = YAML.load_file('.github/workflows/release.yml').fetch('jobs') +producer = release.fetch('build-native') +abort 'production native build differs from CI' unless producer.fetch('uses') == path +abort 'production source must follow caller commit' unless producer.fetch('with').fetch('source-ref') == '${{ github.sha }}' +abort 'missing native publication gate' unless Array(release.fetch('release').fetch('needs')).include?('build-native') +downloads = release.fetch('release').fetch('steps').select { |step| step['uses'].to_s.start_with?('actions/download-artifact@') } +abort 'unsafe artifact download' unless downloads.map { |step| step.fetch('with').slice('name', 'pattern') } == [{'pattern' => 'native-distribution-*'}] +steps = job.fetch('steps') +['Prepare locked native notice resource', 'Verify embedded resource and write distribution sidecars', 'Run PHP tests on matching target architecture'].each do |name| + step = steps.find { |item| item['name'] == name } + abort "missing mandatory native gate: #{name}" unless step && !step.key?('if') && !step['continue-on-error'] +end +upload = steps.find { |step| step['uses'].to_s.start_with?('actions/upload-artifact@') && step.fetch('with').fetch('name').start_with?('native-distribution-') } +abort 'missing native notice sidecars' unless upload && upload.fetch('with').fetch('path').include?('.NOTICE.json') && upload.fetch('with').fetch('path').include?('.NOTICE.manifest.json') +puts 'PHP native source, notice, runtime and publication contracts verified' diff --git a/ci/licenses/cabi-gnullvm-runtime.json b/ci/licenses/cabi-gnullvm-runtime.json new file mode 100644 index 0000000..e58e298 --- /dev/null +++ b/ci/licenses/cabi-gnullvm-runtime.json @@ -0,0 +1,784 @@ +{ + "coverage": "Reviewed C ABI DLL startup/MinGW runtime/libunwind source grants. Exact target-specific SDK fingerprints and retained objects are separate fixed roles. The original source/header notice collection is conservative and does not assert that all source records or SDK components are linked. Not an SDK source-build reproducibility claim.", + "llvm_revision": "7a941dfb2877a0b8cf30323fefa85ad019e0b0f5", + "mingw_revision": "0d6dfbc348dfad714761c0a7151615767f96bcb5", + "original_documents": [ + { + "git_blob": "fa6ac540007032cbd0ec772a1c72e6cb5527a4fe", + "path": "LICENSE.TXT", + "sha256": "8d85c1057d742e597985c7d4e6320b015a9139385cff4cbae06ffc0ebe89afee", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/LICENSE.TXT", + "text": "==============================================================================\nThe LLVM Project is under the Apache License v2.0 with LLVM Exceptions:\n==============================================================================\n\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n\n---- LLVM Exceptions to the Apache 2.0 License ----\n\nAs an exception, if, as a result of your compiling your source code, portions\nof this Software are embedded into an Object form of such source code, you\nmay redistribute such embedded portions in such Object form without complying\nwith the conditions of Sections 4(a), 4(b) and 4(d) of the License.\n\nIn addition, if you combine or link compiled forms of this Software with\nsoftware that is licensed under the GPLv2 (\"Combined Software\") and if a\ncourt of competent jurisdiction determines that the patent provision (Section\n3), the indemnity provision (Section 9) or other Section of the License\nconflicts with the conditions of the GPLv2, you may retroactively and\nprospectively choose to deem waived or otherwise exclude such Section(s) of\nthe License, but only in their entirety and only with respect to the Combined\nSoftware.\n\n==============================================================================\nSoftware from third parties included in the LLVM Project:\n==============================================================================\nThe LLVM Project contains third party software which is under different license\nterms. All such code will be identified clearly using at least one of two\nmechanisms:\n1) It will be in a separate directory tree with its own `LICENSE.txt` or\n `LICENSE` file at the top containing the specific license and restrictions\n which apply to that software, or\n2) It will contain specific license and restriction terms at the top of every\n file.\n\n==============================================================================\nLegacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):\n==============================================================================\nUniversity of Illinois/NCSA\nOpen Source License\n\nCopyright (c) 2003-2019 University of Illinois at Urbana-Champaign.\nAll rights reserved.\n\nDeveloped by:\n\n LLVM Team\n\n University of Illinois at Urbana-Champaign\n\n http://llvm.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal with\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\n * Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimers.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimers in the\n documentation and/or other materials provided with the distribution.\n\n * Neither the names of the LLVM Team, University of Illinois at\n Urbana-Champaign, nor the names of its contributors may be used to\n endorse or promote products derived from this Software without specific\n prior written permission.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nCONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE\nSOFTWARE.\n\n" + }, + { + "git_blob": "1e3120621caeb62648745a42f7a9a25d1e2731ab", + "path": "libunwind/LICENSE.TXT", + "sha256": "b5efebcaca80879234098e52d1725e6d9eb8fb96a19fce625d39184b705f7b6d", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/LICENSE.TXT", + "text": "==============================================================================\nThe LLVM Project is under the Apache License v2.0 with LLVM Exceptions:\n==============================================================================\n\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n\n---- LLVM Exceptions to the Apache 2.0 License ----\n\nAs an exception, if, as a result of your compiling your source code, portions\nof this Software are embedded into an Object form of such source code, you\nmay redistribute such embedded portions in such Object form without complying\nwith the conditions of Sections 4(a), 4(b) and 4(d) of the License.\n\nIn addition, if you combine or link compiled forms of this Software with\nsoftware that is licensed under the GPLv2 (\"Combined Software\") and if a\ncourt of competent jurisdiction determines that the patent provision (Section\n3), the indemnity provision (Section 9) or other Section of the License\nconflicts with the conditions of the GPLv2, you may retroactively and\nprospectively choose to deem waived or otherwise exclude such Section(s) of\nthe License, but only in their entirety and only with respect to the Combined\nSoftware.\n\n==============================================================================\nSoftware from third parties included in the LLVM Project:\n==============================================================================\nThe LLVM Project contains third party software which is under different license\nterms. All such code will be identified clearly using at least one of two\nmechanisms:\n1) It will be in a separate directory tree with its own `LICENSE.txt` or\n `LICENSE` file at the top containing the specific license and restrictions\n which apply to that software, or\n2) It will contain specific license and restriction terms at the top of every\n file.\n\n==============================================================================\nLegacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):\n==============================================================================\n\nThe libunwind library is dual licensed under both the University of Illinois\n\"BSD-Like\" license and the MIT license. As a user of this code you may choose\nto use it under either license. As a contributor, you agree to allow your code\nto be used under both.\n\nFull text of the relevant licenses is included below.\n\n==============================================================================\n\nUniversity of Illinois/NCSA\nOpen Source License\n\nCopyright (c) 2009-2019 by the contributors listed in CREDITS.TXT\n\nAll rights reserved.\n\nDeveloped by:\n\n LLVM Team\n\n University of Illinois at Urbana-Champaign\n\n http://llvm.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal with\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\n * Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimers.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimers in the\n documentation and/or other materials provided with the distribution.\n\n * Neither the names of the LLVM Team, University of Illinois at\n Urbana-Champaign, nor the names of its contributors may be used to\n endorse or promote products derived from this Software without specific\n prior written permission.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nCONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE\nSOFTWARE.\n\n==============================================================================\n\nCopyright (c) 2009-2014 by the contributors listed in CREDITS.TXT\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n" + }, + { + "git_blob": "776d5f1034240f6dae0ce59d592f9c6f4ad29e7d", + "path": "COPYING.MinGW-w64-runtime/COPYING.MinGW-w64-runtime.txt", + "sha256": "1db8da07b436c68833c0673ffee3d9fcb2526047f3820b81661865dfedc79a1f", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/COPYING.MinGW-w64-runtime/COPYING.MinGW-w64-runtime.txt", + "text": "MinGW-w64 runtime licensing\n***************************\n\nThis program or library was built using MinGW-w64 and statically\nlinked against the MinGW-w64 runtime. Some parts of the runtime\nare under licenses which require that the copyright and license\nnotices are included when distributing the code in binary form.\nThese notices are listed below.\n\n\n========================\nOverall copyright notice\n========================\n\nCopyright (c) 2009, 2010, 2011, 2012, 2013 by the mingw-w64 project\n\nThis license has been certified as open source. It has also been designated\nas GPL compatible by the Free Software Foundation (FSF).\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n 1. Redistributions in source code must retain the accompanying copyright\n notice, this list of conditions, and the following disclaimer.\n 2. Redistributions in binary form must reproduce the accompanying\n copyright notice, this list of conditions, and the following disclaimer\n in the documentation and/or other materials provided with the\n distribution.\n 3. Names of the copyright holders must not be used to endorse or promote\n products derived from this software without prior written permission\n from the copyright holders.\n 4. The right to distribute this software or to use it for any purpose does\n not give you the right to use Servicemarks (sm) or Trademarks (tm) of\n the copyright holders. Use of them is covered by separate agreement\n with the copyright holders.\n 5. If any files are modified, you must cause the modified files to carry\n prominent notices stating that you changed the files and the date of\n any change.\n\nDisclaimer\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED\nOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\nEVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\nOR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n======================================== \ngetopt, getopt_long, and getop_long_only\n======================================== \n\nCopyright (c) 2002 Todd C. Miller \n \nPermission to use, copy, modify, and distribute this software for any \npurpose with or without fee is hereby granted, provided that the above \ncopyright notice and this permission notice appear in all copies. \n \t \nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\nSponsored in part by the Defense Advanced Research Projects\nAgency (DARPA) and Air Force Research Laboratory, Air Force\nMateriel Command, USAF, under agreement number F39502-99-1-0512.\n\n * * * * * * * \n\nCopyright (c) 2000 The NetBSD Foundation, Inc.\nAll rights reserved.\n\nThis code is derived from software contributed to The NetBSD Foundation\nby Dieter Baron and Thomas Klausner.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\n``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.\n\n\n===============================================================\ngdtoa: Converting between IEEE floating point numbers and ASCII\n===============================================================\n\nThe author of this software is David M. Gay.\n\nCopyright (C) 1997, 1998, 1999, 2000, 2001 by Lucent Technologies\nAll Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and\nits documentation for any purpose and without fee is hereby\ngranted, provided that the above copyright notice appear in all\ncopies and that both that the copyright notice and this\npermission notice and warranty disclaimer appear in supporting\ndocumentation, and that the name of Lucent or any of its entities\nnot be used in advertising or publicity pertaining to\ndistribution of the software without specific, written prior\npermission.\n\nLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\nIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\nSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\nIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n\n * * * * * * *\n\nThe author of this software is David M. Gay.\n\nCopyright (C) 2005 by David M. Gay\nAll Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that the copyright notice and this permission notice and warranty\ndisclaimer appear in supporting documentation, and that the name of\nthe author or any of his current or former employers not be used in\nadvertising or publicity pertaining to distribution of the software\nwithout specific, written prior permission.\n\nTHE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN\nNO EVENT SHALL THE AUTHOR OR ANY OF HIS CURRENT OR FORMER EMPLOYERS BE\nLIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY\nDAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\n * * * * * * *\n\nThe author of this software is David M. Gay.\n\nCopyright (C) 2004 by David M. Gay.\nAll Rights Reserved\nBased on material in the rest of /netlib/fp/gdota.tar.gz,\nwhich is copyright (C) 1998, 2000 by Lucent Technologies.\n\nPermission to use, copy, modify, and distribute this software and\nits documentation for any purpose and without fee is hereby\ngranted, provided that the above copyright notice appear in all\ncopies and that both that the copyright notice and this\npermission notice and warranty disclaimer appear in supporting\ndocumentation, and that the name of Lucent or any of its entities\nnot be used in advertising or publicity pertaining to\ndistribution of the software without specific, written prior\npermission.\n\nLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\nIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\nSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\nIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n\n\n=========================\nParts of the math library\n=========================\n\nCopyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n\nDeveloped at SunSoft, a Sun Microsystems, Inc. business.\nPermission to use, copy, modify, and distribute this\nsoftware is freely granted, provided that this notice\nis preserved.\n\n * * * * * * *\n\nCopyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n\nDeveloped at SunPro, a Sun Microsystems, Inc. business.\nPermission to use, copy, modify, and distribute this\nsoftware is freely granted, provided that this notice\nis preserved.\n\n * * * * * * *\n\nFIXME: Cephes math lib\nCopyright (C) 1984-1998 Stephen L. Moshier\n\nIt sounds vague, but as to be found at\n, it gives an\nimpression that the author could be willing to give an explicit\npermission to distribute those files e.g. under a BSD style license. So\nprobably there is no problem here, although it could be good to get a\npermission from the author and then add a license into the Cephes files\nin MinGW runtime. At least on follow-up it is marked that debian sees the\nversion a-like BSD one. As MinGW.org (where those cephes parts are coming\nfrom) distributes them now over 6 years, it should be fine.\n\n=================================================\nSome string, memory and time conversion functions\n=================================================\n\nCopyright © 2005-2020 Rich Felker, et al.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n===================================\nHeaders and IDLs imported from Wine\n===================================\n\nSome header and IDL files were imported from the Wine project. These files\nare prominent maked in source. Their copyright belongs to contributors and\nthey are distributed under LGPL license.\n\nDisclaimer\n\nThis library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n" + }, + { + "git_blob": "51261a8ec4b5c5b6b074317fab1d7f506eb30425", + "path": "DISCLAIMER", + "sha256": "039ed6b4f31bb7fb97e733170b58cc435335352e4745734fcfd113877fdaf340", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/DISCLAIMER", + "source_revision": "0d6dfbc348dfad714761c0a7151615767f96bcb5", + "text": "/*\n This Software is provided under the Zope Public License (ZPL) Version 2.1.\n\n Copyright (c) 2009, 2010 by the mingw-w64 project\n\n See the AUTHORS file for the list of contributors to the mingw-w64 project.\n\n This license has been certified as open source. It has also been designated\n as GPL compatible by the Free Software Foundation (FSF).\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions in source code must retain the accompanying copyright\n notice, this list of conditions, and the following disclaimer.\n 2. Redistributions in binary form must reproduce the accompanying\n copyright notice, this list of conditions, and the following disclaimer\n in the documentation and/or other materials provided with the\n distribution.\n 3. Names of the copyright holders must not be used to endorse or promote\n products derived from this software without prior written permission\n from the copyright holders.\n 4. The right to distribute this software or to use it for any purpose does\n not give you the right to use Servicemarks (sm) or Trademarks (tm) of\n the copyright holders. Use of them is covered by separate agreement\n with the copyright holders.\n 5. If any files are modified, you must cause the modified files to carry\n prominent notices stating that you changed the files and the date of\n any change.\n\n Disclaimer\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED\n OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, \n OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n" + }, + { + "git_blob": "91fb0d6dc9d1f65394cbec575a857e635868ed74", + "path": "DISCLAIMER.PD", + "sha256": "87f33608570312a0f2a9745edcb2527275df813b13982e8c3b3f893d88a4141a", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/DISCLAIMER.PD", + "source_revision": "0d6dfbc348dfad714761c0a7151615767f96bcb5", + "text": "/**\n * DISCLAIMER\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n *\n * The mingw-w64 runtime package and its code is distributed in the hope that it \n * will be useful but WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESSED OR \n * IMPLIED ARE HEREBY DISCLAIMED. This includes but is not limited to \n * warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n */\n" + }, + { + "git_blob": "4b40f2beb3cac255a09ff12616c22aa89aa9d80f", + "path": "AUTHORS", + "sha256": "8f308316e7a94b8410f871868bd3948f126526dc1775aeee97a0e365f9a0fd9f", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/AUTHORS", + "source_revision": "0d6dfbc348dfad714761c0a7151615767f96bcb5", + "text": "Note\n====\n\nThis file contains information about people who are permitted to make\nchanges to various parts of the runtimes, headers, associated tools,\nand associated libraries. Also the list of contributors to mingw-w64\nare listed here, too.\n\nPlease do not contact the people in this file directly to report\nproblems in mingw-w64.\n\nFor general information about mingw-w64, please visit:\n\n http://sourceforge.net/projects/mingw-w64/\n\nTo report problems in mingw-w64, please visit bug-tracker on:\n\n http://sourceforge.net/projects/mingw-w64/\n\nMaintainers\n===========\n\nMook \nNightStrike \nKai Tietz \n\nDevelopers with write after approval\n====================================\n\nkjk_hyperion \nTor Lillqvist \nAlexey Pushkin \nRoland Schwingel \nOzkan Sezer \nFridrich Strba \nChris Sutcliffe \nJonathan Yong \nJarrod Chesney \nDoug Semler \nJacek Caban \nCorinna Vinschen \nAndré Hentschel \nLiu Hao \nRuslan Garipov \n\nProject members without SVN/Git access\n==================================\n\nxenofears \n\nContributors\n============\n\nWe want to thank the following list of people for supporting us\nby contributions:\n\n20-40 \nProfessor Brian Ripley \nsduplichan \nWesley W. Terpstra \nzhou drangon \nPiotr Caban \n\nand additional thanks to the following organizations:\n\nOneVision Software AG\nReactos project\nWine project\n\nand many others, we possibly missed to mention here and are sorry for this.\n\nIf you think your name is missing and should be mentioned here, please\ncontact us for adding you.\n" + } + ], + "reviewed_cabi_evidence": { + "repository": "ktav-lang/js", + "run": 41245571952, + "source_ref": "562deb3fde092d63a78f359be095e5079929d0d1", + "tooling_head": "7d8148acc7681196283bd7e63593e5aa7863a12d" + }, + "schema_version": 1, + "sdk_archive_sha256": "fd5462b7f5d93b2ff981fcd3f9c7e427e47f3203c64ea91c27bcc444eebd74cd", + "sdk_recipe_revision": "e08a31fbfe5cfdad07b698299af22d66e5608383", + "sdk_version": "20261020", + "source_files": [ + { + "git_blob": "a1179c73c5906b2df9bb3973cd7918ad1f42b28a", + "path": "libunwind/include/__libunwind_config.h", + "sha256": "0bb004911d967d5cc2d87d07f81e03668d1cf42c6b9347a95285d9e18f82954c", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/include/__libunwind_config.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "6c2dfe58e53bf1f97bca6c78dacb47cc3676b8dc", + "path": "libunwind/include/libunwind.h", + "sha256": "3b411eb68de64e829937faaeec942bbc8e3e3a1c013b55107be2c679df64173c", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/include/libunwind.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Compatible with libunwind API documented at:\n// http://www.nongnu.org/libunwind/man/libunwind(3).html\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "c495b83c40b90ae517e390fe659061a7bbbe2603", + "path": "libunwind/include/mach-o/compact_unwind_encoding.h", + "sha256": "a458a96b1257048618e22688e3ad6fc4c36f99e1229b1492b7b800911e651a68", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/include/mach-o/compact_unwind_encoding.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Darwin's alternative to DWARF based unwind encodings.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "b1775d3a3decc76e1a0916fead1aafbc6fa0fb51", + "path": "libunwind/include/unwind.h", + "sha256": "e4a58637fc8ca1d29cd600c3c4416aafed50085edf276fa076214c8d81c263f0", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/include/unwind.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// C++ ABI Level 1 ABI documented at:\n// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "68e02e47602d60de9f9d33267e270cb5f73fc5aa", + "path": "libunwind/include/unwind_arm_ehabi.h", + "sha256": "04cf22a069866ae35bf075c36f8d9112700bb9772653d80d9c6c4c856f4e7dbb", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/include/unwind_arm_ehabi.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// C++ ABI Level 1 ABI documented at:\n// https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "860ad36cdf14e2e06cd6fe2f77b9070434240434", + "path": "libunwind/include/unwind_itanium.h", + "sha256": "43ad2c8ca672c8fb9a4eb80d7e05a687ae9134f4899641357c86cecde4efbd1f", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/include/unwind_itanium.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// C++ ABI Level 1 ABI documented at:\n// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "ff3b5fc6fea77fba0f4ebc4d74e72bac984935fa", + "path": "libunwind/src/Unwind-EHABI.h", + "sha256": "c04fdebcd31e26de7615b82751373cc64ef83d02b24dbaaf0e112d0a559acc6b", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/Unwind-EHABI.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "0b1930b44d1c648b89099b6f2f796b4233f1c877", + "path": "libunwind/src/Unwind-seh.cpp", + "sha256": "058ae089c7d42ade35b730f87443b34018b21bea75a4ea2226e9fffdf7500160", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/Unwind-seh.cpp", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n//\n// Implements SEH-based Itanium C++ exceptions.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "1764499b304f1ac4ed665829d7cc47793ebf9766", + "path": "libunwind/src/UnwindLevel1-gcc-ext.c", + "sha256": "93d2bb050caf6b4f80819b93340ae5aad91f44e633996cc7dd32dca90da05fe0", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/UnwindLevel1-gcc-ext.c", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Implements gcc extensions to the C++ ABI Exception Handling Level 1.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "834fdae6a76d3e28bde5ece20c45f367a47b1f12", + "path": "libunwind/src/UnwindLevel1.c", + "sha256": "16e16fbc0c85873df1a445d7b204fb363e46c68d6a2815dc68257108b5c944c8", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/UnwindLevel1.c", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Implements C++ ABI Exception Handling Level 1 as documented at:\n// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html\n// using libunwind\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "f44f6a1331968cf75de46a3cf64a0cc5c8f485b2", + "path": "libunwind/src/UnwindRegistersSave.S", + "sha256": "c5d0da824062363be10dc33bcd1156f16cd69811e71603c667f931a91fab5eb1", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/UnwindRegistersSave.S", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "84c9d526f1d7594e456b5a31c11adff57f79551a", + "path": "libunwind/src/assembly.h", + "sha256": "1b802ab55f7b949a9e8b1a1c7c82b6a84d068610aeb823993bdeee1964c98eb3", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/assembly.h", + "source_notices": [ + "/* ===-- assembly.h - libUnwind assembler support macros -------------------===\n *\n * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n * See https://llvm.org/LICENSE.txt for license information.\n * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n *\n * ===----------------------------------------------------------------------===\n *\n * This file defines macros for use in libUnwind assembler source.\n * This file is not part of the interface of this library.\n *\n * ===----------------------------------------------------------------------===\n */" + ] + }, + { + "git_blob": "f017403fa2234f7234e784eefeafe8eae6b1a59b", + "path": "libunwind/src/config.h", + "sha256": "fd99264860ced6f5b5cd4d5e0ef6eb444a4ab511a47a8b0d91bfab254ab21a1e", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/config.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Defines macros used within libunwind project.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "68ad882347203ca193d05bcb2e3f34d4500edca0", + "path": "libunwind/src/dwarf2.h", + "sha256": "e10d240e2f19de7121a8afaf3d4841a65936723e69d636f7e3241e14802d0bfc", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/dwarf2.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n", + "/*\n These constants were taken from version 3 of the DWARF standard,\n which is Copyright (c) 2005 Free Standards Group, and\n Copyright (c) 1992, 1993 UNIX International, Inc.\n*/" + ] + }, + { + "git_blob": "0b9d56ec805bca92f0ed4b93be549c8cf982e809", + "path": "libunwind/src/libunwind.cpp", + "sha256": "51ccb27829d15988ca5678541b1b32bb3c2bdea87e02be31bf4faca48a0ee2ad", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/libunwind.cpp", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Implements unw_* functions from \n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "8acf2212d1eae32433764070421727d73b07e372", + "path": "libunwind/src/libunwind_ext.h", + "sha256": "2efb28c93eb3c32cf491733b8e9c7b5715cb15fa0d6afb7b23ee4ca6de40cc98", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/libunwind_ext.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Extensions to libunwind API.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "b00ca2c9327c74cc40f678cb4db3b56ed18dc405", + "path": "libunwind/src/shadow_stack_unwind.h", + "sha256": "c18056e575fcf2deed7ccfe469c1c7e6c1f390f64b28cac5aa304de3bb7a50fa", + "source": "https://raw.githubusercontent.com/llvm/llvm-project/7a941dfb2877a0b8cf30323fefa85ad019e0b0f5/libunwind/src/shadow_stack_unwind.h", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "26fc8ef70c024ab756b1fb1b03eed646a63a03ab", + "path": "mingw-w64-crt/cfguard/guard_dispatch.S", + "sha256": "a479e2319b9a2789afd6f91aedb3e6c640ed16b746df6babffbb17f810432811", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/cfguard/guard_dispatch.S", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "5c736e162339dc590723f402380c4264601aefe3", + "path": "mingw-w64-crt/cfguard/mingw_cfguard_support.c", + "sha256": "a05b0eb6e9d6553ae934f81324fced9c3a6dc89f71ad073dad8ef174d424d693", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/cfguard/mingw_cfguard_support.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "c8a8bfbeebcc7f325d7d1a729bc95bbf10b7d7d9", + "path": "mingw-w64-crt/crt/CRT_fp10.c", + "sha256": "fa9af6a9c58207fc596b3babe8f0b91ebbd75a9cf73e15aa849289e7eb300643", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/CRT_fp10.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "2bb5d94a279942260b3091ae7278ac6e000351c5", + "path": "mingw-w64-crt/crt/_newmode.c", + "sha256": "d85bb76f70f90b246c780ffbfbe6540a4d787b7801e98c8ac8c3edd50dcee971", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/_newmode.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "9e6931c4fc4b5dbd41d5338a9be793b170596802", + "path": "mingw-w64-crt/crt/cinitexe.c", + "sha256": "98c9238561c0ed1b3d7edfd1e32423dfda93c3ae285807873f637d03406bdcc9", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/cinitexe.c", + "source_notices": [] + }, + { + "git_blob": "39c0d85610f70f746f91adc9af67ccf2480b937b", + "path": "mingw-w64-crt/crt/crtbegin.c", + "sha256": "692fdc825a472b8dfda48e65eace55caf5396c8536236b814b967007c978a8b0", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/crtbegin.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "15ee52a7c3348bdd64b7c4ecb0cbe626e6f8d092", + "path": "mingw-w64-crt/crt/crtdll.c", + "sha256": "158dcc7681f335dc36c4bcf86e41444d6507679cab80a68433666df690217990", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/crtdll.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "39c0d85610f70f746f91adc9af67ccf2480b937b", + "path": "mingw-w64-crt/crt/crtend.c", + "sha256": "692fdc825a472b8dfda48e65eace55caf5396c8536236b814b967007c978a8b0", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/crtend.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "ca9b0069160c14aca643a860386c9d5180fcbd0c", + "path": "mingw-w64-crt/crt/crtexe.c", + "sha256": "0624cd5c19dfcd4f6f17a3608582db6d0d4f92a468c391890b8f9114784a4b82", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/crtexe.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "d6be1bc7c2cf76471df995bdf7509590cd4d8f4d", + "path": "mingw-w64-crt/crt/dllargv.c", + "sha256": "98a1bf05b8a037d68ba1ea98ae40a2230a4e734196879fee4bd215c5c3283112", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/dllargv.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "7edf8360c91c182f8ec6e5a695c262332ee6c3ba", + "path": "mingw-w64-crt/crt/gccmain.c", + "sha256": "07c83e890740008bb74b26ecf60d97048cfeb74d89d973b6e8db4f437bc66ac9", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/gccmain.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "5aba73462de3018c7d35ec93d5afcc6eda8276ff", + "path": "mingw-w64-crt/crt/loadcfg.S", + "sha256": "ea3b2928757e53d5f68edbacfc271f4b6070f8a118bf44e50f6a4dd44baba545", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/loadcfg.S", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "687aab4a90bc7dc14ff14f86ce95136d5c1a2422", + "path": "mingw-w64-crt/crt/merr.c", + "sha256": "37d23d36e2041d5ea6e04e6674d84c227937ec477d246742fa062b5e61e1f5ea", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/merr.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "8143c6b72998473c4df1efa0654f36e59fbc2b53", + "path": "mingw-w64-crt/crt/mingw_dll_ctors_dtors.c", + "sha256": "682be7d58c77d70fdf116ad53168c893dbeaa0c85b8a9b86300493e66d3eeaae", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/mingw_dll_ctors_dtors.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "84413cdb7c9fed8e923e3620334e0f29ccf145f2", + "path": "mingw-w64-crt/crt/mingw_helpers.c", + "sha256": "a5639b68c3176c4c6a358c48f869c2a081434c07d7a0e435013f44909a2003c5", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/mingw_helpers.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "5008790e1eefed244e387f654bf4efbe5f3b2250", + "path": "mingw-w64-crt/crt/natstart.c", + "sha256": "c65fb9a3cb70536b8f757e07df8febb0b1a5fd72889bcff4fee924add1078d14", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/natstart.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "5b903c21d211138864d6b484c5b5d8c0c5df6cf3", + "path": "mingw-w64-crt/crt/pseudo-reloc-list.c", + "sha256": "853116d1ba135ea499714152be5705c72678a86fbd9bd5b90469b0ad51ab8acc", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/pseudo-reloc-list.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "dd2a28e8c2a82fbd0d00731c38e666c09738d1f3", + "path": "mingw-w64-crt/crt/pseudo-reloc.c", + "sha256": "24d57d7fec056a84268fcb3fa43dc7fc726c3c3f4c2ff4796652ca3dba33314a", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/pseudo-reloc.c", + "source_notices": [ + "/* pseudo-reloc.c\n\n Contributed by Egor Duda \n Modified by addition of runtime_pseudo_reloc version 2\n by Kai Tietz \n\t\n THIS SOFTWARE IS NOT COPYRIGHTED\n\n This source code is offered for use in the public domain. You may\n use, modify or distribute it freely.\n\n This code is distributed in the hope that it will be useful but\n WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY\n DISCLAMED. This includes but is not limited to warranties of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n*/" + ] + }, + { + "git_blob": "6273a1c527116aa889d3958bf10de7306a20d2a2", + "path": "mingw-w64-crt/crt/tlssup.c", + "sha256": "3f330e9f97d39637245c74d8cd940b2e0238b50c56aee2ff579cff9314e48e9c", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/tlssup.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n *\n * Written by Kai Tietz \n */" + ] + }, + { + "git_blob": "fce059e14e90c9ca16425e793e43dcc803130561", + "path": "mingw-w64-crt/crt/usermatherr.c", + "sha256": "9642a86e0f68b59b958866afaca5aa602ae632d361565128237b71cff4759e48", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/usermatherr.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "b53cc18ec0c05a14962269e453b1d18b2ae1084d", + "path": "mingw-w64-crt/crt/wildcard.c", + "sha256": "a574c6324511ef40619b62a7bfdfcfd4a24a101b790074979a53fd54f9b6b363", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/wildcard.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "b2ec312f09f4f03755c048a20b29ad7454b823a8", + "path": "mingw-w64-crt/crt/xncommod.c", + "sha256": "011050a8ff748ea000d630892a16dff86ab9ffc43503befe52c1c0b79cb25479", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/xncommod.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "973ff45b16e494acf60cd8e26870460a754e9ac7", + "path": "mingw-w64-crt/crt/xthdloc.c", + "sha256": "3320df224c561ac5335121ad4e1f342b90bda7a291d0f14e89ce16c2cb17e54d", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/xthdloc.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "dcbbe11846a5d0c9cea993f7adcc87bd6a5fe958", + "path": "mingw-w64-crt/crt/xtxtmode.c", + "sha256": "a1c826ee8a440cf86dbb1ae6db80e727af5f079b5797f93a3e3a616b3db2bdb9", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/crt/xtxtmode.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "c61e9fa8a52159f500db0e1497594b503dbcc5cd", + "path": "mingw-w64-crt/gdtoa/dmisc.c", + "sha256": "e73637f5fe5e171d13ab4ce51671f20af98c2707fe6c3ba4f25c7bcd108e0f85", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/gdtoa/dmisc.c", + "source_notices": [ + "/****************************************************************\n\nThe author of this software is David M. Gay.\n\nCopyright (C) 1998 by Lucent Technologies\nAll Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and\nits documentation for any purpose and without fee is hereby\ngranted, provided that the above copyright notice appear in all\ncopies and that both that the copyright notice and this\npermission notice and warranty disclaimer appear in supporting\ndocumentation, and that the name of Lucent or any of its entities\nnot be used in advertising or publicity pertaining to\ndistribution of the software without specific, written prior\npermission.\n\nLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\nIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\nSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\nIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n\n****************************************************************/" + ] + }, + { + "git_blob": "1cfe1953e4c16b19dfd7a0446da5d20ec67f3de4", + "path": "mingw-w64-crt/gdtoa/gdtoa.c", + "sha256": "09ea9686def889450b16910562c5a884e87eee161c52e6c127d373688aac8559", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/gdtoa/gdtoa.c", + "source_notices": [ + "/****************************************************************\n\nThe author of this software is David M. Gay.\n\nCopyright (C) 1998, 1999 by Lucent Technologies\nAll Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and\nits documentation for any purpose and without fee is hereby\ngranted, provided that the above copyright notice appear in all\ncopies and that both that the copyright notice and this\npermission notice and warranty disclaimer appear in supporting\ndocumentation, and that the name of Lucent or any of its entities\nnot be used in advertising or publicity pertaining to\ndistribution of the software without specific, written prior\npermission.\n\nLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\nIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\nSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\nIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n\n****************************************************************/" + ] + }, + { + "git_blob": "b2b4c54151a0da327338210940e5470cbca33f11", + "path": "mingw-w64-crt/gdtoa/gdtoa.h", + "sha256": "9ea503624739483d5a981d426a9b7a74fd2ee2e04599594e74b886d09beb0403", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/gdtoa/gdtoa.h", + "source_notices": [ + "/****************************************************************\n\nThe author of this software is David M. Gay.\n\nCopyright (C) 1998 by Lucent Technologies\nAll Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and\nits documentation for any purpose and without fee is hereby\ngranted, provided that the above copyright notice appear in all\ncopies and that both that the copyright notice and this\npermission notice and warranty disclaimer appear in supporting\ndocumentation, and that the name of Lucent or any of its entities\nnot be used in advertising or publicity pertaining to\ndistribution of the software without specific, written prior\npermission.\n\nLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\nIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\nSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\nIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n\n****************************************************************/" + ] + }, + { + "git_blob": "cc2007cd5fa3f0654b14acee99db363d515c44ad", + "path": "mingw-w64-crt/gdtoa/gdtoaimp.h", + "sha256": "cd4e3796364b4eb9d9c5cf3ff00d3abc8e114102376454bc1d2413183ca3e44d", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/gdtoa/gdtoaimp.h", + "source_notices": [ + "/****************************************************************\n\nThe author of this software is David M. Gay.\n\nCopyright (C) 1998-2000 by Lucent Technologies\nAll Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and\nits documentation for any purpose and without fee is hereby\ngranted, provided that the above copyright notice appear in all\ncopies and that both that the copyright notice and this\npermission notice and warranty disclaimer appear in supporting\ndocumentation, and that the name of Lucent or any of its entities\nnot be used in advertising or publicity pertaining to\ndistribution of the software without specific, written prior\npermission.\n\nLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\nIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\nSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\nIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n\n****************************************************************/" + ] + }, + { + "git_blob": "157e872319f033f3fcc838c26a93b7fc8b9c9826", + "path": "mingw-w64-crt/gdtoa/gmisc.c", + "sha256": "7b4327dfc978aacfb950bd4c6970696ccc76ddb7159800a244ef2a0bb593dc5c", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/gdtoa/gmisc.c", + "source_notices": [ + "/****************************************************************\n\nThe author of this software is David M. Gay.\n\nCopyright (C) 1998 by Lucent Technologies\nAll Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and\nits documentation for any purpose and without fee is hereby\ngranted, provided that the above copyright notice appear in all\ncopies and that both that the copyright notice and this\npermission notice and warranty disclaimer appear in supporting\ndocumentation, and that the name of Lucent or any of its entities\nnot be used in advertising or publicity pertaining to\ndistribution of the software without specific, written prior\npermission.\n\nLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\nIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\nSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\nIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n\n****************************************************************/" + ] + }, + { + "git_blob": "960543a606eeda45b24a4886e6149963fe6bae79", + "path": "mingw-w64-crt/gdtoa/misc.c", + "sha256": "02486c21b11fe4538bde37d4c740b486a5eef76c8fdeec8e74a9c409c8acb6dc", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/gdtoa/misc.c", + "source_notices": [ + "/****************************************************************\n\nThe author of this software is David M. Gay.\n\nCopyright (C) 1998, 1999 by Lucent Technologies\nAll Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and\nits documentation for any purpose and without fee is hereby\ngranted, provided that the above copyright notice appear in all\ncopies and that both that the copyright notice and this\npermission notice and warranty disclaimer appear in supporting\ndocumentation, and that the name of Lucent or any of its entities\nnot be used in advertising or publicity pertaining to\ndistribution of the software without specific, written prior\npermission.\n\nLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\nIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\nSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\nIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\nARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n\n****************************************************************/" + ] + }, + { + "git_blob": "30b11f284226c16e8e5320e4b3d164cc4a3c425d", + "path": "mingw-w64-crt/misc/__initenv.c", + "sha256": "7ca289f2891fef05351cc52879413c219b30de0258b950dbc7d4e10d05a01f97", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/misc/__initenv.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "e3f880b38408689890dff6091f2fe1ef831f8c46", + "path": "mingw-w64-crt/misc/__p___initenv.c", + "sha256": "034d66df82c6da68cc4bc59ff829ff3f18edd431cbe2f6376d51667f9b90f509", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/misc/__p___initenv.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "3f5b5261bffae5b63826829a9103d290d7bf5708", + "path": "mingw-w64-crt/misc/dllmain.c", + "sha256": "ad3eb745bc2e614de38f43700c274cae2b7edec7ee40950cc918d8b98d3d9505", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/misc/dllmain.c", + "source_notices": [] + }, + { + "git_blob": "21529682983729e6197d22fe532d974ca113fcf2", + "path": "mingw-w64-crt/misc/mingw_matherr.c", + "sha256": "47ccdea07abacdd4629596084796291ecf35f4ccf951fa6b5038b6db2eb4c336", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/misc/mingw_matherr.c", + "source_notices": [] + }, + { + "git_blob": "72fef92cc36e674db13500d74dee10a27a060631", + "path": "mingw-w64-crt/misc/ucrt__getmainargs.c", + "sha256": "7d9139300468218e77c1f4b1bc52ba2802b9273ad1f1b1c3e50be624039d2f5e", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/misc/ucrt__getmainargs.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "0aad4f6c368a7f284568ffb1e96c8e48f011e56a", + "path": "mingw-w64-crt/misc/ucrt_amsg_exit.c", + "sha256": "ad8dd7eb0b4e2fef5b5c16f4934b7f5bca265246e18440ecb380ab8ffe1a8c6d", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/misc/ucrt_amsg_exit.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "438941f7e3f473462007cffc12d967c88bf315e9", + "path": "mingw-w64-crt/stdio/mingw_fprintf.c", + "sha256": "c19ffaac9e0ee6056bf4cd0316d021596b37ac800d04dd187b01db01533d839e", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/stdio/mingw_fprintf.c", + "source_notices": [ + "/* fprintf.c\n *\n * $Id: fprintf.c,v 1.1 2008/08/11 22:41:55 keithmarshall Exp $\n *\n * Provides an implementation of the \"fprintf\" function, conforming\n * generally to C99 and SUSv3/POSIX specifications, with extensions\n * to support Microsoft's non-standard format specifications. This\n * is included in libmingwex.a, whence it may replace the Microsoft\n * function of the same name.\n *\n * Written by Keith Marshall \n *\n * This implementation of \"fprintf\" will normally be invoked by calling\n * \"__mingw_fprintf()\" in preference to a direct reference to \"fprintf()\"\n * itself; this leaves the MSVCRT implementation as the default, which\n * will be deployed when user code invokes \"fprint()\". Users who then\n * wish to use this implementation may either call \"__mingw_fprintf()\"\n * directly, or may use conditional preprocessor defines, to redirect\n * references to \"fprintf()\" to \"__mingw_fprintf()\".\n *\n * Compiling this module with \"-D INSTALL_AS_DEFAULT\" will change this\n * recommended convention, such that references to \"fprintf()\" in user\n * code will ALWAYS be redirected to \"__mingw_fprintf()\"; if this option\n * is adopted, then users wishing to use the MSVCRT implementation of\n * \"fprintf()\" will be forced to use a \"back-door\" mechanism to do so.\n * Such a \"back-door\" mechanism is provided with MinGW, allowing the\n * MSVCRT implementation to be called as \"__msvcrt_fprintf()\"; however,\n * since users may not expect this behaviour, a standard libmingwex.a\n * installation does not employ this option.\n *\n *\n * This is free software. You may redistribute and/or modify it as you\n * see fit, without restriction of copyright.\n *\n * This software is provided \"as is\", in the hope that it may be useful,\n * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of\n * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no\n * time will the author accept any form of liability for any damages,\n * however caused, resulting from the use of this software.\n *\n */" + ] + }, + { + "git_blob": "2bbe5203b52fe37cd977c6c11bc11c7924dab2ae", + "path": "mingw-w64-crt/stdio/mingw_pformat.c", + "sha256": "8ad4e2a80cb56291deb8ab42238c5084fa256a65dbf08412109f08c3ced85225", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/stdio/mingw_pformat.c", + "source_notices": [ + "/* pformat.c\n *\n * $Id: pformat.c,v 1.9 2011/01/07 22:57:00 keithmarshall Exp $\n *\n * Provides a core implementation of the formatting capabilities\n * common to the entire `printf()' family of functions; it conforms\n * generally to C99 and SUSv3/POSIX specifications, with extensions\n * to support Microsoft's non-standard format specifications.\n *\n * Written by Keith Marshall \n *\n * This is free software. You may redistribute and/or modify it as you\n * see fit, without restriction of copyright.\n *\n * This software is provided \"as is\", in the hope that it may be useful,\n * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of\n * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no\n * time will the author accept any form of liability for any damages,\n * however caused, resulting from the use of this software.\n *\n * The elements of this implementation which deal with the formatting\n * of floating point numbers, (i.e. the `%e', `%E', `%f', `%F', `%g'\n * and `%G' format specifiers, but excluding the hexadecimal floating\n * point `%a' and `%A' specifiers), make use of the `__gdtoa' function\n * written by David M. Gay, and are modelled on his sample code, which\n * has been deployed under its accompanying terms of use:--\n *\n ******************************************************************\n * Copyright (C) 1997, 1999, 2001 Lucent Technologies\n * All Rights Reserved\n *\n * Permission to use, copy, modify, and distribute this software and\n * its documentation for any purpose and without fee is hereby\n * granted, provided that the above copyright notice appear in all\n * copies and that both that the copyright notice and this\n * permission notice and warranty disclaimer appear in supporting\n * documentation, and that the name of Lucent or any of its entities\n * not be used in advertising or publicity pertaining to\n * distribution of the software without specific, written prior\n * permission.\n *\n * LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\n * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\n * IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\n * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\n * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\n * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n * THIS SOFTWARE.\n ******************************************************************\n *\n */" + ] + }, + { + "git_blob": "ee98ac1ac827877eaa8e5de8a675bdc9dcced18c", + "path": "mingw-w64-crt/stdio/ucrt___local_stdio_printf_options.c", + "sha256": "0c8ab6443db6f80930f95ee4f380faf7e0bd7a04ecafa0fcba8016bd77a0c98c", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/stdio/ucrt___local_stdio_printf_options.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "0b06b14e9653a4dca58436e30cc2ad2feb9a5f2b", + "path": "mingw-w64-crt/stdio/ucrt_fprintf.c", + "sha256": "080d99fcea70a61cde96b5347e8a381c28778928584227cb6b70a543c3b0933c", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/stdio/ucrt_fprintf.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + }, + { + "git_blob": "6ac1bb8c115a5cbf82d3d1a364fc3460eeb47380", + "path": "mingw-w64-crt/stdio/ucrt_vfprintf.c", + "sha256": "682fc042d9007afcfa6c022373178d22591af8c9cb93de9ab5525b3d17cd5b75", + "source": "https://raw.githubusercontent.com/mingw-w64/mingw-w64/0d6dfbc348dfad714761c0a7151615767f96bcb5/mingw-w64-crt/stdio/ucrt_vfprintf.c", + "source_notices": [ + "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is part of the mingw-w64 runtime package.\n * No warranty is given; refer to the file DISCLAIMER.PD within this package.\n */" + ] + } + ], + "targets": { + "aarch64-pc-windows-gnullvm": { + "retained_objects": [ + "Unwind-seh.cpp.obj", + "UnwindLevel1-gcc-ext.c.obj", + "UnwindLevel1.c.obj", + "UnwindRegistersSave.S.obj", + "crtbegin.o", + "crtend.o", + "dllcrt2.o", + "libarm64_libmingw32_a-cinitexe.o", + "libarm64_libmingw32_a-mingw_dll_ctors_dtors.o", + "libarm64_libmingw32_a-mingw_helpers.o", + "libarm64_libmingw32_a-natstart.o", + "libarm64_libmingw32_a-pseudo-reloc-list.o", + "libarm64_libmingw32_a-pseudo-reloc.o", + "libarm64_libmingw32_a-tlssup.o", + "libarm64_libmingwex_a-dllmain.o", + "libarm64_libmingwex_a-loadcfg.o", + "libarm64_libmingwex_a-mingw_cfguard_support.o", + "libarm64_libucrt_extra_a-ucrt___local_stdio_printf_options.o", + "libarm64_libucrt_extra_a-ucrt_fprintf.o", + "libarm64_libucrt_extra_a-ucrt_vfprintf.o", + "libunwind.cpp.obj" + ], + "sdk_inputs": [ + { + "path": "aarch64-w64-mingw32/lib/crtbegin.o", + "sha256": "4ba912486f310ab85d7d06a90d4c46c22485edce0255a03a1f74c0c8510eff9e", + "size": 1309 + }, + { + "path": "aarch64-w64-mingw32/lib/crtend.o", + "sha256": "eefb57102e2168200514c7565f27b14fe519bb5a853e7f00d3e4dd2a5c777470", + "size": 1309 + }, + { + "path": "aarch64-w64-mingw32/lib/dllcrt2.o", + "sha256": "bf86f93b1ce6b401fc837edbac68e8b9ae474a3af335c67ba1659febd25305a6", + "size": 42872 + }, + { + "path": "aarch64-w64-mingw32/lib/libdbghelp.a", + "sha256": "b5d39301a039d48a1513c6222e5254efd96eb641508fac9a4635cd5e5da27968", + "size": 103246 + }, + { + "path": "aarch64-w64-mingw32/lib/libkernel32.a", + "sha256": "f5197cec7cea31be9847bfb6c3912bea507319be63740a6887d02a0b6bbdd893", + "size": 1009086 + }, + { + "path": "aarch64-w64-mingw32/lib/libmingw32.a", + "sha256": "ff45b29605c4c9de82d6ad40fcc7fe4139b37467df10541b286336f7929257c3", + "size": 339550 + }, + { + "path": "aarch64-w64-mingw32/lib/libmingwex.a", + "sha256": "d1108040c5e08d84d58108f4dfe40cb3793a0eee61d0a1fa6919f8469be5ea73", + "size": 4168698 + }, + { + "path": "aarch64-w64-mingw32/lib/libmsvcrt.a", + "sha256": "062c0d06384cb8f8db2666eda5e50dab9a300e2e662f9dda2711bd48576ae34d", + "size": 1796926 + }, + { + "path": "aarch64-w64-mingw32/lib/libntdll.a", + "sha256": "3c91ccf64aa2c8d2fa47bedf45531ec2c972ff37200eb541afb16d7259cce96c", + "size": 1126014 + }, + { + "path": "aarch64-w64-mingw32/lib/libunwind.a", + "sha256": "1a983632d86eb33d808534b4853e5185f31419adc787048c9f5bc3e76a79d9b9", + "size": 231528 + }, + { + "path": "aarch64-w64-mingw32/lib/libuser32.a", + "sha256": "fd1f8ad6376a7d57a01c9d0361f89ca038c8c03dde43b8298f094e73f24c6bf9", + "size": 434306 + }, + { + "path": "aarch64-w64-mingw32/lib/libuserenv.a", + "sha256": "fbc1da1ed5165754594e48fa8e1199a0fbe395e6ab29531d33633c14725789c5", + "size": 40108 + }, + { + "path": "aarch64-w64-mingw32/lib/libws2_32.a", + "sha256": "04d7f776550e3732b37cef7b2759862e82b2485e99cc9baf354df573da489483", + "size": 411636 + }, + { + "path": "lib/clang/23/lib/windows/libclang_rt.builtins-aarch64.a", + "sha256": "0eadf5121c8d6c9169769130d8e83a549251b91bd2686150d75f3914eb8ac6df", + "size": 760636 + } + ] + }, + "x86_64-pc-windows-gnullvm": { + "retained_objects": [ + "Unwind-seh.cpp.obj", + "UnwindLevel1-gcc-ext.c.obj", + "UnwindLevel1.c.obj", + "UnwindRegistersSave.S.obj", + "crtbegin.o", + "crtend.o", + "dllcrt2.o", + "lib64_libmingw32_a-cinitexe.o", + "lib64_libmingw32_a-mingw_dll_ctors_dtors.o", + "lib64_libmingw32_a-mingw_helpers.o", + "lib64_libmingw32_a-natstart.o", + "lib64_libmingw32_a-pseudo-reloc-list.o", + "lib64_libmingw32_a-pseudo-reloc.o", + "lib64_libmingw32_a-tlssup.o", + "lib64_libmingwex_a-dllmain.o", + "lib64_libmingwex_a-dmisc.o", + "lib64_libmingwex_a-gdtoa.o", + "lib64_libmingwex_a-gmisc.o", + "lib64_libmingwex_a-guard_dispatch.o", + "lib64_libmingwex_a-loadcfg.o", + "lib64_libmingwex_a-mingw_cfguard_support.o", + "lib64_libmingwex_a-mingw_fprintf.o", + "lib64_libmingwex_a-mingw_pformat.o", + "lib64_libmingwex_a-misc.o", + "lib64_libucrt_extra_a-ucrt___local_stdio_printf_options.o", + "lib64_libucrt_extra_a-ucrt_fprintf.o", + "lib64_libucrt_extra_a-ucrt_vfprintf.o", + "libunwind.cpp.obj" + ], + "sdk_inputs": [ + { + "path": "lib/clang/23/lib/windows/libclang_rt.builtins-x86_64.a", + "sha256": "fa6a7a18518ff5372a5f32a386ab0d689099d8c258c18eaea2431f514154c55b", + "size": 256660 + }, + { + "path": "x86_64-w64-mingw32/lib/crtbegin.o", + "sha256": "5dc28a7b0ecf42c769578f63b8d169c89c958f95c2e67b3a0d8f94b8bd3c6c60", + "size": 628 + }, + { + "path": "x86_64-w64-mingw32/lib/crtend.o", + "sha256": "c6b583eaf68b432e35507013e3213557edd2656c33916a7878c8efda18b95c19", + "size": 628 + }, + { + "path": "x86_64-w64-mingw32/lib/dllcrt2.o", + "sha256": "a846dd86db648a38ad5ee3d382295b6fa084df639a8c26cd32646ff9f71bfc47", + "size": 17632 + }, + { + "path": "x86_64-w64-mingw32/lib/libdbghelp.a", + "sha256": "f407acff38e12cb5227a6bad5f023f31c3705aca0a5339fc9b25ec433342e3cc", + "size": 49766 + }, + { + "path": "x86_64-w64-mingw32/lib/libkernel32.a", + "sha256": "6ee0041fafa7ad06bd7dc8b6b387e4ca066e76ccfeca56ae84af5a2a6d42a345", + "size": 577358 + }, + { + "path": "x86_64-w64-mingw32/lib/libmingw32.a", + "sha256": "a0aad43b481208ad1ff583102c00bd2a1e56e855b2045e282ed03845a44feef7", + "size": 139220 + }, + { + "path": "x86_64-w64-mingw32/lib/libmingwex.a", + "sha256": "df21bc3944a8766542f1b4c1ffc864e2b5dd997f2d14604eec12d3ba9258bfea", + "size": 1881848 + }, + { + "path": "x86_64-w64-mingw32/lib/libmsvcrt.a", + "sha256": "e4e38200c764bbfd217f3290f64b9bd3cc963dd782b34f3d747df27780360f62", + "size": 848642 + }, + { + "path": "x86_64-w64-mingw32/lib/libntdll.a", + "sha256": "a9e9a4eacaff6d5c186c514a8f27840df9de44c86de4dfbfe38dab0cae907cea", + "size": 545270 + }, + { + "path": "x86_64-w64-mingw32/lib/libunwind.a", + "sha256": "b37299ed084757834d7cee8d723aff6b349890d61505478602e9e981dcca839c", + "size": 91768 + }, + { + "path": "x86_64-w64-mingw32/lib/libuser32.a", + "sha256": "6b2bea0a02e6a95bcbb684ff4ede16a4a51c8bd0a55e7e15b81255c4467190bb", + "size": 207984 + }, + { + "path": "x86_64-w64-mingw32/lib/libuserenv.a", + "sha256": "c9d73aedfcbde527e9a41e9c1bb72924bd6fac5e8a4d0cae13483e8b72e2f94b", + "size": 19538 + }, + { + "path": "x86_64-w64-mingw32/lib/libws2_32.a", + "sha256": "fbb7fff6f90697b20285a1e4dfdeffb8cc5fdf7c8932ea39bc66bd722e3e33ad", + "size": 171084 + } + ] + } + } +} diff --git a/ci/licenses/rust-compiler-originals/compiler-builtins-Cargo.toml.txt b/ci/licenses/rust-compiler-originals/compiler-builtins-Cargo.toml.txt new file mode 100644 index 0000000..b2f1443 --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-builtins-Cargo.toml.txt @@ -0,0 +1,62 @@ +# NOTE: Must be kept in sync with `../builtins-shim/Cargo.toml`. +# +# This manifest is actually used in-tree by rust-lang/rust, +# `../builtins-shim/Cargo.toml` is used by out-of-tree testing. See the other +# manifest for further details. + +[package] +name = "compiler_builtins" +version = "0.1.160" +authors = [ + "Alex Crichton ", + "Amanieu d'Antras ", + "Jorge Aparicio ", + "Trevor Gross ", +] +description = "Compiler intrinsics used by the Rust compiler." +repository = "https://github.com/rust-lang/compiler-builtins" +license = "MIT AND Apache-2.0 WITH LLVM-exception AND (MIT OR Apache-2.0)" +edition = "2024" +publish = false +links = "compiler-rt" + +[lib] +bench = false +doctest = false +test = false +# make sure this crate isn't included in public standard library docs +doc = false + +[dependencies] +core = { path = "../../core", optional = true } + +[build-dependencies] +cc = { version = "1.2", optional = true } + +[features] +default = ["arch"] + +# Enable architecture-specific features such as SIMD or assembly routines. If +# disabled, the generic version can be tested on any platform. +arch = [] + +# Enable compilation of C code in compiler-rt, filling in some more optimized +# implementations and also filling in unimplemented intrinsics +c = ["dep:cc"] + +# Flag this library as the unstable compiler-builtins lib. This must be enabled +# when using as `std`'s dependency.' +compiler-builtins = ["dep:core", "unmangled-names"] + +# Enable `no_mangle` symbols for memory-related intrinsics like memcpy. The +# mangled versions are always available. +mem = [] + +# Enable `no_mangle` symbols so this crate gets used as the runtime intrinsic +# implementation. Leave this disabled for testing to avoid conflicting with +# the system intrinsics. +unmangled-names = [] + +# This makes certain traits and function specializations public that +# are not normally public but are required by the `builtins-test` +unstable-public-internals = [] diff --git a/ci/licenses/rust-compiler-originals/compiler-builtins-LICENSE.txt b/ci/licenses/rust-compiler-originals/compiler-builtins-LICENSE.txt new file mode 100644 index 0000000..00ae614 --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-builtins-LICENSE.txt @@ -0,0 +1,275 @@ +The compiler-builtins crate is available for use under both the MIT license +and the Apache-2.0 license with the LLVM exception (MIT AND Apache-2.0 WITH +LLVM-exception). + +The libm crate is available for use under the MIT license. + +As a contributor, you agree that your code may be used under any of the +following: the MIT license, the Apache-2.0 license, or the Apache-2.0 license +with the LLVM exception. In other words, original (non-derivative) work is +licensed under MIT OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception. This is +the default license for all other source in this repository. + +Text of the relevant licenses is provided below: + +------------------------------------------------------------------------------ +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +------------------------------------------------------------------------------ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. +------------------------------------------------------------------------------ + +Portions of this software are derived from third-party works licensed under +terms compatible with the above Apache-2.0 WITH LLVM-exception AND MIT +license: + +* compiler-builtins is derived from LLVM's compiler-rt (https://llvm.org/). + Work derived from compiler-rt prior to 2019-01-19 is usable under the MIT + license, with the following copyright: + + Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT + + The relevant CREDITS.TXT is located at + https://github.com/llvm/llvm-project/blob/main/compiler-rt/CREDITS.TXT. + +* Work derived from compiler-rt after 2019-01-19 is usable under the + Apache-2.0 license with the LLVM exception. + +* The bundled `math` module is from the libm crate, usable under the MIT + license. For further details and copyrights, see see libm/LICENSE.txt at + https://github.com/rust-lang/compiler-builtins. + +Additionally, some source files may contain comments with specific copyrights +or licenses. diff --git a/ci/licenses/rust-compiler-originals/compiler-builtins-aarch64-outline-atomics.rs.txt b/ci/licenses/rust-compiler-originals/compiler-builtins-aarch64-outline-atomics.rs.txt new file mode 100644 index 0000000..367768e --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-builtins-aarch64-outline-atomics.rs.txt @@ -0,0 +1,467 @@ +//! Aarch64 targets have two possible implementations for atomics: +//! 1. Load-Locked, Store-Conditional (LL/SC), older and slower. +//! 2. Large System Extensions (LSE), newer and faster. +//! To avoid breaking backwards compat, C toolchains introduced a concept of "outlined atomics", +//! where atomic operations call into the compiler runtime to dispatch between two depending on +//! which is supported on the current CPU. +//! See for more discussion. +//! +//! Ported from `aarch64/lse.S` in LLVM's compiler-rt. +//! +//! Generate functions for each of the following symbols: +//! __aarch64_casM_ORDER +//! __aarch64_swpN_ORDER +//! __aarch64_ldaddN_ORDER +//! __aarch64_ldclrN_ORDER +//! __aarch64_ldeorN_ORDER +//! __aarch64_ldsetN_ORDER +//! for N = {1, 2, 4, 8}, M = {1, 2, 4, 8, 16}, ORDER = { relax, acq, rel, acq_rel } +//! +//! The original `lse.S` has some truly horrifying code that expects to be compiled multiple times with different constants. +//! We do something similar, but with macro arguments. +#![cfg_attr(feature = "c", allow(unused_macros))] // avoid putting the macros into a submodule + +use core::sync::atomic::{AtomicU8, Ordering}; + +/// non-zero if the host supports LSE atomics. +static HAVE_LSE_ATOMICS: AtomicU8 = AtomicU8::new(0); + +intrinsics! { + /// Call to enable LSE in outline atomic operations. The caller must verify + /// LSE operations are supported. + pub extern "C" fn __rust_enable_lse() { + HAVE_LSE_ATOMICS.store(1, Ordering::Relaxed); + } +} + +/// Function to enable/disable LSE. To be used only for testing purposes. +#[cfg(feature = "unstable-public-internals")] +pub unsafe fn set_have_lse_atomics(has_lse: bool) { + let lse_flag = if has_lse { 1 } else { 0 }; + HAVE_LSE_ATOMICS.store(lse_flag, Ordering::Relaxed); +} + +/// Function to obtain whether LSE is enabled or not. To be used only for testing purposes. +#[cfg(feature = "unstable-public-internals")] +pub fn get_have_lse_atomics() -> bool { + HAVE_LSE_ATOMICS.load(Ordering::Relaxed) != 0 +} + +/// Translate a byte size to a Rust type. +#[rustfmt::skip] +macro_rules! int_ty { + (1) => { u8 }; + (2) => { u16 }; + (4) => { u32 }; + (8) => { u64 }; + (16) => { u128 }; +} + +/// Given a byte size and a register number, return a register of the appropriate size. +/// +/// See . +#[rustfmt::skip] +macro_rules! reg { + (1, $num:literal) => { concat!("w", $num) }; + (2, $num:literal) => { concat!("w", $num) }; + (4, $num:literal) => { concat!("w", $num) }; + (8, $num:literal) => { concat!("x", $num) }; + (16, $num:literal) => { concat!("x", $num) }; +} + +/// Given an atomic ordering, translate it to the acquire suffix for the lxdr aarch64 ASM instruction. +#[rustfmt::skip] +macro_rules! acquire { + (Relaxed) => { "" }; + (Acquire) => { "a" }; + (Release) => { "" }; + (AcqRel) => { "a" }; +} + +/// Given an atomic ordering, translate it to the release suffix for the stxr aarch64 ASM instruction. +#[rustfmt::skip] +macro_rules! release { + (Relaxed) => { "" }; + (Acquire) => { "" }; + (Release) => { "l" }; + (AcqRel) => { "l" }; +} + +/// Given a size in bytes, translate it to the byte suffix for an aarch64 ASM instruction. +#[rustfmt::skip] +macro_rules! size { + (1) => { "b" }; + (2) => { "h" }; + (4) => { "" }; + (8) => { "" }; + (16) => { "" }; +} + +/// Given a byte size, translate it to an Unsigned eXTend instruction +/// with the correct semantics. +/// +/// See +#[rustfmt::skip] +macro_rules! uxt { + (1) => { "uxtb" }; + (2) => { "uxth" }; + ($_:tt) => { "mov" }; +} + +/// Given an atomic ordering and byte size, translate it to a LoaD eXclusive Register instruction +/// with the correct semantics. +/// +/// See . +macro_rules! ldxr { + ($ordering:ident, $bytes:tt) => { + concat!("ld", acquire!($ordering), "xr", size!($bytes)) + }; +} + +/// Given an atomic ordering and byte size, translate it to a STore eXclusive Register instruction +/// with the correct semantics. +/// +/// See . +macro_rules! stxr { + ($ordering:ident, $bytes:tt) => { + concat!("st", release!($ordering), "xr", size!($bytes)) + }; +} + +/// Given an atomic ordering and byte size, translate it to a LoaD eXclusive Pair of registers instruction +/// with the correct semantics. +/// +/// See +macro_rules! ldxp { + ($ordering:ident) => { + concat!("ld", acquire!($ordering), "xp") + }; +} + +/// Given an atomic ordering and byte size, translate it to a STore eXclusive Pair of registers instruction +/// with the correct semantics. +/// +/// See . +macro_rules! stxp { + ($ordering:ident) => { + concat!("st", release!($ordering), "xp") + }; +} + +// The AArch64 assembly syntax for relocation specifiers +// when accessing symbols changes depending on the target executable format. +// In ELF (used in Linux), we have a prefix notation surrounded by colons (:specifier:sym), +// while in Mach-O object files (used in MacOS), a postfix notation is used (sym@specifier). + +/// AArch64 ELF position-independent addressing: +/// +/// adrp xN, symbol +/// add xN, xN, :lo12:symbol +/// +/// The :lo12: modifier selects the low 12 bits of the symbol address +/// and emits an ELF relocation such as R_AARCH64_ADD_ABS_LO12_NC. +/// +/// Defined by the AArch64 ELF psABI. +/// See: . +#[cfg(not(target_vendor = "apple"))] +macro_rules! sym { + ($sym:literal) => { + $sym + }; +} + +#[cfg(not(target_vendor = "apple"))] +macro_rules! sym_off { + ($sym:literal) => { + concat!(":lo12:", $sym) + }; +} + +/// Mach-O ARM64 relocation types: +/// ARM64_RELOC_PAGE21 +/// ARM64_RELOC_PAGEOFF12 +/// +/// These relocations implement the @PAGE / @PAGEOFF split used by +/// adrp + add sequences on Apple platforms. +/// +/// adrp xN, symbol@PAGE -> ARM64_RELOC_PAGE21 +/// add xN, xN, symbol@PAGEOFF -> ARM64_RELOC_PAGEOFF12 +/// +/// Relocation types defined by Apple in XNU: . +/// See: . +#[cfg(target_vendor = "apple")] +macro_rules! sym { + ($sym:literal) => { + concat!($sym, "@PAGE") + }; +} + +#[cfg(target_vendor = "apple")] +macro_rules! sym_off { + ($sym:literal) => { + concat!($sym, "@PAGEOFF") + }; +} + +// If supported, perform the requested LSE op and return, or fallthrough. +macro_rules! try_lse_op { + ($op: literal, $ordering:ident, $bytes:tt, $($reg:literal,)* [ $mem:ident ] ) => { + concat!( + ".arch_extension lse\n", + concat!("adrp x16, ", sym!("{have_lse}"), "\n"), + concat!("ldrb w16, [x16, ", sym_off!("{have_lse}"), "]\n"), + "cbz w16, 8f\n", + // LSE_OP s(reg),* [$mem] + concat!(lse!($op, $ordering, $bytes), $( " ", reg!($bytes, $reg), ", " ,)* "[", stringify!($mem), "]\n",), + "ret + 8:" + ) + }; +} + +// Translate memory ordering to the LSE suffix +#[rustfmt::skip] +macro_rules! lse_mem_sfx { + (Relaxed) => { "" }; + (Acquire) => { "a" }; + (Release) => { "l" }; + (AcqRel) => { "al" }; +} + +// Generate the aarch64 LSE operation for memory ordering and width +macro_rules! lse { + ($op:literal, $order:ident, 16) => { + concat!($op, "p", lse_mem_sfx!($order)) + }; + ($op:literal, $order:ident, $bytes:tt) => { + concat!($op, lse_mem_sfx!($order), size!($bytes)) + }; +} + +/// See . +macro_rules! compare_and_swap { + ($ordering:ident, $bytes:tt, $name:ident) => { + intrinsics! { + #[maybe_use_optimized_c_shim] + #[unsafe(naked)] + pub unsafe extern "C" fn $name ( + expected: int_ty!($bytes), desired: int_ty!($bytes), ptr: *mut int_ty!($bytes) + ) -> int_ty!($bytes) { + // We can't use `AtomicI8::compare_and_swap`; we *are* compare_and_swap. + core::arch::naked_asm! { + // CAS s(0), s(1), [x2]; if LSE supported. + try_lse_op!("cas", $ordering, $bytes, 0, 1, [x2]), + // UXT s(tmp0), s(0) + concat!(uxt!($bytes), " ", reg!($bytes, 16), ", ", reg!($bytes, 0)), + "0:", + // LDXR s(0), [x2] + concat!(ldxr!($ordering, $bytes), " ", reg!($bytes, 0), ", [x2]"), + // cmp s(0), s(tmp0) + concat!("cmp ", reg!($bytes, 0), ", ", reg!($bytes, 16)), + "bne 1f", + // STXR w(tmp1), s(1), [x2] + concat!(stxr!($ordering, $bytes), " w17, ", reg!($bytes, 1), ", [x2]"), + "cbnz w17, 0b", + "1:", + "ret", + have_lse = sym crate::aarch64_outline_atomics::HAVE_LSE_ATOMICS, + } + } + } + }; +} + +// u128 uses a completely different impl, so it has its own macro. +macro_rules! compare_and_swap_u128 { + ($ordering:ident, $name:ident) => { + intrinsics! { + #[maybe_use_optimized_c_shim] + #[unsafe(naked)] + pub unsafe extern "C" fn $name ( + expected: u128, desired: u128, ptr: *mut u128 + ) -> u128 { + core::arch::naked_asm! { + // CASP x0, x1, x2, x3, [x4]; if LSE supported. + try_lse_op!("cas", $ordering, 16, 0, 1, 2, 3, [x4]), + "mov x16, x0", + "mov x17, x1", + "0:", + // LDXP x0, x1, [x4] + concat!(ldxp!($ordering), " x0, x1, [x4]"), + "cmp x0, x16", + "ccmp x1, x17, #0, eq", + "bne 1f", + // STXP w(tmp2), x2, x3, [x4] + concat!(stxp!($ordering), " w15, x2, x3, [x4]"), + "cbnz w15, 0b", + "1:", + "ret", + have_lse = sym crate::aarch64_outline_atomics::HAVE_LSE_ATOMICS, + } + } + } + }; +} + +/// See . +macro_rules! swap { + ($ordering:ident, $bytes:tt, $name:ident) => { + intrinsics! { + #[maybe_use_optimized_c_shim] + #[unsafe(naked)] + pub unsafe extern "C" fn $name ( + left: int_ty!($bytes), right_ptr: *mut int_ty!($bytes) + ) -> int_ty!($bytes) { + core::arch::naked_asm! { + // SWP s(0), s(0), [x1]; if LSE supported. + try_lse_op!("swp", $ordering, $bytes, 0, 0, [x1]), + // mov s(tmp0), s(0) + concat!("mov ", reg!($bytes, 16), ", ", reg!($bytes, 0)), + "0:", + // LDXR s(0), [x1] + concat!(ldxr!($ordering, $bytes), " ", reg!($bytes, 0), ", [x1]"), + // STXR w(tmp1), s(tmp0), [x1] + concat!(stxr!($ordering, $bytes), " w17, ", reg!($bytes, 16), ", [x1]"), + "cbnz w17, 0b", + "ret", + have_lse = sym crate::aarch64_outline_atomics::HAVE_LSE_ATOMICS, + } + } + } + }; +} + +/// See (e.g.) . +macro_rules! fetch_op { + ($ordering:ident, $bytes:tt, $name:ident, $op:literal, $lse_op:literal) => { + intrinsics! { + #[maybe_use_optimized_c_shim] + #[unsafe(naked)] + pub unsafe extern "C" fn $name ( + val: int_ty!($bytes), ptr: *mut int_ty!($bytes) + ) -> int_ty!($bytes) { + core::arch::naked_asm! { + // LSEOP s(0), s(0), [x1]; if LSE supported. + try_lse_op!($lse_op, $ordering, $bytes, 0, 0, [x1]), + // mov s(tmp0), s(0) + concat!("mov ", reg!($bytes, 16), ", ", reg!($bytes, 0)), + "0:", + // LDXR s(0), [x1] + concat!(ldxr!($ordering, $bytes), " ", reg!($bytes, 0), ", [x1]"), + // OP s(tmp1), s(0), s(tmp0) + concat!($op, " ", reg!($bytes, 17), ", ", reg!($bytes, 0), ", ", reg!($bytes, 16)), + // STXR w(tmp2), s(tmp1), [x1] + concat!(stxr!($ordering, $bytes), " w15, ", reg!($bytes, 17), ", [x1]"), + "cbnz w15, 0b", + "ret", + have_lse = sym crate::aarch64_outline_atomics::HAVE_LSE_ATOMICS, + } + } + } + } +} + +// We need a single macro to pass to `foreach_ldadd`. +macro_rules! add { + ($ordering:ident, $bytes:tt, $name:ident) => { + fetch_op! { $ordering, $bytes, $name, "add", "ldadd" } + }; +} + +macro_rules! and { + ($ordering:ident, $bytes:tt, $name:ident) => { + fetch_op! { $ordering, $bytes, $name, "bic", "ldclr" } + }; +} + +macro_rules! xor { + ($ordering:ident, $bytes:tt, $name:ident) => { + fetch_op! { $ordering, $bytes, $name, "eor", "ldeor" } + }; +} + +macro_rules! or { + ($ordering:ident, $bytes:tt, $name:ident) => { + fetch_op! { $ordering, $bytes, $name, "orr", "ldset" } + }; +} + +#[macro_export] +macro_rules! foreach_ordering { + ($macro:path, $bytes:tt, $name:ident) => { + $macro!( Relaxed, $bytes, ${concat($name, _relax)} ); + $macro!( Acquire, $bytes, ${concat($name, _acq)} ); + $macro!( Release, $bytes, ${concat($name, _rel)} ); + $macro!( AcqRel, $bytes, ${concat($name, _acq_rel)} ); + }; + ($macro:path, $name:ident) => { + $macro!( Relaxed, ${concat($name, _relax)} ); + $macro!( Acquire, ${concat($name, _acq)} ); + $macro!( Release, ${concat($name, _rel)} ); + $macro!( AcqRel, ${concat($name, _acq_rel)} ); + }; +} + +#[macro_export] +macro_rules! foreach_bytes { + ($macro:path, $name:ident) => { + foreach_ordering!( $macro, 1, ${concat(__aarch64_, $name, "1")} ); + foreach_ordering!( $macro, 2, ${concat(__aarch64_, $name, "2")} ); + foreach_ordering!( $macro, 4, ${concat(__aarch64_, $name, "4")} ); + foreach_ordering!( $macro, 8, ${concat(__aarch64_, $name, "8")} ); + }; +} + +/// Generate different macros for cas/swp/add/clr/eor/set so that we can test them separately. +#[macro_export] +macro_rules! foreach_cas { + ($macro:path) => { + foreach_bytes!($macro, cas); + }; +} + +/// Only CAS supports 16 bytes, and it has a different implementation that uses a different macro. +#[macro_export] +macro_rules! foreach_cas16 { + ($macro:path) => { + foreach_ordering!($macro, __aarch64_cas16); + }; +} +#[macro_export] +macro_rules! foreach_swp { + ($macro:path) => { + foreach_bytes!($macro, swp); + }; +} +#[macro_export] +macro_rules! foreach_ldadd { + ($macro:path) => { + foreach_bytes!($macro, ldadd); + }; +} +#[macro_export] +macro_rules! foreach_ldclr { + ($macro:path) => { + foreach_bytes!($macro, ldclr); + }; +} +#[macro_export] +macro_rules! foreach_ldeor { + ($macro:path) => { + foreach_bytes!($macro, ldeor); + }; +} +#[macro_export] +macro_rules! foreach_ldset { + ($macro:path) => { + foreach_bytes!($macro, ldset); + }; +} + +foreach_cas!(compare_and_swap); +foreach_cas16!(compare_and_swap_u128); +foreach_swp!(swap); +foreach_ldadd!(add); +foreach_ldclr!(and); +foreach_ldeor!(xor); +foreach_ldset!(or); diff --git a/ci/licenses/rust-compiler-originals/compiler-builtins-aarch64.rs.txt b/ci/licenses/rust-compiler-originals/compiler-builtins-aarch64.rs.txt new file mode 100644 index 0000000..2c12cb7 --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-builtins-aarch64.rs.txt @@ -0,0 +1,17 @@ +intrinsics! { + #[unsafe(naked)] + #[cfg(any(all(windows, target_env = "gnu"), target_os = "uefi"))] + pub unsafe extern "custom" fn __chkstk() { + core::arch::naked_asm!( + ".p2align 2", + "lsl x16, x15, #4", + "mov x17, sp", + "1:", + "sub x17, x17, 4096", + "subs x16, x16, 4096", + "ldr xzr, [x17]", + "b.gt 1b", + "ret", + ); + } +} diff --git a/ci/licenses/rust-compiler-originals/compiler-builtins-build.rs.txt b/ci/licenses/rust-compiler-originals/compiler-builtins-build.rs.txt new file mode 100644 index 0000000..e86c784 --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-builtins-build.rs.txt @@ -0,0 +1,649 @@ +#[path = "../libm/configure.rs"] +mod configure; + +use std::env; + +use configure::{Config, Library, set_cfg}; + +fn main() { + let cfg = Config::from_env(Library::CompilerBuiltins); + let llvm_target = &cfg.target_triple_split; + + // Work around building as part of `builtins-shim`: if only `build.rs` is used, Cargo always + // considers the build dirty because `builtins-shim/build.rs` does not exist. If only + // `../c-b/build.rs` is used, the same may happen if not built in the workspace. + // Note: this may be `None` if CARGO_MANIFEST_DIR doesn't end in a directory name (e.g. ".") + if let Some(dir) = cfg.manifest_dir.file_name() + && dir == "builtins-shim" + { + println!("cargo::rerun-if-changed=../compiler-builtins/build.rs"); + } else { + println!("cargo::rerun-if-changed=build.rs"); + } + + println!("cargo::rerun-if-changed=../libm/configure.rs"); + + configure::emit(&cfg); + configure_check_cfg(); + + let cwd = env::current_dir().unwrap(); + println!("cargo:compiler-rt={}", cwd.join("compiler-rt").display()); + + // Forcibly enable memory intrinsics on wasm & SGX as we don't have a libc to + // provide them. + if (cfg.target_triple.contains("wasm") && !cfg.target_triple.contains("wasi")) + || (cfg.target_triple.contains("sgx") && cfg.target_triple.contains("fortanix")) + || cfg.target_triple.contains("-none") + || cfg.target_triple.contains("nvptx") + || cfg.target_triple.contains("uefi") + || cfg.target_triple.contains("xous") + { + println!("cargo:rustc-cfg=feature=\"mem\""); + } + + // These targets have hardware unaligned access support. + let mem_unaligned = cfg.target_arch.contains("x86_64") + || cfg.target_arch.contains("x86") + || cfg.target_arch.contains("aarch64") + || cfg.target_arch.contains("bpf"); + set_cfg("mem_unaligned", mem_unaligned); + + // Only emit the ARM Linux atomic emulation on pre-ARMv6 architectures. This + // includes the old androideabi. It is deprecated but it is available as a + // rustc target (arm-linux-androideabi). + let kernel_user_helpers = llvm_target[0] == "armv4t" + || llvm_target[0] == "armv5te" + || cfg.target_triple == "arm-linux-androideabi"; + set_cfg("kernel_user_helpers", kernel_user_helpers); + + let mut maybe_build_c = true; + + // Emscripten's runtime includes all the builtins + if cfg.target_os == "emscripten" { + maybe_build_c = false; + } + + // OpenBSD provides compiler_rt by default, use it instead of rebuilding it from source + if cfg.target_os == "openbsd" { + println!("cargo:rustc-link-search=native=/usr/lib"); + println!("cargo:rustc-link-lib=compiler_rt"); + maybe_build_c = false; + } + + // Everything is LLVM bitcode, not compatible with mixed C/Rust + if cfg.target_arch.contains("nvptx") { + maybe_build_c = false; + } + + // Build missing intrinsics from compiler-rt C source code. If we're + // mangling names though we assume that we're also in test mode so we don't + // build anything and we rely on the upstream implementation of compiler-rt + // functions + if cfg!(feature = "unmangled-names") && cfg!(feature = "c") && maybe_build_c { + #[cfg(feature = "c")] + c::compile(&cfg); + } +} + +/// Emit directives for features we expect to support that aren't in `Cargo.toml`. +/// +/// These are mostly cfg elements emitted by this `build.rs`. +fn configure_check_cfg() { + // Functions where we can set the "optimized-c" flag + const HAS_OPTIMIZED_C: &[&str] = &[ + "__ashldi3", + "__ashlsi3", + "__ashrdi3", + "__ashrsi3", + "__bswapsi2", + "__bswapdi2", + "__bswapti2", + "__divdi3", + "__divsi3", + "__divmoddi4", + "__divmodsi4", + "__divmodsi4", + "__divmodti4", + "__lshrdi3", + "__lshrsi3", + "__moddi3", + "__modsi3", + "__muldi3", + "__udivdi3", + "__udivmoddi4", + "__udivmodsi4", + "__udivsi3", + "__umoddi3", + "__umodsi3", + ]; + + // Build a list of all aarch64 atomic operation functions + let mut aarch_atomic = Vec::new(); + for aarch_op in ["cas", "ldadd", "ldclr", "ldeor", "ldset", "swp"] { + let op_sizes = if aarch_op == "cas" { + [1, 2, 4, 8, 16].as_slice() + } else { + [1, 2, 4, 8].as_slice() + }; + + for op_size in op_sizes { + for ordering in ["relax", "acq", "rel", "acq_rel"] { + aarch_atomic.push(format!("__aarch64_{aarch_op}{op_size}_{ordering}")); + } + } + } + + for fn_name in HAS_OPTIMIZED_C + .iter() + .copied() + .chain(aarch_atomic.iter().map(|s| s.as_str())) + { + println!("cargo::rustc-check-cfg=cfg({fn_name}, values(\"optimized-c\"))",); + } + + // Rustc is unaware of sparc target features, but this does show up from + // `rustc --print target-features --target sparc64-unknown-linux-gnu`. + println!("cargo::rustc-check-cfg=cfg(target_feature, values(\"vis3\"))"); +} + +#[cfg(feature = "c")] +mod c { + use std::collections::{BTreeMap, HashSet}; + use std::env; + use std::fs::{self, File}; + use std::io::Write; + use std::path::{Path, PathBuf}; + + use super::Config; + + struct Sources { + // SYMBOL -> PATH TO SOURCE + map: BTreeMap<&'static str, &'static str>, + } + + impl Sources { + fn new() -> Sources { + Sources { + map: BTreeMap::new(), + } + } + + fn extend(&mut self, sources: &[(&'static str, &'static str)]) { + // NOTE Some intrinsics have both a generic implementation (e.g. + // `floatdidf.c`) and an arch optimized implementation + // (`x86_64/floatdidf.c`). In those cases, we keep the arch optimized + // implementation and discard the generic implementation. If we don't + // and keep both implementations, the linker will yell at us about + // duplicate symbols! + for (symbol, src) in sources { + if src.contains("/") { + // Arch-optimized implementation (preferred) + self.map.insert(symbol, src); + } else { + // Generic implementation + if !self.map.contains_key(symbol) { + self.map.insert(symbol, src); + } + } + } + } + + fn remove(&mut self, symbols: &[&str]) { + for symbol in symbols { + self.map.remove(*symbol).unwrap(); + } + } + } + + /// Compile intrinsics from the compiler-rt C source code + pub fn compile(cfg: &Config) { + let llvm_target = &cfg.target_triple_split; + let mut consider_float_intrinsics = true; + let build = &mut cc::Build::new(); + + // AArch64 GCCs exit with an error condition when they encounter any kind of floating point + // code if the `nofp` and/or `nosimd` compiler flags have been set. + // + // Therefore, evaluate if those flags are present and set a boolean that causes any + // compiler-rt intrinsics that contain floating point source to be excluded for this target. + if cfg.target_arch == "aarch64" { + let cflags_key = String::from("CFLAGS_") + &(cfg.target_triple.replace("-", "_")); + if let Ok(cflags_value) = env::var(cflags_key) { + if cflags_value.contains("+nofp") || cflags_value.contains("+nosimd") { + consider_float_intrinsics = false; + } + } + } + + // `compiler-rt` requires `COMPILER_RT_HAS_FLOAT16` to be defined to make it use the + // `_Float16` type for `f16` intrinsics. This shouldn't matter as all existing `f16` + // intrinsics have been ported to Rust in `compiler-builtins` as C compilers don't + // support `_Float16` on all targets (whereas Rust does). However, define the macro + // anyway to prevent issues like rust#118813 and rust#123885 silently reoccuring if more + // `f16` intrinsics get accidentally added here in the future. + build.define("COMPILER_RT_HAS_FLOAT16", None); + + build.warnings(false); + + if cfg.target_env == "msvc" { + // Don't pull in extra libraries on MSVC + build.flag("/Zl"); + + // Emulate C99 and C++11's __func__ for MSVC prior to 2013 CTP + build.define("__func__", Some("__FUNCTION__")); + } else { + // Turn off various features of gcc and such, mostly copying + // compiler-rt's build system already + build.flag("-fno-builtin"); + build.flag("-fvisibility=hidden"); + build.flag("-ffreestanding"); + // Avoid the following warning appearing once **per file**: + // clang: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7' [-Wignored-optimization-argument] + // + // Note that compiler-rt's build system also checks + // + // `check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG)` + // + // in https://github.com/rust-lang/compiler-rt/blob/c8fbcb3/cmake/config-ix.cmake#L19. + build.flag_if_supported("-fomit-frame-pointer"); + build.define("VISIBILITY_HIDDEN", None); + + if let "aarch64" | "arm64ec" = cfg.target_arch.as_str() { + // FIXME(llvm20): Older GCCs on A64 fail to build with + // -Werror=implicit-function-declaration due to a compiler-rt bug. + // With a newer LLVM we should be able to enable the flag everywhere. + // https://github.com/llvm/llvm-project/commit/8aa9d6206ce55bdaaf422839c351fbd63f033b89 + } else { + // Avoid implicitly creating references to undefined functions + build.flag("-Werror=implicit-function-declaration"); + } + } + + // int_util.c tries to include stdlib.h if `_WIN32` is defined, + // which it is when compiling UEFI targets with clang. This is + // at odds with compiling with `-ffreestanding`, as the header + // may be incompatible or not present. Create a minimal stub + // header to use instead. + if cfg.target_os == "uefi" { + let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); + let include_dir = out_dir.join("include"); + if !include_dir.exists() { + fs::create_dir(&include_dir).unwrap(); + } + fs::write(include_dir.join("stdlib.h"), "#include ").unwrap(); + build.flag(&format!("-I{}", include_dir.to_str().unwrap())); + } + + let mut sources = Sources::new(); + sources.extend(&[ + ("__absvdi2", "absvdi2.c"), + ("__absvsi2", "absvsi2.c"), + ("__addvdi3", "addvdi3.c"), + ("__addvsi3", "addvsi3.c"), + ("__cmpdi2", "cmpdi2.c"), + ("__int_util", "int_util.c"), + ("__mulvdi3", "mulvdi3.c"), + ("__mulvsi3", "mulvsi3.c"), + ("__negdi2", "negdi2.c"), + ("__negvdi2", "negvdi2.c"), + ("__negvsi2", "negvsi2.c"), + ("__paritydi2", "paritydi2.c"), + ("__paritysi2", "paritysi2.c"), + ("__popcountdi2", "popcountdi2.c"), + ("__popcountsi2", "popcountsi2.c"), + ("__subvdi3", "subvdi3.c"), + ("__subvsi3", "subvsi3.c"), + ("__ucmpdi2", "ucmpdi2.c"), + ]); + + if consider_float_intrinsics { + sources.extend(&[ + ("__divdc3", "divdc3.c"), + ("__divsc3", "divsc3.c"), + ("__muldc3", "muldc3.c"), + ("__mulsc3", "mulsc3.c"), + ("__negdf2", "negdf2.c"), + ("__negsf2", "negsf2.c"), + ]); + } + + // On iOS and 32-bit OSX these are all just empty intrinsics, no need to + // include them. + if cfg.target_vendor != "apple" || cfg.target_arch != "x86" { + sources.extend(&[ + ("__absvti2", "absvti2.c"), + ("__addvti3", "addvti3.c"), + ("__cmpti2", "cmpti2.c"), + ("__ffsti2", "ffsti2.c"), + ("__mulvti3", "mulvti3.c"), + ("__negti2", "negti2.c"), + ("__parityti2", "parityti2.c"), + ("__popcountti2", "popcountti2.c"), + ("__subvti3", "subvti3.c"), + ("__ucmpti2", "ucmpti2.c"), + ]); + + if consider_float_intrinsics { + sources.extend(&[("__negvti2", "negvti2.c")]); + } + } + + if cfg.target_vendor == "apple" { + sources.extend(&[ + ("atomic_flag_clear", "atomic_flag_clear.c"), + ("atomic_flag_clear_explicit", "atomic_flag_clear_explicit.c"), + ("atomic_flag_test_and_set", "atomic_flag_test_and_set.c"), + ( + "atomic_flag_test_and_set_explicit", + "atomic_flag_test_and_set_explicit.c", + ), + ("atomic_signal_fence", "atomic_signal_fence.c"), + ("atomic_thread_fence", "atomic_thread_fence.c"), + ]); + } + + if cfg.target_env != "msvc" { + if cfg.target_arch == "x86" { + sources.extend(&[ + ("__ashldi3", "i386/ashldi3.S"), + ("__ashrdi3", "i386/ashrdi3.S"), + ("__divdi3", "i386/divdi3.S"), + ("__lshrdi3", "i386/lshrdi3.S"), + ("__moddi3", "i386/moddi3.S"), + ("__muldi3", "i386/muldi3.S"), + ("__udivdi3", "i386/udivdi3.S"), + ("__umoddi3", "i386/umoddi3.S"), + ]); + } + } + + if cfg.target_arch == "arm" && cfg.target_vendor != "apple" && cfg.target_env != "msvc" { + sources.extend(&[ + ("__aeabi_div0", "arm/aeabi_div0.c"), + ("__aeabi_drsub", "arm/aeabi_drsub.c"), + ("__aeabi_frsub", "arm/aeabi_frsub.c"), + ("__bswapdi2", "arm/bswapdi2.S"), + ("__bswapsi2", "arm/bswapsi2.S"), + ("__divmodsi4", "arm/divmodsi4.S"), + ("__divsi3", "arm/divsi3.S"), + ("__modsi3", "arm/modsi3.S"), + ("__switch16", "arm/switch16.S"), + ("__switch32", "arm/switch32.S"), + ("__switch8", "arm/switch8.S"), + ("__switchu8", "arm/switchu8.S"), + ("__sync_synchronize", "arm/sync_synchronize.S"), + ("__udivmodsi4", "arm/udivmodsi4.S"), + ("__udivsi3", "arm/udivsi3.S"), + ("__umodsi3", "arm/umodsi3.S"), + ]); + + if cfg.target_os == "freebsd" { + sources.extend(&[("__clear_cache", "clear_cache.c")]); + } + + // First of all aeabi_cdcmp and aeabi_cfcmp are never called by LLVM. + // Second are little-endian only, so build fail on big-endian targets. + // Temporally workaround: exclude these files for big-endian targets. + if !llvm_target[0].starts_with("thumbeb") && !llvm_target[0].starts_with("armeb") { + sources.extend(&[ + ("__aeabi_cdcmp", "arm/aeabi_cdcmp.S"), + ("__aeabi_cdcmpeq_check_nan", "arm/aeabi_cdcmpeq_check_nan.c"), + ("__aeabi_cfcmp", "arm/aeabi_cfcmp.S"), + ("__aeabi_cfcmpeq_check_nan", "arm/aeabi_cfcmpeq_check_nan.c"), + ]); + } + } + + if llvm_target[0] == "armv7" { + sources.extend(&[ + ("__sync_fetch_and_add_4", "arm/sync_fetch_and_add_4.S"), + ("__sync_fetch_and_add_8", "arm/sync_fetch_and_add_8.S"), + ("__sync_fetch_and_and_4", "arm/sync_fetch_and_and_4.S"), + ("__sync_fetch_and_and_8", "arm/sync_fetch_and_and_8.S"), + ("__sync_fetch_and_max_4", "arm/sync_fetch_and_max_4.S"), + ("__sync_fetch_and_max_8", "arm/sync_fetch_and_max_8.S"), + ("__sync_fetch_and_min_4", "arm/sync_fetch_and_min_4.S"), + ("__sync_fetch_and_min_8", "arm/sync_fetch_and_min_8.S"), + ("__sync_fetch_and_nand_4", "arm/sync_fetch_and_nand_4.S"), + ("__sync_fetch_and_nand_8", "arm/sync_fetch_and_nand_8.S"), + ("__sync_fetch_and_or_4", "arm/sync_fetch_and_or_4.S"), + ("__sync_fetch_and_or_8", "arm/sync_fetch_and_or_8.S"), + ("__sync_fetch_and_sub_4", "arm/sync_fetch_and_sub_4.S"), + ("__sync_fetch_and_sub_8", "arm/sync_fetch_and_sub_8.S"), + ("__sync_fetch_and_umax_4", "arm/sync_fetch_and_umax_4.S"), + ("__sync_fetch_and_umax_8", "arm/sync_fetch_and_umax_8.S"), + ("__sync_fetch_and_umin_4", "arm/sync_fetch_and_umin_4.S"), + ("__sync_fetch_and_umin_8", "arm/sync_fetch_and_umin_8.S"), + ("__sync_fetch_and_xor_4", "arm/sync_fetch_and_xor_4.S"), + ("__sync_fetch_and_xor_8", "arm/sync_fetch_and_xor_8.S"), + ]); + } + + if llvm_target.last().unwrap().ends_with("eabihf") { + if !llvm_target[0].starts_with("thumbv7em") + && !llvm_target[0].starts_with("thumbv8m.main") + { + // The FPU option chosen for these architectures in cc-rs, ie: + // -mfpu=fpv4-sp-d16 for thumbv7em + // -mfpu=fpv5-sp-d16 for thumbv8m.main + // do not support double precision floating points conversions so the files + // that include such instructions are not included for these targets. + sources.extend(&[ + ("__fixdfsivfp", "arm/fixdfsivfp.S"), + ("__fixunsdfsivfp", "arm/fixunsdfsivfp.S"), + ("__floatsidfvfp", "arm/floatsidfvfp.S"), + ("__floatunssidfvfp", "arm/floatunssidfvfp.S"), + ]); + } + + sources.extend(&[ + ("__fixsfsivfp", "arm/fixsfsivfp.S"), + ("__fixunssfsivfp", "arm/fixunssfsivfp.S"), + ("__floatsisfvfp", "arm/floatsisfvfp.S"), + ("__floatunssisfvfp", "arm/floatunssisfvfp.S"), + ("__floatunssisfvfp", "arm/floatunssisfvfp.S"), + ("__restore_vfp_d8_d15_regs", "arm/restore_vfp_d8_d15_regs.S"), + ("__save_vfp_d8_d15_regs", "arm/save_vfp_d8_d15_regs.S"), + ("__negdf2vfp", "arm/negdf2vfp.S"), + ("__negsf2vfp", "arm/negsf2vfp.S"), + ]); + } + + if (cfg.target_arch == "aarch64" || cfg.target_arch == "arm64ec") + && consider_float_intrinsics + { + sources.extend(&[ + ("__fe_getround", "fp_mode.c"), + ("__fe_raise_inexact", "fp_mode.c"), + ]); + + if cfg.target_os != "windows" && cfg.target_os != "cygwin" { + sources.extend(&[("__multc3", "multc3.c")]); + } + } + + if cfg.target_arch == "mips" || cfg.target_arch == "riscv32" || cfg.target_arch == "riscv64" + { + sources.extend(&[("__bswapsi2", "bswapsi2.c")]); + } + + if cfg.target_arch == "mips64" { + sources.extend(&[("__fe_getround", "fp_mode.c")]); + } + + if cfg.target_arch == "loongarch64" { + sources.extend(&[("__fe_getround", "fp_mode.c")]); + } + + // Remove the assembly implementations that won't compile for the target + if llvm_target[0] == "thumbv6m" + || llvm_target[0] == "thumbv8m.base" + || cfg.target_os == "uefi" + { + let mut to_remove = Vec::new(); + for (k, v) in sources.map.iter() { + if v.ends_with(".S") { + to_remove.push(*k); + } + } + sources.remove(&to_remove); + } + + if llvm_target[0] == "thumbv7m" || llvm_target[0] == "thumbv7em" { + sources.remove(&["__aeabi_cdcmp", "__aeabi_cfcmp"]); + } + + // Android and Cygwin uses emulated TLS so we need a runtime support function. + if cfg.target_os == "android" || cfg.target_os == "cygwin" { + sources.extend(&[("__emutls_get_address", "emutls.c")]); + } + + // Work around a bug in the NDK headers (fixed in + // https://r.android.com/2038949 which will be released in a future + // NDK version) by providing a definition of LONG_BIT. + if cfg.target_os == "android" { + build.define("LONG_BIT", "(8 * sizeof(long))"); + } + + // OpenHarmony also uses emulated TLS. + if cfg.target_env == "ohos" { + sources.extend(&[("__emutls_get_address", "emutls.c")]); + } + + // Optionally, link against a prebuilt llvm compiler-rt containing the builtins + // library. Only the builtins library is required. On many platforms, this is + // available as a library named libclang_rt.builtins.a. + let link_against_prebuilt_rt = env::var_os("LLVM_COMPILER_RT_LIB").is_some(); + + // When compiling the C code we require the user to tell us where the + // source code is, and this is largely done so when we're compiling as + // part of rust-lang/rust we can use the same llvm-project repository as + // rust-lang/rust. + let root = match env::var_os("RUST_COMPILER_RT_ROOT") { + Some(s) => PathBuf::from(s), + // If a prebuild libcompiler-rt is provided, set a valid + // path to simplify later logic. Nothing should be compiled. + None if link_against_prebuilt_rt => PathBuf::new(), + None => { + panic!( + "RUST_COMPILER_RT_ROOT is not set. You may need to run \ + `ci/download-compiler-rt.sh`." + ); + } + }; + if !link_against_prebuilt_rt && !root.exists() { + panic!("RUST_COMPILER_RT_ROOT={} does not exist", root.display()); + } + + // Support deterministic builds by remapping the __FILE__ prefix if the + // compiler supports it. This fixes the nondeterminism caused by the + // use of that macro in lib/builtins/int_util.h in compiler-rt. + build.flag_if_supported(&format!("-ffile-prefix-map={}=.", root.display())); + + // Include out-of-line atomics for aarch64, which are all generated by supplying different + // sets of flags to the same source file. + // Note: Out-of-line aarch64 atomics are not supported by the msvc toolchain (#430) and + // on uefi. + let src_dir = root.join("lib/builtins"); + if cfg.target_arch == "aarch64" && cfg.target_env != "msvc" && cfg.target_os != "uefi" { + // See below for why we're building these as separate libraries. + build_aarch64_out_of_line_atomics_libraries(&src_dir, build, link_against_prebuilt_rt); + + // Some run-time CPU feature detection is necessary, as well. + let cpu_model_src = if src_dir.join("cpu_model.c").exists() { + "cpu_model.c" + } else { + "cpu_model/aarch64.c" + }; + sources.extend(&[("__aarch64_have_lse_atomics", cpu_model_src)]); + } + + let mut added_sources = HashSet::new(); + for (sym, src) in sources.map.iter() { + let src = src_dir.join(src); + if !link_against_prebuilt_rt && added_sources.insert(src.clone()) { + build.file(&src); + println!("cargo:rerun-if-changed={}", src.display()); + } + println!("cargo:rustc-cfg={}=\"optimized-c\"", sym); + } + + if link_against_prebuilt_rt { + let rt_builtins_ext = PathBuf::from(env::var_os("LLVM_COMPILER_RT_LIB").unwrap()); + if !rt_builtins_ext.exists() { + panic!( + "LLVM_COMPILER_RT_LIB={} does not exist", + rt_builtins_ext.display() + ); + } + if let Some(dir) = rt_builtins_ext.parent() { + println!("cargo::rustc-link-search=native={}", dir.display()); + } + if let Some(lib) = rt_builtins_ext.file_name() { + println!( + "cargo::rustc-link-lib=static:+verbatim={}", + lib.to_str().unwrap() + ); + } + } else { + build.compile("libcompiler-rt.a"); + } + } + + fn build_aarch64_out_of_line_atomics_libraries( + builtins_dir: &Path, + cfg: &mut cc::Build, + link_against_prebuilt_rt: bool, + ) { + let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); + let outlined_atomics_file = builtins_dir.join("aarch64").join("lse.S"); + if !link_against_prebuilt_rt { + println!("cargo:rerun-if-changed={}", outlined_atomics_file.display()); + } + + cfg.include(&builtins_dir); + + for instruction_type in &["cas", "swp", "ldadd", "ldclr", "ldeor", "ldset"] { + for size in &[1, 2, 4, 8, 16] { + if *size == 16 && *instruction_type != "cas" { + continue; + } + + for (model_number, model_name) in + &[(1, "relax"), (2, "acq"), (3, "rel"), (4, "acq_rel")] + { + let sym = format!("__aarch64_{}{}_{}", instruction_type, size, model_name); + println!("cargo:rustc-cfg={}=\"optimized-c\"", sym); + + if link_against_prebuilt_rt { + continue; + } + + // The original compiler-rt build system compiles the same + // source file multiple times with different compiler + // options. Here we do something slightly different: we + // create multiple .S files with the proper #defines and + // then include the original file. + // + // This is needed because the cc crate doesn't allow us to + // override the name of object files and libtool requires + // all objects in an archive to have unique names. + let path = + out_dir.join(format!("lse_{}{}_{}.S", instruction_type, size, model_name)); + let mut file = File::create(&path).unwrap(); + writeln!(file, "#define L_{}", instruction_type).unwrap(); + writeln!(file, "#define SIZE {}", size).unwrap(); + writeln!(file, "#define MODEL {}", model_number).unwrap(); + writeln!( + file, + "#include \"{}\"", + outlined_atomics_file.canonicalize().unwrap().display() + ) + .unwrap(); + drop(file); + cfg.file(path); + } + } + } + } +} diff --git a/ci/licenses/rust-compiler-originals/compiler-builtins-float-conv.rs.txt b/ci/licenses/rust-compiler-originals/compiler-builtins-float-conv.rs.txt new file mode 100644 index 0000000..6193aa4 --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-builtins-float-conv.rs.txt @@ -0,0 +1,508 @@ +use core::ops::Neg; + +use crate::support::{CastFrom, CastInto, Float, Int, MinInt}; + +/// Conversions from integers to floats. +/// +/// The algorithm is explained here: . It roughly does the following: +/// - Calculate a base mantissa by shifting the integer into mantissa position. This gives us a +/// mantissa _with the implicit bit set_! +/// - Figure out if rounding needs to occur by classifying the bits that are to be truncated. Some +/// patterns are used to simplify this. Adjust the mantissa with the result if needed. +/// - Calculate the exponent based on the base-2 logarithm of `i` (leading zeros). Subtract one. +/// - Shift the exponent and add the mantissa to create the final representation. Subtracting one +/// from the exponent (above) accounts for the explicit bit being set in the mantissa. +/// +/// # Terminology +/// +/// - `i`: the original integer +/// - `i_m`: the integer, shifted fully left (no leading zeros) +/// - `n`: number of leading zeroes +/// - `e`: the resulting exponent. Usually 1 is subtracted to offset the mantissa implicit bit. +/// - `m_base`: the mantissa before adjusting for truncated bits. Implicit bit is usually set. +/// - `adj`: the bits that will be truncated, possibly compressed in some way. +/// - `m`: the resulting mantissa. Implicit bit is usually set. +mod int_to_float { + use super::*; + + /// Calculate the exponent from the number of leading zeros. + /// + /// Usually 1 is subtracted from this function's result, so that a mantissa with the implicit + /// bit set can be added back later. + fn exp>>(n: u32) -> F::Int { + F::Int::cast_from(F::EXP_BIAS - 1 + I::BITS - n) + } + + /// Adjust a mantissa with dropped bits to perform correct rounding. + /// + /// The dropped bits should be exactly the bits that get truncated (left-aligned), but they + /// can be combined or compressed in some way that simplifies operations. + fn m_adj(m_base: F::Int, dropped_bits: F::Int) -> F::Int { + // Branchlessly extract a `1` if rounding up should happen, 0 otherwise + // This accounts for rounding to even. + let adj = (dropped_bits - ((dropped_bits >> (F::BITS - 1)) & !m_base)) >> (F::BITS - 1); + + // Add one when we need to round up. Break ties to even. + m_base + adj + } + + /// Shift the exponent to its position and add the mantissa. + /// + /// If the mantissa has the implicit bit set, the exponent should be one less than its actual + /// value to cancel it out. + fn repr(e: F::Int, m: F::Int) -> F::Int { + // + rather than | so the mantissa can overflow into the exponent + (e << F::SIG_BITS) + m + } + + /// Shift distance from a left-aligned integer to a smaller float. + fn shift_f_lt_i() -> u32 { + (I::BITS - F::BITS) + F::EXP_BITS + } + + /// Shift distance from an integer with `n` leading zeros to a smaller float. + fn shift_f_gt_i(n: u32) -> u32 { + F::SIG_BITS - I::BITS + 1 + n + } + + /// Perform a signed operation as unsigned, then add the sign back. + pub fn signed(i: I, conv: Conv) -> F + where + F: Float, + I: Int, + F::Int: CastFrom, + Conv: Fn(I::Unsigned) -> F::Int, + { + let sign_bit = F::Int::cast_from_lossy(i >> (I::BITS - 1)) << (F::BITS - 1); + F::from_bits(conv(i.unsigned_abs()) | sign_bit) + } + + pub fn u32_to_f32_bits(i: u32) -> u32 { + if i == 0 { + return 0; + } + let n = i.leading_zeros(); + // Mantissa with implicit bit set (significant bits) + let m_base = (i << n) >> f32::EXP_BITS; + // Bits that will be dropped (insignificant bits) + let adj = (i << n) << (f32::SIG_BITS + 1); + let m = m_adj::(m_base, adj); + let e = exp::(n) - 1; + repr::(e, m) + } + + pub fn u32_to_f64_bits(i: u32) -> u64 { + if i == 0 { + return 0; + } + let n = i.leading_zeros(); + // Mantissa with implicit bit set + let m = (i as u64) << shift_f_gt_i::(n); + let e = exp::(n) - 1; + repr::(e, m) + } + + #[cfg(f128_enabled)] + pub fn u32_to_f128_bits(i: u32) -> u128 { + if i == 0 { + return 0; + } + let n = i.leading_zeros(); + + // Shift into mantissa position that is correct for the type, but shifted into the lower + // 64 bits over so can can avoid 128-bit math. + let m = (i as u64) << (shift_f_gt_i::(n) - 64); + let e = exp::(n) as u64 - 1; + // High 64 bits of f128 representation. + let h = (e << (f128::SIG_BITS - 64)) + m; + + // Shift back to the high bits, the rest of the mantissa will always be 0. + (h as u128) << 64 + } + + pub fn u64_to_f32_bits(i: u64) -> u32 { + let n = i.leading_zeros(); + let i_m = i.wrapping_shl(n); + // Mantissa with implicit bit set + let m_base: u32 = (i_m >> shift_f_lt_i::()) as u32; + // The entire lower half of `i` will be truncated (masked portion), plus the + // next `EXP_BITS` bits. + let adj = ((i_m >> f32::EXP_BITS) | i_m & 0xFFFF) as u32; + let m = m_adj::(m_base, adj); + let e = if i == 0 { 0 } else { exp::(n) - 1 }; + repr::(e, m) + } + + pub fn u64_to_f64_bits(i: u64) -> u64 { + if i == 0 { + return 0; + } + let n = i.leading_zeros(); + // Mantissa with implicit bit set + let m_base = (i << n) >> f64::EXP_BITS; + let adj = (i << n) << (f64::SIG_BITS + 1); + let m = m_adj::(m_base, adj); + let e = exp::(n) - 1; + repr::(e, m) + } + + #[cfg(f128_enabled)] + pub fn u64_to_f128_bits(i: u64) -> u128 { + if i == 0 { + return 0; + } + let n = i.leading_zeros(); + // Mantissa with implicit bit set + let m = (i as u128) << shift_f_gt_i::(n); + let e = exp::(n) - 1; + repr::(e, m) + } + + pub fn u128_to_f32_bits(i: u128) -> u32 { + let n = i.leading_zeros(); + let i_m = i.wrapping_shl(n); // Mantissa, shifted so the first bit is nonzero + let m_base: u32 = (i_m >> shift_f_lt_i::()) as u32; + + // Within the upper `F::BITS`, everything except for the signifcand + // gets truncated + let d1: u32 = (i_m >> (u128::BITS - f32::BITS - f32::SIG_BITS - 1)).cast_lossy(); + + // The entire rest of `i_m` gets truncated. Zero the upper `F::BITS` then just + // check if it is nonzero. + let d2: u32 = (i_m << f32::BITS >> f32::BITS != 0).into(); + let adj = d1 | d2; + + // Mantissa with implicit bit set + let m = m_adj::(m_base, adj); + let e = if i == 0 { 0 } else { exp::(n) - 1 }; + repr::(e, m) + } + + pub fn u128_to_f64_bits(i: u128) -> u64 { + let n = i.leading_zeros(); + let i_m = i.wrapping_shl(n); + // Mantissa with implicit bit set + let m_base: u64 = (i_m >> shift_f_lt_i::()) as u64; + // The entire lower half of `i` will be truncated (masked portion), plus the + // next `EXP_BITS` bits. + let adj = ((i_m >> f64::EXP_BITS) | i_m & 0xFFFF_FFFF) as u64; + let m = m_adj::(m_base, adj); + let e = if i == 0 { 0 } else { exp::(n) - 1 }; + repr::(e, m) + } + + #[cfg(f128_enabled)] + pub fn u128_to_f128_bits(i: u128) -> u128 { + if i == 0 { + return 0; + } + let n = i.leading_zeros(); + // Mantissa with implicit bit set + let m_base = (i << n) >> f128::EXP_BITS; + let adj = (i << n) << (f128::SIG_BITS + 1); + let m = m_adj::(m_base, adj); + let e = exp::(n) - 1; + repr::(e, m) + } +} + +// Conversions from unsigned integers to floats. +intrinsics! { + #[arm_aeabi_alias = __aeabi_ui2f] + pub extern "C" fn __floatunsisf(i: u32) -> f32 { + f32::from_bits(int_to_float::u32_to_f32_bits(i)) + } + + #[arm_aeabi_alias = __aeabi_ui2d] + pub extern "C" fn __floatunsidf(i: u32) -> f64 { + f64::from_bits(int_to_float::u32_to_f64_bits(i)) + } + + #[arm_aeabi_alias = __aeabi_ul2f] + pub extern "C" fn __floatundisf(i: u64) -> f32 { + f32::from_bits(int_to_float::u64_to_f32_bits(i)) + } + + #[arm_aeabi_alias = __aeabi_ul2d] + pub extern "C" fn __floatundidf(i: u64) -> f64 { + f64::from_bits(int_to_float::u64_to_f64_bits(i)) + } + + #[cfg(not(all(target_os = "uefi", target_arch = "x86_64")))] + pub extern "C" fn __floatuntisf(i: u128) -> f32 { + f32::from_bits(int_to_float::u128_to_f32_bits(i)) + } + + #[cfg(all(target_os = "uefi", target_arch = "x86_64"))] + pub extern "C" fn __floatuntisf(lo: u64, hi: u64) -> f32 { + f32::from_bits(int_to_float::u128_to_f32_bits((u128::from(hi) << 64) | u128::from(lo))) + } + + #[cfg(not(all(target_os = "uefi", target_arch = "x86_64")))] + pub extern "C" fn __floatuntidf(i: u128) -> f64 { + f64::from_bits(int_to_float::u128_to_f64_bits(i)) + } + + #[cfg(all(target_os = "uefi", target_arch = "x86_64"))] + pub extern "C" fn __floatuntidf(lo: u64, hi: u64) -> f64 { + f64::from_bits(int_to_float::u128_to_f64_bits((u128::from(hi) << 64) | u128::from(lo))) + } + + #[ppc_alias = __floatunsikf] + #[cfg(f128_enabled)] + pub extern "C" fn __floatunsitf(i: u32) -> f128 { + f128::from_bits(int_to_float::u32_to_f128_bits(i)) + } + + #[ppc_alias = __floatundikf] + #[cfg(f128_enabled)] + pub extern "C" fn __floatunditf(i: u64) -> f128 { + f128::from_bits(int_to_float::u64_to_f128_bits(i)) + } + + #[ppc_alias = __floatuntikf] + #[cfg(f128_enabled)] + pub extern "C" fn __floatuntitf(i: u128) -> f128 { + f128::from_bits(int_to_float::u128_to_f128_bits(i)) + } +} + +// Conversions from signed integers to floats. +intrinsics! { + #[arm_aeabi_alias = __aeabi_i2f] + pub extern "C" fn __floatsisf(i: i32) -> f32 { + int_to_float::signed(i, int_to_float::u32_to_f32_bits) + } + + #[arm_aeabi_alias = __aeabi_i2d] + pub extern "C" fn __floatsidf(i: i32) -> f64 { + int_to_float::signed(i, int_to_float::u32_to_f64_bits) + } + + #[arm_aeabi_alias = __aeabi_l2f] + pub extern "C" fn __floatdisf(i: i64) -> f32 { + int_to_float::signed(i, int_to_float::u64_to_f32_bits) + } + + #[arm_aeabi_alias = __aeabi_l2d] + pub extern "C" fn __floatdidf(i: i64) -> f64 { + int_to_float::signed(i, int_to_float::u64_to_f64_bits) + } + + #[cfg(not(all(target_os = "uefi", target_arch = "x86_64")))] + pub extern "C" fn __floattisf(i: i128) -> f32 { + int_to_float::signed(i, int_to_float::u128_to_f32_bits) + } + + #[cfg(all(target_os = "uefi", target_arch = "x86_64"))] + pub extern "C" fn __floattisf(lo: u64, hi: u64) -> f32 { + int_to_float::signed((i128::from(hi) << 64) | i128::from(lo), int_to_float::u128_to_f32_bits) + } + + #[cfg(not(all(target_os = "uefi", target_arch = "x86_64")))] + pub extern "C" fn __floattidf(i: i128) -> f64 { + int_to_float::signed(i, int_to_float::u128_to_f64_bits) + } + + #[cfg(all(target_os = "uefi", target_arch = "x86_64"))] + pub extern "C" fn __floattidf(lo: u64, hi: u64) -> f64 { + int_to_float::signed((i128::from(hi) << 64) | i128::from(lo), int_to_float::u128_to_f64_bits) + } + + #[ppc_alias = __floatsikf] + #[cfg(f128_enabled)] + pub extern "C" fn __floatsitf(i: i32) -> f128 { + int_to_float::signed(i, int_to_float::u32_to_f128_bits) + } + + #[ppc_alias = __floatdikf] + #[cfg(f128_enabled)] + pub extern "C" fn __floatditf(i: i64) -> f128 { + int_to_float::signed(i, int_to_float::u64_to_f128_bits) + } + + #[ppc_alias = __floattikf] + #[cfg(f128_enabled)] + pub extern "C" fn __floattitf(i: i128) -> f128 { + int_to_float::signed(i, int_to_float::u128_to_f128_bits) + } +} + +/// Generic float to unsigned int conversions. +fn float_to_unsigned_int(f: F) -> U +where + F: Float, + U: Int, + F::Int: CastInto, + F::Int: CastFrom, + F::Int: CastInto, + u32: CastFrom, +{ + float_to_int_inner::(f.to_bits(), |i: U| i, || U::MAX) +} + +/// Generic float to signed int conversions. +fn float_to_signed_int(f: F) -> I +where + F: Float, + I: Int + Neg, + I::Unsigned: Int, + F::Int: CastInto, + F::Int: CastFrom, + u32: CastFrom, +{ + float_to_int_inner::( + f.to_bits() & !F::SIGN_MASK, + |i: I| if f.is_sign_negative() { -i } else { i }, + || if f.is_sign_negative() { I::MIN } else { I::MAX }, + ) +} + +/// Float to int conversions, generic for both signed and unsigned. +/// +/// Parameters: +/// - `fbits`: `abg(f)` bitcasted to an integer. +/// - `map_inbounds`: apply this transformation to integers that are within range (add the sign back). +/// - `out_of_bounds`: return value when out of range for `I`. +fn float_to_int_inner( + fbits: F::Int, + map_inbounds: FnFoo, + out_of_bounds: FnOob, +) -> I +where + F: Float, + I: Int, + FnFoo: FnOnce(I) -> I, + FnOob: FnOnce() -> I, + I::Unsigned: Int, + F::Int: CastInto, + F::Int: CastFrom, + u32: CastFrom, +{ + let int_max_exp = F::EXP_BIAS + I::MAX.ilog2() + 1; + let foobar = F::EXP_BIAS + I::Unsigned::BITS - 1; + + if fbits < F::ONE.to_bits() { + // < 0 gets rounded to 0 + I::ZERO + } else if fbits < F::Int::cast_from(int_max_exp) << F::SIG_BITS { + // >= 1, < integer max + let m_base = if I::Unsigned::BITS >= F::Int::BITS { + I::Unsigned::cast_from(fbits) << (I::BITS - F::SIG_BITS - 1) + } else { + I::Unsigned::cast_from_lossy(fbits >> (F::SIG_BITS - I::BITS + 1)) + }; + + // Set the implicit 1-bit. + let m: I::Unsigned = (I::Unsigned::ONE << (I::BITS - 1)) | m_base; + + // Shift based on the exponent and bias. + let s: u32 = (foobar) - u32::cast_from(fbits >> F::SIG_BITS); + + let unsigned = m >> s; + map_inbounds(I::from_unsigned(unsigned)) + } else if fbits <= F::EXP_MASK { + // >= max (incl. inf) + out_of_bounds() + } else { + I::ZERO + } +} + +// Conversions from floats to unsigned integers. +intrinsics! { + #[arm_aeabi_alias = __aeabi_f2uiz] + pub extern "C" fn __fixunssfsi(f: f32) -> u32 { + float_to_unsigned_int(f) + } + + #[arm_aeabi_alias = __aeabi_f2ulz] + pub extern "C" fn __fixunssfdi(f: f32) -> u64 { + float_to_unsigned_int(f) + } + + pub extern "C" fn __fixunssfti(f: f32) -> u128 { + float_to_unsigned_int(f) + } + + #[arm_aeabi_alias = __aeabi_d2uiz] + pub extern "C" fn __fixunsdfsi(f: f64) -> u32 { + float_to_unsigned_int(f) + } + + #[arm_aeabi_alias = __aeabi_d2ulz] + pub extern "C" fn __fixunsdfdi(f: f64) -> u64 { + float_to_unsigned_int(f) + } + + pub extern "C" fn __fixunsdfti(f: f64) -> u128 { + float_to_unsigned_int(f) + } + + #[ppc_alias = __fixunskfsi] + #[cfg(f128_enabled)] + pub extern "C" fn __fixunstfsi(f: f128) -> u32 { + float_to_unsigned_int(f) + } + + #[ppc_alias = __fixunskfdi] + #[cfg(f128_enabled)] + pub extern "C" fn __fixunstfdi(f: f128) -> u64 { + float_to_unsigned_int(f) + } + + #[ppc_alias = __fixunskfti] + #[cfg(f128_enabled)] + pub extern "C" fn __fixunstfti(f: f128) -> u128 { + float_to_unsigned_int(f) + } +} + +// Conversions from floats to signed integers. +intrinsics! { + #[arm_aeabi_alias = __aeabi_f2iz] + pub extern "C" fn __fixsfsi(f: f32) -> i32 { + float_to_signed_int(f) + } + + #[arm_aeabi_alias = __aeabi_f2lz] + pub extern "C" fn __fixsfdi(f: f32) -> i64 { + float_to_signed_int(f) + } + + pub extern "C" fn __fixsfti(f: f32) -> i128 { + float_to_signed_int(f) + } + + #[arm_aeabi_alias = __aeabi_d2iz] + pub extern "C" fn __fixdfsi(f: f64) -> i32 { + float_to_signed_int(f) + } + + #[arm_aeabi_alias = __aeabi_d2lz] + pub extern "C" fn __fixdfdi(f: f64) -> i64 { + float_to_signed_int(f) + } + + pub extern "C" fn __fixdfti(f: f64) -> i128 { + float_to_signed_int(f) + } + + #[ppc_alias = __fixkfsi] + #[cfg(f128_enabled)] + pub extern "C" fn __fixtfsi(f: f128) -> i32 { + float_to_signed_int(f) + } + + #[ppc_alias = __fixkfdi] + #[cfg(f128_enabled)] + pub extern "C" fn __fixtfdi(f: f128) -> i64 { + float_to_signed_int(f) + } + + #[ppc_alias = __fixkfti] + #[cfg(f128_enabled)] + pub extern "C" fn __fixtfti(f: f128) -> i128 { + float_to_signed_int(f) + } +} diff --git a/ci/licenses/rust-compiler-originals/compiler-builtins-math-mod.rs.txt b/ci/licenses/rust-compiler-originals/compiler-builtins-math-mod.rs.txt new file mode 100644 index 0000000..3dfa386 --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-builtins-math-mod.rs.txt @@ -0,0 +1,211 @@ +#[rustfmt::skip] +#[allow(dead_code)] +#[allow(unused_imports)] +#[allow(clippy::all)] +#[path = "../../../libm/src/math/mod.rs"] +pub(crate) mod libm_math; + +macro_rules! libm_intrinsics { + ($(fn $fun:ident($($iid:ident : $ity:ty),+) -> $oty:ty;)+) => { + intrinsics! { + $( + pub extern "C" fn $fun($($iid: $ity),+) -> $oty { + $crate::math::libm_math::$fun($($iid),+) + } + )+ + } + } +} + +/// This set of functions is well tested in `libm` and known to provide similar performance to +/// system `libm`, as well as the same or better accuracy. +pub mod full_availability { + #[cfg(f16_enabled)] + libm_intrinsics! { + fn ceilf16(x: f16) -> f16; + fn copysignf16(x: f16, y: f16) -> f16; + fn fabsf16(x: f16) -> f16; + fn fdimf16(x: f16, y: f16) -> f16; + fn floorf16(x: f16) -> f16; + fn fmaxf16(x: f16, y: f16) -> f16; + fn fmaximum_numf16(x: f16, y: f16) -> f16; + fn fmaximumf16(x: f16, y: f16) -> f16; + fn fminf16(x: f16, y: f16) -> f16; + fn fminimum_numf16(x: f16, y: f16) -> f16; + fn fminimumf16(x: f16, y: f16) -> f16; + fn fmodf16(x: f16, y: f16) -> f16; + fn rintf16(x: f16) -> f16; + fn roundevenf16(x: f16) -> f16; + fn roundf16(x: f16) -> f16; + fn sqrtf16(x: f16) -> f16; + fn truncf16(x: f16) -> f16; + } + + /* Weak linkage is unreliable on Windows and Apple, so we don't expose symbols that we know + * the system libc provides in order to avoid conflicts. */ + + #[cfg(all(not(windows), not(target_vendor = "apple")))] + libm_intrinsics! { + /* f32 */ + fn cbrtf(n: f32) -> f32; + fn ceilf(x: f32) -> f32; + fn copysignf(x: f32, y: f32) -> f32; + fn fabsf(x: f32) -> f32; + fn fdimf(a: f32, b: f32) -> f32; + fn floorf(x: f32) -> f32; + fn fmaf(x: f32, y: f32, z: f32) -> f32; + fn fmaxf(x: f32, y: f32) -> f32; + fn fminf(x: f32, y: f32) -> f32; + fn fmodf(x: f32, y: f32) -> f32; + fn rintf(x: f32) -> f32; + fn roundf(x: f32) -> f32; + fn sqrtf(x: f32) -> f32; + fn truncf(x: f32) -> f32; + + /* f64 */ + fn cbrt(x: f64) -> f64; + fn ceil(x: f64) -> f64; + fn copysign(x: f64, y: f64) -> f64; + fn fabs(x: f64) -> f64; + fn fdim(a: f64, b: f64) -> f64; + fn floor(x: f64) -> f64; + fn fma(x: f64, y: f64, z: f64) -> f64; + fn fmax(x: f64, y: f64) -> f64; + fn fmin(x: f64, y: f64) -> f64; + fn fmod(x: f64, y: f64) -> f64; + fn rint(x: f64) -> f64; + fn round(x: f64) -> f64; + fn sqrt(x: f64) -> f64; + fn trunc(x: f64) -> f64; + } + + // Windows and MacOS do not yet expose roundeven and IEEE 754-2019 `maximum` / `minimum`, + // however, so we still provide a fallback. + libm_intrinsics! { + fn fmaximum(x: f64, y: f64) -> f64; + fn fmaximum_num(x: f64, y: f64) -> f64; + fn fmaximum_numf(x: f32, y: f32) -> f32; + fn fmaximumf(x: f32, y: f32) -> f32; + fn fminimum(x: f64, y: f64) -> f64; + fn fminimum_num(x: f64, y: f64) -> f64; + fn fminimum_numf(x: f32, y: f32) -> f32; + fn fminimumf(x: f32, y: f32) -> f32; + fn roundeven(x: f64) -> f64; + fn roundevenf(x: f32) -> f32; + } + + #[cfg(f128_enabled)] + libm_intrinsics! { + fn ceilf128(x: f128) -> f128; + fn copysignf128(x: f128, y: f128) -> f128; + fn fabsf128(x: f128) -> f128; + fn fdimf128(x: f128, y: f128) -> f128; + fn floorf128(x: f128) -> f128; + fn fmaf128(x: f128, y: f128, z: f128) -> f128; + fn fmaxf128(x: f128, y: f128) -> f128; + fn fmaximum_numf128(x: f128, y: f128) -> f128; + fn fmaximumf128(x: f128, y: f128) -> f128; + fn fminf128(x: f128, y: f128) -> f128; + fn fminimum_numf128(x: f128, y: f128) -> f128; + fn fminimumf128(x: f128, y: f128) -> f128; + fn fmodf128(x: f128, y: f128) -> f128; + fn rintf128(x: f128) -> f128; + fn roundevenf128(x: f128) -> f128; + fn roundf128(x: f128) -> f128; + fn sqrtf128(x: f128) -> f128; + fn truncf128(x: f128) -> f128; + } +} + +/// This group of functions has more performance or precision issues than system versions, or +/// are otherwise less well tested. Provide them only on platforms that have problems with the +/// system `libm`. +/// +/// As `libm` improves, more functions will be moved from this group to the first group. +/// +/// Do not supply for any of the following: +/// - x86 without sse2 due to ABI issues +/// - +/// - but exclude UEFI since it is a soft-float target +/// - +/// - All unix targets (linux, macos, freebsd, android, etc) +/// - wasm with known target_os +#[cfg(not(any( + all( + target_arch = "x86", + not(target_feature = "sse2"), + not(target_os = "uefi"), + ), + unix, + all(target_family = "wasm", not(target_os = "unknown")) +)))] +pub mod partial_availability { + #[cfg(not(windows))] + libm_intrinsics! { + fn acos(x: f64) -> f64; + fn acosf(n: f32) -> f32; + fn acosh(x: f64) -> f64; + fn acoshf(x: f32) -> f32; + fn asin(x: f64) -> f64; + fn asinf(n: f32) -> f32; + fn asinh(x: f64) -> f64; + fn asinhf(x: f32) -> f32; + fn atan(x: f64) -> f64; + fn atan2(x: f64, y: f64) -> f64; + fn atan2f(a: f32, b: f32) -> f32; + fn atanf(n: f32) -> f32; + fn cos(x: f64) -> f64; + fn cosf(x: f32) -> f32; + fn cosh(x: f64) -> f64; + fn coshf(n: f32) -> f32; + fn erf(x: f64) -> f64; + fn erfc(x: f64) -> f64; + fn erfcf(x: f32) -> f32; + fn erff(x: f32) -> f32; + fn exp(x: f64) -> f64; + fn exp2(x: f64) -> f64; + fn exp2f(x: f32) -> f32; + fn expf(x: f32) -> f32; + fn expm1(x: f64) -> f64; + fn expm1f(n: f32) -> f32; + fn hypot(x: f64, y: f64) -> f64; + fn hypotf(x: f32, y: f32) -> f32; + fn ldexp(f: f64, n: i32) -> f64; + fn ldexpf(f: f32, n: i32) -> f32; + fn log(x: f64) -> f64; + fn log10(x: f64) -> f64; + fn log10f(x: f32) -> f32; + fn log1p(x: f64) -> f64; + fn log1pf(n: f32) -> f32; + fn log2(x: f64) -> f64; + fn log2f(x: f32) -> f32; + fn logf(x: f32) -> f32; + fn pow(x: f64, y: f64) -> f64; + fn powf(x: f32, y: f32) -> f32; + fn sin(x: f64) -> f64; + fn sinf(x: f32) -> f32; + fn sinh(x: f64) -> f64; + fn sinhf(n: f32) -> f32; + fn tan(x: f64) -> f64; + fn tanf(n: f32) -> f32; + fn tanh(x: f64) -> f64; + fn tanhf(n: f32) -> f32; + fn tgamma(x: f64) -> f64; + fn tgammaf(x: f32) -> f32; + } + + // allow for windows (and other targets) + intrinsics! { + pub extern "C" fn lgamma_r(x: f64, s: &mut i32) -> f64 { + let r = super::libm_math::lgamma_r(x); + *s = r.1; + r.0 + } + + pub extern "C" fn lgammaf_r(x: f32, s: &mut i32) -> f32 { + let r = super::libm_math::lgammaf_r(x); + *s = r.1; + r.0 + } + } +} diff --git a/ci/licenses/rust-compiler-originals/compiler-rt-CREDITS.TXT b/ci/licenses/rust-compiler-originals/compiler-rt-CREDITS.TXT new file mode 100644 index 0000000..6964eba --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-rt-CREDITS.TXT @@ -0,0 +1,36 @@ +This file is a partial list of people who have contributed to the LLVM/CompilerRT +project. If you have contributed a patch or made some other contribution to +LLVM/CompilerRT, please submit a patch to this file to add yourself, and it will be +done! + +The list is sorted by surname and formatted to allow easy grepping and +beautification by scripts. The fields are: name (N), email (E), web-address +(W), PGP key ID and fingerprint (P), description (D), and snail-mail address +(S). + +N: Craig van Vliet +E: cvanvliet@auroraux.org +W: http://www.auroraux.org +D: Code style and Readability fixes. + +N: Edward O'Callaghan +E: eocallaghan@auroraux.org +W: http://www.auroraux.org +D: CMake'ify Compiler-RT build system +D: Maintain Solaris & AuroraUX ports of Compiler-RT + +N: Howard Hinnant +E: hhinnant@apple.com +D: Architect and primary author of compiler-rt + +N: Guan-Hong Liu +E: koviankevin@hotmail.com +D: IEEE Quad-precision functions + +N: Joerg Sonnenberger +E: joerg@NetBSD.org +D: Maintains NetBSD port. + +N: Matt Thomas +E: matt@NetBSD.org +D: ARM improvements. diff --git a/ci/licenses/rust-compiler-originals/compiler-rt-LICENSE.TXT b/ci/licenses/rust-compiler-originals/compiler-rt-LICENSE.TXT new file mode 100644 index 0000000..5a79a1b --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-rt-LICENSE.TXT @@ -0,0 +1,311 @@ +============================================================================== +The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: +============================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): +============================================================================== + +The compiler_rt library is dual licensed under both the University of Illinois +"BSD-Like" license and the MIT license. As a user of this code you may choose +to use it under either license. As a contributor, you agree to allow your code +to be used under both. + +Full text of the relevant licenses is included below. + +============================================================================== + +University of Illinois/NCSA +Open Source License + +Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT + +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== + +Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/ci/licenses/rust-compiler-originals/compiler-rt-aarch64-cpu-model.c.txt b/ci/licenses/rust-compiler-originals/compiler-rt-aarch64-cpu-model.c.txt new file mode 100644 index 0000000..347bb4e --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-rt-aarch64-cpu-model.c.txt @@ -0,0 +1,94 @@ +//===-- cpu_model/aarch64.c - Support for __cpu_model builtin ----*- C -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file is based on LLVM's lib/Support/Host.cpp. +// It implements __aarch64_have_lse_atomics, __aarch64_cpu_features for +// AArch64. +// +//===----------------------------------------------------------------------===// + +#include "aarch64.h" + +#if !defined(__aarch64__) && !defined(__arm64__) && !defined(_M_ARM64) && \ + !defined(__arm64ec__) && !defined(_M_ARM64EC) +#error This file is intended only for aarch64-based targets +#endif + +#if __has_include() +#include +#else +typedef struct __ifunc_arg_t { + unsigned long _size; + unsigned long _hwcap; + unsigned long _hwcap2; +} __ifunc_arg_t; +#endif // __has_include() + +// LSE support detection for out-of-line atomics +// using HWCAP and Auxiliary vector +_Bool __aarch64_have_lse_atomics + __attribute__((visibility("hidden"), nocommon)) = false; + +// The formatter wants to re-order these includes, but doing so is incorrect: +// clang-format off +#if defined(__FreeBSD__) || defined(__OpenBSD__) +#include +#include "aarch64/hwcap.inc" +#include "aarch64/lse_atomics/elf_aux_info.inc" +#elif defined(__Fuchsia__) +#include "aarch64/hwcap.inc" +#include "aarch64/lse_atomics/fuchsia.inc" +#elif defined(__ANDROID__) +#include +#include "aarch64/hwcap.inc" +#include "aarch64/lse_atomics/android.inc" +#elif defined(__linux__) +#include +#include "aarch64/hwcap.inc" +#include "aarch64/lse_atomics/getauxval.inc" +#elif defined(_WIN32) +#include "aarch64/lse_atomics/windows.inc" +#else +// When unimplemented, we leave __aarch64_have_lse_atomics initialized to false. +#endif +// clang-format on + +#if !defined(DISABLE_AARCH64_FMV) + +// Architecture features used +// in Function Multi Versioning +struct { + unsigned long long features; + // As features grows new fields could be added +} __aarch64_cpu_features __attribute__((visibility("hidden"), nocommon)); + +// The formatter wants to re-order these includes, but doing so is incorrect: +// clang-format off +#if defined(TARGET_BAREMETAL_AARCH64) +#include "aarch64/fmv/baremetal.inc" +#elif defined(__APPLE__) +#include "aarch64/fmv/apple.inc" +#elif defined(__FreeBSD__) || defined(__OpenBSD__) +#include "aarch64/fmv/hwcap.inc" +#include "aarch64/fmv/elf_aux_info.inc" +#elif defined(__Fuchsia__) +#include "aarch64/fmv/fuchsia.inc" +#elif defined(__ANDROID__) +#include "aarch64/fmv/hwcap.inc" +#include "aarch64/fmv/android.inc" +#elif defined(__linux__) +#include "aarch64/fmv/hwcap.inc" +#include "aarch64/fmv/getauxval.inc" +#elif defined(_WIN32) +#include "aarch64/fmv/windows.inc" +#else +#include "aarch64/fmv/unimplemented.inc" +#endif +// clang-format on + +#endif // !defined(DISABLE_AARCH64_FMV) diff --git a/ci/licenses/rust-compiler-originals/compiler-rt-aarch64-lse.S.txt b/ci/licenses/rust-compiler-originals/compiler-rt-aarch64-lse.S.txt new file mode 100644 index 0000000..a444d82 --- /dev/null +++ b/ci/licenses/rust-compiler-originals/compiler-rt-aarch64-lse.S.txt @@ -0,0 +1,270 @@ +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include "assembly.h" + +// Out-of-line LSE atomics helpers. Ported from libgcc library. +// N = {1, 2, 4, 8} +// M = {1, 2, 4, 8, 16} +// ORDER = {'relax', 'acq', 'rel', 'acq_rel', 'sync'} +// Routines implemented: +// +// iM __aarch64_casM_ORDER(iM expected, iM desired, iM *ptr) +// iN __aarch64_swpN_ORDER(iN val, iN *ptr) +// iN __aarch64_ldaddN_ORDER(iN val, iN *ptr) +// iN __aarch64_ldclrN_ORDER(iN val, iN *ptr) +// iN __aarch64_ldeorN_ORDER(iN val, iN *ptr) +// iN __aarch64_ldsetN_ORDER(iN val, iN *ptr) +// +// Routines may modify temporary registers tmp0, tmp1, tmp2, +// return value x0 and the flags only. + +#if defined(__aarch64__) || defined(__arm64ec__) + +#ifdef HAS_ASM_LSE +.arch armv8-a+lse +#else +.arch armv8-a +#endif + +#if !defined(__APPLE__) +HIDDEN(__aarch64_have_lse_atomics) +#else +HIDDEN(___aarch64_have_lse_atomics) +#endif + +// Generate mnemonics for +// L_cas: SIZE: 1,2,4,8,16 MODEL: 1,2,3,4,5 +// L_swp L_ldadd L_ldclr L_ldeor L_ldset: SIZE: 1,2,4,8 MODEL: 1,2,3,4,5 + +#if SIZE == 1 +#define S b +#define UXT uxtb +#define B 0x00000000 +#elif SIZE == 2 +#define S h +#define UXT uxth +#define B 0x40000000 +#elif SIZE == 4 || SIZE == 8 || SIZE == 16 +#define S +#define UXT mov +#if SIZE == 4 +#define B 0x80000000 +#elif SIZE == 8 +#define B 0xc0000000 +#endif +#else +#error +#endif // SIZE + +#if MODEL == 1 +#define SUFF _relax +#define A +#define L +#define M 0x000000 +#define N 0x000000 +#define BARRIER +#elif MODEL == 2 +#define SUFF _acq +#define A a +#define L +#define M 0x400000 +#define N 0x800000 +#define BARRIER +#elif MODEL == 3 +#define SUFF _rel +#define A +#define L l +#define M 0x008000 +#define N 0x400000 +#define BARRIER +#elif MODEL == 4 +#define SUFF _acq_rel +#define A a +#define L l +#define M 0x408000 +#define N 0xc00000 +#define BARRIER +#elif MODEL == 5 +#define SUFF _sync +#ifdef L_swp +// swp has _acq semantics. +#define A a +#define L +#define M 0x400000 +#define N 0x800000 +#else +// All other _sync functions have _seq semantics. +#define A a +#define L l +#define M 0x408000 +#define N 0xc00000 +#endif +#define BARRIER dmb ish +#else +#error +#endif // MODEL + +// Define register size. +#define x(N) GLUE2(x, N) +#define w(N) GLUE2(w, N) +#if SIZE < 8 +#define s(N) w(N) +#else +#define s(N) x(N) +#endif + +#define NAME(BASE) GLUE4(__aarch64_, BASE, SIZE, SUFF) +#if MODEL == 5 +// Drop A for _sync functions. +#define LDXR GLUE3(ld, xr, S) +#else +#define LDXR GLUE4(ld, A, xr, S) +#endif +#define STXR GLUE4(st, L, xr, S) + +// Define temporary registers. +#define tmp0 16 +#define tmp1 17 +#define tmp2 15 + +// Macro for branch to label if no LSE available +.macro JUMP_IF_NOT_LSE label +#if !defined(__APPLE__) + adrp x(tmp0), __aarch64_have_lse_atomics + ldrb w(tmp0), [x(tmp0), :lo12:__aarch64_have_lse_atomics] +#else + adrp x(tmp0), ___aarch64_have_lse_atomics@page + ldrb w(tmp0), [x(tmp0), ___aarch64_have_lse_atomics@pageoff] +#endif + cbz w(tmp0), \label +.endm + +#ifdef L_cas +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(cas)) + JUMP_IF_NOT_LSE 8f +#if SIZE < 16 +#ifdef HAS_ASM_LSE +#define CAS GLUE4(cas, A, L, S) s(0), s(1), [x2] +#else +#define CAS .inst 0x08a07c41 + B + M +#endif + CAS // s(0), s(1), [x2] + ret +8: + UXT s(tmp0), s(0) +0: + LDXR s(0), [x2] + cmp s(0), s(tmp0) + bne 1f + STXR w(tmp1), s(1), [x2] + cbnz w(tmp1), 0b +1: + BARRIER + ret +#else +#if MODEL == 5 +// Drop A for _sync functions. +#define LDXP GLUE2(ld, xp) +#else +#define LDXP GLUE3(ld, A, xp) +#endif +#define STXP GLUE3(st, L, xp) +#ifdef HAS_ASM_LSE +#define CASP GLUE3(casp, A, L) x0, x1, x2, x3, [x4] +#else +#define CASP .inst 0x48207c82 + M +#endif + + CASP // x0, x1, x2, x3, [x4] + ret +8: + mov x(tmp0), x0 + mov x(tmp1), x1 +0: + LDXP x0, x1, [x4] + cmp x0, x(tmp0) + ccmp x1, x(tmp1), #0, eq + bne 1f + STXP w(tmp2), x2, x3, [x4] + cbnz w(tmp2), 0b +1: + BARRIER + ret +#endif +END_COMPILERRT_OUTLINE_FUNCTION(NAME(cas)) +#endif // L_cas + +#ifdef L_swp +#ifdef HAS_ASM_LSE +#define SWP GLUE4(swp, A, L, S) s(0), s(0), [x1] +#else +#define SWP .inst 0x38208020 + B + N +#endif +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(swp)) + JUMP_IF_NOT_LSE 8f + SWP // s(0), s(0), [x1] + ret +8: + mov s(tmp0), s(0) +0: + LDXR s(0), [x1] + STXR w(tmp1), s(tmp0), [x1] + cbnz w(tmp1), 0b + BARRIER + ret +END_COMPILERRT_OUTLINE_FUNCTION(NAME(swp)) +#endif // L_swp + +#if defined(L_ldadd) || defined(L_ldclr) || \ + defined(L_ldeor) || defined(L_ldset) + +#ifdef L_ldadd +#define LDNM ldadd +#define OP add +#define OPN 0x0000 +#elif defined(L_ldclr) +#define LDNM ldclr +#define OP bic +#define OPN 0x1000 +#elif defined(L_ldeor) +#define LDNM ldeor +#define OP eor +#define OPN 0x2000 +#elif defined(L_ldset) +#define LDNM ldset +#define OP orr +#define OPN 0x3000 +#else +#error +#endif + +#ifdef HAS_ASM_LSE +#define LDOP GLUE4(LDNM, A, L, S) s(0), s(0), [x1] +#else +#define LDOP .inst 0x38200020 + OPN + B + N +#endif + +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(LDNM)) + JUMP_IF_NOT_LSE 8f + LDOP // s(0), s(0), [x1] + ret +8: + mov s(tmp0), s(0) +0: + LDXR s(0), [x1] + OP s(tmp1), s(0), s(tmp0) + STXR w(tmp2), s(tmp1), [x1] + cbnz w(tmp2), 0b + BARRIER + ret +END_COMPILERRT_OUTLINE_FUNCTION(NAME(LDNM)) +#endif // L_ldadd L_ldclr L_ldeor L_ldset + +NO_EXEC_STACK_DIRECTIVE + +// GNU property note for BTI, PAC, and GCS +GNU_PROPERTY_BTI_PAC_GCS + +#endif // defined(__aarch64__) || defined(__arm64ec__) diff --git a/ci/licenses/rust-compiler-originals/libm-LICENSE.txt b/ci/licenses/rust-compiler-originals/libm-LICENSE.txt new file mode 100644 index 0000000..2f8e41f --- /dev/null +++ b/ci/licenses/rust-compiler-originals/libm-LICENSE.txt @@ -0,0 +1,258 @@ +rust-lang/libm as a whole is available for use under the MIT license: + +------------------------------------------------------------------------------ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +------------------------------------------------------------------------------ + +As a contributor, you agree that your code can be used under either the MIT +license or the Apache-2.0 license: + +------------------------------------------------------------------------------ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +------------------------------------------------------------------------------ + +This Rust library contains the following copyrights: + + Copyright (c) 2018 Jorge Aparicio + +Portions of this software are derived from third-party works licensed under +terms compatible with the above MIT license: + +* musl libc https://www.musl-libc.org/. This library contains the following + copyright: + + Copyright © 2005-2020 Rich Felker, et al. + +* The CORE-MATH project https://core-math.gitlabpages.inria.fr/. CORE-MATH + routines are available under the MIT license on a per-file basis. + +The musl libc COPYRIGHT file also includes the following notice relevant to +math portions of the library: + +------------------------------------------------------------------------------ +Much of the math library code (src/math/* and src/complex/*) is +Copyright © 1993,2004 Sun Microsystems or +Copyright © 2003-2011 David Schultz or +Copyright © 2003-2009 Steven G. Kargl or +Copyright © 2003-2009 Bruce D. Evans or +Copyright © 2008 Stephen L. Moshier or +Copyright © 2017-2018 Arm Limited +and labelled as such in comments in the individual source files. All +have been licensed under extremely permissive terms. +------------------------------------------------------------------------------ + +Copyright notices are retained in src/* files where relevant. diff --git a/ci/licenses/rust-compiler-originals/libm-generic-trunc.rs.txt b/ci/licenses/rust-compiler-originals/libm-generic-trunc.rs.txt new file mode 100644 index 0000000..0b252fa --- /dev/null +++ b/ci/licenses/rust-compiler-originals/libm-generic-trunc.rs.txt @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: MIT + * origin: musl src/math/trunc.c */ + +use crate::support::{Float, FpResult, Int, IntTy, MinInt, Status}; + +#[inline] +pub fn trunc_status(x: F) -> FpResult { + let xi: F::Int = x.to_bits(); + let e: i32 = x.exp_unbiased(); + + // The represented value has no fractional part, so no truncation is needed + if e >= F::SIG_BITS as i32 { + return FpResult::ok(x); + } + + let clear_mask = if e < 0 { + // If the exponent is negative, the result will be zero so we clear everything + // except the sign. + !F::SIGN_MASK + } else { + // Otherwise, we keep `e` fractional bits and clear the rest. + F::SIG_MASK >> e.unsigned() + }; + + let cleared = xi & clear_mask; + let status = if cleared == IntTy::::ZERO { + // If the to-be-zeroed portion is already zero, we have an exact result. + Status::OK + } else { + // Otherwise the result is inexact and we will truncate, so indicate `FE_INEXACT`. + Status::INEXACT + }; + + // Now zero the bits we need to truncate and return. + FpResult::new(F::from_bits(xi ^ cleared), status) +} diff --git a/ci/licenses/rust-compiler-originals/libm-trunc.rs.txt b/ci/licenses/rust-compiler-originals/libm-trunc.rs.txt new file mode 100644 index 0000000..9eb902e --- /dev/null +++ b/ci/licenses/rust-compiler-originals/libm-trunc.rs.txt @@ -0,0 +1,147 @@ +use super::generic; + +/// Rounds the number toward 0 to the closest integral value (f16). +/// +/// This effectively removes the decimal part of the number, leaving the integral part. +#[cfg(f16_enabled)] +#[cfg_attr(assert_no_panic, no_panic::no_panic)] +pub fn truncf16(x: f16) -> f16 { + generic::trunc_status(x).val +} + +/// Rounds the number toward 0 to the closest integral value (f32). +/// +/// This effectively removes the decimal part of the number, leaving the integral part. +#[cfg_attr(assert_no_panic, no_panic::no_panic)] +pub fn truncf(x: f32) -> f32 { + select_implementation! { + name: truncf, + use_arch: all(target_arch = "wasm32", intrinsics_enabled), + args: x, + } + + generic::trunc_status(x).val +} + +/// Rounds the number toward 0 to the closest integral value (f64). +/// +/// This effectively removes the decimal part of the number, leaving the integral part. +#[cfg_attr(assert_no_panic, no_panic::no_panic)] +pub fn trunc(x: f64) -> f64 { + select_implementation! { + name: trunc, + use_arch: all(target_arch = "wasm32", intrinsics_enabled), + args: x, + } + + generic::trunc_status(x).val +} + +/// Rounds the number toward 0 to the closest integral value (f128). +/// +/// This effectively removes the decimal part of the number, leaving the integral part. +#[cfg(f128_enabled)] +#[cfg_attr(assert_no_panic, no_panic::no_panic)] +pub fn truncf128(x: f128) -> f128 { + generic::trunc_status(x).val +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::support::{Float, FpResult, Hex, Status}; + + macro_rules! cases { + ($f:ty) => { + [ + // roundtrip + (0.0, 0.0, Status::OK), + (-0.0, -0.0, Status::OK), + (1.0, 1.0, Status::OK), + (-1.0, -1.0, Status::OK), + (<$f>::INFINITY, <$f>::INFINITY, Status::OK), + (<$f>::NEG_INFINITY, <$f>::NEG_INFINITY, Status::OK), + // with rounding + (0.1, 0.0, Status::INEXACT), + (-0.1, -0.0, Status::INEXACT), + (0.5, 0.0, Status::INEXACT), + (-0.5, -0.0, Status::INEXACT), + (0.9, 0.0, Status::INEXACT), + (-0.9, -0.0, Status::INEXACT), + (1.1, 1.0, Status::INEXACT), + (-1.1, -1.0, Status::INEXACT), + (1.5, 1.0, Status::INEXACT), + (-1.5, -1.0, Status::INEXACT), + (1.9, 1.0, Status::INEXACT), + (-1.9, -1.0, Status::INEXACT), + ] + }; + } + + #[track_caller] + fn check(f: fn(F) -> F, cases: &[(F, F, Status)]) { + for &(x, exp_res, exp_stat) in cases { + let FpResult { val, status } = generic::trunc_status(x); + assert_biteq!(val, exp_res, "generic::trunc_status({x:?}) ({})", Hex(x)); + assert_eq!( + status, + exp_stat, + "{x:?} {} -> {exp_res:?} {}", + Hex(x), + Hex(exp_res) + ); + let val = f(x); + assert_biteq!(val, exp_res, "trunc({x:?}) ({})", Hex(x)); + } + } + + #[test] + #[cfg(f16_enabled)] + fn check_f16() { + check::(truncf16, &cases!(f16)); + check::( + truncf16, + &[ + (hf16!("0x1p10"), hf16!("0x1p10"), Status::OK), + (hf16!("-0x1p10"), hf16!("-0x1p10"), Status::OK), + ], + ); + } + + #[test] + fn check_f32() { + check::(truncf, &cases!(f32)); + check::( + truncf, + &[ + (hf32!("0x1p23"), hf32!("0x1p23"), Status::OK), + (hf32!("-0x1p23"), hf32!("-0x1p23"), Status::OK), + ], + ); + } + + #[test] + fn check_f64() { + check::(trunc, &cases!(f64)); + check::( + trunc, + &[ + (hf64!("0x1p52"), hf64!("0x1p52"), Status::OK), + (hf64!("-0x1p52"), hf64!("-0x1p52"), Status::OK), + ], + ); + } + + #[test] + #[cfg(f128_enabled)] + fn check_f128() { + check::(truncf128, &cases!(f128)); + check::( + truncf128, + &[ + (hf128!("0x1p112"), hf128!("0x1p112"), Status::OK), + (hf128!("-0x1p112"), hf128!("-0x1p112"), Status::OK), + ], + ); + } +} diff --git a/ci/php-windows-gnu.lock b/ci/php-windows-gnu.lock new file mode 100644 index 0000000..b9f4451 --- /dev/null +++ b/ci/php-windows-gnu.lock @@ -0,0 +1,215 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "castaway" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" +dependencies = [ + "rustversion", +] + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "compact_str" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dfdd1c2274d9aa354115b09dc9a901d6c5576818cdf70d14cae2bdb47df00ab" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "rustversion", + "ryu", + "serde", + "static_assertions", +] + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown", + "serde", + "serde_core", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "ktav" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7140dfe2fa6c320e74768cd6a637828c2d26f81746254f4fcd805f3993bd3fd5" +dependencies = [ + "bumpalo", + "compact_str", + "indexmap", + "itoa", + "memchr", + "rustc-hash", + "ryu", + "serde", + "serde_json", +] + +[[package]] +name = "ktav-cabi" +version = "0.8.1" +dependencies = [ + "ktav", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "foldhash", + "indexmap", + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "syn" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/ci/rust-compiler-notices.json b/ci/rust-compiler-notices.json new file mode 100644 index 0000000..7cdc2d0 --- /dev/null +++ b/ci/rust-compiler-notices.json @@ -0,0 +1,163 @@ +{ + "coverage": "Complete original Rust compiler-builtins, LLVM compiler-rt and libm grants and a conservative source witness collection for the pinned compiler. Not a retained-code inventory, all-target input proof or change to the first-party MIT OR Apache-2.0 license.", + "llvm_revision": "1b9c0d5ff9bbe7634aead059efe6b11a7eeba145", + "materials": [ + { + "bytes": 15078, + "git_blob": "00ae6140bd54e1b538d833f60438e11ed8be12cf", + "legal_document": true, + "path": "ci/licenses/rust-compiler-originals/compiler-builtins-LICENSE.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "compiler-builtins-LICENSE.txt", + "sha256": "ab6eec6caf0fa5775e411c7a8bc6a45c4ef2956b0980b157ab74fc5cd62a928b", + "upstream_path": "library/compiler-builtins/LICENSE.txt" + }, + { + "bytes": 2005, + "git_blob": "b2f1443f2eb09d297b62c7b44fce9e31d71b10a2", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/compiler-builtins-Cargo.toml.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "compiler-builtins-Cargo.toml.txt", + "sha256": "d89e31fed70f2cad9c6e91b787bf4c0fb680c631196b2a7215c81745aaf7fb7e", + "upstream_path": "library/compiler-builtins/compiler-builtins/Cargo.toml" + }, + { + "bytes": 27313, + "git_blob": "e86c784b5c6317a53e9ff89104b15e60ba7ac4bf", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/compiler-builtins-build.rs.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "compiler-builtins-build.rs.txt", + "sha256": "dd1d07d0852fd6a654c69d6dafd8ae66744853cb5678610008dbf6ae6baec11e", + "upstream_path": "library/compiler-builtins/compiler-builtins/build.rs" + }, + { + "bytes": 463, + "git_blob": "2c12cb7f3095b2ace3938a666ebd1b607b8a269c", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/compiler-builtins-aarch64.rs.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "compiler-builtins-aarch64.rs.txt", + "sha256": "5acb367779a8e6e6e06e188e715d6d2ff76b9c3208acd899e139957bd1d3c877", + "upstream_path": "library/compiler-builtins/compiler-builtins/src/aarch64.rs" + }, + { + "bytes": 16463, + "git_blob": "367768ecb60d65069679b3c84a9ef932c5ab6962", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/compiler-builtins-aarch64-outline-atomics.rs.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "compiler-builtins-aarch64-outline-atomics.rs.txt", + "sha256": "d2e6ed0066ac36db55dfaa245bdc814353456dda92437aba539cc828d2011ae9", + "upstream_path": "library/compiler-builtins/compiler-builtins/src/aarch64_outline_atomics.rs" + }, + { + "bytes": 5851, + "git_blob": "a444d82892c36f8c1e3ba5f1977638d56fb929f8", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/compiler-rt-aarch64-lse.S.txt", + "repository": "rust-lang/llvm-project", + "revision": "1b9c0d5ff9bbe7634aead059efe6b11a7eeba145", + "role": "compiler-rt-aarch64-lse.S.txt", + "sha256": "dcd05cb984ef8d777642eb960e3ef61b1140f268c3e4744f8f738aa46fd8ed66", + "upstream_path": "compiler-rt/lib/builtins/aarch64/lse.S" + }, + { + "bytes": 3026, + "git_blob": "347bb4e121c97c98aa6e7440b1c952978bfedc9b", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/compiler-rt-aarch64-cpu-model.c.txt", + "repository": "rust-lang/llvm-project", + "revision": "1b9c0d5ff9bbe7634aead059efe6b11a7eeba145", + "role": "compiler-rt-aarch64-cpu-model.c.txt", + "sha256": "405b2ad2520db341af1338be2e58cce9d28a9f63006486d1c9572f4fe10ae032", + "upstream_path": "compiler-rt/lib/builtins/cpu_model/aarch64.c" + }, + { + "bytes": 16708, + "git_blob": "5a79a1b9d5cb0af9a779751f07033e44ca3b14d8", + "legal_document": true, + "path": "ci/licenses/rust-compiler-originals/compiler-rt-LICENSE.TXT", + "repository": "rust-lang/llvm-project", + "revision": "1b9c0d5ff9bbe7634aead059efe6b11a7eeba145", + "role": "compiler-rt-LICENSE.TXT", + "sha256": "1a8f1058753f1ba890de984e48f0242a3a5c29a6a8f2ed9fd813f36985387e8d", + "upstream_path": "compiler-rt/LICENSE.TXT" + }, + { + "bytes": 1049, + "git_blob": "6964eba020b8aa7a08629b249e3b9aea3ce3e448", + "legal_document": true, + "path": "ci/licenses/rust-compiler-originals/compiler-rt-CREDITS.TXT", + "repository": "rust-lang/llvm-project", + "revision": "1b9c0d5ff9bbe7634aead059efe6b11a7eeba145", + "role": "compiler-rt-CREDITS.TXT", + "sha256": "a9901f47a089da41e4690682d00ce4cedaa2baf41fedbe79beee366d43ac2461", + "upstream_path": "compiler-rt/CREDITS.TXT" + }, + { + "bytes": 7270, + "git_blob": "3dfa3863bb77007fbec01b7c931bf1c349953d11", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/compiler-builtins-math-mod.rs.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "compiler-builtins-math-mod.rs.txt", + "sha256": "a3ff615e04d9ae9a0bb36cfbfd9a0aaf183ab6e32ddfe836cdf4f243f97a401e", + "upstream_path": "library/compiler-builtins/compiler-builtins/src/math/mod.rs" + }, + { + "bytes": 4407, + "git_blob": "9eb902ea578f87588d8236619a67ab7db72c8ba8", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/libm-trunc.rs.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "libm-trunc.rs.txt", + "sha256": "ef59952a1a80ec93be27eb78c977189084ff7fcae0e8f782d60b5947e1de141c", + "upstream_path": "library/compiler-builtins/libm/src/math/trunc.rs" + }, + { + "bytes": 14088, + "git_blob": "2f8e41f147472510b05e0adeadf350df6f5a6b96", + "legal_document": true, + "path": "ci/licenses/rust-compiler-originals/libm-LICENSE.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "libm-LICENSE.txt", + "sha256": "3823dda7cf046602f4b4e77ec8e227863dc4736037cc85bb33d9f19febe16bb7", + "upstream_path": "library/compiler-builtins/libm/LICENSE.txt" + }, + { + "bytes": 1152, + "git_blob": "0b252fab94ae1d54aac4df8d5ab6f7a2e919bd32", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/libm-generic-trunc.rs.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "libm-generic-trunc.rs.txt", + "sha256": "3a3ca091cd1d750276601dc2dfeb2a8ff058636ea2b66a748c55a1804bc8f00a", + "upstream_path": "library/compiler-builtins/libm/src/math/generic/trunc.rs" + }, + { + "bytes": 16862, + "git_blob": "6193aa416e22249ed25e856aa03dda2f5a585b62", + "legal_document": false, + "path": "ci/licenses/rust-compiler-originals/compiler-builtins-float-conv.rs.txt", + "repository": "rust-lang/rust", + "revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "role": "compiler-builtins-float-conv.rs.txt", + "sha256": "740286ec154ddd78a9a8e5e6b8fad2c564585d1a76051cd6ee429c313d660070", + "upstream_path": "library/compiler-builtins/compiler-builtins/src/float/conv.rs" + } + ], + "rust_revision": "58cf8f9c35b355199727627d07ae34a4e2846d67", + "rust_version": "1.99.1", + "schema_version": 1 +} diff --git a/ci/test_cabi_gnullvm_notices.py b/ci/test_cabi_gnullvm_notices.py new file mode 100644 index 0000000..e126160 --- /dev/null +++ b/ci/test_cabi_gnullvm_notices.py @@ -0,0 +1,104 @@ +"""CI-регрессии exact C ABI SDK/source/runtime boundary.""" + +import copy +import hashlib +import importlib.util +from pathlib import Path +import tempfile +import unittest + +ROOT = Path(__file__).resolve().parents[1] +SPEC = importlib.util.spec_from_file_location('cabi_runtime', ROOT / 'scripts/cabi_gnullvm_notices.py') +MODULE = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(MODULE) +TARGET = 'x86_64-pc-windows-gnullvm' + + +class CabiRuntimeTests(unittest.TestCase): + def profile(self): + return MODULE.catalogue(ROOT) + + def link_fixture(self): + document = self.profile() + profile = document['targets'][TARGET] + items = [{'path': 'link/llvm-mingw-20261020-ucrt-x86_64/' + value['path'], 'bytes': value['size'], 'sha256': value['sha256']} for value in profile['sdk_inputs']] + mapping = ''.join('00001000 00000010 16 ' + value + ':(.text)\n' for value in profile['retained_objects']).encode() + return document, items, mapping + + def test_exact_profile_has_dll_specific_targets_and_source_grants(self): + document = self.profile() + self.assertEqual(len(document['source_files']), 58) + self.assertEqual(len(document['original_documents']), 6) + self.assertEqual(len(document['targets'][TARGET]['retained_objects']), 28) + self.assertEqual(len(document['targets']['aarch64-pc-windows-gnullvm']['retained_objects']), 21) + self.assertIn('mingw-w64-crt/crt/crtdll.c', {item['path'] for item in document['source_files']}) + + def test_profile_mutation_is_rejected(self): + with tempfile.TemporaryDirectory() as temporary: + root = Path(temporary) + destination = root / MODULE.CATALOG + destination.parent.mkdir(parents=True) + destination.write_bytes((ROOT / MODULE.CATALOG).read_bytes() + b'\n') + with self.assertRaisesRegex(ValueError, 'unreviewed C ABI runtime catalogue'): + MODULE.catalogue(root) + + def test_augmentation_preserves_original_cargo_bundle(self): + before = {'schema_version': 1, 'coverage': 'Cargo/std fixture', 'packages': [{'name': 'fixture'}]} + saved = copy.deepcopy(before) + result = MODULE.augment(before, self.profile(), TARGET) + self.assertEqual(before, saved) + self.assertEqual(result['packages'], saved['packages']) + self.assertEqual(result['non_cargo_runtimes'][0]['selected_inputs']['retained_objects'], self.profile()['targets'][TARGET]['retained_objects']) + + def test_unknown_target_and_repeated_augmentation_are_rejected(self): + before = {'schema_version': 1, 'coverage': 'fixture'} + for target, bundle in [('unknown', before), (TARGET, MODULE.augment(before, self.profile(), TARGET))]: + with self.assertRaisesRegex(ValueError, 'unexpected C ABI runtime'): + MODULE.augment(bundle, self.profile(), target) + + def test_source_hash_and_original_notice_changes_are_rejected(self): + raw = b'/* Copyright fixture. Permission fixture. */\nint value;\n' + item = {'source': 'fixture', 'path': 'fixture.c', 'sha256': hashlib.sha256(raw).hexdigest(), 'source_notices': ['/* Copyright fixture. Permission fixture. */']} + document = {'source_files': [item], 'original_documents': []} + MODULE.verify_sources(document, fetch=lambda _: raw) + with self.assertRaisesRegex(ValueError, 'source/grant bytes differ'): + MODULE.verify_sources(document, fetch=lambda _: raw + b'changed') + changed = copy.deepcopy(document) + changed['source_files'][0]['source_notices'] = [] + with self.assertRaisesRegex(ValueError, 'original notice differs'): + MODULE.verify_sources(changed, fetch=lambda _: raw) + + def test_foreign_source_url_is_rejected_before_fetch(self): + with self.assertRaisesRegex(ValueError, 'unreviewed C ABI runtime source URL'): + MODULE.original('https://example.invalid/source.c') + + def test_exact_sdk_bytes_and_objects_are_accepted(self): + document, items, mapping = self.link_fixture() + MODULE.verify_inputs(items, mapping, document, TARGET) + + def test_changed_sdk_bytes_or_missing_retained_member_are_rejected(self): + document, items, mapping = self.link_fixture() + changed = copy.deepcopy(items) + changed[0]['sha256'] = '0' * 64 + with self.assertRaisesRegex(ValueError, 'differ from reviewed profile'): + MODULE.verify_inputs(changed, mapping, document, TARGET) + with self.assertRaisesRegex(ValueError, 'differ from reviewed profile'): + MODULE.verify_inputs(items, b'\n'.join(mapping.splitlines()[1:]), document, TARGET) + + def test_foreign_native_input_and_duplicate_sdk_input_are_rejected(self): + document, items, mapping = self.link_fixture() + foreign = {'path': 'external/foreign.a', 'bytes': 1, 'sha256': '0' * 64} + with self.assertRaisesRegex(ValueError, 'outside reviewed SDK/Rust boundary'): + MODULE.verify_inputs([*items, foreign], mapping, document, TARGET) + with self.assertRaisesRegex(ValueError, 'duplicate or unsafe SDK'): + MODULE.verify_inputs([*items, items[0]], mapping, document, TARGET) + + def test_legal_collection_does_not_drop_full_original_documents(self): + document = self.profile() + plain = MODULE.plain_notice(document) + for item in document['original_documents']: + self.assertIn(item['text'].encode('utf-8'), plain) + + +if __name__ == '__main__': + unittest.main() diff --git a/ci/test_embedded_notices.py b/ci/test_embedded_notices.py new file mode 100644 index 0000000..f72ab37 --- /dev/null +++ b/ci/test_embedded_notices.py @@ -0,0 +1,61 @@ +"""Проверить compact notice resource без загрузки native кода.""" + +from __future__ import annotations + +import gzip +import importlib.util +import unittest +from pathlib import Path + +SCRIPT = Path(__file__).resolve().parents[1] / "scripts" / "check_embedded_notices.py" +spec = importlib.util.spec_from_file_location("embedded_notices", SCRIPT) +assert spec is not None +assert spec.loader is not None +module = importlib.util.module_from_spec(spec) +spec.loader.exec_module(module) + + +def _resource(data: bytes) -> bytes: + compressed = gzip.compress(data, mtime=0) + return module.MARKER + len(compressed).to_bytes(8, "little") + compressed + + +class EmbeddedNoticesTest(unittest.TestCase): + def test_roundtrip_preserves_utf8_notice(self) -> None: + expected = '{"copyright": "© contributors", "license": "MIT"}'.encode() + resource = _resource(expected) + actual, size = module._extract(b"native-prefix" + resource + b"native-suffix") + self.assertEqual(actual, expected) + self.assertEqual(size, len(resource) - len(module.MARKER) - 8) + + def test_missing_resource_is_rejected(self) -> None: + with self.assertRaisesRegex(ValueError, "missing or duplicate"): + module._extract(b"native without notices") + + def test_duplicate_resource_is_rejected(self) -> None: + resource = _resource(b"notice") + with self.assertRaisesRegex(ValueError, "missing or duplicate"): + module._extract(resource + resource) + + def test_truncated_length_is_rejected(self) -> None: + with self.assertRaisesRegex(ValueError, "truncated embedded notice length"): + module._extract(module.MARKER + b"short") + + def test_truncated_payload_is_rejected(self) -> None: + with self.assertRaisesRegex(ValueError, "invalid embedded notice size"): + module._extract(module.MARKER + (100).to_bytes(8, "little") + b"short") + + def test_oversized_claim_is_rejected_without_large_allocation(self) -> None: + length = module.MAX_GZIP + 1 + with self.assertRaisesRegex(ValueError, "invalid embedded notice size"): + module._extract(module.MARKER + length.to_bytes(8, "little")) + + def test_corrupt_gzip_is_rejected(self) -> None: + resource = bytearray(_resource(b"notice")) + resource[-1] ^= 1 + with self.assertRaises((OSError, EOFError)): + module._extract(bytes(resource)) + + +if __name__ == "__main__": + unittest.main() diff --git a/ci/test_native_distribution_contract.py b/ci/test_native_distribution_contract.py new file mode 100644 index 0000000..eb8e887 --- /dev/null +++ b/ci/test_native_distribution_contract.py @@ -0,0 +1,63 @@ +"""Проверить обязательные combined targets и distribution gates в CI.""" + +from pathlib import Path +import shutil +import subprocess +import tempfile +import unittest + +ROOT = Path(__file__).resolve().parents[1] +FILES = ['ci/check_native_distribution.rb', '.github/workflows/native-distribution.yml', '.github/workflows/windows-gnu-cabi-candidate.yml', '.github/workflows/native-distribution-check.yml', '.github/workflows/release.yml', 'scripts/stage_php_gnu_release.py'] +GNU = '.github/workflows/windows-gnu-cabi-candidate.yml' +NATIVE = '.github/workflows/native-distribution.yml' + + +class NativeDistributionContractTests(unittest.TestCase): + def check(self, path=None, before=None, after=None): + with tempfile.TemporaryDirectory() as temporary: + root = Path(temporary) + for name in FILES: + destination = root / name + destination.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(ROOT / name, destination) + if path is not None: + destination = root / path + text = destination.read_text(encoding='utf-8') + self.assertEqual(text.count(before), 1, 'unique actual workflow mutation anchor') + destination.write_text(text.replace(before, after), encoding='utf-8') + return subprocess.run(['ruby', 'ci/check_native_distribution.rb'], cwd=root, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, timeout=30) + + def reject(self, path, before, after, reason): + result = self.check(path, before, after) + self.assertNotEqual(result.returncode, 0) + self.assertIn(reason, result.stderr) + + def test_actual_workflow_preserves_all_six_native_roles(self): + result = self.check() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn('PHP native source, notice, runtime and publication contracts verified', result.stdout) + + def test_missing_genuine_gnu_target_is_rejected(self): + self.reject(GNU, ' - target: aarch64-pc-windows-gnullvm\n compiler:', ' - target: aarch64-pc-windows-msvc\n compiler:', 'wrong GNU target matrix') + + def test_missing_source_forwarding_is_rejected(self): + self.reject(NATIVE, ' source-ref: ${{ inputs.source-ref }}\n', ' source-ref: fixed-unreviewed-source\n', 'GNU source is not forwarded') + + def test_missing_consumer_success_gate_is_rejected(self): + self.reject(GNU, ' needs: [cabi-gnullvm, php-consumers]\n', ' needs: [cabi-gnullvm]\n', 'missing complete GNU consumer gate') + + def test_wrong_arm_runner_is_rejected(self): + self.reject(GNU, ' - os: windows-11-arm\n', ' - os: windows-latest\n', 'incomplete genuine PHP consumer matrix') + + def test_missing_sidecar_role_is_rejected(self): + self.reject('scripts/stage_php_gnu_release.py', "asset.name + '.NOTICE.manifest.json'", "asset.name + '.unexpected.json'", 'missing GNU delivery role .NOTICE.manifest.json') + + def test_missing_publication_dependency_is_rejected(self): + self.reject('.github/workflows/release.yml', ' needs: [build-native]\n', ' needs: [missing-native]\n', 'missing native publication gate') + + def test_broad_release_artifact_selector_is_rejected(self): + self.reject('.github/workflows/release.yml', ' pattern: native-distribution-*\n', " pattern: 'native-*'\n", 'unsafe artifact download') + + +if __name__ == '__main__': + unittest.main() diff --git a/ci/test_rust_compiler_notices.py b/ci/test_rust_compiler_notices.py new file mode 100644 index 0000000..66d0e24 --- /dev/null +++ b/ci/test_rust_compiler_notices.py @@ -0,0 +1,83 @@ +"""Проверить exact compiler grants без запуска compiler или native payload.""" + +import hashlib +import json +from pathlib import Path +import shutil +import sys +import tempfile +import unittest + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / 'scripts')) +from rust_compiler_notices import collect, RUST_REVISION, PROFILE_SHA256 + +RUSTC = 'rustc 1.99.1 (fixture)\ncommit-hash: ' + RUST_REVISION + '\nrelease: 1.99.1\nLLVM version: 23.1.1\n' + + +class CompilerNoticesTests(unittest.TestCase): + def source_copy(self, root): + profile = ROOT / 'ci/rust-compiler-notices.json' + (root / 'ci').mkdir() + shutil.copyfile(profile, root / 'ci/rust-compiler-notices.json') + for item in json.loads(profile.read_bytes())['materials']: + path = root / item['path'] + path.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(ROOT / item['path'], path) + + def test_complete_original_collection(self): + result = collect(ROOT, RUSTC) + self.assertEqual(result['profile_sha256'], PROFILE_SHA256) + self.assertEqual(result['compiler_builtins_license'], 'MIT AND Apache-2.0 WITH LLVM-exception') + self.assertEqual(result['libm_license'], 'MIT') + self.assertEqual(len(result['materials']), 14) + self.assertEqual(sum(item['legal_document'] for item in result['materials']), 4) + for item in result['materials']: + raw = item['text'].encode('utf-8') + self.assertEqual(len(raw), item['bytes']) + self.assertEqual(hashlib.sha256(raw).hexdigest(), item['sha256']) + self.assertEqual(hashlib.sha1(b'blob ' + str(len(raw)).encode() + bytes([0]) + raw).hexdigest(), item['git_blob']) + + def test_wrong_compiler_source_or_version_is_rejected(self): + for text in [RUSTC.replace('1.99.1', '1.88.0'), RUSTC.replace(RUST_REVISION, '0' * 40)]: + with self.assertRaisesRegex(ValueError, 'unreviewed Rust compiler'): + collect(ROOT, text) + + def test_changed_profile_is_rejected(self): + with tempfile.TemporaryDirectory() as temporary: + root = Path(temporary) + self.source_copy(root) + (root / 'ci/rust-compiler-notices.json').write_bytes(b'{}') + with self.assertRaisesRegex(ValueError, 'profile differs'): + collect(root, RUSTC) + + def test_changed_original_is_rejected(self): + with tempfile.TemporaryDirectory() as temporary: + root = Path(temporary) + self.source_copy(root) + profile = json.loads((root / 'ci/rust-compiler-notices.json').read_bytes()) + path = root / profile['materials'][0]['path'] + path.write_bytes(path.read_bytes() + b'changed') + with self.assertRaisesRegex(ValueError, 'original identity differs'): + collect(root, RUSTC) + + def test_missing_original_is_rejected(self): + with tempfile.TemporaryDirectory() as temporary: + root = Path(temporary) + self.source_copy(root) + profile = json.loads((root / 'ci/rust-compiler-notices.json').read_bytes()) + (root / profile['materials'][0]['path']).unlink() + with self.assertRaisesRegex(ValueError, 'missing or symlinked'): + collect(root, RUSTC) + + def test_copyright_holders_and_legacy_credits_preserved(self): + result = collect(ROOT, RUSTC) + documents = {item['role']: item['text'] for item in result['materials'] if item['legal_document']} + self.assertIn('Jorge Aparicio', documents['libm-LICENSE.txt']) + self.assertIn('Rich Felker', documents['libm-LICENSE.txt']) + self.assertIn('LLVM', documents['compiler-builtins-LICENSE.txt']) + self.assertIn('compiler-rt-CREDITS.TXT', documents) + + +if __name__ == '__main__': + unittest.main() diff --git a/ci/test_zig_link_capture.py b/ci/test_zig_link_capture.py new file mode 100644 index 0000000..628aa93 --- /dev/null +++ b/ci/test_zig_link_capture.py @@ -0,0 +1,55 @@ +"""Проверить прозрачность audit wrapper и передачу ошибок.""" + +import os +from pathlib import Path +import subprocess +import tempfile +import unittest + + +class ZigLinkCaptureTest(unittest.TestCase): + def setUp(self): + self.directory = tempfile.TemporaryDirectory() + self.addCleanup(self.directory.cleanup) + self.root = Path(self.directory.name) + self.real = self.root / 'actual-zig' + self.real.write_text('#!/usr/bin/env bash\nprintf "%s\\n" "$@"\nprintf diagnostic >&2\nexit "${STATUS:-0}"\n') + self.real.chmod(0o755) + self.output = self.root / 'link.map' + self.wrapper = Path(__file__).resolve().parents[1] / 'scripts/capture-zig-link.sh' + + def invoke(self, *args, status=0): + return subprocess.run( + ['bash', str(self.wrapper), *args], + env={**os.environ, 'KTAV_REAL_ZIG': str(self.real), 'KTAV_LINK_MAP': str(self.output), 'STATUS': str(status)}, + capture_output=True, + ) + + def test_plain_invocation_does_not_create_map(self): + result = self.invoke('version') + self.assertEqual(result.returncode, 0) + self.assertEqual(result.stdout, b'version\n') + self.assertEqual(result.stderr, b'diagnostic') + self.assertFalse(self.output.exists()) + + def test_map_preserves_arguments_and_streams(self): + result = self.invoke('cc', '-Wl,--print-map', 'path with spaces.o') + self.assertEqual(result.returncode, 0) + self.assertEqual(result.stdout, b'cc\n-Wl,--print-map\npath with spaces.o\n') + self.assertEqual(self.output.read_bytes(), result.stdout) + self.assertEqual(result.stderr, b'diagnostic') + + def test_failed_link_is_not_hidden_by_tee(self): + result = self.invoke('cc', '-Wl,--print-map', status=23) + self.assertEqual(result.returncode, 23) + self.assertEqual(self.output.read_bytes(), result.stdout) + self.assertEqual(result.stderr, b'diagnostic') + + def test_failed_plain_command_is_preserved(self): + result = self.invoke('version', status=19) + self.assertEqual(result.returncode, 19) + self.assertFalse(self.output.exists()) + + +if __name__ == '__main__': + unittest.main() diff --git a/ci/test_zig_runtime_notices.py b/ci/test_zig_runtime_notices.py new file mode 100644 index 0000000..fcec362 --- /dev/null +++ b/ci/test_zig_runtime_notices.py @@ -0,0 +1,68 @@ +"""Проверить fail-closed source identity и состав runtime archives.""" + +import hashlib +import importlib.util +from pathlib import Path +import tempfile +import unittest + +spec = importlib.util.spec_from_file_location( + 'zig_runtime_notices', Path(__file__).resolve().parents[1] / 'scripts/zig_runtime_notices.py' +) +module = importlib.util.module_from_spec(spec) +spec.loader.exec_module(module) + + +class ZigRuntimeNoticeTest(unittest.TestCase): + def map_text(self, extra=''): + lines = [' 0 0 1 1 /build/library.rcgu.o:(.text)'] + lines += [f' 0 0 1 1 /cache/{archive}(/cache/{member}):(.text)' for archive, member in module.EXPECTED_MEMBERS] + return '\n'.join(lines) + extra + + def test_exact_archive_members(self): + self.assertEqual(set(module._members(self.map_text())), module.EXPECTED_MEMBERS) + + def test_unknown_archive_rejected(self): + with self.assertRaisesRegex(ValueError, 'archive membership'): + module._members(self.map_text('\n 0 0 1 1 /cache/libgcc.a(other.o):(.text)')) + + def test_unknown_member_rejected(self): + with self.assertRaisesRegex(ValueError, 'archive membership'): + module._members(self.map_text('\n 0 0 1 1 /cache/libunwind.a(new.o):(.text)')) + + def test_missing_member_rejected(self): + with self.assertRaisesRegex(ValueError, 'archive membership'): + module._members(self.map_text().replace('stat64-2.32.o', 'changed.o')) + + def test_direct_crt_rejected(self): + with self.assertRaisesRegex(ValueError, 'direct object'): + module._members(self.map_text('\n 0 0 1 1 /cache/crtbeginS.o:(.text)')) + + def test_source_bytes_match_catalog(self): + with tempfile.TemporaryDirectory() as directory: + lib = Path(directory) / 'lib' + source = lib / 'libunwind/source.c' + source.parent.mkdir(parents=True) + source.write_bytes(b'reviewed source') + catalog = {'source_revision': module.REVISION, 'zig_version': '0.14.0', 'files': [ + {'path': 'lib/libunwind/source.c', 'sha256': hashlib.sha256(b'reviewed source').hexdigest()} + ]} + self.assertEqual(module._sources(lib, catalog), catalog['files']) + source.write_bytes(b'changed source') + with self.assertRaisesRegex(ValueError, 'source changed'): + module._sources(lib, catalog) + + def test_wrong_revision_rejected(self): + with self.assertRaisesRegex(ValueError, 'revision'): + module._sources(Path('.'), {'source_revision': '0' * 40, 'zig_version': '0.14.0'}) + + def test_path_escape_rejected(self): + with self.assertRaisesRegex(ValueError, 'path'): + module._sources(Path('.'), { + 'source_revision': module.REVISION, 'zig_version': '0.14.0', + 'files': [{'path': 'lib/../outside', 'sha256': '0' * 64}], + }) + + +if __name__ == '__main__': + unittest.main() diff --git a/ci/zig-runtime-catalog.json b/ci/zig-runtime-catalog.json new file mode 100644 index 0000000..fb12afc --- /dev/null +++ b/ci/zig-runtime-catalog.json @@ -0,0 +1,299 @@ +{ + "credits": "libunwind LICENSE.TXT refers to CREDITS.TXT, which is absent from this pinned Zig subtree.", + "files": [ + { + "git_blob": "9ce01373c89082fd81e8ea0793aab0978140526b", + "license_text": "The MIT License (Expat)\n\nCopyright (c) Zig contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", + "path": "LICENSE", + "sha256": "5c537d6853e005298a285d508cff9ac7192cea23576c840d485b2b586a7ff177" + }, + { + "git_blob": "56d857f0273649bbdd14a73016ee87c507108b12", + "license_text": "This file contains the copying permission notices for various files in the\nGNU C Library distribution that have copyright owners other than the Free\nSoftware Foundation. These notices all require that a copy of the notice\nbe included in the accompanying documentation and be distributed with\nbinary distributions of the code, so be sure to include this file along\nwith any binary distributions derived from the GNU C Library.\n\n\f\nAll code incorporated from 4.4 BSD is distributed under the following\nlicense:\n\nCopyright (C) 1991 Regents of the University of California.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n3. [This condition was removed.]\n4. Neither the name of the University nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\nOR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\nOUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGE.\n\f\nThe DNS resolver code, taken from BIND 4.9.5, is copyrighted by UC\nBerkeley, by Digital Equipment Corporation and by Internet Software\nConsortium. The DEC portions are under the following license:\n\nPortions Copyright (C) 1993 by Digital Equipment Corporation.\n\nPermission to use, copy, modify, and distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies, and\nthat the name of Digital Equipment Corporation not be used in\nadvertising or publicity pertaining to distribution of the document or\nsoftware without specific, written prior permission.\n\nTHE SOFTWARE IS PROVIDED ``AS IS'' AND DIGITAL EQUIPMENT CORP.\nDISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL\nDIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING\nFROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\nNEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION\nWITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\f\nThe ISC portions are under the following license:\n\nPortions Copyright (c) 1996-1999 by Internet Software Consortium.\n\nPermission to use, copy, modify, and distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS\nALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE\nCONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\nDAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\nPROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\nACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nSOFTWARE.\n\f\nThe Sun RPC support (from rpcsrc-4.0) is covered by the following\nlicense:\n\nCopyright (c) 2010, Oracle America, Inc.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n * Neither the name of the \"Oracle America, Inc.\" nor the names of its\n contributors may be used to endorse or promote products derived\n from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\f\nThe following CMU license covers some of the support code for Mach,\nderived from Mach 3.0:\n\nMach Operating System\nCopyright (C) 1991,1990,1989 Carnegie Mellon University\nAll Rights Reserved.\n\nPermission to use, copy, modify and distribute this software and its\ndocumentation is hereby granted, provided that both the copyright\nnotice and this permission notice appear in all copies of the\nsoftware, derivative works or modified versions, and any portions\nthereof, and that both notices appear in supporting documentation.\n\nCARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS ``AS IS''\nCONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR\nANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.\n\nCarnegie Mellon requests users of this software to return to\n\n Software Distribution Coordinator\n School of Computer Science\n Carnegie Mellon University\n Pittsburgh PA 15213-3890\n\nor Software.Distribution@CS.CMU.EDU any improvements or\nextensions that they make and grant Carnegie Mellon the rights to\nredistribute these changes.\n\f\nThe file if_ppp.h is under the following CMU license:\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n 3. Neither the name of the University nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND\n CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,\n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\f\nThe files nss/getnameinfo.c and nss/getaddrinfo.c are copyright (C) by\nCraig Metz and are distributed under the following license:\n\n/* The Inner Net License, Version 2.00\n\n The author(s) grant permission for redistribution and use in source and\nbinary forms, with or without modification, of the software and documentation\nprovided that the following conditions are met:\n\n0. If you receive a version of the software that is specifically labelled\n as not being for redistribution (check the version message and/or README),\n you are not permitted to redistribute that version of the software in any\n way or form.\n1. All terms of the all other applicable copyrights and licenses must be\n followed.\n2. Redistributions of source code must retain the authors' copyright\n notice(s), this list of conditions, and the following disclaimer.\n3. Redistributions in binary form must reproduce the authors' copyright\n notice(s), this list of conditions, and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n4. [The copyright holder has authorized the removal of this clause.]\n5. Neither the name(s) of the author(s) nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY ITS AUTHORS AND CONTRIBUTORS ``AS IS'' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n If these license terms cause you a real problem, contact the author. */\n\f\nThe file sunrpc/des_impl.c is copyright Eric Young:\n\nCopyright (C) 1992 Eric Young\nCollected from libdes and modified for SECURE RPC by Martin Kuck 1994\nThis file is distributed under the terms of the GNU Lesser General\nPublic License, version 2.1 or later - see the file COPYING.LIB for details.\nIf you did not receive a copy of the license with this program, please\nsee to obtain a copy.\n\f\nThe file inet/rcmd.c is under a UCB copyright and the following:\n\nCopyright (C) 1998 WIDE Project.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n3. Neither the name of the project nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\nOR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\nOUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGE.\n\f\nThe file posix/runtests.c is copyright Tom Lord:\n\nCopyright 1995 by Tom Lord\n\n All Rights Reserved\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth that copyright notice and this permission notice appear in\nsupporting documentation, and that the name of the copyright holder not be\nused in advertising or publicity pertaining to distribution of the\nsoftware without specific, written prior permission.\n\nTom Lord DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO\nEVENT SHALL TOM LORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR\nCONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF\nUSE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n\f\nThe posix/rxspencer tests are copyright Henry Spencer:\n\nCopyright 1992, 1993, 1994, 1997 Henry Spencer. All rights reserved.\nThis software is not subject to any license of the American Telephone\nand Telegraph Company or of the Regents of the University of California.\n\nPermission is granted to anyone to use this software for any purpose on\nany computer system, and to alter it and redistribute it, subject\nto the following restrictions:\n\n1. The author is not responsible for the consequences of use of this\n software, no matter how awful, even if they arise from flaws in it.\n\n2. The origin of this software must not be misrepresented, either by\n explicit claim or by omission. Since few users ever read sources,\n credits must appear in the documentation.\n\n3. Altered versions must be plainly marked as such, and must not be\n misrepresented as being the original software. Since few users\n ever read sources, credits must appear in the documentation.\n\n4. This notice may not be removed or altered.\n\f\nThe file posix/PCRE.tests is copyright University of Cambridge:\n\nCopyright (c) 1997-2003 University of Cambridge\n\nPermission is granted to anyone to use this software for any purpose on any\ncomputer system, and to redistribute it freely, subject to the following\nrestrictions:\n\n1. This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n2. The origin of this software must not be misrepresented, either by\n explicit claim or by omission. In practice, this means that if you use\n PCRE in software that you distribute to others, commercially or\n otherwise, you must put a sentence like this\n\n Regular expression support is provided by the PCRE library package,\n which is open source software, written by Philip Hazel, and copyright\n by the University of Cambridge, England.\n\n somewhere reasonably visible in your documentation and in any relevant\n files or online help data or similar. A reference to the ftp site for\n the source, that is, to\n\n ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/\n\n should also be given in the documentation. However, this condition is not\n intended to apply to whole chains of software. If package A includes PCRE,\n it must acknowledge it, but if package B is software that includes package\n A, the condition is not imposed on package B (unless it uses PCRE\n independently).\n\n3. Altered versions must be plainly marked as such, and must not be\n misrepresented as being the original software.\n\n4. If PCRE is embedded in any software that is released under the GNU\n General Purpose Licence (GPL), or Lesser General Purpose Licence (LGPL),\n then the terms of that licence shall supersede any condition above with\n which it is incompatible.\n\f\nFiles from Sun fdlibm are copyright Sun Microsystems, Inc.:\n\nCopyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n\nDeveloped at SunPro, a Sun Microsystems, Inc. business.\nPermission to use, copy, modify, and distribute this\nsoftware is freely granted, provided that this notice\nis preserved.\n\f\nVarious long double libm functions are copyright Stephen L. Moshier:\n\nCopyright 2001 by Stephen L. Moshier \n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, see\n . */\n\f\nCopyright (c) 1995 IBM Corporation\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\f\nVarious files in sysdeps/ieee754/flt-32, taken from the CORE-MATH project\n, are distributed under the\nfollowing license:\n\nCopyright (c) 2022-2024 Alexei Sibidanov. Paul Zimmermann.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "path": "lib/libc/glibc/LICENSES", + "sha256": "b22a69aa3f80a5201818c66cb0df0f25f9fa13cf5861b0093a058dbd12d50dce" + }, + { + "git_blob": "c4dd3acd604680a20d52ec46d1c4384806bd4a15", + "path": "lib/libc/glibc/io/fstat64-2.32.c", + "sha256": "cd4bac3397e220917fbb81bfbe56385a724a750936a0e1e6a1dc377cfca1c65a", + "source_notices": [ + "/* Copyright (C) 1996-2020 Free Software Foundation, Inc.\n This file is part of the GNU C Library.\n\n The GNU C Library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n In addition to the permissions in the GNU Lesser General Public\n License, the Free Software Foundation gives you unlimited\n permission to link the compiled version of this file with other\n programs, and to distribute those programs without any restriction\n coming from the use of this file. (The GNU Lesser General Public\n License restrictions do apply in other respects; for example, they\n cover modification of the file, and distribution when not linked\n into another program.)\n\n Note that people who make modified versions of this file are not\n obligated to grant this special exception for their modified\n versions; it is their choice whether to do so. The GNU Lesser\n General Public License gives permission to release a modified\n version without this exception; this exception also makes it\n possible to release a modified version which carries forward this\n exception.\n\n The GNU C Library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with the GNU C Library; if not, see\n . */" + ] + }, + { + "git_blob": "8b6b662f3ac4f69357ae6ffbf6d9692b4c646170", + "path": "lib/libc/glibc/io/stat64-2.32.c", + "sha256": "dfa5093069bbbca665a543cf1a3c9d19aec1f69b125b6a668b91e0c1f272a848", + "source_notices": [ + "/* Copyright (C) 1996-2020 Free Software Foundation, Inc.\n This file is part of the GNU C Library.\n\n The GNU C Library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n In addition to the permissions in the GNU Lesser General Public\n License, the Free Software Foundation gives you unlimited\n permission to link the compiled version of this file with other\n programs, and to distribute those programs without any restriction\n coming from the use of this file. (The GNU Lesser General Public\n License restrictions do apply in other respects; for example, they\n cover modification of the file, and distribution when not linked\n into another program.)\n\n Note that people who make modified versions of this file are not\n obligated to grant this special exception for their modified\n versions; it is their choice whether to do so. The GNU Lesser\n General Public License gives permission to release a modified\n version without this exception; this exception also makes it\n possible to release a modified version which carries forward this\n exception.\n\n The GNU C Library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with the GNU C Library; if not, see\n . */" + ] + }, + { + "git_blob": "1e3120621caeb62648745a42f7a9a25d1e2731ab", + "license_text": "==============================================================================\nThe LLVM Project is under the Apache License v2.0 with LLVM Exceptions:\n==============================================================================\n\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n\n---- LLVM Exceptions to the Apache 2.0 License ----\n\nAs an exception, if, as a result of your compiling your source code, portions\nof this Software are embedded into an Object form of such source code, you\nmay redistribute such embedded portions in such Object form without complying\nwith the conditions of Sections 4(a), 4(b) and 4(d) of the License.\n\nIn addition, if you combine or link compiled forms of this Software with\nsoftware that is licensed under the GPLv2 (\"Combined Software\") and if a\ncourt of competent jurisdiction determines that the patent provision (Section\n3), the indemnity provision (Section 9) or other Section of the License\nconflicts with the conditions of the GPLv2, you may retroactively and\nprospectively choose to deem waived or otherwise exclude such Section(s) of\nthe License, but only in their entirety and only with respect to the Combined\nSoftware.\n\n==============================================================================\nSoftware from third parties included in the LLVM Project:\n==============================================================================\nThe LLVM Project contains third party software which is under different license\nterms. All such code will be identified clearly using at least one of two\nmechanisms:\n1) It will be in a separate directory tree with its own `LICENSE.txt` or\n `LICENSE` file at the top containing the specific license and restrictions\n which apply to that software, or\n2) It will contain specific license and restriction terms at the top of every\n file.\n\n==============================================================================\nLegacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):\n==============================================================================\n\nThe libunwind library is dual licensed under both the University of Illinois\n\"BSD-Like\" license and the MIT license. As a user of this code you may choose\nto use it under either license. As a contributor, you agree to allow your code\nto be used under both.\n\nFull text of the relevant licenses is included below.\n\n==============================================================================\n\nUniversity of Illinois/NCSA\nOpen Source License\n\nCopyright (c) 2009-2019 by the contributors listed in CREDITS.TXT\n\nAll rights reserved.\n\nDeveloped by:\n\n LLVM Team\n\n University of Illinois at Urbana-Champaign\n\n http://llvm.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal with\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\n * Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimers.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimers in the\n documentation and/or other materials provided with the distribution.\n\n * Neither the names of the LLVM Team, University of Illinois at\n Urbana-Champaign, nor the names of its contributors may be used to\n endorse or promote products derived from this Software without specific\n prior written permission.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nCONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE\nSOFTWARE.\n\n==============================================================================\n\nCopyright (c) 2009-2014 by the contributors listed in CREDITS.TXT\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", + "path": "lib/libunwind/LICENSE.TXT", + "sha256": "b5efebcaca80879234098e52d1725e6d9eb8fb96a19fce625d39184b705f7b6d" + }, + { + "git_blob": "bb7fe4c83a3c17774f1466e8f8378d8dc0dd810f", + "path": "lib/libunwind/include/__libunwind_config.h", + "sha256": "5e963e752482bf8cefcabbb6b4f3f09ae3bff247f59b7a2f1d8fcabbe539c18b", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "b2dae8feed9a3b57d017fe72b4f8cf0a7a41ba50", + "path": "lib/libunwind/include/libunwind.h", + "sha256": "9f9a52c31dbb093e09ccef880652fdced398070b6062515a2fa118361cf8afb7", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Compatible with libunwind API documented at:\n// http://www.nongnu.org/libunwind/man/libunwind(3).html\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "4c48e33c3c177d9cdf7e4805fc4797628ff54ac4", + "path": "lib/libunwind/include/mach-o/compact_unwind_encoding.h", + "sha256": "06f58e9d0058583b6da91ca2328fa663f80d089496a4979754ee7608fe9bd877", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Darwin's alternative to DWARF based unwind encodings.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "b1775d3a3decc76e1a0916fead1aafbc6fa0fb51", + "path": "lib/libunwind/include/unwind.h", + "sha256": "e4a58637fc8ca1d29cd600c3c4416aafed50085edf276fa076214c8d81c263f0", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// C++ ABI Level 1 ABI documented at:\n// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "6277a1457f8966012848302489915bf7298e10ec", + "path": "lib/libunwind/include/unwind_arm_ehabi.h", + "sha256": "80edc55ea33440f46e676e4ac805ecdc64a7222f2c9107f8ff6b1097eb8a51df", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// C++ ABI Level 1 ABI documented at:\n// https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "d94a6183be2901e3167779691726b307970254a7", + "path": "lib/libunwind/include/unwind_itanium.h", + "sha256": "c8cc61d806e13a2e75e93f1c15afd432f93a99283d27d15f5a28a3ebee989cba", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// C++ ABI Level 1 ABI documented at:\n// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "5551c7d4bef1c569decb20ba240c923581453457", + "path": "lib/libunwind/src/AddressSpace.hpp", + "sha256": "c12382512621f8c749d4ecfa05964c59905a340ba1ea75adecf944d69b383def", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Abstracts accessing local vs remote address spaces.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "a7a8a153d86a43fe1ae02a353faec2530a8bb1a9", + "path": "lib/libunwind/src/CompactUnwinder.hpp", + "sha256": "438d320fb6503e1c82160d96fe8c774e03d51a755226deb28a1b7d248bd4ef9a", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Does runtime stack unwinding using compact unwind encodings.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "bd9ece60ee5881ac64b0f853eb7076ff797db02e", + "path": "lib/libunwind/src/DwarfInstructions.hpp", + "sha256": "cb6a9be6832b948089b2dcdb2f008fcca0e723b2269c420d9a138a227bfa1b8c", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Processor specific interpretation of DWARF unwind info.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "0682942ce13799e87ee1bad80323f41d9d050d22", + "path": "lib/libunwind/src/DwarfParser.hpp", + "sha256": "b468ad4ab82af4f9e9c4aae7664529a49051e22b69ffad964794ae9a9370b87c", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Parses DWARF CFIs (FDEs and CIEs).\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "0662a1321e2c75e1e8f13f0f049d1b3748d4295f", + "path": "lib/libunwind/src/EHHeaderParser.hpp", + "sha256": "31c22a99d0a0eef3341db272812e343b08b0de00518b2372eb189d977d9dda38", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Parses ELF .eh_frame_hdr sections.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "296064d8e2e675994a39227e2912c893892b8612", + "path": "lib/libunwind/src/FrameHeaderCache.hpp", + "sha256": "ba9d7a8ae3c936fce48639f3f0964f67657cc8ffcccdb75416d3fa7c304845e9", + "source_notices": [ + "//===-FrameHeaderCache.hpp ------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n// Cache the elf program headers necessary to unwind the stack more efficiently\n// in the presence of many dsos.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "344d35641f07a8037f9cb2535106479b8a6d26f2", + "path": "lib/libunwind/src/RWMutex.hpp", + "sha256": "3d6f718c49944207310eafc2231767016a971c6be6612d31dcc673312f23e724", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Abstract interface to shared reader/writer log, hiding platform and\n// configuration differences.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "861e6b5f6f2c583344713e80a7d85e1f9682e2f4", + "path": "lib/libunwind/src/Registers.hpp", + "sha256": "1cb6f74ec9a42ef8a3ebe242e348e4a35b9758bb416d884e9c62e806dd2c3157", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Models register sets for supported processors.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "05475c6ac1e2fe60db522a0c138f5acb3f5b1945", + "path": "lib/libunwind/src/Unwind-EHABI.cpp", + "sha256": "352ab8ec8eaa93a790c261c418ffea18fc78d55ba805601df369a310dc086417", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Implements ARM zero-cost C++ exceptions\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "ff3b5fc6fea77fba0f4ebc4d74e72bac984935fa", + "path": "lib/libunwind/src/Unwind-EHABI.h", + "sha256": "c04fdebcd31e26de7615b82751373cc64ef83d02b24dbaaf0e112d0a559acc6b", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "b2bb119ed6d2997664383ef5f7e278d305d5403d", + "path": "lib/libunwind/src/Unwind-seh.cpp", + "sha256": "fcbd1821df294fe80c4870a03f663cb1156b809a598a53ebfaf68bb57110ae19", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n//\n// Implements SEH-based Itanium C++ exceptions.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "7e8faf098fe14b11625de7c5bbc6e58bdb3c46dd", + "path": "lib/libunwind/src/Unwind-sjlj.c", + "sha256": "708ea7f9377fea810c2df6196448763f9436aff28fb81463d79f09548c70f096", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Implements setjump-longjump based C++ exceptions\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "b18b32c5d17847afaeff405e6f63474f2b188de2", + "path": "lib/libunwind/src/Unwind-wasm.c", + "sha256": "5b7d0b8e2befed5899b32682e907f9cde35f244df1c9d61f82c9013e1c824d2c", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Implements Wasm exception handling proposal\n// (https://github.com/WebAssembly/exception-handling) based C++ exceptions\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "06e654197351df6449ca5a3da88794fadd4c2c38", + "path": "lib/libunwind/src/UnwindCursor.hpp", + "sha256": "61cf048bb46b1f023796b1b9a951233ee7a0fb1c03468254daeb1e268f883e53", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// C++ interface to lower levels of libunwind\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "32c872ffade1fd0c02c6e9d30a56fb48c2080193", + "path": "lib/libunwind/src/UnwindLevel1-gcc-ext.c", + "sha256": "3bed106de18fec9d1c52cb7bc3d5db89d3225252f3c0312597d159edbbd6e802", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Implements gcc extensions to the C++ ABI Exception Handling Level 1.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "7e785f4d31e716a3be3febb9d6f569cf41fef217", + "path": "lib/libunwind/src/UnwindLevel1.c", + "sha256": "829414f3c44b210ae26d14aac61ea59b6ba1a57bfc46c8500d7561dd60c42d4e", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Implements C++ ABI Exception Handling Level 1 as documented at:\n// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html\n// using libunwind\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "9d34c7909ed3719b9a083275af8c3558e5255dc0", + "path": "lib/libunwind/src/UnwindRegistersRestore.S", + "sha256": "83a0e71b5a1ea8c90be705882c16b8fbc5b2e2c9866566988dd1094abcacd183", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "5bf6055fe4147f660d9f97715fe455488ea0e5d3", + "path": "lib/libunwind/src/UnwindRegistersSave.S", + "sha256": "5d4d94842641d34a0213947bc33c69c2283ca4bf54d70673c41ce77303bb68ad", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "66194ab4a16ba227b321ef8160845803fa1d0ce5", + "path": "lib/libunwind/src/Unwind_AIXExtras.cpp", + "sha256": "fec55a3209fcd9ad4eac0f9820d599ceef2750a155e2aa10f66aacdf6f0fb536", + "source_notices": [ + "//===--------------------- Unwind_AIXExtras.cpp -------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "f8e83e138eff50eb526eefa8ba83d06fe0b643a0", + "path": "lib/libunwind/src/assembly.h", + "sha256": "c3d765a0642dd4bc59e2f92ab16be2e9192432fcb834b8b313a69eb9165e699a", + "source_notices": [ + "/* ===-- assembly.h - libUnwind assembler support macros -------------------===\n *\n * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n * See https://llvm.org/LICENSE.txt for license information.\n * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n *\n * ===----------------------------------------------------------------------===\n *\n * This file defines macros for use in libUnwind assembler source.\n * This file is not part of the interface of this library.\n *\n * ===----------------------------------------------------------------------===\n */" + ] + }, + { + "git_blob": "47d7616a7322c3224ed4569735731ee8275606df", + "path": "lib/libunwind/src/cet_unwind.h", + "sha256": "52ae0493950aa103238c9d923f674ba062171ffed4c5f5a64609c64a06baeeff", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "deb5a4d4d73d467f72d4e7d183b5d25b0128f7cf", + "path": "lib/libunwind/src/config.h", + "sha256": "65d0561fb6af948fbbf32e9c9b087bbc7013c94faae9565d7edabc18336bce95", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Defines macros used within libunwind project.\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "174277d5a795084bbd20e2a58a5244620deceb81", + "path": "lib/libunwind/src/dwarf2.h", + "sha256": "d57f3a7a4dff483b64a8503d6a0ac8e8c3a79c52da9cdc637b8d53d52a16a1f6", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n", + "/*\n These constants were taken from version 3 of the DWARF standard,\n which is Copyright (c) 2005 Free Standards Group, and\n Copyright (c) 1992, 1993 UNIX International, Inc.\n*/" + ] + }, + { + "git_blob": "1d9c7f4d17b85038ea2412ad47d8d48cf054fed6", + "path": "lib/libunwind/src/gcc_personality_v0.c", + "sha256": "f83c80299344ddf08ca6dc7f7032249dfac5c00ebac3b222f01d27556147294e", + "source_notices": [ + "//===-- gcc_personality_v0.c - Implement __gcc_personality_v0 -------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "cf39ec5f7dbdf9b6485cccb804f5104f3b3a83d1", + "path": "lib/libunwind/src/libunwind.cpp", + "sha256": "0be28214f509a9301f7745b20b8f5e0667a9bd4f42ecf946dd7ee5dcec40b0d1", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Implements unw_* functions from \n//\n//===----------------------------------------------------------------------===//\n" + ] + }, + { + "git_blob": "28db43a4f6eef20dd5967f420a8d8fea552cf8c5", + "path": "lib/libunwind/src/libunwind_ext.h", + "sha256": "ee76dbef4b8a910e6d9302e643ae4566ce5ed8f4cbe5e612804506a089b291e1", + "source_notices": [ + "//===----------------------------------------------------------------------===//\n//\n// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n// See https://llvm.org/LICENSE.txt for license information.\n// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n//\n//\n// Extensions to libunwind API.\n//\n//===----------------------------------------------------------------------===//\n" + ] + } + ], + "schema_version": 1, + "source_revision": "5ad91a646a753cc3eecd8751e61cf458dadd9ac4", + "zig_version": "0.14.0" +} \ No newline at end of file diff --git a/crates/cabi/build.rs b/crates/cabi/build.rs new file mode 100644 index 0000000..c9b5a09 --- /dev/null +++ b/crates/cabi/build.rs @@ -0,0 +1,39 @@ +use std::{env, fs, io::Read, path::PathBuf}; + +fn main() { + println!("cargo:rerun-if-env-changed=KTAV_NATIVE_NOTICES"); + println!("cargo:rerun-if-changed=build.rs"); + let out = PathBuf::from(env::var_os("OUT_DIR").expect("Cargo must provide OUT_DIR")); + let generated = out.join("native_notices.rs"); + let Some(path) = env::var_os("KTAV_NATIVE_NOTICES") else { + fs::write(generated, "").expect("write development notice stub"); + return; + }; + let path = PathBuf::from(path); + println!("cargo:rerun-if-changed={}", path.display()); + let mut payload = Vec::new(); + fs::File::open(path) + .expect("open prepared native notice gzip") + .take(4 * 1024 * 1024 + 1) + .read_to_end(&mut payload) + .expect("read prepared native notice gzip"); + assert!( + payload.starts_with(&[0x1f, 0x8b]) && payload.len() <= 4 * 1024 * 1024, + "native notice payload must be a bounded gzip" + ); + let length = u64::try_from(payload.len()).expect("native notice length must fit u64"); + let mut resource = b"KTAV-NOTICES-GZIP-v1\0".to_vec(); + resource.extend_from_slice(&length.to_le_bytes()); + resource.extend_from_slice(&payload); + fs::write(out.join("native_notices.bin"), resource).expect("write native notice resource"); + fs::write( + generated, + r#"/// Статический gzip JSON: маркер, длина LE64 и payload; не передаётся в ktav_free. +#[used] +#[no_mangle] +pub static KTAV_THIRD_PARTY_NOTICES: [u8; include_bytes!(concat!(env!("OUT_DIR"), "/native_notices.bin")).len()] = + *include_bytes!(concat!(env!("OUT_DIR"), "/native_notices.bin")); +"#, + ) + .expect("write native notice declaration"); +} diff --git a/crates/cabi/src/lib.rs b/crates/cabi/src/lib.rs index 2192a91..08cf7ae 100644 --- a/crates/cabi/src/lib.rs +++ b/crates/cabi/src/lib.rs @@ -21,3 +21,6 @@ //! own requirement. ktav::declare_cabi!(); + +// Статический license resource; не передаётся в ktav_free. +include!(concat!(env!("OUT_DIR"), "/native_notices.rs")); diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..548a82d --- /dev/null +++ b/deny.toml @@ -0,0 +1,12 @@ +[licenses] +confidence-threshold = 0.8 +allow = [ + "Apache-2.0", + "BSD-2-Clause", + "BSD-3-Clause", + "BSL-1.0", + "ISC", + "MIT", + "Unicode-3.0", + "Zlib", +] diff --git a/docs/ru/README.ru.md b/docs/ru/README.ru.md index 6e7d7eb..36acfa6 100644 --- a/docs/ru/README.ru.md +++ b/docs/ru/README.ru.md @@ -466,6 +466,31 @@ PHP-бэкенд (`Ktav\PureBackend`) обходит всю эту цепочк - Готовые бинарники для: `linux/amd64`, `linux/arm64`, `darwin/amd64`, `darwin/arm64`, `windows/amd64`, `windows/arm64`. +## Подготовленный нативный Windows runtime + +Подготовленный Windows C ABI **0.8.1** использует настоящие цели +`x86_64-pc-windows-gnullvm` и `aarch64-pc-windows-gnullvm` с закреплённым +LLVM MinGW UCRT SDK вместо сборки MSVC. Публичные имена DLL сохранены. +Архитектура процесса PHP должна совпадать с DLL: x64 PHP на Windows ARM64 +по-прежнему нужна x64 DLL. + +Перед staging выполняются исходные native/pure suites на настоящих x64 +и ARM64 PHP CLI. Собранный из исходников ARM64 PHP host — инструмент CI, +а не включённый интерпретатор или зависимость потребителя. Потребителям +нужны PHP runtime и `ext-ffi`, но не Rust или нативный компилятор; чистый +режим остаётся самодостаточным со стандартным `ext-json`. + +Каждая DLL сохраняет встроенный ресурс Cargo/std, Rust compiler и исходных +текстов/лицензий GNU runtime. Соседние `.NOTICE.json` и +`.NOTICE.manifest.json` сохраняют полные оригинальные материалы и +идентичности бинарника/исходников. Системные Windows/UCRT API остаются +зависимостями ОС. + +Шесть ранее документированных canonical round-trip gaps не изменены. +Две cycle specifications без `expect()` дополнительно требуют отдельного +bounded native/pure child execution. Эта подготовка не публикует пакет, +не принимает Microsoft redistribution terms и не исправляет старые assets. + ## Лицензия MIT OR Apache-2.0 — см. [LICENSE-MIT](../../LICENSE-MIT) и [LICENSE-APACHE](../../LICENSE-APACHE). diff --git a/docs/zh/README.zh.md b/docs/zh/README.zh.md index 73d3159..7eaff0d 100644 --- a/docs/zh/README.zh.md +++ b/docs/zh/README.zh.md @@ -450,6 +450,26 @@ x.y\.z: v - 预编译二进制覆盖:`linux/amd64`、`linux/arm64`、`darwin/amd64`、 `darwin/arm64`、`windows/amd64`、`windows/arm64`。 +## 准备中的 Windows 原生运行时 + +准备中的 **0.8.1** Windows C ABI 使用真正的 +`x86_64-pc-windows-gnullvm` 和 `aarch64-pc-windows-gnullvm` 目标以及固定的 +LLVM MinGW UCRT SDK,而非 MSVC 构建路径。公开 DLL 文件名不变。 +PHP 进程的 CPU 必须与 DLL 匹配:Windows ARM64 上的 x64 PHP 进程仍需 x64 DLL。 + +暂存发行载荷之前,会在真正的 x64 和 ARM64 PHP CLI 上运行原始 native/pure +测试。源码构建的 ARM64 PHP host 只是 CI 工具,不是捆绑的解释器或消费者依赖。 +使用者需要自己的 PHP runtime 和 `ext-ffi`,无需 Rust 或原生编译器; +纯模式仍然自包含,只需标准 `ext-json`。 + +每个 DLL 保留内嵌的 Cargo/std、Rust 编译器和 GNU runtime 源码/许可资源。 +旁边的 `.NOTICE.json` 和 `.NOTICE.manifest.json` 保留完整原文及二进制/源码身份。 +Windows 系统/UCRT API 仍由操作系统提供。 + +此前记录的六个 canonical round-trip 限制保持不变。两个不含 `expect()` 的 +cycle specifications 还必须单独执行有界 native/pure 子进程测试。这些准备不会 +发布软件包、接受 Microsoft 再分发条款,也不会修复历史资产。 + ## 许可证 MIT OR Apache-2.0 —— 见 [LICENSE-MIT](../../LICENSE-MIT) 和 [LICENSE-APACHE](../../LICENSE-APACHE)。 diff --git a/root-docs/README/manifest.js b/root-docs/README/manifest.js index 58d8d6f..77d3a0d 100644 --- a/root-docs/README/manifest.js +++ b/root-docs/README/manifest.js @@ -12,6 +12,7 @@ export default [ "key-escaping", "native-lib-resolution", "runtime-support", + "windows-native-runtime", "license", "other-implementations" ] diff --git a/root-docs/README/windows-native-runtime/body-1.md b/root-docs/README/windows-native-runtime/body-1.md new file mode 100644 index 0000000..15d1e5b --- /dev/null +++ b/root-docs/README/windows-native-runtime/body-1.md @@ -0,0 +1,72 @@ +>>>>> lang=en +## Prepared Windows native runtime + +The prepared **0.8.1** Windows C ABI uses genuine +`x86_64-pc-windows-gnullvm` and `aarch64-pc-windows-gnullvm` targets with +the pinned LLVM MinGW UCRT SDK instead of the MSVC build path. Public DLL +filenames are unchanged. PHP process CPU must match the DLL; an x64 PHP +process on Windows ARM64 still needs the x64 DLL. + +Original native/pure suites run on genuine x64 and ARM64 PHP CLI before +release staging. The source-built ARM64 PHP host is a CI tool, not a +bundled interpreter or a consumer dependency. Consumers need their PHP +runtime and `ext-ffi`, not Rust or a native compiler; pure mode remains +self-contained with standard `ext-json` only. + +Each DLL retains its embedded Cargo/std, Rust compiler and GNU runtime +source/grant resource. Adjacent `.NOTICE.json` and `.NOTICE.manifest.json` +retain the complete original materials and binary/source identities. +Windows system/UCRT APIs remain OS dependencies. + +Six previously documented canonical round-trip gaps remain unchanged. +The two no-expectation cycle specifications also require separate bounded +native/pure child execution. This runtime preparation does not publish a +package, accept Microsoft redistribution terms or repair historical assets. + +>>>>> lang=ru +## Подготовленный нативный Windows runtime + +Подготовленный Windows C ABI **0.8.1** использует настоящие цели +`x86_64-pc-windows-gnullvm` и `aarch64-pc-windows-gnullvm` с закреплённым +LLVM MinGW UCRT SDK вместо сборки MSVC. Публичные имена DLL сохранены. +Архитектура процесса PHP должна совпадать с DLL: x64 PHP на Windows ARM64 +по-прежнему нужна x64 DLL. + +Перед staging выполняются исходные native/pure suites на настоящих x64 +и ARM64 PHP CLI. Собранный из исходников ARM64 PHP host — инструмент CI, +а не включённый интерпретатор или зависимость потребителя. Потребителям +нужны PHP runtime и `ext-ffi`, но не Rust или нативный компилятор; чистый +режим остаётся самодостаточным со стандартным `ext-json`. + +Каждая DLL сохраняет встроенный ресурс Cargo/std, Rust compiler и исходных +текстов/лицензий GNU runtime. Соседние `.NOTICE.json` и +`.NOTICE.manifest.json` сохраняют полные оригинальные материалы и +идентичности бинарника/исходников. Системные Windows/UCRT API остаются +зависимостями ОС. + +Шесть ранее документированных canonical round-trip gaps не изменены. +Две cycle specifications без `expect()` дополнительно требуют отдельного +bounded native/pure child execution. Эта подготовка не публикует пакет, +не принимает Microsoft redistribution terms и не исправляет старые assets. + +>>>>> lang=zh +## 准备中的 Windows 原生运行时 + +准备中的 **0.8.1** Windows C ABI 使用真正的 +`x86_64-pc-windows-gnullvm` 和 `aarch64-pc-windows-gnullvm` 目标以及固定的 +LLVM MinGW UCRT SDK,而非 MSVC 构建路径。公开 DLL 文件名不变。 +PHP 进程的 CPU 必须与 DLL 匹配:Windows ARM64 上的 x64 PHP 进程仍需 x64 DLL。 + +暂存发行载荷之前,会在真正的 x64 和 ARM64 PHP CLI 上运行原始 native/pure +测试。源码构建的 ARM64 PHP host 只是 CI 工具,不是捆绑的解释器或消费者依赖。 +使用者需要自己的 PHP runtime 和 `ext-ffi`,无需 Rust 或原生编译器; +纯模式仍然自包含,只需标准 `ext-json`。 + +每个 DLL 保留内嵌的 Cargo/std、Rust 编译器和 GNU runtime 源码/许可资源。 +旁边的 `.NOTICE.json` 和 `.NOTICE.manifest.json` 保留完整原文及二进制/源码身份。 +Windows 系统/UCRT API 仍由操作系统提供。 + +此前记录的六个 canonical round-trip 限制保持不变。两个不含 `expect()` 的 +cycle specifications 还必须单独执行有界 native/pure 子进程测试。这些准备不会 +发布软件包、接受 Microsoft 再分发条款,也不会修复历史资产。 + diff --git a/root-docs/README/windows-native-runtime/meta.js b/root-docs/README/windows-native-runtime/meta.js new file mode 100644 index 0000000..eb86416 --- /dev/null +++ b/root-docs/README/windows-native-runtime/meta.js @@ -0,0 +1,7 @@ +export default { + "kind": "frontmatter", + "number": null, + "level": null, + "title": null, + "bodyParts": 1 +} diff --git a/scripts/cabi_gnullvm_notices.py b/scripts/cabi_gnullvm_notices.py new file mode 100644 index 0000000..7e0ddcb --- /dev/null +++ b/scripts/cabi_gnullvm_notices.py @@ -0,0 +1,213 @@ +"""Подготовить и проверить C ABI-specific GNU/LLVM runtime notices.""" + +import gzip +import hashlib +import importlib.util +import json +from pathlib import Path, PurePosixPath +import re +import sys +import urllib.error +import urllib.request + +CATALOG = 'ci/licenses/cabi-gnullvm-runtime.json' +CATALOG_SHA = '793c61f930c31a27f987c169eec4a07cc8c140dd16e91653fec3d029f803a816' +SDK_SHA = 'fd5462b7f5d93b2ff981fcd3f9c7e427e47f3203c64ea91c27bcc444eebd74cd' +REVISIONS = {'mingw-w64/mingw-w64': '0d6dfbc348dfad714761c0a7151615767f96bcb5', 'llvm/llvm-project': '7a941dfb2877a0b8cf30323fefa85ad019e0b0f5'} +DATA_ONLY = {'mingw-w64-crt/crt/cinitexe.c', 'mingw-w64-crt/misc/mingw_matherr.c', 'mingw-w64-crt/misc/dllmain.c'} +MAX_FILE = 4 * 1024 * 1024 +MAX_TOTAL = 64 * 1024 * 1024 + + +def read(path, limit): + if path.is_symlink() or not path.is_file(): + raise ValueError('missing or symlinked C ABI runtime input') + with path.open('rb') as source: + raw = source.read(limit + 1) + if len(raw) > limit: + raise ValueError('C ABI runtime input exceeds bound') + return raw + + +def catalogue(root): + raw = read(root / CATALOG, MAX_FILE) + if hashlib.sha256(raw).hexdigest() != CATALOG_SHA: + raise ValueError('unreviewed C ABI runtime catalogue') + document = json.loads(raw) + if document['sdk_archive_sha256'] != SDK_SHA or len(document['source_files']) != 58 or len(document['original_documents']) != 6: + raise ValueError('C ABI runtime catalogue roles differ') + return document + + +def source_file_path(evidence, item): + relative = PurePosixPath(item['path']) + if relative.is_absolute() or '..' in relative.parts or '\\' in item['path']: + raise ValueError('unsafe original source path') + matches = [repo.split('/')[-1] for repo, revision in REVISIONS.items() if item['source'].startswith('https://raw.githubusercontent.com/' + repo + '/' + revision + '/')] + if len(matches) != 1: + raise ValueError('unreviewed C ABI source repository') + return evidence / 'runtime-originals' / matches[0] / item['path'] + + +def original(url): + if not any(url.startswith('https://raw.githubusercontent.com/' + repo + '/' + revision + '/') for repo, revision in REVISIONS.items()): + raise ValueError('unreviewed C ABI runtime source URL') + for attempt in range(3): + try: + with urllib.request.urlopen(url, timeout=90) as response: + raw = response.read(MAX_FILE + 1) + break + except urllib.error.HTTPError as error: + if error.code not in {500, 502, 503, 504} or attempt == 2: + raise + except (TimeoutError, urllib.error.URLError): + if attempt == 2: + raise + if len(raw) > MAX_FILE: + raise ValueError('C ABI original source exceeds bound') + return raw + + +def verify_sources(document, fetch=original, evidence=None): + seen = set() + total = 0 + for item in [*document['source_files'], *document['original_documents']]: + if item['source'] in seen: + raise ValueError('duplicate C ABI original source') + seen.add(item['source']) + raw = fetch(item['source']) + total += len(raw) + blob = hashlib.sha1(b'blob ' + str(len(raw)).encode() + b'\0' + raw).hexdigest() + if len(raw) > MAX_FILE or total > MAX_TOTAL or hashlib.sha256(raw).hexdigest() != item['sha256'] or item.get('git_blob', blob) != blob: + raise ValueError('C ABI source/grant bytes differ') + if 'text' in item: + if item['text'].encode('utf-8') != raw: + raise ValueError('C ABI legal document differs') + else: + comments = re.findall(r'/\*.*?\*/|(?:^[ \t]*//[^\n]*(?:\n|$))+', raw.decode('utf-8'), re.M | re.S) + notices = [value for value in comments if re.search(r'copyright|licens|public domain|permission|redistribution', value, re.I)] + if item['source_notices'] != notices or not notices and item['path'] not in DATA_ONLY: + raise ValueError('C ABI file-level original notice differs') + if evidence is not None: + path = source_file_path(evidence, item) + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(raw) + + +def augment(bundle, document, target): + if target not in document['targets'] or bundle.get('schema_version') != 1 or 'non_cargo_runtimes' in bundle: + raise ValueError('unexpected C ABI runtime preparation state') + runtime = {'name': 'LLVM-MinGW DLL startup, MinGW runtime and LLVM libunwind', 'target': target, 'catalog_sha256': CATALOG_SHA, 'sdk_archive_sha256': SDK_SHA, 'sdk_recipe_revision': document['sdk_recipe_revision'], 'mingw_revision': document['mingw_revision'], 'llvm_revision': document['llvm_revision'], 'selected_inputs': document['targets'][target], 'source_files': document['source_files'], 'original_documents': document['original_documents'], 'coverage': document['coverage']} + return {**bundle, 'non_cargo_runtimes': [runtime], 'coverage': bundle['coverage'] + ' Includes source-reviewed C ABI GNU/LLVM runtime grants; final retained-input gate is required.'} + + +def plain_notice(document): + sections = ['Ktav C ABI Windows GNU/LLVM runtime notices.\nOriginal terms follow unchanged; the source/header notice set is conservative.\n'] + for item in document['original_documents']: + sections.extend(['\n===== ' + item['source'] + ' =====\n', item['text']]) + for item in document['source_files']: + sections.extend(['\n===== ' + item['source'] + ' =====\n', '\n'.join(item['source_notices'])]) + return '\n'.join(sections).encode('utf-8') + + +def prepare(evidence, target): + root = Path(__file__).resolve().parents[1] + document = catalogue(root) + if target not in document['targets'] or (evidence / 'NOTICE.cargo-std.json').exists(): + raise ValueError('unreviewed target or runtime already prepared') + verify_sources(document, evidence=evidence) + before = read(evidence / 'NOTICE.json', MAX_TOTAL) + combined = (json.dumps(augment(json.loads(before), document, target), ensure_ascii=False, sort_keys=True, indent=2) + '\n').encode('utf-8') + payload = gzip.compress(combined, mtime=0) + if len(combined) > MAX_TOTAL or len(payload) > MAX_FILE: + raise ValueError('C ABI combined runtime notice exceeds bound') + (evidence / 'NOTICE.cargo-std.json').write_bytes(before) + (evidence / 'NOTICE.json').write_bytes(combined) + (evidence / 'NOTICE.json.gz').write_bytes(payload) + (evidence / 'NOTICE.windows-runtime.txt').write_bytes(plain_notice(document)) + (evidence / 'cabi-gnullvm-runtime.json').write_bytes(read(root / CATALOG, MAX_FILE)) + + +def retained_objects(raw): + objects = set() + for line in raw.splitlines(): + match = re.match(rb'^[0-9a-fA-F]+\s+[0-9a-fA-F]+\s+\d+\s{2,}(.+):\([^\r\n]*\)\s*$', line) + if match and b'.rcgu.o' not in match[1]: + objects.add(match[1].decode('utf-8').replace('\\', '/').rsplit('/', 1)[-1]) + return objects + + +def sdk_inputs(items, target): + selected = [] + marker = 'llvm-mingw-20261020-ucrt-x86_64/' + seen = set() + for item in items: + name = item['path'].replace('\\', '/') + if not name.endswith(('.a', '.o', '.obj', '.rlib', '.lib')): + continue + if marker not in name: + cargo = r'/target/' + re.escape(target) + r'/release/deps/' + rust = r'/[.]rustup/toolchains/1[.]99[.]1-x86_64-pc-windows-msvc/lib/rustlib/' + re.escape(target) + r'/lib/' + accepted = re.search(cargo + r'ktav_cabi[.][^/]+[.]rcgu[.]o$', name) or re.search(cargo + r'rustc[^/]+/libstd-[0-9a-f]+[.]rlib$', name) or re.search(rust + r'libcompiler_builtins-[0-9a-f]+[.]rlib$', name) + if not accepted: + raise ValueError('native linker input outside reviewed SDK/Rust boundary') + continue + if name.count(marker) != 1: + raise ValueError('unreviewed SDK linker input path') + relative = name.split(marker, 1)[1] + if relative in seen or '..' in PurePosixPath(relative).parts: + raise ValueError('duplicate or unsafe SDK linker input') + seen.add(relative) + selected.append({'path': relative, 'size': item['bytes'], 'sha256': item['sha256']}) + return sorted(selected, key=lambda item: item['path']) + + +def verify_inputs(items, mapping, document, target): + if target not in document['targets']: + raise ValueError('unreviewed C ABI target') + expected = document['targets'][target] + if sdk_inputs(items, target) != expected['sdk_inputs'] or retained_objects(mapping) != set(expected['retained_objects']): + raise ValueError('C ABI SDK bytes or retained objects differ from reviewed profile') + + +def verify(evidence, binary, target): + spec = importlib.util.spec_from_file_location('cabi_notice_scanner', Path(__file__).with_name('check_embedded_notices.py')) + scanner = importlib.util.module_from_spec(spec) + spec.loader.exec_module(scanner) + + document = catalogue(Path(__file__).resolve().parents[1]) + if target not in document['targets']: + raise ValueError('unreviewed C ABI target') + records = {item['source']: item for item in [*document['source_files'], *document['original_documents']]} + verify_sources(document, fetch=lambda url: read(source_file_path(evidence, records[url]), MAX_FILE)) + raw = read(binary, 128 * 1024 * 1024) + notice = read(evidence / 'NOTICE.json', MAX_TOTAL) + before = json.loads(read(evidence / 'NOTICE.cargo-std.json', MAX_TOTAL)) + if json.loads(notice) != augment(before, document, target) or scanner._extract(raw)[0] != notice: + raise ValueError('actual C ABI runtime resource differs') + if read(evidence / 'NOTICE.windows-runtime.txt', MAX_TOTAL) != plain_notice(document): + raise ValueError('plain C ABI original notices differ') + if read(evidence / 'cabi-gnullvm-runtime.json', MAX_FILE) != read(Path(__file__).resolve().parents[1] / CATALOG, MAX_FILE): + raise ValueError('staged C ABI catalogue differs') + identity = json.loads(read(evidence / 'native-verification.json', MAX_FILE)) + mapping = read(evidence / 'native-link.map', 32 * 1024 * 1024) + if identity['target'] != target or identity['binary_sha256'] != hashlib.sha256(raw).hexdigest() or identity['map_sha256'] != hashlib.sha256(mapping).hexdigest(): + raise ValueError('actual C ABI release/map identity differs') + expected = document['targets'][target] + inputs = json.loads(read(evidence / 'link-input-fingerprints.json', MAX_FILE)) + verify_inputs(inputs, mapping, document, target) + provenance = json.loads(read(evidence / 'source-provenance.json', MAX_FILE)) + if provenance['sdk_archive_sha256'] != SDK_SHA or provenance['source_ref'] != 'c979b98d6decfb3c2808c8177eecf5d34dbc8634': + raise ValueError('C ABI source/SDK identity differs') + report = {'target': target, 'binary_sha256': identity['binary_sha256'], 'notice_sha256': hashlib.sha256(notice).hexdigest(), 'catalog_sha256': CATALOG_SHA, 'sdk_inputs': len(expected['sdk_inputs']), 'retained_runtime_objects': len(expected['retained_objects']), 'source_records': len(document['source_files']), 'scope': 'Actual C ABI DLL resource and target-specific SDK input/source-grant binding; not NAPI compatibility, other targets or historical published artifact clearance.'} + (evidence / 'native-runtime-verification.json').write_text(json.dumps(report, sort_keys=True, indent=2) + '\n', encoding='utf-8') + print(json.dumps(report, sort_keys=True)) + + +if __name__ == '__main__': + if len(sys.argv) == 4 and sys.argv[1] == 'prepare': + prepare(Path(sys.argv[2]), sys.argv[3]) + elif len(sys.argv) == 5 and sys.argv[1] == 'verify': + verify(Path(sys.argv[2]), Path(sys.argv[3]), sys.argv[4]) + else: + raise SystemExit('usage: cabi_gnullvm_notices.py prepare EVIDENCE TARGET | verify EVIDENCE BINARY TARGET') diff --git a/scripts/capture-zig-link.sh b/scripts/capture-zig-link.sh new file mode 100755 index 0000000..fe4fbd5 --- /dev/null +++ b/scripts/capture-zig-link.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ " $* " == *"--print-map"* ]]; then + "${KTAV_REAL_ZIG:?}" "$@" | tee -a "${KTAV_LINK_MAP:?}" +else + exec "${KTAV_REAL_ZIG:?}" "$@" +fi diff --git a/scripts/cargo_notice_bundle.py b/scripts/cargo_notice_bundle.py new file mode 100644 index 0000000..7196de5 --- /dev/null +++ b/scripts/cargo_notice_bundle.py @@ -0,0 +1,113 @@ +"""Собрать notices без локальных путей и проверить их в wheel.""" + +from __future__ import annotations + +import base64 +import csv +import hashlib +import io +import json +import sys +import zipfile +from pathlib import Path, PurePosixPath + +from collect_cargo_notices import _collect, _packages + +MEMBER = "ktav/_third_party/NOTICE.json" +MAX_BUNDLE_BYTES = 64 * 1024 * 1024 + + +def _text(data: bytes) -> dict: + return {"sha256": hashlib.sha256(data).hexdigest(), "text": data.decode("utf-8")} + + +def _package(package: dict) -> dict: + return {key: package.get(key) for key in ("name", "version", "source")} + + +def _build(evidence: Path) -> bytes: + metadata = json.loads((evidence / "metadata.json").read_text(encoding="utf-8")) + report = json.loads((evidence / "licenses.json").read_text(encoding="utf-8")) + packages = _packages(metadata, report) + identities = {package["id"]: _package(package) for package in packages} + licenses = [] + for entry in report["licenses"]: + used_by = [identities[item["crate"]["id"]] for item in entry["used_by"]] + licenses.append( + { + **_text(entry["text"].encode("utf-8")), + "used_by": sorted(used_by, key=lambda item: json.dumps(item, sort_keys=True)), + } + ) + notices = _collect(metadata, report) + for entry in notices["notices"]: + path = PurePosixPath(entry["path"]) + if path.is_absolute() or ".." in path.parts or "\\" in entry["path"]: + raise ValueError("unsafe notice path") + rustc = (evidence / "rustc.txt").read_bytes() + if not rustc.startswith(b"rustc ") or b"\ncommit-hash: " not in rustc: + raise ValueError("missing verbose rustc provenance") + stdlib = (evidence / "COPYRIGHT-library.html").read_bytes() + if not stdlib.strip(): + raise ValueError("empty Rust standard library report") + lock = (evidence / "Cargo.lock").read_bytes() + if not lock.strip(): + raise ValueError("empty Cargo.lock") + result = { + "schema_version": 1, + "coverage": "Resolved Cargo graph and Rust standard library; not a linked-code inventory. " + "Non-Cargo runtimes require separate evidence.", + "cargo_lock_sha256": hashlib.sha256(lock).hexdigest(), + "packages": sorted(identities.values(), key=lambda item: json.dumps(item, sort_keys=True)), + "licenses": sorted(licenses, key=lambda item: json.dumps(item, sort_keys=True)), + "notices": notices["notices"], + "rustc": rustc.decode("utf-8"), + "rust_standard_library": _text(stdlib), + } + data = (json.dumps(result, ensure_ascii=False, sort_keys=True, indent=2) + "\n").encode() + if len(data) > MAX_BUNDLE_BYTES: + raise ValueError("notice bundle size limit exceeded") + return data + + +def _verify(wheel_path: Path, expected: bytes) -> None: + if not expected or len(expected) > MAX_BUNDLE_BYTES: + raise ValueError("invalid expected bundle size") + with zipfile.ZipFile(wheel_path) as wheel: + members = [item for item in wheel.infolist() if item.filename == MEMBER] + if len(members) != 1 or members[0].file_size != len(expected): + raise ValueError("missing, duplicate or wrong-sized wheel notice bundle") + if wheel.read(members[0]) != expected: + raise ValueError("wheel notice bundle differs from build evidence") + records = [item for item in wheel.infolist() if item.filename.endswith(".dist-info/RECORD")] + if len(records) != 1 or records[0].filename.count("/") != 1: + raise ValueError("unexpected wheel RECORD") + rows = csv.reader(io.StringIO(wheel.read(records[0]).decode("utf-8"))) + matching = [row for row in rows if row and row[0] == MEMBER] + digest = base64.urlsafe_b64encode(hashlib.sha256(expected).digest()).rstrip(b"=").decode() + if matching != [[MEMBER, f"sha256={digest}", str(len(expected))]]: + raise ValueError("notice bundle does not match wheel RECORD") + + +def main() -> None: + """Собрать bundle или сверить точные байты упакованного файла.""" + if len(sys.argv) != 4 or sys.argv[1] not in {"build", "verify"}: + raise SystemExit( + "usage: cargo_notice_bundle.py build EVIDENCE OUTPUT | verify WHEEL BUNDLE" + ) + try: + if sys.argv[1] == "build": + data = _build(Path(sys.argv[2])) + output = Path(sys.argv[3]) + output.parent.mkdir(parents=True, exist_ok=True) + with output.open("xb") as destination: + destination.write(data) + else: + _verify(Path(sys.argv[2]), Path(sys.argv[3]).read_bytes()) + except (OSError, ValueError, KeyError, TypeError, zipfile.BadZipFile) as exc: + raise SystemExit(str(exc)) from exc + print(f"notice bundle {sys.argv[1]} verified") + + +if __name__ == "__main__": + main() diff --git a/scripts/check_embedded_notices.py b/scripts/check_embedded_notices.py new file mode 100644 index 0000000..e70868f --- /dev/null +++ b/scripts/check_embedded_notices.py @@ -0,0 +1,72 @@ +"""Проверить license resource без исполнения native binary.""" + +from __future__ import annotations + +import gzip +import hashlib +import io +import json +import sys +from pathlib import Path + +MARKER = b"KTAV-NOTICES-GZIP-v1\0" +MAX_GZIP = 4 * 1024 * 1024 +MAX_JSON = 64 * 1024 * 1024 +MAX_BINARY = 128 * 1024 * 1024 + + +def _read(path: Path, limit: int) -> bytes: + with path.open("rb") as source: + data = source.read(limit + 1) + if len(data) > limit: + raise ValueError(f"file exceeds notice verification limit: {path.name}") + return data + + +def _extract(binary: bytes) -> tuple[bytes, int]: + offset = binary.find(MARKER) + if offset < 0 or binary.find(MARKER, offset + 1) >= 0: + raise ValueError("missing or duplicate embedded notice resource") + start = offset + len(MARKER) + if start + 8 > len(binary): + raise ValueError("truncated embedded notice length") + size = int.from_bytes(binary[start : start + 8], "little") + start += 8 + if not 0 < size <= MAX_GZIP or start + size > len(binary): + raise ValueError("invalid embedded notice size") + with gzip.GzipFile(fileobj=io.BytesIO(binary[start : start + size])) as source: + data = source.read(MAX_JSON + 1) + if len(data) > MAX_JSON: + raise ValueError("embedded notice JSON exceeds size limit") + return data, size + + +def main() -> None: + """Сверить embedded resource с ожидаемым source-backed bundle.""" + if len(sys.argv) != 3: + raise SystemExit("usage: check_embedded_notices.py BINARY EXPECTED_NOTICE_JSON") + try: + binary = _read(Path(sys.argv[1]), MAX_BINARY) + expected = _read(Path(sys.argv[2]), MAX_JSON) + actual, compressed_size = _extract(binary) + if actual != expected: + raise ValueError("embedded notices differ from the locked build evidence") + bundle = json.loads(actual) + if bundle.get("schema_version") != 1: + raise ValueError("unexpected embedded notice schema") + report = { + "schema_version": 1, + "binary": Path(sys.argv[1]).name, + "binary_sha256": hashlib.sha256(binary).hexdigest(), + "notice_sha256": hashlib.sha256(actual).hexdigest(), + "cargo_lock_sha256": bundle["cargo_lock_sha256"], + "notice_bytes": len(actual), + "compressed_bytes": compressed_size, + } + except (OSError, EOFError, ValueError, KeyError, TypeError) as exc: + raise SystemExit(str(exc)) from exc + print(json.dumps(report, sort_keys=True, indent=2)) + + +if __name__ == "__main__": + main() diff --git a/scripts/check_php_gnu_consumer.py b/scripts/check_php_gnu_consumer.py new file mode 100644 index 0000000..30a2a89 --- /dev/null +++ b/scripts/check_php_gnu_consumer.py @@ -0,0 +1,98 @@ +"""Проверить original PHP suites на actual GNU DLL и matching native PHP CPU.""" + +import hashlib +import json +import os +import re +from pathlib import Path +import shutil +import struct +import subprocess +import sys + +SOURCE = 'c979b98d6decfb3c2808c8177eecf5d34dbc8634' +arch = os.environ['EXPECTED_ARCH'] +target = os.environ['EXPECTED_TARGET'] +if os.environ['ACTUAL_RUNNER_ARCH'].lower() != arch: + raise ValueError('genuine matching CPU runner required') +if subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip() != SOURCE: + raise ValueError('original PHP source identity differs') +root = Path(os.environ['RUNNER_TEMP']) +delivered = root / 'php-gnu-delivered' +output = root / 'php-gnu-consumer' +output.mkdir() +raw = (delivered / 'ktav_cabi.dll').read_bytes() +checksum = hashlib.sha256(raw).hexdigest() +identity = json.loads((delivered / 'native-verification.json').read_bytes()) +runtime = json.loads((delivered / 'native-runtime-verification.json').read_bytes()) +if identity['target'] != target or identity['binary_sha256'] != checksum or runtime['binary_sha256'] != checksum: + raise ValueError('actual GNU DLL differs from source-bound producer') +if Path('target').exists(): + raise ValueError('consumer requires fresh no-Rust native build tree') +binary = Path('target/release/ktav_cabi.dll') +binary.parent.mkdir(parents=True) +binary.write_bytes(raw) +php = Path(os.environ.get('KTAV_TEST_PHP') or shutil.which('php')).resolve() +php_bytes = php.read_bytes() +pe = int.from_bytes(php_bytes[60:64], 'little') +expected_machine = 0xAA64 if arch == 'arm64' else 0x8664 +if php_bytes[:2] != b'MZ' or pe + 24 > len(php_bytes) or php_bytes[pe:pe + 4] != b'PE\0\0' or struct.unpack_from(' list[dict]: + packages = metadata.get("packages") + crates = report.get("crates") + licenses = report.get("licenses") + if not isinstance(packages, list) or not packages: + raise ValueError("Cargo metadata has no packages") + if not isinstance(crates, list) or not isinstance(licenses, list) or not licenses: + raise ValueError("license report is incomplete") + package_ids = {p["id"] for p in packages} + reported_ids = {c["package"]["id"] for c in crates} + licensed_ids = {u["crate"]["id"] for lic in licenses for u in lic["used_by"]} + if ( + len(package_ids) != len(packages) + or package_ids != reported_ids + or package_ids != licensed_ids + ): + raise ValueError("Cargo graph and license report coverage differ") + if any(not lic.get("source_path") or not lic.get("text") for lic in licenses): + raise ValueError("license report contains an unverified fallback") + return sorted(packages, key=lambda p: p["id"]) + + +def _notice_files(root: Path) -> list[Path]: + if root.is_symlink() or not root.is_dir(): + raise ValueError(f"invalid package source directory: {root}") + pending = [root] + found = [] + while pending: + directory = pending.pop() + for path in sorted(directory.iterdir()): + if path.name in {".git", "target"}: + continue + if path.is_symlink(): + if NOTICE_NAME.fullmatch(path.name) or path.is_dir(): + raise ValueError(f"unverified symlink in package source: {path}") + continue + if path.is_dir(): + pending.append(path) + elif path.is_file() and NOTICE_NAME.fullmatch(path.name): + found.append(path) + return sorted(found) + + +def _collect(metadata: dict, report: dict) -> dict: + packages = _packages(metadata, report) + notices = [] + total = 0 + for package in packages: + root = Path(package["manifest_path"]).parent + for path in _notice_files(root): + size = path.stat().st_size + if size > MAX_NOTICE_BYTES or total + size > MAX_TOTAL_BYTES: + raise ValueError(f"notice size limit exceeded: {path}") + data = path.read_bytes() + if len(data) != size: + raise ValueError(f"notice changed while reading: {path}") + total += len(data) + notices.append( + { + "package": package["name"], + "version": package["version"], + "source": package.get("source"), + "path": path.relative_to(root).as_posix(), + "sha256": hashlib.sha256(data).hexdigest(), + "text": data.decode("utf-8"), + } + ) + return {"schema_version": 1, "package_count": len(packages), "notices": notices} + + +def main() -> None: + """Проверить покрытие, сохранить уведомления и хеши.""" + if len(sys.argv) != 4: + raise SystemExit("usage: collect_cargo_notices.py METADATA LICENSES OUTPUT") + try: + metadata = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8")) + report = json.loads(Path(sys.argv[2]).read_text(encoding="utf-8")) + result = _collect(metadata, report) + Path(sys.argv[3]).write_text( + json.dumps(result, ensure_ascii=False, indent=2) + "\n", encoding="utf-8" + ) + except (OSError, ValueError, KeyError, TypeError) as exc: + raise SystemExit(str(exc)) from exc + print(f"Collected {len(result['notices'])} notices from {result['package_count']} packages") + + +if __name__ == "__main__": + main() diff --git a/scripts/prepare_cabi_notices.py b/scripts/prepare_cabi_notices.py new file mode 100644 index 0000000..1a368bd --- /dev/null +++ b/scripts/prepare_cabi_notices.py @@ -0,0 +1,98 @@ +"""Подготовить source-backed notices для самостоятельной C ABI библиотеки.""" + +from __future__ import annotations + +import gzip +import json +import shutil +import subprocess +import sys +from pathlib import Path + +from cargo_notice_bundle import _build +from rust_compiler_notices import collect as compiler_notices + + +def _prepare(evidence: Path) -> None: + root = Path.cwd().resolve() + evidence = evidence.resolve() + if evidence.is_relative_to(root): + raise ValueError("notice evidence must be outside project sources") + if evidence.exists() and (not evidence.is_dir() or any(evidence.iterdir())): + raise ValueError("notice evidence directory must be empty") + lock = Path("Cargo.lock") + if not lock.is_file() or lock.is_symlink(): + raise ValueError("prepare an existing regular Cargo.lock first") + original = lock.read_bytes() + raw = subprocess.check_output( + ["cargo", "metadata", "--locked", "--all-features", "--format-version", "1"] + ) + metadata = json.loads(raw) + crate = (root / "crates" / "cabi").resolve() + own = [p for p in metadata["packages"] if Path(p["manifest_path"]).resolve().parent == crate] + if len(own) != 1 or own[0].get("license") != "MIT OR Apache-2.0": + raise ValueError("unexpected C ABI workspace license") + for name in ("LICENSE-MIT", "LICENSE-APACHE"): + original_license = root / name + target = crate / name + if target.is_symlink(): + raise ValueError("C ABI license copy must not be a symlink") + if target.exists(): + if target.read_bytes() != original_license.read_bytes(): + raise ValueError("C ABI license copy differs from workspace license") + else: + shutil.copyfile(original_license, target) + for package in metadata["packages"]: + if evidence.is_relative_to(Path(package["manifest_path"]).resolve().parent): + raise ValueError("notice evidence overlaps a Cargo package source") + evidence.mkdir(parents=True, exist_ok=True) + (evidence / "metadata.json").write_bytes(raw) + (evidence / "Cargo.lock").write_bytes(original) + (evidence / "rustc.txt").write_bytes( + subprocess.check_output(["rustc", "--version", "--verbose"]) + ) + sysroot = subprocess.check_output(["rustc", "--print", "sysroot"], text=True).strip() + shutil.copyfile( + Path(sysroot) / "share" / "doc" / "rust" / "COPYRIGHT-library.html", + evidence / "COPYRIGHT-library.html", + ) + licenses = subprocess.check_output( + [ + "cargo", + "about", + "generate", + "--locked", + "--all-features", + "--fail", + "--config", + "ci/about.toml", + "--format", + "json", + ] + ) + (evidence / "licenses.json").write_bytes(licenses) + bundle = json.loads(_build(evidence)) + bundle["rust_compiler_builtins"] = compiler_notices(root, bundle["rustc"]) + data = (json.dumps(bundle, ensure_ascii=False, sort_keys=True, indent=2) + "\n").encode("utf-8") + compressed = gzip.compress(data, mtime=0) + if len(data) > 64 * 1024 * 1024 or len(compressed) > 4 * 1024 * 1024: + raise ValueError("compressed native notices exceed the resource size limit") + if lock.read_bytes() != original: + raise ValueError("Cargo.lock changed during notice preparation") + (evidence / "NOTICE.json").write_bytes(data) + (evidence / "NOTICE.json.gz").write_bytes(compressed) + print(f"Prepared {len(data)} notice bytes, compressed to {len(compressed)} bytes") + + +def main() -> None: + """Подготовить notices без изменения dependency resolution.""" + if len(sys.argv) != 2: + raise SystemExit("usage: prepare_cabi_notices.py EMPTY_EVIDENCE_DIRECTORY") + try: + _prepare(Path(sys.argv[1])) + except (OSError, ValueError, KeyError, TypeError, subprocess.CalledProcessError) as exc: + raise SystemExit(str(exc)) from exc + + +if __name__ == "__main__": + main() diff --git a/scripts/probe_php_arm_host.py b/scripts/probe_php_arm_host.py new file mode 100644 index 0000000..615d6f7 --- /dev/null +++ b/scripts/probe_php_arm_host.py @@ -0,0 +1,126 @@ +"""Собрать отдельный ARM64 PHP CLI/FFI host; не включать его в Ktav assets.""" + +import hashlib +import json +import os +from pathlib import Path, PurePosixPath +import shutil +import struct +import subprocess +import sys +import tarfile +import urllib.request + +PHP_SOURCE = 'https://www.php.net/distributions/php-8.2.35.tar.gz' +PHP_SHA256 = '9db4204f0a2d1911277ae832185e07bb4c3b3559772753a70d2968ca346d6910' +SDK = '81b356186db123ce9cd65149cee4683211a59ebd' +VCPKG = '9a5dfef5d1a0438a7d24856a85bd60f309d355e9' + + +def run(command, log, cwd=None): + result = subprocess.run(command, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, timeout=5400) + log.write_bytes(result.stdout) + sys.stdout.buffer.write(result.stdout) + if result.returncode: + raise RuntimeError('native PHP host preparation failed: ' + log.name) + return result.stdout + + +def pe(path): + data = path.read_bytes() + if len(data) < 64 or len(data) > 128 * 1024 * 1024 or data[:2] != b'MZ': + raise ValueError('bounded actual PHP PE required') + offset = int.from_bytes(data[60:64], 'little') + if offset + 24 > len(data) or data[offset:offset + 4] != b'PE\0\0' or struct.unpack_from(' 64 * 1024 * 1024: + raise ValueError('PHP source archive exceeds bound') + checksum.update(chunk) + output.write(chunk) +if checksum.hexdigest() != PHP_SHA256: + raise ValueError('official PHP source archive identity differs') +(evidence / 'source-archive.json').write_text(json.dumps({'url': PHP_SOURCE, 'sha256': checksum.hexdigest(), 'bytes': size, 'reviewed_large_source_member': {'path': 'php-8.2.35/ext/fileinfo/data_file.c', 'bytes': 42528803, 'sha256': 'd2375f7306b94d7b35f42cd9afc83f54b3072936fc1dfb90eac2add22d60ef5a'}}), encoding='utf-8') +source_root = root / 'source' +source_root.mkdir() +with tarfile.open(archive, 'r:gz') as packed: + total = 0 + seen = set() + for item in packed.getmembers(): + path = PurePosixPath(item.name) + total += item.size + large_source = item.name == 'php-8.2.35/ext/fileinfo/data_file.c' and item.size == 42528803 and item.isfile() + if large_source and hashlib.file_digest(packed.extractfile(item), 'sha256').hexdigest() != 'd2375f7306b94d7b35f42cd9afc83f54b3072936fc1dfb90eac2add22d60ef5a': + raise ValueError('reviewed PHP large source member differs') + if path.is_absolute() or '..' in path.parts or '\\' in item.name or ':' in item.name or item.name in seen or not (item.isdir() or item.isfile()) or (item.size > 32 * 1024 * 1024 and not large_source) or total > 512 * 1024 * 1024: + raise ValueError('unsafe or oversized PHP source archive member: ' + repr(item.name)) + seen.add(item.name) + packed.extractall(source_root, filter='data') +source = source_root / 'php-8.2.35' +run(['cmd', '/d', '/c', str(vcpkg / 'bootstrap-vcpkg.bat'), '-disableMetrics'], evidence / 'vcpkg-bootstrap.log') +run([str(vcpkg / 'vcpkg.exe'), 'install', 'libffi:arm64-windows-static', '--disable-metrics'], evidence / 'libffi-build.log', vcpkg) +installed = vcpkg / 'installed/arm64-windows-static' +deps = root / 'deps' +shutil.copytree(installed / 'include', deps / 'include') +(deps / 'lib').mkdir() +libraries = [path for path in (installed / 'lib').glob('*.lib') if path.name.lower() in ['libffi.lib', 'ffi.lib']] +if len(libraries) != 1: + raise ValueError('one actual built ARM64 libffi archive required') +shutil.copyfile(libraries[0], deps / 'lib/libffi.lib') +# SDK передаёт genuine ARM64 compiler environment без target spoof. +batch = root / 'build-host.bat' +commands = [ + '@echo off', + 'cd /d "' + str(source) + '"', + 'call buildconf.bat', + 'if errorlevel 1 exit /b 1', + 'call configure.bat --disable-all --disable-zts --enable-cli --enable-phpdbg --enable-tokenizer --enable-ctype --enable-filter --enable-mbstring --disable-mbregex --with-ffi --without-pcre-jit --with-mp=4 --with-php-build="' + str(deps) + '"', + 'if errorlevel 1 exit /b 1', + 'nmake', + 'if errorlevel 1 exit /b 1', +] +batch.write_text('\r\n'.join(commands) + '\r\n', encoding='utf-8') +run(['cmd', '/d', '/c', str(sdk / 'phpsdk-starter.bat'), '-c', 'vs18', '-a', 'arm64', '-t', str(batch)], evidence / 'php-build.log') +executables = [path for path in source.rglob('php.exe') if path.parent.name == 'Release'] +if len(executables) != 1: + raise ValueError('one actual Release PHP CLI required') +php = executables[0] +identity = pe(php) +code = '$f=FFI::cdef("unsigned long GetCurrentProcessId(void);", "kernel32.dll"); echo json_encode(["version"=>PHP_VERSION,"int_size"=>PHP_INT_SIZE,"sapi"=>PHP_SAPI,"ffi"=>extension_loaded("FFI"),"pid"=>$f->GetCurrentProcessId(),"self_pid"=>getmypid()]);' +raw = run([str(php), '-n', '-d', 'ffi.enable=1', '-r', code], evidence / 'php-ffi-probe.json') +probe = json.loads(raw) +if probe['version'] != '8.2.35' or probe['int_size'] != 8 or probe['sapi'] != 'cli' or not probe['ffi'] or probe['pid'] != probe['self_pid']: + raise ValueError('genuine ARM64 PHP FFI execution required') +phpdbg = php.with_name('phpdbg.exe') +debugger = pe(phpdbg) +record = {'runner_arch': 'ARM64', 'php': identity, 'phpdbg': debugger, 'php_source': PHP_SOURCE, 'php_source_sha256': PHP_SHA256, 'sdk_commit': SDK, 'vcpkg_commit': VCPKG, 'libffi_sha256': hashlib.sha256(libraries[0].read_bytes()).hexdigest(), 'probe': probe, 'scope': 'CI-only native ARM64 PHP host feasibility. No Ktav DLL build/consumer acceptance, interpreter redistribution, package publication or product dependency change.'} +(evidence / 'host-verification.json').write_text(json.dumps(record, sort_keys=True, indent=2) + '\n', encoding='utf-8') + +php.with_name('php.ini').write_text('ffi.enable=1' + chr(10), encoding='utf-8') +for extension in ['mbstring', 'tokenizer', 'ctype', 'filter']: + if subprocess.check_output([str(php), '-n', '-r', 'echo extension_loaded("' + extension + '") ? "yes" : "no";'], text=True).strip() != 'yes': + raise ValueError('original test host extension missing: ' + extension) +with Path(os.environ['GITHUB_ENV']).open('a', encoding='utf-8') as environment: + environment.write('KTAV_TEST_PHP=' + str(php) + chr(10)) diff --git a/scripts/rust_compiler_notices.py b/scripts/rust_compiler_notices.py new file mode 100644 index 0000000..36bdc1b --- /dev/null +++ b/scripts/rust_compiler_notices.py @@ -0,0 +1,65 @@ +"""Сохранить полные compiler grants для exact Rust source revision.""" + +from __future__ import annotations + +import hashlib +import json +from pathlib import Path, PurePosixPath + +PROFILE_SHA256 = "39cbf18420d5e0c0a35fb2d5e5fbed4db755488ea0ca11414944ead9fbabab92" +RUST_REVISION = "58cf8f9c35b355199727627d07ae34a4e2846d67" + + +def _read(path: Path, limit: int) -> bytes: + if path.is_symlink() or not path.is_file(): + raise ValueError("missing or symlinked compiler notice input") + with path.open("rb") as source: + raw = source.read(limit + 1) + if len(raw) > limit: + raise ValueError("compiler notice input exceeds bound") + return raw + + +def collect(root: Path, rustc: str) -> dict: + """Сверить compiler identity и сохранить original legal/source bytes.""" + if ( + not rustc.startswith("rustc 1.99.1 ") + or "\nrelease: 1.99.1\n" not in rustc + or "\ncommit-hash: " + RUST_REVISION + "\n" not in rustc + ): + raise ValueError("unreviewed Rust compiler source identity") + root = root.resolve() + raw = _read(root / "ci/rust-compiler-notices.json", 1024 * 1024) + if hashlib.sha256(raw).hexdigest() != PROFILE_SHA256: + raise ValueError("compiler notice profile differs from review") + profile = json.loads(raw) + materials = [] + for item in profile["materials"]: + relative = PurePosixPath(item["path"]) + path = root / item["path"] + if ( + relative.is_absolute() + or ".." in relative.parts + or "\\" in item["path"] + or not path.resolve().is_relative_to(root) + ): + raise ValueError("unsafe compiler notice source path") + original = _read(path, 4 * 1024 * 1024) + blob = hashlib.sha1(b"blob " + str(len(original)).encode() + b"\0" + original).hexdigest() + if ( + len(original) != item["bytes"] + or hashlib.sha256(original).hexdigest() != item["sha256"] + or blob != item["git_blob"] + ): + raise ValueError("compiler notice original identity differs") + materials.append({**item, "text": original.decode("utf-8")}) + return { + "schema_version": 1, + "profile_sha256": PROFILE_SHA256, + "rust_revision": profile["rust_revision"], + "llvm_revision": profile["llvm_revision"], + "compiler_builtins_license": "MIT AND Apache-2.0 WITH LLVM-exception", + "libm_license": "MIT", + "coverage": profile["coverage"], + "materials": materials, + } diff --git a/scripts/stage_php_gnu_release.py b/scripts/stage_php_gnu_release.py new file mode 100644 index 0000000..605d487 --- /dev/null +++ b/scripts/stage_php_gnu_release.py @@ -0,0 +1,55 @@ +"""Сохранить проверенный GNU candidate в совместимых native release roles.""" + +import hashlib +import json +from pathlib import Path +import shutil +import subprocess +import sys + +SOURCE = 'c979b98d6decfb3c2808c8177eecf5d34dbc8634' +TARGETS = {'x86_64-pc-windows-gnullvm': 'ktav_cabi-windows-amd64.dll', 'aarch64-pc-windows-gnullvm': 'ktav_cabi-windows-arm64.dll'} + + +def stage(evidence, output, target): + if target not in TARGETS or output.exists(): + raise ValueError('reviewed target and new release directory required') + binary = evidence / 'ktav_cabi.dll' + if binary.is_symlink() or not binary.is_file() or binary.stat().st_size > 128 * 1024 * 1024: + raise ValueError('bounded regular candidate DLL required') + report = json.loads(subprocess.check_output([sys.executable, '-I', str(Path(__file__).with_name('check_embedded_notices.py')), str(binary), str(evidence / 'NOTICE.json')])) + runtime = json.loads((evidence / 'native-runtime-verification.json').read_bytes()) + source = json.loads((evidence / 'source-provenance.json').read_bytes()) + bundle = json.loads((evidence / 'NOTICE.json').read_bytes()) + if source['source_ref'] != SOURCE or source['target'] != target or runtime['target'] != target or runtime['binary_sha256'] != report['binary_sha256']: + raise ValueError('source-bound GNU producer identity differs') + if source['sdk_archive_sha256'] != 'fd5462b7f5d93b2ff981fcd3f9c7e427e47f3203c64ea91c27bcc444eebd74cd' or hashlib.sha256((evidence / 'Cargo.lock').read_bytes()).hexdigest() != 'a7066ecc92727ae12c3905cbf1a2b73266da609773356f725e931682381b7a8b': + raise ValueError('reviewed SDK or original PHP lock differs') + compiler = bundle['rust_compiler_builtins'] + runtimes = bundle['non_cargo_runtimes'] + if compiler['profile_sha256'] != '39cbf18420d5e0c0a35fb2d5e5fbed4db755488ea0ca11414944ead9fbabab92' or len(compiler['materials']) != 14 or compiler['compiler_builtins_license'] != 'MIT AND Apache-2.0 WITH LLVM-exception': + raise ValueError('complete reviewed compiler originals required') + if len(runtimes) != 1 or runtimes[0]['target'] != target or runtimes[0]['catalog_sha256'] != '793c61f930c31a27f987c169eec4a07cc8c140dd16e91653fec3d029f803a816' or len(runtimes[0]['source_files']) != 58 or len(runtimes[0]['original_documents']) != 6: + raise ValueError('complete reviewed runtime grants required') + for item in compiler['materials']: + raw = item['text'].encode('utf-8') + if hashlib.sha256(raw).hexdigest() != item['sha256'] or len(raw) != item['bytes']: + raise ValueError('delivered compiler original text differs') + for item in runtimes[0]['original_documents']: + if hashlib.sha256(item['text'].encode('utf-8')).hexdigest() != item['sha256']: + raise ValueError('delivered runtime original text differs') + output.mkdir(parents=True) + asset = output / TARGETS[target] + shutil.copyfile(binary, asset) + shutil.copyfile(evidence / 'NOTICE.json', output / (asset.name + '.NOTICE.json')) + manifest = {**report, 'binary': asset.name, 'source_ref': SOURCE, 'tooling_ref': source['tooling_ref'], 'target': target, 'sdk_archive_sha256': source['sdk_archive_sha256'], 'coverage': 'GNU native distribution role; original metadata hook only. Complete runtime and compiler grant texts remain embedded and in the adjacent NOTICE.json. No historical asset repair.'} + (output / (asset.name + '.NOTICE.manifest.json')).write_text(json.dumps(manifest, sort_keys=True, indent=2) + '\n', encoding='utf-8') + if asset.read_bytes() != binary.read_bytes(): + raise ValueError('staged release DLL differs') + print(json.dumps(manifest, sort_keys=True)) + + +if __name__ == '__main__': + if len(sys.argv) != 4: + raise SystemExit('usage: stage_php_gnu_release.py EVIDENCE NEW_OUTPUT TARGET') + stage(Path(sys.argv[1]), Path(sys.argv[2]), sys.argv[3]) diff --git a/scripts/zig_runtime_notices.py b/scripts/zig_runtime_notices.py new file mode 100644 index 0000000..e2eb824 --- /dev/null +++ b/scripts/zig_runtime_notices.py @@ -0,0 +1,122 @@ +"""Сохранить проверенные Zig runtime notices и проверить actual link inputs.""" + +import gzip +import hashlib +import json +from pathlib import Path, PurePosixPath +import re +import subprocess +import sys + +REVISION = '5ad91a646a753cc3eecd8751e61cf458dadd9ac4' +EXPECTED_MEMBERS = { + ('libunwind.a', 'UnwindLevel1.o'), + ('libunwind.a', 'UnwindLevel1-gcc-ext.o'), + ('libunwind.a', 'UnwindRegistersSave.o'), + ('libunwind.a', 'UnwindRegistersRestore.o'), + ('libunwind.a', 'libunwind.o'), + ('libc_nonshared.a', 'stat64-2.32.o'), + ('libc_nonshared.a', 'fstat64-2.32.o'), +} + + +def _read(path, limit=4 * 1024 * 1024): + with path.open('rb') as source: + data = source.read(limit + 1) + if len(data) > limit: + raise ValueError('runtime evidence file exceeds limit') + return data + + +def _sources(lib, catalog): + if catalog.get('source_revision') != REVISION or catalog.get('zig_version') != '0.14.0': + raise ValueError('unreviewed Zig runtime source revision') + lib = lib.resolve() + for item in catalog['files']: + relative = PurePosixPath(item['path']) + if relative.is_absolute() or '..' in relative.parts: + raise ValueError('invalid runtime source path') + if item['path'] == 'LICENSE': + source = lib.parent / 'LICENSE' + boundary = lib.parent + elif relative.parts[0] == 'lib': + source = lib.joinpath(*relative.parts[1:]) + boundary = lib + else: + raise ValueError('unexpected runtime source path') + if not source.resolve().is_relative_to(boundary): + raise ValueError('runtime source escapes Zig installation') + data = _read(source) + if hashlib.sha256(data).hexdigest() != item['sha256']: + raise ValueError(f"Zig runtime source changed: {item['path']}") + return catalog['files'] + + +def _prepare(evidence): + version = subprocess.check_output(['zig', 'version'], text=True).strip() + if version != '0.14.0': + raise ValueError('unreviewed Zig version') + environment = json.loads(subprocess.check_output(['zig', 'env'])) + lib = Path(environment['lib_dir']) + catalog_path = Path(__file__).resolve().parents[1] / 'ci/zig-runtime-catalog.json' + catalog_bytes = _read(catalog_path) + catalog = json.loads(catalog_bytes) + files = _sources(lib, catalog) + notice_path = evidence / 'NOTICE.json' + bundle = json.loads(_read(notice_path, 64 * 1024 * 1024)) + if bundle.get('schema_version') != 1 or 'non_cargo_runtimes' in bundle: + raise ValueError('unexpected native notice bundle state') + bundle['non_cargo_runtimes'] = [{ + 'name': 'Zig vendored LLVM libunwind and glibc nonshared runtime', + 'zig_version': version, + 'source_revision': REVISION, + 'coverage': 'Conservative source notices; actual archive members are checked after linking.', + 'catalog_sha256': hashlib.sha256(catalog_bytes).hexdigest(), + 'files': files, + 'credits': catalog['credits'], + }] + bundle['coverage'] += ' Includes verified Zig runtime source notices; linked archive members require the post-build map gate.' + data = (json.dumps(bundle, ensure_ascii=False, sort_keys=True, indent=2) + '\n').encode('utf-8') + compressed = gzip.compress(data, mtime=0) + if len(compressed) > 4 * 1024 * 1024: + raise ValueError('compressed runtime notices exceed resource limit') + with (evidence / 'zig-runtime-catalog.json').open('xb') as out: + out.write(catalog_bytes) + notice_path.write_bytes(data) + (evidence / 'NOTICE.json.gz').write_bytes(compressed) + print(f'Included {len(files)} exact Zig runtime source records') + + +def _members(text): + matches = re.findall(r'([^\s()]+[.]a)\(([^()\n]+)\)', text) + members = {(PurePosixPath(archive).name, PurePosixPath(member).name) for archive, member in matches} + if members != EXPECTED_MEMBERS: + raise ValueError(f'unreviewed archive membership: {sorted(members ^ EXPECTED_MEMBERS)}') + objects = set(re.findall(r'[^\s()]+[.]o(?=:\()', text)) + if not objects or any(not path.endswith('.rcgu.o') for path in objects): + raise ValueError('unreviewed direct object input') + return sorted(members) + + +def _verify(evidence): + bundle = json.loads(_read(evidence / 'NOTICE.json', 64 * 1024 * 1024)) + runtimes = bundle.get('non_cargo_runtimes') + if not isinstance(runtimes, list) or len(runtimes) != 1 or runtimes[0].get('source_revision') != REVISION: + raise ValueError('Zig runtime notices missing or unreviewed') + members = _members(_read(evidence / 'native-link.map', 16 * 1024 * 1024).decode('utf-8')) + with (evidence / 'zig-runtime-members.json').open('x', encoding='utf-8') as out: + json.dump({'source_revision': REVISION, 'archive_members': members}, out, sort_keys=True, indent=2) + print('Verified all seven static Zig runtime archive members') + + +def main(): + if len(sys.argv) != 3 or sys.argv[1] not in ('prepare', 'verify'): + raise SystemExit('usage: zig_runtime_notices.py prepare|verify EVIDENCE_DIRECTORY') + try: + (_prepare if sys.argv[1] == 'prepare' else _verify)(Path(sys.argv[2])) + except (OSError, ValueError, KeyError, TypeError, subprocess.CalledProcessError) as error: + raise SystemExit(str(error)) from error + + +if __name__ == '__main__': + main()