diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 34b54a52ab4b5c..a70b87da867648 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -83,15 +83,6 @@ /src/node_http2* @nodejs/http2 @nodejs/net /src/node_mem* @nodejs/http2 -# quic - -/deps/ngtcp2/* @nodejs/quic -/doc/api/quic.md @nodejs/quic -/lib/quic.js @nodejs/quic -/lib/internal/quic/* @nodejs/quic -/src/quic/* @nodejs/quic -/test/parallel/test-quic-* @nodejs/quic - # modules, including loaders /doc/api/esm.md @nodejs/loaders diff --git a/.github/actions/undici-wpt-current/action.yml b/.github/actions/undici-wpt-current/action.yml deleted file mode 100644 index ffedcaa0fadc92..00000000000000 --- a/.github/actions/undici-wpt-current/action.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Run undici WPT (current) -description: Runs undici WPT tests for undici >= 7 and merges results into the Node.js WPT report - -inputs: - undici-version: - required: true - description: undici version tag to checkout - wpt-report: - required: true - description: Path to the Node.js WPT report to merge into - -runs: - using: composite - steps: - - name: Checkout undici - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: nodejs/undici - persist-credentials: false - path: undici - clean: false - ref: ${{ inputs.undici-version }} - - name: Prepare WPT checkout - shell: bash - run: | - rm -rf undici/test/web-platform-tests/wpt - mv test/fixtures/wpt undici/test/web-platform-tests/wpt - - name: Configure hosts - shell: bash - working-directory: undici/test/web-platform-tests/wpt - run: python3 wpt make-hosts-file | sudo tee -a /etc/hosts - - name: Install dependencies - shell: bash - working-directory: undici - run: npm install - - name: Run WPT - shell: bash - working-directory: undici - env: - CI: 'true' - WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json - run: npm run test:wpt || true - - name: Merge report - shell: bash - env: - NODE_WPT_REPORT: ${{ inputs.wpt-report }} - UNDICI_WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json - run: | - if [ -f "$UNDICI_WPT_REPORT" ]; then - jq -sc ' - .[0].results += .[1].results | - .[0].time_end = .[1].time_end | - .[0] - ' "$NODE_WPT_REPORT" "$UNDICI_WPT_REPORT" > "${NODE_WPT_REPORT}.tmp" - mv "${NODE_WPT_REPORT}.tmp" "$NODE_WPT_REPORT" - fi diff --git a/.github/actions/undici-wpt-legacy/action.yml b/.github/actions/undici-wpt-legacy/action.yml deleted file mode 100644 index 77a8b3fee46992..00000000000000 --- a/.github/actions/undici-wpt-legacy/action.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Run undici WPT (legacy) -description: Runs undici WPT tests for undici < 7 and appends results to the Node.js WPT report - -inputs: - undici-version: - required: true - description: undici version tag to checkout - wpt-report: - required: true - description: Path to the Node.js WPT report - -runs: - using: composite - steps: - - name: Checkout undici - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - repository: nodejs/undici - persist-credentials: false - path: undici - clean: false - ref: ${{ inputs.undici-version }} - - name: Prepare WPT checkout - shell: bash - run: | - rm -rf undici/test/wpt/tests - mv test/fixtures/wpt undici/test/wpt/tests - - name: Install dependencies - shell: bash - working-directory: undici - run: npm install - - name: Run WPT - shell: bash - working-directory: undici - env: - WPT_REPORT: ${{ inputs.wpt-report }} - run: npm run test:wpt || true diff --git a/.github/workflows/close-stale-feature-requests.yml b/.github/workflows/close-stale-feature-requests.yml new file mode 100644 index 00000000000000..cb308cb044bc84 --- /dev/null +++ b/.github/workflows/close-stale-feature-requests.yml @@ -0,0 +1,56 @@ +name: Close stale feature requests +on: + workflow_dispatch: + schedule: + # Run every day at 1:00 AM UTC. + - cron: 0 1 * * * + +# yamllint disable rule:empty-lines +env: + CLOSE_MESSAGE: > + There has been no activity on this feature request + and it is being closed. If you feel closing this issue is not the + right thing to do, please leave a comment. + + + For more information on how the project manages + feature requests, please consult the + [feature request management document](https://github.com/nodejs/node/blob/HEAD/doc/contributing/feature-request-management.md). + + WARN_MESSAGE: > + There has been no activity on this feature request for + 5 months. To help maintain relevant open issues, please + add the https://github.com/nodejs/node/labels/never-stale + label or close this issue if it should be closed. If not, + the issue will be automatically closed 6 months after the + last non-automated comment. + + For more information on how the project manages + feature requests, please consult the + [feature request management document](https://github.com/nodejs/node/blob/HEAD/doc/contributing/feature-request-management.md). +# yamllint enable + +permissions: + contents: read + +jobs: + stale: + permissions: + issues: write # for actions/stale to close stale issues + pull-requests: write # for actions/stale to close stale PRs + if: github.repository == 'nodejs/node' + runs-on: ubuntu-slim + steps: + - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 180 + days-before-close: 30 + stale-issue-label: stale + close-issue-message: ${{ env.CLOSE_MESSAGE }} + stale-issue-message: ${{ env.WARN_MESSAGE }} + only-labels: feature request + exempt-issue-labels: never-stale + # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits + operations-per-run: 500 + remove-stale-when-updated: true diff --git a/.github/workflows/close-stale-pull-requests.yml b/.github/workflows/close-stale-pull-requests.yml new file mode 100644 index 00000000000000..de565c9051328d --- /dev/null +++ b/.github/workflows/close-stale-pull-requests.yml @@ -0,0 +1,59 @@ +name: Close stale pull requests +on: + workflow_dispatch: + inputs: + endDate: + description: stop processing PRs after this date + required: false + type: string + +# yamllint disable rule:empty-lines +env: + CLOSE_MESSAGE: > + This pull request was opened more than a year ago and there has + been no activity in the last 6 months. We value your contribution + but since it has not progressed in the last 6 months it is being + closed. If you feel closing this pull request is not the right thing + to do, please leave a comment. + + WARN_MESSAGE: > + This pull request was opened more than a year ago and there has + been no activity in the last 5 months. We value your contribution + but since it has not progressed in the last 5 months it is being + marked stale and will be closed if there is no progress in the + next month. If you feel that is not the right thing to do please + comment on the pull request. +# yamllint enable + +permissions: + contents: read + +jobs: + stale: + permissions: + pull-requests: write # for actions/stale to close stale PRs + if: github.repository == 'nodejs/node' + runs-on: ubuntu-slim + steps: + - name: Set default end date which is 1 year ago + run: echo "END_DATE=$(date --date='525600 minutes ago' --rfc-2822)" >> "$GITHUB_ENV" + - name: if date set in event override the default end date + env: + END_DATE_INPUT_VALUE: ${{ github.event.inputs.endDate }} + if: ${{ github.event.inputs.endDate != '' }} + run: echo "END_DATE=$END_DATE_INPUT_VALUE" >> "$GITHUB_ENV" + - uses: mhdawson/stale@453d6581568dc43dbe345757f24408d7b451c651 # PR to add support for endDate + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + end-date: ${{ env.END_DATE }} + days-before-issue-stale: -1 + days-before-issue-close: -1 + days-before-stale: 150 + days-before-close: 30 + stale-issue-label: stale + close-issue-message: ${{ env.CLOSE_MESSAGE }} + stale-issue-message: ${{ env.WARN_MESSAGE }} + exempt-pr-labels: never-stale + # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits + operations-per-run: 500 + remove-stale-when-updated: true diff --git a/.github/workflows/daily-wpt-fyi.yml b/.github/workflows/daily-wpt-fyi.yml index 3899b6bd28e1a5..5ec2662d21df61 100644 --- a/.github/workflows/daily-wpt-fyi.yml +++ b/.github/workflows/daily-wpt-fyi.yml @@ -96,48 +96,6 @@ jobs: echo "WPT_REPORT=$(pwd)/out/wpt/wptreport.json" >> $GITHUB_ENV fi - # undici WPT Runner - - name: Set env.UNDICI_VERSION - if: ${{ env.WPT_REPORT != '' }} - run: | - UNDICI_VERSION=$(jq -r '.version' < deps/undici/src/package.json) - echo "UNDICI_VERSION=v$UNDICI_VERSION" >> $GITHUB_ENV - if [ "${UNDICI_VERSION%%.*}" -ge 7 ]; then - echo "UNDICI_WPT=current" >> $GITHUB_ENV - else - echo "UNDICI_WPT=legacy" >> $GITHUB_ENV - fi - # Checkout composite actions from the default branch since the - # version-specific checkout above overwrites .github/actions/ - - name: Checkout undici WPT actions - if: ${{ env.WPT_REPORT != '' }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - sparse-checkout: | - .github/actions/undici-wpt-current - .github/actions/undici-wpt-legacy - sparse-checkout-cone-mode: false - persist-credentials: false - path: _wpt_actions - clean: false - - name: Place undici WPT actions - if: ${{ env.WPT_REPORT != '' }} - run: | - mkdir -p .github/actions - cp -r _wpt_actions/.github/actions/undici-wpt-* .github/actions/ - - name: Run undici WPT (current) - if: ${{ env.UNDICI_WPT == 'current' }} - uses: ./.github/actions/undici-wpt-current - with: - undici-version: ${{ env.UNDICI_VERSION }} - wpt-report: ${{ env.WPT_REPORT }} - - name: Run undici WPT (legacy) - if: ${{ env.UNDICI_WPT == 'legacy' }} - uses: ./.github/actions/undici-wpt-legacy - with: - undici-version: ${{ env.UNDICI_VERSION }} - wpt-report: ${{ env.WPT_REPORT }} - # Upload artifacts - name: Clone report for upload if: ${{ env.WPT_REPORT != '' }} diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index 2fb374e912d10f..87320f3f51da45 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -20,10 +20,9 @@ jobs: steps: - name: Trigger update-links workflow on nodejs/release-cloudflare-worker run: | - gh workflow run update-links.yml --repo nodejs/release-cloudflare-worker -f version=$VERSION + gh workflow run update-links.yml --repo nodejs/release-cloudflare-worker env: GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} - VERSION: ${{ inputs.version || github.event.release.tag_name }} - name: Trigger create-release-post workflow on nodejs/nodejs.org run: | diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 704967c24e62ec..00000000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Close stale -on: - workflow_dispatch: - schedule: - # Run every day at 1:00 AM UTC. - - cron: 0 1 * * * - -# yamllint disable rule:empty-lines -env: - CLOSE_MESSAGE: > - This {0} has been automatically closed after 30 days of inactivity - following its stale status (no activity for a total of 240 days). - - If this is still relevant, feel free to reopen it or leave a comment - with additional details so we can continue the discussion. - - WARN_MESSAGE: > - This {0} has been marked as stale due to 210 days of inactivity. - - It will be automatically closed in 30 days if no further activity occurs. - If this is still relevant, please leave a comment or update it to keep it open. -# yamllint enable - -permissions: - contents: read - -jobs: - stale: - permissions: - issues: write # for actions/stale to close stale issues - pull-requests: write # for actions/stale to close stale PRs - if: github.repository == 'nodejs/node' - runs-on: ubuntu-slim - steps: - - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 210 - days-before-close: 30 - stale-issue-label: stale - exempt-issue-labels: never-stale, confirmed-bug - close-issue-message: ${{ format(env.CLOSE_MESSAGE, 'issue') }} - stale-issue-message: ${{ format(env.WARN_MESSAGE, 'issue') }} - stale-pr-label: stale - exempt-pr-labels: never-stale - close-pr-message: ${{ format(env.CLOSE_MESSAGE, 'pull request') }} - stale-pr-message: ${{ format(env.WARN_MESSAGE, 'pull request') }} - # max requests it will send per run to the GitHub API before it deliberately exits to avoid hitting API rate limits - operations-per-run: 500 - remove-stale-when-updated: true diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 8d878c26f74888..6d49f08991cf86 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -77,14 +77,9 @@ jobs: - name: Environment Information run: npx envinfo - name: Build - working-directory: node - run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --v8-enable-temporal-support" + run: make -C node build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --v8-enable-temporal-support" - name: Test - working-directory: node - run: make test-ci -j1 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9" - - name: Ensure running tests did not cause any change in the tree - working-directory: node - run: git add -A && git diff --name-only --exit-code --staged + run: make -C node test-ci -j1 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9" - name: Re-run test in a folder whose name contains unusual chars run: | mv node "$DIR" diff --git a/.github/workflows/test-shared.yml b/.github/workflows/test-shared.yml index c746b2d75e9fde..a465a6232fee49 100644 --- a/.github/workflows/test-shared.yml +++ b/.github/workflows/test-shared.yml @@ -196,7 +196,7 @@ jobs: --arg ccache "${NIX_SCCACHE:-null}" \ --arg devTools '[]' \ --arg benchmarkTools '[]' \ - ${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withLief false --arg withSQLite false --arg withFFI false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }} + ${{ endsWith(matrix.system, '-darwin') && '--arg withAmaro false --arg withLief false --arg withSQLite false --arg extraConfigFlags ''["--without-inspector" "--without-node-options"]'' \' || '\' }} --run ' make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS" ' "$TAR_DIR/shell.nix" diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index f45ffd68ca6b76..b756a6972f3d66 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -26,7 +26,6 @@ on: - histogram - icu - inspector_protocol - - libffi - libuv - llhttp - minimatch @@ -162,14 +161,6 @@ jobs: cat temp-output tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true rm temp-output - - id: libffi - subsystem: deps - label: dependencies, ffi - run: | - ./tools/dep_updaters/update-libffi.sh > temp-output - cat temp-output - tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true - rm temp-output - id: libuv subsystem: deps label: dependencies diff --git a/BUILDING.md b/BUILDING.md index 2cb15c812acf3b..4fb7521190b1fc 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -104,26 +104,26 @@ Node.js does not support a platform version if a vendor has expired support for it. In other words, Node.js does not support running on End-of-Life (EoL) platforms. This is true regardless of entries in the table below. -| Operating System | Architectures | Versions | Support Type | Notes | -| ---------------- | ---------------- | --------------------------------- | ------------ | ---------------------------------------------- | -| GNU/Linux | x64 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10, RHEL 8 | -| GNU/Linux | x64 | kernel >= 3.10, musl >= 1.1.19 | Experimental | e.g. Alpine 3.8 | -| GNU/Linux | x86 | kernel >= 3.10, glibc >= 2.17 | Experimental | Downgraded as of Node.js 10 | -| GNU/Linux | arm64 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10, RHEL 8 | -| GNU/Linux | armv7 | kernel >= 4.18[^1], glibc >= 2.28 | Experimental | Downgraded as of Node.js 24 | -| GNU/Linux | armv6 | kernel >= 4.14, glibc >= 2.24 | Experimental | Downgraded as of Node.js 12 | -| GNU/Linux | ppc64le >=power9 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. Ubuntu 20.04, RHEL 8 | -| GNU/Linux | s390x >=z14 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. RHEL 8 | -| GNU/Linux | loong64 | kernel >= 5.19, glibc >= 2.36 | Experimental | | -| GNU/Linux | riscv64 | kernel >= 5.19, glibc >= 2.36 | Experimental | GCC >= 14 or Clang >= 19 for native builds[^7] | -| Windows | x64 | >= Windows 10/Server 2016 | Tier 1 | [^2],[^3] | -| Windows | arm64 | >= Windows 10 | Tier 2 | | -| macOS | x64 | >= 13.5 | Tier 1 | For notes about compilation see [^4] | -| macOS | arm64 | >= 13.5 | Tier 1 | | -| SmartOS | x64 | >= 18 | Tier 2 | | -| AIX | ppc64be >=power9 | >= 7.2 TL04 | Tier 2 | | -| FreeBSD | x64 | >= 13.2 | Experimental | | -| OpenHarmony | arm64 | >= 5.0 | Experimental | | +| Operating System | Architectures | Versions | Support Type | Notes | +| ---------------- | ---------------- | --------------------------------- | ------------ | ------------------------------------ | +| GNU/Linux | x64 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10, RHEL 8 | +| GNU/Linux | x64 | kernel >= 3.10, musl >= 1.1.19 | Experimental | e.g. Alpine 3.8 | +| GNU/Linux | x86 | kernel >= 3.10, glibc >= 2.17 | Experimental | Downgraded as of Node.js 10 | +| GNU/Linux | arm64 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10, RHEL 8 | +| GNU/Linux | armv7 | kernel >= 4.18[^1], glibc >= 2.28 | Experimental | Downgraded as of Node.js 24 | +| GNU/Linux | armv6 | kernel >= 4.14, glibc >= 2.24 | Experimental | Downgraded as of Node.js 12 | +| GNU/Linux | ppc64le >=power9 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. Ubuntu 20.04, RHEL 8 | +| GNU/Linux | s390x >=z14 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. RHEL 8 | +| GNU/Linux | loong64 | kernel >= 5.19, glibc >= 2.36 | Experimental | | +| GNU/Linux | riscv64 | kernel >= 5.19, glibc >= 2.36 | Experimental | | +| Windows | x64 | >= Windows 10/Server 2016 | Tier 1 | [^2],[^3] | +| Windows | arm64 | >= Windows 10 | Tier 2 | | +| macOS | x64 | >= 13.5 | Tier 1 | For notes about compilation see [^4] | +| macOS | arm64 | >= 13.5 | Tier 1 | | +| SmartOS | x64 | >= 18 | Tier 2 | | +| AIX | ppc64be >=power9 | >= 7.2 TL04 | Tier 2 | | +| FreeBSD | x64 | >= 13.2 | Experimental | | +| OpenHarmony | arm64 | >= 5.0 | Experimental | | @@ -148,13 +148,6 @@ platforms. This is true regardless of entries in the table below. [^4]: Our macOS Binaries are compiled with 13.5 as a target. Xcode 16 is required to compile. -[^7]: Native riscv64 builds need GCC >= 14 or Clang >= 19 because V8 - includes `` and uses `target("arch=+v")` in - `deps/v8/src/base/cpu.cc`. GCC 13's `riscv_vector.h` errors out without - `-march=rv64gcv` and doesn't support the `target` attribute at all. - Cross-compilation from x64 is unaffected (the code is behind - `V8_HOST_ARCH_RISCV64`). - ### Supported toolchains diff --git a/CHANGELOG.md b/CHANGELOG.md index cfdf29cf9c4104..5cedb0c6734d52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,8 +57,7 @@ release. 25.0.0
-24.15.0
-24.14.1
+24.14.1
24.14.0
24.13.1
24.13.0
diff --git a/Makefile b/Makefile index 12851f2bc2911a..231bbe11f4c011 100644 --- a/Makefile +++ b/Makefile @@ -318,7 +318,7 @@ v8: ## Build deps/v8. tools/make-v8.sh $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS) .PHONY: jstest -jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests ## Run addon tests and JS tests. +jstest: build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests ## Run addon tests and JS tests. $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \ $(TEST_CI_ARGS) \ --skip-tests=$(CI_SKIP_TESTS) \ @@ -344,7 +344,6 @@ test: all ## Run default tests and build docs. $(MAKE) -s build-js-native-api-tests $(MAKE) -s build-node-api-tests $(MAKE) -s build-sqlite-tests - $(MAKE) -s build-ffi-tests $(MAKE) -s cctest $(MAKE) -s jstest @@ -354,7 +353,6 @@ test-only: all ## Run default tests without building the docs. $(MAKE) build-js-native-api-tests $(MAKE) build-node-api-tests $(MAKE) build-sqlite-tests - $(MAKE) build-ffi-tests $(MAKE) cctest $(MAKE) jstest $(MAKE) tooltest @@ -366,7 +364,6 @@ test-cov: all ## Run coverage tests. $(MAKE) build-js-native-api-tests $(MAKE) build-node-api-tests $(MAKE) build-sqlite-tests - $(MAKE) build-ffi-tests $(MAKE) cctest CI_SKIP_TESTS=$(COV_SKIP_TESTS) $(MAKE) jstest @@ -545,29 +542,6 @@ else build-sqlite-tests: endif -FFI_BINDING_GYPS := $(wildcard test/ffi/*/binding.gyp) - -FFI_BINDING_SOURCES := \ - $(wildcard test/ffi/*/*.c) \ - $(wildcard test/ffi/*/*.def) - -ifndef NOFFI -# Depends on $(NODE_EXE) as order-only to avoid ETXTBSY on AIX when make -# tries to execute node while it is still being linked in parallel. -test/ffi/.buildstamp: $(ADDONS_PREREQS) \ - $(FFI_BINDING_GYPS) $(FFI_BINDING_SOURCES) | $(NODE_EXE) - @$(call run_build_addons,"$$PWD/test/ffi",$@) -else -test/ffi/.buildstamp: -endif - -.PHONY: build-ffi-tests -ifndef NOFFI -build-ffi-tests: | test/ffi/.buildstamp ## Build FFI tests. -else -build-ffi-tests: -endif - .PHONY: clear-stalled clear-stalled: ## Clear any stalled processes. $(info Clean up any leftover processes but don't error if found.) @@ -578,7 +552,7 @@ clear-stalled: ## Clear any stalled processes. fi .PHONY: test-build -test-build: | all build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests ## Build all tests. +test-build: | all build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests ## Build all tests. .PHONY: test-build-js-native-api test-build-js-native-api: all build-js-native-api-tests ## Build JS Native-API tests. @@ -589,8 +563,6 @@ test-build-node-api: all build-node-api-tests ## Build Node-API tests. .PHONY: test-build-sqlite test-build-sqlite: all build-sqlite-tests ## Build SQLite tests. -.PHONY: test-build-ffi -test-build-ffi: all build-ffi-tests ## Build FFI tests. .PHONY: test-all test-all: test-build ## Run default tests with both Debug and Release builds. @@ -619,7 +591,7 @@ endif # Related CI job: node-test-commit-arm-fanned test-ci-native: LOGLEVEL := info ## Build and test addons without building anything else. -test-ci-native: | benchmark/napi/.buildstamp test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp test/sqlite/.buildstamp test/ffi/.buildstamp +test-ci-native: | benchmark/napi/.buildstamp test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp test/sqlite/.buildstamp $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \ $(TEST_CI_ARGS) $(CI_NATIVE_SUITES) @@ -642,7 +614,7 @@ test-ci-js: | clear-stalled ## Build and test JavaScript with building anything .PHONY: test-ci # Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned test-ci: LOGLEVEL := info ## Build and test everything (CI). -test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests doc-only +test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests doc-only out/Release/cctest --gtest_output=xml:out/junit/cctest.xml $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \ @@ -660,7 +632,6 @@ test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tes build-ci: ## Build everything (CI). $(PYTHON) ./configure --verbose $(CONFIG_FLAGS) $(MAKE) - $(MAKE) build-ffi-tests .PHONY: run-ci # Run by CI tests, exceptions: @@ -763,16 +734,6 @@ test-sqlite-clean: ## Remove SQLite testing artifacts. $(RM) -r test/sqlite/*/build $(RM) test/sqlite/.buildstamp -.PHONY: test-ffi -test-ffi: test-build-ffi ## Run FFI tests. - $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) ffi - -.PHONY: test-ffi-clean -.NOTPARALLEL: test-ffi-clean -test-ffi-clean: ## Remove FFI testing artifacts. - $(RM) -r test/ffi/*/build - $(RM) test/ffi/.buildstamp - .PHONY: test-addons test-addons: test-build test-js-native-api test-node-api ## Run addon tests. $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) addons @@ -1251,7 +1212,6 @@ $(TARBALL): release-only doc-only mkdir -p $(TARNAME)/doc/api cp doc/node.1 $(TARNAME)/doc/node.1 cp -r out/doc/api/* $(TARNAME)/doc/api/ - sed 's/fileset = fileset.intersection (fileset.gitTracked root)/fileset =/' tools/nix/v8.nix > $(TARNAME)/tools/nix/v8.nix $(RM) -r $(TARNAME)/.editorconfig $(RM) -r $(TARNAME)/.git* $(RM) -r $(TARNAME)/.mailmap @@ -1267,7 +1227,6 @@ ifeq ($(SKIP_SHARED_DEPS), 1) $(RM) -r $(TARNAME)/deps/icu-small $(RM) -r $(TARNAME)/deps/icu-tmp $(RM) -r $(TARNAME)/deps/LIEF - $(RM) -r $(TARNAME)/deps/libffi $(RM) -r $(TARNAME)/deps/llhttp $(RM) -r $(TARNAME)/deps/merve $(RM) -r $(TARNAME)/deps/nbytes @@ -1542,7 +1501,6 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \ test/embedding/*.cc \ test/embedding/*.h \ test/sqlite/*/*.c \ - test/ffi/*/*.c \ test/fixtures/*.c \ test/js-native-api/*/*.cc \ test/node-api/*/*.cc \ @@ -1567,7 +1525,6 @@ FORMAT_CPP_FILES += $(wildcard \ test/node-api/*/*.c \ test/node-api/*/*.h \ test/sqlite/*/*.c \ - test/ffi/*/*.c \ ) # Code blocks don't have newline at the end, diff --git a/benchmark/util/style-text.js b/benchmark/util/style-text.js index f04a26646e052d..282a96150f0b94 100644 --- a/benchmark/util/style-text.js +++ b/benchmark/util/style-text.js @@ -7,7 +7,7 @@ const assert = require('node:assert'); const bench = common.createBenchmark(main, { messageType: ['string', 'number', 'boolean', 'invalid'], - format: ['red', 'italic', 'invalid', '#ff0000'], + format: ['red', 'italic', 'invalid'], validateStream: [1, 0], n: [1e3], }); diff --git a/benchmark/util/type-check.js b/benchmark/util/type-check.js index 0815dd70061c14..269c2a4e9c1374 100644 --- a/benchmark/util/type-check.js +++ b/benchmark/util/type-check.js @@ -23,11 +23,6 @@ const args = { 'false-primitive': true, 'false-object': int32Array, }, - DataView: { - 'true': dataView, - 'false-primitive': true, - 'false-object': uint8Array, - }, }; const bench = common.createBenchmark(main, { diff --git a/common.gypi b/common.gypi index b9baa1f35ed5e1..953a1448d4baa5 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.18', + 'v8_embedder_string': '-node.17', ##### V8 defaults for Node.js ##### @@ -189,7 +189,7 @@ ['clang==1', { 'lto': ' -flto ', # Clang }, { - 'lto': ' -flto=4 -ffat-lto-objects ', # GCC + 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC }], ], }, @@ -591,18 +591,6 @@ '-maix64', ], 'conditions': [ - [ 'clang==1', { - 'cflags': [ - '-fno-integrated-as', - '-fno-xl-pragma-pack', - '-mcpu=power9', - ], - 'cflags_cc': [ - '-fno-integrated-as', - '-fno-xl-pragma-pack', - '-mcpu=power9', - ], - }], [ '"<(aix_variant_name)"=="OS400"', { # a.k.a. `IBM i` 'ldflags': [ '-Wl,-blibpath:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib', diff --git a/configure.py b/configure.py index 5e31fa03558819..9ec5b2fc4694c6 100755 --- a/configure.py +++ b/configure.py @@ -686,28 +686,6 @@ dest='shared_sqlite_libpath', help='a directory to search for the shared sqlite DLL') -shared_optgroup.add_argument('--shared-ffi', - action='store_true', - dest='shared_ffi', - default=None, - help='link to a shared libffi DLL instead of static linking') - -shared_optgroup.add_argument('--shared-ffi-includes', - action='store', - dest='shared_ffi_includes', - help='directory containing libffi header files') - -shared_optgroup.add_argument('--shared-ffi-libname', - action='store', - dest='shared_ffi_libname', - default='ffi', - help='alternative libffi name to link to [default: %(default)s]') - -shared_optgroup.add_argument('--shared-ffi-libpath', - action='store', - dest='shared_ffi_libpath', - help='a directory to search for the shared libffi DLL') - shared_optgroup.add_argument('--shared-temporal_capi', action='store_true', dest='shared_temporal_capi', @@ -1039,12 +1017,6 @@ default=None, help='build without SQLite (disables SQLite and Web Storage API)') -parser.add_argument('--without-ffi', - action='store_true', - dest='without_ffi', - default=None, - help='build without FFI (Foreign Function Interface) support') - parser.add_argument('--experimental-quic', action='store_true', dest='experimental_quic', @@ -1184,11 +1156,6 @@ default=None, help='Enable the built-in snapshot compression in V8.') -parser.add_argument('--v8-disable-temporal-support', - action='store_true', - dest='v8_disable_temporal_support', - default=None, - help='Disable Temporal support in V8.') parser.add_argument('--v8-enable-temporal-support', action='store_true', @@ -1483,7 +1450,11 @@ def get_cargo_version(cargo): stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) except OSError: - return '0.0' + error('''No acceptable cargo found! + + Please make sure you have cargo installed on your system and/or + consider adjusting the CARGO environment variable if you have installed + it in a non-standard prefix.''') with proc: cargo_ret = to_utf8(proc.communicate()[0]) @@ -1502,7 +1473,11 @@ def get_rustc_version(rustc): stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) except OSError: - return '0.0' + error('''No acceptable rustc compiler found! + + Please make sure you have a rust compiler installed on your system and/or + consider adjusting the RUSTC environment variable if you have installed + it in a non-standard prefix.''') with proc: rustc_ret = to_utf8(proc.communicate()[0]) @@ -1563,51 +1538,23 @@ def check_compiler(o): o['variables']['llvm_version'] = get_llvm_version(CC) if is_clang else '0.0' # cargo and rustc are needed for Temporal. - if not options.v8_disable_temporal_support and not options.shared_temporal_capi: + if options.v8_enable_temporal_support and not options.shared_temporal_capi: # Minimum cargo and rustc versions should match values in BUILDING.md. min_cargo_ver_tuple = (1, 82) min_rustc_ver_tuple = (1, 82) cargo = os.environ.get('CARGO', 'cargo') cargo_ver = get_cargo_version(cargo) print_verbose(f'Detected cargo (CARGO={cargo}): {cargo_ver}') - if cargo_ver == '0.0': - # Error if --v8-enable-temporal-support is explicitly set, - # otherwise disable support for Temporal. - if options.v8_enable_temporal_support: - error('''No acceptable cargo found! - - Enabling Temporal support requires cargo. - Please make sure you have cargo installed on your system and/or - consider adjusting the CARGO environment variable if you have installed - it in a non-standard prefix.''') - else: - warn('cargo not found! Support for Temporal will be disabled.') - options.v8_disable_temporal_support = True - else: - cargo_ver_tuple = tuple(map(int, cargo_ver.split('.'))) - if cargo_ver_tuple < min_cargo_ver_tuple: - warn(f'cargo {cargo_ver} too old, need cargo {".".join(map(str, min_cargo_ver_tuple))}') + cargo_ver_tuple = tuple(map(int, cargo_ver.split('.'))) + if cargo_ver_tuple < min_cargo_ver_tuple: + warn(f'cargo {cargo_ver} too old, need cargo {".".join(map(str, min_cargo_ver_tuple))}') # cargo supports RUSTC environment variable to override "rustc". rustc = os.environ.get('RUSTC', 'rustc') rustc_ver = get_rustc_version(rustc) - if rustc_ver == '0.0': - # Error if --v8-enable-temporal-support is explicitly set, - # otherwise disable support for Temporal. - if options.v8_enable_temporal_support: - error('''No acceptable rustc compiler found! - - Enabling Temporal support requires a Rust toolchain. - Please make sure you have a Rust compiler installed on your system and/or - consider adjusting the RUSTC environment variable if you have installed - it in a non-standard prefix.''') - else: - warn(f'{rustc} not found! Support for Temporal will be disabled.') - options.v8_disable_temporal_support = True - else: - print_verbose(f'Detected rustc (RUSTC={rustc}): {rustc_ver}') - rust_ver_tuple = tuple(map(int, rustc_ver.split('.'))) - if rust_ver_tuple < min_rustc_ver_tuple: - warn(f'rustc {rustc_ver} too old, need rustc {".".join(map(str, min_rustc_ver_tuple))}') + print_verbose(f'Detected rustc (RUSTC={rustc}): {rustc_ver}') + rust_ver_tuple = tuple(map(int, rustc_ver.split('.'))) + if rust_ver_tuple < min_rustc_ver_tuple: + warn(f'rustc {rustc_ver} too old, need rustc {".".join(map(str, min_rustc_ver_tuple))}') # Need xcode_version or gas_version when openssl asm files are compiled. if options.without_ssl or options.openssl_no_asm or options.shared_openssl: @@ -1833,14 +1780,6 @@ def configure_node(o): o['variables']['target_arch'] = target_arch o['variables']['node_byteorder'] = sys.byteorder - # On Windows, cargo may default to the GNU target (e.g. x86_64-pc-windows-gnu) - # but Node.js requires MSVC-compatible libraries. Set explicit Rust target - # triple for the target architecture. - o['variables']['cargo_rust_target'] = '' - if flavor == 'win': - o['variables']['cargo_rust_target'] = \ - 'aarch64-pc-windows-msvc' if target_arch == 'arm64' else 'x86_64-pc-windows-msvc' - # Allow overriding the compiler - needed by embedders. if options.use_clang: o['variables']['clang'] = 1 @@ -2118,19 +2057,7 @@ def configure_v8(o, configs): o['variables']['v8_enable_external_code_space'] = 1 if options.enable_pointer_compression else 0 o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0 o['variables']['v8_enable_extensible_ro_snapshot'] = 0 - # TODO(richardlau): Temporal objects in V8 currently reference a private - # ICU header file and fail to compile with shared ICU or no ICU. For now, - # if auto-detecting, warn and disable Temporal in those cases. - # Refs: https://github.com/nodejs/node/issues/62676 - if (not options.v8_disable_temporal_support and not options.v8_enable_temporal_support): - match options.with_intl: - case 'none': - warn('Temporal support disabled when compiling without ICU') - options.v8_disable_temporal_support = True - case 'system-icu': - warn('Temporal support disabled when compiling with a shared ICU library') - options.v8_disable_temporal_support = True - o['variables']['v8_enable_temporal_support'] = 0 if options.v8_disable_temporal_support else 1 + o['variables']['v8_enable_temporal_support'] = 1 if options.v8_enable_temporal_support else 0 o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0 o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform) o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8) @@ -2162,10 +2089,6 @@ def configure_v8(o, configs): raise Exception( 'Only one of the --v8-enable-object-print or --v8-disable-object-print options ' 'can be specified at a time.') - if all(opt in sys.argv for opt in ['--v8-enable-temporal-support', '--v8-disable-temporal-support']): - raise Exception( - 'Only one of the --v8-enable-temporal-support or --v8-disable-temporal-support options ' - 'can be specified at a time.') if sys.platform != 'darwin': if o['variables']['v8_enable_webassembly'] and o['variables']['target_arch'] == 'x64': o['variables']['v8_enable_wasm_simd256_revec'] = 1 @@ -2261,43 +2184,6 @@ def without_sqlite_error(option): configure_library('sqlite', o, pkgname='sqlite3') -def bundled_ffi_supported(os_name, target_arch): - supported = { - 'freebsd': {'arm', 'arm64', 'x64'}, - 'linux': {'arm', 'arm64', 'x64'}, - 'mac': {'arm64', 'x64'}, - 'win': {'arm64', 'x64'}, - } - - if target_arch == 'x86': - target_arch = 'ia32' - - return target_arch in supported.get(os_name, set()) - -def configure_ffi(o): - use_ffi = not options.without_ffi - - if use_ffi and not options.shared_ffi: - target_arch = o['variables']['target_arch'] - if not bundled_ffi_supported(flavor, target_arch): - warn(f'FFI is disabled for {flavor}/{target_arch}: the bundled libffi ' - 'integration is not available on this platform. Use --shared-ffi ' - 'to provide a system libffi or --without-ffi to silence this ' - 'warning.') - use_ffi = False - - o['variables']['node_use_ffi'] = b(use_ffi) - - if options.without_ffi: - if options.shared_ffi: - error('--without-ffi is incompatible with --shared-ffi') - return - - if not use_ffi: - return - - configure_library('ffi', o, pkgname='libffi') - def configure_quic(o): o['variables']['node_use_quic'] = b(options.experimental_quic and not options.without_ssl) @@ -2388,7 +2274,6 @@ def icu_download(path): # always set icu_small, node.gyp depends on it being defined. o['variables']['icu_small'] = b(False) - o['variables']['icu_system'] = b(False) # prevent data override o['defines'] += ['ICU_NO_USER_DATA_OVERRIDE'] @@ -2425,7 +2310,6 @@ def icu_download(path): o['variables']['v8_enable_i18n_support'] = 1 elif with_intl == 'system-icu': # ICU from pkg-config. - o['variables']['icu_system'] = b(True) o['variables']['v8_enable_i18n_support'] = 1 pkgicu = pkg_config(['icu-i18n', 'icu-uc']) if not pkgicu[0]: @@ -2753,7 +2637,6 @@ def make_bin_override(): configure_library('ngtcp2', output, pkgname='libngtcp2') configure_lief(output); configure_sqlite(output); -configure_ffi(output); configure_library('temporal_capi', output) configure_library('uvwasi', output) configure_library('zstd', output, pkgname='libzstd') @@ -2871,7 +2754,7 @@ def make_bin_override(): # will fail to run python scripts. gyp_args += ['-Dpython=' + python] -if not options.v8_disable_temporal_support or not options.shared_temporal_capi: +if options.v8_enable_temporal_support and not options.shared_temporal_capi: cargo = os.environ.get('CARGO') if cargo: gyp_args += ['-Dcargo=' + cargo] diff --git a/deps/LIEF/lief.gyp b/deps/LIEF/lief.gyp index 783e97c181d897..3864c0e538a588 100644 --- a/deps/LIEF/lief.gyp +++ b/deps/LIEF/lief.gyp @@ -443,6 +443,7 @@ }, 'defines': [ 'LIEF_STATIC', + 'testtttt' 'MBEDTLS_CONFIG_FILE="config/mbedtls/config.h"', 'MBEDTLS_NO_PLATFORM_ENTROPY', 'SPDLOG_DISABLE_DEFAULT_LOGGER', diff --git a/deps/crates/cargo_build.py b/deps/crates/cargo_build.py deleted file mode 100644 index eaac737c77cc5f..00000000000000 --- a/deps/crates/cargo_build.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python3 - -"""Invoke cargo with the correct Rust target on Windows cross-compilation. - -Works around three issues: GYP's MSVS generator mangles executable names in -host-toolset actions (breaking direct cargo calls), GYP cannot set different -variable values per toolset, and cargo's output directory layout uses Rust -target triples while MSBuild expects platform names (x64/arm64). This script -reads MSBuild's $(Platform) to select the right Rust target and copies the -built library to a path MSBuild can resolve per-project. -""" - -import os -import shutil -import subprocess -import sys - - -def main(): - # Arguments: [cargo_args...] - if len(sys.argv) < 3: - print('Usage: cargo_build.py [cargo_args...]', file=sys.stderr) - sys.exit(1) - - platform = sys.argv[1] # x64 or arm64 - output_dir = sys.argv[2] # SHARED_INTERMEDIATE_DIR - cargo_args = sys.argv[3:] - build_profile = 'release' if '--release' in cargo_args else 'debug' - - cargo = os.environ.get('CARGO', 'cargo') - if not os.path.isabs(cargo) and shutil.which(cargo) is None: - home = os.environ.get('USERPROFILE', '') - cargo_home = os.path.join(home, '.cargo', 'bin', 'cargo.exe') - if os.path.isfile(cargo_home): - cargo = cargo_home - - rust_target_map = { - 'x64': 'x86_64-pc-windows-msvc', - 'arm64': 'aarch64-pc-windows-msvc', - } - rust_target = rust_target_map.get(platform) - if rust_target is None: - print(f'Unsupported platform: {platform}', file=sys.stderr) - sys.exit(1) - - cmd = [cargo, 'rustc', '--target', rust_target, '--target-dir', output_dir] + cargo_args - ret = subprocess.call(cmd) - if ret != 0: - sys.exit(ret) - - # Copy output to the platform-specific directory that MSBuild expects. - src = os.path.join(output_dir, rust_target, build_profile, 'node_crates.lib') - dst_dir = os.path.join(output_dir, platform, build_profile) - os.makedirs(dst_dir, exist_ok=True) - dst = os.path.join(dst_dir, 'node_crates.lib') - shutil.copy2(src, dst) - - -if __name__ == '__main__': - main() diff --git a/deps/crates/crates.gyp b/deps/crates/crates.gyp index fa2387281839f2..106000028ea794 100644 --- a/deps/crates/crates.gyp +++ b/deps/crates/crates.gyp @@ -2,46 +2,24 @@ 'variables': { 'cargo%': 'cargo', 'cargo_vendor_dir': './vendor', - 'cargo_rust_target%': '', }, 'conditions': [ ['build_type == "Release"', { 'variables': { 'cargo_build_flags': ['--release'], + 'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/release/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)', }, - 'conditions': [ - ['cargo_rust_target!=""', { - 'variables': { - 'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/$(Platform)/release/node_crates.lib', - }, - }, { - 'variables': { - 'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/release/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)', - }, - }], - ], }, { 'variables': { 'cargo_build_flags': [], + 'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/debug/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)', }, - 'conditions': [ - ['cargo_rust_target!=""', { - 'variables': { - 'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/$(Platform)/debug/node_crates.lib', - }, - }, { - 'variables': { - 'node_crates_libpath': '<(SHARED_INTERMEDIATE_DIR)/debug/<(STATIC_LIB_PREFIX)node_crates<(STATIC_LIB_SUFFIX)', - }, - }], - ], }] ], 'targets': [ { 'target_name': 'node_crates', 'type': 'none', - 'toolsets': ['host', 'target'], 'hard_dependency': 1, 'sources': [ 'Cargo.toml', @@ -61,54 +39,29 @@ }], ], }, - 'conditions': [ - ['cargo_rust_target!=""', { - 'actions': [ - { - 'action_name': 'cargo_build', - 'inputs': [ - '<@(_sources)' - ], - 'outputs': [ - '<(node_crates_libpath)' - ], - 'action': [ - '<(python)', - 'cargo_build.py', - '$(Platform)', - '<(SHARED_INTERMEDIATE_DIR)', - '<@(cargo_build_flags)', - '--frozen', - ], - } + 'actions': [ + { + 'action_name': 'cargo_build', + 'inputs': [ + '<@(_sources)' + ], + 'outputs': [ + '<(node_crates_libpath)' ], - }, { - 'actions': [ - { - 'action_name': 'cargo_build', - 'inputs': [ - '<@(_sources)' - ], - 'outputs': [ - '<(node_crates_libpath)' - ], - 'action': [ - '<(cargo)', - 'rustc', - '<@(cargo_build_flags)', - '--frozen', - '--target-dir', - '<(SHARED_INTERMEDIATE_DIR)' - ], - } + 'action': [ + '<(cargo)', + 'rustc', + '<@(cargo_build_flags)', + '--frozen', + '--target-dir', + '<(SHARED_INTERMEDIATE_DIR)' ], - }], + } ], }, { 'target_name': 'temporal_capi', 'type': 'none', - 'toolsets': ['host', 'target'], 'sources': [], 'dependencies': [ 'node_crates', diff --git a/deps/libffi/ChangeLog.old b/deps/libffi/ChangeLog.old deleted file mode 100644 index 8de1ca75f1b921..00000000000000 --- a/deps/libffi/ChangeLog.old +++ /dev/null @@ -1,7407 +0,0 @@ -Libffi change logs used to be maintained in separate ChangeLog files. -These days we generate them directly from the git commit messages. -The old ChangeLog files are saved here in order to maintain the historical -record. - -============================================================================= -From the old ChangeLog.libffi-3.1 file... - -2014-03-16 Josh Triplett - - * ChangeLog: Archive to ChangeLog.libffi-3.1 and delete. Future - changelogs will come from git, with autogenerated snapshots shipped in - distributed tarballs. - -2014-03-16 Josh Triplett - - Add support for stdcall, thiscall, and fastcall on non-Windows - x86-32. - - Linux supports the stdcall calling convention, either via - functions explicitly declared with the stdcall attribute, or via - code compiled with -mrtd which effectively makes stdcall the - default. - - This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on - non-Windows x86-32 platforms, as non-default calling conventions. - - * Makefile.am: Compile in src/x86/win32.S on non-Windows x86-32. - * src/x86/ffitarget.h: Add FFI_STDCALL, FFI_THISCALL, and - FFI_FASTCALL on non-Windows x86-32. Increase trampoline size to - accomodate these calling conventions, and unify some ifdeffery. - * src/x86/ffi.c: Add support for FFI_STDCALL, FFI_THISCALL, and - FFI_FASTCALL on non-Windows x86-32 platforms; update ifdeffery. - * src/x86/win32.S: Support compiling on non-Windows x86-32 - platforms. On those platforms, avoid redefining the SYSV symbols - already provided by src/x86/sysv.S. - * testsuite/libffi.call/closure_stdcall.c: Run on non-Windows. - #define __stdcall if needed. - * testsuite/libffi.call/closure_thiscall.c: Run on non-Windows. - #define __fastcall if needed. - * testsuite/libffi.call/fastthis1_win32.c: Run on non-Windows. - * testsuite/libffi.call/fastthis2_win32.c: Ditto. - * testsuite/libffi.call/fastthis3_win32.c: Ditto. - * testsuite/libffi.call/many2_win32.c: Ditto. - * testsuite/libffi.call/many_win32.c: Ditto. - * testsuite/libffi.call/strlen2_win32.c: Ditto. - * testsuite/libffi.call/strlen_win32.c: Ditto. - * testsuite/libffi.call/struct1_win32.c: Ditto. - * testsuite/libffi.call/struct2_win32.c: Ditto. - -2014-03-16 Josh Triplett - - * prep_cif.c: Remove unnecessary ifdef for X86_WIN32. - ffi_prep_cif_core had a special case for X86_WIN32, checking for - FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI - range before returning FFI_BAD_ABI. However, on X86_WIN32, - FFI_THISCALL already falls in that range, making the special case - unnecessary. Remove it. - -2014-03-16 Josh Triplett - - * testsuite/libffi.call/closure_stdcall.c, - testsuite/libffi.call/closure_thiscall.c: Remove fragile stack - pointer checks. These files included inline assembly to save the - stack pointer before and after the call, and compare the values. - However, compilers can and do leave the stack in different states - for these two pieces of inline assembly, such as by saving a - temporary value on the stack across the call; observed with gcc - -Os, and verified as spurious through careful inspection of - disassembly. - -2014-03-16 Josh Triplett - - * testsuite/libffi.call/many.c: Avoid spurious failure due to - excess floating-point precision. - * testsuite/libffi.call/many_win32.c: Ditto. - -2014-03-16 Josh Triplett - - * libtool-ldflags: Re-add. - -2014-03-16 Josh Triplett - - * Makefile.in, aclocal.m4, compile, config.guess, config.sub, - configure, depcomp, include/Makefile.in, install-sh, - libtool-ldflags, ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, - m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4, - man/Makefile.in, mdate-sh, missing, testsuite/Makefile.in: Delete - autogenerated files from version control. - * .gitignore: Add autogenerated files. - * autogen.sh: New script to generate the autogenerated files. - * README: Document requirement to run autogen.sh when building - directly from version control. - * .travis.yml: Run autogen.sh - -2014-03-14 Anthony Green - - * configure, Makefile.in: Rebuilt. - -2014-03-10 Mike Hommey - - * configure.ac: Allow building for mipsel with Android NDK r8. - * Makefile.am (AM_MAKEFLAGS): Replace double quotes with single - quotes. - -2014-03-10 Landry Breuil - - * configure.ac: Ensure the linker supports @unwind sections in libffi. - -2014-03-01 Anthony Green - - * Makefile.am (EXTRA_DIST): Replace old scripts with - generate-darwin-source-and-headers.py. - * Makefile.in: Rebuilt. - -2014-02-28 Anthony Green - - * Makefile.am (AM_CFLAGS): Reintroduce missing -DFFI_DEBUG for - --enable-debug builds. - * Makefile.in: Rebuilt. - -2014-02-28 Makoto Kato - - * src/closures.c: Fix build failure when using clang for Android. - -2014-02-28 Marcin Wojdyr - - * libffi.pc.in (toolexeclibdir): use -L${toolexeclibdir} instead - of -L${libdir}. - -2014-02-28 Paulo Pizarro - - * src/bfin/sysv.S: Calling functions in shared libraries requires - considering the GOT. - -2014-02-28 Josh Triplett - - * src/x86/ffi64.c (classify_argument): Handle case where - FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE. - -2014-02-28 Anthony Green - - * ltmain.sh: Generate with libtool-2.4.2.418. - * m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4: Ditto. - * configure: Rebuilt. - -2014-02-28 Dominik Vogt - - * configure.ac (AC_ARG_ENABLE struct): Fix typo in help - message. - (AC_ARG_ENABLE raw_api): Ditto. - * configure, fficonfig.h.in: Rebuilt. - -2014-02-28 Will Newton - - * src/arm/sysv.S: Initialize IP register with FP. - -2014-02-28 Yufeng Zhang - - * src/aarch64/sysv.S (ffi_closure_SYSV): Use x29 as the - main CFA reg; update cfi_rel_offset. - -2014-02-15 Marcus Comstedt - - * src/powerpc/ffi_linux64.c, src/powerpc/linux64_closure.S: Remove - assumption on contents of r11 in closure. - -2014-02-09 Heiher - - * src/mips/n32.S: Fix call floating point va function. - -2014-01-21 Zachary Waldowski - - * src/aarch64/ffi.c: Fix missing semicolons on assertions under - debug mode. - -2013-12-30 Zachary Waldowski - - * .gitignore: Exclude darwin_* generated source and build_* trees. - * src/aarch64/ffi.c, src/arm/ffi.c, src/x86/ffi.c: Inhibit Clang - previous prototype warnings. - * src/arm/ffi.c: Prevent NULL dereference, fix short type warning - * src/dlmalloc.c: Fix warnings from set_segment_flags return type, - and the native use of size_t for malloc on platforms - * src/arm/sysv.S: Use unified syntax. Clang clean-ups for - ARM_FUNC_START. - * generate-osx-source-and-headers.py: Remove. - * build-ios.sh: Remove. - * libffi.xcodeproj/project.pbxproj: Rebuild targets. Include - x86_64+aarch64 pieces in library. Export headers properly. - * src/x86/ffi64.c: More Clang warning clean-ups. - * src/closures.c (open_temp_exec_file_dir): Use size_t. - * src/prep_cif.c (ffi_prep_cif_core): Cast ALIGN result. - * src/aarch64/sysv.S: Use CNAME for global symbols. Only use - .size for ELF targets. - * src/aarch64/ffi.c: Clean up for double == long double. Clean up - from Clang warnings. Use Clang cache invalidation builtin. Use - size_t in place of unsigned in many places. Accommodate for - differences in Apple AArch64 ABI. - -2013-12-02 Daniel Rodríguez Troitiño - - * generate-darwin-source-and-headers.py: Clean up, modernize, - merged version of previous scripts. - -2013-11-21 Anthony Green - - * configure, Makefile.in, include/Makefile.in, include/ffi.h.in, - man/Makefile.in, testsuite/Makefile.in, fficonfig.h.in: Rebuilt. - -2013-11-21 Alan Modra - - * Makefile.am (EXTRA_DIST): Add new src/powerpc files. - (nodist_libffi_la_SOURCES ): Likewise. - * configure.ac (HAVE_LONG_DOUBLE_VARIANT): Define for powerpc. - * include/ffi.h.in (ffi_prep_types): Declare. - * src/prep_cif.c (ffi_prep_cif_core): Call ffi_prep_types. - * src/types.c (FFI_NONCONST_TYPEDEF): Define and use for - HAVE_LONG_DOUBLE_VARIANT. - * src/powerpc/ffi_powerpc.h: New file. - * src/powerpc/ffi.c: Split into.. - * src/powerpc/ffi_sysv.c: ..new file, and.. - * src/powerpc/ffi_linux64.c: ..new file, rewriting parts. - * src/powerpc/ffitarget.h (enum ffi_abi): Rewrite powerpc ABI - selection as bits controlling features. - * src/powerpc/linux64.S: For consistency, use POWERPC64 rather - than __powerpc64__. - * src/powerpc/linux64_closure.S: Likewise. - * src/powerpc/ppc_closure.S: Likewise. Move .note.FNU-stack - inside guard. - * src/powerpc/sysv.S: Likewise. - * configure: Regenerate. - * fficonfig.h.in: Regenerate. - * Makefile.in: Regenerate. - -2013-11-20 Alan Modra - - * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use - NUM_FPR_ARG_REGISTERS64 and NUM_GPR_ARG_REGISTERS64 not their - 32-bit versions for 64-bit code. - * src/powerpc/linux64_closure.S: Don't use the return value area - as a parameter save area on ELFv2. - -2013-11-18 Iain Sandoe - - * src/powerpc/darwin.S (EH): Correct use of pcrel FDE encoding. - * src/powerpc/darwin_closure.S (EH): Likewise. Modernise picbase - labels. - -2013-11-18 Anthony Green - - * src/arm/ffi.c (ffi_call): Hoist declaration of temp to top of - function. - * src/arm/ffi.c (ffi_closure_inner): Moderize function declaration - to appease compiler. - Thanks for Gregory P. Smith . - -2013-11-18 Anthony Green - - * README (tested): Mention PowerPC ELFv2. - -2013-11-16 Alan Modra - - * src/powerpc/ppc_closure.S: Move errant #endif to where it belongs. - Don't bl .Luint128. - -2013-11-16 Alan Modra - - * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use #if _CALL_ELF - test to select parameter save sizing for ELFv2 vs. ELFv1. - * src/powerpc/ffitarget.h (FFI_V2_TYPE_FLOAT_HOMOG, - FFI_V2_TYPE_DOUBLE_HOMOG, FFI_V2_TYPE_SMALL_STRUCT): Define. - (FFI_TRAMPOLINE_SIZE): Define variant for ELFv2. - * src/powerpc/ffi.c (FLAG_ARG_NEEDS_PSAVE): Define. - (discover_homogeneous_aggregate): New function. - (ffi_prep_args64): Adjust start of param save area for ELFv2. - Handle homogenous floating point struct parms. - (ffi_prep_cif_machdep_core): Adjust space calculation for ELFv2. - Handle ELFv2 return values. Set FLAG_ARG_NEEDS_PSAVE. Handle - homogenous floating point structs. - (ffi_call): Increase size of smst_buffer for ELFv2. Handle ELFv2. - (flush_icache): Compile for ELFv2. - (ffi_prep_closure_loc): Set up ELFv2 trampoline. - (ffi_closure_helper_LINUX64): Don't return all structs directly - to caller. Handle homogenous floating point structs. Handle - ELFv2 struct return values. - * src/powerpc/linux64.S (ffi_call_LINUX64): Set up r2 for - ELFv2. Adjust toc save location. Call function pointer using - r12. Handle FLAG_RETURNS_SMST. Don't predict branches. - * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Set up r2 - for ELFv2. Define ELFv2 versions of STACKFRAME, PARMSAVE, and - RETVAL. Handle possibly missing parameter save area. Handle - ELFv2 return values. - (.note.GNU-stack): Move inside outer #ifdef. - -2013-11-16 Alan Modra - - * src/powerpc/ffi.c (ffi_prep_cif_machdep): Revert 2013-02-08 - change. Do not consume an int arg when returning a small struct - for FFI_SYSV ABI. - (ffi_call): Only use bounce buffer when FLAG_RETURNS_SMST. - Properly copy bounce buffer to destination. - * src/powerpc/sysv.S: Revert 2013-02-08 change. - * src/powerpc/ppc_closure.S: Remove stray '+'. - -2013-11-16 Alan Modra - - * src/powerpc/ffi.c (ffi_prep_args64): Align struct parameters - according to __STRUCT_PARM_ALIGN__. - (ffi_prep_cif_machdep_core): Likewise. - (ffi_closure_helper_LINUX64): Likewise. - -2013-11-16 Alan Modra - - * src/powerpc/linux64.S (ffi_call_LINUX64): Tweak restore of r28. - (.note.GNU-stack): Move inside outer #ifdef. - * src/powerpc/linux64_closure.S (STACKFRAME, PARMSAVE, - RETVAL): Define and use throughout. - (ffi_closure_LINUX64): Save fprs before buying stack. - (.note.GNU-stack): Move inside outer #ifdef. - -2013-11-16 Alan Modra - - * src/powerpc/ffitarget.h (FFI_TARGET_SPECIFIC_VARIADIC): Define. - (FFI_EXTRA_CIF_FIELDS): Define. - * src/powerpc/ffi.c (ffi_prep_args64): Save fprs as per the - ABI, not to both fpr and param save area. - (ffi_prep_cif_machdep_core): Renamed from ffi_prep_cif_machdep. - Keep initial flags. Formatting. Remove dead FFI_LINUX_SOFT_FLOAT - code. - (ffi_prep_cif_machdep, ffi_prep_cif_machdep_var): New functions. - (ffi_closure_helper_LINUX64): Pass floating point as per ABI, - not to both fpr and parameter save areas. - - * libffi/testsuite/libffi.call/cls_double_va.c (main): Correct - function cast and don't call ffi_prep_cif. - * libffi/testsuite/libffi.call/cls_longdouble_va.c (main): Likewise. - -2013-11-15 Andrew Haley - - * doc/libffi.texi (Closure Example): Fix the sample code. - * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt. - -2013-11-15 Andrew Haley - - * testsuite/libffi.call/va_struct1.c (main): Fix broken test. - * testsuite/libffi.call/cls_uint_va.c (cls_ret_T_fn): Likewise - * testsuite/libffi.call/cls_struct_va1.c (test_fn): Likewise. - * testsuite/libffi.call/va_1.c (main): Likewise. - -2013-11-14 David Schneider - - * src/arm/ffi.c: Fix register allocation for mixed float and - doubles. - * testsuite/libffi.call/cls_many_mixed_float_double.c: Testcase - for many mixed float and double arguments. - -2013-11-13 Alan Modra - - * doc/libffi.texi (Simple Example): Correct example code. - * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt. - -2013-11-13 Anthony Green - - * include/ffi_common.h: Respect HAVE_ALLOCA_H for GNU compiler - based build. (Thanks to tmr111116 on github) - -2013-11-09 Anthony Green - - * m4/libtool.m4: Refresh. - * configure, Makefile.in: Rebuilt. - * README: Add more notes about next release. - -2013-11-09 Shigeharu TAKENO - - * m4/ax_gcc_archflag.m4 (ax_gcc_arch): Don't recognize - UltraSPARC-IIi as ultrasparc3. - -2013-11-06 Mark Kettenis - - * src/x86/freebsd.S (ffi_call_SYSV): Align the stack pointer to - 16-bytes. - -2013-11-06 Konstantin Belousov - - * src/x86/freebsd.S (ffi_closure_raw_SYSV): Mark the assembler - source as not requiring executable stack. - -2013-11-02 Anthony Green - - * doc/libffi.texi (The Basics): Clarify return value buffer size - requirements. Also, NULL result buffer pointers are no longer - supported. - * doc/libffi.info: Rebuilt. - -2013-11-02 Mischa Jonker - - * Makefile.am (nodist_libffi_la_SOURCES): Fix build error. - * Makefile.in: Rebuilt. - -2013-11-02 David Schneider - - * src/arm/ffi.c: more robust argument handling for closures on arm hardfloat - * testsuite/libffi.call/many_mixed.c: New file. - * testsuite/libffi.call/cls_many_mixed_args.c: More tests. - -2013-11-02 Vitaly Budovski - - * src/x86/ffi.c (ffi_prep_cif_machdep): Don't align stack for win32. - -2013-10-23 Mark H Weaver - - * src/mips/ffi.c: Fix handling of uint32_t arguments on the - MIPS N32 ABI. - -2013-10-13 Sandra Loosemore - - * README: Add Nios II to table of supported platforms. - * Makefile.am (EXTRA_DIST): Add nios2 files. - (nodist_libffi_la_SOURCES): Likewise. - * Makefile.in: Regenerated. - * configure.ac (nios2*-linux*): New host. - (NIOS2): Add AM_CONDITIONAL. - * configure: Regenerated. - * src/nios2/ffi.c: New. - * src/nios2/ffitarget.h: New. - * src/nios2/sysv.S: New. - * src/prep_cif.c (initialize_aggregate): Handle extra structure - alignment via FFI_AGGREGATE_ALIGNMENT. - (ffi_prep_cif_core): Conditionalize structure return for NIOS2. - -2013-10-10 Sandra Loosemore - - * testsuite/libffi.call/cls_many_mixed_args.c (cls_ret_double_fn): - Fix uninitialized variable. - -2013-10-11 Marcus Shawcroft - - * testsuite/libffi.call/many.c (many): Replace * with +. - -2013-10-08 Ondřej Bílka - - * src/aarch64/ffi.c, src/aarch64/sysv.S, src/arm/ffi.c, - src/arm/gentramp.sh, src/bfin/sysv.S, src/closures.c, - src/dlmalloc.c, src/ia64/ffi.c, src/microblaze/ffi.c, - src/microblaze/sysv.S, src/powerpc/darwin_closure.S, - src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/sh/ffi.c, - src/tile/tile.S, testsuite/libffi.call/nested_struct11.c: Fix - spelling errors. - -2013-10-08 Anthony Green - - * aclocal.m4, compile, config.guess, config.sub, depcomp, - install-sh, mdate-sh, missing, texinfo.tex: Update from upstream. - * configure.ac: Update version to 3.0.14-rc0. - * Makefile.in, configure, Makefile.in, include/Makefile.in, - man/Makefile.in, testsuite/Makefile.in: Rebuilt. - * README: Mention M88K and VAX. - -2013-07-15 Miod Vallat - - * Makefile.am, - configure.ac, - src/m88k/ffi.c, - src/m88k/ffitarget.h, - src/m88k/obsd.S, - src/vax/elfbsd.S, - src/vax/ffi.c, - src/vax/ffitarget.h: Add m88k and vax support. - -2013-06-24 Alan Modra - - * src/powerpc/ffi.c (ffi_prep_args_SYSV): Move var declaration - before statements. - (ffi_prep_args64): Support little-endian. - (ffi_closure_helper_SYSV, ffi_closure_helper_LINUX64): Likewise. - * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise. - * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Likewise. - -2013-06-12 Mischa Jonker - - * configure.ac: Add support for ARC. - * Makefile.am: Likewise. - * README: Add ARC details. - * src/arc/arcompact.S: New. - * src/arc/ffi.c: Likewise. - * src/arc/ffitarget.h: Likewise. - -2013-03-28 David Schneider - - * src/arm/ffi.c: Fix support for ARM hard-float calling convention. - * src/arm/sysv.S: call different methods for SYSV and VFP ABIs. - * testsuite/libffi.call/cls_many_mixed_args.c: testcase for a closure with - mixed arguments, many doubles. - * testsuite/libffi.call/many_double.c: testcase for calling a function using - more than 8 doubles. - * testcase/libffi.call/many.c: use absolute value to check result against an - epsilon - -2013-03-17 Anthony Green - - * README: Update for 3.0.13. - * configure.ac: Ditto. - * configure: Rebuilt. - * doc/*: Update version. - -2013-03-17 Dave Korn - - * src/closures.c (is_emutramp_enabled - [!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default definition outside - enclosing #if scope. - -2013-03-17 Anthony Green - - * configure.ac: Only modify toolexecdir in certain cases. - * configure: Rebuilt. - -2013-03-16 Gilles Talis - - * src/powerpc/ffi.c (ffi_prep_args_SYSV): Don't use - fparg_count,etc on __NO_FPRS__ targets. - -2013-03-16 Alan Hourihane - - * src/m68k/sysv.S (epilogue): Don't use extb instruction on - m680000 machines. - -2013-03-16 Alex Gaynor - - * src/x86/ffi.c (ffi_prep_cif_machdep): Always align stack. - -2013-03-13 Markos Chandras - - * configure.ac: Add support for Imagination Technologies Meta. - * Makefile.am: Likewise. - * README: Add Imagination Technologies Meta details. - * src/metag/ffi.c: New. - * src/metag/ffitarget.h: Likewise. - * src/metag/sysv.S: Likewise. - -2013-02-24 Andreas Schwab - - * doc/libffi.texi (Structures): Fix missing category argument of - @deftp. - -2013-02-11 Anthony Green - - * configure.ac: Update release number to 3.0.12. - * configure: Rebuilt. - * README: Update release info. - -2013-02-10 Anthony Green - - * README: Add Moxie. - * src/moxie/ffi.c: Created. - * src/moxie/eabi.S: Created. - * src/moxie/ffitarget.h: Created. - * Makefile.am (nodist_libffi_la_SOURCES): Add Moxie. - * Makefile.in: Rebuilt. - * configure.ac: Add Moxie. - * configure: Rebuilt. - * testsuite/libffi.call/huge_struct.c: Disable format string - warnings for moxie*-*-elf tests. - -2013-02-10 Anthony Green - - * Makefile.am (LTLDFLAGS): Fix reference. - * Makefile.in: Rebuilt. - -2013-02-10 Anthony Green - - * README: Update supported platforms. Update test results link. - -2013-02-09 Anthony Green - - * testsuite/libffi.call/negint.c: Remove forced -O2. - * testsuite/libffi.call/many2.c (foo): Remove GCCism. - * testsuite/libffi.call/ffitest.h: Add default PRIuPTR definition. - - * src/sparc/v8.S (ffi_closure_v8): Import ancient ulonglong - closure return type fix developed by Martin v. Löwis for cpython - fork. - -2013-02-08 Andreas Tobler - - * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix small struct - support. - * src/powerpc/sysv.S: Ditto. - -2013-02-08 Anthony Green - - * testsuite/libffi.call/cls_longdouble.c: Remove xfail for - arm*-*-*. - -2013-02-08 Anthony Green - - * src/sparc/ffi.c (ffi_prep_closure_loc): Fix cache flushing for GCC. - -2013-02-08 Matthias Klose - - * man/ffi_prep_cif.3: Clean up for debian linter. - -2013-02-08 Peter Bergner - - * src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed - on the stack. - -2013-02-08 Anthony Green - - * Makefile.am (EXTRA_DIST): Add missing files. - * testsuite/Makefile.am (EXTRA_DIST): Ditto. - * Makefile.in: Rebuilt. - -2013-02-08 Anthony Green - - * configure.ac: Move sparc asm config checks to within functions - for compatibility with sun tools. - * configure: Rebuilt. - * src/sparc/ffi.c (ffi_prep_closure_loc): Flush cache on v9 - systems. - * src/sparc/v8.S (ffi_flush_icache): Implement a sparc v9 cache - flusher. - -2013-02-08 Nathan Rossi - - * src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of - small big-endian structures. - (ffi_prep_args): Ditto. - -2013-02-07 Anthony Green - - * src/sparc/v8.S (ffi_call_v8): Fix typo from last patch - (effectively hiding ffi_call_v8). - -2013-02-07 Anthony Green - - * configure.ac: Update bug reporting address. - * configure.in: Rebuild. - - * src/sparc/v8.S (ffi_flush_icache): Out-of-line cache flusher for - Sun compiler. - * src/sparc/ffi.c (ffi_call): Remove warning. - Call ffi_flush_icache for non-GCC builds. - (ffi_prep_closure_loc): Use ffi_flush_icache. - - * Makefile.am (EXTRA_DIST): Add libtool-ldflags. - * Makefile.in: Rebuilt. - * libtool-ldflags: New file. - -2013-02-07 Daniel Schepler - - * configure.ac: Correctly identify x32 systems as 64-bit. - * m4/libtool.m4: Remove libtool expr error. - * aclocal.m4, configure: Rebuilt. - -2013-02-07 Anthony Green - - * configure.ac: Fix GCC usage test. - * configure: Rebuilt. - * README: Mention LLVM/GCC x86_64 issue. - * testsuite/Makefile.in: Rebuilt. - -2013-02-07 Anthony Green - - * testsuite/libffi.call/cls_double_va.c (main): Replace // style - comments with /* */ for xlc compiler. - * testsuite/libffi.call/stret_large.c (main): Ditto. - * testsuite/libffi.call/stret_large2.c (main): Ditto. - * testsuite/libffi.call/nested_struct1.c (main): Ditto. - * testsuite/libffi.call/huge_struct.c (main): Ditto. - * testsuite/libffi.call/float_va.c (main): Ditto. - * testsuite/libffi.call/cls_struct_va1.c (main): Ditto. - * testsuite/libffi.call/cls_pointer_stack.c (main): Ditto. - * testsuite/libffi.call/cls_pointer.c (main): Ditto. - * testsuite/libffi.call/cls_longdouble_va.c (main): Ditto. - -2013-02-06 Anthony Green - - * man/ffi_prep_cif.3: Clean up for debian lintian checker. - -2013-02-06 Anthony Green - - * Makefile.am (pkgconfigdir): Add missing pkgconfig install bits. - * Makefile.in: Rebuild. - -2013-02-02 Mark H Weaver - - * src/x86/ffi64.c (ffi_call): Sign-extend integer arguments passed - via general purpose registers. - -2013-01-21 Nathan Rossi - - * README: Add MicroBlaze details. - * Makefile.am: Add MicroBlaze support. - * configure.ac: Likewise. - * src/microblaze/ffi.c: New. - * src/microblaze/ffitarget.h: Likewise. - * src/microblaze/sysv.S: Likewise. - -2013-01-21 Nathan Rossi - * testsuite/libffi.call/return_uc.c: Fixed issue. - -2013-01-21 Chris Zankel - - * README: Add Xtensa support. - * Makefile.am: Likewise. - * configure.ac: Likewise. - * Makefile.in Regenerate. - * configure: Likewise. - * src/prep_cif.c: Handle Xtensa. - * src/xtensa: New directory. - * src/xtensa/ffi.c: New file. - * src/xtensa/ffitarget.h: Ditto. - * src/xtensa/sysv.S: Ditto. - -2013-01-11 Anthony Green - - * src/powerpc/ffi_darwin.c (ffi_prep_args): Replace // style - comments with /* */ for xlc compiler. - * src/powerpc/aix.S (ffi_call_AIX): Ditto. - * testsuite/libffi.call/ffitest.h (allocate_mmap): Delete - deprecated inline function. - * testsuite/libffi.special/ffitestcxx.h: Ditto. - * README: Add update for AIX support. - -2013-01-11 Anthony Green - - * configure.ac: Robustify pc relative reloc check. - * m4/ax_cc_maxopt.m4: Don't -malign-double. This is an ABI - changing option for 32-bit x86. - * aclocal.m4, configure: Rebuilt. - * README: Update supported target list. - -2013-01-10 Anthony Green - - * README (tested): Add Compiler column to table. - -2013-01-10 Anthony Green - - * src/x86/ffi64.c (struct register_args): Make sse array and array - of unions for sunpro compiler compatibility. - -2013-01-10 Anthony Green - - * configure.ac: Test target platform size_t size. Handle both 32 - and 64-bit builds for x86_64-* and i?86-* targets (allowing for - CFLAG option to change default settings). - * configure, aclocal.m4: Rebuilt. - -2013-01-10 Anthony Green - - * testsuite/libffi.special/special.exp: Only run exception - handling tests when using GNU compiler. - - * m4/ax_compiler_vendor.m4: New file. - * configure.ac: Test for compiler vendor and don't use - AX_CFLAGS_WARN_ALL with the sun compiler. - * aclocal.m4, configure: Rebuilt. - -2013-01-10 Anthony Green - - * include/ffi_common.h: Don't use GCCisms to define types when - building with the SUNPRO compiler. - -2013-01-10 Anthony Green - - * configure.ac: Put local.exp in the right place. - * configure: Rebuilt. - - * src/x86/ffi.c: Update comment about regparm function attributes. - * src/x86/sysv.S (ffi_closure_SYSV): The SUNPRO compiler requires - that all function arguments be passed on the stack (no regparm - support). - -2013-01-08 Anthony Green - - * configure.ac: Generate local.exp. This sets CC_FOR_TARGET - when we are using the vendor compiler. - * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): Point to - ../local.exp. - * configure, testsuite/Makefile.in: Rebuilt. - - * testsuite/libffi.call/call.exp: Run tests with different - options, depending on whether or not we are using gcc or the - vendor compiler. - * testsuite/lib/libffi.exp (libffi-init): Set using_gcc based on - whether or not we are building/testing with gcc. - -2013-01-08 Anthony Green - - * configure.ac: Switch x86 solaris target to X86 by default. - * configure: Rebuilt. - -2013-01-08 Anthony Green - - * configure.ac: Fix test for read-only eh_frame. - * configure: Rebuilt. - -2013-01-08 Anthony Green - - * src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info - when building with the GNU toolchain. - * testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor - compiler. - -2013-01-07 Thorsten Glaser - - * testsuite/libffi.call/cls_uchar_va.c, - testsuite/libffi.call/cls_ushort_va.c, - testsuite/libffi.call/va_1.c: Testsuite fixes. - -2013-01-07 Thorsten Glaser - - * src/m68k/ffi.c (CIF_FLAGS_SINT8, CIF_FLAGS_SINT16): Define. - (ffi_prep_cif_machdep): Fix 8-bit and 16-bit signed calls. - * src/m68k/sysv.S (ffi_call_SYSV, ffi_closure_SYSV): Ditto. - -2013-01-04 Anthony Green - - * Makefile.am (AM_CFLAGS): Don't automatically add -fexceptions - and -Wall. This is set in the configure script after testing for - GCC. - * Makefile.in: Rebuilt. - -2013-01-02 rofl0r - - * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix build error on ppc - when long double == double. - -2013-01-02 Reini Urban - - * Makefile.am (libffi_la_LDFLAGS): Add -no-undefined to LDFLAGS - (required for shared libs on cygwin/mingw). - * Makefile.in: Rebuilt. - -2012-10-31 Alan Modra - - * src/powerpc/linux64_closure.S: Add new ABI support. - * src/powerpc/linux64.S: Likewise. - -2012-10-30 Magnus Granberg - Pavel Labushev - - * configure.ac: New options pax_emutramp - * configure, fficonfig.h.in: Regenerated - * src/closures.c: New function emutramp_enabled_check() and - checks. - -2012-10-30 Frederick Cheung - - * configure.ac: Enable FFI_MAP_EXEC_WRIT for Darwin 12 (mountain - lion) and future version. - * configure: Rebuild. - -2012-10-30 James Greenhalgh - Marcus Shawcroft - - * README: Add details of aarch64 port. - * src/aarch64/ffi.c: New. - * src/aarch64/ffitarget.h: Likewise. - * src/aarch64/sysv.S: Likewise. - * Makefile.am: Support aarch64. - * configure.ac: Support aarch64. - * Makefile.in, configure: Rebuilt. - -2012-10-30 James Greenhalgh - Marcus Shawcroft - - * testsuite/lib/libffi.exp: Add support for aarch64. - * testsuite/libffi.call/cls_struct_va1.c: New. - * testsuite/libffi.call/cls_uchar_va.c: Likewise. - * testsuite/libffi.call/cls_uint_va.c: Likewise. - * testsuite/libffi.call/cls_ulong_va.c: Likewise. - * testsuite/libffi.call/cls_ushort_va.c: Likewise. - * testsuite/libffi.call/nested_struct11.c: Likewise. - * testsuite/libffi.call/uninitialized.c: Likewise. - * testsuite/libffi.call/va_1.c: Likewise. - * testsuite/libffi.call/va_struct1.c: Likewise. - * testsuite/libffi.call/va_struct2.c: Likewise. - * testsuite/libffi.call/va_struct3.c: Likewise. - -2012-10-12 Walter Lee - - * Makefile.am: Add TILE-Gx/TILEPro support. - * configure.ac: Likewise. - * Makefile.in: Regenerate. - * configure: Likewise. - * src/prep_cif.c (ffi_prep_cif_core): Handle TILE-Gx/TILEPro. - * src/tile: New directory. - * src/tile/ffi.c: New file. - * src/tile/ffitarget.h: Ditto. - * src/tile/tile.S: Ditto. - -2012-10-12 Matthias Klose - - * generate-osx-source-and-headers.py: Normalize whitespace. - -2012-09-14 David Edelsohn - - * configure: Regenerated. - -2012-08-26 Andrew Pinski - - PR libffi/53014 - * src/mips/ffi.c (ffi_prep_closure_loc): Allow n32 with soft-float and n64 with - soft-float. - -2012-08-08 Uros Bizjak - - * src/s390/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, - just return FFI_BAD_ABI when things are wrong. - -2012-07-18 H.J. Lu - - PR libffi/53982 - PR libffi/53973 - * src/x86/ffitarget.h: Check __ILP32__ instead of __LP64__ for x32. - (FFI_SIZEOF_JAVA_RAW): Defined to 4 for x32. - -2012-05-16 H.J. Lu - - * configure: Regenerated. - -2012-05-05 Nicolas Lelong - - * libffi.xcodeproj/project.pbxproj: Fixes. - * README: Update for iOS builds. - -2012-04-23 Alexandre Keunecke I. de Mendonca - - * configure.ac: Add Blackfin/sysv support - * Makefile.am: Add Blackfin/sysv support - * src/bfin/ffi.c: Add Blackfin/sysv support - * src/bfin/ffitarget.h: Add Blackfin/sysv support - -2012-04-11 Anthony Green - - * Makefile.am (EXTRA_DIST): Add new script. - * Makefile.in: Rebuilt. - -2012-04-11 Zachary Waldowski - - * generate-ios-source-and-headers.py, - libffi.xcodeproj/project.pbxproj: Support a Mac static library via - Xcode. Set iOS compatibility to 4.0. Move iOS trampoline - generation into an Xcode "run script" phase. Include both as - Xcode build scripts. Don't always regenerate config files. - -2012-04-10 Anthony Green - - * src/powerpc/ffi_darwin.c (ffi_prep_args): Add missing semicolon. - -2012-04-06 Anthony Green - - * Makefile.am (EXTRA_DIST): Add new iOS/xcode files. - * Makefile.in: Rebuilt. - -2012-04-06 Mike Lewis - - * generate-ios-source-and-headers.py: New file. - * libffi.xcodeproj/project.pbxproj: New file. - * README: Update instructions on building iOS binary. - * build-ios.sh: Delete. - -2012-04-06 Anthony Green - - * src/x86/ffi64.c (UINT128): Define differently for Intel and GNU - compilers, then use it. - -2012-04-06 H.J. Lu - - * m4/libtool.m4 (_LT_ENABLE_LOCK): Support x32. - -2012-04-06 Anthony Green - - * testsuite/Makefile.am (EXTRA_DIST): Add missing test cases. - * testsuite/Makefile.in: Rebuilt. - -2012-04-05 Zachary Waldowski - - * include/ffi.h.in: Add missing trampoline table fields. - * src/arm/sysv.S: Fix ENTRY definition, and wrap symbol references - in CNAME. - * src/x86/ffi.c: Wrap Windows specific code in ifdefs. - -2012-04-02 Peter Bergner - - * src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp. - Silence casting pointer to integer of different size warning. - Delete goto to previously deleted label. - (ffi_call): Silence possibly undefined warning. - (ffi_closure_helper_SYSV): Declare variable type. - -2012-04-02 Peter Rosin - - * src/x86/win32.S (ffi_call_win32): Sign/zero extend the return - value in the Intel version as is already done for the AT&T version. - (ffi_closure_SYSV): Likewise. - (ffi_closure_raw_SYSV): Likewise. - (ffi_closure_STDCALL): Likewise. - -2012-03-29 Peter Rosin - - * src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame - generation, fix the ENDP label and remove the surplus third arg - from the 'lea' insn. - -2012-03-29 Peter Rosin - - * src/x86/win32.S (ffi_closure_raw_SYSV): Make the 'stubraw' label - visible outside the PROC, so that ffi_closure_raw_THISCALL can see - it. Also instruct the assembler to add a frame to the function. - -2012-03-23 Peter Rosin - - * Makefile.am (AM_CPPFLAGS): Add -DFFI_BUILDING. - * Makefile.in: Rebuilt. - * include/ffi.h.in [MSVC]: Add __declspec(dllimport) decorations - to all data exports, when compiling libffi clients using MSVC. - -2012-03-29 Peter Rosin - - * src/x86/ffitarget.h (ffi_abi): Add new ABI FFI_MS_CDECL and - make it the default for MSVC. - (FFI_TYPE_MS_STRUCT): New structure return convention. - * src/x86/ffi.c (ffi_prep_cif_machdep): Tweak the structure - return convention for FFI_MS_CDECL to be FFI_TYPE_MS_STRUCT - instead of an ordinary FFI_TYPE_STRUCT. - (ffi_prep_args): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT. - (ffi_call): Likewise. - (ffi_prep_incoming_args_SYSV): Likewise. - (ffi_raw_call): Likewise. - (ffi_prep_closure_loc): Treat FFI_MS_CDECL as FFI_SYSV. - * src/x86/win32.S (ffi_closure_SYSV): For FFI_TYPE_MS_STRUCT, - return a pointer to the result structure in eax and don't pop - that pointer from the stack, the caller takes care of it. - (ffi_call_win32): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT. - (ffi_closure_raw_SYSV): Likewise. - -2012-03-22 Peter Rosin - - * testsuite/libffi.call/closure_stdcall.c [MSVC]: Add inline - assembly version with Intel syntax. - * testsuite/libffi.call/closure_thiscall.c [MSVC]: Likewise. - -2012-03-23 Peter Rosin - - * testsuite/libffi.call/ffitest.h: Provide abstration of - __attribute__((fastcall)) in the form of a __FASTCALL__ - define. Define it to __fastcall for MSVC. - * testsuite/libffi.call/fastthis1_win32.c: Use the above. - * testsuite/libffi.call/fastthis2_win32.c: Likewise. - * testsuite/libffi.call/fastthis3_win32.c: Likewise. - * testsuite/libffi.call/strlen2_win32.c: Likewise. - * testsuite/libffi.call/struct1_win32.c: Likewise. - * testsuite/libffi.call/struct2_win32.c: Likewise. - -2012-03-22 Peter Rosin - - * src/x86/win32.S [MSVC] (ffi_closure_THISCALL): Remove the manual - frame on function entry, MASM adds one automatically. - -2012-03-22 Peter Rosin - - * testsuite/libffi.call/ffitest.h [MSVC]: Add kludge for missing - bits in the MSVC headers. - -2012-03-22 Peter Rosin - - * testsuite/libffi.call/cls_12byte.c: Adjust to the C89 style - with no declarations after statements. - * testsuite/libffi.call/cls_16byte.c: Likewise. - * testsuite/libffi.call/cls_18byte.c: Likewise. - * testsuite/libffi.call/cls_19byte.c: Likewise. - * testsuite/libffi.call/cls_1_1byte.c: Likewise. - * testsuite/libffi.call/cls_20byte.c: Likewise. - * testsuite/libffi.call/cls_20byte1.c: Likewise. - * testsuite/libffi.call/cls_24byte.c: Likewise. - * testsuite/libffi.call/cls_2byte.c: Likewise. - * testsuite/libffi.call/cls_3_1byte.c: Likewise. - * testsuite/libffi.call/cls_3byte1.c: Likewise. - * testsuite/libffi.call/cls_3byte2.c: Likewise. - * testsuite/libffi.call/cls_4_1byte.c: Likewise. - * testsuite/libffi.call/cls_4byte.c: Likewise. - * testsuite/libffi.call/cls_5_1_byte.c: Likewise. - * testsuite/libffi.call/cls_5byte.c: Likewise. - * testsuite/libffi.call/cls_64byte.c: Likewise. - * testsuite/libffi.call/cls_6_1_byte.c: Likewise. - * testsuite/libffi.call/cls_6byte.c: Likewise. - * testsuite/libffi.call/cls_7_1_byte.c: Likewise. - * testsuite/libffi.call/cls_7byte.c: Likewise. - * testsuite/libffi.call/cls_8byte.c: Likewise. - * testsuite/libffi.call/cls_9byte1.c: Likewise. - * testsuite/libffi.call/cls_9byte2.c: Likewise. - * testsuite/libffi.call/cls_align_double.c: Likewise. - * testsuite/libffi.call/cls_align_float.c: Likewise. - * testsuite/libffi.call/cls_align_longdouble.c: Likewise. - * testsuite/libffi.call/cls_align_longdouble_split.c: Likewise. - * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise. - * testsuite/libffi.call/cls_align_pointer.c: Likewise. - * testsuite/libffi.call/cls_align_sint16.c: Likewise. - * testsuite/libffi.call/cls_align_sint32.c: Likewise. - * testsuite/libffi.call/cls_align_sint64.c: Likewise. - * testsuite/libffi.call/cls_align_uint16.c: Likewise. - * testsuite/libffi.call/cls_align_uint32.c: Likewise. - * testsuite/libffi.call/cls_align_uint64.c: Likewise. - * testsuite/libffi.call/cls_dbls_struct.c: Likewise. - * testsuite/libffi.call/cls_pointer_stack.c: Likewise. - * testsuite/libffi.call/err_bad_typedef.c: Likewise. - * testsuite/libffi.call/huge_struct.c: Likewise. - * testsuite/libffi.call/nested_struct.c: Likewise. - * testsuite/libffi.call/nested_struct1.c: Likewise. - * testsuite/libffi.call/nested_struct10.c: Likewise. - * testsuite/libffi.call/nested_struct2.c: Likewise. - * testsuite/libffi.call/nested_struct3.c: Likewise. - * testsuite/libffi.call/nested_struct4.c: Likewise. - * testsuite/libffi.call/nested_struct5.c: Likewise. - * testsuite/libffi.call/nested_struct6.c: Likewise. - * testsuite/libffi.call/nested_struct7.c: Likewise. - * testsuite/libffi.call/nested_struct8.c: Likewise. - * testsuite/libffi.call/nested_struct9.c: Likewise. - * testsuite/libffi.call/stret_large.c: Likewise. - * testsuite/libffi.call/stret_large2.c: Likewise. - * testsuite/libffi.call/stret_medium.c: Likewise. - * testsuite/libffi.call/stret_medium2.c: Likewise. - * testsuite/libffi.call/struct1.c: Likewise. - * testsuite/libffi.call/struct1_win32.c: Likewise. - * testsuite/libffi.call/struct2.c: Likewise. - * testsuite/libffi.call/struct2_win32.c: Likewise. - * testsuite/libffi.call/struct3.c: Likewise. - * testsuite/libffi.call/struct4.c: Likewise. - * testsuite/libffi.call/struct5.c: Likewise. - * testsuite/libffi.call/struct6.c: Likewise. - * testsuite/libffi.call/struct7.c: Likewise. - * testsuite/libffi.call/struct8.c: Likewise. - * testsuite/libffi.call/struct9.c: Likewise. - * testsuite/libffi.call/testclosure.c: Likewise. - -2012-03-21 Peter Rosin - - * testsuite/libffi.call/float_va.c (float_va_fn): Use %f when - printing doubles (%lf is for long doubles). - (main): Likewise. - -2012-03-21 Peter Rosin - - * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*] - (set_ld_library_path_env_vars): Add the library search dir to PATH - (and save PATH for later). - (restore_ld_library_path_env_vars): Restore PATH. - -2012-03-21 Peter Rosin - - * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*] - (set_ld_library_path_env_vars): Add the library search dir to PATH - (and save PATH for later). - (restore_ld_library_path_env_vars): Restore PATH. - -2012-03-20 Peter Rosin - - * testsuite/libffi.call/strlen2_win32.c (main): Remove bug. - * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label - visible outside the PROC, so that ffi_closure_THISCALL can see it. - -2012-03-20 Peter Rosin - - * testsuite/libffi.call/strlen2_win32.c (main): Remove bug. - * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label - visible outside the PROC, so that ffi_closure_THISCALL can see it. - -2012-03-19 Alan Hourihane - - * src/m68k/ffi.c: Add MINT support. - * src/m68k/sysv.S: Ditto. - -2012-03-06 Chung-Lin Tang - - * src/arm/ffi.c (ffi_call): Add __ARM_EABI__ guard around call to - ffi_call_VFP(). - (ffi_prep_closure_loc): Add __ARM_EABI__ guard around use of - ffi_closure_VFP. - * src/arm/sysv.S: Add __ARM_EABI__ guard around VFP code. - -2012-03-19 chennam - - * src/powerpc/ffi_darwin.c (ffi_prep_closure_loc): Fix AIX closure - support. - -2012-03-13 Kaz Kojima - - * src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, - just return FFI_BAD_ABI when things are wrong. - * src/sh64/ffi.c (ffi_prep_closure_loc): Ditto. - -2012-03-09 David Edelsohn - - * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64 - change to return value of ffi_closure_helper_DARWIN and load type - from return type. - -2012-03-03 H.J. Lu - - * src/x86/ffi64.c (ffi_call): Cast the return value to unsigned - long. - (ffi_prep_closure_loc): Cast to 64bit address in trampoline. - (ffi_closure_unix64_inner): Cast return pointer to unsigned long - first. - - * src/x86/ffitarget.h (FFI_SIZEOF_ARG): Defined to 8 for x32. - (ffi_arg): Set to unsigned long long for x32. - (ffi_sarg): Set to long long for x32. - -2012-03-03 H.J. Lu - - * src/prep_cif.c (ffi_prep_cif_core): Properly check bad ABI. - -2012-03-03 Andoni Morales Alastruey - - * configure.ac: Add -no-undefined for both 32- and 64-bit x86 - windows-like hosts. - * configure: Rebuilt. - -2012-02-27 Mikael Pettersson - - PR libffi/52223 - * Makefile.am (FLAGS_TO_PASS): Define. - * Makefile.in: Regenerate. - -2012-02-23 Anthony Green - - * src/*/ffitarget.h: Ensure that users never include ffitarget.h - directly. - -2012-02-23 Kai Tietz - - PR libffi/52221 - * src/x86/ffi.c (ffi_closure_raw_THISCALL): New - prototype. - (ffi_prep_raw_closure_loc): Use ffi_closure_raw_THISCALL for - thiscall-convention. - (ffi_raw_call): Use ffi_prep_args_raw. - * src/x86/win32.S (ffi_closure_raw_THISCALL): Add - implementation for stub. - -2012-02-10 Kai Tietz - - * configure.ac (AM_LTLDFLAGS): Add -no-undefine for x64 - windows target. - * configure: Regenerated. - -2012-02-08 Kai Tietz - - * src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32 - also FFI_THISCALL. - * src/x86/ffi.c (ffi_closure_THISCALL): Add prototype. - (FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code. - (ffi_prep_closure_loc): Add FFI_THISCALL support. - * src/x86/ffitarget.h (FFI_TRAMPOLINE_SIZE): Adjust size. - * src/x86/win32.S (ffi_closure_THISCALL): New closure code - for thiscall-calling convention. - * testsuite/libffi.call/closure_thiscall.c: New test. - -2012-01-28 Kai Tietz - - * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new - argument to prototype for specify calling-convention. - (ffi_call): Add support for stdcall/thiscall convention. - (ffi_prep_args): Likewise. - (ffi_raw_call): Likewise. - * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and - FFI_FASTCALL. - * src/x86/win32.S (_ffi_call_win32): Add support for - fastcall/thiscall calling-convention calls. - * testsuite/libffi.call/fastthis1_win32.c: New test. - * testsuite/libffi.call/fastthis2_win32.c: New test. - * testsuite/libffi.call/fastthis3_win32.c: New test. - * testsuite/libffi.call/strlen2_win32.c: New test. - * testsuite/libffi.call/many2_win32.c: New test. - * testsuite/libffi.call/struct1_win32.c: New test. - * testsuite/libffi.call/struct2_win32.c: New test. - -2012-01-23 Uros Bizjak - - * src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI. - -2012-01-23 Anthony Green - Chris Young - - * configure.ac: Add Amiga support. - * configure: Rebuilt. - -2012-01-23 Dmitry Nadezhin - - * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions. - -2012-01-23 Andreas Schwab - - * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain - mc68000. Test for __HAVE_68881__ in addition to __MC68881__. - -2012-01-19 Jakub Jelinek - - PR rtl-optimization/48496 - * src/ia64/ffi.c (ffi_call): Fix up aliasing violations. - -2012-01-09 Rainer Orth - - * configure.ac (i?86-*-*): Set TARGET to X86_64. - * configure: Regenerate. - -2011-12-07 Andrew Pinski - - PR libffi/50051 - * src/mips/n32.S: Add ".set mips4". - -2011-11-21 Andreas Tobler - - * configure: Regenerate. - -2011-11-12 David Gilbert - - * doc/libffi.texi, include/ffi.h.in, include/ffi_common.h, - man/Makefile.am, man/ffi.3, man/ffi_prep_cif.3, - man/ffi_prep_cif_var.3, src/arm/ffi.c, src/arm/ffitarget.h, - src/cris/ffi.c, src/prep_cif.c, - testsuite/libffi.call/cls_double_va.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/float_va.c: Many changes to support variadic - function calls. - -2011-11-12 Kyle Moffett - - * src/powerpc/ffi.c, src/powerpc/ffitarget.h, - src/powerpc/ppc_closure.S, src/powerpc/sysv.S: Many changes for - softfloat powerpc variants. - -2011-11-12 Petr Salinger - - * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Fix kfreebsd support. - * configure: Rebuilt. - -2011-11-12 Timothy Wall - - * src/arm/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): Max - alignment of 4 for wince on ARM. - -2011-11-12 Kyle Moffett - Anthony Green - - * src/ppc/sysv.S, src/ppc/ffi.c: Remove use of ppc string - instructions (not available on some cores, like the PPC440). - -2011-11-12 Kimura Wataru - - * m4/ax_enable_builddir: Change from string comparison to numeric - comparison for wc output. - * configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS - X 10.7. - * configure: Rebuilt. - -2011-11-12 Anthony Green - - * Makefile.am (AM_CCASFLAGS): Add -g option to build assembly - files with debug info. - * Makefile.in: Rebuilt. - -2011-11-12 Jasper Lievisse Adriaanse - - * README: Update list of supported OpenBSD systems. - -2011-11-12 Anthony Green - - * libtool-version: Update. - * Makefile.am (nodist_libffi_la_SOURCES): Add src/debug.c if - FFI_DEBUG. - (libffi_la_SOURCES): Remove src/debug.c - (EXTRA_DIST): Add src/debug.c - * Makefile.in: Rebuilt. - * README: Update for 3.0.11. - -2011-11-10 Richard Henderson - - * configure.ac (GCC_AS_CFI_PSEUDO_OP): Use it instead of inline check. - * configure, aclocal.m4: Rebuild. - -2011-09-04 Iain Sandoe - - PR libffi/49594 - * src/powerpc/darwin_closure.S (stubs): Make the stub binding - helper reference track the architecture pointer size. - -2011-08-25 Andrew Haley - - * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly - instructions. - * src/arm/sysv.S (ffi_arm_trampoline): Put them here instead. - -2011-07-11 Andrew Haley - - * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache. - -2011-06-29 Rainer Orth - - * testsuite/libffi.call/cls_double_va.c: Move PR number to comment. - * testsuite/libffi.call/cls_longdouble_va.c: Likewise. - -2011-06-29 Rainer Orth - - PR libffi/46660 - * testsuite/libffi.call/cls_double_va.c: xfail dg-output on - mips-sgi-irix6*. - * testsuite/libffi.call/cls_longdouble_va.c: Likewise. - -2011-06-14 Rainer Orth - - * testsuite/libffi.call/huge_struct.c (test_large_fn): Use PRIu8, - PRId8 instead of %hhu, %hhd. - * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRId8, - PRIu8): Define. - [__sgi__] (PRId8, PRIu8): Define. - -2011-04-29 Rainer Orth - - * src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE): - Define. - Use them to handle ELF vs. ECOFF differences. - [__osf__] (_GLOBAL__F_ffi_call_osf): Define. - -2011-03-30 Timothy Wall - - * src/powerpc/darwin.S: Fix unknown FDE encoding. - * src/powerpc/darwin_closure.S: ditto. - -2011-02-25 Anthony Green - - * src/powerpc/ffi.c (ffi_prep_closure_loc): Allow for more - 32-bit ABIs. - -2011-02-15 Anthony Green - - * m4/ax_cc_maxopt.m4: Don't -malign-double or use -ffast-math. - * configure: Rebuilt. - -2011-02-13 Ralf Wildenhues - - * configure: Regenerate. - -2011-02-13 Anthony Green - - * include/ffi_common.h (UNLIKELY, LIKELY): Define. - * src/x86/ffi64.c (UNLIKELY, LIKELY): Remove definition. - * src/prep_cif.c (UNLIKELY, LIKELY): Remove definition. - - * src/prep_cif.c (initialize_aggregate): Convert assertion into - FFI_BAD_TYPEDEF return. Initialize arg size and alignment to 0. - - * src/pa/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, - just return FFI_BAD_ABI when things are wrong. - * src/arm/ffi.c (ffi_prep_closure_loc): Ditto. - * src/powerpc/ffi.c (ffi_prep_closure_loc): Ditto. - * src/mips/ffi.c (ffi_prep_closure_loc): Ditto. - * src/ia64/ffi.c (ffi_prep_closure_loc): Ditto. - * src/avr32/ffi.c (ffi_prep_closure_loc): Ditto. - -2011-02-11 Anthony Green - - * src/sparc/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, - just return FFI_BAD_ABI when things are wrong. - -2012-02-11 Eric Botcazou - - * src/sparc/v9.S (STACKFRAME): Bump to 176. - -2011-02-09 Stuart Shelton - - http://bugs.gentoo.org/show_bug.cgi?id=286911 - * src/mips/ffitarget.h: Clean up error messages. - * src/java_raw_api.c (ffi_java_translate_args): Cast raw arg to - ffi_raw*. - * include/ffi.h.in: Add pragma for SGI compiler. - -2011-02-09 Anthony Green - - * configure.ac: Add powerpc64-*-darwin* support. - -2011-02-09 Anthony Green - - * README: Mention Interix. - -2011-02-09 Jonathan Callen - - * configure.ac: Add Interix to win32/cygwin/mingw case. - * configure: Ditto. - * src/closures.c: Treat Interix like Cygwin, instead of as a - generic win32. - -2011-02-09 Anthony Green - - * testsuite/libffi.call/err_bad_typedef.c: Remove xfail. - * testsuite/libffi.call/err_bad_abi.c: Remove xfail. - * src/x86/ffi64.c (UNLIKELY, LIKELY): Define. - (ffi_prep_closure_loc): Check for bad ABI. - * src/prep_cif.c (UNLIKELY, LIKELY): Define. - (initialize_aggregate): Check for bad types. - -2011-02-09 Landon Fuller - - * Makefile.am (EXTRA_DIST): Add build-ios.sh, src/arm/gentramp.sh, - src/arm/trampoline.S. - (nodist_libffi_la_SOURCES): Add src/arc/trampoline.S. - * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Define. - * src/arm/ffi.c (ffi_trampoline_table) - (ffi_closure_trampoline_table_page, ffi_trampoline_table_entry) - (FFI_TRAMPOLINE_CODELOC_CONFIG, FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET) - (FFI_TRAMPOLINE_COUNT, ffi_trampoline_lock, ffi_trampoline_tables) - (ffi_trampoline_table_alloc, ffi_closure_alloc, ffi_closure_free): - Define for FFI_EXEC_TRAMPOLINE_TABLE case (iOS). - (ffi_prep_closure_loc): Handl FFI_EXEC_TRAMPOLINE_TABLE case - separately. - * src/arm/sysv.S: Handle Apple iOS host. - * src/closures.c: Handle FFI_EXEC_TRAMPOLINE_TABLE case. - * build-ios.sh: New file. - * fficonfig.h.in, configure, Makefile.in: Rebuilt. - * README: Mention ARM iOS. - -2011-02-08 Oren Held - - * src/dlmalloc.c (_STRUCT_MALLINFO): Define in order to avoid - redefinition of mallinfo on HP-UX. - -2011-02-08 Ginn Chen - - * src/sparc/ffi.c (ffi_call): Make compatible with Solaris Studio - aggregate return ABI. Flush cache. - (ffi_prep_closure_loc): Flush cache. - -2011-02-11 Anthony Green - - From Tom Honermann : - * src/powerpc/aix.S (ffi_call_AIX): Support for xlc toolchain on - AIX. Declare .ffi_prep_args. Insert nops after branch - instructions so that the AIX linker can insert TOC reload - instructions. - * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN. - -2011-02-08 Ed - - * src/powerpc/asm.h: Fix grammar nit in comment. - -2011-02-08 Uli Link - - * include/ffi.h.in (FFI_64_BIT_MAX): Define and use. - -2011-02-09 Rainer Orth - - PR libffi/46661 - * testsuite/libffi.call/cls_pointer.c (main): Cast void * to - uintptr_t first. - * testsuite/libffi.call/cls_pointer_stack.c (main): Likewise. - -2011-02-08 Rafael Avila de Espindola - - * configure.ac: Fix x86 test for pc related relocs. - * configure: Rebuilt. - -2011-02-07 Joel Sherrill - - * libffi/src/m68k/ffi.c: Add RTEMS support for cache flushing. - Handle case when CPU variant does not have long double support. - * libffi/src/m68k/sysv.S: Add support for mc68000, Coldfire, - and cores with soft floating point. - -2011-02-07 Joel Sherrill - - * configure.ac: Add mips*-*-rtems* support. - * configure: Regenerate. - * src/mips/ffitarget.h: Ensure needed constants are available - for targets which do not have sgidefs.h. - -2011-01-26 Dave Korn - - PR target/40125 - * configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs. - * configure: Regenerate. - -2010-12-18 Iain Sandoe - - PR libffi/29152 - PR libffi/42378 - * src/powerpc/darwin_closure.S: Provide Darwin64 implementation, - update comments. - * src/powerpc/ffitarget.h (POWERPC_DARWIN64): New, - (FFI_TRAMPOLINE_SIZE): Update for Darwin64. - * src/powerpc/darwin.S: Provide Darwin64 implementation, - update comments. - * src/powerpc/ffi_darwin.c: Likewise. - -2010-12-06 Rainer Orth - - * configure.ac (libffi_cv_as_ascii_pseudo_op): Use double - backslashes. - (libffi_cv_as_string_pseudo_op): Likewise. - * configure: Regenerate. - -2010-12-03 Chung-Lin Tang - - * src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive. - (ffi_closure_VFP): Same. - (ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp' - directive. - -2010-12-01 Rainer Orth - - * testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define. - (PRIuPTR): Define. - -2010-11-29 Richard Henderson - Rainer Orth - - * src/x86/sysv.S (FDE_ENCODING, FDE_ENCODE): Define. - (.eh_frame): Use FDE_ENCODING. - (.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE. - -2010-11-22 Jacek Caban - - * configure.ac: Check for symbol underscores on mingw-w64. - * configure: Rebuilt. - * src/x86/win64.S: Correctly access extern symbols in respect to - underscores. - -2010-11-15 Rainer Orth - - * testsuite/lib/libffi-dg.exp: Rename ... - * testsuite/lib/libffi.exp: ... to this. - * libffi/testsuite/libffi.call/call.exp: Don't load libffi-dg.exp. - * libffi/testsuite/libffi.special/special.exp: Likewise. - -2010-10-28 Chung-Lin Tang - - * src/arm/ffi.c (ffi_prep_args): Add VFP register argument handling - code, new parameter, and return value. Update comments. - (ffi_prep_cif_machdep): Add case for VFP struct return values. Add - call to layout_vfp_args(). - (ffi_call_SYSV): Update declaration. - (ffi_call_VFP): New declaration. - (ffi_call): Add VFP struct return conditions. Call ffi_call_VFP() - when ABI is FFI_VFP. - (ffi_closure_VFP): New declaration. - (ffi_closure_SYSV_inner): Add new vfp_args parameter, update call to - ffi_prep_incoming_args_SYSV(). - (ffi_prep_incoming_args_SYSV): Update parameters. Add VFP argument - case handling. - (ffi_prep_closure_loc): Pass ffi_closure_VFP to trampoline - construction under VFP hard-float. - (rec_vfp_type_p): New function. - (vfp_type_p): Same. - (place_vfp_arg): Same. - (layout_vfp_args): Same. - * src/arm/ffitarget.h (ffi_abi): Add FFI_VFP. Define FFI_DEFAULT_ABI - based on __ARM_PCS_VFP. - (FFI_EXTRA_CIF_FIELDS): Define for adding VFP hard-float specific - fields. - (FFI_TYPE_STRUCT_VFP_FLOAT): Define internally used type code. - (FFI_TYPE_STRUCT_VFP_DOUBLE): Same. - * src/arm/sysv.S (ffi_call_SYSV): Change call of ffi_prep_args() to - direct call. Move function pointer load upwards. - (ffi_call_VFP): New function. - (ffi_closure_VFP): Same. - - * testsuite/lib/libffi-dg.exp (check-flags): New function. - (dg-skip-if): New function. - * testsuite/libffi.call/cls_double_va.c: Skip if target is arm*-*-* - and compiler options include -mfloat-abi=hard. - * testsuite/libffi.call/cls_longdouble_va.c: Same. - -2010-10-01 Jakub Jelinek - - PR libffi/45677 - * src/x86/ffi64.c (ffi_prep_cif_machdep): Ensure cif->bytes is - a multiple of 8. - * testsuite/libffi.call/many2.c: New test. - -2010-08-20 Mark Wielaard - - * src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r - returns NULL. - -2010-08-09 Andreas Tobler - - * configure.ac: Add target powerpc64-*-freebsd*. - * configure: Regenerate. - * testsuite/libffi.call/cls_align_longdouble_split.c: Pass - -mlong-double-128 only to linux targets. - * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise. - * testsuite/libffi.call/cls_longdouble.c: Likewise. - * testsuite/libffi.call/huge_struct.c: Likewise. - -2010-08-05 Dan Witte - - * Makefile.am: Pass FFI_DEBUG define to msvcc.sh for linking to the - debug CRT when --enable-debug is given. - * configure.ac: Define it. - * msvcc.sh: Translate -g and -DFFI_DEBUG appropriately. - -2010-08-04 Dan Witte - - * src/x86/ffitarget.h: Add X86_ANY define for all x86/x86_64 - platforms. - * src/x86/ffi.c: Remove redundant ifdef checks. - * src/prep_cif.c: Push stack space computation into src/x86/ffi.c - for X86_ANY so return value space doesn't get added twice. - -2010-08-03 Neil Rashbrooke - - * msvcc.sh: Don't pass -safeseh to ml64 because behavior is buggy. - -2010-07-22 Dan Witte - - * src/*/ffitarget.h: Make FFI_LAST_ABI one past the last valid ABI. - * src/prep_cif.c: Fix ABI assertion. - * src/cris/ffi.c: Ditto. - -2010-07-10 Evan Phoenix - - * src/closures.c (selinux_enabled_check): Fix strncmp usage bug. - -2010-07-07 Dan Horák - - * include/ffi.h.in: Protect #define with #ifndef. - * src/powerpc/ffitarget.h: Ditto. - * src/s390/ffitarget.h: Ditto. - * src/sparc/ffitarget.h: Ditto. - -2010-07-07 Neil Roberts - - * src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to - 16-bytes. - -2010-07-02 Jakub Jelinek - - * Makefile.am (AM_MAKEFLAGS): Pass also mandir to submakes. - * Makefile.in: Regenerated. - -2010-05-19 Rainer Orth - - * configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as - output, too. - (libffi_cv_as_ascii_pseudo_op): Check for .ascii. - (libffi_cv_as_string_pseudo_op): Check for .string. - * configure: Regenerate. - * fficonfig.h.in: Regenerate. - * src/x86/sysv.S (.eh_frame): Use .ascii, .string or error. - -2010-05-11 Dan Witte - - * doc/libffi.tex: Document previous change. - -2010-05-11 Makoto Kato - - * src/x86/ffi.c (ffi_call): Don't copy structs passed by value. - -2010-05-05 Michael Kohler - - * src/dlmalloc.c (dlfree): Fix spelling. - * src/ia64/ffi.c (ffi_prep_cif_machdep): Ditto. - * configure.ac: Ditto. - * configure: Rebuilt. - -2010-04-13 Dan Witte - - * msvcc.sh: Build with -W3 instead of -Wall. - * src/powerpc/ffi_darwin.c: Remove build warnings. - * src/x86/ffi.c: Ditto. - * src/x86/ffitarget.h: Ditto. - -2010-04-12 Dan Witte - Walter Meinl - - * configure.ac: Add OS/2 support. - * configure: Rebuilt. - * src/closures.c: Ditto. - * src/dlmalloc.c: Ditto. - * src/x86/win32.S: Ditto. - -2010-04-07 Jakub Jelinek - - * testsuite/libffi.call/err_bad_abi.c: Remove unused args variable. - -2010-04-02 Ralf Wildenhues - - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate. - * include/Makefile.in: Regenerate. - * man/Makefile.in: Regenerate. - * testsuite/Makefile.in: Regenerate. - -2010-03-30 Dan Witte - - * msvcc.sh: Disable build warnings. - * README (tested): Clarify windows build procedure. - -2010-03-15 Rainer Orth - - * configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test. - * configure: Regenerate. - * fficonfig.h.in: Regenerate. - * libffi/src/x86/unix64.S (.eh_frame) - [HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type. - -2010-03-14 Matthias Klose - - * src/x86/ffi64.c: Fix typo in comment. - * src/x86/ffi.c: Use /* ... */ comment style. - -2010-02-24 Rainer Orth - - * doc/libffi.texi (The Closure API): Fix typo. - * doc/libffi.info: Remove. - -2010-02-15 Matthias Klose - - * src/arm/sysv.S (__ARM_ARCH__): Define for processor - __ARM_ARCH_7EM__. - -2010-01-15 Anthony Green - - * README: Add notes on building with Microsoft Visual C++. - -2010-01-15 Daniel Witte - - * msvcc.sh: New file. - - * src/x86/win32.S: Port assembly routines to MSVC and #ifdef. - * src/x86/ffi.c: Tweak function declaration and remove excess - parens. - * include/ffi.h.in: Add __declspec(align(8)) to typedef struct - ffi_closure. - - * src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new - function ffi_call_win32 on X86_WIN32. - * src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32. - (ffi_call_STDCALL): Remove. - - * src/prep_cif.c (ffi_prep_cif): Move stack space allocation code - to ffi_prep_cif_machdep for x86. - * src/x86/ffi.c (ffi_prep_cif_machdep): To here. - -2010-01-15 Oliver Kiddle - - * src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for - Sun Studio compiler compatibility. - -2010-01-12 Conrad Irwin - - * doc/libffi.texi: Add closure example. - -2010-01-07 Rainer Orth - - PR libffi/40701 - * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRIdLL, - PRIuLL, PRId64, PRIu64, PRIuPTR): Define. - * testsuite/libffi.call/cls_align_sint64.c: Add -Wno-format on - alpha*-dec-osf*. - * testsuite/libffi.call/cls_align_uint64.c: Likewise. - * testsuite/libffi.call/cls_ulonglong.c: Likewise. - * testsuite/libffi.call/return_ll1.c: Likewise. - * testsuite/libffi.call/stret_medium2.c: Likewise. - * testsuite/libffi.special/ffitestcxx.h (allocate_mmap): Cast - MAP_FAILED to char *. - -2010-01-06 Rainer Orth - - * src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__. - -2009-12-31 Anthony Green - - * README: Update for libffi 3.0.9. - -2009-12-27 Matthias Klose - - * configure.ac (HAVE_LONG_DOUBLE): Define for mips when - appropriate. - * configure: Rebuilt. - -2009-12-26 Anthony Green - - * testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for - avr32*-*-*. - * testsuite/libffi.call/cls_double_va.c: Ditto. - -2009-12-26 Andreas Tobler - - * testsuite/libffi.call/ffitest.h: Conditionally include stdint.h - and inttypes.h. - * testsuite/libffi.special/unwindtest.cc: Ditto. - -2009-12-26 Andreas Tobler - - * configure.ac: Add amd64-*-openbsd*. - * configure: Rebuilt. - * testsuite/lib/libffi-dg.exp (libffi_target_compile): Link - openbsd programs with -lpthread. - -2009-12-26 Anthony Green - - * testsuite/libffi.call/cls_double_va.c, - testsuite/libffi.call/cls_longdouble.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/cls_pointer.c, - testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for - mips*-*-* and arm*-*-*. - * testsuite/libffi.call/cls_align_longdouble_split.c, - testsuite/libffi.call/cls_align_longdouble_split2.c, - testsuite/libffi.call/stret_medium2.c, - testsuite/libffi.call/stret_medium.c, - testsuite/libffi.call/stret_large.c, - testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*. - -2009-12-31 Kay Tietz - - * testsuite/libffi.call/ffitest.h, - testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix - definitions. - -2009-12-31 Carlo Bramini - - * configure.ac (AM_LTLDFLAGS): Define for windows hosts. - * Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS. - * configure: Rebuilt. - * Makefile.in: Rebuilt. - -2009-12-31 Anthony Green - Blake Chaffin. - - * testsuite/libffi.call/huge_struct.c: New test case from Blake - Chaffin @ Apple. - -2009-12-28 David Edelsohn - - * src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to - local variables. - (aix_adjust_aggregate_sizes): New function. - (ffi_prep_cif_machdep): Call it. - -2009-12-26 Andreas Tobler - - * configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets. - * configure: Regenerate. - * fficonfig.h.in: Likewise. - * src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for - Solaris/x86. - -2009-12-26 Andreas Schwab - - * src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count - when a float arguments is passed in memory. - (ffi_closure_helper_SYSV): Mark general registers as used up when - a 64bit or soft-float long double argument is passed in memory. - -2009-12-25 Matthias Klose - - * man/ffi_call.3: Fix #include in examples. - * doc/libffi.texi: Add dircategory. - -2009-12-25 Frank Everdij - - * include/ffi.h.in: Placed '__GNUC__' ifdef around - '__attribute__((aligned(8)))' in ffi_closure, fixes compile for - IRIX MIPSPro c99. - * include/ffi_common.h: Added '__sgi' define to non - '__attribute__((__mode__()))' integer typedefs. - * src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32, - ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check. - (ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added - FFI_LONGDOUBLE support and alignment(N32 only). - * src/mips/ffitarget.h: Corrected '#include ' for IRIX and - fixed non '__attribute__((__mode__()))' integer typedefs. - * src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame' - since they are Linux/GNU Assembler specific. - -2009-12-25 Bradley Smith - - * configure.ac, Makefile.am, src/avr32/ffi.c, - src/avr32/ffitarget.h, - src/avr32/sysv.S: Add AVR32 port. - * configure, Makefile.in: Rebuilt. - -2009-12-21 Andreas Tobler - - * configure.ac: Make i?86 build on FreeBSD and OpenBSD. - * configure: Regenerate. - -2009-12-15 John David Anglin - - * testsuite/libffi.call/ffitest.h: Define PRIuPTR on PA HP-UX. - -2009-12-13 John David Anglin - - * src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE - type on HP-UX. - -2012-02-13 Kai Tietz - - PR libffi/52221 - * src/x86/ffi.c (ffi_prep_raw_closure_loc): Add thiscall - support for X86_WIN32. - (FFI_INIT_TRAMPOLINE_THISCALL): Fix displacement. - -2009-12-11 Eric Botcazou - - * src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long - double' arguments. - -2009-12-11 Eric Botcazou - - * testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10. - -2009-12-10 Rainer Orth - - PR libffi/40700 - * src/closures.c [X86_64 && __sun__ && __svr4__] - (FFI_MMAP_EXEC_WRIT): Define. - -2009-12-08 David Daney - - * testsuite/libffi.call/stret_medium.c: Remove xfail for mips*-*-* - * testsuite/libffi.call/cls_align_longdouble_split2.c: Same. - * testsuite/libffi.call/stret_large.c: Same. - * testsuite/libffi.call/cls_align_longdouble_split.c: Same. - * testsuite/libffi.call/stret_large2.c: Same. - * testsuite/libffi.call/stret_medium2.c: Same. - -2009-12-07 David Edelsohn - - * src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump - typo. - -2009-12-05 David Edelsohn - - * src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64 - code. - * src/powerpc/aix_closure.S: Same. - -2009-12-05 Ralf Wildenhues - - * Makefile.in: Regenerate. - * configure: Regenerate. - * include/Makefile.in: Regenerate. - * man/Makefile.in: Regenerate. - * testsuite/Makefile.in: Regenerate. - -2009-12-04 David Edelsohn - - * src/powerpc/aix_closure.S: Reorganize 64-bit code to match - linux64_closure.S. - -2009-12-04 Uros Bizjak - - PR libffi/41908 - * src/x86/ffi64.c (classify_argument): Update from - gcc/config/i386/i386.c. - (ffi_closure_unix64_inner): Do not use the address of two consecutive - SSE registers directly. - * testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail - for x86_64 linux targets. - -2009-12-04 David Edelsohn - - * src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment - pfr for long double split between fpr13 and stack. - -2009-12-03 David Edelsohn - - * src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and - fparg_count twice for long double. - -2009-12-03 David Edelsohn - - PR libffi/42243 - * src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses. - -2009-12-03 Uros Bizjak - - * testsuite/libffi.call/cls_longdouble_va.c (main): Fix format string. - Remove xfails for x86 linux targets. - -2009-12-02 David Edelsohn - - * src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64 - case. - -2009-12-01 David Edelsohn - - * src/powerpc/aix.S (ffi_call_AIX): Convert to more standard - register usage. Call ffi_prep_args directly. Add long double - return value support. - * src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment - applies to FFI_TYPE_DOUBLE. Correct fpr_base increment typo. - Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases. - (ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit - mode. - (ffi_closure_helper_DARWIN): Remove nf and ng counters. Move temp - into case. - * src/powerpc/aix_closure.S: Maintain 16 byte stack alignment. - Allocate result area between params and FPRs. - -2009-11-30 David Edelsohn - - PR target/35484 - * src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and - AIX64. - * src/powerpc/aix.S: Implement AIX64 version. - * src/powerpc/aix_closure.S: Implement AIX64 version. - (ffi_closure_ASM): Use extsb, lha and displament addresses. - * src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64 - support. - (ffi_prep_cif_machdep): Same. - (ffi_call): Same. - (ffi_closure_helper_DARWIN): Same. - -2009-11-02 Andreas Tobler - - PR libffi/41908 - * testsuite/libffi.call/testclosure.c: New test. - -2009-09-28 Kai Tietz - - * src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu - assembly version use of ___chkstk. - -2009-09-23 Matthias Klose - - PR libffi/40242, PR libffi/41443 - * src/arm/sysv.S (__ARM_ARCH__): Define for processors - __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__, - __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__. - Change the conditionals to __SOFTFP__ || __ARM_EABI__ - for -mfloat-abi=softfp to work. - -2009-09-17 Loren J. Rittle - - PR testsuite/32843 (strikes again) - * src/x86/ffi.c (ffi_prep_cif_machdep): Add X86_FREEBSD to - enable proper extension on char and short. - -2009-09-15 David Daney - - * src/java_raw_api.c (ffi_java_raw_to_rvalue): Remove special - handling for FFI_TYPE_POINTER. - * src/mips/ffitarget.h (FFI_TYPE_STRUCT_D_SOFT, - FFI_TYPE_STRUCT_F_SOFT, FFI_TYPE_STRUCT_DD_SOFT, - FFI_TYPE_STRUCT_FF_SOFT, FFI_TYPE_STRUCT_FD_SOFT, - FFI_TYPE_STRUCT_DF_SOFT, FFI_TYPE_STRUCT_SOFT): New defines. - (FFI_N32_SOFT_FLOAT, FFI_N64_SOFT_FLOAT): New ffi_abi enumerations. - (enum ffi_abi): Set FFI_DEFAULT_ABI for soft-float. - * src/mips/n32.S (ffi_call_N32): Add handling for soft-float - structure and pointer returns. - (ffi_closure_N32): Add handling for pointer returns. - * src/mips/ffi.c (ffi_prep_args, calc_n32_struct_flags, - calc_n32_return_struct_flags): Handle soft-float. - (ffi_prep_cif_machdep): Handle soft-float, fix pointer handling. - (ffi_call_N32): Declare proper argument types. - (ffi_call, copy_struct_N32, ffi_closure_mips_inner_N32): Handle - soft-float. - -2009-08-24 Ralf Wildenhues - - * configure.ac (AC_PREREQ): Bump to 2.64. - -2009-08-22 Ralf Wildenhues - - * Makefile.am (install-html, install-pdf): Remove. - * Makefile.in: Regenerate. - - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate. - * configure: Regenerate. - * fficonfig.h.in: Regenerate. - * include/Makefile.in: Regenerate. - * man/Makefile.in: Regenerate. - * testsuite/Makefile.in: Regenerate. - -2011-08-22 Jasper Lievisse Adriaanse - - * configure.ac: Add OpenBSD/hppa and OpenBSD/powerpc support. - * configure: Rebuilt. - -2009-07-30 Ralf Wildenhues - - * configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force. - -2009-07-24 Dave Korn - - PR libffi/40807 - * src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending - return types for X86_WIN32. - * src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types. - (_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV, - _ffi_closure_STDCALL): Likewise. - - * src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin. - (dlmmap, dlmunmap): Also use these functions on Cygwin. - -2009-07-11 Richard Sandiford - - PR testsuite/40699 - PR testsuite/40707 - PR testsuite/40709 - * testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and - 2009-06-30 commits. - -2009-07-01 Richard Sandiford - - * testsuite/lib/libffi-dg.exp (libffi-init): Set ld_library_path - to "" before adding paths. (This reinstates an assignment that - was removed by my 2009-06-30 commit, but changes the initial - value from "." to "".) - -2009-07-01 H.J. Lu - - PR testsuite/40601 - * testsuite/lib/libffi-dg.exp (libffi-init): Properly set - gccdir. Adjust ld_library_path for gcc only if gccdir isn't - empty. - -2009-06-30 Richard Sandiford - - * testsuite/lib/libffi-dg.exp (libffi-init): Don't add "." - to ld_library_path. Use add_path. Add just find_libgcc_s - to ld_library_path, not every libgcc multilib directory. - -2009-06-16 Wim Lewis - - * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are - supposed to be callee-saved. - * src/powerpc/sysv.S (small_struct_return_value): Fix overrun of - return buffer for odd-size structs. - -2009-06-16 Andreas Tobler - - PR libffi/40444 - * testsuite/lib/libffi-dg.exp (libffi_target_compile): Add - allow_stack_execute for Darwin. - -2009-06-16 Andrew Haley - - * configure.ac (TARGETDIR): Add missing blank lines. - * configure: Regenerate. - -2009-06-16 Andrew Haley - - * testsuite/libffi.call/cls_align_sint64.c, - testsuite/libffi.call/cls_align_uint64.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/cls_ulonglong.c, - testsuite/libffi.call/return_ll1.c, - testsuite/libffi.call/stret_medium2.c: Fix printf format - specifiers. - * testsuite/libffi.call/ffitest.h, - testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define. - -2009-06-15 Andrew Haley - - * testsuite/libffi.call/err_bad_typedef.c: xfail everywhere. - * testsuite/libffi.call/err_bad_abi.c: Likewise. - -2009-06-12 Andrew Haley - - * Makefile.am: Remove info_TEXINFOS. - -2009-06-12 Andrew Haley - - * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c, - testsuite/libffi.call/cls_align_uint64.c, - testsuite/libffi.call/cls_ulonglong.c, - testsuite/libffi.call/return_ll1.c, - testsuite/libffi.call/stret_medium2.c: Fix printf format - specifiers. - testsuite/libffi.special/unwindtest.cc: include stdint.h. - -2009-06-11 Timothy Wall - - * Makefile.am, - configure.ac, - include/ffi.h.in, - include/ffi_common.h, - src/closures.c, - src/dlmalloc.c, - src/x86/ffi.c, - src/x86/ffitarget.h, - src/x86/win64.S (new), - README: Added win64 support (mingw or MSVC) - * Makefile.in, - include/Makefile.in, - man/Makefile.in, - testsuite/Makefile.in, - configure, - aclocal.m4: Regenerated - * ltcf-c.sh: properly escape cygwin/w32 path - * man/ffi_call.3: Clarify size requirements for return value. - * src/x86/ffi64.c: Fix filename in comment. - * src/x86/win32.S: Remove unused extern. - - * testsuite/libffi.call/closure_fn0.c, - testsuite/libffi.call/closure_fn1.c, - testsuite/libffi.call/closure_fn2.c, - testsuite/libffi.call/closure_fn3.c, - testsuite/libffi.call/closure_fn4.c, - testsuite/libffi.call/closure_fn5.c, - testsuite/libffi.call/closure_fn6.c, - testsuite/libffi.call/closure_stdcall.c, - testsuite/libffi.call/cls_12byte.c, - testsuite/libffi.call/cls_16byte.c, - testsuite/libffi.call/cls_18byte.c, - testsuite/libffi.call/cls_19byte.c, - testsuite/libffi.call/cls_1_1byte.c, - testsuite/libffi.call/cls_20byte.c, - testsuite/libffi.call/cls_20byte1.c, - testsuite/libffi.call/cls_24byte.c, - testsuite/libffi.call/cls_2byte.c, - testsuite/libffi.call/cls_3_1byte.c, - testsuite/libffi.call/cls_3byte1.c, - testsuite/libffi.call/cls_3byte2.c, - testsuite/libffi.call/cls_4_1byte.c, - testsuite/libffi.call/cls_4byte.c, - testsuite/libffi.call/cls_5_1_byte.c, - testsuite/libffi.call/cls_5byte.c, - testsuite/libffi.call/cls_64byte.c, - testsuite/libffi.call/cls_6_1_byte.c, - testsuite/libffi.call/cls_6byte.c, - testsuite/libffi.call/cls_7_1_byte.c, - testsuite/libffi.call/cls_7byte.c, - testsuite/libffi.call/cls_8byte.c, - testsuite/libffi.call/cls_9byte1.c, - testsuite/libffi.call/cls_9byte2.c, - testsuite/libffi.call/cls_align_double.c, - testsuite/libffi.call/cls_align_float.c, - testsuite/libffi.call/cls_align_longdouble.c, - testsuite/libffi.call/cls_align_longdouble_split.c, - testsuite/libffi.call/cls_align_longdouble_split2.c, - testsuite/libffi.call/cls_align_pointer.c, - testsuite/libffi.call/cls_align_sint16.c, - testsuite/libffi.call/cls_align_sint32.c, - testsuite/libffi.call/cls_align_sint64.c, - testsuite/libffi.call/cls_align_uint16.c, - testsuite/libffi.call/cls_align_uint32.c, - testsuite/libffi.call/cls_align_uint64.c, - testsuite/libffi.call/cls_dbls_struct.c, - testsuite/libffi.call/cls_double.c, - testsuite/libffi.call/cls_double_va.c, - testsuite/libffi.call/cls_float.c, - testsuite/libffi.call/cls_longdouble.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/cls_multi_schar.c, - testsuite/libffi.call/cls_multi_sshort.c, - testsuite/libffi.call/cls_multi_sshortchar.c, - testsuite/libffi.call/cls_multi_uchar.c, - testsuite/libffi.call/cls_multi_ushort.c, - testsuite/libffi.call/cls_multi_ushortchar.c, - testsuite/libffi.call/cls_pointer.c, - testsuite/libffi.call/cls_pointer_stack.c, - testsuite/libffi.call/cls_schar.c, - testsuite/libffi.call/cls_sint.c, - testsuite/libffi.call/cls_sshort.c, - testsuite/libffi.call/cls_uchar.c, - testsuite/libffi.call/cls_uint.c, - testsuite/libffi.call/cls_ulonglong.c, - testsuite/libffi.call/cls_ushort.c, - testsuite/libffi.call/err_bad_abi.c, - testsuite/libffi.call/err_bad_typedef.c, - testsuite/libffi.call/float2.c, - testsuite/libffi.call/huge_struct.c, - testsuite/libffi.call/nested_struct.c, - testsuite/libffi.call/nested_struct1.c, - testsuite/libffi.call/nested_struct10.c, - testsuite/libffi.call/nested_struct2.c, - testsuite/libffi.call/nested_struct3.c, - testsuite/libffi.call/nested_struct4.c, - testsuite/libffi.call/nested_struct5.c, - testsuite/libffi.call/nested_struct6.c, - testsuite/libffi.call/nested_struct7.c, - testsuite/libffi.call/nested_struct8.c, - testsuite/libffi.call/nested_struct9.c, - testsuite/libffi.call/problem1.c, - testsuite/libffi.call/return_ldl.c, - testsuite/libffi.call/return_ll1.c, - testsuite/libffi.call/stret_large.c, - testsuite/libffi.call/stret_large2.c, - testsuite/libffi.call/stret_medium.c, - testsuite/libffi.call/stret_medium2.c, - testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead - of checking for MMAP. Use intptr_t instead of long casts. - -2009-06-11 Kaz Kojima - - * testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*. - * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*. - * testsuite/libffi.call/err_bad_typedef.c: Likewise. - -2009-06-09 Andrew Haley - - * src/x86/freebsd.S: Add missing file. - -2009-06-08 Andrew Haley - - Import from libffi 3.0.8: - - * doc/libffi.texi: New file. - * doc/libffi.info: Likewise. - * doc/stamp-vti: Likewise. - * man/Makefile.am: New file. - * man/ffi_call.3: New file. - - * Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S, - src/dlmalloc.c. - (nodist_libffi_la_SOURCES): Add X86_FREEBSD. - - * configure.ac: Bump version to 3.0.8. - parisc*-*-linux*: Add. - i386-*-freebsd* | i386-*-openbsd*: Add. - powerpc-*-beos*: Add. - AM_CONDITIONAL X86_FREEBSD: Add. - AC_CONFIG_FILES: Add man/Makefile. - - * include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void). - -2009-06-08 Andrew Haley - - * README: Import from libffi 3.0.8. - -2009-06-08 Andrew Haley - - * testsuite/libffi.call/err_bad_abi.c: Add xfails. - * testsuite/libffi.call/cls_longdouble_va.c: Add xfails. - * testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*. - * testsuite/libffi.call/err_bad_typedef.c: Add xfails. - - * testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args. - * testsuite/libffi.call/stret_medium.c: Likewise. - * testsuite/libffi.call/stret_large2.c: Likewise. - * testsuite/libffi.call/stret_large.c: Likewise. - -2008-12-26 Timothy Wall - - * testsuite/libffi.call/cls_longdouble.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/cls_align_longdouble.c, - testsuite/libffi.call/cls_align_longdouble_split.c, - testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected - failures on x86_64 cygwin/mingw. - -2008-12-22 Timothy Wall - - * testsuite/libffi.call/closure_fn0.c, - testsuite/libffi.call/closure_fn1.c, - testsuite/libffi.call/closure_fn2.c, - testsuite/libffi.call/closure_fn3.c, - testsuite/libffi.call/closure_fn4.c, - testsuite/libffi.call/closure_fn5.c, - testsuite/libffi.call/closure_fn6.c, - testsuite/libffi.call/closure_loc_fn0.c, - testsuite/libffi.call/closure_stdcall.c, - testsuite/libffi.call/cls_align_pointer.c, - testsuite/libffi.call/cls_pointer.c, - testsuite/libffi.call/cls_pointer_stack.c: use portable cast from - pointer to integer (intptr_t). - * testsuite/libffi.call/cls_longdouble.c: disable for win64. - -2008-07-24 Anthony Green - - * testsuite/libffi.call/cls_dbls_struct.c, - testsuite/libffi.call/cls_double_va.c, - testsuite/libffi.call/cls_longdouble.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/cls_pointer.c, - testsuite/libffi.call/cls_pointer_stack.c, - testsuite/libffi.call/err_bad_abi.c: Clean up failures from - compiler warnings. - -2008-03-04 Anthony Green - Blake Chaffin - hos@tamanegi.org - - * testsuite/libffi.call/cls_align_longdouble_split2.c - testsuite/libffi.call/cls_align_longdouble_split.c - testsuite/libffi.call/cls_dbls_struct.c - testsuite/libffi.call/cls_double_va.c - testsuite/libffi.call/cls_longdouble.c - testsuite/libffi.call/cls_longdouble_va.c - testsuite/libffi.call/cls_pointer.c - testsuite/libffi.call/cls_pointer_stack.c - testsuite/libffi.call/err_bad_abi.c - testsuite/libffi.call/err_bad_typedef.c - testsuite/libffi.call/stret_large2.c - testsuite/libffi.call/stret_large.c - testsuite/libffi.call/stret_medium2.c - testsuite/libffi.call/stret_medium.c: New tests from Apple. - -2009-06-05 Andrew Haley - - * src/x86/ffitarget.h, src/x86/ffi.c: Merge stdcall changes from - libffi. - -2009-06-04 Andrew Haley - - * src/x86/ffitarget.h, src/x86/win32.S, src/x86/ffi.c: Back out - stdcall changes. - -2008-02-26 Anthony Green - Thomas Heller - - * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C - comment. - -2008-02-03 Timothy Wall - - * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return - offset based on code pointer, not data pointer. - -2008-01-31 Timothy Wall - - * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall - closures. - * src/x86/ffitarget.h: Increase size of trampoline for stdcall - closures. - * src/x86/win32.S: Add assembly for stdcall closure. - * src/x86/ffi.c: Initialize stdcall closure trampoline. - -2009-06-04 Andrew Haley - - * include/ffi.h.in: Change void (*)() to void (*)(void). - * src/x86/ffi.c: Likewise. - -2009-06-04 Andrew Haley - - * src/powerpc/ppc_closure.S: Insert licence header. - * src/powerpc/linux64_closure.S: Likewise. - * src/m68k/sysv.S: Likewise. - - * src/sh64/ffi.c: Change void (*)() to void (*)(void). - * src/powerpc/ffi.c: Likewise. - * src/powerpc/ffi_darwin.c: Likewise. - * src/m32r/ffi.c: Likewise. - * src/sh64/ffi.c: Likewise. - * src/x86/ffi64.c: Likewise. - * src/alpha/ffi.c: Likewise. - * src/alpha/osf.S: Likewise. - * src/frv/ffi.c: Likewise. - * src/s390/ffi.c: Likewise. - * src/pa/ffi.c: Likewise. - * src/pa/hpux32.S: Likewise. - * src/ia64/unix.S: Likewise. - * src/ia64/ffi.c: Likewise. - * src/sparc/ffi.c: Likewise. - * src/mips/ffi.c: Likewise. - * src/sh/ffi.c: Likewise. - -2008-02-15 David Daney - - * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): - Define (conditionally), and use it to include cachectl.h. - (ffi_prep_closure_loc): Fix cache flushing. - * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. - -2009-06-04 Andrew Haley - - include/ffi.h.in, - src/arm/ffitarget.h, - src/arm/ffi.c, - src/arm/sysv.S, - src/powerpc/ffitarget.h, - src/closures.c, - src/sh64/ffitarget.h, - src/sh64/ffi.c, - src/sh64/sysv.S, - src/types.c, - src/x86/ffi64.c, - src/x86/ffitarget.h, - src/x86/win32.S, - src/x86/darwin.S, - src/x86/ffi.c, - src/x86/sysv.S, - src/x86/unix64.S, - src/alpha/ffitarget.h, - src/alpha/ffi.c, - src/alpha/osf.S, - src/m68k/ffitarget.h, - src/frv/ffitarget.h, - src/frv/ffi.c, - src/s390/ffitarget.h, - src/s390/sysv.S, - src/cris/ffitarget.h, - src/pa/linux.S, - src/pa/ffitarget.h, - src/pa/ffi.c, - src/raw_api.c, - src/ia64/ffitarget.h, - src/ia64/unix.S, - src/ia64/ffi.c, - src/ia64/ia64_flags.h, - src/java_raw_api.c, - src/debug.c, - src/sparc/v9.S, - src/sparc/ffitarget.h, - src/sparc/ffi.c, - src/sparc/v8.S, - src/mips/ffitarget.h, - src/mips/n32.S, - src/mips/o32.S, - src/mips/ffi.c, - src/prep_cif.c, - src/sh/ffitarget.h, - src/sh/ffi.c, - src/sh/sysv.S: Update license text. - -2009-05-22 Dave Korn - - * src/x86/win32.S (_ffi_closure_STDCALL): New function. - (.eh_frame): Add FDE for it. - -2009-05-22 Dave Korn - - * configure.ac: Also check if assembler supports pc-relative - relocs on X86_WIN32 targets. - * configure: Regenerate. - * src/x86/win32.S (ffi_prep_args): Declare extern, not global. - (_ffi_call_SYSV): Add missing function type symbol .def and - add EH markup labels. - (_ffi_call_STDCALL): Likewise. - (_ffi_closure_SYSV): Likewise. - (_ffi_closure_raw_SYSV): Likewise. - (.eh_frame): Add hand-crafted EH data. - -2009-04-09 Jakub Jelinek - - * testsuite/lib/libffi-dg.exp: Change copyright header to refer to - version 3 of the GNU General Public License and to point readers - at the COPYING3 file and the FSF's license web page. - * testsuite/libffi.call/call.exp: Likewise. - * testsuite/libffi.special/special.exp: Likewise. - -2009-03-01 Ralf Wildenhues - - * configure: Regenerate. - -2008-12-18 Rainer Orth - - PR libffi/26048 - * configure.ac (HAVE_AS_X86_PCREL): New test. - * configure: Regenerate. - * fficonfig.h.in: Regenerate. - * src/x86/sysv.S [!FFI_NO_RAW_API]: Precalculate - RAW_CLOSURE_CIF_OFFSET, RAW_CLOSURE_FUN_OFFSET, - RAW_CLOSURE_USER_DATA_OFFSET for the Solaris 10/x86 assembler. - (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL. - * src/x86/unix64.S (.Lstore_table): Move to .text section. - (.Lload_table): Likewise. - (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL. - -2008-12-18 Ralf Wildenhues - - * configure: Regenerate. - -2008-11-21 Eric Botcazou - - * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for - signed/unsigned int8/16 return values. - * src/sparc/v8.S (ffi_call_v8): Likewise. - (ffi_closure_v8): Likewise. - -2008-09-26 Peter O'Gorman - Steve Ellcey - - * configure: Regenerate for new libtool. - * Makefile.in: Ditto. - * include/Makefile.in: Ditto. - * aclocal.m4: Ditto. - -2008-08-25 Andreas Tobler - - * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and - FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum. - Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT. - Adjust copyright notice. - * src/powerpc/ffi.c: Add two new flags to indicate if we have one - register or two register to use for FFI_SYSV structs. - (ffi_prep_cif_machdep): Pass the right register flag introduced above. - (ffi_closure_helper_SYSV): Fix the return type for - FFI_SYSV_TYPE_SMALL_STRUCT. Comment. - Adjust copyright notice. - -2008-07-16 Kaz Kojima - - * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned - int. - -2008-06-17 Ralf Wildenhues - - * configure: Regenerate. - * include/Makefile.in: Regenerate. - * testsuite/Makefile.in: Regenerate. - -2008-06-07 Joseph Myers - - * configure.ac (parisc*-*-linux*, powerpc-*-sysv*, - powerpc-*-beos*): Remove. - * configure: Regenerate. - -2008-05-09 Julian Brown - - * Makefile.am (LTLDFLAGS): New. - (libffi_la_LDFLAGS): Use above. - * Makefile.in: Regenerate. - -2008-04-18 Paolo Bonzini - - PR bootstrap/35457 - * aclocal.m4: Regenerate. - * configure: Regenerate. - -2008-03-26 Kaz Kojima - - * src/sh/sysv.S: Add .note.GNU-stack on Linux. - * src/sh64/sysv.S: Likewise. - -2008-03-26 Daniel Jacobowitz - - * src/arm/sysv.S: Fix ARM comment marker. - -2008-03-26 Jakub Jelinek - - * src/alpha/osf.S: Add .note.GNU-stack on Linux. - * src/s390/sysv.S: Likewise. - * src/powerpc/ppc_closure.S: Likewise. - * src/powerpc/sysv.S: Likewise. - * src/x86/unix64.S: Likewise. - * src/x86/sysv.S: Likewise. - * src/sparc/v8.S: Likewise. - * src/sparc/v9.S: Likewise. - * src/m68k/sysv.S: Likewise. - * src/arm/sysv.S: Likewise. - -2008-03-16 Ralf Wildenhues - - * aclocal.m4: Regenerate. - * configure: Likewise. - * Makefile.in: Likewise. - * include/Makefile.in: Likewise. - * testsuite/Makefile.in: Likewise. - -2008-02-12 Bjoern Koenig - Andreas Tobler - - * configure.ac: Add amd64-*-freebsd* target. - * configure: Regenerate. - -2008-01-30 H.J. Lu - - PR libffi/34612 - * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when - returning struct. - - * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer" - tests. - -2008-01-24 David Edelsohn - - * configure: Regenerate. - -2008-01-06 Andreas Tobler - - * src/x86/ffi.c (ffi_prep_cif_machdep): Fix thinko. - -2008-01-05 Andreas Tobler - - PR testsuite/32843 - * src/x86/ffi.c (ffi_prep_cif_machdep): Add code for - signed/unsigned int8/16 for X86_DARWIN. - Updated copyright info. - Handle one and two byte structs with special cif->flags. - * src/x86/ffitarget.h: Add special types for one and two byte structs. - Updated copyright info. - * src/x86/darwin.S (ffi_call_SYSV): Rewrite to use a jump table like - sysv.S - Remove code to pop args from the stack after call. - Special-case signed/unsigned for int8/16, one and two byte structs. - (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8, - FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32, - FFI_TYPE_SINT32. - Updated copyright info. - -2007-12-08 David Daney - - * src/mips/n32.S (ffi_call_N32): Replace dadd with ADDU, dsub with - SUBU, add with ADDU and use smaller code sequences. - -2007-12-07 David Daney - - * src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return - type. - -2007-12-06 David Daney - - * include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already - defined. - (ffi_java_raw): New typedef. - (ffi_java_raw_call, ffi_java_ptrarray_to_raw, - ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to - ffi_java_raw. - (ffi_java_raw_closure) : Same. - (ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change - parameter types. - * src/java_raw_api.c (ffi_java_raw_size): Replace FFI_SIZEOF_ARG with - FFI_SIZEOF_JAVA_RAW. - (ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw. - Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use - sizeof(ffi_java_raw) for alignment calculations. - (ffi_java_ptrarray_to_raw): Same. - (ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER - if FFI_SIZEOF_JAVA_RAW == 4. - (ffi_java_raw_to_rvalue): Same. - (ffi_java_raw_call): Change type of raw to ffi_java_raw. - (ffi_java_translate_args): Same. - (ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change - parameter types. - * src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI. - -2007-12-06 David Daney - - * src/mips/n32.S (ffi_closure_N32): Use 64-bit add instruction on - pointer values. - -2007-12-01 Andreas Tobler - - PR libffi/31937 - * src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT. - Add local FFI_TYPE_UINT128 to handle soft-float long-double-128. - * src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and - set the NUM_FPR_ARG_REGISTERS according to. - Add support for potential soft-float support under hard-float - architecture. - (ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of - FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according - to the FFI_LINUX_SOFT_FLOAT ABI. - (ffi_prep_cif_machdep): Likewise. - (ffi_closure_helper_SYSV): Likewise. - * src/powerpc/ppc_closure.S: Make sure not to store float/double - on archs where __NO_FPRS__ is true. - Add FFI_TYPE_UINT128 support. - * src/powerpc/sysv.S: Add support for soft-float long-double-128. - Adjust copyright notice. - -2007-11-25 Andreas Tobler - - * src/closures.c: Move defintion of MAYBE_UNUSED from here to ... - * include/ffi_common.h: ... here. - Update copyright. - -2007-11-17 Andreas Tobler - - * src/powerpc/sysv.S: Load correct cr to compare if we have long double. - * src/powerpc/linux64.S: Likewise. - * src/powerpc/ffi.c: Add a comment to show which part goes into cr6. - * testsuite/libffi.call/return_ldl.c: New test. - -2007-09-04 - - * src/arm/sysv.S (UNWIND): New. - (Whole file): Conditionally compile unwinder directives. - * src/arm/sysv.S: Add unwinder directives. - - * src/arm/ffi.c (ffi_prep_args): Align structs by at least 4 bytes. - Only treat r0 as a struct address if we're actually returning a - struct by address. - Only copy the bytes that are actually within a struct. - (ffi_prep_cif_machdep): A Composite Type not larger than 4 bytes - is returned in r0, not passed by address. - (ffi_call): Allocate a word-sized temporary for the case where - a composite is returned in r0. - (ffi_prep_incoming_args_SYSV): Align as necessary. - -2007-08-05 Steven Newbury - - * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use __clear_cache instead of - directly using the sys_cacheflush syscall. - -2007-07-27 Andrew Haley - - * src/arm/sysv.S (ffi_closure_SYSV): Add soft-float. - -2007-09-03 Maciej W. Rozycki - - * Makefile.am: Unify MIPS_IRIX and MIPS_LINUX into MIPS. - * configure.ac: Likewise. - * Makefile.in: Regenerate. - * include/Makefile.in: Likewise. - * testsuite/Makefile.in: Likewise. - * configure: Likewise. - -2007-08-24 David Daney - - * testsuite/libffi.call/return_sl.c: New test. - -2007-08-10 David Daney - - * testsuite/libffi.call/cls_multi_ushort.c, - testsuite/libffi.call/cls_align_uint16.c, - testsuite/libffi.call/nested_struct1.c, - testsuite/libffi.call/nested_struct3.c, - testsuite/libffi.call/cls_7_1_byte.c, - testsuite/libffi.call/nested_struct5.c, - testsuite/libffi.call/cls_double.c, - testsuite/libffi.call/nested_struct7.c, - testsuite/libffi.call/cls_sint.c, - testsuite/libffi.call/nested_struct9.c, - testsuite/libffi.call/cls_20byte1.c, - testsuite/libffi.call/cls_multi_sshortchar.c, - testsuite/libffi.call/cls_align_sint64.c, - testsuite/libffi.call/cls_3byte2.c, - testsuite/libffi.call/cls_multi_schar.c, - testsuite/libffi.call/cls_multi_uchar.c, - testsuite/libffi.call/cls_19byte.c, - testsuite/libffi.call/cls_9byte1.c, - testsuite/libffi.call/cls_align_float.c, - testsuite/libffi.call/closure_fn1.c, - testsuite/libffi.call/problem1.c, - testsuite/libffi.call/closure_fn3.c, - testsuite/libffi.call/cls_sshort.c, - testsuite/libffi.call/closure_fn5.c, - testsuite/libffi.call/cls_align_double.c, - testsuite/libffi.call/nested_struct.c, - testsuite/libffi.call/cls_2byte.c, - testsuite/libffi.call/nested_struct10.c, - testsuite/libffi.call/cls_4byte.c, - testsuite/libffi.call/cls_6byte.c, - testsuite/libffi.call/cls_8byte.c, - testsuite/libffi.call/cls_multi_sshort.c, - testsuite/libffi.call/cls_align_sint16.c, - testsuite/libffi.call/cls_align_uint32.c, - testsuite/libffi.call/cls_20byte.c, - testsuite/libffi.call/cls_float.c, - testsuite/libffi.call/nested_struct2.c, - testsuite/libffi.call/cls_5_1_byte.c, - testsuite/libffi.call/nested_struct4.c, - testsuite/libffi.call/cls_24byte.c, - testsuite/libffi.call/nested_struct6.c, - testsuite/libffi.call/cls_64byte.c, - testsuite/libffi.call/nested_struct8.c, - testsuite/libffi.call/cls_uint.c, - testsuite/libffi.call/cls_multi_ushortchar.c, - testsuite/libffi.call/cls_schar.c, - testsuite/libffi.call/cls_uchar.c, - testsuite/libffi.call/cls_align_uint64.c, - testsuite/libffi.call/cls_ulonglong.c, - testsuite/libffi.call/cls_align_longdouble.c, - testsuite/libffi.call/cls_1_1byte.c, - testsuite/libffi.call/cls_12byte.c, - testsuite/libffi.call/cls_3_1byte.c, - testsuite/libffi.call/cls_3byte1.c, - testsuite/libffi.call/cls_4_1byte.c, - testsuite/libffi.call/cls_6_1_byte.c, - testsuite/libffi.call/cls_16byte.c, - testsuite/libffi.call/cls_18byte.c, - testsuite/libffi.call/closure_fn0.c, - testsuite/libffi.call/cls_9byte2.c, - testsuite/libffi.call/closure_fn2.c, - testsuite/libffi.call/closure_fn4.c, - testsuite/libffi.call/cls_ushort.c, - testsuite/libffi.call/closure_fn6.c, - testsuite/libffi.call/cls_5byte.c, - testsuite/libffi.call/cls_align_pointer.c, - testsuite/libffi.call/cls_7byte.c, - testsuite/libffi.call/cls_align_sint32.c, - testsuite/libffi.special/unwindtest_ffi_call.cc, - testsuite/libffi.special/unwindtest.cc: Remove xfail for mips64*-*-*. - -2007-08-10 David Daney - - PR libffi/28313 - * configure.ac: Don't treat mips64 as a special case. - * Makefile.am (nodist_libffi_la_SOURCES): Add n32.S. - * configure: Regenerate - * Makefile.in: Ditto. - * fficonfig.h.in: Ditto. - * src/mips/ffitarget.h (REG_L, REG_S, SUBU, ADDU, SRL, LI): Indent. - (LA, EH_FRAME_ALIGN, FDE_ADDR_BYTES): New preprocessor macros. - (FFI_DEFAULT_ABI): Set for n64 case. - (FFI_CLOSURES, FFI_TRAMPOLINE_SIZE): Define for n32 and n64 cases. - * src/mips/n32.S (ffi_call_N32): Add debug macros and labels for FDE. - (ffi_closure_N32): New function. - (.eh_frame): New section - * src/mips/o32.S: Clean up comments. - (ffi_closure_O32): Pass ffi_closure parameter in $12. - * src/mips/ffi.c: Use FFI_MIPS_N32 instead of - _MIPS_SIM == _ABIN32 throughout. - (FFI_MIPS_STOP_HERE): New, use in place of - ffi_stop_here. - (ffi_prep_args): Use unsigned long to hold pointer values. Rewrite - to support n32/n64 ABIs. - (calc_n32_struct_flags): Rewrite. - (calc_n32_return_struct_flags): Remove unused variable. Reverse - position of flag bits. - (ffi_prep_cif_machdep): Rewrite n32 portion. - (ffi_call): Enable for n64. Add special handling for small structure - return values. - (ffi_prep_closure_loc): Add n32 and n64 support. - (ffi_closure_mips_inner_O32): Add cast to silence warning. - (copy_struct_N32, ffi_closure_mips_inner_N32): New functions. - -2007-08-08 David Daney - - * testsuite/libffi.call/ffitest.h (ffi_type_mylong): Remove definition. - * testsuite/libffi.call/cls_align_uint16.c (main): Use correct type - specifiers. - * testsuite/libffi.call/nested_struct1.c (main): Ditto. - * testsuite/libffi.call/cls_sint.c (main): Ditto. - * testsuite/libffi.call/nested_struct9.c (main): Ditto. - * testsuite/libffi.call/cls_20byte1.c (main): Ditto. - * testsuite/libffi.call/cls_9byte1.c (main): Ditto. - * testsuite/libffi.call/closure_fn1.c (main): Ditto. - * testsuite/libffi.call/closure_fn3.c (main): Ditto. - * testsuite/libffi.call/return_dbl2.c (main): Ditto. - * testsuite/libffi.call/cls_sshort.c (main): Ditto. - * testsuite/libffi.call/return_fl3.c (main): Ditto. - * testsuite/libffi.call/closure_fn5.c (main): Ditto. - * testsuite/libffi.call/nested_struct.c (main): Ditto. - * testsuite/libffi.call/nested_struct10.c (main): Ditto. - * testsuite/libffi.call/return_ll1.c (main): Ditto. - * testsuite/libffi.call/cls_8byte.c (main): Ditto. - * testsuite/libffi.call/cls_align_uint32.c (main): Ditto. - * testsuite/libffi.call/cls_align_sint16.c (main): Ditto. - * testsuite/libffi.call/cls_20byte.c (main): Ditto. - * testsuite/libffi.call/nested_struct2.c (main): Ditto. - * testsuite/libffi.call/cls_24byte.c (main): Ditto. - * testsuite/libffi.call/nested_struct6.c (main): Ditto. - * testsuite/libffi.call/cls_uint.c (main): Ditto. - * testsuite/libffi.call/cls_12byte.c (main): Ditto. - * testsuite/libffi.call/cls_16byte.c (main): Ditto. - * testsuite/libffi.call/closure_fn0.c (main): Ditto. - * testsuite/libffi.call/cls_9byte2.c (main): Ditto. - * testsuite/libffi.call/closure_fn2.c (main): Ditto. - * testsuite/libffi.call/return_dbl1.c (main): Ditto. - * testsuite/libffi.call/closure_fn4.c (main): Ditto. - * testsuite/libffi.call/closure_fn6.c (main): Ditto. - * testsuite/libffi.call/cls_align_sint32.c (main): Ditto. - -2007-08-07 Andrew Haley - - * src/x86/sysv.S (ffi_closure_raw_SYSV): Fix typo in previous - checkin. - -2007-08-06 Andrew Haley - - PR testsuite/32843 - * src/x86/sysv.S (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8, - FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32, - FFI_TYPE_SINT32. - -2007-08-02 David Daney - - * testsuite/libffi.call/return_ul.c (main): Define return type as - ffi_arg. Use proper printf conversion specifier. - -2007-07-30 Andrew Haley - - PR testsuite/32843 - * src/x86/ffi.c (ffi_prep_cif_machdep): in x86 case, add code for - signed/unsigned int8/16. - * src/x86/sysv.S (ffi_call_SYSV): Rewrite to: - Use a jump table. - Remove code to pop args from the stack after call. - Special-case signed/unsigned int8/16. - * testsuite/libffi.call/return_sc.c (main): Revert. - -2007-07-26 Richard Guenther - - PR testsuite/32843 - * testsuite/libffi.call/return_sc.c (main): Verify call - result as signed char, not ffi_arg. - -2007-07-16 Rainer Orth - - * configure.ac (i?86-*-solaris2.1[0-9]): Set TARGET to X86_64. - * configure: Regenerate. - -2007-07-11 David Daney - - * src/mips/ffi.c: Don't include sys/cachectl.h. - (ffi_prep_closure_loc): Use __builtin___clear_cache() instead of - cacheflush(). - -2007-05-18 Aurelien Jarno - - * src/arm/ffi.c (ffi_prep_closure_loc): Renamed and ajusted - from (ffi_prep_closure): ... this. - (FFI_INIT_TRAMPOLINE): Adjust. - -2005-12-31 Phil Blundell - - * src/arm/ffi.c (ffi_prep_incoming_args_SYSV, - ffi_closure_SYSV_inner, ffi_prep_closure): New, add closure support. - * src/arm/sysv.S(ffi_closure_SYSV): Likewise. - * src/arm/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. - (FFI_CLOSURES): Enable closure support. - -2007-07-03 Andrew Haley - - * testsuite/libffi.call/cls_multi_ushort.c, - testsuite/libffi.call/cls_align_uint16.c, - testsuite/libffi.call/nested_struct1.c, - testsuite/libffi.call/nested_struct3.c, - testsuite/libffi.call/cls_7_1_byte.c, - testsuite/libffi.call/cls_double.c, - testsuite/libffi.call/nested_struct5.c, - testsuite/libffi.call/nested_struct7.c, - testsuite/libffi.call/cls_sint.c, - testsuite/libffi.call/nested_struct9.c, - testsuite/libffi.call/cls_20byte1.c, - testsuite/libffi.call/cls_multi_sshortchar.c, - testsuite/libffi.call/cls_align_sint64.c, - testsuite/libffi.call/cls_3byte2.c, - testsuite/libffi.call/cls_multi_schar.c, - testsuite/libffi.call/cls_multi_uchar.c, - testsuite/libffi.call/cls_19byte.c, - testsuite/libffi.call/cls_9byte1.c, - testsuite/libffi.call/cls_align_float.c, - testsuite/libffi.call/closure_fn1.c, - testsuite/libffi.call/problem1.c, - testsuite/libffi.call/closure_fn3.c, - testsuite/libffi.call/cls_sshort.c, - testsuite/libffi.call/closure_fn5.c, - testsuite/libffi.call/cls_align_double.c, - testsuite/libffi.call/cls_2byte.c, - testsuite/libffi.call/nested_struct.c, - testsuite/libffi.call/nested_struct10.c, - testsuite/libffi.call/cls_4byte.c, - testsuite/libffi.call/cls_6byte.c, - testsuite/libffi.call/cls_8byte.c, - testsuite/libffi.call/cls_multi_sshort.c, - testsuite/libffi.call/cls_align_uint32.c, - testsuite/libffi.call/cls_align_sint16.c, - testsuite/libffi.call/cls_float.c, - testsuite/libffi.call/cls_20byte.c, - testsuite/libffi.call/cls_5_1_byte.c, - testsuite/libffi.call/nested_struct2.c, - testsuite/libffi.call/cls_24byte.c, - testsuite/libffi.call/nested_struct4.c, - testsuite/libffi.call/nested_struct6.c, - testsuite/libffi.call/cls_64byte.c, - testsuite/libffi.call/nested_struct8.c, - testsuite/libffi.call/cls_uint.c, - testsuite/libffi.call/cls_multi_ushortchar.c, - testsuite/libffi.call/cls_schar.c, - testsuite/libffi.call/cls_uchar.c, - testsuite/libffi.call/cls_align_uint64.c, - testsuite/libffi.call/cls_ulonglong.c, - testsuite/libffi.call/cls_align_longdouble.c, - testsuite/libffi.call/cls_1_1byte.c, - testsuite/libffi.call/cls_12byte.c, - testsuite/libffi.call/cls_3_1byte.c, - testsuite/libffi.call/cls_3byte1.c, - testsuite/libffi.call/cls_4_1byte.c, - testsuite/libffi.call/cls_6_1_byte.c, - testsuite/libffi.call/cls_16byte.c, - testsuite/libffi.call/cls_18byte.c, - testsuite/libffi.call/closure_fn0.c, - testsuite/libffi.call/cls_9byte2.c, - testsuite/libffi.call/closure_fn2.c, - testsuite/libffi.call/closure_fn4.c, - testsuite/libffi.call/cls_ushort.c, - testsuite/libffi.call/closure_fn6.c, - testsuite/libffi.call/cls_5byte.c, - testsuite/libffi.call/cls_align_pointer.c, - testsuite/libffi.call/cls_7byte.c, - testsuite/libffi.call/cls_align_sint32.c, - testsuite/libffi.special/unwindtest_ffi_call.cc, - testsuite/libffi.special/unwindtest.cc: Enable for ARM. - -2007-07-05 H.J. Lu - - * aclocal.m4: Regenerated. - -2007-06-02 Paolo Bonzini - - * configure: Regenerate. - -2007-05-23 Steve Ellcey - - * Makefile.in: Regenerate. - * configure: Regenerate. - * aclocal.m4: Regenerate. - * include/Makefile.in: Regenerate. - * testsuite/Makefile.in: Regenerate. - -2007-05-10 Roman Zippel - - * src/m68k/ffi.c (ffi_prep_incoming_args_SYSV, - ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support. - * src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise. - * src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. - (FFI_CLOSURES): Enable closure support. - -2007-05-10 Roman Zippel - - * configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test. - * configure: Regenerate. - * fficonfig.h.in: Regenerate. - * src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC, - CFI_OFFSET,CFI_DEF_CFA): New macros. - (ffi_call_SYSV): Add callframe annotation. - -2007-05-10 Roman Zippel - - * src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix - numerous test suite failures. - * src/m68k/sysv.S (ffi_call_SYSV): Likewise. - -2007-04-11 Paolo Bonzini - - * Makefile.am (EXTRA_DIST): Bring up to date. - * Makefile.in: Regenerate. - * src/frv/eabi.S: Remove RCS keyword. - -2007-04-06 Richard Henderson - - * configure.ac: Tidy target case. - (HAVE_LONG_DOUBLE): Allow the target to override. - * configure: Regenerate. - * include/ffi.h.in: Don't define ffi_type_foo if - LIBFFI_HIDE_BASIC_TYPES is defined. - (ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define - to ffi_type_double. - * types.c (LIBFFI_HIDE_BASIC_TYPES): Define. - (FFI_TYPEDEF, ffi_type_void): Mark the data const. - (ffi_type_longdouble): Special case for Alpha. Don't define - if long double == double. - - * src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value. - (ffi_prep_cif_machdep): Handle it as the 128-bit type. - (ffi_call, ffi_closure_osf_inner): Likewise. - (ffi_closure_osf_inner): Likewise. Mark hidden. - (ffi_call_osf, ffi_closure_osf): Mark hidden. - * src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition. - * src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden. - (load_table): Handle 128-bit long double. - - * testsuite/libffi.call/float4.c: Add -mieee for alpha. - -2007-04-06 Tom Tromey - - PR libffi/31491: - * README: Fixed bug in example. - -2007-04-03 Jakub Jelinek - - * src/closures.c: Include sys/statfs.h. - (_GNU_SOURCE): Define on Linux. - (FFI_MMAP_EXEC_SELINUX): Define. - (selinux_enabled): New variable. - (selinux_enabled_check): New function. - (is_selinux_enabled): Define. - (dlmmap): Use it. - -2007-03-24 Uros Bizjak - - * testsuite/libffi.call/return_fl2.c (return_fl): Mark as static. - Use 'volatile float sum' to create sum of floats to avoid false - negative due to excess precision on ix86 targets. - (main): Ditto. - -2007-03-08 Alexandre Oliva - - * src/powerpc/ffi.c (flush_icache): Fix left-over from previous - patch. - (ffi_prep_closure_loc): Remove unneeded casts. Add needed ones. - -2007-03-07 Alexandre Oliva - - * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New. - (ffi_prep_closure_loc): New. - (ffi_prep_raw_closure_loc): New. - (ffi_prep_java_raw_closure_loc): New. - * src/closures.c: New file. - * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment): - Replace sflags with exec_offset. - [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset, - sub_segment_exec_offset): New macros. - (get_segment_flags, set_segment_flags, check_segment_merge): New - macros. - (is_mmapped_segment, is_extern_segment): Use get_segment_flags. - (add_segment, sys_alloc, create_mspace, create_mspace_with_base, - destroy_mspace): Use new macros. - (sys_alloc): Silence warning. - * Makefile.am (libffi_la_SOURCES): Add src/closures.c. - * Makefile.in: Rebuilt. - * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in - terms of ffi_prep_closure_loc. - * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted - from... - (ffi_prep_raw_closure): ... this. Re-implement in terms of the - renamed version. - * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and - adjusted from... - (ffi_prep_java_raw_closure): ... this. Re-implement in terms of - the renamed version. - * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from - (ffi_prep_closure): ... this. - * src/pa/ffi.c: Likewise. - * src/cris/ffi.c: Likewise. Adjust. - * src/frv/ffi.c: Likewise. - * src/ia64/ffi.c: Likewise. - * src/mips/ffi.c: Likewise. - * src/powerpc/ffi_darwin.c: Likewise. - * src/s390/ffi.c: Likewise. - * src/sh/ffi.c: Likewise. - * src/sh64/ffi.c: Likewise. - * src/sparc/ffi.c: Likewise. - * src/x86/ffi64.c: Likewise. - * src/x86/ffi.c: Likewise. - (FFI_INIT_TRAMPOLINE): Adjust. - (ffi_prep_raw_closure_loc): Renamed and adjusted from... - (ffi_prep_raw_closure): ... this. - * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from - (ffi_prep_closure): ... this. - (flush_icache): Adjust. - -2007-03-07 Alexandre Oliva - - * src/dlmalloc.c: New file, imported version 2.8.3 of Doug - Lea's malloc. - -2007-03-01 Brooks Moses - - * Makefile.am: Add dummy install-pdf target. - * Makefile.in: Regenerate - -2007-02-13 Andreas Krebbel - - * src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep, - ffi_closure_helper_SYSV): Add long double handling. - -2007-02-02 Jakub Jelinek - - * src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2 - immediately after bctrl instruction. - -2007-01-18 Alexandre Oliva - - * Makefile.am (all-recursive, install-recursive, - mostlyclean-recursive, clean-recursive, distclean-recursive, - maintainer-clean-recursive): Add missing targets. - * Makefile.in: Rebuilt. - -2006-12-14 Andreas Tobler - - * configure.ac: Add TARGET for x86_64-*-darwin*. - * Makefile.am (nodist_libffi_la_SOURCES): Add rules for 64-bit sources - for X86_DARWIN. - * src/x86/ffitarget.h: Set trampoline size for x86_64-*-darwin*. - * src/x86/darwin64.S: New file for x86_64-*-darwin* support. - * configure: Regenerate. - * Makefile.in: Regenerate. - * include/Makefile.in: Regenerate. - * testsuite/Makefile.in: Regenerate. - * testsuite/libffi.special/unwindtest_ffi_call.cc: New test case for - ffi_call only. - -2006-12-13 Andreas Tobler - - * aclocal.m4: Regenerate with aclocal -I .. as written in the - Makefile.am. - -2006-10-31 Geoffrey Keating - - * src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New. - (ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for - Darwin. - * testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL. - * testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL. - -2006-10-10 Paolo Bonzini - Sandro Tolaini - - * configure.ac [i*86-*-darwin*]: Set X86_DARWIN symbol and - conditional. - * configure: Regenerated. - * Makefile.am (nodist_libffi_la_SOURCES) [X86_DARWIN]: New case. - (EXTRA_DIST): Add src/x86/darwin.S. - * Makefile.in: Regenerated. - * include/Makefile.in: Regenerated. - * testsuite/Makefile.in: Regenerated. - - * src/x86/ffi.c (ffi_prep_cif_machdep) [X86_DARWIN]: Treat like - X86_WIN32, and additionally align stack to 16 bytes. - * src/x86/darwin.S: New, based on sysv.S. - * src/prep_cif.c (ffi_prep_cif) [X86_DARWIN]: Align > 8-byte structs. - -2006-09-12 David Daney - - PR libffi/23935 - * include/Makefile.am: Install both ffi.h and ffitarget.h in - $(libdir)/gcc/$(target_alias)/$(gcc_version)/include. - * aclocal.m4: Regenerated for automake 1.9.6. - * Makefile.in: Regenerated. - * include/Makefile.in: Regenerated. - * testsuite/Makefile.in: Regenerated. - -2006-08-17 Andreas Tobler - - * include/ffi_common.h (struct): Revert accidental commit. - -2006-08-15 Andreas Tobler - - * include/ffi_common.h: Remove lint directives. - * include/ffi.h.in: Likewise. - -2006-07-25 Torsten Schoenfeld - - * include/ffi.h.in (ffi_type_ulong, ffi_type_slong): Define correctly - for 32-bit architectures. - * testsuite/libffi.call/return_ul.c: New test case. - -2006-07-19 David Daney - - * testsuite/libffi.call/closure_fn6.c: Remove xfail for mips, - xfail remains for mips64. - -2006-05-23 Carlos O'Donell - - * Makefile.am: Add install-html target. Add install-html to .PHONY - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate. - * include/Makefile.in: Regenerate. - * testsuite/Makefile.in: Regenerate. - -2006-05-18 John David Anglin - - * pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from - stack slot. - -2006-04-22 Andreas Tobler - - * README: Remove notice about 'Crazy Comments'. - * src/debug.c: Remove lint directives. Cleanup white spaces. - * src/java_raw_api.c: Likewise. - * src/prep_cif.c: Likewise. - * src/raw_api.c: Likewise. - * src/ffitest.c: Delete. No longer needed, all test cases migrated - to the testsuite. - * src/arm/ffi.c: Remove lint directives. - * src/m32r/ffi.c: Likewise. - * src/pa/ffi.c: Likewise. - * src/powerpc/ffi.c: Likewise. - * src/powerpc/ffi_darwin.c: Likewise. - * src/sh/ffi.c: Likewise. - * src/sh64/ffi.c: Likewise. - * src/x86/ffi.c: Likewise. - * testsuite/libffi.call/float2.c: Likewise. - * testsuite/libffi.call/promotion.c: Likewise. - * testsuite/libffi.call/struct1.c: Likewise. - -2006-04-13 Andreas Tobler - - * src/pa/hpux32.S: Correct unwind offset calculation for - ffi_closure_pa32. - * src/pa/linux.S: Likewise. - -2006-04-12 James E Wilson - - PR libgcj/26483 - * src/ia64/ffi.c (stf_spill, ldf_fill): Rewrite as macros. - (hfa_type_load): Call stf_spill. - (hfa_type_store): Call ldf_fill. - (ffi_call): Adjust calls to above routines. Add local temps for - macro result. - -2006-04-10 Matthias Klose - - * testsuite/lib/libffi-dg.exp (libffi-init): Recognize multilib - directory names containing underscores. - -2006-04-07 James E Wilson - - * testsuite/libffi.call/float4.c: New testcase. - -2006-04-05 John David Anglin - Andreas Tobler - - * Makefile.am: Add PA_HPUX port. - * Makefile.in: Regenerate. - * include/Makefile.in: Likewise. - * testsuite/Makefile.in: Likewise. - * configure.ac: Add PA_HPUX rules. - * configure: Regenerate. - * src/pa/ffitarget.h: Rename linux target to PA_LINUX. - Add PA_HPUX and PA64_HPUX. - Rename FFI_LINUX ABI to FFI_PA32 ABI. - (FFI_TRAMPOLINE_SIZE): Define for 32-bit HP-UX targets. - (FFI_TYPE_SMALL_STRUCT2): Define. - (FFI_TYPE_SMALL_STRUCT4): Likewise. - (FFI_TYPE_SMALL_STRUCT8): Likewise. - (FFI_TYPE_SMALL_STRUCT3): Redefine. - (FFI_TYPE_SMALL_STRUCT5): Likewise. - (FFI_TYPE_SMALL_STRUCT6): Likewise. - (FFI_TYPE_SMALL_STRUCT7): Likewise. - * src/pa/ffi.c (ROUND_DOWN): Delete. - (fldw, fstw, fldd, fstd): Use '__asm__'. - (ffi_struct_type): Add support for FFI_TYPE_SMALL_STRUCT2, - FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8. - (ffi_prep_args_LINUX): Rename to ffi_prep_args_pa32. Update comment. - Simplify incrementing of stack slot variable. Change type of local - 'n' to unsigned int. - (ffi_size_stack_LINUX): Rename to ffi_size_stack_pa32. Handle long - double on PA_HPUX. - (ffi_prep_cif_machdep): Likewise. - (ffi_call): Likewise. - (ffi_closure_inner_LINUX): Rename to ffi_closure_inner_pa32. Change - return type to ffi_status. Simplify incrementing of stack slot - variable. Only copy floating point argument registers when PA_LINUX - is true. Reformat debug statement. - Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and - FFI_TYPE_SMALL_STRUCT8. - (ffi_closure_LINUX): Rename to ffi_closure_pa32. Add 'extern' to - declaration. - (ffi_prep_closure): Make linux trampoline conditional on PA_LINUX. - Add nops to cache flush. Add trampoline for PA_HPUX. - * src/pa/hpux32.S: New file. - * src/pa/linux.S (ffi_call_LINUX): Rename to ffi_call_pa32. Rename - ffi_prep_args_LINUX to ffi_prep_args_pa32. - Localize labels. Add support for 2, 4 and 8-byte small structs. Handle - unaligned destinations in 3, 5, 6 and 7-byte small structs. Order - argument type checks so that common argument types appear first. - (ffi_closure_LINUX): Rename to ffi_closure_pa32. Rename - ffi_closure_inner_LINUX to ffi_closure_inner_pa32. - -2006-03-24 Alan Modra - - * src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX. Default - for 32-bit using IBM extended double format. Fix FFI_LAST_ABI. - * src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of - FFI_TYPE_LONGDOUBLE. - (ffi_prep_args64): Assert using IBM extended double. - (ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type. - Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args. - (ffi_call): Handle FFI_LINUX. - (ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs - gpr3 return pointer as for struct return. Handle FFI_LINUX - FFI_TYPE_LONGDOUBLE return and args. Don't increment "nf" - unnecessarily. - * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2 - for FFI_TYPE_LONGDOUBLE. Move epilogue insns into case table. - Don't use r6 as pointer to results, instead use sp offset. Don't - make a special call to load lr with case table address, instead - use offset from previous call. - * src/powerpc/sysv.S (ffi_call_SYSV): Save long double return. - * src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double - return. - -2006-03-15 Kaz Kojima - - * src/sh64/ffi.c (ffi_prep_cif_machdep): Handle float arguments - passed with FP registers correctly. - (ffi_closure_helper_SYSV): Likewise. - * src/sh64/sysv.S: Likewise. - -2006-03-01 Andreas Tobler - - * testsuite/libffi.special/unwindtest.cc (closure_test_fn): Mark cif, - args and userdata unused. - (closure_test_fn1): Mark cif and userdata unused. - (main): Remove unused res. - -2006-02-28 Andreas Tobler - - * testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for - -O2, -O3, -Os and the warning flags -W -Wall. - * testsuite/libffi.special/special.exp: Likewise. - * testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark - unused parameter unused for gcc or else do nothing. - * testsuite/libffi.special/ffitestcxx.h: Likewise. - * testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif - and userdata unused. - * testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise. - * testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise. - * testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise. - * testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise. - * testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise. - * testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise. - * testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise. - * testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise. - * testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise. - * testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise. - * testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise. - * testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise. - * testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise. - * testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise. - * testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise. - * testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise. - * testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise. - * testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise. - * testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise. - * testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise. - * testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise. - * testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise. - * testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise. - * testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn): - Likewise. - * testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn): - Likewise. - * testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn): - Likewise. - * testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast - void* to avoid compiler warning. - (main): Likewise. - (cls_struct_align_gn): Mark cif and userdata unused. - * testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn): - Likewise. - * testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn): - Likewise. - * testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn): - Likewise. - * testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn): - Likewise. - * testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn): - Likewise. - * testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise. - * testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise. - * testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and - data unused. - (main): Cast res_call to silence gcc. - * testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and - data unused. - (main): Cast res_call to silence gcc. - * testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif - and data unused. - (main): Cast res_call to silence gcc. - * testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and - data unused. - (main): Cast res_call to silence gcc. - * testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and - data unused. - (main): Cast res_call to silence gcc. - * testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif - and data unused. - (main): Cast res_call to silence gcc. - * testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and - userdata unused. - (cls_ret_schar_fn): Cast printf parameter to silence gcc. - * testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and - userdata unused. - (cls_ret_sint_fn): Cast printf parameter to silence gcc. - * testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and - userdata unused. - (cls_ret_sshort_fn): Cast printf parameter to silence gcc. - * testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn): Mark cif and - userdata unused. - (cls_ret_uchar_fn): Cast printf parameter to silence gcc. - * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and - userdata unused. - (cls_ret_uint_fn): Cast printf parameter to silence gcc. - * testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif - and userdata unused. - * testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and - userdata unused. - (cls_ret_ushort_fn): Cast printf parameter to silence gcc. - * testsuite/libffi.call/float.c (floating): Remove unused parameter e. - * testsuite/libffi.call/float1.c (main): Remove unused variable i. - Cleanup white spaces. - * testsuite/libffi.call/negint.c (checking): Remove unused variable i. - * testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark - cif and userdata unused. - * testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn): - Likewise. - * testsuite/libffi.call/nested_struct10.c (B_gn): Likewise. - * testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf - formatters to silence gcc. - (B_gn): Mark cif and userdata unused. - * testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata - unused. - * testsuite/libffi.call/nested_struct4.c: Mention related PR. - (B_gn): Mark cif and userdata unused. - * testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata - unused. - * testsuite/libffi.call/nested_struct6.c: Mention related PR. - (B_gn): Mark cif and userdata unused. - * testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata - unused. - * testsuite/libffi.call/nested_struct8.c (B_gn): Likewise. - * testsuite/libffi.call/nested_struct9.c (B_gn): Likewise. - * testsuite/libffi.call/problem1.c (stub): Likewise. - * testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence - gcc. - * testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned - in the last commit for this test case in the test case itself. - * testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as - unused. - * testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise. - * testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise. - * testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise. - * testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise. - * testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise. - * testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise. - -2006-02-22 Kaz Kojima - - * src/sh/sysv.S: Fix register numbers in the FDE for - ffi_closure_SYSV. - -2006-02-20 Andreas Tobler - - * testsuite/libffi.call/return_fl2.c (return_fl): Remove static - declaration to avoid a false negative on ix86. See PR323. - -2006-02-18 Kaz Kojima - - * src/sh/ffi.c (ffi_closure_helper_SYSV): Remove unused variable - and cast integer to void * if needed. Update the pointer to - the FP register saved area correctly. - -2006-02-17 Andreas Tobler - - * testsuite/libffi.call/nested_struct6.c: XFAIL this test until PR25630 - is fixed. - * testsuite/libffi.call/nested_struct4.c: Likewise. - -2006-02-16 Andreas Tobler - - * testsuite/libffi.call/return_dbl.c: New test case. - * testsuite/libffi.call/return_dbl1.c: Likewise. - * testsuite/libffi.call/return_dbl2.c: Likewise. - * testsuite/libffi.call/return_fl.c: Likewise. - * testsuite/libffi.call/return_fl1.c: Likewise. - * testsuite/libffi.call/return_fl2.c: Likewise. - * testsuite/libffi.call/return_fl3.c: Likewise. - * testsuite/libffi.call/closure_fn6.c: Likewise. - - * testsuite/libffi.call/nested_struct2.c: Remove ffi_type_mylong - definition. - * testsuite/libffi.call/ffitest.h: Add ffi_type_mylong definition - here to be used by other test cases too. - - * testsuite/libffi.call/nested_struct10.c: New test case. - * testsuite/libffi.call/nested_struct9.c: Likewise. - * testsuite/libffi.call/nested_struct8.c: Likewise. - * testsuite/libffi.call/nested_struct7.c: Likewise. - * testsuite/libffi.call/nested_struct6.c: Likewise. - * testsuite/libffi.call/nested_struct5.c: Likewise. - * testsuite/libffi.call/nested_struct4.c: Likewise. - -2006-01-21 Andreas Tobler - - * configure.ac: Enable libffi for sparc64-*-freebsd*. - * configure: Rebuilt. - -2006-01-18 Jakub Jelinek - - * src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3, - instead do the shifting inline. - * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5 - shift count unconditionally. Simplify load sequences for 1, 2, 3, 4 - and 8 byte structs, for the remaining struct sizes don't call - __lshrdi3, instead do the shifting inline. - -2005-12-07 Thiemo Seufer - - * src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add - missing parentheses. - * src/mips/o32.S (ffi_call_O32): Code formatting. Define - and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations. - (ffi_closure_O32): Likewise, but with newly defined A3_OFF2, - A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2, - V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2, - FA_0_0_OFF2. - * src/mips/ffi.c (ffi_prep_args): Code formatting. Fix - endianness bugs. - (ffi_prep_closure): Improve trampoline instruction scheduling. - (ffi_closure_mips_inner_O32): Fix endianness bugs. - -2005-12-03 Alan Modra - - * src/powerpc/ffi.c: Formatting. - (ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions. - (ffi_prep_args64): Likewise. - -2005-09-30 Geoffrey Keating - - * testsuite/lib/libffi-dg.exp (libffi_target_compile): For - darwin, use -shared-libgcc not -lgcc_s, and explain why. - -2005-09-26 Tom Tromey - - * testsuite/libffi.call/float1.c (value_type): New typedef. - (CANARY): New define. - (main): Check for result buffer overflow. - * src/powerpc/linux64.S: Handle linux64 long double returns. - * src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant. - (ffi_prep_cif_machdep): Handle linux64 long double returns. - -2005-08-25 Alan Modra - - PR target/23404 - * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack - homed fp args. - (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same. - -2005-08-11 Jakub Jelinek - - * configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test. - (AH_BOTTOM): Add FFI_HIDDEN definition. - * configure: Rebuilt. - * fficonfig.h.in: Rebuilt. - * src/powerpc/ffi.c (hidden): Remove. - (ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64, - ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden. - * src/powerpc/linux64_closure.S (ffi_closure_LINUX64, - .ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden. - * src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove, - add FFI_HIDDEN to its prototype. - (ffi_closure_SYSV_inner): New. - * src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. - * src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. - -2005-08-10 Alfred M. Szmidt - - PR libffi/21819: - * configure: Rebuilt. - * configure.ac: Handle i*86-*-gnu*. - -2005-08-09 Jakub Jelinek - - * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use - DW_CFA_offset_extended_sf rather than - DW_CFA_GNU_negative_offset_extended. - * src/powerpc/sysv.S (ffi_call_SYSV): Likewise. - -2005-07-22 SUGIOKA Toshinobu - - * src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly - on sh3. - (ffi_closure_SYSV): Change the stack layout for sh3 struct argument. - * src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is - partially on register. - (ffi_closure_helper_SYSV): Likewise. - (ffi_prep_cif_machdep): Don't set too many cif->flags. - -2005-07-20 Kaz Kojima - - * src/sh/ffi.c (ffi_call): Handle small structures correctly. - Remove empty line. - * src/sh64/ffi.c (simple_type): Remove. - (return_type): Handle small structures correctly. - (ffi_prep_args): Likewise. - (ffi_call): Likewise. - (ffi_closure_helper_SYSV): Likewise. - * src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return. - Emit position independent code if PIC and remove wrong datalabel - prefixes from EH data. - -2005-07-19 Andreas Tobler - - * Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD. - * Makefile.in: Regenerate. - * include/Makefile.in: Likewise. - * testsuite/Makefile.in: Likewise. - * configure.ac: Add POWERPC_FREEBSD rules. - * configure: Regenerate. - * src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules. - (FFI_SYSV_TYPE_SMALL_STRUCT): Define. - * src/powerpc/ffi.c: Add flags to handle small structure returns - in ffi_call_SYSV. - (ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI. - Aka FFI_SYSV. - (ffi_closure_helper_SYSV): Likewise. - * src/powerpc/ppc_closure.S: Add return types for small structures. - * src/powerpc/sysv.S: Add bits to handle small structures for - final SYSV 4 ABI. - -2005-07-10 Andreas Tobler - - * testsuite/libffi.call/cls_5_1_byte.c: New test file. - * testsuite/libffi.call/cls_6_1_byte.c: Likewise. - * testsuite/libffi.call/cls_7_1_byte.c: Likewise. - -2005-07-05 Randolph Chung - - * src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1 - as FFI_TYPE_SMALL_STRUCT3. Break out handling for 5-7 byte - structures. Kill compilation warnings. - (ffi_closure_inner_LINUX): Print return values as hex in debug - message. Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3. - Properly handle 5-7 byte structure returns. - * src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1) - (FFI_TYPE_SMALL_STRUCT2): Remove. - (FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5) - (FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define. - * src/pa/linux.S: Mark source file as using PA1.1 assembly. - (checksmst1, checksmst2): Remove. - (checksmst3): Optimize handling of 3-byte struct returns. - (checksmst567): Properly handle 5-7 byte struct returns. - -2005-06-15 Rainer Orth - - PR libgcj/21943 - * src/mips/n32.S: Enforce PIC code. - * src/mips/o32.S: Likewise. - -2005-06-15 Rainer Orth - - * configure.ac: Treat i*86-*-solaris2.10 and up as X86_64. - * configure: Regenerate. - -2005-06-01 Alan Modra - - * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET - to call ffi_closure_helper_SYSV. Append @local instead. - * src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV. - -2005-05-17 Kelley Cook - - * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS. - Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF. - * Makefile.am (ACLOCAL_AMFLAGS): Remove -I ../config. - * aclocal.m4, configure, fficonfig.h.in, Makefile.in, - include/Makefile.in, testsuite/Makefile.in: Regenerate. - -2005-05-09 Mike Stump - - * configure: Regenerate. - -2005-05-08 Richard Henderson - - PR libffi/21285 - * src/alpha/osf.S: Update unwind into to match code. - -2005-05-04 Andreas Degert - Richard Henderson - - * src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in - bit 11 of flags. - (ffi_call): Mask return type field. Pass ssecount to ffi_call_unix64. - (ffi_prep_closure): Set carry bit if sse-used flag set. - * src/x86/unix64.S (ffi_call_unix64): Add ssecount argument. - Only load sse registers if ssecount non-zero. - (ffi_closure_unix64): Only save sse registers if carry set on entry. - -2005-04-29 Ralf Corsepius - - * configure.ac: Add i*86-*-rtems*, sparc*-*-rtems*, - powerpc-*rtems*, arm*-*-rtems*, sh-*-rtems*. - * configure: Regenerate. - -2005-04-20 Hans-Peter Nilsson - - * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): In regsub use, - have Tcl8.3-compatible intermediate variable. - -2005-04-18 Simon Posnjak - Hans-Peter Nilsson - - * Makefile.am: Add CRIS support. - * configure.ac: Likewise. - * Makefile.in, configure, testsuite/Makefile.in, - include/Makefile.in: Regenerate. - * src/cris: New directory. - * src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files. - * src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__. - - * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with - \r?\n in output tests. - -2005-04-12 Mike Stump - - * configure: Regenerate. - -2005-03-30 Hans Boehm - - * src/ia64/ffitarget.h (ffi_arg): Use long long instead of DI. - -2005-03-30 Steve Ellcey - - * src/ia64/ffitarget.h (ffi_arg) ADD DI attribute. - (ffi_sarg) Ditto. - * src/ia64/unix.S (ffi_closure_unix): Extend gp - to 64 bits in ILP32 mode. - Load 64 bits even for short data. - -2005-03-23 Mike Stump - - * src/powerpc/darwin.S: Update for -m64 multilib. - * src/powerpc/darwin_closure.S: Likewise. - -2005-03-21 Zack Weinberg - - * configure.ac: Do not invoke TL_AC_GCC_VERSION. - Do not set tool_include_dir. - * aclocal.m4, configure, Makefile.in, testsuite/Makefile.in: - Regenerate. - * include/Makefile.am: Set gcc_version and toollibffidir. - * include/Makefile.in: Regenerate. - -2005-02-22 Andrew Haley - - * src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to - odd-numbered register pairs for 64-bit integer types. - -2005-02-23 Andreas Tobler - - PR libffi/20104 - * testsuite/libffi.call/return_ll1.c: New test case. - -2005-02-11 Janis Johnson - - * testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options. - * testsuite/libffi.call/float.c: Ditto. - * testsuite/libffi.call/float2.c: Ditto. - * testsuite/libffi.call/float3.c: Ditto. - -2005-02-08 Andreas Tobler - - * src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv. - -2005-01-12 Eric Botcazou - - * testsuite/libffi.special/special.exp (cxx_options): Add - -shared-libgcc. - -2004-12-31 Richard Henderson - - * src/types.c (FFI_AGGREGATE_TYPEDEF): Remove. - (FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF. Replace size and - offset parameters with a type parameter; deduce size and structure - alignment. Update all users. - -2004-12-31 Richard Henderson - - * src/types.c (FFI_TYPE_POINTER): Define with sizeof. - (FFI_TYPE_LONGDOUBLE): Fix for ia64. - * src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move - into ffi_prep_closure. - * src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite - from scratch. - -2004-12-27 Richard Henderson - - * src/x86/unix64.S: Fix typo in unwind info. - -2004-12-25 Richard Henderson - - * src/x86/ffi64.c (struct register_args): Rename from stackLayout. - (enum x86_64_reg_class): Add X86_64_COMPLEX_X87_CLASS. - (merge_classes): Check for it. - (SSE_CLASS_P): New. - (classify_argument): Pass byte_offset by value; perform all updates - inside struct case. - (examine_argument): Add classes argument; handle - X86_64_COMPLEX_X87_CLASS. - (ffi_prep_args): Merge into ... - (ffi_call): ... here. Share stack frame with ffi_call_unix64. - (ffi_prep_cif_machdep): Setup cif->flags for proper structure return. - (ffi_fill_return_value): Remove. - (ffi_prep_closure): Remove dead assert. - (ffi_closure_unix64_inner): Rename from ffi_closure_UNIX64_inner. - Rewrite to use struct register_args instead of va_list. Create - flags for handling structure returns. - * src/x86/unix64.S: Remove dead strings. - (ffi_call_unix64): Rename from ffi_call_UNIX64. Rewrite to share - stack frame with ffi_call. Handle structure returns properly. - (float2sse, floatfloat2sse, double2sse): Remove. - (sse2float, sse2double, sse2floatfloat): Remove. - (ffi_closure_unix64): Rename from ffi_closure_UNIX64. Rewrite - to handle structure returns properly. - -2004-12-08 David Edelsohn - - * Makefile.am (AM_MAKEFLAGS): Remove duplicate LIBCFLAGS and - PICFLAG. - * Makefile.in: Regenerated. - -2004-12-02 Richard Sandiford - - * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version. - * configure, aclocal.m4, Makefile.in: Regenerate. - * include/Makefile.in, testsuite/Makefile.in: Regenerate. - -2004-11-29 Kelley Cook - - * configure: Regenerate for libtool change. - -2004-11-25 Kelley Cook - - * configure: Regenerate for libtool reversion. - -2004-11-24 Kelley Cook - - * configure: Regenerate for libtool change. - -2004-11-23 John David Anglin - - * testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp. - -2004-11-23 Richard Sandiford - - * src/mips/o32.S (ffi_call_O32, ffi_closure_O32): Use jalr instead - of jal. Use an absolute encoding for the frame information. - -2004-11-23 Kelley Cook - - * Makefile.am: Remove no-dependencies. Add ACLOCAL_AMFLAGS. - * acinclude.m4: Delete logic for sincludes. - * aclocal.m4, Makefile.in, configure: Regenerate. - * include/Makefile: Likewise. - * testsuite/Makefile: Likewise. - -2004-11-22 Eric Botcazou - - * src/sparc/ffi.c (ffi_prep_closure): Align doubles and 64-bit integers - on a 8-byte boundary. - * src/sparc/v8.S (ffi_closure_v8): Reserve frame space for arguments. - -2004-10-27 Richard Earnshaw - - * src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return - long long values. Round stack allocation to a multiple of 8 bytes - for ATPCS compatibility. - * src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register - names. Handle returning long long types. Add Thumb and interworking - support. Improve soft-float code. - -2004-10-27 Richard Earnshaw - - * testsuite/lib/libffi-db.exp (load_gcc_lib): New function. - (libffi_exit): New function. - (libffi_init): Build the testglue wrapper if needed. - -2004-10-25 Eric Botcazou - - PR other/18138 - * testsuite/lib/libffi-dg.exp: Accept more than one multilib libgcc. - -2004-10-25 Kazuhiro Inaoka - - * src/m32r/libffitarget.h (FFI_CLOSURES): Set to 0. - -2004-10-20 Kaz Kojima - - * src/sh/sysv.S (ffi_call_SYSV): Don't align for double data. - * testsuite/libffi.call/float3.c: New test case. - -2004-10-18 Kaz Kojima - - * src/sh/ffi.c (ffi_prep_closure): Set T bit in trampoline for - the function returning a structure pointed with R2. - * src/sh/sysv.S (ffi_closure_SYSV): Use R2 as the pointer to - the structure return value if T bit set. Emit position - independent code and EH data if PIC. - -2004-10-13 Kazuhiro Inaoka - - * Makefile.am: Add m32r support. - * configure.ac: Likewise. - * Makefile.in: Regenerate. - * confiugre: Regenerate. - * src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF - (uint64, sint64, double, longdouble) - * src/m32r: New directory. - * src/m32r/ffi.c: New file. - * src/m32r/sysv.S: Likewise. - * src/m32r/ffitarget.h: Likewise. - -2004-10-02 Kaz Kojima - - * testsuite/libffi.call/negint.c: New test case. - -2004-09-14 H.J. Lu - - PR libgcj/17465 - * testsuite/lib/libffi-dg.exp: Don't use global ld_library_path. - Set up LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH, - LD_LIBRARY64_PATH, LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64 and - DYLD_LIBRARY_PATH. - -2004-09-05 Andreas Tobler - - * testsuite/libffi.call/many_win32.c: Remove whitespaces. - * testsuite/libffi.call/promotion.c: Likewise. - * testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup - whitespaces. - * testsuite/libffi.call/return_sc.c: Likewise. - * testsuite/libffi.call/return_uc.c: Likewise. - -2004-09-05 Andreas Tobler - - * src/powerpc/darwin.S: Fix comments and identation. - * src/powerpc/darwin_closure.S: Likewise. - -2004-09-02 Andreas Tobler - - * src/powerpc/ffi_darwin.c: Add flag for longdouble return values. - (ffi_prep_args): Handle longdouble arguments. - (ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for - longdouble. - (ffi_closure_helper_DARWIN): Add closure handling for longdouble. - * src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble - values. - * src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise. - * src/types.c: Defined longdouble size and alignment for darwin. - -2004-09-02 Andreas Tobler - - * src/powerpc/aix.S: Remove whitespaces. - * src/powerpc/aix_closure.S: Likewise. - * src/powerpc/asm.h: Likewise. - * src/powerpc/ffi.c: Likewise. - * src/powerpc/ffitarget.h: Likewise. - * src/powerpc/linux64.S: Likewise. - * src/powerpc/linux64_closure.S: Likewise. - * src/powerpc/ppc_closure.S: Likewise. - * src/powerpc/sysv.S: Likewise. - -2004-08-30 Anthony Green - - * Makefile.am: Add frv support. - * Makefile.in, testsuite/Makefile.in: Rebuilt. - * configure.ac: Read configure.host. - * configure.in: Read configure.host. - * configure.host: New file. frv-elf needs libgloss. - * include/ffi.h.in: Force ffi_closure to have a nice big (8) - alignment. This is needed to frv and shouldn't harm the others. - * include/ffi_common.h (ALIGN_DOWN): New macro. - * src/frv/ffi.c, src/frv/ffitarget.h, src/frv/eabi.S: New files. - -2004-08-24 David Daney - - * testsuite/libffi.call/closure_fn0.c: Xfail mips64* instead of mips*. - * testsuite/libffi.call/closure_fn1.c: Likewise. - * testsuite/libffi.call/closure_fn2.c Likewise. - * testsuite/libffi.call/closure_fn3.c: Likewise. - * testsuite/libffi.call/closure_fn4.c: Likewise. - * testsuite/libffi.call/closure_fn5.c: Likewise. - * testsuite/libffi.call/cls_18byte.c: Likewise. - * testsuite/libffi.call/cls_19byte.c: Likewise. - * testsuite/libffi.call/cls_1_1byte.c: Likewise. - * testsuite/libffi.call/cls_20byte.c: Likewise. - * testsuite/libffi.call/cls_20byte1.c: Likewise. - * testsuite/libffi.call/cls_24byte.c: Likewise. - * testsuite/libffi.call/cls_2byte.c: Likewise. - * testsuite/libffi.call/cls_3_1byte.c: Likewise. - * testsuite/libffi.call/cls_3byte1.c: Likewise. - * testsuite/libffi.call/cls_3byte2.c: Likewise. - * testsuite/libffi.call/cls_4_1byte.c: Likewise. - * testsuite/libffi.call/cls_4byte.c: Likewise. - * testsuite/libffi.call/cls_64byte.c: Likewise. - * testsuite/libffi.call/cls_6byte.c: Likewise. - * testsuite/libffi.call/cls_7byte.c: Likewise. - * testsuite/libffi.call/cls_8byte.c: Likewise. - * testsuite/libffi.call/cls_9byte1.c: Likewise. - * testsuite/libffi.call/cls_9byte2.c: Likewise. - * testsuite/libffi.call/cls_align_double.c: Likewise. - * testsuite/libffi.call/cls_align_float.c: Likewise. - * testsuite/libffi.call/cls_align_longdouble.c: Likewise. - * testsuite/libffi.call/cls_align_pointer.c: Likewise. - * testsuite/libffi.call/cls_align_sint16.c: Likewise. - * testsuite/libffi.call/cls_align_sint32.c: Likewise. - * testsuite/libffi.call/cls_align_sint64.c: Likewise. - * testsuite/libffi.call/cls_align_uint16.c: Likewise. - * testsuite/libffi.call/cls_align_uint32.c: Likewise. - * testsuite/libffi.call/cls_align_uint64.c: Likewise. - * testsuite/libffi.call/cls_double.c: Likewise. - * testsuite/libffi.call/cls_float.c: Likewise. - * testsuite/libffi.call/cls_multi_schar.c: Likewise. - * testsuite/libffi.call/cls_multi_sshort.c: Likewise. - * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. - * testsuite/libffi.call/cls_multi_uchar.c: Likewise. - * testsuite/libffi.call/cls_multi_ushort.c: Likewise. - * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. - * testsuite/libffi.call/cls_schar.c: Likewise. - * testsuite/libffi.call/cls_sint.c: Likewise. - * testsuite/libffi.call/cls_sshort.c: Likewise. - * testsuite/libffi.call/cls_uchar.c: Likewise. - * testsuite/libffi.call/cls_uint.c: Likewise. - * testsuite/libffi.call/cls_ulonglong.c: Likewise. - * testsuite/libffi.call/cls_ushort.c: Likewise. - * testsuite/libffi.call/nested_struct.c: Likewise. - * testsuite/libffi.call/nested_struct1.c: Likewise. - * testsuite/libffi.call/nested_struct2.c: Likewise. - * testsuite/libffi.call/nested_struct3.c: Likewise. - * testsuite/libffi.call/problem1.c: Likewise. - * testsuite/libffi.special/unwindtest.cc: Likewise. - * testsuite/libffi.call/cls_12byte.c: Likewise and set return value - to zero. - * testsuite/libffi.call/cls_16byte.c: Likewise. - * testsuite/libffi.call/cls_5byte.c: Likewise. - -2004-08-23 David Daney - - PR libgcj/13141 - * src/mips/ffitarget.h (FFI_O32_SOFT_FLOAT): New ABI. - * src/mips/ffi.c (ffi_prep_args): Fix alignment calculation. - (ffi_prep_cif_machdep): Handle FFI_O32_SOFT_FLOAT floating point - parameters and return types. - (ffi_call): Handle FFI_O32_SOFT_FLOAT ABI. - (ffi_prep_closure): Ditto. - (ffi_closure_mips_inner_O32): Handle FFI_O32_SOFT_FLOAT ABI, fix - alignment calculations. - * src/mips/o32.S (ffi_closure_O32): Don't use floating point - instructions if FFI_O32_SOFT_FLOAT, make stack frame ABI compliant. - -2004-08-14 Casey Marshall - - * src/mips/ffi.c (ffi_pref_cif_machdep): set `cif->flags' to - contain `FFI_TYPE_UINT64' as return type for any 64-bit - integer (O32 ABI only). - (ffi_prep_closure): new function. - (ffi_closure_mips_inner_O32): new function. - * src/mips/ffitarget.h: Define `FFI_CLOSURES' and - `FFI_TRAMPOLINE_SIZE' appropriately if the ABI is o32. - * src/mips/o32.S (ffi_call_O32): add labels for .eh_frame. Return - 64 bit integers correctly. - (ffi_closure_O32): new function. - Added DWARF-2 unwind info for both functions. - -2004-08-10 Andrew Haley - - * src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments. - -2004-08-01 Robert Millan - - * configure.ac: Detect knetbsd-gnu and kfreebsd-gnu. - * configure: Regenerate. - -2004-07-30 Maciej W. Rozycki - - * acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for - and mmap() explicitly instead of relying on preset autoconf cache - variables. - * aclocal.m4: Regenerate. - * configure: Regenerate. - -2004-07-11 Ulrich Weigand - - * src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation. - (ffi_check_float_struct): Remove unused prototype. - -2004-06-30 Geoffrey Keating - - * src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment - character on Darwin, use '\n\t' instead. - -2004-06-26 Matthias Klose - - * libtool-version: Fix typo in revision/age. - -2004-06-17 Matthias Klose - - * libtool-version: New. - * Makefile.am (libffi_la_LDFLAGS): Use -version-info for soname. - * Makefile.in: Regenerate. - -2004-06-15 Paolo Bonzini - - * Makefile.am: Remove useless multilib rules. - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate with automake 1.8.5. - * configure.ac: Remove useless multilib configury. - * configure: Regenerate. - -2004-06-15 Paolo Bonzini - - * .cvsignore: New file. - -2004-06-10 Jakub Jelinek - - * src/ia64/unix.S (ffi_call_unix): Insert group barrier break - fp_done. - (ffi_closure_UNIX): Fix f14/f15 adjustment if FLOAT_SZ is ever - changed from 8. - -2004-06-06 Sean McNeil - - * configure.ac: Add x86_64-*-freebsd* support. - * configure: Regenerate. - -2004-04-26 Joe Buck - - Bug 15093 - * configure.ac: Test for existence of mmap and sys/mman.h before - checking blacklist. Fix suggested by Jim Wilson. - * configure: Regenerate. - -2004-04-26 Matt Austern - - * src/powerpc/darwin.S: Go through a non-lazy pointer for initial - FDE location. - * src/powerpc/darwin_closure.S: Likewise. - -2004-04-24 Andreas Tobler - - * testsuite/libffi.call/cls_multi_schar.c (main): Fix initialization - error. Reported by Thomas Heller . - * testsuite/libffi.call/cls_multi_sshort.c (main): Likewise. - * testsuite/libffi.call/cls_multi_ushort.c (main): Likewise. - -2004-03-20 Matthias Klose - - * src/pa/linux.S: Fix typo. - -2004-03-19 Matthias Klose - - * Makefile.am: Update. - * Makefile.in: Regenerate. - * src/pa/ffi.h.in: Remove. - * src/pa/ffitarget.h: New file. - -2004-02-10 Randolph Chung - - * Makefile.am: Add PA support. - * Makefile.in: Regenerate. - * include/Makefile.in: Regenerate. - * configure.ac: Add PA target. - * configure: Regenerate. - * src/pa/ffi.c: New file. - * src/pa/ffi.h.in: Add PA support. - * src/pa/linux.S: New file. - * prep_cif.c: Add PA support. - -2004-03-16 Hosaka Yuji - - * src/types.c: Fix alignment size of X86_WIN32 case int64 and - double. - * src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type - with ecif->cif->flags. - (ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type - with cif->flags. - (ffi_prep_cif_machdep): Add X86_WIN32 struct case. - (ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32. - * src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b, - sc_retstruct2b): Add for 1 or 2-bytes struct case. - -2004-03-15 Kelley Cook - - * configure.in: Rename file to ... - * configure.ac: ... this. - * fficonfig.h.in: Regenerate. - * Makefile.in: Regenerate. - * include/Makefile.in: Regenerate. - * testsuite/Makefile.in: Regenerate. - -2004-03-12 Matt Austern - - * src/powerpc/darwin.S: Fix EH information so it corresponds to - changes in EH format resulting from addition of linkonce support. - * src/powerpc/darwin_closure.S: Likewise. - -2004-03-11 Andreas Tobler - Paolo Bonzini - - * Makefile.am (AUTOMAKE_OPTIONS): Set them. - Remove VPATH. Remove rules for object files. Remove multilib support. - (AM_CCASFLAGS): Add. - * configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER. - (AC_PREREQ): Bump version to 2.59. - (AC_INIT): Fill with version info and bug address. - (ORIGINAL_LD_FOR_MULTILIBS): Remove. - (AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE. - De-precious CC so that the right flags are passed down to multilibs. - (AC_MSG_ERROR): Replace obsolete macro AC_ERROR. - (AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES. - (AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS. - * configure: Rebuilt. - * aclocal.m4: Likewise. - * Makefile.in, include/Makefile.in, testsuite/Makefile.in: Likewise. - * fficonfig.h.in: Likewise. - -2004-03-11 Andreas Schwab - - * src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point - arguments from fp registers only for the first 8 parameter slots. - Don't convert a float parameter when passed in memory. - -2004-03-09 Hans-Peter Nilsson - - * configure: Regenerate for config/accross.m4 correction. - -2004-02-25 Matt Kraai - - * src/powerpc/ffi.c (ffi_prep_args_SYSV): Change - ecif->cif->bytes to bytes. - (ffi_prep_cif_machdep): Add braces around nested if statement. - -2004-02-09 Alan Modra - - * src/types.c (pointer): POWERPC64 has 8 byte pointers. - - * src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling. - (ffi_closure_helper_LINUX64): Fix typo. - * testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128 - for powerpc64-*-*. - * testsuite/libffi.call/float.c: Likewise. - * testsuite/libffi.call/float2.c: Likewise. - -2004-02-08 Alan Modra - - * src/powerpc/ffi.c (ffi_prep_cif_machdep ): Correct - long double function return and long double arg handling. - (ffi_closure_helper_LINUX64): Formatting. Delete unused "ng" var. - Use "end_pfr" instead of "nf". Correct long double handling. - Localise "temp". - * src/powerpc/linux64.S (ffi_call_LINUX64): Save f2 long double - return value. - * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Allocate - space for long double return value. Adjust stack frame and offsets. - Load f2 long double return. - -2004-02-07 Alan Modra - - * src/types.c: Use 16 byte long double for POWERPC64. - -2004-01-25 Eric Botcazou - - * src/sparc/ffi.c (ffi_prep_args_v9): Shift the parameter array - when the structure return address is passed in %o0. - (ffi_V9_return_struct): Rename into ffi_v9_layout_struct. - (ffi_v9_layout_struct): Align the field following a nested structure - on a word boundary. Use memmove instead of memcpy. - (ffi_call): Update call to ffi_V9_return_struct. - (ffi_prep_closure): Define 'ctx' only for V8. - (ffi_closure_sparc_inner): Clone into ffi_closure_sparc_inner_v8 - and ffi_closure_sparc_inner_v9. - (ffi_closure_sparc_inner_v8): Return long doubles by reference. - Always skip the structure return address. For structures and long - doubles, copy the argument directly. - (ffi_closure_sparc_inner_v9): Skip the structure return address only - if required. Shift the maximum floating-point slot accordingly. For - big structures, copy the argument directly; otherwise, left-justify the - argument and call ffi_v9_layout_struct to lay out the structure on - the stack. - * src/sparc/v8.S: Undef STACKFRAME before defining it. - (ffi_closure_v8): Pass the structure return address. Update call to - ffi_closure_sparc_inner_v8. Short-circuit FFI_TYPE_INT handling. - Skip the 'unimp' insn when returning long doubles and structures. - * src/sparc/v9.S: Undef STACKFRAME before defining it. - (ffi_closure_v9): Increase the frame size by 2 words. Short-circuit - FFI_TYPE_INT handling. Load structures both in integers and - floating-point registers on return. - * README: Update status of the SPARC port. - -2004-01-24 Andreas Tobler - - * testsuite/libffi.call/pyobjc-tc.c (main): Treat result value - as of type ffi_arg. - * testsuite/libffi.call/struct3.c (main): Fix CHECK. - -2004-01-22 Ulrich Weigand - - * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result - value as of type ffi_arg, not unsigned int. - -2004-01-21 Michael Ritzert - - * ffi64.c (ffi_prep_args): Cast the RHS of an assignment instead - of the LHS. - -2004-01-12 Andreas Tobler - - * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_32 for - Solaris. - -2004-01-08 Rainer Orth - - * testsuite/libffi.call/ffitest.h (allocate_mmap): Cast MAP_FAILED - to void *. - -2003-12-10 Richard Henderson - - * testsuite/libffi.call/cls_align_pointer.c: Cast pointers to - size_t instead of int. - -2003-12-04 Hosaka Yuji - - * testsuite/libffi.call/many_win32.c: Include . - * testsuite/libffi.call/many_win32.c (main): Replace variable - int i with unsigned long ul. - - * testsuite/libffi.call/cls_align_uint64.c: New test case. - * testsuite/libffi.call/cls_align_sint64.c: Likewise. - * testsuite/libffi.call/cls_align_uint32.c: Likewise. - * testsuite/libffi.call/cls_align_sint32.c: Likewise. - * testsuite/libffi.call/cls_align_uint16.c: Likewise. - * testsuite/libffi.call/cls_align_sint16.c: Likewise. - * testsuite/libffi.call/cls_align_float.c: Likewise. - * testsuite/libffi.call/cls_align_double.c: Likewise. - * testsuite/libffi.call/cls_align_longdouble.c: Likewise. - * testsuite/libffi.call/cls_align_pointer.c: Likewise. - -2003-12-02 Hosaka Yuji - - PR other/13221 - * src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): - Align arguments to 32 bits. - -2003-12-01 Andreas Tobler - - PR other/13221 - * testsuite/libffi.call/cls_multi_sshort.c: New test case. - * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. - * testsuite/libffi.call/cls_multi_uchar.c: Likewise. - * testsuite/libffi.call/cls_multi_schar.c: Likewise. - * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. - * testsuite/libffi.call/cls_multi_ushort.c: Likewise. - - * testsuite/libffi.special/unwindtest.cc: Cosmetics. - -2003-11-26 Kaveh R. Ghazi - - * testsuite/libffi.call/ffitest.h: Include . - * testsuite/libffi.special/ffitestcxx.h: Likewise. - -2003-11-22 Andreas Tobler - - * Makefile.in: Rebuilt. - * configure: Likewise. - * testsuite/libffi.special/unwindtest.cc: Convert the mmap to - the right type. - -2003-11-21 Andreas Jaeger - Andreas Tobler - - * acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST. - * configure.in: Call AC_FUNC_MMAP_BLACKLIST. - * Makefile.in: Rebuilt. - * aclocal.m4: Likewise. - * configure: Likewise. - * fficonfig.h.in: Likewise. - * testsuite/lib/libffi-dg.exp: Add include dir. - * testsuite/libffi.call/ffitest.h: Add MMAP definitions. - * testsuite/libffi.special/ffitestcxx.h: Likewise. - * testsuite/libffi.call/closure_fn0.c: Use MMAP functionality - for ffi_closure if available. - * testsuite/libffi.call/closure_fn1.c: Likewise. - * testsuite/libffi.call/closure_fn2.c: Likewise. - * testsuite/libffi.call/closure_fn3.c: Likewise. - * testsuite/libffi.call/closure_fn4.c: Likewise. - * testsuite/libffi.call/closure_fn5.c: Likewise. - * testsuite/libffi.call/cls_12byte.c: Likewise. - * testsuite/libffi.call/cls_16byte.c: Likewise. - * testsuite/libffi.call/cls_18byte.c: Likewise. - * testsuite/libffi.call/cls_19byte.c: Likewise. - * testsuite/libffi.call/cls_1_1byte.c: Likewise. - * testsuite/libffi.call/cls_20byte.c: Likewise. - * testsuite/libffi.call/cls_20byte1.c: Likewise. - * testsuite/libffi.call/cls_24byte.c: Likewise. - * testsuite/libffi.call/cls_2byte.c: Likewise. - * testsuite/libffi.call/cls_3_1byte.c: Likewise. - * testsuite/libffi.call/cls_3byte1.c: Likewise. - * testsuite/libffi.call/cls_3byte2.c: Likewise. - * testsuite/libffi.call/cls_4_1byte.c: Likewise. - * testsuite/libffi.call/cls_4byte.c: Likewise. - * testsuite/libffi.call/cls_5byte.c: Likewise. - * testsuite/libffi.call/cls_64byte.c: Likewise. - * testsuite/libffi.call/cls_6byte.c: Likewise. - * testsuite/libffi.call/cls_7byte.c: Likewise. - * testsuite/libffi.call/cls_8byte.c: Likewise. - * testsuite/libffi.call/cls_9byte1.c: Likewise. - * testsuite/libffi.call/cls_9byte2.c: Likewise. - * testsuite/libffi.call/cls_double.c: Likewise. - * testsuite/libffi.call/cls_float.c: Likewise. - * testsuite/libffi.call/cls_schar.c: Likewise. - * testsuite/libffi.call/cls_sint.c: Likewise. - * testsuite/libffi.call/cls_sshort.c: Likewise. - * testsuite/libffi.call/cls_uchar.c: Likewise. - * testsuite/libffi.call/cls_uint.c: Likewise. - * testsuite/libffi.call/cls_ulonglong.c: Likewise. - * testsuite/libffi.call/cls_ushort.c: Likewise. - * testsuite/libffi.call/nested_struct.c: Likewise. - * testsuite/libffi.call/nested_struct1.c: Likewise. - * testsuite/libffi.call/nested_struct2.c: Likewise. - * testsuite/libffi.call/nested_struct3.c: Likewise. - * testsuite/libffi.call/problem1.c: Likewise. - * testsuite/libffi.special/unwindtest.cc: Likewise. - -2003-11-20 Andreas Tobler - - * testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional. - -2003-11-19 Andreas Tobler - - * testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin. - Add -lgcc_s to additional flags. - -2003-11-12 Andreas Tobler - - * configure.in, include/Makefile.am: PR libgcj/11147, install - the ffitarget.h header file in a gcc versioned and target - dependent place. - * configure: Regenerated. - * Makefile.in, include/Makefile.in: Likewise. - * testsuite/Makefile.in: Likewise. - -2003-11-09 Andreas Tobler - - * testsuite/libffi.call/closure_fn0.c: Print result and check - with dg-output to make debugging easier. - * testsuite/libffi.call/closure_fn1.c: Likewise. - * testsuite/libffi.call/closure_fn2.c: Likewise. - * testsuite/libffi.call/closure_fn3.c: Likewise. - * testsuite/libffi.call/closure_fn4.c: Likewise. - * testsuite/libffi.call/closure_fn5.c: Likewise. - * testsuite/libffi.call/cls_12byte.c: Likewise. - * testsuite/libffi.call/cls_16byte.c: Likewise. - * testsuite/libffi.call/cls_18byte.c: Likewise. - * testsuite/libffi.call/cls_19byte.c: Likewise. - * testsuite/libffi.call/cls_1_1byte.c: Likewise. - * testsuite/libffi.call/cls_20byte.c: Likewise. - * testsuite/libffi.call/cls_20byte1.c: Likewise. - * testsuite/libffi.call/cls_24byte.c: Likewise. - * testsuite/libffi.call/cls_2byte.c: Likewise. - * testsuite/libffi.call/cls_3_1byte.c: Likewise. - * testsuite/libffi.call/cls_3byte1.c: Likewise. - * testsuite/libffi.call/cls_3byte2.c: Likewise. - * testsuite/libffi.call/cls_4_1byte.c: Likewise. - * testsuite/libffi.call/cls_4byte.c: Likewise. - * testsuite/libffi.call/cls_5byte.c: Likewise. - * testsuite/libffi.call/cls_64byte.c: Likewise. - * testsuite/libffi.call/cls_6byte.c: Likewise. - * testsuite/libffi.call/cls_7byte.c: Likewise. - * testsuite/libffi.call/cls_8byte.c: Likewise. - * testsuite/libffi.call/cls_9byte1.c: Likewise. - * testsuite/libffi.call/cls_9byte2.c: Likewise. - * testsuite/libffi.call/cls_double.c: Likewise. - * testsuite/libffi.call/cls_float.c: Likewise. - * testsuite/libffi.call/cls_schar.c: Likewise. - * testsuite/libffi.call/cls_sint.c: Likewise. - * testsuite/libffi.call/cls_sshort.c: Likewise. - * testsuite/libffi.call/cls_uchar.c: Likewise. - * testsuite/libffi.call/cls_uint.c: Likewise. - * testsuite/libffi.call/cls_ulonglong.c: Likewise. - * testsuite/libffi.call/cls_ushort.c: Likewise. - * testsuite/libffi.call/problem1.c: Likewise. - - * testsuite/libffi.special/unwindtest.cc: Make ffi_closure - static. - -2003-11-08 Andreas Tobler - - * testsuite/libffi.call/cls_9byte2.c: New test case. - * testsuite/libffi.call/cls_9byte1.c: Likewise. - * testsuite/libffi.call/cls_64byte.c: Likewise. - * testsuite/libffi.call/cls_20byte1.c: Likewise. - * testsuite/libffi.call/cls_19byte.c: Likewise. - * testsuite/libffi.call/cls_18byte.c: Likewise. - * testsuite/libffi.call/closure_fn4.c: Likewise. - * testsuite/libffi.call/closure_fn5.c: Likewise. - * testsuite/libffi.call/cls_schar.c: Likewise. - * testsuite/libffi.call/cls_sint.c: Likewise. - * testsuite/libffi.call/cls_sshort.c: Likewise. - * testsuite/libffi.call/nested_struct2.c: Likewise. - * testsuite/libffi.call/nested_struct3.c: Likewise. - -2003-11-08 Andreas Tobler - - * testsuite/libffi.call/cls_double.c: Do a check on the result. - * testsuite/libffi.call/cls_uchar.c: Likewise. - * testsuite/libffi.call/cls_uint.c: Likewise. - * testsuite/libffi.call/cls_ulonglong.c: Likewise. - * testsuite/libffi.call/cls_ushort.c: Likewise. - * testsuite/libffi.call/return_sc.c: Cleanup whitespaces. - -2003-11-06 Andreas Tobler - - * src/prep_cif.c (ffi_prep_cif): Move the validity check after - the initialization. - -2003-10-23 Andreas Tobler - - * src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace - FFI_ASSERT(FALSE) with FFI_ASSERT(0). - -2003-10-22 David Daney - - * src/mips/ffitarget.h: Replace undefined UINT32 and friends with - __attribute__((__mode__(__SI__))) and friends. - -2003-10-22 Andreas Schwab - - * src/ia64/ffi.c: Replace FALSE/TRUE with false/true. - -2003-10-21 Andreas Tobler - - * configure.in: AC_LINK_FILES(ffitarget.h). - * configure: Regenerate. - * Makefile.in: Likewise. - * include/Makefile.in: Likewise. - * testsuite/Makefile.in: Likewise. - * fficonfig.h.in: Likewise. - -2003-10-21 Paolo Bonzini - Richard Henderson - - Avoid that ffi.h includes fficonfig.h. - - * Makefile.am (EXTRA_DIST): Include ffitarget.h files - (TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. - (TARGET_SRC_MIPS_SGI): Removed. - (MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. - (MIPS_SGI): Removed. - (CLEANFILES): Removed. - (mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New - targets. - * acconfig.h: Removed. - * configure.in: Compute sizeofs only for double and long double. - Use them to define and subst HAVE_LONG_DOUBLE. Include comments - into AC_DEFINE instead of using acconfig.h. Create - include/ffitarget.h instead of include/fficonfig.h. Rename - MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree. - AC_DEFINE EH_FRAME_FLAGS. - * include/Makefile.am (DISTCLEANFILES): New automake macro. - (hack_DATA): Add ffitarget.h. - * include/ffi.h.in: Remove all system specific definitions. - Declare raw API even if it is not installed, why bother? - Use limits.h instead of SIZEOF_* to define ffi_type_*. Do - not define EH_FRAME_FLAGS, it is in fficonfig.h now. Include - ffitarget.h instead of fficonfig.h. Remove ALIGN macro. - (UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead. - * include/ffi_common.h (bool): Do not define. - (ffi_assert): Accept failed assertion. - (ffi_type_test): Return void and accept file/line. - (FFI_ASSERT): Pass stringized failed assertion. - (FFI_ASSERT_AT): New macro. - (FFI_ASSERT_VALID_TYPE): New macro. - (UINT8, SINT8, UINT16, SINT16, UINT32, SINT32, - UINT64, SINT64): Define here with gcc's __attribute__ macro - instead of in ffi.h - (FLOAT32, ALIGN): Define here instead of in ffi.h - * include/ffi-mips.h: Removed. Its content moved to - src/mips/ffitarget.h after separating assembly and C sections. - * src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c - src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c, - src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S, - src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c: - SIZEOF_ARG -> FFI_SIZEOF_ARG. - * src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+). - * src/debug.c (ffi_assert): Accept stringized failed assertion. - (ffi_type_test): Rewritten. - * src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call - FFI_ASSERT_VALID_TYPE. - * src/alpha/ffitarget.h, src/arm/ffitarget.h, - src/ia64/ffitarget.h, src/m68k/ffitarget.h, - src/mips/ffitarget.h, src/powerpc/ffitarget.h, - src/s390/ffitarget.h, src/sh/ffitarget.h, - src/sh64/ffitarget.h, src/sparc/ffitarget.h, - src/x86/ffitarget.h: New files. - * src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S, - src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S, - src/powerpc/aix.S, src/powerpc/darwin.S, - src/powerpc/ffi_darwin.c, src/powerpc/linux64.S, - src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S, - src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S, - src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S, - src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S: - include fficonfig.h - -2003-10-20 Rainer Orth - - * src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external - _MIPS_SIM_NABI32, _MIPS_SIM_ABI32. - -2003-10-19 Andreas Tobler - - * src/powerpc/ffi_darwin.c (ffi_prep_args): Declare bytes again. - Used when FFI_DEBUG = 1. - -2003-10-14 Alan Modra - - * src/types.c (double, longdouble): Default POWERPC64 to 8 byte size - and align. - -2003-10-06 Rainer Orth - - * include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs, - FFI_MIPS_O32 for O32 ABI. - -2003-10-01 Andreas Tobler - - * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for - SPARC64. Cleanup whitespaces. - -2003-09-19 Andreas Tobler - - * testsuite/libffi.call/closure_fn0.c: Xfail mips, arm, - strongarm, xscale. Cleanup whitespaces. - * testsuite/libffi.call/closure_fn1.c: Likewise. - * testsuite/libffi.call/closure_fn2.c: Likewise. - * testsuite/libffi.call/closure_fn3.c: Likewise. - * testsuite/libffi.call/cls_12byte.c: Likewise. - * testsuite/libffi.call/cls_16byte.c: Likewise. - * testsuite/libffi.call/cls_1_1byte.c: Likewise. - * testsuite/libffi.call/cls_20byte.c: Likewise. - * testsuite/libffi.call/cls_24byte.c: Likewise. - * testsuite/libffi.call/cls_2byte.c: Likewise. - * testsuite/libffi.call/cls_3_1byte.c: Likewise. - * testsuite/libffi.call/cls_3byte1.c: Likewise. - * testsuite/libffi.call/cls_3byte2.c: Likewise. - * testsuite/libffi.call/cls_4_1byte.c: Likewise. - * testsuite/libffi.call/cls_4byte.c: Likewise. - * testsuite/libffi.call/cls_5byte.c: Likewise. - * testsuite/libffi.call/cls_6byte.c: Likewise. - * testsuite/libffi.call/cls_7byte.c: Likewise. - * testsuite/libffi.call/cls_8byte.c: Likewise. - * testsuite/libffi.call/cls_double.c: Likewise. - * testsuite/libffi.call/cls_float.c: Likewise. - * testsuite/libffi.call/cls_uchar.c: Likewise. - * testsuite/libffi.call/cls_uint.c: Likewise. - * testsuite/libffi.call/cls_ulonglong.c: Likewise. - * testsuite/libffi.call/cls_ushort.c: Likewise. - * testsuite/libffi.call/nested_struct.c: Likewise. - * testsuite/libffi.call/nested_struct1.c: Likewise. - * testsuite/libffi.call/problem1.c: Likewise. - * testsuite/libffi.special/unwindtest.cc: Likewise. - * testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces. - -2003-09-18 David Edelsohn - - * src/powerpc/aix.S: Cleanup whitespaces. - * src/powerpc/aix_closure.S: Likewise. - -2003-09-18 Andreas Tobler - - * src/powerpc/darwin.S: Cleanup whitespaces, comment formatting. - * src/powerpc/darwin_closure.S: Likewise. - * src/powerpc/ffi_darwin.c: Likewise. - -2003-09-18 Andreas Tobler - David Edelsohn - - * src/types.c (double): Add AIX and Darwin to the right TYPEDEF. - * src/powerpc/aix_closure.S: Remove the pointer to the outgoing - parameter stack. - * src/powerpc/darwin_closure.S: Likewise. - * src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures - according to the Darwin/AIX ABI. - (ffi_prep_cif_machdep): Likewise. - (ffi_closure_helper_DARWIN): Likewise. - Remove the outgoing parameter stack logic. Simplify the evaluation - of the different CASE types. - (ffi_prep_clousure): Avoid the casts on lvalues. Change the branch - statement in the trampoline code. - -2003-09-18 Kaz Kojima - - * src/sh/ffi.c (ffi_prep_args): Take account into the alignement - for the register size. - (ffi_closure_helper_SYSV): Handle the structure return value - address correctly. - (ffi_closure_helper_SYSV): Return the appropriate type when - the registers are used for the structure return value. - * src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for - the 64-bit return value. Update copyright years. - -2003-09-17 Rainer Orth - - * testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in - srcdir for ffi_mips.h. - -2003-09-12 Alan Modra - - * src/prep_cif.c (initialize_aggregate): Include tail padding in - structure size. - * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct - placement of float result. - * testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct - cast of "resp" for big-endian 64 bit machines. - -2003-09-11 Alan Modra - - * src/types.c (double, longdouble): Merge identical SH and ARM - typedefs, and add POWERPC64. - * src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for - struct split over gpr and rest. - (ffi_prep_cif_machdep): Correct intarg_count for structures. - * src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets. - -2003-09-09 Andreas Tobler - - * src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct - passing correctly. - -2003-09-09 Alan Modra - - * configure: Regenerate. - -2003-09-04 Andreas Tobler - - * Makefile.am: Remove build rules for ffitest. - * Makefile.in: Rebuilt. - -2003-09-04 Andreas Tobler - - * src/java_raw_api.c: Include to fix compiler warning - about implicit declaration of abort(). - -2003-09-04 Andreas Tobler - - * Makefile.am: Add dejagnu test framework. Fixes PR other/11411. - * Makefile.in: Rebuilt. - * configure.in: Add dejagnu test framework. - * configure: Rebuilt. - - * testsuite/Makefile.am: New file. - * testsuite/Makefile.in: Built - * testsuite/lib/libffi-dg.exp: New file. - * testsuite/config/default.exp: Likewise. - * testsuite/libffi.call/call.exp: Likewise. - * testsuite/libffi.call/ffitest.h: Likewise. - * testsuite/libffi.call/closure_fn0.c: Likewise. - * testsuite/libffi.call/closure_fn1.c: Likewise. - * testsuite/libffi.call/closure_fn2.c: Likewise. - * testsuite/libffi.call/closure_fn3.c: Likewise. - * testsuite/libffi.call/cls_1_1byte.c: Likewise. - * testsuite/libffi.call/cls_3_1byte.c: Likewise. - * testsuite/libffi.call/cls_4_1byte.c: Likewise. - * testsuite/libffi.call/cls_2byte.c: Likewise. - * testsuite/libffi.call/cls_3byte1.c: Likewise. - * testsuite/libffi.call/cls_3byte2.c: Likewise. - * testsuite/libffi.call/cls_4byte.c: Likewise. - * testsuite/libffi.call/cls_5byte.c: Likewise. - * testsuite/libffi.call/cls_6byte.c: Likewise. - * testsuite/libffi.call/cls_7byte.c: Likewise. - * testsuite/libffi.call/cls_8byte.c: Likewise. - * testsuite/libffi.call/cls_12byte.c: Likewise. - * testsuite/libffi.call/cls_16byte.c: Likewise. - * testsuite/libffi.call/cls_20byte.c: Likewise. - * testsuite/libffi.call/cls_24byte.c: Likewise. - * testsuite/libffi.call/cls_double.c: Likewise. - * testsuite/libffi.call/cls_float.c: Likewise. - * testsuite/libffi.call/cls_uchar.c: Likewise. - * testsuite/libffi.call/cls_uint.c: Likewise. - * testsuite/libffi.call/cls_ulonglong.c: Likewise. - * testsuite/libffi.call/cls_ushort.c: Likewise. - * testsuite/libffi.call/float.c: Likewise. - * testsuite/libffi.call/float1.c: Likewise. - * testsuite/libffi.call/float2.c: Likewise. - * testsuite/libffi.call/many.c: Likewise. - * testsuite/libffi.call/many_win32.c: Likewise. - * testsuite/libffi.call/nested_struct.c: Likewise. - * testsuite/libffi.call/nested_struct1.c: Likewise. - * testsuite/libffi.call/pyobjc-tc.c: Likewise. - * testsuite/libffi.call/problem1.c: Likewise. - * testsuite/libffi.call/promotion.c: Likewise. - * testsuite/libffi.call/return_ll.c: Likewise. - * testsuite/libffi.call/return_sc.c: Likewise. - * testsuite/libffi.call/return_uc.c: Likewise. - * testsuite/libffi.call/strlen.c: Likewise. - * testsuite/libffi.call/strlen_win32.c: Likewise. - * testsuite/libffi.call/struct1.c: Likewise. - * testsuite/libffi.call/struct2.c: Likewise. - * testsuite/libffi.call/struct3.c: Likewise. - * testsuite/libffi.call/struct4.c: Likewise. - * testsuite/libffi.call/struct5.c: Likewise. - * testsuite/libffi.call/struct6.c: Likewise. - * testsuite/libffi.call/struct7.c: Likewise. - * testsuite/libffi.call/struct8.c: Likewise. - * testsuite/libffi.call/struct9.c: Likewise. - * testsuite/libffi.special/special.exp: New file. - * testsuite/libffi.special/ffitestcxx.h: Likewise. - * testsuite/libffi.special/unwindtest.cc: Likewise. - - -2003-08-13 Kaz Kojima - - * src/sh/ffi.c (OFS_INT16): Set 0 for little endian case. Update - copyright years. - -2003-08-02 Alan Modra - - * src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc - structure passing. - (ffi_closure_helper_LINUX64): Likewise. - * src/powerpc/linux64.S: Remove code writing to parm save area. - * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return - address in lr from ffi_closure_helper_LINUX64 call to calculate - table address. Optimize function tail. - -2003-07-28 Andreas Tobler - - * src/sparc/ffi.c: Handle all floating point registers. - * src/sparc/v9.S: Likewise. Fixes second part of PR target/11410. - -2003-07-11 Gerald Pfeifer - - * README: Note that libffi is not part of GCC. Update the project - URL and status. - -2003-06-19 Franz Sirl - - * src/powerpc/ppc_closure.S: Include ffi.h. - -2003-06-13 Rainer Orth - - * src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives. - Use C style comments. - -2003-06-13 Kaz Kojima - - * Makefile.am: Add SHmedia support. Fix a typo of SH support. - * Makefile.in: Regenerate. - * configure.in (sh64-*-linux*, sh5*-*-linux*): Add target. - * configure: Regenerate. - * include/ffi.h.in: Add SHmedia support. - * src/sh64/ffi.c: New file. - * src/sh64/sysv.S: New file. - -2003-05-16 Jakub Jelinek - - * configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section - should be read-only. - * configure: Rebuilt. - * fficonfig.h.in: Rebuilt. - * include/ffi.h.in (EH_FRAME_FLAGS): Define. - * src/alpha/osf.S: Use EH_FRAME_FLAGS. - * src/powerpc/linux64.S: Likewise. - * src/powerpc/linux64_closure.S: Likewise. Include ffi.h. - * src/powerpc/sysv.S: Use EH_FRAME_FLAGS. Use pcrel encoding - if -fpic/-fPIC/-mrelocatable. - * src/powerpc/powerpc_closure.S: Likewise. - * src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include - #write in .eh_frame flags. - * src/sparc/v9.S: Likewise. - * src/x86/unix64.S: Use EH_FRAME_FLAGS. - * src/x86/sysv.S: Likewise. Use pcrel encoding if -fpic/-fPIC. - * src/s390/sysv.S: Use EH_FRAME_FLAGS. Include ffi.h. - -2003-05-07 Jeff Sturm - - Fixes PR bootstrap/10656 - * configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler - support for .register pseudo-op. - * src/sparc/v8.S: Use it. - * fficonfig.h.in: Rebuilt. - * configure: Rebuilt. - -2003-04-18 Jakub Jelinek - - * include/ffi.h.in (POWERPC64): Define if 64-bit. - (enum ffi_abi): Add FFI_LINUX64 on POWERPC. - Make it the default on POWERPC64. - (FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64. - * configure.in: Change powerpc-*-linux* into powerpc*-*-linux*. - * configure: Rebuilt. - * src/powerpc/ffi.c (hidden): Define. - (ffi_prep_args_SYSV): Renamed from - ffi_prep_args. Cast pointers to unsigned long to shut up warnings. - (NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64, - ASM_NEEDS_REGISTERS64): New. - (ffi_prep_args64): New function. - (ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI. - (ffi_call): Likewise. - (ffi_prep_closure): Likewise. - (flush_icache): Surround by #ifndef POWERPC64. - (ffi_dblfl): New union type. - (ffi_closure_helper_SYSV): Use it to avoid aliasing problems. - (ffi_closure_helper_LINUX64): New function. - * src/powerpc/ppc_closure.S: Surround whole file by #ifndef - __powerpc64__. - * src/powerpc/sysv.S: Likewise. - (ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV. - * src/powerpc/linux64.S: New file. - * src/powerpc/linux64_closure.S: New file. - * Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and - src/powerpc/linux64_closure.S. - (TARGET_SRC_POWERPC): Likewise. - - * src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2, - closure_test_fn3): Fix result printing on big-endian 64-bit - machines. - (main): Print tst2_arg instead of uninitialized tst2_result. - - * src/ffitest.c (main): Hide what closure pointer really points to - from the compiler. - -2003-04-16 Richard Earnshaw - - * configure.in (arm-*-netbsdelf*): Add configuration. - (configure): Regenerated. - -2003-04-04 Loren J. Rittle - - * include/Makefile.in: Regenerate. - -2003-03-21 Zdenek Dvorak - - * libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32 - bit mode. - * libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): - Receive closure pointer through parameter, read args using - __builtin_dwarf_cfa. - (FFI_INIT_TRAMPOLINE): Send closure reference through eax. - -2003-03-12 Andreas Schwab - - * configure.in: Avoid trailing /. in toolexeclibdir. - * configure: Rebuilt. - -2003-03-03 Andreas Tobler - - * src/powerpc/darwin_closure.S: Recode to fit dynamic libraries. - -2003-02-06 Andreas Tobler - - * libffi/src/powerpc/darwin_closure.S: - Fix alignement bug, allocate 8 bytes for the result. - * libffi/src/powerpc/aix_closure.S: - Likewise. - * libffi/src/powerpc/ffi_darwin.c: - Update stackframe description for aix/darwin_closure.S. - -2003-02-06 Jakub Jelinek - - * src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility - attribute. - -2003-01-31 Christian Cornelssen , - Andreas Schwab - - * configure.in: Adjust command to source config-ml.in to account - for changes to the libffi_basedir definition. - (libffi_basedir): Remove ${srcdir} from value and include trailing - slash if nonempty. - - * configure: Regenerate. - -2003-01-29 Franz Sirl - - * src/powerpc/ppc_closure.S: Recode to fit shared libs. - -2003-01-28 Andrew Haley - - * include/ffi.h.in: Enable FFI_CLOSURES for x86_64. - * src/x86/ffi64.c (ffi_prep_closure): New. - (ffi_closure_UNIX64_inner): New. - * src/x86/unix64.S (ffi_closure_UNIX64): New. - -2003-01-27 Alexandre Oliva - - * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST. - Remove USE_LIBDIR conditional. - * Makefile.am (toolexecdir, toolexeclibdir): Don't override. - * Makefile.in, configure: Rebuilt. - -2003-01027 David Edelsohn - - * Makefile.am (TARGET_SRC_POWERPC_AIX): Fix typo. - * Makefile.in: Regenerate. - -2003-01-22 Andrew Haley - - * src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to - unwind info. - -2003-01-21 Andreas Tobler - - * src/powerpc/darwin.S: Add unwind info. - * src/powerpc/darwin_closure.S: Likewise. - -2003-01-14 Andrew Haley - - * src/x86/ffi64.c (ffi_prep_args): Check for void retval. - (ffi_prep_cif_machdep): Likewise. - * src/x86/unix64.S: Add unwind info. - -2003-01-14 Andreas Jaeger - - * src/ffitest.c (main): Only use ffi_closures if those are - supported. - -2003-01-13 Andreas Tobler - - * libffi/src/ffitest.c - add closure testcases - -2003-01-13 Kevin B. Hendricks - - * libffi/src/powerpc/ffi.c - fix alignment bug for float (4 byte aligned iso 8 byte) - -2003-01-09 Geoffrey Keating - - * src/powerpc/ffi_darwin.c: Remove RCS version string. - * src/powerpc/darwin.S: Remove RCS version string. - -2003-01-03 Jeff Sturm - - * include/ffi.h.in: Add closure defines for SPARC, SPARC64. - * src/ffitest.c (main): Use static storage for closure. - * src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New. - * src/sparc/v8.S (ffi_closure_v8): New. - * src/sparc/v9.S (ffi_closure_v9): New. - -2002-11-10 Ranjit Mathew - - * include/ffi.h.in: Added FFI_STDCALL ffi_type - enumeration for X86_WIN32. - * src/x86/win32.S: Added ffi_call_STDCALL function - definition. - * src/x86/ffi.c (ffi_call/ffi_raw_call): Added - switch cases for recognising FFI_STDCALL and - calling ffi_call_STDCALL if target is X86_WIN32. - * src/ffitest.c (my_stdcall_strlen/stdcall_many): - stdcall versions of the "my_strlen" and "many" - test functions (for X86_WIN32). - Added test cases to test stdcall invocation using - these functions. - -2002-12-02 Kaz Kojima - - * src/sh/sysv.S: Add DWARF2 unwind info. - -2002-11-27 Ulrich Weigand - - * src/s390/sysv.S (.eh_frame section): Make section read-only. - -2002-11-26 Jim Wilson - - * src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64. - -2002-11-23 H.J. Lu - - * acinclude.m4: Add dummy AM_PROG_LIBTOOL. - Include ../config/accross.m4. - * aclocal.m4; Rebuild. - * configure: Likewise. - -2002-11-15 Ulrich Weigand - - * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding. - -2002-11-11 DJ Delorie - - * configure.in: Look for common files in the right place. - -2002-10-08 Ulrich Weigand - - * src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret - raw data as _Jv_word values, not ffi_raw. - (ffi_java_ptrarray_to_raw): Likewise. - (ffi_java_rvalue_to_raw): New function. - (ffi_java_raw_call): Call it. - (ffi_java_raw_to_rvalue): New function. - (ffi_java_translate_args): Call it. - * src/ffitest.c (closure_test_fn): Interpret return value - as ffi_arg, not int. - * src/s390/ffi.c (ffi_prep_cif_machdep): Add missing - FFI_TYPE_POINTER case. - (ffi_closure_helper_SYSV): Likewise. Also, assume return - values extended to word size. - -2002-10-02 Andreas Jaeger - - * src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output. - -2002-10-01 Bo Thorsen - - * include/ffi.h.in: Fix i386 win32 compilation. - -2002-09-30 Ulrich Weigand - - * configure.in: Add s390x-*-linux-* target. - * configure: Regenerate. - * include/ffi.h.in: Define S390X for s390x targets. - (FFI_CLOSURES): Define for s390/s390x. - (FFI_TRAMPOLINE_SIZE): Likewise. - (FFI_NATIVE_RAW_API): Likewise. - * src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390. - * src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x. - * src/s390/ffi.c: Major rework of existing code. Add support for - s390x targets. Add closure support. - * src/s390/sysv.S: Likewise. - -2002-09-29 Richard Earnshaw - - * src/arm/sysv.S: Fix typo. - -2002-09-28 Richard Earnshaw - - * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor - has defined __USER_LABEL_PREFIX__, then use it in CNAME. - (ffi_call_SYSV): Handle soft-float. - -2002-09-27 Bo Thorsen - - * include/ffi.h.in: Fix multilib x86-64 support. - -2002-09-22 Kaveh R. Ghazi - - * Makefile.am (all-multi): Fix multilib parallel build. - -2002-07-19 Kaz Kojima - - * configure.in (sh[34]*-*-linux*): Add brackets. - * configure: Regenerate. - -2002-07-18 Kaz Kojima - - * Makefile.am: Add SH support. - * Makefile.in: Regenerate. - * configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target. - * configure: Regenerate. - * include/ffi.h.in: Add SH support. - * src/sh/ffi.c: New file. - * src/sh/sysv.S: New file. - * src/types.c: Add SH support. - -2002-07-16 Bo Thorsen - - * src/x86/ffi64.c: New file that adds x86-64 support. - * src/x86/unix64.S: New file that handles argument setup for - x86-64. - * src/x86/sysv.S: Don't use this on x86-64. - * src/x86/ffi.c: Don't use this on x86-64. - Remove unused vars. - * src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation - for x86-64. - * src/ffitest.c (struct6): New test that tests a special case in - the x86-64 ABI. - (struct7): Likewise. - (struct8): Likewise. - (struct9): Likewise. - (closure_test_fn): Silence warning about this when it's not used. - (main): Add the new tests. - (main): Fix a couple of wrong casts and silence some compiler warnings. - * include/ffi.h.in: Add x86-64 ABI definition. - * fficonfig.h.in: Regenerate. - * Makefile.am: Add x86-64 support. - * configure.in: Likewise. - * Makefile.in: Regenerate. - * configure: Likewise. - -2002-06-24 Bo Thorsen - - * src/types.c: Merge settings for similar architectures. - Add x86-64 sizes and alignments. - -2002-06-23 Bo Thorsen - - * src/arm/ffi.c (ffi_prep_args): Remove unused vars. - * src/sparc/ffi.c (ffi_prep_args_v8): Likewise. - * src/mips/ffi.c (ffi_prep_args): Likewise. - * src/m68k/ffi.c (ffi_prep_args): Likewise. - -2002-07-18 H.J. Lu (hjl@gnu.org) - - * Makefile.am (TARGET_SRC_MIPS_LINUX): New. - (libffi_la_SOURCES): Support MIPS_LINUX. - (libffi_convenience_la_SOURCES): Likewise. - * Makefile.in: Regenerated. - - * configure.in (mips64*-*): Skip. - (mips*-*-linux*): New. - * configure: Regenerated. - - * src/mips/ffi.c: Include . - -2002-06-06 Ulrich Weigand - - * src/s390/sysv.S: Save/restore %r6. Add DWARF-2 unwind info. - -2002-05-27 Roger Sayle - - * src/x86/ffi.c (ffi_prep_args): Remove reference to avn. - -2002-05-27 Bo Thorsen - - * src/x86/ffi.c (ffi_prep_args): Remove unused variable and - fix formatting. - -2002-05-13 Andreas Tobler - - * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at - beginning of function (for older apple cc). - -2002-05-08 Alexandre Oliva - - * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at - script entry, and set LD to it when configuring multilibs. - * configure: Rebuilt. - -2002-05-05 Jason Thorpe - - * configure.in (sparc64-*-netbsd*): Add target. - (sparc-*-netbsdelf*): Likewise. - * configure: Regenerate. - -2002-04-28 David S. Miller - - * configure.in, configure: Fix SPARC test in previous change. - -2002-04-29 Gerhard Tonn - - * Makefile.am: Add Linux for S/390 support. - * Makefile.in: Regenerate. - * configure.in: Add Linux for S/390 support. - * configure: Regenerate. - * include/ffi.h.in: Add Linux for S/390 support. - * src/s390/ffi.c: New file from libffi CVS tree. - * src/s390/sysv.S: New file from libffi CVS tree. - -2002-04-28 Jakub Jelinek - - * configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working - %r_disp32(). - * src/sparc/v8.S: Use it. - * src/sparc/v9.S: Likewise. - * fficonfig.h.in: Rebuilt. - * configure: Rebuilt. - -2002-04-08 Hans Boehm - - * src/java_raw_api.c (ffi_java_raw_size): Handle FFI_TYPE_DOUBLE - correctly. - * src/ia64/unix.S: Add unwind information. Fix comments. - Save sp in a way that's compatible with unwind info. - (ffi_call_unix): Correctly restore sp in all cases. - * src/ia64/ffi.c: Add, fix comments. - -2002-04-08 Jakub Jelinek - - * src/sparc/v8.S: Make .eh_frame dependent on target word size. - -2002-04-06 Jason Thorpe - - * configure.in (alpha*-*-netbsd*): Add target. - * configure: Regenerate. - -2002-04-04 Jeff Sturm - - * src/sparc/v8.S: Add unwind info. - * src/sparc/v9.S: Likewise. - -2002-03-30 Krister Walfridsson - - * configure.in: Enable i*86-*-netbsdelf*. - * configure: Rebuilt. - -2002-03-29 David Billinghurst - - PR other/2620 - * src/mips/n32.s: Delete - * src/mips/o32.s: Delete - -2002-03-21 Loren J. Rittle - - * configure.in: Enable alpha*-*-freebsd*. - * configure: Rebuilt. - -2002-03-17 Bryce McKinlay - - * Makefile.am: libfficonvenience -> libffi_convenience. - * Makefile.in: Rebuilt. - - * Makefile.am: Define ffitest_OBJECTS. - * Makefile.in: Rebuilt. - -2002-03-07 Andreas Tobler - David Edelsohn - - * Makefile.am (EXTRA_DIST): Add Darwin and AIX closure files. - (TARGET_SRC_POWERPC_AIX): Add aix_closure.S. - (TARGET_SRC_POWERPC_DARWIN): Add darwin_closure.S. - * Makefile.in: Regenerate. - * include/ffi.h.in: Add AIX and Darwin closure definitions. - * src/powerpc/ffi_darwin.c (ffi_prep_closure): New function. - (flush_icache, flush_range): New functions. - (ffi_closure_helper_DARWIN): New function. - * src/powerpc/aix_closure.S: New file. - * src/powerpc/darwin_closure.S: New file. - -2002-02-24 Jeff Sturm - - * include/ffi.h.in: Add typedef for ffi_arg. - * src/ffitest.c (main): Declare rint with ffi_arg. - -2002-02-21 Andreas Tobler - - * src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate - number of GPRs for floating-point arguments. - -2002-01-31 Anthony Green - - * configure: Rebuilt. - * configure.in: Replace CHECK_SIZEOF and endian tests with - cross-compiler friendly macros. - * aclocal.m4 (AC_COMPILE_CHECK_SIZEOF, AC_C_BIGENDIAN_CROSS): New - macros. - -2002-01-18 David Edelsohn - - * src/powerpc/darwin.S (_ffi_call_AIX): New. - * src/powerpc/aix.S (ffi_call_DARWIN): New. - -2002-01-17 David Edelsohn - - * Makefile.am (EXTRA_DIST): Add Darwin and AIX files. - (TARGET_SRC_POWERPC_AIX): New. - (POWERPC_AIX): New stanza. - * Makefile.in: Regenerate. - * configure.in: Add AIX case. - * configure: Regenerate. - * include/ffi.h.in (ffi_abi): Add FFI_AIX. - * src/powerpc/ffi_darwin.c (ffi_status): Use "long" to scale frame - size. Fix "long double" support. - (ffi_call): Add FFI_AIX case. - * src/powerpc/aix.S: New. - -2001-10-09 John Hornkvist - - Implement Darwin PowerPC ABI. - * configure.in: Handle powerpc-*-darwin*. - * Makefile.am: Set source files for POWERPC_DARWIN. - * configure: Rebuilt. - * Makefile.in: Rebuilt. - * include/ffi.h.in: Define FFI_DARWIN and FFI_DEFAULT_ABI for - POWERPC_DARWIN. - * src/powerpc/darwin.S: New file. - * src/powerpc/ffi_darwin.c: New file. - -2001-10-07 Joseph S. Myers - - * src/x86/ffi.c: Fix spelling error of "separate" as "seperate". - -2001-07-16 Rainer Orth - - * src/x86/sysv.S: Avoid gas-only .balign directive. - Use C style comments. - -2001-07-16 Rainer Orth - - * src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic. - Fixes PR bootstrap/3563. - -2001-06-26 Rainer Orth - - * src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF. - -2001-06-25 Rainer Orth - - * configure.in: Recognize sparc*-sun-* host. - * configure: Regenerate. - -2001-06-06 Andrew Haley - - * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF. - -2001-06-03 Andrew Haley - - * src/alpha/osf.S: Add unwind info. - * src/powerpc/sysv.S: Add unwind info. - * src/powerpc/ppc_closure.S: Likewise. - -2000-05-31 Jeff Sturm - - * configure.in: Fix AC_ARG_ENABLE usage. - * configure: Rebuilt. - -2001-05-06 Bryce McKinlay - - * configure.in: Remove warning about beta code. - * configure: Rebuilt. - -2001-04-25 Hans Boehm - - * src/ia64/unix.S: Restore stack pointer when returning from - ffi_closure_UNIX. - * src/ia64/ffi.c: Fix typo in comment. - -2001-04-18 Jim Wilson - - * src/ia64/unix.S: Delete unnecessary increment and decrement of loc2 - to eliminate RAW DV. - -2001-04-12 Bryce McKinlay - - * Makefile.am: Make a libtool convenience library. - * Makefile.in: Rebuilt. - -2001-03-29 Bryce McKinlay - - * configure.in: Use different syntax for subdirectory creation. - * configure: Rebuilt. - -2001-03-27 Jon Beniston - - * configure.in: Added X86_WIN32 target (Win32, CygWin, MingW). - * configure: Rebuilt. - * Makefile.am: Added X86_WIN32 target support. - * Makefile.in: Rebuilt. - - * include/ffi.h.in: Added X86_WIN32 target support. - - * src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets. - * src/types.c: Added X86_WIN32 target support. - - * src/x86/win32.S: New file. Based on sysv.S, but with EH - stuff removed and made to work with CygWin's gas. - -2001-03-26 Bryce McKinlay - - * configure.in: Make target subdirectory in build dir. - * Makefile.am: Override suffix based rules to specify correct output - subdirectory. - * Makefile.in: Rebuilt. - * configure: Rebuilt. - -2001-03-23 Kevin B Hendricks - - * src/powerpc/ppc_closure.S: New file. - * src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug - involving long long and register pairs. - (ffi_prep_closure): New function. - (flush_icache): Likewise. - (ffi_closure_helper_SYSV): Likewise. - * include/ffi.h.in (FFI_CLOSURES): Define on PPC. - (FFI_TRAMPOLINE_SIZE): Likewise. - (FFI_NATIVE_RAW_API): Likewise. - * Makefile.in: Rebuilt. - * Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S. - (TARGET_SRC_POWERPC): Likewise. - -2001-03-19 Tom Tromey - - * Makefile.in: Rebuilt. - * Makefile.am (ffitest_LDFLAGS): New macro. - -2001-03-02 Nick Clifton - - * include/ffi.h.in: Remove RCS ident string. - * include/ffi_mips.h: Remove RCS ident string. - * src/debug.c: Remove RCS ident string. - * src/ffitest.c: Remove RCS ident string. - * src/prep_cif.c: Remove RCS ident string. - * src/types.c: Remove RCS ident string. - * src/alpha/ffi.c: Remove RCS ident string. - * src/alpha/osf.S: Remove RCS ident string. - * src/arm/ffi.c: Remove RCS ident string. - * src/arm/sysv.S: Remove RCS ident string. - * src/mips/ffi.c: Remove RCS ident string. - * src/mips/n32.S: Remove RCS ident string. - * src/mips/o32.S: Remove RCS ident string. - * src/sparc/ffi.c: Remove RCS ident string. - * src/sparc/v8.S: Remove RCS ident string. - * src/sparc/v9.S: Remove RCS ident string. - * src/x86/ffi.c: Remove RCS ident string. - * src/x86/sysv.S: Remove RCS ident string. - -2001-02-08 Joseph S. Myers - - * include/ffi.h.in: Change sourceware.cygnus.com references to - gcc.gnu.org. - -2000-12-09 Richard Henderson - - * src/alpha/ffi.c (ffi_call): Simplify struct return test. - (ffi_closure_osf_inner): Index rather than increment avalue - and arg_types. Give ffi_closure_osf the raw return value type. - * src/alpha/osf.S (ffi_closure_osf): Handle return value type - promotion. - -2000-12-07 Richard Henderson - - * src/raw_api.c (ffi_translate_args): Fix typo. - (ffi_prep_closure): Likewise. - - * include/ffi.h.in [ALPHA]: Define FFI_CLOSURES and - FFI_TRAMPOLINE_SIZE. - * src/alpha/ffi.c (ffi_prep_cif_machdep): Adjust minimal - cif->bytes for new ffi_call_osf implementation. - (ffi_prep_args): Absorb into ... - (ffi_call): ... here. Do all stack allocation here and - avoid a callback function. - (ffi_prep_closure, ffi_closure_osf_inner): New. - * src/alpha/osf.S (ffi_call_osf): Reimplement with no callback. - (ffi_closure_osf): New. - -2000-09-10 Alexandre Oliva - - * config.guess, config.sub, install-sh: Removed. - * ltconfig, ltmain.sh, missing, mkinstalldirs: Likewise. - * Makefile.in: Rebuilt. - - * acinclude.m4: Include libtool macros from the top level. - * aclocal.m4, configure: Rebuilt. - -2000-08-22 Alexandre Oliva - - * configure.in [i*86-*-freebsd*] (TARGET, TARGETDIR): Set. - * configure: Rebuilt. - -2000-05-11 Scott Bambrough - - * libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to - memory correctly. Use conditional instructions, not branches where - possible. - -2000-05-04 Tom Tromey - - * configure: Rebuilt. - * configure.in: Match `arm*-*-linux-*'. - From Chris Dornan . - -2000-04-28 Jakub Jelinek - - * Makefile.am (SUBDIRS): Define. - (AM_MAKEFLAGS): Likewise. - (Multilib support.): Add section. - * Makefile.in: Rebuilt. - * ltconfig (extra_compiler_flags, extra_compiler_flags_value): - New variables. Set for gcc using -print-multi-lib. Export them - to libtool. - (sparc64-*-linux-gnu*): Use libsuff 64 for search paths. - * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options - for -shared links. - (extra_compiler_flags_value, extra_compiler_flags): Check these - for extra compiler options which need to be passed down in - compiler_flags. - -2000-04-16 Anthony Green - - * configure: Rebuilt. - * configure.in: Change i*86-pc-linux* to i*86-*-linux*. - -2000-04-14 Jakub Jelinek - - * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds. - Set SPARC FFI_DEFAULT_ABI based on SPARC64 define. - * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args. - Replace all void * sizeofs with sizeof(int). - Only compare type with FFI_TYPE_LONGDOUBLE if LONGDOUBLE is - different than DOUBLE. - Remove FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases (handled elsewhere). - (ffi_prep_args_v9): New function. - (ffi_prep_cif_machdep): Handle V9 ABI and long long on V8. - (ffi_V9_return_struct): New function. - (ffi_call): Handle FFI_V9 ABI from 64bit code and FFI_V8 ABI from - 32bit code (not yet cross-arch calls). - * src/sparc/v8.S: Add struct return delay nop. - Handle long long. - * src/sparc/v9.S: New file. - * src/prep_cif.c (ffi_prep_cif): Return structure pointer - is used on sparc64 only for structures larger than 32 bytes. - Pass by reference for structures is done for structure arguments - larger than 16 bytes. - * src/ffitest.c (main): Use 64bit rint on sparc64. - Run long long tests on sparc. - * src/types.c (FFI_TYPE_POINTER): Pointer is 64bit on alpha and - sparc64. - (FFI_TYPE_LONGDOUBLE): long double is 128 bit aligned to 128 bits - on sparc64. - * configure.in (sparc-*-linux*): New supported target. - (sparc64-*-linux*): Likewise. - * configure: Rebuilt. - * Makefile.am: Add v9.S to SPARC files. - * Makefile.in: Likewise. - (LINK): Surround $(CCLD) into double quotes, so that multilib - compiles work correctly. - -2000-04-04 Alexandre Petit-Bianco - - * configure: Rebuilt. - * configure.in: (i*86-*-solaris*): New libffi target. Patch - proposed by Bryce McKinlay. - -2000-03-20 Tom Tromey - - * Makefile.in: Hand edit for java_raw_api.lo. - -2000-03-08 Bryce McKinlay - - * config.guess, config.sub: Update from the gcc tree. - Fix for PR libgcj/168. - -2000-03-03 Tom Tromey - - * Makefile.in: Fixed ia64 by hand. - - * configure: Rebuilt. - * configure.in (--enable-multilib): New option. - (libffi_basedir): New subst. - (AC_OUTPUT): Added multilib code. - -2000-03-02 Tom Tromey - - * Makefile.in: Rebuilt. - * Makefile.am (TARGET_SRC_IA64): Use `ia64', not `alpha', as - directory name. - -2000-02-25 Hans Boehm - - * src/ia64/ffi.c, src/ia64/ia64_flags.h, src/ia64/unix.S: New - files. - * src/raw_api.c (ffi_translate_args): Fixed typo in argument - list. - (ffi_prep_raw_closure): Use ffi_translate_args, not - ffi_closure_translate. - * src/java_raw_api.c: New file. - * src/ffitest.c (closure_test_fn): New function. - (main): Define `rint' as long long on IA64. Added new test when - FFI_CLOSURES is defined. - * include/ffi.h.in (ALIGN): Use size_t, not unsigned. - (ffi_abi): Recognize IA64. - (ffi_raw): Added `flt' field. - Added "Java raw API" code. - * configure.in: Recognize ia64. - * Makefile.am (TARGET_SRC_IA64): New macro. - (libffi_la_common_SOURCES): Added java_raw_api.c. - (libffi_la_SOURCES): Define in IA64 case. - -2000-01-04 Tom Tromey - - * Makefile.in: Rebuilt with newer automake. - -1999-12-31 Tom Tromey - - * Makefile.am (INCLUDES): Added -I$(top_srcdir)/src. - -1999-09-01 Tom Tromey - - * include/ffi.h.in: Removed PACKAGE and VERSION defines and - undefs. - * fficonfig.h.in: Rebuilt. - * configure: Rebuilt. - * configure.in: Pass 3rd argument to AM_INIT_AUTOMAKE. - Use AM_PROG_LIBTOOL (automake 1.4 compatibility). - * acconfig.h: Don't #undef PACKAGE or VERSION. - -1999-08-09 Anthony Green - - * include/ffi.h.in: Try to work around messy header problem - with PACKAGE and VERSION. - - * configure: Rebuilt. - * configure.in: Change version to 2.00-beta. - - * fficonfig.h.in: Rebuilt. - * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define. - - * src/x86/ffi.c (ffi_raw_call): Rename. - -1999-08-02 Kresten Krab Thorup - - * src/x86/ffi.c (ffi_closure_SYSV): New function. - (ffi_prep_incoming_args_SYSV): Ditto. - (ffi_prep_closure): Ditto. - (ffi_closure_raw_SYSV): Ditto. - (ffi_prep_raw_closure): More ditto. - (ffi_call_raw): Final ditto. - - * include/ffi.h.in: Add definitions for closure and raw API. - - * src/x86/ffi.c (ffi_prep_cif_machdep): Added case for - FFI_TYPE_UINT64. - - * Makefile.am (libffi_la_common_SOURCES): Added raw_api.c - - * src/raw_api.c: New file. - - * include/ffi.h.in (ffi_raw): New type. - (UINT_ARG, SINT_ARG): New defines. - (ffi_closure, ffi_raw_closure): New types. - (ffi_prep_closure, ffi_prep_raw_closure): New declarations. - - * configure.in: Add check for endianness and sizeof void*. - - * src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument, - instead of directly. - - * configure: Rebuilt. - -Thu Jul 8 14:28:42 1999 Anthony Green - - * configure.in: Add x86 and powerpc BeOS configurations. - From Makoto Kato . - -1999-05-09 Anthony Green - - * configure.in: Add warning about this being beta code. - Remove src/Makefile.am from the picture. - * configure: Rebuilt. - - * Makefile.am: Move logic from src/Makefile.am. Add changes - to support libffi as a target library. - * Makefile.in: Rebuilt. - - * aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh: - Upgraded to new autoconf, automake, libtool. - - * README: Tweaks. - - * LICENSE: Update copyright date. - - * src/Makefile.am, src/Makefile.in: Removed. - -1998-11-29 Anthony Green - - * include/ChangeLog: Removed. - * src/ChangeLog: Removed. - * src/mips/ChangeLog: Removed. - * src/sparc/ChangeLog: Remboved. - * src/x86/ChangeLog: Removed. - - * ChangeLog.v1: Created. - -============================================================================= -From the old ChangeLog.libffi file.... - -2011-02-08 Andreas Tobler - - * testsuite/lib/libffi.exp: Tweak for stand-alone mode. - -2009-12-25 Samuli Suominen - - * configure.ac: Undefine _AC_ARG_VAR_PRECIOUS for autoconf 2.64. - * configure: Rebuilt. - * fficonfig.h.in: Rebuilt. - -2009-06-16 Andrew Haley - - * testsuite/libffi.call/cls_align_sint64.c, - testsuite/libffi.call/cls_align_uint64.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/cls_ulonglong.c, - testsuite/libffi.call/return_ll1.c, - testsuite/libffi.call/stret_medium2.c: Fix printf format - specifiers. - * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs. - * testsuite/libffi.call/float2.c: Fix dg-excess-errors. - * testsuite/libffi.call/ffitest.h, - testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define. - -2009-06-12 Andrew Haley - - * testsuite/libffi.call/cls_align_sint64.c, - testsuite/libffi.call/cls_align_uint64.c, - testsuite/libffi.call/cls_ulonglong.c, - testsuite/libffi.call/return_ll1.c, - testsuite/libffi.call/stret_medium2.c: Fix printf format - specifiers. - testsuite/libffi.special/unwindtest.cc: include stdint.h. - -2009-06-11 Timothy Wall - - * Makefile.am, - configure.ac, - include/ffi.h.in, - include/ffi_common.h, - src/closures.c, - src/dlmalloc.c, - src/x86/ffi.c, - src/x86/ffitarget.h, - src/x86/win64.S (new), - README: Added win64 support (mingw or MSVC) - * Makefile.in, - include/Makefile.in, - man/Makefile.in, - testsuite/Makefile.in, - configure, - aclocal.m4: Regenerated - * ltcf-c.sh: properly escape cygwin/w32 path - * man/ffi_call.3: Clarify size requirements for return value. - * src/x86/ffi64.c: Fix filename in comment. - * src/x86/win32.S: Remove unused extern. - - * testsuite/libffi.call/closure_fn0.c, - testsuite/libffi.call/closure_fn1.c, - testsuite/libffi.call/closure_fn2.c, - testsuite/libffi.call/closure_fn3.c, - testsuite/libffi.call/closure_fn4.c, - testsuite/libffi.call/closure_fn5.c, - testsuite/libffi.call/closure_fn6.c, - testsuite/libffi.call/closure_stdcall.c, - testsuite/libffi.call/cls_12byte.c, - testsuite/libffi.call/cls_16byte.c, - testsuite/libffi.call/cls_18byte.c, - testsuite/libffi.call/cls_19byte.c, - testsuite/libffi.call/cls_1_1byte.c, - testsuite/libffi.call/cls_20byte.c, - testsuite/libffi.call/cls_20byte1.c, - testsuite/libffi.call/cls_24byte.c, - testsuite/libffi.call/cls_2byte.c, - testsuite/libffi.call/cls_3_1byte.c, - testsuite/libffi.call/cls_3byte1.c, - testsuite/libffi.call/cls_3byte2.c, - testsuite/libffi.call/cls_4_1byte.c, - testsuite/libffi.call/cls_4byte.c, - testsuite/libffi.call/cls_5_1_byte.c, - testsuite/libffi.call/cls_5byte.c, - testsuite/libffi.call/cls_64byte.c, - testsuite/libffi.call/cls_6_1_byte.c, - testsuite/libffi.call/cls_6byte.c, - testsuite/libffi.call/cls_7_1_byte.c, - testsuite/libffi.call/cls_7byte.c, - testsuite/libffi.call/cls_8byte.c, - testsuite/libffi.call/cls_9byte1.c, - testsuite/libffi.call/cls_9byte2.c, - testsuite/libffi.call/cls_align_double.c, - testsuite/libffi.call/cls_align_float.c, - testsuite/libffi.call/cls_align_longdouble.c, - testsuite/libffi.call/cls_align_longdouble_split.c, - testsuite/libffi.call/cls_align_longdouble_split2.c, - testsuite/libffi.call/cls_align_pointer.c, - testsuite/libffi.call/cls_align_sint16.c, - testsuite/libffi.call/cls_align_sint32.c, - testsuite/libffi.call/cls_align_sint64.c, - testsuite/libffi.call/cls_align_uint16.c, - testsuite/libffi.call/cls_align_uint32.c, - testsuite/libffi.call/cls_align_uint64.c, - testsuite/libffi.call/cls_dbls_struct.c, - testsuite/libffi.call/cls_double.c, - testsuite/libffi.call/cls_double_va.c, - testsuite/libffi.call/cls_float.c, - testsuite/libffi.call/cls_longdouble.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/cls_multi_schar.c, - testsuite/libffi.call/cls_multi_sshort.c, - testsuite/libffi.call/cls_multi_sshortchar.c, - testsuite/libffi.call/cls_multi_uchar.c, - testsuite/libffi.call/cls_multi_ushort.c, - testsuite/libffi.call/cls_multi_ushortchar.c, - testsuite/libffi.call/cls_pointer.c, - testsuite/libffi.call/cls_pointer_stack.c, - testsuite/libffi.call/cls_schar.c, - testsuite/libffi.call/cls_sint.c, - testsuite/libffi.call/cls_sshort.c, - testsuite/libffi.call/cls_uchar.c, - testsuite/libffi.call/cls_uint.c, - testsuite/libffi.call/cls_ulonglong.c, - testsuite/libffi.call/cls_ushort.c, - testsuite/libffi.call/err_bad_abi.c, - testsuite/libffi.call/err_bad_typedef.c, - testsuite/libffi.call/float2.c, - testsuite/libffi.call/huge_struct.c, - testsuite/libffi.call/nested_struct.c, - testsuite/libffi.call/nested_struct1.c, - testsuite/libffi.call/nested_struct10.c, - testsuite/libffi.call/nested_struct2.c, - testsuite/libffi.call/nested_struct3.c, - testsuite/libffi.call/nested_struct4.c, - testsuite/libffi.call/nested_struct5.c, - testsuite/libffi.call/nested_struct6.c, - testsuite/libffi.call/nested_struct7.c, - testsuite/libffi.call/nested_struct8.c, - testsuite/libffi.call/nested_struct9.c, - testsuite/libffi.call/problem1.c, - testsuite/libffi.call/return_ldl.c, - testsuite/libffi.call/return_ll1.c, - testsuite/libffi.call/stret_large.c, - testsuite/libffi.call/stret_large2.c, - testsuite/libffi.call/stret_medium.c, - testsuite/libffi.call/stret_medium2.c, - testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead - of checking for MMAP. Use intptr_t instead of long casts. - -2009-06-04 Andrew Haley - - * src/powerpc/ffitarget.h: Fix misapplied merge from gcc. - -2009-06-04 Andrew Haley - - * src/mips/o32.S, - src/mips/n32.S: Fix licence formatting. - -2009-06-04 Andrew Haley - - * src/x86/darwin.S: Fix licence formatting. - src/x86/win32.S: Likewise. - src/sh64/sysv.S: Likewise. - src/sh/sysv.S: Likewise. - -2009-06-04 Andrew Haley - - * src/sh64/ffi.c: Remove lint directives. Was missing from merge - of Andreas Tobler's patch from 2006-04-22. - -2009-06-04 Andrew Haley - - * src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of - 2007-03-07. - -2008-12-26 Timothy Wall - - * testsuite/libffi.call/cls_longdouble.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/cls_align_longdouble.c, - testsuite/libffi.call/cls_align_longdouble_split.c, - testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected - failures on x86_64 cygwin/mingw. - -2008-12-22 Timothy Wall - - * testsuite/libffi.call/closure_fn0.c, - testsuite/libffi.call/closure_fn1.c, - testsuite/libffi.call/closure_fn2.c, - testsuite/libffi.call/closure_fn3.c, - testsuite/libffi.call/closure_fn4.c, - testsuite/libffi.call/closure_fn5.c, - testsuite/libffi.call/closure_fn6.c, - testsuite/libffi.call/closure_loc_fn0.c, - testsuite/libffi.call/closure_stdcall.c, - testsuite/libffi.call/cls_align_pointer.c, - testsuite/libffi.call/cls_pointer.c, - testsuite/libffi.call/cls_pointer_stack.c: use portable cast from - pointer to integer (intptr_t). - * testsuite/libffi.call/cls_longdouble.c: disable for win64. - -2008-12-19 Anthony Green - - * configure.ac: Bump version to 3.0.8. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - * libtool-version: Increment revision. - * README: Update for new release. - -2008-11-11 Anthony Green - - * configure.ac: Bump version to 3.0.7. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - * libtool-version: Increment revision. - * README: Update for new release. - -2008-08-25 Andreas Tobler - - * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and - FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum. - Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT. - Adjust copyright notice. - * src/powerpc/ffi.c: Add two new flags to indicate if we have one - register or two register to use for FFI_SYSV structs. - (ffi_prep_cif_machdep): Pass the right register flag introduced above. - (ffi_closure_helper_SYSV): Fix the return type for - FFI_SYSV_TYPE_SMALL_STRUCT. Comment. - Adjust copyright notice. - -2008-07-24 Anthony Green - - * testsuite/libffi.call/cls_dbls_struct.c, - testsuite/libffi.call/cls_double_va.c, - testsuite/libffi.call/cls_longdouble.c, - testsuite/libffi.call/cls_longdouble_va.c, - testsuite/libffi.call/cls_pointer.c, - testsuite/libffi.call/cls_pointer_stack.c, - testsuite/libffi.call/err_bad_abi.c: Clean up failures from - compiler warnings. - -2008-07-17 Anthony Green - - * configure.ac: Bump version to 3.0.6. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - * libtool-version: Increment revision. Add documentation. - * README: Update for new release. - -2008-07-16 Kaz Kojima - - * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned - int. - -2008-07-16 Kaz Kojima - - * src/sh/sysv.S: Add .note.GNU-stack on Linux. - * src/sh64/sysv.S: Likewise. - -2008-04-03 Anthony Green - - * libffi.pc.in (Libs): Add -L${libdir}. - * configure.ac: Bump version to 3.0.5. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - * libtool-version: Increment revision. - * README: Update for new release. - -2008-04-03 Anthony Green - Xerces Ranby - - * include/ffi.h.in: Wrap definition of target architecture to - protect from double definitions. - -2008-03-22 Moriyoshi Koizumi - - * src/x86/ffi.c (ffi_prep_closure_loc): Fix for bug revealed in - closure_loc_fn0.c. - * testsuite/libffi.call/closure_loc_fn0.c (closure_loc_test_fn0): - New test. - -2008-03-04 Anthony Green - Blake Chaffin - hos@tamanegi.org - - * testsuite/libffi.call/cls_align_longdouble_split2.c - testsuite/libffi.call/cls_align_longdouble_split.c - testsuite/libffi.call/cls_dbls_struct.c - testsuite/libffi.call/cls_double_va.c - testsuite/libffi.call/cls_longdouble.c - testsuite/libffi.call/cls_longdouble_va.c - testsuite/libffi.call/cls_pointer.c - testsuite/libffi.call/cls_pointer_stack.c - testsuite/libffi.call/err_bad_abi.c - testsuite/libffi.call/err_bad_typedef.c - testsuite/libffi.call/huge_struct.c - testsuite/libffi.call/stret_large2.c - testsuite/libffi.call/stret_large.c - testsuite/libffi.call/stret_medium2.c - testsuite/libffi.call/stret_medium.c: New tests from Apple. - -2008-02-26 Jakub Jelinek - Anthony Green - - * src/alpha/osf.S: Add .note.GNU-stack on Linux. - * src/s390/sysv.S: Likewise. - * src/powerpc/linux64.S: Likewise. - * src/powerpc/linux64_closure.S: Likewise. - * src/powerpc/ppc_closure.S: Likewise. - * src/powerpc/sysv.S: Likewise. - * src/x86/unix64.S: Likewise. - * src/x86/sysv.S: Likewise. - * src/sparc/v8.S: Likewise. - * src/sparc/v9.S: Likewise. - * src/m68k/sysv.S: Likewise. - * src/ia64/unix.S: Likewise. - * src/arm/sysv.S: Likewise. - -2008-02-26 Anthony Green - Thomas Heller - - * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C - comment. - -2008-02-26 Anthony Green - Thomas Heller - - * include/ffi.h.in: Change void (*)() to void (*)(void). - -2008-02-26 Anthony Green - Thomas Heller - - * src/alpha/ffi.c: Change void (*)() to void (*)(void). - src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c, - src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c, - src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S, - src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c, - src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c, - src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S, - src/x86/ffi64.c: Ditto. - -2008-02-24 Anthony Green - - * configure.ac: Accept openbsd*, not just openbsd. - Bump version to 3.0.4. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - * libtool-version: Increment revision. - * README: Update for new release. - -2008-02-22 Anthony Green - - * README: Clean up list of tested platforms. - -2008-02-22 Anthony Green - - * configure.ac: Bump version to 3.0.3. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - * libtool-version: Increment revision. - * README: Update for new release. Clean up test docs. - -2008-02-22 Bjoern Koenig - Andreas Tobler - - * configure.ac: Add amd64-*-freebsd* target. - * configure: Regenerate. - -2008-02-22 Thomas Heller - - * configure.ac: Add x86 OpenBSD support. - * configure: Rebuilt. - -2008-02-21 Thomas Heller - - * README: Change "make test" to "make check". - -2008-02-21 Anthony Green - - * configure.ac: Bump version to 3.0.2. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - * libtool-version: Increment revision. - * README: Update for new release. - -2008-02-21 Björn König - - * src/x86/freebsd.S: New file. - * configure.ac: Add x86 FreeBSD support. - * Makefile.am: Ditto. - -2008-02-15 Anthony Green - - * configure.ac: Bump version to 3.0.1. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - * libtool-version: Increment revision. - * README: Update for new release. - -2008-02-15 David Daney - - * src/mips/ffi.c: Remove extra '>' from include directive. - (ffi_prep_closure_loc): Use clear_location instead of tramp. - -2008-02-15 Anthony Green - - * configure.ac: Bump version to 3.0.0. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - -2008-02-15 David Daney - - * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): - Define (conditionally), and use it to include cachectl.h. - (ffi_prep_closure_loc): Fix cache flushing. - * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. - -2008-02-15 Anthony Green - - * man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3: - Update dates and remove all references to ffi_prep_closure. - * configure.ac: Bump version to 2.99.9. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - -2008-02-15 Anthony Green - - * man/ffi_prep_closure.3: Delete. - * man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3. - (man_MANS): Ditto. - * man/Makefile.in: Rebuilt. - * configure.ac: Bump version to 2.99.8. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - -2008-02-14 Anthony Green - - * configure.ac: Bump version to 2.99.7. - * configure, doc/stamp-vti, doc/version.texi: Rebuilt. - * include/ffi.h.in LICENSE src/debug.c src/closures.c - src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h - src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c - src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S - src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c - src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c - src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S - src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h - src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c - src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S - src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h - src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h - src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S - src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h - src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S - src/arm/ffitarget.h src/prep_cif.c: Update license text. - -2008-02-14 Anthony Green - - * README: Update tested platforms. - * configure.ac: Bump version to 2.99.6. - * configure: Rebuilt. - -2008-02-14 Anthony Green - - * configure.ac: Bump version to 2.99.5. - * configure: Rebuilt. - * Makefile.am (EXTRA_DIST): Add darwin64.S - * Makefile.in: Rebuilt. - * testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree. - * LICENSE: Update WARRANTY. - -2008-02-14 Anthony Green - - * libffi.pc.in (libdir): Fix libdir definition. - * configure.ac: Bump version to 2.99.4. - * configure: Rebuilt. - -2008-02-14 Anthony Green - - * README: Update. - * libffi.info: New file. - * doc/stamp-vti: New file. - * configure.ac: Bump version to 2.99.3. - * configure: Rebuilt. - -2008-02-14 Anthony Green - - * Makefile.am (SUBDIRS): Add man dir. - * Makefile.in: Rebuilt. - * configure.ac: Create Makefile. - * configure: Rebuilt. - * man/ffi_call.3 man/ffi_prep_cif.3 man/ffi_prep_closure.3 - man/Makefile.am man/Makefile.in: New files. - -2008-02-14 Tom Tromey - - * aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt. - * mdate-sh, texinfo.tex: New files. - * Makefile.am (info_TEXINFOS): New variable. - * doc/libffi.texi: New file. - * doc/version.texi: Likewise. - -2008-02-14 Anthony Green - - * Makefile.am (AM_CFLAGS): Don't compile with -D$(TARGET). - (lib_LTLIBRARIES): Define. - (toolexeclib_LIBRARIES): Undefine. - * Makefile.in: Rebuilt. - * configure.ac: Reset version to 2.99.1. - * configure.in: Rebuilt. - -2008-02-14 Anthony Green - - * libffi.pc.in: Use @PACKAGE_NAME@ and @PACKAGE_VERSION@. - * configure.ac: Reset version to 2.99.1. - * configure.in: Rebuilt. - * Makefile.am (EXTRA_DIST): Add ChangeLog.libffi. - * Makefile.in: Rebuilt. - * LICENSE: Update copyright notice. - -2008-02-14 Anthony Green - - * include/Makefile.am (nodist_includes_HEADERS): Define. Don't - distribute ffitarget.h or ffi.h from the build include dir. - * Makefile.in: Rebuilt. - -2008-02-14 Anthony Green - - * include/Makefile.am (includesdir): Install headers under libdir. - (pkgconfigdir): Define. Install libffi.pc. - * include/Makefile.in: Rebuilt. - * libffi.pc.in: Create. - * libtool-version: Increment CURRENT - * configure.ac: Add libffi.pc.in - * configure: Rebuilt. - -2008-02-03 Anthony Green - - * include/Makefile.am (includesdir): Fix header install with - DESTDIR. - * include/Makefile.in: Rebuilt. - -2008-02-03 Timothy Wall - - * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return - offset based on code pointer, not data pointer. - -2008-02-01 Anthony Green - - * include/Makefile.am: Fix header installs. - * Makefile.am: Ditto. - * include/Makefile.in: Rebuilt. - * Makefile.in: Ditto. - -2008-02-01 Anthony Green - - * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL, - FFI_INIT_TRAMPOLINE): Revert my broken changes to twall's last - patch. - -2008-01-31 Anthony Green - - * Makefile.am (EXTRA_DIST): Add missing files. - * testsuite/Makefile.am: Ditto. - * Makefile.in, testsuite/Makefile.in: Rebuilt. - -2008-01-31 Timothy Wall - - * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall - closures. - * src/x86/ffitarget.h: Increase size of trampoline for stdcall - closures. - * src/x86/win32.S: Add assembly for stdcall closure. - * src/x86/ffi.c: Initialize stdcall closure trampoline. - -2008-01-30 H.J. Lu - - PR libffi/34612 - * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when - returning struct. - - * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer" - tests. - -2008-01-30 Anthony Green - - * Makefile.am, include/Makefile.am: Move headers to - libffi_la_SOURCES for new automake. - * Makefile.in, include/Makefile.in: Rebuilt. - - * testsuite/lib/wrapper.exp: Copied from gcc tree to allow for - execution outside of gcc tree. - * testsuite/lib/target-libpath.exp: Ditto. - - * testsuite/lib/libffi-dg.exp: Many changes to allow for execution - outside of gcc tree. - - -============================================================================= -From the old ChangeLog.libgcj file.... - -2004-01-14 Kelley Cook - - * configure.in: Add in AC_PREREQ(2.13) - -2003-02-20 Alexandre Oliva - - * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to - config.status. - * configure: Rebuilt. - -2002-01-27 Alexandre Oliva - - * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST. - Remove USE_LIBDIR conditional. - * Makefile.am (toolexecdir, toolexeclibdir): Don't override. - * Makefile.in, configure: Rebuilt. - -Mon Aug 9 18:33:38 1999 Rainer Orth - - * include/Makefile.in: Rebuilt. - * Makefile.in: Rebuilt - * Makefile.am (toolexeclibdir): Add $(MULTISUBDIR) even for native - builds. - Use USE_LIBDIR. - - * configure: Rebuilt. - * configure.in (USE_LIBDIR): Define for native builds. - Use lowercase in configure --help explanations. - -1999-08-08 Anthony Green - - * include/ffi.h.in (FFI_FN): Remove `...'. - -1999-08-08 Anthony Green - - * Makefile.in: Rebuilt. - * Makefile.am (AM_CFLAGS): Compile with -fexceptions. - - * src/x86/sysv.S: Add exception handling metadata. - - -============================================================================= - -The libffi version 1 ChangeLog archive. - -Version 1 of libffi had per-directory ChangeLogs. Current and future -versions have a single ChangeLog file in the root directory. The -version 1 ChangeLogs have all been concatenated into this file for -future reference only. - ---- libffi ---------------------------------------------------------------- - -Mon Oct 5 02:17:50 1998 Anthony Green - - * configure.in: Boosted rev. - * configure, Makefile.in, aclocal.m4: Rebuilt. - * README: Boosted rev and updated release notes. - -Mon Oct 5 01:03:03 1998 Anthony Green - - * configure.in: Boosted rev. - * configure, Makefile.in, aclocal.m4: Rebuilt. - * README: Boosted rev and updated release notes. - -1998-07-25 Andreas Schwab - - * m68k/ffi.c (ffi_prep_cif_machdep): Use bitmask for cif->flags. - Correctly handle small structures. - (ffi_prep_args): Also handle small structures. - (ffi_call): Pass size of return type to ffi_call_SYSV. - * m68k/sysv.S: Adjust for above changes. Correctly align small - structures in the return value. - - * types.c (uint64, sint64) [M68K]: Change alignment to 4. - -Fri Apr 17 17:26:58 1998 Anthony Green - - * configure.in: Boosted rev. - * configure,Makefile.in,aclocal.m4: Rebuilt. - * README: Boosted rev and added release notes. - -Sun Feb 22 00:50:41 1998 Geoff Keating - - * configure.in: Add PowerPC config bits. - -1998-02-14 Andreas Schwab - - * configure.in: Add m68k config bits. Change AC_CANONICAL_SYSTEM - to AC_CANONICAL_HOST, this is not a compiler. Use $host instead - of $target. Remove AC_CHECK_SIZEOF(char), we already know the - result. Fix argument of AC_ARG_ENABLE. - * configure, fficonfig.h.in: Rebuilt. - -Tue Feb 10 20:53:40 1998 Richard Henderson - - * configure.in: Add Alpha config bits. - -Tue May 13 13:39:20 1997 Anthony Green - - * README: Updated dates and reworded Irix comments. - - * configure.in: Removed AC_PROG_RANLIB. - - * Makefile.in, aclocal.m4, config.guess, config.sub, configure, - ltmain.sh, */Makefile.in: libtoolized again and rebuilt with - automake and autoconf. - -Sat May 10 18:44:50 1997 Tom Tromey - - * configure, aclocal.m4: Rebuilt. - * configure.in: Don't compute EXTRADIST; now handled in - src/Makefile.in. Removed macros implied by AM_INIT_AUTOMAKE. - Don't run AM_MAINTAINER_MODE. - -Thu May 8 14:34:05 1997 Anthony Green - - * missing, ltmain.sh, ltconfig.sh: Created. These are new files - required by automake and libtool. - - * README: Boosted rev to 1.14. Added notes. - - * acconfig.h: Moved PACKAGE and VERSION for new automake. - - * configure.in: Changes for libtool. - - * Makefile.am (check): make test now make check. Uses libtool now. - - * Makefile.in, configure.in, aclocal.h, fficonfig.h.in: Rebuilt. - -Thu May 1 16:27:07 1997 Anthony Green - - * missing: Added file required by new automake. - -Tue Nov 26 14:10:42 1996 Anthony Green - - * acconfig.h: Added USING_PURIFY flag. This is defined when - --enable-purify-safety was used at configure time. - - * configure.in (allsources): Added --enable-purify-safety switch. - (VERSION): Boosted rev to 1.13. - * configure: Rebuilt. - -Fri Nov 22 06:46:12 1996 Anthony Green - - * configure.in (VERSION): Boosted rev to 1.12. - Removed special CFLAGS hack for gcc. - * configure: Rebuilt. - - * README: Boosted rev to 1.12. Added notes. - - * Many files: Cygnus Support changed to Cygnus Solutions. - -Wed Oct 30 11:15:25 1996 Anthony Green - - * configure.in (VERSION): Boosted rev to 1.11. - * configure: Rebuilt. - - * README: Boosted rev to 1.11. Added notes about GNU make. - -Tue Oct 29 12:25:12 1996 Anthony Green - - * configure.in: Fixed -Wall trick. - (VERSION): Boosted rev. - * configure: Rebuilt - - * acconfig.h: Needed for --enable-debug configure switch. - - * README: Boosted rev to 1.09. Added more notes on building - libffi, and LCLint. - - * configure.in: Added --enable-debug switch. Boosted rev to - 1.09. - * configure: Rebuilt - -Tue Oct 15 13:11:28 1996 Anthony Green - - * configure.in (VERSION): Boosted rev to 1.08 - * configure: Rebuilt. - - * README: Added n32 bug fix notes. - - * Makefile.am: Added "make lint" production. - * Makefile.in: Rebuilt. - -Mon Oct 14 10:54:46 1996 Anthony Green - - * README: Added web page reference. - - * configure.in, README: Boosted rev to 1.05 - * configure: Rebuilt. - - * README: Fixed n32 sample code. - -Fri Oct 11 17:09:28 1996 Anthony Green - - * README: Added sparc notes. - - * configure.in, README: Boosted rev to 1.04. - * configure: Rebuilt. - -Thu Oct 10 10:31:03 1996 Anthony Green - - * configure.in, README: Boosted rev to 1.03. - * configure: Rebuilt. - - * README: Added struct notes. - - * Makefile.am (EXTRA_DIST): Added LICENSE to distribution. - * Makefile.in: Rebuilt. - - * README: Removed Linux section. No special notes now - because aggregates arg/return types work. - -Wed Oct 9 16:16:42 1996 Anthony Green - - * README, configure.in (VERSION): Boosted rev to 1.02 - * configure: Rebuilt. - -Tue Oct 8 11:56:33 1996 Anthony Green - - * README (NOTE): Added n32 notes. - - * Makefile.am: Added test production. - * Makefile: Rebuilt - - * README: spell checked! - - * configure.in (VERSION): Boosted rev to 1.01 - * configure: Rebuilt. - -Mon Oct 7 15:50:22 1996 Anthony Green - - * configure.in: Added nasty bit to support SGI tools. - * configure: Rebuilt. - - * README: Added SGI notes. Added note about automake bug. - -Mon Oct 7 11:00:28 1996 Anthony Green - - * README: Rewrote intro, and fixed examples. - -Fri Oct 4 10:19:55 1996 Anthony Green - - * configure.in: -D$TARGET is no longer used as a compiler switch. - It is now inserted into ffi.h at configure time. - * configure: Rebuilt. - - * FFI_ABI and FFI_STATUS are now ffi_abi and ffi_status. - -Thu Oct 3 13:47:34 1996 Anthony Green - - * README, LICENSE: Created. Wrote some docs. - - * configure.in: Don't barf on i586-unknown-linuxaout. - Added EXTRADIST code for "make dist". - * configure: Rebuilt. - - * */Makefile.in: Rebuilt with patched automake. - -Tue Oct 1 17:12:25 1996 Anthony Green - - * Makefile.am, aclocal.m4, config.guess, config.sub, - configure.in, fficonfig.h.in, install-sh, mkinstalldirs, - stamp-h.in: Created - * Makefile.in, configure: Generated - ---- libffi/include -------------------------------------------------------- - -Tue Feb 24 13:09:36 1998 Anthony Green - - * ffi_mips.h: Updated FFI_TYPE_STRUCT_* values based on - ffi.h.in changes. This is a work-around for SGI's "simple" - assembler. - -Sun Feb 22 00:51:55 1998 Geoff Keating - - * ffi.h.in: PowerPC support. - -1998-02-14 Andreas Schwab - - * ffi.h.in: Add m68k support. - (FFI_TYPE_LONGDOUBLE): Make it a separate value. - -Tue Feb 10 20:55:16 1998 Richard Henderson - - * ffi.h.in (SIZEOF_ARG): Use a pointer type by default. - - * ffi.h.in: Alpha support. - -Fri Nov 22 06:48:45 1996 Anthony Green - - * ffi.h.in, ffi_common.h: Cygnus Support -> Cygnus Solutions. - -Wed Nov 20 22:31:01 1996 Anthony Green - - * ffi.h.in: Added ffi_type_void definition. - -Tue Oct 29 12:22:40 1996 Anthony Green - - * Makefile.am (hack_DATA): Always install ffi_mips.h. - - * ffi.h.in: Removed FFI_DEBUG. It's now in the correct - place (acconfig.h). - Added #include for size_t definition. - -Tue Oct 15 17:23:35 1996 Anthony Green - - * ffi.h.in, ffi_common.h, ffi_mips.h: More clean up. - Commented out #define of FFI_DEBUG. - -Tue Oct 15 13:01:06 1996 Anthony Green - - * ffi_common.h: Added bool definition. - - * ffi.h.in, ffi_common.h: Clean up based on LCLint output. - Added funny /*@...@*/ comments to annotate source. - -Mon Oct 14 12:29:23 1996 Anthony Green - - * ffi.h.in: Interface changes based on feedback from Jim - Blandy. - -Fri Oct 11 16:49:35 1996 Anthony Green - - * ffi.h.in: Small change for sparc support. - -Thu Oct 10 14:53:37 1996 Anthony Green - - * ffi_mips.h: Added FFI_TYPE_STRUCT_* definitions for - special structure return types. - -Wed Oct 9 13:55:57 1996 Anthony Green - - * ffi.h.in: Added SIZEOF_ARG definition for X86 - -Tue Oct 8 11:40:36 1996 Anthony Green - - * ffi.h.in (FFI_FN): Added macro for eliminating compiler warnings. - Use it to case your function pointers to the proper type. - - * ffi_mips.h (SIZEOF_ARG): Added magic to fix type promotion bug. - - * Makefile.am (EXTRA_DIST): Added ffi_mips.h to EXTRA_DIST. - * Makefile: Rebuilt. - - * ffi_mips.h: Created. Moved all common mips definitions here. - -Mon Oct 7 10:58:12 1996 Anthony Green - - * ffi.h.in: The SGI assember is very picky about parens. Redefined - some macros to avoid problems. - - * ffi.h.in: Added FFI_DEFAULT_ABI definitions. Also added - externs for pointer, and 64bit integral ffi_types. - -Fri Oct 4 09:51:37 1996 Anthony Green - - * ffi.h.in: Added FFI_ABI member to ffi_cif and changed - function prototypes accordingly. - Added #define @TARGET@. Now programs including ffi.h don't - have to specify this themselves. - -Thu Oct 3 15:36:44 1996 Anthony Green - - * ffi.h.in: Changed ffi_prep_cif's values from void* to void** - - * Makefile.am (EXTRA_DIST): Added EXTRA_DIST for "make dist" - to work. - * Makefile.in: Regenerated. - -Wed Oct 2 10:16:59 1996 Anthony Green - - * Makefile.am: Created - * Makefile.in: Generated - - * ffi_common.h: Added rcsid comment - -Tue Oct 1 17:13:51 1996 Anthony Green - - * ffi.h.in, ffi_common.h: Created - ---- libffi/src ------------------------------------------------------------ - -Mon Oct 5 02:17:50 1998 Anthony Green - - * arm/ffi.c, arm/sysv.S: Created. - - * Makefile.am: Added arm files. - * Makefile.in: Rebuilt. - -Mon Oct 5 01:41:38 1998 Anthony Green - - * Makefile.am (libffi_la_LDFLAGS): Incremented revision. - -Sun Oct 4 16:27:17 1998 Anthony Green - - * alpha/osf.S (ffi_call_osf): Patch for DU assembler. - - * ffitest.c (main): long long and long double return values work - for x86. - -Fri Apr 17 11:50:58 1998 Anthony Green - - * Makefile.in: Rebuilt. - - * ffitest.c (main): Floating point tests not executed for systems - with broken lond double (SunOS 4 w/ GCC). - - * types.c: Fixed x86 alignment info for long long types. - -Thu Apr 16 07:15:28 1998 Anthony Green - - * ffitest.c: Added more notes about GCC bugs under Irix 6. - -Wed Apr 15 08:42:22 1998 Anthony Green - - * ffitest.c (struct5): New test function. - (main): New test with struct5. - -Thu Mar 5 10:48:11 1998 Anthony Green - - * prep_cif.c (initialize_aggregate): Fix assertion for - nested structures. - -Tue Feb 24 16:33:41 1998 Anthony Green - - * prep_cif.c (ffi_prep_cif): Added long double support for sparc. - -Sun Feb 22 00:52:18 1998 Geoff Keating - - * powerpc/asm.h: New file. - * powerpc/ffi.c: New file. - * powerpc/sysv.S: New file. - * Makefile.am: PowerPC port. - * ffitest.c (main): Allow all tests to run even in presence of gcc - bug on PowerPC. - -1998-02-17 Anthony Green - - * mips/ffi.c: Fixed comment typo. - - * x86/ffi.c (ffi_prep_cif_machdep), x86/sysv.S (retfloat): - Fixed x86 long double return handling. - - * types.c: Fixed x86 long double alignment info. - -1998-02-14 Andreas Schwab - - * types.c: Add m68k support. - - * ffitest.c (floating): Add long double parameter. - (return_ll, ldblit): New functions to test long long and long - double return value. - (main): Fix type error in assignment of ts[1-4]_type.elements. - Add tests for long long and long double arguments and return - values. - - * prep_cif.c (ffi_prep_cif) [M68K]: Don't allocate argument for - struct value pointer. - - * m68k/ffi.c, m68k/sysv.S: New files. - * Makefile.am: Add bits for m68k port. Add kludge to work around - automake deficiency. - (test): Don't require "." in $PATH. - * Makefile.in: Rebuilt. - -Wed Feb 11 07:36:50 1998 Anthony Green - - * Makefile.in: Rebuilt. - -Tue Feb 10 20:56:00 1998 Richard Henderson - - * alpha/ffi.c, alpha/osf.S: New files. - * Makefile.am: Alpha port. - -Tue Nov 18 14:12:07 1997 Anthony Green - - * mips/ffi.c (ffi_prep_cif_machdep): Initialize rstruct_flag - for n32. - -Tue Jun 3 17:18:20 1997 Anthony Green - - * ffitest.c (main): Added hack to get structure tests working - correctly. - -Sat May 10 19:06:42 1997 Tom Tromey - - * Makefile.in: Rebuilt. - * Makefile.am (EXTRA_DIST): Explicitly list all distributable - files in subdirs. - (VERSION, CC): Removed. - -Thu May 8 17:19:01 1997 Anthony Green - - * Makefile.am: Many changes for new automake and libtool. - * Makefile.in: Rebuilt. - -Fri Nov 22 06:57:56 1996 Anthony Green - - * ffitest.c (main): Fixed test case for non mips machines. - -Wed Nov 20 22:31:59 1996 Anthony Green - - * types.c: Added ffi_type_void declaration. - -Tue Oct 29 13:07:19 1996 Anthony Green - - * ffitest.c (main): Fixed character constants. - (main): Emit warning for structure test 3 failure on Sun. - - * Makefile.am (VPATH): Fixed VPATH def'n so automake won't - strip it out. - Moved distdir hack from libffi to automake. - (ffitest): Added missing -c for $(COMPILE) (change in automake). - * Makefile.in: Rebuilt. - -Tue Oct 15 13:08:20 1996 Anthony Green - - * Makefile.am: Added "make lint" production. - * Makefile.in: Rebuilt. - - * prep_cif.c (STACK_ARG_SIZE): Improved STACK_ARG_SIZE macro. - Clean up based on LCLint output. Added funny /*@...@*/ comments to - annotate source. - - * ffitest.c, debug.c: Cleaned up code. - -Mon Oct 14 12:26:56 1996 Anthony Green - - * ffitest.c: Changes based on interface changes. - - * prep_cif.c (ffi_prep_cif): Cleaned up interface based on - feedback from Jim Blandy. - -Fri Oct 11 15:53:18 1996 Anthony Green - - * ffitest.c: Reordered tests while porting to sparc. - Made changes to handle lame structure passing for sparc. - Removed calls to fflush(). - - * prep_cif.c (ffi_prep_cif): Added special case for sparc - aggregate type arguments. - -Thu Oct 10 09:56:51 1996 Anthony Green - - * ffitest.c (main): Added structure passing/returning tests. - - * prep_cif.c (ffi_prep_cif): Perform proper initialization - of structure return types if needed. - (initialize_aggregate): Bug fix - -Wed Oct 9 16:04:20 1996 Anthony Green - - * types.c: Added special definitions for x86 (double doesn't - need double word alignment). - - * ffitest.c: Added many tests - -Tue Oct 8 09:19:22 1996 Anthony Green - - * prep_cif.c (ffi_prep_cif): Fixed assertion. - - * debug.c (ffi_assert): Must return a non void now. - - * Makefile.am: Added test production. - * Makefile: Rebuilt. - - * ffitest.c (main): Created. - - * types.c: Created. Stripped common code out of */ffi.c. - - * prep_cif.c: Added missing stdlib.h include. - - * debug.c (ffi_type_test): Used "a" to eliminate compiler - warnings in non-debug builds. Included ffi_common.h. - -Mon Oct 7 15:36:42 1996 Anthony Green - - * Makefile.am: Added a rule for .s -> .o - This is required by the SGI compiler. - * Makefile: Rebuilt. - -Fri Oct 4 09:51:08 1996 Anthony Green - - * prep_cif.c (initialize_aggregate): Moved abi specification - to ffi_prep_cif(). - -Thu Oct 3 15:37:37 1996 Anthony Green - - * prep_cif.c (ffi_prep_cif): Changed values from void* to void**. - (initialize_aggregate): Fixed aggregate type initialization. - - * Makefile.am (EXTRA_DIST): Added support code for "make dist". - * Makefile.in: Regenerated. - -Wed Oct 2 11:41:57 1996 Anthony Green - - * debug.c, prep_cif: Created. - - * Makefile.am: Added debug.o and prep_cif.o to OBJ. - * Makefile.in: Regenerated. - - * Makefile.am (INCLUDES): Added missing -I../include - * Makefile.in: Regenerated. - -Tue Oct 1 17:11:51 1996 Anthony Green - - * error.c, Makefile.am: Created. - * Makefile.in: Generated. - ---- libffi/src/x86 -------------------------------------------------------- - -Sun Oct 4 16:27:17 1998 Anthony Green - - * sysv.S (retlongdouble): Fixed long long return value support. - * ffi.c (ffi_prep_cif_machdep): Ditto. - -Wed May 13 04:30:33 1998 Anthony Green - - * ffi.c (ffi_prep_cif_machdep): Fixed long double return value - support. - -Wed Apr 15 08:43:20 1998 Anthony Green - - * ffi.c (ffi_prep_args): small struct support was missing. - -Thu May 8 16:53:58 1997 Anthony Green - - * objects.mak: Removed. - -Mon Dec 2 15:12:58 1996 Tom Tromey - - * sysv.S: Use .balign, for a.out Linux boxes. - -Tue Oct 15 13:06:50 1996 Anthony Green - - * ffi.c: Clean up based on LCLint output. - Added funny /*@...@*/ comments to annotate source. - -Fri Oct 11 16:43:38 1996 Anthony Green - - * ffi.c (ffi_call): Added assertion for bad ABIs. - -Wed Oct 9 13:57:27 1996 Anthony Green - - * sysv.S (retdouble): Fixed double return problems. - - * ffi.c (ffi_call): Corrected fn arg definition. - (ffi_prep_cif_machdep): Fixed double return problems - -Tue Oct 8 12:12:49 1996 Anthony Green - - * ffi.c: Moved ffi_type definitions to types.c. - (ffi_prep_args): Fixed type promotion bug. - -Mon Oct 7 15:53:06 1996 Anthony Green - - * ffi.c (FFI_*_TYPEDEF): Removed redundant ';' - -Fri Oct 4 09:54:53 1996 Anthony Green - - * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped - remaining args. - -Wed Oct 2 10:07:05 1996 Anthony Green - - * ffi.c, sysv.S, objects.mak: Created. - (ffi_prep_cif): cif->rvalue no longer initialized to NULL. - (ffi_prep_cif_machdep): Moved machine independent cif processing - to src/prep_cif.c. Introduced ffi_prep_cif_machdep(). - ---- libffi/src/mips ------------------------------------------------------- - -Tue Feb 17 17:18:07 1998 Anthony Green - - * o32.S: Fixed typo in comment. - - * ffi.c (ffi_prep_cif_machdep): Fixed argument processing. - -Thu May 8 16:53:58 1997 Anthony Green - - * o32.s, n32.s: Wrappers for SGI tool support. - - * objects.mak: Removed. - -Tue Oct 29 14:37:45 1996 Anthony Green - - * ffi.c (ffi_prep_args): Changed int z to size_t z. - -Tue Oct 15 13:17:25 1996 Anthony Green - - * n32.S: Fixed bad stack munging. - - * ffi.c: Moved prototypes for ffi_call_?32() to here from - ffi_mips.h because extended_cif is not defined in ffi_mips.h. - -Mon Oct 14 12:42:02 1996 Anthony Green - - * ffi.c: Interface changes based on feedback from Jim Blandy. - -Thu Oct 10 11:22:16 1996 Anthony Green - - * n32.S, ffi.c: Lots of changes to support passing and - returning structures with the n32 calling convention. - - * n32.S: Fixed fn pointer bug. - - * ffi.c (ffi_prep_cif_machdep): Fix for o32 structure - return values. - (ffi_prep_args): Fixed n32 structure passing when structures - partially fit in registers. - -Wed Oct 9 13:49:25 1996 Anthony Green - - * objects.mak: Added n32.o. - - * n32.S: Created. - - * ffi.c (ffi_prep_args): Added magic to support proper - n32 processing. - -Tue Oct 8 10:37:35 1996 Anthony Green - - * ffi.c: Moved ffi_type definitions to types.c. - (ffi_prep_args): Fixed type promotion bug. - - * o32.S: This code is only built for o32 compiles. - A lot of the #define cruft has moved to ffi_mips.h. - - * ffi.c (ffi_prep_cif_machdep): Fixed arg flags. Second arg - is only processed if the first is either a float or double. - -Mon Oct 7 15:33:59 1996 Anthony Green - - * o32.S: Modified to compile under each of o32, n32 and n64. - - * ffi.c (FFI_*_TYPEDEF): Removed redundant ';' - -Fri Oct 4 09:53:25 1996 Anthony Green - - * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped - remaining args. - -Wed Oct 2 17:41:22 1996 Anthony Green - - * o32.S: Removed crufty definitions. - -Wed Oct 2 12:53:42 1996 Anthony Green - - * ffi.c (ffi_prep_cif): cif->rvalue no longer initialized to NULL. - (ffi_prep_cif_machdep): Moved all machine independent cif processing - to src/prep_cif.c. Introduced ffi_prep_cif_machdep. Return types - of FFI_TYPE_STRUCT are no different than FFI_TYPE_INT. - -Tue Oct 1 17:11:02 1996 Anthony Green - - * ffi.c, o32.S, object.mak: Created - ---- libffi/src/sparc ------------------------------------------------------ - -Tue Feb 24 16:33:18 1998 Anthony Green - - * ffi.c (ffi_prep_args): Added long double support. - -Thu May 8 16:53:58 1997 Anthony Green - - * objects.mak: Removed. - -Thu May 1 16:07:56 1997 Anthony Green - - * v8.S: Fixed minor portability problem reported by - Russ McManus . - -Tue Nov 26 14:12:43 1996 Anthony Green - - * v8.S: Used STACKFRAME define elsewhere. - - * ffi.c (ffi_prep_args): Zero out space when USING_PURIFY - is set. - (ffi_prep_cif_machdep): Allocate the correct stack frame - space for functions with < 6 args. - -Tue Oct 29 15:08:55 1996 Anthony Green - - * ffi.c (ffi_prep_args): int z is now size_t z. - -Mon Oct 14 13:31:24 1996 Anthony Green - - * v8.S (ffi_call_V8): Gordon rewrites this again. It looks - great now. - - * ffi.c (ffi_call): The comment about hijacked registers - is no longer valid after gordoni hacked v8.S. - - * v8.S (ffi_call_V8): Rewrote with gordoni. Much simpler. - - * v8.S, ffi.c: ffi_call() had changed to accept more than - two args, so v8.S had to change (because it hijacks incoming - arg registers). - - * ffi.c: Interface changes based on feedback from Jim Blandy. - -Thu Oct 10 17:48:16 1996 Anthony Green - - * ffi.c, v8.S, objects.mak: Created. - - diff --git a/deps/libffi/LICENSE b/deps/libffi/LICENSE deleted file mode 100644 index 12b4970e0ddcb4..00000000000000 --- a/deps/libffi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -libffi - Copyright (c) 1996-2025 Anthony Green, Red Hat, Inc and others. -See source files for details. - -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/deps/libffi/LICENSE-BUILDTOOLS b/deps/libffi/LICENSE-BUILDTOOLS deleted file mode 100644 index d1d626e0085903..00000000000000 --- a/deps/libffi/LICENSE-BUILDTOOLS +++ /dev/null @@ -1,353 +0,0 @@ -The libffi source distribution contains certain code that is not part -of libffi, and is only used as tooling to assist with the building and -testing of libffi. This includes the msvcc.sh script used to wrap the -Microsoft compiler with GNU compatible command-line options, -make_sunver.pl, and the libffi test code distributed in the -testsuite/libffi.bhaible directory. This code is distributed with -libffi for the purpose of convenience only, and libffi is in no way -derived from this code. - -msvcc.sh an testsuite/libffi.bhaible are both distributed under the -terms of the GNU GPL version 2, as below. - - - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/deps/libffi/Makefile.am b/deps/libffi/Makefile.am deleted file mode 100644 index c3bcf00b327955..00000000000000 --- a/deps/libffi/Makefile.am +++ /dev/null @@ -1,162 +0,0 @@ -## Process this with automake to create Makefile.in - -AUTOMAKE_OPTIONS = foreign subdir-objects - -ACLOCAL_AMFLAGS = -I m4 - -# Alias required by AX_ENABLE_BUILDDIR / config-ml -.PHONY: all-configured -all-configured: all - -SUBDIRS = include testsuite man -if BUILD_DOCS -## This hack is needed because it doesn't seem possible to make a -## conditional info_TEXINFOS in Automake. At least Automake 1.14 -## either gives errors -- if this attempted in the most -## straightforward way -- or simply unconditionally tries to build the -## info file. -SUBDIRS += doc -endif - -EXTRA_DIST = LICENSE ChangeLog.old \ - m4/libtool.m4 m4/lt~obsolete.m4 \ - m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \ - m4/ltversion.m4 src/debug.c msvcc.sh \ - generate-darwin-source-and-headers.py \ - libffi.xcodeproj/project.pbxproj \ - src/powerpc/t-aix \ - libtool-ldflags libtool-version configure.host README.md \ - libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl - -# local.exp is generated by configure -DISTCLEANFILES = local.exp - -# Subdir rules rely on $(FLAGS_TO_PASS) -FLAGS_TO_PASS = $(AM_MAKEFLAGS) - -MAKEOVERRIDES= - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libffi.pc - -toolexeclib_LTLIBRARIES = libffi.la -noinst_LTLIBRARIES = libffi_convenience.la - -libffi_la_SOURCES = src/prep_cif.c src/types.c \ - src/raw_api.c src/java_raw_api.c src/closures.c \ - src/tramp.c - -if FFI_DEBUG -libffi_la_SOURCES += src/debug.c -endif - -noinst_HEADERS = src/aarch64/ffitarget.h src/aarch64/internal.h \ - src/alpha/ffitarget.h src/alpha/internal.h \ - src/arc/ffitarget.h src/arm/ffitarget.h src/arm/internal.h \ - src/avr32/ffitarget.h src/bfin/ffitarget.h \ - src/cris/ffitarget.h src/csky/ffitarget.h src/frv/ffitarget.h \ - src/ia64/ffitarget.h src/ia64/ia64_flags.h \ - src/m32r/ffitarget.h src/m68k/ffitarget.h \ - src/m88k/ffitarget.h src/metag/ffitarget.h \ - src/microblaze/ffitarget.h src/mips/ffitarget.h \ - src/moxie/ffitarget.h \ - src/or1k/ffitarget.h src/pa/ffitarget.h \ - src/powerpc/ffitarget.h src/powerpc/asm.h \ - src/powerpc/ffi_powerpc.h src/powerpc/internal.h \ - src/riscv/ffitarget.h \ - src/s390/ffitarget.h src/s390/internal.h src/sh/ffitarget.h \ - src/sh64/ffitarget.h src/sparc/ffitarget.h \ - src/sparc/internal.h src/tile/ffitarget.h src/vax/ffitarget.h \ - src/wasm/ffitarget.h \ - src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h \ - src/x86/asmnames.h src/xtensa/ffitarget.h src/dlmalloc.c \ - src/kvx/ffitarget.h src/kvx/asm.h \ - src/loongarch64/ffitarget.h - -EXTRA_libffi_la_SOURCES = src/aarch64/ffi.c src/aarch64/sysv.S \ - src/aarch64/win64_armasm.S src/alpha/ffi.c src/alpha/osf.S \ - src/arc/ffi.c src/arc/arcompact.S src/arm/ffi.c \ - src/arm/sysv.S src/arm/ffi.c src/arm/sysv_msvc_arm32.S \ - src/avr32/ffi.c src/avr32/sysv.S src/bfin/ffi.c \ - src/bfin/sysv.S src/cris/ffi.c src/cris/sysv.S src/frv/ffi.c \ - src/csky/ffi.c src/csky/sysv.S src/frv/eabi.S src/ia64/ffi.c \ - src/ia64/unix.S src/m32r/ffi.c src/m32r/sysv.S src/m68k/ffi.c \ - src/m68k/sysv.S src/m88k/ffi.c src/m88k/obsd.S \ - src/metag/ffi.c src/metag/sysv.S src/microblaze/ffi.c \ - src/microblaze/sysv.S src/mips/ffi.c src/mips/o32.S \ - src/mips/n32.S src/moxie/ffi.c src/moxie/eabi.S \ - src/or1k/ffi.c \ - src/or1k/sysv.S src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \ - src/pa/hpux64.S src/powerpc/ffi.c src/powerpc/ffi_sysv.c \ - src/powerpc/ffi_linux64.c src/powerpc/sysv.S \ - src/powerpc/linux64.S src/powerpc/linux64_closure.S \ - src/powerpc/ppc_closure.S src/powerpc/aix.S \ - src/powerpc/darwin.S src/powerpc/aix_closure.S \ - src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \ - src/riscv/ffi.c src/riscv/sysv.S src/s390/ffi.c \ - src/s390/sysv.S src/sh/ffi.c src/sh/sysv.S src/sh64/ffi.c \ - src/sh64/sysv.S src/sparc/ffi.c src/sparc/ffi64.c \ - src/sparc/v8.S src/sparc/v9.S src/tile/ffi.c src/tile/tile.S \ - src/vax/ffi.c src/vax/elfbsd.S src/x86/ffi.c src/x86/sysv.S \ - src/wasm/ffi.c \ - src/x86/ffiw64.c src/x86/win64.S src/x86/ffi64.c \ - src/x86/unix64.S src/x86/sysv_intel.S src/x86/win64_intel.S \ - src/xtensa/ffi.c src/xtensa/sysv.S src/kvx/ffi.c \ - src/kvx/sysv.S src/loongarch64/ffi.c src/loongarch64/sysv.S - -TARGET_OBJ = @TARGET_OBJ@ -libffi_la_LIBADD = $(TARGET_OBJ) - -libffi_convenience_la_SOURCES = $(libffi_la_SOURCES) -EXTRA_libffi_convenience_la_SOURCES = $(EXTRA_libffi_la_SOURCES) -libffi_convenience_la_LIBADD = $(libffi_la_LIBADD) -libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES) -nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES) - -LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS)) - -AM_CFLAGS = -if FFI_DEBUG -# Build debug. Define FFI_DEBUG on the commandline so that, when building with -# MSVC, it can link against the debug CRT. -AM_CFLAGS += -DFFI_DEBUG -endif - -if LIBFFI_BUILD_VERSIONED_SHLIB -if LIBFFI_BUILD_VERSIONED_SHLIB_GNU -libffi_version_script = -Wl,--version-script,libffi.map -libffi_version_dep = libffi.map -endif -if LIBFFI_BUILD_VERSIONED_SHLIB_SUN -libffi_version_script = -Wl,-M,libffi.map-sun -libffi_version_dep = libffi.map-sun -libffi.map-sun : libffi.map $(top_srcdir)/make_sunver.pl \ - $(libffi_la_OBJECTS) $(libffi_la_LIBADD) - perl $(top_srcdir)/make_sunver.pl libffi.map \ - `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \ - sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \ - > $@ || (rm -f $@ ; exit 1) -endif -else -libffi_version_script = -libffi_version_dep = -endif -libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` - -libffi.map: $(top_srcdir)/libffi.map.in - $(COMPILE) -D$(TARGET) -DGENERATE_LIBFFI_MAP \ - -E -x assembler-with-cpp -o $@ $(top_srcdir)/libffi.map.in - -libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) -libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) - -AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src -AM_CCASFLAGS = '$(AM_CPPFLAGS)' - -dist-hook: - d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc) - if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog - s=`awk '/was released on/{ print NR; exit}' $(top_srcdir)/README.md`; tail -n +$$(($$s-1)) $(top_srcdir)/README.md > $(distdir)/README.md - -# target overrides --include $(tmake_file) diff --git a/deps/libffi/README.md b/deps/libffi/README.md deleted file mode 100644 index f093c324f66b38..00000000000000 --- a/deps/libffi/README.md +++ /dev/null @@ -1,567 +0,0 @@ -Status -====== - -libffi-3.5.2 was released on August 2, 2025. - - -What is libffi? -=============== - -Compilers for high level languages generate code that follow certain -conventions. These conventions are necessary, in part, for separate -compilation to work. One such convention is the "calling -convention". The "calling convention" is essentially a set of -assumptions made by the compiler about where function arguments will -be found on entry to a function. A "calling convention" also specifies -where the return value for a function is found. - -Some programs may not know at the time of compilation what arguments -are to be passed to a function. For instance, an interpreter may be -told at run-time about the number and types of arguments used to call -a given function. Libffi can be used in such programs to provide a -bridge from the interpreter program to compiled code. - -The libffi library provides a portable, high level programming -interface to various calling conventions. This allows a programmer to -call any function specified by a call interface description at run -time. - -FFI stands for Foreign Function Interface. A foreign function -interface is the popular name for the interface that allows code -written in one language to call code written in another language. The -libffi library really only provides the lowest, machine dependent -layer of a fully featured foreign function interface. A layer must -exist above libffi that handles type conversions for values passed -between the two languages. - - -Supported Platforms -=================== - -Libffi has been ported to many different platforms. - -At the time of release, the following basic configurations have been -tested: - -| Architecture | Operating System | Compiler | -| --------------- | ---------------- | ----------------------- | -| AArch64 (ARM64) | iOS | Clang | -| AArch64 | Linux | GCC | -| AArch64 | Windows | MSVC | -| Alpha | Linux | GCC | -| Alpha | Tru64 | GCC | -| ARC | Linux | GCC | -| ARC32 | Linux | GCC | -| ARC64 | Linux | GCC | -| ARM | Linux | GCC | -| ARM | iOS | GCC | -| ARM | Windows | MSVC | -| AVR32 | Linux | GCC | -| Blackfin | uClinux | GCC | -| CSKY | Linux | GCC | -| HPPA | HPUX | GCC | -| HPPA64 | HPUX | GCC | -| KVX | Linux | GCC | -| IA-64 | Linux | GCC | -| LoongArch64 | Linux | GCC | -| M68K | FreeMiNT | GCC | -| M68K | Linux | GCC | -| M68K | RTEMS | GCC | -| M88K | OpenBSD/mvme88k | GCC | -| Meta | Linux | GCC | -| MicroBlaze | Linux | GCC | -| MIPS | IRIX | GCC | -| MIPS | Linux | GCC | -| MIPS | RTEMS | GCC | -| MIPS64 | Linux | GCC | -| Moxie | Bare metal | GCC | -| OpenRISC | Linux | GCC | -| PowerPC 32-bit | AIX | GCC | -| PowerPC 32-bit | AIX | IBM XL C | -| PowerPC 64-bit | AIX | IBM XL C | -| PowerPC | AMIGA | GCC | -| PowerPC | Linux | GCC | -| PowerPC | Mac OSX | GCC | -| PowerPC | FreeBSD | GCC | -| PowerPC 64-bit | FreeBSD | GCC | -| PowerPC 64-bit | Linux ELFv1 | GCC | -| PowerPC 64-bit | Linux ELFv2 | GCC | -| RISC-V 32-bit | Linux | GCC | -| RISC-V 64-bit | Linux | GCC | -| S390 | Linux | GCC | -| S390X | Linux | GCC | -| SH3 | Linux | GCC | -| SH4 | Linux | GCC | -| SH5/SH64 | Linux | GCC | -| SPARC | Linux | GCC | -| SPARC | Solaris | GCC | -| SPARC | Solaris | Oracle Solaris Studio C | -| SPARC64 | Linux | GCC | -| SPARC64 | FreeBSD | GCC | -| SPARC64 | Solaris | Oracle Solaris Studio C | -| TILE-Gx/TILEPro | Linux | GCC | -| VAX | OpenBSD/vax | GCC | -| WASM32 | Emscripten | EMCC | -| WASM64 | Emscripten | EMCC | -| X86 | FreeBSD | GCC | -| X86 | GNU HURD | GCC | -| X86 | Interix | GCC | -| X86 | kFreeBSD | GCC | -| X86 | Linux | GCC | -| X86 | OpenBSD | GCC | -| X86 | OS/2 | GCC | -| X86 | Solaris | GCC | -| X86 | Solaris | Oracle Solaris Studio C | -| X86 | Windows/Cygwin | GCC | -| X86 | Windows/MinGW | GCC | -| X86-64 | DragonFly BSD | GCC | -| X86-64 | FreeBSD | GCC | -| X86-64 | Linux | GCC | -| X86-64 | Linux/x32 | GCC | -| X86-64 | OpenBSD | GCC | -| X86-64 | Solaris | Oracle Solaris Studio C | -| X86-64 | Windows/Cygwin | GCC | -| X86-64 | Windows/MinGW | GCC | -| X86-64 | Mac OSX | GCC | -| Xtensa | Linux | GCC | - -Please send additional platform test results to -libffi-discuss@sourceware.org. - -Installing libffi -================= - -First you must configure the distribution for your particular -system. Go to the directory you wish to build libffi in and run the -"configure" program found in the root directory of the libffi source -distribution. Note that building libffi requires a C99 compatible -compiler. - -If you're building libffi directly from git hosted sources, configure -won't exist yet; run ./autogen.sh first. This will require that you -install autoconf, automake, libtool and texinfo. - -You may want to tell configure where to install the libffi library and -header files. To do that, use the ``--prefix`` configure switch. Libffi -will install under /usr/local by default. - -If you want to enable extra run-time debugging checks use the the -``--enable-debug`` configure switch. This is useful when your program dies -mysteriously while using libffi. - -Another useful configure switch is ``--enable-purify-safety``. Using this -will add some extra code which will suppress certain warnings when you -are using Purify with libffi. Only use this switch when using -Purify, as it will slow down the library. - -If you don't want to build documentation, use the ``--disable-docs`` -configure switch. - -It's also possible to build libffi on Windows platforms with -Microsoft's Visual C++ compiler. In this case, use the msvcc.sh -wrapper script during configuration like so: - - path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP" CXXCPP="cl -nologo -EP" CPPFLAGS="-DFFI_BUILDING_DLL" - -For 64-bit Windows builds, use ``CC="path/to/msvcc.sh -m64"`` and -``CXX="path/to/msvcc.sh -m64"``. You may also need to specify -``--build`` appropriately. - -It is also possible to build libffi on Windows platforms with the LLVM -project's clang-cl compiler, like below: - - path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP" - -When building with MSVC under a MingW environment, you may need to -remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath' -command. ('cygpath' is not present in MingW, and is not required when -using MingW-style paths.) - -To build static library for ARM64 with MSVC using visual studio solution, msvc_build folder have - aarch64/Ffi_staticLib.sln - required header files in aarch64/aarch64_include/ - - -SPARC Solaris builds require the use of the GNU assembler and linker. -Point ``AS`` and ``LD`` environment variables at those tool prior to -configuration. - -For iOS builds, the ``libffi.xcodeproj`` Xcode project is available. - -Configure has many other options. Use ``configure --help`` to see them all. - -Once configure has finished, type "make". Note that you must be using -GNU make. You can ftp GNU make from ftp.gnu.org:/pub/gnu/make . - -To ensure that libffi is working as advertised, type "make check". -This will require that you have DejaGNU installed. - -To install the library and header files, type ``make install``. - - -History -======= - -See the git log for details at http://github.com/libffi/libffi. - - 3.5.2 Aug-2-2025 - Add wasm64 support. - Add DragonFly BSD support. - Ensure trampoline file descriptors are closed on exec. - - 3.5.1 Jun-10-2025 - Fix symbol versioning error. - - 3.5.0 Jun-8-2025 - Add FFI_VERSION_STRING and FFI_VERSION_NUMBER macros, as well - as ffi_get_version() and ffi_get_version_number() functions. - Add ffi_get_default_abi() and ffi_get_closure_size() functions. - Fix closures on powerpc64-linux when statically linking. - Mark the PA stack as non-executable. - - 3.4.8 Apr-9-2025 - Add static trampoline support for powerpc-linux (32-bit SYSV BE), - powerpc64-linux (64-bit ELFv1 BE) and - powerpc64le-linux (64-bit ELFv2 LE) - Various x86-64 bug fixes (x32 ABI and improper memory access for - small argument calls). - Fix to enable pointer authentication for aarch64. - - 3.4.7 Feb-8-2025 - Add static trampoline support for Linux on s390x. - Fix BTI support for ARM64. - Support pointer authentication for ARM64. - Fix ASAN compatibility. - Fix x86-64 calls with 6 GP registers and some SSE registers. - Miscellaneous fixes for ARC and Darwin ARM64. - Fix OpenRISC or1k and Solaris 10 builds. - Remove nios2 port. - - 3.4.6 Feb-18-2024 - Fix long double regression on mips64 and alpha. - - 3.4.5 Feb-15-2024 - Add support for wasm32. - Add support for aarch64 branch target identification (bti). - Add support for ARCv3: ARC32 & ARC64. - Add support for HPPA64, and many HPPA fixes. - Add support for Haikuos on PowerPC. - Fixes for AIX, loongson, MIPS, power, sparc64, and x86 Darwin. - - 3.4.4 Oct-23-2022 - Important aarch64 fixes, including support for linux builds - with Link Time Optimization (-flto). - Fix x86 stdcall stack alignment. - Fix x86 Windows msvc assembler compatibility. - Fix moxie and or1k small structure args. - - 3.4.3 Sep-19-2022 - All struct args are passed by value, regardless of size, as per ABIs. - Enable static trampolines for Cygwin. - Add support for Loongson's LoongArch64 architecture. - Fix x32 static trampolines. - Fix 32-bit x86 stdcall stack corruption. - Fix ILP32 aarch64 support. - - 3.4.2 Jun-28-2021 - Add static trampoline support for Linux on x86_64 and ARM64. - Add support for Alibaba's CSKY architecture. - Add support for Kalray's KVX architecture. - Add support for Intel Control-flow Enforcement Technology (CET). - Add support for ARM Pointer Authentication (PA). - Fix 32-bit PPC regression. - Fix MIPS soft-float problem. - Enable tmpdir override with the $LIBFFI_TMPDIR environment variable. - Enable compatibility with MSVC runtime stack checking. - Reject float and small integer argument in ffi_prep_cif_var(). - Callers must promote these types themselves. - - 3.3 Nov-23-2019 - Add RISC-V support. - New API in support of GO closures. - Add IEEE754 binary128 long double support for 64-bit Power - Default to Microsoft's 64 bit long double ABI with Visual C++. - GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI. - Add Windows on ARM64 (WOA) support. - Add Windows 32-bit ARM support. - Raw java (gcj) API deprecated. - Add pre-built PDF documentation to source distribution. - Many new test cases and bug fixes. - - 3.2.1 Nov-12-2014 - Build fix for non-iOS AArch64 targets. - - 3.2 Nov-11-2014 - Add C99 Complex Type support (currently only supported on - s390). - Add support for PASCAL and REGISTER calling conventions on x86 - Windows/Linux. - Add OpenRISC and Cygwin-64 support. - Bug fixes. - - 3.1 May-19-2014 - Add AArch64 (ARM64) iOS support. - Add Nios II support. - Add m88k and DEC VAX support. - Add support for stdcall, thiscall, and fastcall on non-Windows - 32-bit x86 targets such as Linux. - Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi - fixes. - Make the testsuite more robust: eliminate several spurious - failures, and respect the $CC and $CXX environment variables. - Archive off the manually maintained ChangeLog in favor of git - log. - - 3.0.13 Mar-17-2013 - Add Meta support. - Add missing Moxie bits. - Fix stack alignment bug on 32-bit x86. - Build fix for m68000 targets. - Build fix for soft-float Power targets. - Fix the install dir location for some platforms when building - with GCC (OS X, Solaris). - Fix Cygwin regression. - - 3.0.12 Feb-11-2013 - Add Moxie support. - Add AArch64 support. - Add Blackfin support. - Add TILE-Gx/TILEPro support. - Add MicroBlaze support. - Add Xtensa support. - Add support for PaX enabled kernels with MPROTECT. - Add support for native vendor compilers on - Solaris and AIX. - Work around LLVM/GCC interoperability issue on x86_64. - - 3.0.11 Apr-11-2012 - Lots of build fixes. - Add support for variadic functions (ffi_prep_cif_var). - Add Linux/x32 support. - Add thiscall, fastcall and MSVC cdecl support on Windows. - Add Amiga and newer MacOS support. - Add m68k FreeMiNT support. - Integration with iOS' xcode build tools. - Fix Octeon and MC68881 support. - Fix code pessimizations. - - 3.0.10 Aug-23-2011 - Add support for Apple's iOS. - Add support for ARM VFP ABI. - Add RTEMS support for MIPS and M68K. - Fix instruction cache clearing problems on - ARM and SPARC. - Fix the N64 build on mips-sgi-irix6.5. - Enable builds with Microsoft's compiler. - Enable x86 builds with Oracle's Solaris compiler. - Fix support for calling code compiled with Oracle's Sparc - Solaris compiler. - Testsuite fixes for Tru64 Unix. - Additional platform support. - - 3.0.9 Dec-31-2009 - Add AVR32 and win64 ports. Add ARM softfp support. - Many fixes for AIX, Solaris, HP-UX, *BSD. - Several PowerPC and x86-64 bug fixes. - Build DLL for windows. - - 3.0.8 Dec-19-2008 - Add *BSD, BeOS, and PA-Linux support. - - 3.0.7 Nov-11-2008 - Fix for ppc FreeBSD. - (thanks to Andreas Tobler) - - 3.0.6 Jul-17-2008 - Fix for closures on sh. - Mark the sh/sh64 stack as non-executable. - (both thanks to Kaz Kojima) - - 3.0.5 Apr-3-2008 - Fix libffi.pc file. - Fix #define ARM for IcedTea users. - Fix x86 closure bug. - - 3.0.4 Feb-24-2008 - Fix x86 OpenBSD configury. - - 3.0.3 Feb-22-2008 - Enable x86 OpenBSD thanks to Thomas Heller, and - x86-64 FreeBSD thanks to Björn König and Andreas Tobler. - Clean up test instruction in README. - - 3.0.2 Feb-21-2008 - Improved x86 FreeBSD support. - Thanks to Björn König. - - 3.0.1 Feb-15-2008 - Fix instruction cache flushing bug on MIPS. - Thanks to David Daney. - - 3.0.0 Feb-15-2008 - Many changes, mostly thanks to the GCC project. - Cygnus Solutions is now Red Hat. - - [10 years go by...] - - 1.20 Oct-5-1998 - Raffaele Sena produces ARM port. - - 1.19 Oct-5-1998 - Fixed x86 long double and long long return support. - m68k bug fixes from Andreas Schwab. - Patch for DU assembler compatibility for the Alpha from Richard - Henderson. - - 1.18 Apr-17-1998 - Bug fixes and MIPS configuration changes. - - 1.17 Feb-24-1998 - Bug fixes and m68k port from Andreas Schwab. PowerPC port from - Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes. - - 1.16 Feb-11-1998 - Richard Henderson produces Alpha port. - - 1.15 Dec-4-1997 - Fixed an n32 ABI bug. New libtool, auto* support. - - 1.14 May-13-97 - libtool is now used to generate shared and static libraries. - Fixed a minor portability problem reported by Russ McManus - . - - 1.13 Dec-2-1996 - Added --enable-purify-safety to keep Purify from complaining - about certain low level code. - Sparc fix for calling functions with < 6 args. - Linux x86 a.out fix. - - 1.12 Nov-22-1996 - Added missing ffi_type_void, needed for supporting void return - types. Fixed test case for non MIPS machines. Cygnus Support - is now Cygnus Solutions. - - 1.11 Oct-30-1996 - Added notes about GNU make. - - 1.10 Oct-29-1996 - Added configuration fix for non GNU compilers. - - 1.09 Oct-29-1996 - Added --enable-debug configure switch. Clean-ups based on LCLint - feedback. ffi_mips.h is always installed. Many configuration - fixes. Fixed ffitest.c for sparc builds. - - 1.08 Oct-15-1996 - Fixed n32 problem. Many clean-ups. - - 1.07 Oct-14-1996 - Gordon Irlam rewrites v8.S again. Bug fixes. - - 1.06 Oct-14-1996 - Gordon Irlam improved the sparc port. - - 1.05 Oct-14-1996 - Interface changes based on feedback. - - 1.04 Oct-11-1996 - Sparc port complete (modulo struct passing bug). - - 1.03 Oct-10-1996 - Passing struct args, and returning struct values works for - all architectures/calling conventions. Expanded tests. - - 1.02 Oct-9-1996 - Added SGI n32 support. Fixed bugs in both o32 and Linux support. - Added "make test". - - 1.01 Oct-8-1996 - Fixed float passing bug in mips version. Restructured some - of the code. Builds cleanly with SGI tools. - - 1.00 Oct-7-1996 - First release. No public announcement. - -Authors & Credits -================= - -libffi was originally written by Anthony Green . - -The developers of the GNU Compiler Collection project have made -innumerable valuable contributions. See the ChangeLog file for -details. - -Some of the ideas behind libffi were inspired by Gianni Mariani's free -gencall library for Silicon Graphics machines. - -The closure mechanism was designed and implemented by Kresten Krab -Thorup. - -Major processor architecture ports were contributed by the following -developers: - - aarch64 Marcus Shawcroft, James Greenhalgh - alpha Richard Henderson - arc Hackers at Synopsis - arm Raffaele Sena - avr32 Bradley Smith - blackfin Alexandre Keunecke I. de Mendonca - cris Simon Posnjak, Hans-Peter Nilsson - csky Ma Jun, Zhang Wenmeng - frv Anthony Green - ia64 Hans Boehm - kvx Yann Sionneau - loongarch64 Cheng Lulu, Xi Ruoyao, Xu Hao, - Zhang Wenlong, Pan Xuefeng - m32r Kazuhiro Inaoka - m68k Andreas Schwab - m88k Miod Vallat - metag Hackers at Imagination Technologies - microblaze Nathan Rossi - mips Anthony Green, Casey Marshall - mips64 David Daney - moxie Anthony Green - nios ii Sandra Loosemore - openrisc Sebastian Macke - pa Randolph Chung, Dave Anglin, Andreas Tobler - pa64 Dave Anglin - powerpc Geoffrey Keating, Andreas Tobler, - David Edelsohn, John Hornkvist - powerpc64 Jakub Jelinek - riscv Michael Knyszek, Andrew Waterman, Stef O'Rear - s390 Gerhard Tonn, Ulrich Weigand - sh Kaz Kojima - sh64 Kaz Kojima - sparc Anthony Green, Gordon Irlam - tile-gx/tilepro Walter Lee - vax Miod Vallat - wasm32 Hood Chatham, Brion Vibber, Kleis Auke Wolthuizen - x86 Anthony Green, Jon Beniston - x86-64 Bo Thorsen - xtensa Chris Zankel - -Jesper Skov and Andrew Haley both did more than their fair share of -stepping through the code and tracking down bugs. - -Thanks also to Tom Tromey for bug fixes, documentation and -configuration help. - -Thanks to Jim Blandy, who provided some useful feedback on the libffi -interface. - -Andreas Tobler has done a tremendous amount of work on the testsuite. - -Alex Oliva solved the executable page problem for SElinux. - -The list above is almost certainly incomplete and inaccurate. I'm -happy to make corrections or additions upon request. - -If you have a problem, or have found a bug, please file an issue on -our issue tracker at https://github.com/libffi/libffi/issues. - -The author can be reached at green@moxielogic.com. - -To subscribe/unsubscribe to our mailing lists, visit: -https://sourceware.org/mailman/listinfo/libffi-announce -https://sourceware.org/mailman/listinfo/libffi-discuss diff --git a/deps/libffi/acinclude.m4 b/deps/libffi/acinclude.m4 deleted file mode 100644 index 9624bbed0bdf8f..00000000000000 --- a/deps/libffi/acinclude.m4 +++ /dev/null @@ -1,383 +0,0 @@ -# mmap(2) blacklisting. Some platforms provide the mmap library routine -# but don't support all of the features we need from it. -AC_DEFUN([AC_FUNC_MMAP_BLACKLIST], -[ -AC_CHECK_HEADER([sys/mman.h], - [libffi_header_sys_mman_h=yes], [libffi_header_sys_mman_h=no]) -AC_CHECK_FUNC([mmap], [libffi_func_mmap=yes], [libffi_func_mmap=no]) -if test "$libffi_header_sys_mman_h" != yes \ - || test "$libffi_func_mmap" != yes; then - ac_cv_func_mmap_file=no - ac_cv_func_mmap_dev_zero=no - ac_cv_func_mmap_anon=no -else - AC_CACHE_CHECK([whether read-only mmap of a plain file works], - ac_cv_func_mmap_file, - [# Add a system to this blacklist if - # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a - # memory area containing the same data that you'd get if you applied - # read() to the same fd. The only system known to have a problem here - # is VMS, where text files have record structure. - case "$host_os" in - vms* | ultrix*) - ac_cv_func_mmap_file=no ;; - *) - ac_cv_func_mmap_file=yes;; - esac]) - AC_CACHE_CHECK([whether mmap from /dev/zero works], - ac_cv_func_mmap_dev_zero, - [# Add a system to this blacklist if it has mmap() but /dev/zero - # does not exist, or if mmapping /dev/zero does not give anonymous - # zeroed pages with both the following properties: - # 1. If you map N consecutive pages in with one call, and then - # unmap any subset of those pages, the pages that were not - # explicitly unmapped remain accessible. - # 2. If you map two adjacent blocks of memory and then unmap them - # both at once, they must both go away. - # Systems known to be in this category are Windows (all variants), - # VMS, and Darwin. - case "$host_os" in - vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) - ac_cv_func_mmap_dev_zero=no ;; - *) - ac_cv_func_mmap_dev_zero=yes;; - esac]) - - # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. - AC_CACHE_CHECK([for MAP_ANON(YMOUS)], ac_cv_decl_map_anon, - [AC_COMPILE_IFELSE( -[AC_LANG_PROGRAM([[#include -#include -#include - -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif -]], -[[int n = MAP_ANONYMOUS;]])], - ac_cv_decl_map_anon=yes, - ac_cv_decl_map_anon=no)]) - - if test $ac_cv_decl_map_anon = no; then - ac_cv_func_mmap_anon=no - else - AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works], - ac_cv_func_mmap_anon, - [# Add a system to this blacklist if it has mmap() and MAP_ANON or - # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) - # doesn't give anonymous zeroed pages with the same properties listed - # above for use of /dev/zero. - # Systems known to be in this category are Windows, VMS, and SCO Unix. - case "$host_os" in - vms* | cygwin* | pe | mingw* | sco* | udk* ) - ac_cv_func_mmap_anon=no ;; - *) - ac_cv_func_mmap_anon=yes;; - esac]) - fi -fi - -if test $ac_cv_func_mmap_file = yes; then - AC_DEFINE(HAVE_MMAP_FILE, 1, - [Define if read-only mmap of a plain file works.]) -fi -if test $ac_cv_func_mmap_dev_zero = yes; then - AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1, - [Define if mmap of /dev/zero works.]) -fi -if test $ac_cv_func_mmap_anon = yes; then - AC_DEFINE(HAVE_MMAP_ANON, 1, - [Define if mmap with MAP_ANON(YMOUS) works.]) -fi -]) - -dnl ---------------------------------------------------------------------- -dnl This whole bit snagged from libstdc++-v3, via libatomic. - -dnl -dnl LIBFFI_ENABLE -dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING) -dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c) -dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER) -dnl -dnl See docs/html/17_intro/configury.html#enable for documentation. -dnl -m4_define([LIBFFI_ENABLE],[dnl -m4_define([_g_switch],[--enable-$1])dnl -m4_define([_g_help],[AS_HELP_STRING([_g_switch$3],[$4 @<:@default=$2@:>@])])dnl - AC_ARG_ENABLE($1,_g_help, - m4_bmatch([$5], - [^permit ], - [[ - case "$enableval" in - m4_bpatsubst([$5],[permit ])) ;; - *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;; - dnl Idea for future: generate a URL pointing to - dnl "onlinedocs/configopts.html#whatever" - esac - ]], - [^$], - [[ - case "$enableval" in - yes|no) ;; - *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;; - esac - ]], - [[$5]]), - [enable_]m4_bpatsubst([$1],-,_)[=][$2]) -m4_undefine([_g_switch])dnl -m4_undefine([_g_help])dnl -]) - -dnl -dnl If GNU ld is in use, check to see if tricky linker opts can be used. If -dnl the native linker is in use, all variables will be defined to something -dnl safe (like an empty string). -dnl -dnl Defines: -dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible -dnl OPT_LDFLAGS='-Wl,-O1' if possible -dnl LD (as a side effect of testing) -dnl Sets: -dnl with_gnu_ld -dnl libat_ld_is_gold (possibly) -dnl libat_gnu_ld_version (possibly) -dnl -dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will -dnl set libat_gnu_ld_version to 12345. Zeros cause problems. -dnl -AC_DEFUN([LIBFFI_CHECK_LINKER_FEATURES], [ - # If we're not using GNU ld, then there's no point in even trying these - # tests. Check for that first. We should have already tested for gld - # by now (in libtool), but require it now just to be safe... - test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS='' - test -z "$OPT_LDFLAGS" && OPT_LDFLAGS='' - AC_REQUIRE([LT_PATH_LD]) - AC_REQUIRE([AC_PROG_AWK]) - - # The name set by libtool depends on the version of libtool. Shame on us - # for depending on an impl detail, but c'est la vie. Older versions used - # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on - # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually - # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't - # set (hence we're using an older libtool), then set it. - if test x${with_gnu_ld+set} != xset; then - if test x${ac_cv_prog_gnu_ld+set} != xset; then - # We got through "ac_require(ac_prog_ld)" and still not set? Huh? - with_gnu_ld=no - else - with_gnu_ld=$ac_cv_prog_gnu_ld - fi - fi - - # Start by getting the version number. I think the libtool test already - # does some of this, but throws away the result. - libat_ld_is_gold=no - if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then - libat_ld_is_gold=yes - fi - libat_ld_is_lld=no - if $LD --version 2>/dev/null | grep 'LLD '> /dev/null 2>&1; then - libat_ld_is_lld=yes - fi - libat_ld_is_mold=no - if $LD --version 2>/dev/null | grep 'mold '> /dev/null 2>&1; then - libat_ld_is_mold=yes - fi - changequote(,) - ldver=`$LD --version 2>/dev/null | - sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'` - changequote([,]) - libat_gnu_ld_version=`echo $ldver | \ - $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'` - - # Set --gc-sections. - if test "$with_gnu_ld" = "notbroken"; then - # GNU ld it is! Joy and bunny rabbits! - - # All these tests are for C++; save the language and the compiler flags. - # Need to do this so that g++ won't try to link in libstdc++ - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS='-x c++ -Wl,--gc-sections' - - # Check for -Wl,--gc-sections - # XXX This test is broken at the moment, as symbols required for linking - # are now in libsupc++ (not built yet). In addition, this test has - # cored on solaris in the past. In addition, --gc-sections doesn't - # really work at the moment (keeps on discarding used sections, first - # .eh_frame and now some of the glibc sections for iconv). - # Bzzzzt. Thanks for playing, maybe next time. - AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - int main(void) - { - try { throw 1; } - catch (...) { }; - return 0; - } - ]])],[ac_sectionLDflags=yes],[ac_sectionLDflags=no],[ac_sectionLDflags=yes]) - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - else - # this is the suspicious part - CFLAGS='' - fi - if test "$ac_sectionLDflags" = "yes"; then - SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS" - fi - AC_MSG_RESULT($ac_sectionLDflags) - fi - - # Set linker optimization flags. - if test x"$with_gnu_ld" = x"yes"; then - OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" - fi - - AC_SUBST(SECTION_LDFLAGS) - AC_SUBST(OPT_LDFLAGS) -]) - - -dnl -dnl Add version tags to symbols in shared library (or not), additionally -dnl marking other symbols as private/local (or not). -dnl -dnl --enable-symvers=style adds a version script to the linker call when -dnl creating the shared library. The choice of version script is -dnl controlled by 'style'. -dnl --disable-symvers does not. -dnl + Usage: LIBFFI_ENABLE_SYMVERS[(DEFAULT)] -dnl Where DEFAULT is either 'yes' or 'no'. Passing `yes' tries to -dnl choose a default style based on linker characteristics. Passing -dnl 'no' disables versioning. -dnl -AC_DEFUN([LIBFFI_ENABLE_SYMVERS], [ - -LIBFFI_ENABLE(symvers,yes,[=STYLE], - [enables symbol versioning of the shared library], - [permit yes|no|gnu*|sun]) - -# If we never went through the LIBFFI_CHECK_LINKER_FEATURES macro, then we -# don't know enough about $LD to do tricks... -AC_REQUIRE([LIBFFI_CHECK_LINKER_FEATURES]) - -# Turn a 'yes' into a suitable default. -if test x$enable_symvers = xyes ; then - # FIXME The following test is too strict, in theory. - if test $enable_shared = no || test "x$LD" = x; then - enable_symvers=no - else - if test $with_gnu_ld = yes ; then - enable_symvers=gnu - else - case ${target_os} in - # Sun symbol versioning exists since Solaris 2.5. - solaris2.[[5-9]]* | solaris2.1[[0-9]]*) - enable_symvers=sun ;; - *) - enable_symvers=no ;; - esac - fi - fi -fi - -# Check if 'sun' was requested on non-Solaris 2 platforms. -if test x$enable_symvers = xsun ; then - case ${target_os} in - solaris2*) - # All fine. - ;; - *) - # Unlikely to work. - AC_MSG_WARN([=== You have requested Sun symbol versioning, but]) - AC_MSG_WARN([=== you are not targetting Solaris 2.]) - AC_MSG_WARN([=== Symbol versioning will be disabled.]) - enable_symvers=no - ;; - esac -fi - -# Check to see if libgcc_s exists, indicating that shared libgcc is possible. -if test $enable_symvers != no; then - AC_MSG_CHECKING([for shared libgcc]) - ac_save_CFLAGS="$CFLAGS" - CFLAGS=' -lgcc_s' - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[libat_shared_libgcc=yes],[libat_shared_libgcc=no]) - CFLAGS="$ac_save_CFLAGS" - if test $libat_shared_libgcc = no; then - cat > conftest.c <&1 >/dev/null \ - | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'` -changequote([,])dnl - rm -f conftest.c conftest.so - if test x${libat_libgcc_s_suffix+set} = xset; then - CFLAGS=" -lgcc_s$libat_libgcc_s_suffix" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[libat_shared_libgcc=yes],[]) - CFLAGS="$ac_save_CFLAGS" - fi - fi - AC_MSG_RESULT($libat_shared_libgcc) -fi - -# For GNU ld, we need at least this version. The format is described in -# LIBFFI_CHECK_LINKER_FEATURES above. -libat_min_gnu_ld_version=21400 -# XXXXXXXXXXX libat_gnu_ld_version=21390 - -# Check to see if unspecified "yes" value can win, given results above. -# Change "yes" into either "no" or a style name. -if test $enable_symvers != no && test $libat_shared_libgcc = yes; then - if test $with_gnu_ld = yes; then - if test $libat_gnu_ld_version -ge $libat_min_gnu_ld_version ; then - enable_symvers=gnu - elif test $libat_ld_is_gold = yes ; then - enable_symvers=gnu - elif test $libat_ld_is_lld = yes ; then - enable_symvers=gnu - elif test $libat_ld_is_mold = yes ; then - enable_symvers=gnu - else - # The right tools, the right setup, but too old. Fallbacks? - AC_MSG_WARN(=== Linker version $libat_gnu_ld_version is too old for) - AC_MSG_WARN(=== full symbol versioning support in this release of GCC.) - AC_MSG_WARN(=== You would need to upgrade your binutils to version) - AC_MSG_WARN(=== $libat_min_gnu_ld_version or later and rebuild GCC.) - if test $libat_gnu_ld_version -ge 21200 ; then - # Globbing fix is present, proper block support is not. - dnl AC_MSG_WARN([=== Dude, you are soooo close. Maybe we can fake it.]) - dnl enable_symvers=??? - AC_MSG_WARN([=== Symbol versioning will be disabled.]) - enable_symvers=no - else - # 2.11 or older. - AC_MSG_WARN([=== Symbol versioning will be disabled.]) - enable_symvers=no - fi - fi - elif test $enable_symvers = sun; then - : All interesting versions of Sun ld support sun style symbol versioning. - else - # just fail for now - AC_MSG_WARN([=== You have requested some kind of symbol versioning, but]) - AC_MSG_WARN([=== either you are not using a supported linker, or you are]) - AC_MSG_WARN([=== not building a shared libgcc_s (which is required).]) - AC_MSG_WARN([=== Symbol versioning will be disabled.]) - enable_symvers=no - fi -fi -if test $enable_symvers = gnu; then - AC_DEFINE(LIBFFI_GNU_SYMBOL_VERSIONING, 1, - [Define to 1 if GNU symbol versioning is used for libatomic.]) -fi - -AM_CONDITIONAL(LIBFFI_BUILD_VERSIONED_SHLIB, test $enable_symvers != no) -AM_CONDITIONAL(LIBFFI_BUILD_VERSIONED_SHLIB_GNU, test $enable_symvers = gnu) -AM_CONDITIONAL(LIBFFI_BUILD_VERSIONED_SHLIB_SUN, test $enable_symvers = sun) -AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers) -]) diff --git a/deps/libffi/autogen.sh b/deps/libffi/autogen.sh deleted file mode 100755 index fb014a33ea3bf4..00000000000000 --- a/deps/libffi/autogen.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec autoreconf -v -i diff --git a/deps/libffi/config.guess b/deps/libffi/config.guess deleted file mode 100644 index f6d217a49f8f4a..00000000000000 --- a/deps/libffi/config.guess +++ /dev/null @@ -1,1812 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2024 Free Software Foundation, Inc. - -# shellcheck disable=SC2006,SC2268 # see below for rationale - -timestamp='2024-01-01' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess -# -# Please send patches to . - - -# The "shellcheck disable" line above the timestamp inhibits complaints -# about features and limitations of the classic Bourne shell that were -# superseded or lifted in POSIX. However, this script identifies a wide -# variety of pre-POSIX systems that do not have POSIX shells at all, and -# even some reasonably current systems (Solaris 10 as case-in-point) still -# have a pre-POSIX /bin/sh. - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system '$me' is run on. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2024 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try '$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -# Just in case it came from the environment. -GUESS= - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still -# use 'HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -tmp= -# shellcheck disable=SC2172 -trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 - -set_cc_for_build() { - # prevent multiple calls if $tmp is already set - test "$tmp" && return 0 - : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039,SC3028 - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } - dummy=$tmp/dummy - case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in - ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do - if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD=$driver - break - fi - done - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; - esac -} - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if test -f /.attbin/uname ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case $UNAME_SYSTEM in -Linux|GNU|GNU/*) - LIBC=unknown - - set_cc_for_build - cat <<-EOF > "$dummy.c" - #if defined(__ANDROID__) - LIBC=android - #else - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #elif defined(__GLIBC__) - LIBC=gnu - #elif defined(__LLVM_LIBC__) - LIBC=llvm - #else - #include - /* First heuristic to detect musl libc. */ - #ifdef __DEFINED_va_list - LIBC=musl - #endif - #endif - #endif - EOF - cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` - eval "$cc_set_libc" - - # Second heuristic to detect musl libc. - if [ "$LIBC" = unknown ] && - command -v ldd >/dev/null && - ldd --version 2>&1 | grep -q ^musl; then - LIBC=musl - fi - - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - if [ "$LIBC" = unknown ]; then - LIBC=gnu - fi - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ - /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ - echo unknown)` - case $UNAME_MACHINE_ARCH in - aarch64eb) machine=aarch64_be-unknown ;; - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown - ;; - *) machine=$UNAME_MACHINE_ARCH-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently (or will in the future) and ABI. - case $UNAME_MACHINE_ARCH in - earm*) - os=netbsdelf - ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # Determine ABI tags. - case $UNAME_MACHINE_ARCH in - earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case $UNAME_VERSION in - Debian*) - release='-gnu' - ;; - *) - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - GUESS=$machine-${os}${release}${abi-} - ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE - ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE - ;; - *:SecBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` - GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE - ;; - *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE - ;; - *:MidnightBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE - ;; - *:ekkoBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE - ;; - *:SolidBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE - ;; - *:OS108:*:*) - GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE - ;; - macppc:MirBSD:*:*) - GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE - ;; - *:MirBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE - ;; - *:Sortix:*:*) - GUESS=$UNAME_MACHINE-unknown-sortix - ;; - *:Twizzler:*:*) - GUESS=$UNAME_MACHINE-unknown-twizzler - ;; - *:Redox:*:*) - GUESS=$UNAME_MACHINE-unknown-redox - ;; - mips:OSF1:*.*) - GUESS=mips-dec-osf1 - ;; - alpha:OSF1:*:*) - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - trap '' 0 - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case $ALPHA_CPU_TYPE in - "EV4 (21064)") - UNAME_MACHINE=alpha ;; - "EV4.5 (21064)") - UNAME_MACHINE=alpha ;; - "LCA4 (21066/21068)") - UNAME_MACHINE=alpha ;; - "EV5 (21164)") - UNAME_MACHINE=alphaev5 ;; - "EV5.6 (21164A)") - UNAME_MACHINE=alphaev56 ;; - "EV5.6 (21164PC)") - UNAME_MACHINE=alphapca56 ;; - "EV5.7 (21164PC)") - UNAME_MACHINE=alphapca57 ;; - "EV6 (21264)") - UNAME_MACHINE=alphaev6 ;; - "EV6.7 (21264A)") - UNAME_MACHINE=alphaev67 ;; - "EV6.8CB (21264C)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8AL (21264B)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8CX (21264D)") - UNAME_MACHINE=alphaev68 ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE=alphaev69 ;; - "EV7 (21364)") - UNAME_MACHINE=alphaev7 ;; - "EV7.9 (21364A)") - UNAME_MACHINE=alphaev79 ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - GUESS=$UNAME_MACHINE-dec-osf$OSF_REL - ;; - Amiga*:UNIX_System_V:4.0:*) - GUESS=m68k-unknown-sysv4 - ;; - *:[Aa]miga[Oo][Ss]:*:*) - GUESS=$UNAME_MACHINE-unknown-amigaos - ;; - *:[Mm]orph[Oo][Ss]:*:*) - GUESS=$UNAME_MACHINE-unknown-morphos - ;; - *:OS/390:*:*) - GUESS=i370-ibm-openedition - ;; - *:z/VM:*:*) - GUESS=s390-ibm-zvmoe - ;; - *:OS400:*:*) - GUESS=powerpc-ibm-os400 - ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - GUESS=arm-acorn-riscix$UNAME_RELEASE - ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - GUESS=arm-unknown-riscos - ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - GUESS=hppa1.1-hitachi-hiuxmpp - ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - case `(/bin/universe) 2>/dev/null` in - att) GUESS=pyramid-pyramid-sysv3 ;; - *) GUESS=pyramid-pyramid-bsd ;; - esac - ;; - NILE*:*:*:dcosx) - GUESS=pyramid-pyramid-svr4 - ;; - DRS?6000:unix:4.0:6*) - GUESS=sparc-icl-nx6 - ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) GUESS=sparc-icl-nx7 ;; - esac - ;; - s390x:SunOS:*:*) - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL - ;; - sun4H:SunOS:5.*:*) - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=sparc-hal-solaris2$SUN_REL - ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=sparc-sun-solaris2$SUN_REL - ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - GUESS=i386-pc-auroraux$UNAME_RELEASE - ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - set_cc_for_build - SUN_ARCH=i386 - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH=x86_64 - fi - fi - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=$SUN_ARCH-pc-solaris2$SUN_REL - ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=sparc-sun-solaris3$SUN_REL - ;; - sun4*:SunOS:*:*) - case `/usr/bin/arch -k` in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like '4.1.3-JL'. - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` - GUESS=sparc-sun-sunos$SUN_REL - ;; - sun3*:SunOS:*:*) - GUESS=m68k-sun-sunos$UNAME_RELEASE - ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case `/bin/arch` in - sun3) - GUESS=m68k-sun-sunos$UNAME_RELEASE - ;; - sun4) - GUESS=sparc-sun-sunos$UNAME_RELEASE - ;; - esac - ;; - aushp:SunOS:*:*) - GUESS=sparc-auspex-sunos$UNAME_RELEASE - ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - GUESS=m68k-atari-mint$UNAME_RELEASE - ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - GUESS=m68k-atari-mint$UNAME_RELEASE - ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - GUESS=m68k-atari-mint$UNAME_RELEASE - ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - GUESS=m68k-milan-mint$UNAME_RELEASE - ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - GUESS=m68k-hades-mint$UNAME_RELEASE - ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - GUESS=m68k-unknown-mint$UNAME_RELEASE - ;; - m68k:machten:*:*) - GUESS=m68k-apple-machten$UNAME_RELEASE - ;; - powerpc:machten:*:*) - GUESS=powerpc-apple-machten$UNAME_RELEASE - ;; - RISC*:Mach:*:*) - GUESS=mips-dec-mach_bsd4.3 - ;; - RISC*:ULTRIX:*:*) - GUESS=mips-dec-ultrix$UNAME_RELEASE - ;; - VAX*:ULTRIX*:*:*) - GUESS=vax-dec-ultrix$UNAME_RELEASE - ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - GUESS=clipper-intergraph-clix$UNAME_RELEASE - ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`"$dummy" "$dummyarg"` && - { echo "$SYSTEM_NAME"; exit; } - GUESS=mips-mips-riscos$UNAME_RELEASE - ;; - Motorola:PowerMAX_OS:*:*) - GUESS=powerpc-motorola-powermax - ;; - Motorola:*:4.3:PL8-*) - GUESS=powerpc-harris-powermax - ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - GUESS=powerpc-harris-powermax - ;; - Night_Hawk:Power_UNIX:*:*) - GUESS=powerpc-harris-powerunix - ;; - m88k:CX/UX:7*:*) - GUESS=m88k-harris-cxux7 - ;; - m88k:*:4*:R4*) - GUESS=m88k-motorola-sysv4 - ;; - m88k:*:3*:R3*) - GUESS=m88k-motorola-sysv3 - ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 - then - if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ - test "$TARGET_BINARY_INTERFACE"x = x - then - GUESS=m88k-dg-dgux$UNAME_RELEASE - else - GUESS=m88k-dg-dguxbcs$UNAME_RELEASE - fi - else - GUESS=i586-dg-dgux$UNAME_RELEASE - fi - ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - GUESS=m88k-dolphin-sysv3 - ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - GUESS=m88k-motorola-sysv3 - ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - GUESS=m88k-tektronix-sysv3 - ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - GUESS=m68k-tektronix-bsd - ;; - *:IRIX*:*:*) - IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` - GUESS=mips-sgi-irix$IRIX_REL - ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id - ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - GUESS=i386-ibm-aix - ;; - ia64:AIX:*:*) - if test -x /usr/bin/oslevel ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=$UNAME_VERSION.$UNAME_RELEASE - fi - GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV - ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` - then - GUESS=$SYSTEM_NAME - else - GUESS=rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - GUESS=rs6000-ibm-aix3.2.4 - else - GUESS=rs6000-ibm-aix3.2 - fi - ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if test -x /usr/bin/lslpp ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - else - IBM_REV=$UNAME_VERSION.$UNAME_RELEASE - fi - GUESS=$IBM_ARCH-ibm-aix$IBM_REV - ;; - *:AIX:*:*) - GUESS=rs6000-ibm-aix - ;; - ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - GUESS=romp-ibm-bsd4.4 - ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to - ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - GUESS=rs6000-bull-bosx - ;; - DPX/2?00:B.O.S.:*:*) - GUESS=m68k-bull-sysv3 - ;; - 9000/[34]??:4.3bsd:1.*:*) - GUESS=m68k-hp-bsd - ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - GUESS=m68k-hp-bsd4.4 - ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` - case $UNAME_MACHINE in - 9000/31?) HP_ARCH=m68000 ;; - 9000/[34]??) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if test -x /usr/bin/getconf; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case $sc_cpu_version in - 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 - 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case $sc_kernel_bits in - 32) HP_ARCH=hppa2.0n ;; - 64) HP_ARCH=hppa2.0w ;; - '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 - esac ;; - esac - fi - if test "$HP_ARCH" = ""; then - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if test "$HP_ARCH" = hppa2.0w - then - set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH=hppa2.0w - else - HP_ARCH=hppa64 - fi - fi - GUESS=$HP_ARCH-hp-hpux$HPUX_REV - ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` - GUESS=ia64-hp-hpux$HPUX_REV - ;; - 3050*:HI-UX:*:*) - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && - { echo "$SYSTEM_NAME"; exit; } - GUESS=unknown-hitachi-hiuxwe2 - ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - GUESS=hppa1.1-hp-bsd - ;; - 9000/8??:4.3bsd:*:*) - GUESS=hppa1.0-hp-bsd - ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - GUESS=hppa1.0-hp-mpeix - ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - GUESS=hppa1.1-hp-osf - ;; - hp8??:OSF1:*:*) - GUESS=hppa1.0-hp-osf - ;; - i*86:OSF1:*:*) - if test -x /usr/sbin/sysversion ; then - GUESS=$UNAME_MACHINE-unknown-osf1mk - else - GUESS=$UNAME_MACHINE-unknown-osf1 - fi - ;; - parisc*:Lites*:*:*) - GUESS=hppa1.1-hp-lites - ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - GUESS=c1-convex-bsd - ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - GUESS=c34-convex-bsd - ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - GUESS=c38-convex-bsd - ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - GUESS=c4-convex-bsd - ;; - CRAY*Y-MP:*:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=ymp-cray-unicos$CRAY_REL - ;; - CRAY*[A-Z]90:*:*:*) - echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=t90-cray-unicos$CRAY_REL - ;; - CRAY*T3E:*:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=alphaev5-cray-unicosmk$CRAY_REL - ;; - CRAY*SV1:*:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=sv1-cray-unicos$CRAY_REL - ;; - *:UNICOS/mp:*:*) - CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` - GUESS=craynv-cray-unicosmp$CRAY_REL - ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` - GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} - ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} - ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE - ;; - sparc*:BSD/OS:*:*) - GUESS=sparc-unknown-bsdi$UNAME_RELEASE - ;; - *:BSD/OS:*:*) - GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE - ;; - arm:FreeBSD:*:*) - UNAME_PROCESSOR=`uname -p` - set_cc_for_build - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi - else - FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf - fi - ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`uname -p` - case $UNAME_PROCESSOR in - amd64) - UNAME_PROCESSOR=x86_64 ;; - i386) - UNAME_PROCESSOR=i586 ;; - esac - FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL - ;; - i*:CYGWIN*:*) - GUESS=$UNAME_MACHINE-pc-cygwin - ;; - *:MINGW64*:*) - GUESS=$UNAME_MACHINE-pc-mingw64 - ;; - *:MINGW*:*) - GUESS=$UNAME_MACHINE-pc-mingw32 - ;; - *:MSYS*:*) - GUESS=$UNAME_MACHINE-pc-msys - ;; - i*:PW*:*) - GUESS=$UNAME_MACHINE-pc-pw32 - ;; - *:SerenityOS:*:*) - GUESS=$UNAME_MACHINE-pc-serenity - ;; - *:Interix*:*) - case $UNAME_MACHINE in - x86) - GUESS=i586-pc-interix$UNAME_RELEASE - ;; - authenticamd | genuineintel | EM64T) - GUESS=x86_64-unknown-interix$UNAME_RELEASE - ;; - IA64) - GUESS=ia64-unknown-interix$UNAME_RELEASE - ;; - esac ;; - i*:UWIN*:*) - GUESS=$UNAME_MACHINE-pc-uwin - ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - GUESS=x86_64-pc-cygwin - ;; - prep*:SunOS:5.*:*) - SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` - GUESS=powerpcle-unknown-solaris2$SUN_REL - ;; - *:GNU:*:*) - # the GNU system - GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` - GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` - GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL - ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` - GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC - ;; - x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) - GUESS="$UNAME_MACHINE-pc-managarm-mlibc" - ;; - *:[Mm]anagarm:*:*) - GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" - ;; - *:Minix:*:*) - GUESS=$UNAME_MACHINE-unknown-minix - ;; - aarch64:Linux:*:*) - set_cc_for_build - CPU=$UNAME_MACHINE - LIBCABI=$LIBC - if test "$CC_FOR_BUILD" != no_compiler_found; then - ABI=64 - sed 's/^ //' << EOF > "$dummy.c" - #ifdef __ARM_EABI__ - #ifdef __ARM_PCS_VFP - ABI=eabihf - #else - ABI=eabi - #endif - #endif -EOF - cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` - eval "$cc_set_abi" - case $ABI in - eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; - esac - fi - GUESS=$CPU-unknown-linux-$LIBCABI - ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - arm*:Linux:*:*) - set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi - else - GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf - fi - fi - ;; - avr32*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - cris:Linux:*:*) - GUESS=$UNAME_MACHINE-axis-linux-$LIBC - ;; - crisv32:Linux:*:*) - GUESS=$UNAME_MACHINE-axis-linux-$LIBC - ;; - e2k:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - frv:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - hexagon:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - i*86:Linux:*:*) - GUESS=$UNAME_MACHINE-pc-linux-$LIBC - ;; - ia64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - k1om:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - kvx:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - kvx:cos:*:*) - GUESS=$UNAME_MACHINE-unknown-cos - ;; - kvx:mbr:*:*) - GUESS=$UNAME_MACHINE-unknown-mbr - ;; - loongarch32:Linux:*:* | loongarch64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - m32r*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - m68*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - mips:Linux:*:* | mips64:Linux:*:*) - set_cc_for_build - IS_GLIBC=0 - test x"${LIBC}" = xgnu && IS_GLIBC=1 - sed 's/^ //' << EOF > "$dummy.c" - #undef CPU - #undef mips - #undef mipsel - #undef mips64 - #undef mips64el - #if ${IS_GLIBC} && defined(_ABI64) - LIBCABI=gnuabi64 - #else - #if ${IS_GLIBC} && defined(_ABIN32) - LIBCABI=gnuabin32 - #else - LIBCABI=${LIBC} - #endif - #endif - - #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 - CPU=mipsisa64r6 - #else - #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 - CPU=mipsisa32r6 - #else - #if defined(__mips64) - CPU=mips64 - #else - CPU=mips - #endif - #endif - #endif - - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - MIPS_ENDIAN=el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - MIPS_ENDIAN= - #else - MIPS_ENDIAN= - #endif - #endif -EOF - cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` - eval "$cc_set_vars" - test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } - ;; - mips64el:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - openrisc*:Linux:*:*) - GUESS=or1k-unknown-linux-$LIBC - ;; - or32:Linux:*:* | or1k*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - padre:Linux:*:*) - GUESS=sparc-unknown-linux-$LIBC - ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - GUESS=hppa64-unknown-linux-$LIBC - ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; - PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; - *) GUESS=hppa-unknown-linux-$LIBC ;; - esac - ;; - ppc64:Linux:*:*) - GUESS=powerpc64-unknown-linux-$LIBC - ;; - ppc:Linux:*:*) - GUESS=powerpc-unknown-linux-$LIBC - ;; - ppc64le:Linux:*:*) - GUESS=powerpc64le-unknown-linux-$LIBC - ;; - ppcle:Linux:*:*) - GUESS=powerpcle-unknown-linux-$LIBC - ;; - riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - s390:Linux:*:* | s390x:Linux:*:*) - GUESS=$UNAME_MACHINE-ibm-linux-$LIBC - ;; - sh64*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - sh*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - tile*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - vax:Linux:*:*) - GUESS=$UNAME_MACHINE-dec-linux-$LIBC - ;; - x86_64:Linux:*:*) - set_cc_for_build - CPU=$UNAME_MACHINE - LIBCABI=$LIBC - if test "$CC_FOR_BUILD" != no_compiler_found; then - ABI=64 - sed 's/^ //' << EOF > "$dummy.c" - #ifdef __i386__ - ABI=x86 - #else - #ifdef __ILP32__ - ABI=x32 - #endif - #endif -EOF - cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` - eval "$cc_set_abi" - case $ABI in - x86) CPU=i686 ;; - x32) LIBCABI=${LIBC}x32 ;; - esac - fi - GUESS=$CPU-pc-linux-$LIBCABI - ;; - xtensa*:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - GUESS=i386-sequent-sysv4 - ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION - ;; - i*86:OS/2:*:*) - # If we were able to find 'uname', then EMX Unix compatibility - # is probably installed. - GUESS=$UNAME_MACHINE-pc-os2-emx - ;; - i*86:XTS-300:*:STOP) - GUESS=$UNAME_MACHINE-unknown-stop - ;; - i*86:atheos:*:*) - GUESS=$UNAME_MACHINE-unknown-atheos - ;; - i*86:syllable:*:*) - GUESS=$UNAME_MACHINE-pc-syllable - ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - GUESS=i386-unknown-lynxos$UNAME_RELEASE - ;; - i*86:*DOS:*:*) - GUESS=$UNAME_MACHINE-pc-msdosdjgpp - ;; - i*86:*:4.*:*) - UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL - else - GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL - fi - ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL - else - GUESS=$UNAME_MACHINE-pc-sysv32 - fi - ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configure will decide that - # this is a cross-build. - GUESS=i586-pc-msdosdjgpp - ;; - Intel:Mach:3*:*) - GUESS=i386-pc-mach3 - ;; - paragon:*:*:*) - GUESS=i860-intel-osf1 - ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 - fi - ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - GUESS=m68010-convergent-sysv - ;; - mc68k:UNIX:SYSTEM5:3.51m) - GUESS=m68k-convergent-sysv - ;; - M680?0:D-NIX:5.3:*) - GUESS=m68k-diab-dnix - ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - GUESS=m68k-unknown-lynxos$UNAME_RELEASE - ;; - mc68030:UNIX_System_V:4.*:*) - GUESS=m68k-atari-sysv4 - ;; - TSUNAMI:LynxOS:2.*:*) - GUESS=sparc-unknown-lynxos$UNAME_RELEASE - ;; - rs6000:LynxOS:2.*:*) - GUESS=rs6000-unknown-lynxos$UNAME_RELEASE - ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - GUESS=powerpc-unknown-lynxos$UNAME_RELEASE - ;; - SM[BE]S:UNIX_SV:*:*) - GUESS=mips-dde-sysv$UNAME_RELEASE - ;; - RM*:ReliantUNIX-*:*:*) - GUESS=mips-sni-sysv4 - ;; - RM*:SINIX-*:*:*) - GUESS=mips-sni-sysv4 - ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - GUESS=$UNAME_MACHINE-sni-sysv4 - else - GUESS=ns32k-sni-sysv - fi - ;; - PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort - # says - GUESS=i586-unisys-sysv4 - ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - GUESS=hppa1.1-stratus-sysv4 - ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - GUESS=i860-stratus-sysv4 - ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - GUESS=$UNAME_MACHINE-stratus-vos - ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - GUESS=hppa1.1-stratus-vos - ;; - mc68*:A/UX:*:*) - GUESS=m68k-apple-aux$UNAME_RELEASE - ;; - news*:NEWS-OS:6*:*) - GUESS=mips-sony-newsos6 - ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if test -d /usr/nec; then - GUESS=mips-nec-sysv$UNAME_RELEASE - else - GUESS=mips-unknown-sysv$UNAME_RELEASE - fi - ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - GUESS=powerpc-be-beos - ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - GUESS=powerpc-apple-beos - ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - GUESS=i586-pc-beos - ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - GUESS=i586-pc-haiku - ;; - ppc:Haiku:*:*) # Haiku running on Apple PowerPC - GUESS=powerpc-apple-haiku - ;; - *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) - GUESS=$UNAME_MACHINE-unknown-haiku - ;; - SX-4:SUPER-UX:*:*) - GUESS=sx4-nec-superux$UNAME_RELEASE - ;; - SX-5:SUPER-UX:*:*) - GUESS=sx5-nec-superux$UNAME_RELEASE - ;; - SX-6:SUPER-UX:*:*) - GUESS=sx6-nec-superux$UNAME_RELEASE - ;; - SX-7:SUPER-UX:*:*) - GUESS=sx7-nec-superux$UNAME_RELEASE - ;; - SX-8:SUPER-UX:*:*) - GUESS=sx8-nec-superux$UNAME_RELEASE - ;; - SX-8R:SUPER-UX:*:*) - GUESS=sx8r-nec-superux$UNAME_RELEASE - ;; - SX-ACE:SUPER-UX:*:*) - GUESS=sxace-nec-superux$UNAME_RELEASE - ;; - Power*:Rhapsody:*:*) - GUESS=powerpc-apple-rhapsody$UNAME_RELEASE - ;; - *:Rhapsody:*:*) - GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE - ;; - arm64:Darwin:*:*) - GUESS=aarch64-apple-darwin$UNAME_RELEASE - ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; - esac - if command -v xcode-select > /dev/null 2> /dev/null && \ - ! xcode-select --print-path > /dev/null 2> /dev/null ; then - # Avoid executing cc if there is no toolchain installed as - # cc will be a stub that puts up a graphical alert - # prompting the user to install developer tools. - CC_FOR_BUILD=no_compiler_found - else - set_cc_for_build - fi - if test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # uname -m returns i386 or x86_64 - UNAME_PROCESSOR=$UNAME_MACHINE - fi - GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE - ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = x86; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE - ;; - *:QNX:*:4*) - GUESS=i386-pc-qnx - ;; - NEO-*:NONSTOP_KERNEL:*:*) - GUESS=neo-tandem-nsk$UNAME_RELEASE - ;; - NSE-*:NONSTOP_KERNEL:*:*) - GUESS=nse-tandem-nsk$UNAME_RELEASE - ;; - NSR-*:NONSTOP_KERNEL:*:*) - GUESS=nsr-tandem-nsk$UNAME_RELEASE - ;; - NSV-*:NONSTOP_KERNEL:*:*) - GUESS=nsv-tandem-nsk$UNAME_RELEASE - ;; - NSX-*:NONSTOP_KERNEL:*:*) - GUESS=nsx-tandem-nsk$UNAME_RELEASE - ;; - *:NonStop-UX:*:*) - GUESS=mips-compaq-nonstopux - ;; - BS2000:POSIX*:*:*) - GUESS=bs2000-siemens-sysv - ;; - DS/*:UNIX_System_V:*:*) - GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE - ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "${cputype-}" = 386; then - UNAME_MACHINE=i386 - elif test "x${cputype-}" != x; then - UNAME_MACHINE=$cputype - fi - GUESS=$UNAME_MACHINE-unknown-plan9 - ;; - *:TOPS-10:*:*) - GUESS=pdp10-unknown-tops10 - ;; - *:TENEX:*:*) - GUESS=pdp10-unknown-tenex - ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - GUESS=pdp10-dec-tops20 - ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - GUESS=pdp10-xkl-tops20 - ;; - *:TOPS-20:*:*) - GUESS=pdp10-unknown-tops20 - ;; - *:ITS:*:*) - GUESS=pdp10-unknown-its - ;; - SEI:*:*:SEIUX) - GUESS=mips-sei-seiux$UNAME_RELEASE - ;; - *:DragonFly:*:*) - DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` - GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL - ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case $UNAME_MACHINE in - A*) GUESS=alpha-dec-vms ;; - I*) GUESS=ia64-dec-vms ;; - V*) GUESS=vax-dec-vms ;; - esac ;; - *:XENIX:*:SysV) - GUESS=i386-pc-xenix - ;; - i*86:skyos:*:*) - SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` - GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL - ;; - i*86:rdos:*:*) - GUESS=$UNAME_MACHINE-pc-rdos - ;; - i*86:Fiwix:*:*) - GUESS=$UNAME_MACHINE-pc-fiwix - ;; - *:AROS:*:*) - GUESS=$UNAME_MACHINE-unknown-aros - ;; - x86_64:VMkernel:*:*) - GUESS=$UNAME_MACHINE-unknown-esx - ;; - amd64:Isilon\ OneFS:*:*) - GUESS=x86_64-unknown-onefs - ;; - *:Unleashed:*:*) - GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE - ;; - *:Ironclad:*:*) - GUESS=$UNAME_MACHINE-unknown-ironclad - ;; -esac - -# Do we have a guess based on uname results? -if test "x$GUESS" != x; then - echo "$GUESS" - exit -fi - -# No uname command or uname output not recognized. -set_cc_for_build -cat > "$dummy.c" < -#include -#endif -#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) -#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) -#include -#if defined(_SIZE_T_) || defined(SIGLOST) -#include -#endif -#endif -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); -#endif - -#if defined (vax) -#if !defined (ultrix) -#include -#if defined (BSD) -#if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -#else -#if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -#else - printf ("vax-dec-bsd\n"); exit (0); -#endif -#endif -#else - printf ("vax-dec-bsd\n"); exit (0); -#endif -#else -#if defined(_SIZE_T_) || defined(SIGLOST) - struct utsname un; - uname (&un); - printf ("vax-dec-ultrix%s\n", un.release); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif -#endif -#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) -#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) -#if defined(_SIZE_T_) || defined(SIGLOST) - struct utsname *un; - uname (&un); - printf ("mips-dec-ultrix%s\n", un.release); exit (0); -#else - printf ("mips-dec-ultrix\n"); exit (0); -#endif -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. -test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } - -echo "$0: unable to guess system type" >&2 - -case $UNAME_MACHINE:$UNAME_SYSTEM in - mips:Linux | mips64:Linux) - # If we got here on MIPS GNU/Linux, output extra information. - cat >&2 <&2 <&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = "$UNAME_MACHINE" -UNAME_RELEASE = "$UNAME_RELEASE" -UNAME_SYSTEM = "$UNAME_SYSTEM" -UNAME_VERSION = "$UNAME_VERSION" -EOF -fi - -exit 1 - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/deps/libffi/config.sub b/deps/libffi/config.sub deleted file mode 100755 index 2c5120f1ddae7f..00000000000000 --- a/deps/libffi/config.sub +++ /dev/null @@ -1,1973 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2024 Free Software Foundation, Inc. - -# shellcheck disable=SC2006,SC2268 # see below for rationale - -timestamp='2024-01-01' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -# The "shellcheck disable" line above the timestamp inhibits complaints -# about features and limitations of the classic Bourne shell that were -# superseded or lifted in POSIX. However, this script identifies a wide -# variety of pre-POSIX systems that do not have POSIX shells at all, and -# even some reasonably current systems (Solaris 10 as case-in-point) still -# have a pre-POSIX /bin/sh. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS - -Canonicalize a configuration name. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2024 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try '$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo "$1" - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Split fields of configuration type -# shellcheck disable=SC2162 -saved_IFS=$IFS -IFS="-" read field1 field2 field3 field4 <&2 - exit 1 - ;; - *-*-*-*) - basic_machine=$field1-$field2 - basic_os=$field3-$field4 - ;; - *-*-*) - # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two - # parts - maybe_os=$field2-$field3 - case $maybe_os in - nto-qnx* | linux-* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ - | windows-* ) - basic_machine=$field1 - basic_os=$maybe_os - ;; - android-linux) - basic_machine=$field1-unknown - basic_os=linux-android - ;; - *) - basic_machine=$field1-$field2 - basic_os=$field3 - ;; - esac - ;; - *-*) - # A lone config we happen to match not fitting any pattern - case $field1-$field2 in - decstation-3100) - basic_machine=mips-dec - basic_os= - ;; - *-*) - # Second component is usually, but not always the OS - case $field2 in - # Prevent following clause from handling this valid os - sun*os*) - basic_machine=$field1 - basic_os=$field2 - ;; - zephyr*) - basic_machine=$field1-unknown - basic_os=$field2 - ;; - # Manufacturers - dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ - | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ - | unicom* | ibm* | next | hp | isi* | apollo | altos* \ - | convergent* | ncr* | news | 32* | 3600* | 3100* \ - | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ - | ultra | tti* | harris | dolphin | highlevel | gould \ - | cbm | ns | masscomp | apple | axis | knuth | cray \ - | microblaze* | sim | cisco \ - | oki | wec | wrs | winbond) - basic_machine=$field1-$field2 - basic_os= - ;; - *) - basic_machine=$field1 - basic_os=$field2 - ;; - esac - ;; - esac - ;; - *) - # Convert single-component short-hands not valid as part of - # multi-component configurations. - case $field1 in - 386bsd) - basic_machine=i386-pc - basic_os=bsd - ;; - a29khif) - basic_machine=a29k-amd - basic_os=udi - ;; - adobe68k) - basic_machine=m68010-adobe - basic_os=scout - ;; - alliant) - basic_machine=fx80-alliant - basic_os= - ;; - altos | altos3068) - basic_machine=m68k-altos - basic_os= - ;; - am29k) - basic_machine=a29k-none - basic_os=bsd - ;; - amdahl) - basic_machine=580-amdahl - basic_os=sysv - ;; - amiga) - basic_machine=m68k-unknown - basic_os= - ;; - amigaos | amigados) - basic_machine=m68k-unknown - basic_os=amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - basic_os=sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - basic_os=sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - basic_os=bsd - ;; - aros) - basic_machine=i386-pc - basic_os=aros - ;; - aux) - basic_machine=m68k-apple - basic_os=aux - ;; - balance) - basic_machine=ns32k-sequent - basic_os=dynix - ;; - blackfin) - basic_machine=bfin-unknown - basic_os=linux - ;; - cegcc) - basic_machine=arm-unknown - basic_os=cegcc - ;; - convex-c1) - basic_machine=c1-convex - basic_os=bsd - ;; - convex-c2) - basic_machine=c2-convex - basic_os=bsd - ;; - convex-c32) - basic_machine=c32-convex - basic_os=bsd - ;; - convex-c34) - basic_machine=c34-convex - basic_os=bsd - ;; - convex-c38) - basic_machine=c38-convex - basic_os=bsd - ;; - cray) - basic_machine=j90-cray - basic_os=unicos - ;; - crds | unos) - basic_machine=m68k-crds - basic_os= - ;; - da30) - basic_machine=m68k-da30 - basic_os= - ;; - decstation | pmax | pmin | dec3100 | decstatn) - basic_machine=mips-dec - basic_os= - ;; - delta88) - basic_machine=m88k-motorola - basic_os=sysv3 - ;; - dicos) - basic_machine=i686-pc - basic_os=dicos - ;; - djgpp) - basic_machine=i586-pc - basic_os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd - basic_os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - basic_os=ose - ;; - gmicro) - basic_machine=tron-gmicro - basic_os=sysv - ;; - go32) - basic_machine=i386-pc - basic_os=go32 - ;; - h8300hms) - basic_machine=h8300-hitachi - basic_os=hms - ;; - h8300xray) - basic_machine=h8300-hitachi - basic_os=xray - ;; - h8500hms) - basic_machine=h8500-hitachi - basic_os=hms - ;; - harris) - basic_machine=m88k-harris - basic_os=sysv3 - ;; - hp300 | hp300hpux) - basic_machine=m68k-hp - basic_os=hpux - ;; - hp300bsd) - basic_machine=m68k-hp - basic_os=bsd - ;; - hppaosf) - basic_machine=hppa1.1-hp - basic_os=osf - ;; - hppro) - basic_machine=hppa1.1-hp - basic_os=proelf - ;; - i386mach) - basic_machine=i386-mach - basic_os=mach - ;; - isi68 | isi) - basic_machine=m68k-isi - basic_os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown - basic_os=linux - ;; - magnum | m3230) - basic_machine=mips-mips - basic_os=sysv - ;; - merlin) - basic_machine=ns32k-utek - basic_os=sysv - ;; - mingw64) - basic_machine=x86_64-pc - basic_os=mingw64 - ;; - mingw32) - basic_machine=i686-pc - basic_os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - basic_os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k - basic_os=coff - ;; - morphos) - basic_machine=powerpc-unknown - basic_os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown - basic_os=moxiebox - ;; - msdos) - basic_machine=i386-pc - basic_os=msdos - ;; - msys) - basic_machine=i686-pc - basic_os=msys - ;; - mvs) - basic_machine=i370-ibm - basic_os=mvs - ;; - nacl) - basic_machine=le32-unknown - basic_os=nacl - ;; - ncr3000) - basic_machine=i486-ncr - basic_os=sysv4 - ;; - netbsd386) - basic_machine=i386-pc - basic_os=netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - basic_os=linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - basic_os=newsos - ;; - news1000) - basic_machine=m68030-sony - basic_os=newsos - ;; - necv70) - basic_machine=v70-nec - basic_os=sysv - ;; - nh3000) - basic_machine=m68k-harris - basic_os=cxux - ;; - nh[45]000) - basic_machine=m88k-harris - basic_os=cxux - ;; - nindy960) - basic_machine=i960-intel - basic_os=nindy - ;; - mon960) - basic_machine=i960-intel - basic_os=mon960 - ;; - nonstopux) - basic_machine=mips-compaq - basic_os=nonstopux - ;; - os400) - basic_machine=powerpc-ibm - basic_os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - basic_os=ose - ;; - os68k) - basic_machine=m68k-none - basic_os=os68k - ;; - paragon) - basic_machine=i860-intel - basic_os=osf - ;; - parisc) - basic_machine=hppa-unknown - basic_os=linux - ;; - psp) - basic_machine=mipsallegrexel-sony - basic_os=psp - ;; - pw32) - basic_machine=i586-unknown - basic_os=pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - basic_os=rdos - ;; - rdos32) - basic_machine=i386-pc - basic_os=rdos - ;; - rom68k) - basic_machine=m68k-rom68k - basic_os=coff - ;; - sa29200) - basic_machine=a29k-amd - basic_os=udi - ;; - sei) - basic_machine=mips-sei - basic_os=seiux - ;; - sequent) - basic_machine=i386-sequent - basic_os= - ;; - sps7) - basic_machine=m68k-bull - basic_os=sysv2 - ;; - st2000) - basic_machine=m68k-tandem - basic_os= - ;; - stratus) - basic_machine=i860-stratus - basic_os=sysv4 - ;; - sun2) - basic_machine=m68000-sun - basic_os= - ;; - sun2os3) - basic_machine=m68000-sun - basic_os=sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - basic_os=sunos4 - ;; - sun3) - basic_machine=m68k-sun - basic_os= - ;; - sun3os3) - basic_machine=m68k-sun - basic_os=sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - basic_os=sunos4 - ;; - sun4) - basic_machine=sparc-sun - basic_os= - ;; - sun4os3) - basic_machine=sparc-sun - basic_os=sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - basic_os=sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - basic_os=solaris2 - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - basic_os= - ;; - sv1) - basic_machine=sv1-cray - basic_os=unicos - ;; - symmetry) - basic_machine=i386-sequent - basic_os=dynix - ;; - t3e) - basic_machine=alphaev5-cray - basic_os=unicos - ;; - t90) - basic_machine=t90-cray - basic_os=unicos - ;; - toad1) - basic_machine=pdp10-xkl - basic_os=tops20 - ;; - tpf) - basic_machine=s390x-ibm - basic_os=tpf - ;; - udi29k) - basic_machine=a29k-amd - basic_os=udi - ;; - ultra3) - basic_machine=a29k-nyu - basic_os=sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - basic_os=none - ;; - vaxv) - basic_machine=vax-dec - basic_os=sysv - ;; - vms) - basic_machine=vax-dec - basic_os=vms - ;; - vsta) - basic_machine=i386-pc - basic_os=vsta - ;; - vxworks960) - basic_machine=i960-wrs - basic_os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - basic_os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - basic_os=vxworks - ;; - xbox) - basic_machine=i686-pc - basic_os=mingw32 - ;; - ymp) - basic_machine=ymp-cray - basic_os=unicos - ;; - *) - basic_machine=$1 - basic_os= - ;; - esac - ;; -esac - -# Decode 1-component or ad-hoc basic machines -case $basic_machine in - # Here we handle the default manufacturer of certain CPU types. It is in - # some cases the only manufacturer, in others, it is the most popular. - w89k) - cpu=hppa1.1 - vendor=winbond - ;; - op50n) - cpu=hppa1.1 - vendor=oki - ;; - op60c) - cpu=hppa1.1 - vendor=oki - ;; - ibm*) - cpu=i370 - vendor=ibm - ;; - orion105) - cpu=clipper - vendor=highlevel - ;; - mac | mpw | mac-mpw) - cpu=m68k - vendor=apple - ;; - pmac | pmac-mpw) - cpu=powerpc - vendor=apple - ;; - - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - cpu=m68000 - vendor=att - ;; - 3b*) - cpu=we32k - vendor=att - ;; - bluegene*) - cpu=powerpc - vendor=ibm - basic_os=cnk - ;; - decsystem10* | dec10*) - cpu=pdp10 - vendor=dec - basic_os=tops10 - ;; - decsystem20* | dec20*) - cpu=pdp10 - vendor=dec - basic_os=tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - cpu=m68k - vendor=motorola - ;; - dpx2*) - cpu=m68k - vendor=bull - basic_os=sysv3 - ;; - encore | umax | mmax) - cpu=ns32k - vendor=encore - ;; - elxsi) - cpu=elxsi - vendor=elxsi - basic_os=${basic_os:-bsd} - ;; - fx2800) - cpu=i860 - vendor=alliant - ;; - genix) - cpu=ns32k - vendor=ns - ;; - h3050r* | hiux*) - cpu=hppa1.1 - vendor=hitachi - basic_os=hiuxwe2 - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - cpu=m68000 - vendor=hp - ;; - hp9k3[2-9][0-9]) - cpu=m68k - vendor=hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - i*86v32) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - basic_os=sysv32 - ;; - i*86v4*) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - basic_os=sysv4 - ;; - i*86v) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - basic_os=sysv - ;; - i*86sol2) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - basic_os=solaris2 - ;; - j90 | j90-cray) - cpu=j90 - vendor=cray - basic_os=${basic_os:-unicos} - ;; - iris | iris4d) - cpu=mips - vendor=sgi - case $basic_os in - irix*) - ;; - *) - basic_os=irix4 - ;; - esac - ;; - miniframe) - cpu=m68000 - vendor=convergent - ;; - *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) - cpu=m68k - vendor=atari - basic_os=mint - ;; - news-3600 | risc-news) - cpu=mips - vendor=sony - basic_os=newsos - ;; - next | m*-next) - cpu=m68k - vendor=next - case $basic_os in - openstep*) - ;; - nextstep*) - ;; - ns2*) - basic_os=nextstep2 - ;; - *) - basic_os=nextstep3 - ;; - esac - ;; - np1) - cpu=np1 - vendor=gould - ;; - op50n-* | op60c-*) - cpu=hppa1.1 - vendor=oki - basic_os=proelf - ;; - pa-hitachi) - cpu=hppa1.1 - vendor=hitachi - basic_os=hiuxwe2 - ;; - pbd) - cpu=sparc - vendor=tti - ;; - pbb) - cpu=m68k - vendor=tti - ;; - pc532) - cpu=ns32k - vendor=pc532 - ;; - pn) - cpu=pn - vendor=gould - ;; - power) - cpu=power - vendor=ibm - ;; - ps2) - cpu=i386 - vendor=ibm - ;; - rm[46]00) - cpu=mips - vendor=siemens - ;; - rtpc | rtpc-*) - cpu=romp - vendor=ibm - ;; - sde) - cpu=mipsisa32 - vendor=sde - basic_os=${basic_os:-elf} - ;; - simso-wrs) - cpu=sparclite - vendor=wrs - basic_os=vxworks - ;; - tower | tower-32) - cpu=m68k - vendor=ncr - ;; - vpp*|vx|vx-*) - cpu=f301 - vendor=fujitsu - ;; - w65) - cpu=w65 - vendor=wdc - ;; - w89k-*) - cpu=hppa1.1 - vendor=winbond - basic_os=proelf - ;; - none) - cpu=none - vendor=none - ;; - leon|leon[3-9]) - cpu=sparc - vendor=$basic_machine - ;; - leon-*|leon[3-9]-*) - cpu=sparc - vendor=`echo "$basic_machine" | sed 's/-.*//'` - ;; - - *-*) - # shellcheck disable=SC2162 - saved_IFS=$IFS - IFS="-" read cpu vendor <&2 - exit 1 - ;; - esac - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $vendor in - digital*) - vendor=dec - ;; - commodore*) - vendor=cbm - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if test x"$basic_os" != x -then - -# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just -# set os. -obj= -case $basic_os in - gnu/linux*) - kernel=linux - os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` - ;; - os2-emx) - kernel=os2 - os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` - ;; - nto-qnx*) - kernel=nto - os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` - ;; - *-*) - # shellcheck disable=SC2162 - saved_IFS=$IFS - IFS="-" read kernel os <&2 - fi - ;; - *) - echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 - exit 1 - ;; -esac - -case $obj in - aout* | coff* | elf* | pe*) - ;; - '') - # empty is fine - ;; - *) - echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 - exit 1 - ;; -esac - -# Here we handle the constraint that a (synthetic) cpu and os are -# valid only in combination with each other and nowhere else. -case $cpu-$os in - # The "javascript-unknown-ghcjs" triple is used by GHC; we - # accept it here in order to tolerate that, but reject any - # variations. - javascript-ghcjs) - ;; - javascript-* | *-ghcjs) - echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 - exit 1 - ;; -esac - -# As a final step for OS-related things, validate the OS-kernel combination -# (given a valid OS), if there is a kernel. -case $kernel-$os-$obj in - linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ - | linux-mlibc*- | linux-musl*- | linux-newlib*- \ - | linux-relibc*- | linux-uclibc*- ) - ;; - uclinux-uclibc*- ) - ;; - managarm-mlibc*- | managarm-kernel*- ) - ;; - windows*-msvc*-) - ;; - -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ - | -uclibc*- ) - # These are just libc implementations, not actual OSes, and thus - # require a kernel. - echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 - exit 1 - ;; - -kernel*- ) - echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 - exit 1 - ;; - *-kernel*- ) - echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 - exit 1 - ;; - *-msvc*- ) - echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 - exit 1 - ;; - kfreebsd*-gnu*- | kopensolaris*-gnu*-) - ;; - vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) - ;; - nto-qnx*-) - ;; - os2-emx-) - ;; - ios*-simulator* | tvos*-simulator* | watchos*-simulator*) - ;; - *-eabi*- | *-gnueabi*-) - ;; - none--*) - # None (no kernel, i.e. freestanding / bare metal), - # can be paired with an machine code file format - ;; - -*-) - # Blank kernel with real OS is always fine. - ;; - --*) - # Blank kernel and OS with real machine code file format is always fine. - ;; - *-*-*) - echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 - exit 1 - ;; -esac - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -case $vendor in - unknown) - case $cpu-$os in - *-riscix*) - vendor=acorn - ;; - *-sunos*) - vendor=sun - ;; - *-cnk* | *-aix*) - vendor=ibm - ;; - *-beos*) - vendor=be - ;; - *-hpux*) - vendor=hp - ;; - *-mpeix*) - vendor=hp - ;; - *-hiux*) - vendor=hitachi - ;; - *-unos*) - vendor=crds - ;; - *-dgux*) - vendor=dg - ;; - *-luna*) - vendor=omron - ;; - *-genix*) - vendor=ns - ;; - *-clix*) - vendor=intergraph - ;; - *-mvs* | *-opened*) - vendor=ibm - ;; - *-os400*) - vendor=ibm - ;; - s390-* | s390x-*) - vendor=ibm - ;; - *-ptx*) - vendor=sequent - ;; - *-tpf*) - vendor=ibm - ;; - *-vxsim* | *-vxworks* | *-windiss*) - vendor=wrs - ;; - *-aux*) - vendor=apple - ;; - *-hms*) - vendor=hitachi - ;; - *-mpw* | *-macos*) - vendor=apple - ;; - *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) - vendor=atari - ;; - *-vos*) - vendor=stratus - ;; - esac - ;; -esac - -echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" -exit - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/deps/libffi/configure.ac b/deps/libffi/configure.ac deleted file mode 100644 index dcfc7b242d02b3..00000000000000 --- a/deps/libffi/configure.ac +++ /dev/null @@ -1,461 +0,0 @@ -dnl Process this with autoconf to create configure - -AC_PREREQ([2.68]) - -AC_INIT([libffi],[3.5.2],[http://github.com/libffi/libffi/issues]) -AC_CONFIG_HEADERS([fficonfig.h]) - -FFI_VERSION_STRING="3.5.2" -FFI_VERSION_NUMBER=30502 -AC_SUBST(FFI_VERSION_STRING) -AC_SUBST(FFI_VERSION_NUMBER) - -AC_CANONICAL_TARGET -target_alias=${target_alias-$host_alias} - -case "${host}" in - frv*-elf) - LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/ - ;; -esac - -AX_ENABLE_BUILDDIR - -AM_INIT_AUTOMAKE - -# The same as in boehm-gc and libstdc++. Have to borrow it from there. -# We must force CC to /not/ be precious variables; otherwise -# the wrong, non-multilib-adjusted value will be used in multilibs. -# As a side effect, we have to subst CFLAGS ourselves. -# Also save and restore CFLAGS, since AC_PROG_CC will come up with -# defaults of its own if none are provided. - -m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) -m4_define([_AC_ARG_VAR_PRECIOUS],[]) -save_CFLAGS=$CFLAGS -AC_PROG_CC -AC_PROG_CXX -CFLAGS=$save_CFLAGS -m4_undefine([_AC_ARG_VAR_PRECIOUS]) -m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) - -AC_SUBST(CFLAGS) - -AM_PROG_AS -AM_PROG_CC_C_O -AC_PROG_EGREP -LT_INIT -AC_CONFIG_MACRO_DIR([m4]) - -AC_CHECK_TOOLS([READELF], [readelf greadelf]) - -# Test for 64-bit build. -AC_CHECK_SIZEOF([size_t]) - -AX_COMPILER_VENDOR -AX_CC_MAXOPT -# The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro -# compiler. -if test "$ax_cv_c_compiler_vendor" != "sun"; then - AX_CFLAGS_WARN_ALL -fi - -if test "x$GCC" = "xyes"; then - CFLAGS="$CFLAGS -fexceptions" -fi - -cat > local.exp < conftest.s - if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then - libffi_cv_as_x86_pcrel=yes - fi - ]) - if test "x$libffi_cv_as_x86_pcrel" = xyes; then - AC_DEFINE(HAVE_AS_X86_PCREL, 1, - [Define if your assembler supports PC relative relocs.]) - fi - ;; - - S390) - AC_CACHE_CHECK([compiler uses zarch features], - libffi_cv_as_s390_zarch, [ - libffi_cv_as_s390_zarch=no - echo 'void foo(void) { bar(); bar(); }' > conftest.c - if $CC $CFLAGS -S conftest.c > /dev/null 2>&1; then - if $GREP -q brasl conftest.s; then - libffi_cv_as_s390_zarch=yes - fi - fi - ]) - if test "x$libffi_cv_as_s390_zarch" = xyes; then - AC_DEFINE(HAVE_AS_S390_ZARCH, 1, - [Define if the compiler uses zarch features.]) - fi - ;; - wasm64) - if test -z "$WASM64_MEMORY64"; then - WASM64_MEMORY64=1 - fi - CFLAGS="$CFLAGS -sMEMORY64=$WASM64_MEMORY64" - ;; -esac - -AC_CACHE_CHECK([whether compiler supports pointer authentication], - libffi_cv_as_ptrauth, [ - libffi_cv_as_ptrauth=unknown - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ -#ifdef __clang__ -# if __has_feature(ptrauth_calls) -# define HAVE_ARM64E_PTRAUTH 1 -# endif -#endif - -#ifndef HAVE_ARM64E_PTRAUTH -# error Pointer authentication not supported -#endif - ]])],[libffi_cv_as_ptrauth=yes],[libffi_cv_as_ptrauth=no]) -]) -if test "x$libffi_cv_as_ptrauth" = xyes; then - AC_DEFINE(HAVE_ARM64E_PTRAUTH, 1, - [Define if your compiler supports pointer authentication.]) -fi - -# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC; -# if EMUTRAMP is active too ffi could try mapping without PROT_EXEC, -# but the kernel needs to recognize the trampoline generated by ffi. -# Otherwise fallback to double mmap trick. -AC_ARG_ENABLE(pax_emutramp, - [ --enable-pax_emutramp enable pax emulated trampolines (experimental)], - if test "$enable_pax_emutramp" = "yes"; then - AC_MSG_WARN([EMUTRAMP is experimental only. Use --enable-pax_emutramp=experimental to enforce.]) - elif test "$enable_pax_emutramp" = "experimental"; then - AC_DEFINE(FFI_MMAP_EXEC_EMUTRAMP_PAX, 1, - [Define this if you want to enable pax emulated trampolines (experimental)]) - fi) - -LT_SYS_SYMBOL_USCORE -if test "x$sys_symbol_underscore" = xyes; then - AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.]) -fi - -FFI_EXEC_TRAMPOLINE_TABLE=0 -case "$target" in - *arm*-apple-* | aarch64-apple-*) - FFI_EXEC_TRAMPOLINE_TABLE=1 - AC_DEFINE(FFI_EXEC_TRAMPOLINE_TABLE, 1, - [Cannot use PROT_EXEC on this target, so, we revert to - alternative means]) - ;; - *-apple-* | *-*-dragonfly* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris* | *-linux-android*) - AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1, - [Cannot use malloc on this target, so, we revert to - alternative means]) - ;; -esac -AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1) -AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE) - -if test x$TARGET = xX86_64; then - AC_CACHE_CHECK([toolchain supports unwind section type], - libffi_cv_as_x86_64_unwind_section_type, [ - cat > conftest1.s << EOF -.text -.globl foo -foo: -jmp bar -.section .eh_frame,"a",@unwind -bar: -EOF - - cat > conftest2.c << EOF -extern void foo(); -int main(){foo();} -EOF - - libffi_cv_as_x86_64_unwind_section_type=no - # we ensure that we can compile _and_ link an assembly file containing an @unwind section - # since the compiler can support it and not the linker (ie old binutils) - if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \ - $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then - libffi_cv_as_x86_64_unwind_section_type=yes - fi - ]) - if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then - AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1, - [Define if your assembler supports unwind section type.]) - fi -fi - -if test "x$GCC" = "xyes"; then - AX_CHECK_COMPILE_FLAG(-fno-lto, libffi_cv_no_lto=-fno-lto) - - AC_CACHE_CHECK([whether .eh_frame section should be read-only], - libffi_cv_ro_eh_frame, [ - libffi_cv_ro_eh_frame=yes - echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c - if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then - if $READELF -WS conftest.o 2>/dev/null | $GREP -q -n 'eh_frame .* WA'; then - libffi_cv_ro_eh_frame=no - fi - fi - rm -f conftest.* - ]) - if test "x$libffi_cv_ro_eh_frame" = xyes; then - AC_DEFINE(HAVE_RO_EH_FRAME, 1, - [Define if .eh_frame sections should be read-only.]) - AC_DEFINE(EH_FRAME_FLAGS, "a", - [Define to the flags needed for the .section .eh_frame directive. ]) - else - AC_DEFINE(EH_FRAME_FLAGS, "aw", - [Define to the flags needed for the .section .eh_frame directive. ]) - fi - - AC_CACHE_CHECK([for __attribute__((visibility("hidden")))], - libffi_cv_hidden_visibility_attribute, [ - echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c - libffi_cv_hidden_visibility_attribute=no - if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then - if $EGREP '(\.hidden|\.private_extern).*foo|foo.*,hidden' conftest.s >/dev/null; then - libffi_cv_hidden_visibility_attribute=yes - fi - fi - rm -f conftest.* - ]) - if test $libffi_cv_hidden_visibility_attribute = yes; then - AC_DEFINE(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE, 1, - [Define if __attribute__((visibility("hidden"))) is supported.]) - fi -fi - -AC_ARG_ENABLE(docs, - AS_HELP_STRING([--disable-docs],[Disable building of docs (default: no)]), - [enable_docs=no], - [enable_docs=yes]) -AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes]) - -AH_BOTTOM([ -#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE -#ifdef LIBFFI_ASM -#ifdef __APPLE__ -#define FFI_HIDDEN(name) .private_extern name -#else -#define FFI_HIDDEN(name) .hidden name -#endif -#else -#define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) -#endif -#else -#ifdef LIBFFI_ASM -#define FFI_HIDDEN(name) -#else -#define FFI_HIDDEN -#endif -#endif -]) - -AC_SUBST(TARGET) -AC_SUBST(TARGETDIR) - -changequote(<,>) -TARGET_OBJ= -for i in $SOURCES; do - TARGET_OBJ="${TARGET_OBJ} src/${TARGETDIR}/"`echo $i | sed 's/[cS]$/lo/'` -done -changequote([,]) -AC_SUBST(TARGET_OBJ) - -AC_SUBST(SHELL) - -AC_ARG_ENABLE(debug, -[ --enable-debug debugging mode], - if test "$enable_debug" = "yes"; then - AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.]) - fi) -AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes") - -AC_ARG_ENABLE(structs, -[ --disable-structs omit code for struct support], - if test "$enable_structs" = "no"; then - AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this if you do not want support for aggregate types.]) - fi) -AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes") - -AC_ARG_ENABLE(raw-api, -[ --disable-raw-api make the raw api unavailable], - if test "$enable_raw_api" = "no"; then - AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.]) - fi) - -AC_ARG_ENABLE(exec-static-tramp, -[ --disable-exec-static-tramp disable use of static exec trampolines (enabled by default)]) - -if test "$enable_exec_static_tramp" != no; then -case "$target" in - *-cygwin* | *-msys*) - # Only define static trampolines if we are using the cygwin runtime. - # Will this need to be changed for mingw? - if test "x$GCC" = "xyes"; then - AC_DEFINE(FFI_EXEC_STATIC_TRAMP, 1, - [Define this if you want statically defined trampolines]) - fi - ;; - *arm*-*-linux-* | aarch64*-*-linux-* | i*86-*-linux-* | x86_64-*-linux-* \ - | loongarch*-*-linux-* | s390x*-linux-* | powerpc*-linux-*) - AC_DEFINE(FFI_EXEC_STATIC_TRAMP, 1, - [Define this if you want statically defined trampolines]) - ;; -esac -fi - -AC_ARG_ENABLE(purify-safety, -[ --enable-purify-safety purify-safe mode], - if test "$enable_purify_safety" = "yes"; then - AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.]) - fi) - -AC_ARG_ENABLE(multi-os-directory, -[ --disable-multi-os-directory - disable use of gcc --print-multi-os-directory to change the library installation directory]) - -# These variables are only ever used when we cross-build to X86_WIN32. -# And we only support this with GCC, so... -if test "x$GCC" = "xyes"; then - if test -n "$with_cross_host" && - test x"$with_cross_host" != x"no"; then - toolexecdir='${exec_prefix}'/'$(target_alias)' - toolexeclibdir='${toolexecdir}'/lib - else - toolexecdir='${libdir}'/gcc-lib/'$(target_alias)' - toolexeclibdir='${libdir}' - fi - if test x"$enable_multi_os_directory" != x"no"; then - multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` - case $multi_os_directory in - .) ;; # Avoid trailing /. - ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; - esac - fi - AC_SUBST(toolexecdir) -else - toolexeclibdir='${libdir}' -fi -AC_SUBST(toolexeclibdir) - -# Conditionalize the makefile for this target machine. -tmake_file_= -for f in ${tmake_file}; do - if test -f ${srcdir}/src/$TARGETDIR/$f; then - tmake_file_="${tmake_file_} \$(srcdir)/src/$TARGETDIR/$f" - fi -done -tmake_file="${tmake_file_}" -AC_SUBST(tmake_file) - -# Check linker support. -LIBFFI_ENABLE_SYMVERS - -AC_CONFIG_COMMANDS(include, [test -d include || mkdir include]) -AC_CONFIG_COMMANDS(src, [ -test -d src || mkdir src -test -d src/$TARGETDIR || mkdir src/$TARGETDIR -], [TARGETDIR="$TARGETDIR"]) - -AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile doc/Makefile libffi.pc) - -AC_OUTPUT - -# Copy this file instead of using AC_CONFIG_LINK in order to support -# compiling with MSVC, which won't understand cygwin style symlinks. -cp ${srcdir}/src/$TARGETDIR/ffitarget.h include/ffitarget.h diff --git a/deps/libffi/configure.host b/deps/libffi/configure.host deleted file mode 100644 index 4e10c3edb773a1..00000000000000 --- a/deps/libffi/configure.host +++ /dev/null @@ -1,337 +0,0 @@ -# configure.host -# -# This shell script handles all host based configuration for libffi. -# - -# THIS TABLE IS SORTED. KEEP IT THAT WAY. -# Most of the time we can define all the variables all at once... -case "${host}" in - aarch64*-*-cygwin* | aarch64*-*-msys* | aarch64*-*-mingw* | aarch64*-*-win* ) - TARGET=ARM_WIN64; TARGETDIR=aarch64 - if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then - MSVC=1 - fi - ;; - - aarch64*-*-*) - TARGET=AARCH64; TARGETDIR=aarch64 - SOURCES="ffi.c sysv.S" - ;; - - alpha*-*-*) - TARGET=ALPHA; TARGETDIR=alpha; - # Support 128-bit long double, changeable via command-line switch. - HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)' - SOURCES="ffi.c osf.S" - ;; - - arc*-*-*) - TARGET=ARC; TARGETDIR=arc - SOURCES="ffi.c arcompact.S" - ;; - - arm*-*-cygwin* | arm*-*-msys* | arm*-*-mingw* | arm*-*-win* ) - TARGET=ARM_WIN32; TARGETDIR=arm - if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then - MSVC=1 - fi - ;; - - arm*-*-*) - TARGET=ARM; TARGETDIR=arm - SOURCES="ffi.c sysv.S" - ;; - - avr32*-*-*) - TARGET=AVR32; TARGETDIR=avr32 - SOURCES="ffi.c sysv.S" - ;; - - bfin*) - TARGET=BFIN; TARGETDIR=bfin - SOURCES="ffi.c sysv.S" - ;; - - cris-*-*) - TARGET=LIBFFI_CRIS; TARGETDIR=cris - SOURCES="ffi.c sysv.S" - ;; - - csky-*-*) - TARGET=CSKY; TARGETDIR=csky - SOURCES="ffi.c sysv.S" - ;; - - frv-*-*) - TARGET=FRV; TARGETDIR=frv - SOURCES="ffi.c eabi.S" - ;; - - hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*) - TARGET=PA_LINUX; TARGETDIR=pa - SOURCES="ffi.c linux.S" - ;; - hppa*64-*-hpux*) - TARGET=PA64_HPUX; TARGETDIR=pa - SOURCES="ffi64.c hpux64.S" - ;; - hppa*-*-hpux*) - TARGET=PA_HPUX; TARGETDIR=pa - SOURCES="ffi.c hpux32.S" - ;; - - i?86-*-freebsd* | i?86-*-openbsd*) - TARGET=X86_FREEBSD; TARGETDIR=x86 - ;; - - i?86-*-cygwin* | i?86-*-msys* | i?86-*-mingw* | i?86-*-win* | i?86-*-os2* | i?86-*-interix* \ - | x86_64-*-cygwin* | x86_64-*-msys* | x86_64-*-mingw* | x86_64-*-win* ) - TARGETDIR=x86 - if test $ac_cv_sizeof_size_t = 4; then - TARGET=X86_WIN32 - else - TARGET=X86_WIN64 - fi - if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then - MSVC=1 - fi - # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. - # We must also check with_cross_host to decide if this is a native - # or cross-build and select where to install dlls appropriately. - if test -n "$with_cross_host" && - test x"$with_cross_host" != x"no"; then - AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"'; - else - AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"'; - fi - ;; - - i?86-*-darwin* | x86_64-*-darwin* | i?86-*-ios | x86_64-*-ios) - TARGETDIR=x86 - if test $ac_cv_sizeof_size_t = 4; then - TARGET=X86_DARWIN - else - TARGET=X86_64 - fi - ;; - - i?86-*-* | x86_64-*-* | amd64-*) - TARGETDIR=x86 - if test $ac_cv_sizeof_size_t = 4; then - echo 'int foo (void) { return __x86_64__; }' > conftest.c - if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then - TARGET_X32=yes - TARGET=X86_64 - else - TARGET=X86; - fi - rm -f conftest.* - else - TARGET=X86_64; - fi - ;; - - ia64*-*-*) - TARGET=IA64; TARGETDIR=ia64 - SOURCES="ffi.c unix.S" - ;; - - kvx-*-*) - TARGET=KVX; TARGETDIR=kvx - SOURCES="ffi.c sysv.S" - ;; - - loongarch64-*-*) - TARGET=LOONGARCH64; TARGETDIR=loongarch64 - SOURCES="ffi.c sysv.S" - ;; - - m32r*-*-*) - TARGET=M32R; TARGETDIR=m32r - SOURCES="ffi.c sysv.S" - ;; - - m68k-*-*) - TARGET=M68K; TARGETDIR=m68k - SOURCES="ffi.c sysv.S" - ;; - - m88k-*-*) - TARGET=M88K; TARGETDIR=m88k - SOURCES="ffi.c obsd.S" - ;; - - microblaze*-*-*) - TARGET=MICROBLAZE; TARGETDIR=microblaze - SOURCES="ffi.c sysv.S" - ;; - - moxie-*-*) - TARGET=MOXIE; TARGETDIR=moxie - SOURCES="ffi.c eabi.S" - ;; - - metag-*-*) - TARGET=METAG; TARGETDIR=metag - SOURCES="ffi.c sysv.S" - ;; - - mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) - TARGET=MIPS; TARGETDIR=mips - ;; - mips*-*linux* | mips*-*-openbsd* | mips*-*-freebsd*) - # Support 128-bit long double for NewABI. - HAVE_LONG_DOUBLE='defined(__mips64)' - TARGET=MIPS; TARGETDIR=mips - ;; - - or1k*-*-*) - TARGET=OR1K; TARGETDIR=or1k - SOURCES="ffi.c sysv.S" - ;; - - powerpc*-*-linux* | powerpc-*-sysv*) - TARGET=POWERPC; TARGETDIR=powerpc - HAVE_LONG_DOUBLE_VARIANT=1 - ;; - powerpc-*-amigaos*) - TARGET=POWERPC; TARGETDIR=powerpc - ;; - powerpc-*-eabi*) - TARGET=POWERPC; TARGETDIR=powerpc - ;; - powerpc-*-beos* | powerpc-*-haiku*) - TARGET=POWERPC; TARGETDIR=powerpc - ;; - powerpc-*-darwin* | powerpc64-*-darwin*) - TARGET=POWERPC_DARWIN; TARGETDIR=powerpc - ;; - powerpc-*-aix* | rs6000-*-aix*) - TARGET=POWERPC_AIX; TARGETDIR=powerpc - # Create AIX-style "FAT" libraries. - tmake_file="t-aix" - ;; - powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*) - TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc - HAVE_LONG_DOUBLE_VARIANT=1 - ;; - powerpcspe-*-freebsd*) - TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc - CFLAGS="$CFLAGS -D__NO_FPRS__" - ;; - powerpc64-*-freebsd* | powerpc64le-*-freebsd*) - TARGET=POWERPC; TARGETDIR=powerpc - ;; - powerpc*-*-rtems*) - TARGET=POWERPC; TARGETDIR=powerpc - ;; - - riscv*-*) - TARGET=RISCV; TARGETDIR=riscv - SOURCES="ffi.c sysv.S" - ;; - - s390-*-* | s390x-*-*) - TARGET=S390; TARGETDIR=s390 - SOURCES="ffi.c sysv.S" - ;; - - sh-*-* | sh[34]*-*-*) - TARGET=SH; TARGETDIR=sh - SOURCES="ffi.c sysv.S" - ;; - sh64-*-* | sh5*-*-*) - TARGET=SH64; TARGETDIR=sh64 - SOURCES="ffi.c sysv.S" - ;; - - sparc*-*-*) - TARGET=SPARC; TARGETDIR=sparc - SOURCES="ffi.c ffi64.c v8.S v9.S" - ;; - - tile*-*) - TARGET=TILE; TARGETDIR=tile - SOURCES="ffi.c tile.S" - ;; - - vax-*-*) - TARGET=VAX; TARGETDIR=vax - SOURCES="ffi.c elfbsd.S" - ;; - - wasm32-*-*) - TARGET=wasm32; TARGETDIR=wasm - SOURCES="ffi.c" - ;; - - wasm64-*-*) - TARGET=wasm64; TARGETDIR=wasm - SOURCES="ffi.c" - ;; - - xtensa*-*) - TARGET=XTENSA; TARGETDIR=xtensa - SOURCES="ffi.c sysv.S" - ;; -esac - -# ... but some of the cases above share configury. -case "${TARGET}" in - ARM_WIN32) - if test "$MSVC" = 1; then - SOURCES="ffi.c sysv_msvc_arm32.S" - else - SOURCES="ffi.c sysv.S" - fi - ;; - ARM_WIN64) - if test "$MSVC" = 1; then - SOURCES="ffi.c win64_armasm.S" - else - SOURCES="ffi.c sysv.S" - fi - ;; - MIPS) - SOURCES="ffi.c o32.S n32.S" - ;; - POWERPC) - SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S" - SOURCES="${SOURCES} linux64.S linux64_closure.S" - ;; - POWERPC_AIX) - SOURCES="ffi_darwin.c aix.S aix_closure.S" - ;; - POWERPC_DARWIN) - SOURCES="ffi_darwin.c darwin.S darwin_closure.S" - ;; - POWERPC_FREEBSD) - SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S" - ;; - X86 | X86_DARWIN | X86_FREEBSD | X86_WIN32) - if test "$MSVC" = 1; then - SOURCES="ffi.c sysv_intel.S" - else - SOURCES="ffi.c sysv.S" - fi - ;; - X86_64) - if test x"$TARGET_X32" = xyes; then - SOURCES="ffi64.c unix64.S" - else - SOURCES="ffi64.c unix64.S ffiw64.c win64.S" - fi - ;; - X86_WIN64) - if test "$MSVC" = 1; then - SOURCES="ffiw64.c win64_intel.S" - else - SOURCES="ffiw64.c win64.S" - fi - ;; -esac - -# If we failed to configure SOURCES, we can't do anything. -if test -z "${SOURCES}"; then - UNSUPPORTED=1 -fi diff --git a/deps/libffi/doc/Makefile.am b/deps/libffi/doc/Makefile.am deleted file mode 100644 index 43b650aea7a2dc..00000000000000 --- a/deps/libffi/doc/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -## Process this with automake to create Makefile.in - -info_TEXINFOS = libffi.texi diff --git a/deps/libffi/doc/libffi.texi b/deps/libffi/doc/libffi.texi deleted file mode 100644 index 165c2fb1f873ec..00000000000000 --- a/deps/libffi/doc/libffi.texi +++ /dev/null @@ -1,1069 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@c %**start of header -@setfilename libffi.info -@include version.texi -@settitle libffi: the portable foreign function interface library -@setchapternewpage off -@c %**end of header - -@c Merge the standard indexes into a single one. -@syncodeindex fn cp -@syncodeindex vr cp -@syncodeindex ky cp -@syncodeindex pg cp -@syncodeindex tp cp - -@copying - -This manual is for libffi, a portable foreign function interface -library. - -Copyright @copyright{} 2008--2025 Anthony Green and Red Hat, Inc. - -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. - -@end copying - -@dircategory Development -@direntry -* libffi: (libffi). Portable foreign function interface library. -@end direntry - -@titlepage -@title libffi: a foreign function interface library -@subtitle For Version @value{VERSION} of libffi -@author Anthony Green -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - - -@ifnottex -@node Top -@top libffi - -@insertcopying - -@menu -* Introduction:: What is libffi? -* Using libffi:: How to use libffi. -* Memory Usage:: Where memory for closures comes from. -* Missing Features:: Things libffi can't do. -* Index:: Index. -@end menu - -@end ifnottex - - -@node Introduction -@chapter What is libffi? - -Compilers for high level languages generate code that follow certain -conventions. These conventions are necessary, in part, for separate -compilation to work. One such convention is the @dfn{calling -convention}. The calling convention is a set of assumptions made by -the compiler about where function arguments will be found on entry to -a function. A calling convention also specifies where the return -value for a function is found. The calling convention is also -sometimes called the @dfn{ABI} or @dfn{Application Binary Interface}. -@cindex calling convention -@cindex ABI -@cindex Application Binary Interface - -Some programs may not know at the time of compilation what arguments -are to be passed to a function. For instance, an interpreter may be -told at run-time about the number and types of arguments used to call -a given function. @code{libffi} can be used in such programs to -provide a bridge from the interpreter program to compiled code. - -The @code{libffi} library provides a portable, high level programming -interface to various calling conventions. This allows a programmer to -call any function specified by a call interface description at run -time. - -@acronym{FFI} stands for Foreign Function Interface. A foreign -function interface is the popular name for the interface that allows -code written in one language to call code written in another language. -The @code{libffi} library really only provides the lowest, machine -dependent layer of a fully featured foreign function interface. A -layer must exist above @code{libffi} that handles type conversions for -values passed between the two languages. -@cindex FFI -@cindex Foreign Function Interface - - -@node Using libffi -@chapter Using libffi - -@menu -* The Basics:: The basic libffi API. -* Simple Example:: A simple example. -* Types:: libffi type descriptions. -* Multiple ABIs:: Different passing styles on one platform. -* The Closure API:: Writing a generic function. -* Closure Example:: A closure example. -* Thread Safety:: Thread safety. -@end menu - - -@node The Basics -@section The Basics - -@code{libffi} assumes that you have a pointer to the function you wish -to call and that you know the number and types of arguments to pass -it, as well as the return type of the function. - -The first thing you must do is create an @code{ffi_cif} object that -matches the signature of the function you wish to call. This is a -separate step because it is common to make multiple calls using a -single @code{ffi_cif}. The @dfn{cif} in @code{ffi_cif} stands for -Call InterFace. To prepare a call interface object, use the function -@code{ffi_prep_cif}. -@cindex cif - -@findex ffi_prep_cif -@defun ffi_status ffi_prep_cif (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes}) -This initializes @var{cif} according to the given parameters. - -@var{abi} is the ABI to use; normally @code{FFI_DEFAULT_ABI} is what -you want. @ref{Multiple ABIs} for more information. - -@var{nargs} is the number of arguments that this function accepts. - -@var{rtype} is a pointer to an @code{ffi_type} structure that -describes the return type of the function. @xref{Types}. - -@var{argtypes} is a vector of @code{ffi_type} pointers. -@var{argtypes} must have @var{nargs} elements. If @var{nargs} is 0, -this argument is ignored. - -@code{ffi_prep_cif} returns a @code{libffi} status code, of type -@code{ffi_status}. This will be either @code{FFI_OK} if everything -worked properly; @code{FFI_BAD_TYPEDEF} if one of the @code{ffi_type} -objects is incorrect; or @code{FFI_BAD_ABI} if the @var{abi} parameter -is invalid. -@end defun - -If the function being called is variadic (varargs) then -@code{ffi_prep_cif_var} must be used instead of @code{ffi_prep_cif}. - -@findex ffi_prep_cif_var -@defun ffi_status ffi_prep_cif_var (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nfixedargs}, unsigned int @var{ntotalargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes}) -This initializes @var{cif} according to the given parameters for -a call to a variadic function. In general its operation is the -same as for @code{ffi_prep_cif} except that: - -@var{nfixedargs} is the number of fixed arguments, prior to any -variadic arguments. It must be greater than zero. - -@var{ntotalargs} the total number of arguments, including variadic -and fixed arguments. @var{argtypes} must have this many elements. - -@code{ffi_prep_cif_var} will return @code{FFI_BAD_ARGTYPE} if any of -the variable argument types are @code{ffi_type_float} (promote to -@code{ffi_type_double} first), or any integer type small than an int -(promote to an int-sized type first). - -Note that, different cif's must be prepped for calls to the same -function when different numbers of arguments are passed. - -Also note that a call to @code{ffi_prep_cif_var} with -@var{nfixedargs}=@var{nototalargs} is NOT equivalent to a call to -@code{ffi_prep_cif}. - -@end defun - -Note that the resulting @code{ffi_cif} holds pointers to all the -@code{ffi_type} objects that were used during initialization. You -must ensure that these type objects have a lifetime at least as long -as that of the @code{ffi_cif}. - -To call a function using an initialized @code{ffi_cif}, use the -@code{ffi_call} function: - -@findex ffi_call -@defun void ffi_call (ffi_cif *@var{cif}, void *@var{fn}, void *@var{rvalue}, void **@var{avalues}) -This calls the function @var{fn} according to the description given in -@var{cif}. @var{cif} must have already been prepared using -@code{ffi_prep_cif}. - -@var{rvalue} is a pointer to a chunk of memory that will hold the -result of the function call. This must be large enough to hold the -result, no smaller than the system register size (generally 32 or 64 -bits), and must be suitably aligned; it is the caller's responsibility -to ensure this. If @var{cif} declares that the function returns -@code{void} (using @code{ffi_type_void}), then @var{rvalue} is -ignored. - -In most situations, @code{libffi} will handle promotion according to -the ABI. However, for historical reasons, there is a special case -with return values that must be handled by your code. In particular, -for integral (not @code{struct}) types that are narrower than the -system register size, the return value will be widened by -@code{libffi}. @code{libffi} provides a type, @code{ffi_arg}, that -can be used as the return type. For example, if the CIF was defined -with a return type of @code{char}, @code{libffi} will try to store a -full @code{ffi_arg} into the return value. - -@var{avalues} is a vector of @code{void *} pointers that point to the -memory locations holding the argument values for a call. If @var{cif} -declares that the function has no arguments (i.e., @var{nargs} was 0), -then @var{avalues} is ignored. - -Note that while the return value must be register-sized, arguments -should exactly match their declared type. For example, if an argument -is a @code{short}, then the entry in @var{avalues} should point to an -object declared as @code{short}; but if the return type is -@code{short}, then @var{rvalue} should point to an object declared as -a larger type -- usually @code{ffi_arg}. -@end defun - -@findex ffi_get_version -@defun {const char *} ffi_get_version (void) -Returns the library version as a string. This string is also -available at build time as the macro @code{FFI_VERSION_STRING}. -@end defun - -@findex ffi_get_version_number -@defun {unsigned long} ffi_get_version_number (void) -Returns the library version as an unsigned long value where -version ``x.y.z'' is represented as the number x*10000+y*100+z. -This number is also available at build time as the macro -@code{FFI_VERSION_NUMBER}. -@end defun - -@findex ffi_get_default_abi -@defun {unsigned int} ffi_get_default_abi (void) -Return the value of @code{FFI_DEFAULT_ABI}. -@end defun - -@findex ffi_get_closure_size -@defun {size_t} ffi_get_closure_size (void) -Return @code{sizeof(ffi_closure)}. -@end defun - -@node Simple Example -@section Simple Example - -Here is a trivial example that calls @code{puts} a few times. - -@example -#include -#include - -int main() -@{ - ffi_cif cif; - ffi_type *args[1]; - void *values[1]; - char *s; - ffi_arg rc; - - /* Initialize the argument info vectors */ - args[0] = &ffi_type_pointer; - values[0] = &s; - - /* Initialize the cif */ - if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, - &ffi_type_sint, args) == FFI_OK) - @{ - s = "Hello World!"; - ffi_call(&cif, (void(*)())puts, &rc, values); - /* rc now holds the result of the call to puts */ - - /* values holds a pointer to the function's arg, so to - call puts() again all we need to do is change the - value of s */ - s = "This is cool!"; - ffi_call(&cif, (void(*)())puts, &rc, values); - @} - - return 0; -@} -@end example - - -@node Types -@section Types - -@menu -* Primitive Types:: Built-in types. -* Structures:: Structure types. -* Size and Alignment:: Size and alignment of types. -* Arrays Unions Enums:: Arrays, unions, and enumerations. -* Type Example:: Structure type example. -* Complex:: Complex types. -* Complex Type Example:: Complex type example. -@end menu - -@node Primitive Types -@subsection Primitive Types - -@code{Libffi} provides a number of built-in type descriptors that can -be used to describe argument and return types: - -@table @code -@item ffi_type_void -@tindex ffi_type_void -The type @code{void}. This cannot be used for argument types, only -for return values. - -@item ffi_type_uint8 -@tindex ffi_type_uint8 -An unsigned, 8-bit integer type. - -@item ffi_type_sint8 -@tindex ffi_type_sint8 -A signed, 8-bit integer type. - -@item ffi_type_uint16 -@tindex ffi_type_uint16 -An unsigned, 16-bit integer type. - -@item ffi_type_sint16 -@tindex ffi_type_sint16 -A signed, 16-bit integer type. - -@item ffi_type_uint32 -@tindex ffi_type_uint32 -An unsigned, 32-bit integer type. - -@item ffi_type_sint32 -@tindex ffi_type_sint32 -A signed, 32-bit integer type. - -@item ffi_type_uint64 -@tindex ffi_type_uint64 -An unsigned, 64-bit integer type. - -@item ffi_type_sint64 -@tindex ffi_type_sint64 -A signed, 64-bit integer type. - -@item ffi_type_float -@tindex ffi_type_float -The C @code{float} type. - -@item ffi_type_double -@tindex ffi_type_double -The C @code{double} type. - -@item ffi_type_uchar -@tindex ffi_type_uchar -The C @code{unsigned char} type. - -@item ffi_type_schar -@tindex ffi_type_schar -The C @code{signed char} type. (Note that there is not an exact -equivalent to the C @code{char} type in @code{libffi}; ordinarily you -should either use @code{ffi_type_schar} or @code{ffi_type_uchar} -depending on whether @code{char} is signed.) - -@item ffi_type_ushort -@tindex ffi_type_ushort -The C @code{unsigned short} type. - -@item ffi_type_sshort -@tindex ffi_type_sshort -The C @code{short} type. - -@item ffi_type_uint -@tindex ffi_type_uint -The C @code{unsigned int} type. - -@item ffi_type_sint -@tindex ffi_type_sint -The C @code{int} type. - -@item ffi_type_ulong -@tindex ffi_type_ulong -The C @code{unsigned long} type. - -@item ffi_type_slong -@tindex ffi_type_slong -The C @code{long} type. - -@item ffi_type_longdouble -@tindex ffi_type_longdouble -On platforms that have a C @code{long double} type, this is defined. -On other platforms, it is not. - -@item ffi_type_pointer -@tindex ffi_type_pointer -A generic @code{void *} pointer. You should use this for all -pointers, regardless of their real type. - -@item ffi_type_complex_float -@tindex ffi_type_complex_float -The C @code{_Complex float} type. - -@item ffi_type_complex_double -@tindex ffi_type_complex_double -The C @code{_Complex double} type. - -@item ffi_type_complex_longdouble -@tindex ffi_type_complex_longdouble -The C @code{_Complex long double} type. -On platforms that have a C @code{long double} type, this is defined. -On other platforms, it is not. -@end table - -Each of these is of type @code{ffi_type}, so you must take the address -when passing to @code{ffi_prep_cif}. - - -@node Structures -@subsection Structures - -@code{libffi} is perfectly happy passing structures back and forth. -You must first describe the structure to @code{libffi} by creating a -new @code{ffi_type} object for it. - -@tindex ffi_type -@deftp {Data type} ffi_type -The @code{ffi_type} has the following members: -@table @code -@item size_t size -This is set by @code{libffi}; you should initialize it to zero. - -@item unsigned short alignment -This is set by @code{libffi}; you should initialize it to zero. - -@item unsigned short type -For a structure, this should be set to @code{FFI_TYPE_STRUCT}. - -@item ffi_type **elements -This is a @samp{NULL}-terminated array of pointers to @code{ffi_type} -objects. There is one element per field of the struct. - -Note that @code{libffi} has no special support for bit-fields. You -must manage these manually. -@end table -@end deftp - -The @code{size} and @code{alignment} fields will be filled in by -@code{ffi_prep_cif} or @code{ffi_prep_cif_var}, as needed. - -@node Size and Alignment -@subsection Size and Alignment - -@code{libffi} will set the @code{size} and @code{alignment} fields of -an @code{ffi_type} object for you. It does so using its knowledge of -the ABI. - -You might expect that you can simply read these fields for a type that -has been laid out by @code{libffi}. However, there are some caveats. - -@itemize @bullet -@item -The size or alignment of some of the built-in types may vary depending -on the chosen ABI. - -@item -The size and alignment of a new structure type will not be set by -@code{libffi} until it has been passed to @code{ffi_prep_cif} or -@code{ffi_get_struct_offsets}. - -@item -A structure type cannot be shared across ABIs. Instead each ABI needs -its own copy of the structure type. -@end itemize - -So, before examining these fields, it is safest to pass the -@code{ffi_type} object to @code{ffi_prep_cif} or -@code{ffi_get_struct_offsets} first. This function will do all the -needed setup. - -@example -ffi_type *desired_type; -ffi_abi desired_abi; -@dots{} -ffi_cif cif; -if (ffi_prep_cif (&cif, desired_abi, 0, desired_type, NULL) == FFI_OK) - @{ - size_t size = desired_type->size; - unsigned short alignment = desired_type->alignment; - @} -@end example - -@code{libffi} also provides a way to get the offsets of the members of -a structure. - -@findex ffi_get_struct_offsets -@defun ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets) -Compute the offset of each element of the given structure type. -@var{abi} is the ABI to use; this is needed because in some cases the -layout depends on the ABI. - -@var{offsets} is an out parameter. The caller is responsible for -providing enough space for all the results to be written -- one -element per element type in @var{struct_type}. If @var{offsets} is -@code{NULL}, then the type will be laid out but not otherwise -modified. This can be useful for accessing the type's size or layout, -as mentioned above. - -This function returns @code{FFI_OK} on success; @code{FFI_BAD_ABI} if -@var{abi} is invalid; or @code{FFI_BAD_TYPEDEF} if @var{struct_type} -is invalid in some way. Note that only @code{FFI_STRUCT} types are -valid here. -@end defun - -@node Arrays Unions Enums -@subsection Arrays, Unions, and Enumerations - -@subsubsection Arrays - -@code{libffi} does not have direct support for arrays or unions. -However, they can be emulated using structures. - -To emulate an array, simply create an @code{ffi_type} using -@code{FFI_TYPE_STRUCT} with as many members as there are elements in -the array. - -@example -ffi_type array_type; -ffi_type **elements -int i; - -elements = malloc ((n + 1) * sizeof (ffi_type *)); -for (i = 0; i < n; ++i) - elements[i] = array_element_type; -elements[n] = NULL; - -array_type.size = array_type.alignment = 0; -array_type.type = FFI_TYPE_STRUCT; -array_type.elements = elements; -@end example - -Note that arrays cannot be passed or returned by value in C -- -structure types created like this should only be used to refer to -members of real @code{FFI_TYPE_STRUCT} objects. - -However, a phony array type like this will not cause any errors from -@code{libffi} if you use it as an argument or return type. This may -be confusing. - -@subsubsection Unions - -A union can also be emulated using @code{FFI_TYPE_STRUCT}. In this -case, however, you must make sure that the size and alignment match -the real requirements of the union. - -One simple way to do this is to ensue that each element type is laid -out. Then, give the new structure type a single element; the size of -the largest element; and the largest alignment seen as well. - -This example uses the @code{ffi_prep_cif} trick to ensure that each -element type is laid out. - -@example -ffi_abi desired_abi; -ffi_type union_type; -ffi_type **union_elements; - -int i; -ffi_type element_types[2]; - -element_types[1] = NULL; - -union_type.size = union_type.alignment = 0; -union_type.type = FFI_TYPE_STRUCT; -union_type.elements = element_types; - -for (i = 0; union_elements[i]; ++i) - @{ - ffi_cif cif; - if (ffi_prep_cif (&cif, desired_abi, 0, union_elements[i], NULL) == FFI_OK) - @{ - if (union_elements[i]->size > union_type.size) - @{ - union_type.size = union_elements[i]; - size = union_elements[i]->size; - @} - if (union_elements[i]->alignment > union_type.alignment) - union_type.alignment = union_elements[i]->alignment; - @} - @} -@end example - -@subsubsection Enumerations - -@code{libffi} does not have any special support for C @code{enum}s. -Although any given @code{enum} is implemented using a specific -underlying integral type, exactly which type will be used cannot be -determined by @code{libffi} -- it may depend on the values in the -enumeration or on compiler flags such as @option{-fshort-enums}. -@xref{Structures unions enumerations and bit-fields implementation, , , gcc}, -for more information about how GCC handles enumerations. - -@node Type Example -@subsection Type Example - -The following example initializes a @code{ffi_type} object -representing the @code{tm} struct from Linux's @file{time.h}. - -Here is how the struct is defined: - -@example -struct tm @{ - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; - /* Those are for future use. */ - long int __tm_gmtoff__; - __const char *__tm_zone__; -@}; -@end example - -Here is the corresponding code to describe this struct to -@code{libffi}: - -@example - @{ - ffi_type tm_type; - ffi_type *tm_type_elements[12]; - int i; - - tm_type.size = tm_type.alignment = 0; - tm_type.type = FFI_TYPE_STRUCT; - tm_type.elements = tm_type_elements; - - for (i = 0; i < 9; i++) - tm_type_elements[i] = &ffi_type_sint; - - tm_type_elements[9] = &ffi_type_slong; - tm_type_elements[10] = &ffi_type_pointer; - tm_type_elements[11] = NULL; - - /* tm_type can now be used to represent tm argument types and - return types for ffi_prep_cif() */ - @} -@end example - -@node Complex -@subsection Complex Types - -@code{libffi} supports the complex types defined by the C99 -standard (@code{_Complex float}, @code{_Complex double} and -@code{_Complex long double} with the built-in type descriptors -@code{ffi_type_complex_float}, @code{ffi_type_complex_double} and -@code{ffi_type_complex_longdouble}. - -Custom complex types like @code{_Complex int} can also be used. -An @code{ffi_type} object has to be defined to describe the -complex type to @code{libffi}. - -@tindex ffi_type -@deftp {Data type} ffi_type -@table @code -@item size_t size -This must be manually set to the size of the complex type. - -@item unsigned short alignment -This must be manually set to the alignment of the complex type. - -@item unsigned short type -For a complex type, this must be set to @code{FFI_TYPE_COMPLEX}. - -@item ffi_type **elements - -This is a @samp{NULL}-terminated array of pointers to -@code{ffi_type} objects. The first element is set to the -@code{ffi_type} of the complex's base type. The second element -must be set to @code{NULL}. -@end table -@end deftp - -The section @ref{Complex Type Example} shows a way to determine -the @code{size} and @code{alignment} members in a platform -independent way. - -For platforms that have no complex support in @code{libffi} yet, -the functions @code{ffi_prep_cif} and @code{ffi_prep_args} abort -the program if they encounter a complex type. - -@node Complex Type Example -@subsection Complex Type Example - -This example demonstrates how to use complex types: - -@example -#include -#include -#include - -void complex_fn(_Complex float cf, - _Complex double cd, - _Complex long double cld) -@{ - printf("cf=%f+%fi\ncd=%f+%fi\ncld=%f+%fi\n", - (float)creal (cf), (float)cimag (cf), - (float)creal (cd), (float)cimag (cd), - (float)creal (cld), (float)cimag (cld)); -@} - -int main() -@{ - ffi_cif cif; - ffi_type *args[3]; - void *values[3]; - _Complex float cf; - _Complex double cd; - _Complex long double cld; - - /* Initialize the argument info vectors */ - args[0] = &ffi_type_complex_float; - args[1] = &ffi_type_complex_double; - args[2] = &ffi_type_complex_longdouble; - values[0] = &cf; - values[1] = &cd; - values[2] = &cld; - - /* Initialize the cif */ - if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, - &ffi_type_void, args) == FFI_OK) - @{ - cf = 1.0 + 20.0 * I; - cd = 300.0 + 4000.0 * I; - cld = 50000.0 + 600000.0 * I; - /* Call the function */ - ffi_call(&cif, (void (*)(void))complex_fn, 0, values); - @} - - return 0; -@} -@end example - -This is an example for defining a custom complex type descriptor -for compilers that support them: - -@example -/* - * This macro can be used to define new complex type descriptors - * in a platform independent way. - * - * name: Name of the new descriptor is ffi_type_complex_. - * type: The C base type of the complex type. - */ -#define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \ - static ffi_type *ffi_elements_complex_##name [2] = @{ \ - (ffi_type *)(&ffitype), NULL \ - @}; \ - struct struct_align_complex_##name @{ \ - char c; \ - _Complex type x; \ - @}; \ - ffi_type ffi_type_complex_##name = @{ \ - sizeof(_Complex type), \ - offsetof(struct struct_align_complex_##name, x), \ - FFI_TYPE_COMPLEX, \ - (ffi_type **)ffi_elements_complex_##name \ - @} - -/* Define new complex type descriptors using the macro: */ -/* ffi_type_complex_sint */ -FFI_COMPLEX_TYPEDEF(sint, int, ffi_type_sint); -/* ffi_type_complex_uchar */ -FFI_COMPLEX_TYPEDEF(uchar, unsigned char, ffi_type_uint8); -@end example - -The new type descriptors can then be used like one of the built-in -type descriptors in the previous example. - -@node Multiple ABIs -@section Multiple ABIs - -A given platform may provide multiple different ABIs at once. For -instance, the x86 platform has both @samp{stdcall} and @samp{fastcall} -functions. - -@code{libffi} provides some support for this. However, this is -necessarily platform-specific. - -@c FIXME: document the platforms - -@node The Closure API -@section The Closure API - -@code{libffi} also provides a way to write a generic function -- a -function that can accept and decode any combination of arguments. -This can be useful when writing an interpreter, or to provide wrappers -for arbitrary functions. - -This facility is called the @dfn{closure API}. Closures are not -supported on all platforms; you can check the @code{FFI_CLOSURES} -define to determine whether they are supported on the current -platform. -@cindex closures -@cindex closure API -@findex FFI_CLOSURES - -Because closures work by assembling a tiny function at runtime, they -require special allocation on platforms that have a non-executable -heap. Memory management for closures is handled by a pair of -functions: - -@findex ffi_closure_alloc -@defun void *ffi_closure_alloc (size_t @var{size}, void **@var{code}) -Allocate a chunk of memory holding @var{size} bytes. This returns a -pointer to the writable address, and sets *@var{code} to the -corresponding executable address. - -@var{size} should be sufficient to hold a @code{ffi_closure} object. -@end defun - -@findex ffi_closure_free -@defun void ffi_closure_free (void *@var{writable}) -Free memory allocated using @code{ffi_closure_alloc}. The argument is -the writable address that was returned. -@end defun - -Once you have allocated the memory for a closure, you must construct a -@code{ffi_cif} describing the function call. Finally you can prepare -the closure function: - -@findex ffi_prep_closure_loc -@defun ffi_status ffi_prep_closure_loc (ffi_closure *@var{closure}, ffi_cif *@var{cif}, void (*@var{fun}) (ffi_cif *@var{cif}, void *@var{ret}, void **@var{args}, void *@var{user_data}), void *@var{user_data}, void *@var{codeloc}) -Prepare a closure function. The arguments to -@code{ffi_prep_closure_loc} are: - -@table @var -@item closure -The address of a @code{ffi_closure} object; this is the writable -address returned by @code{ffi_closure_alloc}. - -@item cif -The @code{ffi_cif} describing the function parameters. Note that this -object, and the types to which it refers, must be kept alive until the -closure itself is freed. - -@item user_data -An arbitrary datum that is passed, uninterpreted, to your closure -function. - -@item codeloc -The executable address returned by @code{ffi_closure_alloc}. - -@item fun -The function which will be called when the closure is invoked. It is -called with the arguments: - -@table @var -@item cif -The @code{ffi_cif} passed to @code{ffi_prep_closure_loc}. - -@item ret -A pointer to the memory used for the function's return value. - -If the function is declared as returning @code{void}, then this value -is garbage and should not be used. - -Otherwise, @var{fun} must fill the object to which this points, -following the same special promotion behavior as @code{ffi_call}. -That is, in most cases, @var{ret} points to an object of exactly the -size of the type specified when @var{cif} was constructed. However, -integral types narrower than the system register size are widened. In -these cases your program may assume that @var{ret} points to an -@code{ffi_arg} object. - -@item args -A vector of pointers to memory holding the arguments to the function. - -@item user_data -The same @var{user_data} that was passed to -@code{ffi_prep_closure_loc}. -@end table -@end table - -@code{ffi_prep_closure_loc} will return @code{FFI_OK} if everything -went ok, and one of the other @code{ffi_status} values on error. - -After calling @code{ffi_prep_closure_loc}, you can cast @var{codeloc} -to the appropriate pointer-to-function type. -@end defun - -You may see old code referring to @code{ffi_prep_closure}. This -function is deprecated, as it cannot handle the need for separate -writable and executable addresses. - -@node Closure Example -@section Closure Example - -A trivial example that creates a new @code{puts} by binding -@code{fputs} with @code{stdout}. - -@example -#include -#include - -/* Acts like puts with the file given at time of enclosure. */ -void puts_binding(ffi_cif *cif, void *ret, void* args[], - void *stream) -@{ - *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream); -@} - -typedef int (*puts_t)(char *); - -int main() -@{ - ffi_cif cif; - ffi_type *args[1]; - ffi_closure *closure; - - void *bound_puts; - int rc; - - /* Allocate closure and bound_puts */ - closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts); - - if (closure) - @{ - /* Initialize the argument info vectors */ - args[0] = &ffi_type_pointer; - - /* Initialize the cif */ - if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, - &ffi_type_sint, args) == FFI_OK) - @{ - /* Initialize the closure, setting stream to stdout */ - if (ffi_prep_closure_loc(closure, &cif, puts_binding, - stdout, bound_puts) == FFI_OK) - @{ - rc = ((puts_t)bound_puts)("Hello World!"); - /* rc now holds the result of the call to fputs */ - @} - @} - @} - - /* Deallocate both closure, and bound_puts */ - ffi_closure_free(closure); - - return 0; -@} - -@end example - -@node Thread Safety -@section Thread Safety - -@code{libffi} is not completely thread-safe. However, many parts are, -and if you follow some simple rules, you can use it safely in a -multi-threaded program. - -@itemize @bullet -@item -@code{ffi_prep_cif} may modify the @code{ffi_type} objects passed to -it. It is best to ensure that only a single thread prepares a given -@code{ffi_cif} at a time. - -@item -On some platforms, @code{ffi_prep_cif} may modify the size and -alignment of some types, depending on the chosen ABI. On these -platforms, if you switch between ABIs, you must ensure that there is -only one call to @code{ffi_prep_cif} at a time. - -Currently the only affected platform is PowerPC and the only affected -type is @code{long double}. -@end itemize - -@node Memory Usage -@chapter Memory Usage - -Note that memory allocated by @code{ffi_closure_alloc} and freed by -@code{ffi_closure_free} does not come from the same general pool of -memory that @code{malloc} and @code{free} use. To accomodate security -settings, @code{libffi} may aquire memory, for example, by mapping -temporary files into multiple places in the address space (once to -write out the closure, a second to execute it). The search follows -this list, using the first that works: - -@itemize @bullet - -@item -A anonymous mapping (i.e. not file-backed) - -@item -@code{memfd_create()}, if the kernel supports it. - -@item -A file created in the directory referenced by the environment variable -@code{LIBFFI_TMPDIR}. - -@item -Likewise for the environment variable @code{TMPDIR}. - -@item -A file created in @code{/tmp}. - -@item -A file created in @code{/var/tmp}. - -@item -A file created in @code{/dev/shm}. - -@item -A file created in the user's home directory (@code{$HOME}). - -@item -A file created in any directory listed in @code{/etc/mtab}. - -@item -A file created in any directory listed in @code{/proc/mounts}. - -@end itemize - -If security settings prohibit using any of these for closures, -@code{ffi_closure_alloc} will fail. - -@node Missing Features -@chapter Missing Features - -@code{libffi} is missing a few features. We welcome patches to add -support for these. - -@itemize @bullet -@item -Variadic closures. - -@item -There is no support for bit fields in structures. - -@item -The ``raw'' API is undocumented. -@c anything else? - -@item -The Go API is undocumented. -@end itemize - -@node Index -@unnumbered Index - -@printindex cp - -@bye diff --git a/deps/libffi/doc/version.texi b/deps/libffi/doc/version.texi deleted file mode 100644 index fc180c12dd52e8..00000000000000 --- a/deps/libffi/doc/version.texi +++ /dev/null @@ -1,4 +0,0 @@ -@set UPDATED 2 August 2025 -@set UPDATED-MONTH August 2025 -@set EDITION 3.5.2 -@set VERSION 3.5.2 diff --git a/deps/libffi/generate-configure-headers.py b/deps/libffi/generate-configure-headers.py deleted file mode 100644 index 17df60ceb6e0c1..00000000000000 --- a/deps/libffi/generate-configure-headers.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import subprocess -import argparse -from pathlib import Path - -def get_host_os(os_name): - """Map GYP OS names to configure host OS.""" - mapping = { - 'linux': 'linux-gnu', - 'mac': 'darwin', - 'win': 'mingw', - 'freebsd': 'freebsd', - } - return mapping.get(os_name, os_name) - -def get_host_arch(os_name, arch): - """Map GYP architecture to configure host architecture.""" - arch_mapping = { - 'x64': 'x86_64', - 'x86': 'i686', - 'arm': 'arm', - 'arm64': 'aarch64', - } - arch_name = arch_mapping.get(arch, arch) - os_name_mapped = get_host_os(os_name) - return f"{arch_name}-pc-{os_name_mapped}" - -def run_command(cmd): - """Run a command and return success status.""" - try: - subprocess.run(cmd, check=True) - return True - except subprocess.CalledProcessError as e: - print(f"Error running command: {' '.join(cmd)}", file=sys.stderr) - print(f"Error: {e}", file=sys.stderr) - return False - -def generate_headers(output_dir, target_arch, os_name, libffi_dir): - """Generate libffi headers using configure script.""" - os.makedirs(output_dir, exist_ok=True) - - # Change to libffi directory - original_dir = os.getcwd() - try: - os.chdir(libffi_dir) - - # Create a temporary build directory - build_dir = os.path.join(output_dir, 'build') - os.makedirs(build_dir, exist_ok=True) - - host_triplet = get_host_arch(os_name, target_arch) - - # Run configure script - configure_path = os.path.join(libffi_dir, 'configure') - configure_cmd = [ - configure_path, - f'--host={host_triplet}', - f'--prefix={build_dir}', - '--disable-shared', - '--enable-static', - ] - - print(f"Running configure with: {' '.join(configure_cmd)}") - - if not run_command(configure_cmd): - return False - - # Copy generated headers to output directory - header_files = ['fficonfig.h', 'ffitarget.h', 'include/ffi.h'] - - for header in header_files: - src_path = os.path.join(libffi_dir, header) - dst_path = os.path.join(output_dir, os.path.basename(header)) - - if os.path.exists(src_path): - with open(src_path, 'r') as src: - with open(dst_path, 'w') as dst: - dst.write(src.read()) - print(f"Generated: {dst_path}") - else: - print(f"Warning: {src_path} not found", file=sys.stderr) - - return True - - finally: - os.chdir(original_dir) - -def main(): - parser = argparse.ArgumentParser(description='Generate libffi headers') - parser.add_argument('--output-dir', required=True, help='Output directory for generated headers') - parser.add_argument('--target-arch', required=True, help='Target architecture (x86, x64, arm, arm64)') - parser.add_argument('--os', required=True, help='Target OS (linux, mac, win, freebsd)') - - args = parser.parse_args() - - # Get the libffi directory (parent of this script) - libffi_dir = os.path.dirname(os.path.abspath(__file__)) - - if generate_headers(args.output_dir, args.target_arch, args.os, libffi_dir): - print("Headers generated successfully") - sys.exit(0) - else: - print("Failed to generate headers", file=sys.stderr) - sys.exit(1) - -if __name__ == '__main__': - main() diff --git a/deps/libffi/generate-darwin-source-and-headers.py b/deps/libffi/generate-darwin-source-and-headers.py deleted file mode 100755 index f6e9152846aa9e..00000000000000 --- a/deps/libffi/generate-darwin-source-and-headers.py +++ /dev/null @@ -1,285 +0,0 @@ -#!/usr/bin/env python -import subprocess -import os -import errno -import collections -import glob -import argparse - - -class Platform(object): - pass - - -class x86_64_platform(Platform): - arch = 'x86_64' - - prefix = "#ifdef __x86_64__\n\n" - suffix = "\n\n#endif" - src_dir = 'x86' - src_files = ['unix64.S', 'ffi64.c', 'ffiw64.c', 'win64.S', 'internal64.h', 'asmnames.h'] - - -class arm64_platform(Platform): - arch = 'arm64' - - prefix = "#ifdef __arm64__\n\n" - suffix = "\n\n#endif" - src_dir = 'aarch64' - src_files = ['sysv.S', 'ffi.c', 'internal.h'] - - -class armv7_platform(Platform): - arch = 'armv7' - - prefix = "#ifdef __arm__\n\n" - suffix = "\n\n#endif" - src_dir = 'arm' - src_files = ['sysv.S', 'ffi.c', 'internal.h'] - - -class ios_simulator_x86_64_platform(x86_64_platform): - target = 'x86_64-apple-ios-simulator' - directory = 'darwin_ios' - sdk = 'iphonesimulator' - version_min = '-miphoneos-version-min=7.0' - - -class ios_simulator_arm64_platform(arm64_platform): - target = 'arm64-apple-ios-simulator' - directory = 'darwin_ios' - sdk = 'iphonesimulator' - version_min = '-miphoneos-version-min=7.0' - - -class ios_device_armv7_platform(armv7_platform): - target = 'armv7-apple-ios' - directory = 'darwin_ios' - sdk = 'iphoneos' - version_min = '-miphoneos-version-min=7.0' - - -class ios_device_arm64_platform(arm64_platform): - target = 'arm64-apple-ios' - directory = 'darwin_ios' - sdk = 'iphoneos' - version_min = '-miphoneos-version-min=7.0' - - -class desktop_x86_64_platform(x86_64_platform): - target = 'x86_64-apple-macos' - directory = 'darwin_osx' - sdk = 'macosx' - version_min = '-mmacosx-version-min=10.6' - - -class desktop_arm64_platform(arm64_platform): - target = 'arm64-apple-macos' - directory = 'darwin_osx' - sdk = 'macosx' - version_min = '-mmacosx-version-min=11.0' - - -class tvos_simulator_x86_64_platform(x86_64_platform): - target = 'x86_64-apple-tvos-simulator' - directory = 'darwin_tvos' - sdk = 'appletvsimulator' - version_min = '-mtvos-version-min=9.0' - - -class tvos_simulator_arm64_platform(arm64_platform): - target = 'arm64-apple-tvos-simulator' - directory = 'darwin_tvos' - sdk = 'appletvsimulator' - version_min = '-mtvos-version-min=9.0' - - -class tvos_device_arm64_platform(arm64_platform): - target = 'arm64-apple-tvos' - directory = 'darwin_tvos' - sdk = 'appletvos' - version_min = '-mtvos-version-min=9.0' - - -class watchos_simulator_x86_64_platform(x86_64_platform): - target = 'x86_64-apple-watchos-simulator' - directory = 'darwin_watchos' - sdk = 'watchsimulator' - version_min = '-mwatchos-version-min=4.0' - - -class watchos_simulator_arm64_platform(arm64_platform): - target = 'arm64-apple-watchos-simulator' - directory = 'darwin_watchos' - sdk = 'watchsimulator' - version_min = '-mwatchos-version-min=4.0' - - -class watchos_device_armv7k_platform(armv7_platform): - target = 'armv7k-apple-watchos' - directory = 'darwin_watchos' - sdk = 'watchos' - arch = 'armv7k' - version_min = '-mwatchos-version-min=4.0' - - -class watchos_device_arm64_32_platform(arm64_platform): - target = 'arm64_32-apple-watchos' - directory = 'darwin_watchos' - sdk = 'watchos' - arch = 'arm64_32' - version_min = '-mwatchos-version-min=4.0' - - -def mkdir_p(path): - try: - os.makedirs(path) - except OSError as exc: # Python >2.5 - if exc.errno != errno.EEXIST: - raise - - -def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''): - mkdir_p(dst_dir) - out_filename = filename - - if file_suffix: - if filename in ['internal64.h', 'asmnames.h', 'internal.h']: - out_filename = filename - else: - split_name = os.path.splitext(filename) - out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1]) - - with open(os.path.join(src_dir, filename)) as in_file: - with open(os.path.join(dst_dir, out_filename), 'w') as out_file: - if prefix: - out_file.write(prefix) - - out_file.write(in_file.read()) - - if suffix: - out_file.write(suffix) - - -def list_files(src_dir, pattern=None, filelist=None): - if pattern: filelist = glob.iglob(os.path.join(src_dir, pattern)) - for file in filelist: - yield os.path.basename(file) - - -def copy_files(src_dir, dst_dir, pattern=None, filelist=None, file_suffix=None, prefix=None, suffix=None): - for filename in list_files(src_dir, pattern=pattern, filelist=filelist): - move_file(src_dir, dst_dir, filename, file_suffix=file_suffix, prefix=prefix, suffix=suffix) - - -def copy_src_platform_files(platform): - src_dir = os.path.join('src', platform.src_dir) - dst_dir = os.path.join(platform.directory, 'src', platform.src_dir) - copy_files(src_dir, dst_dir, filelist=platform.src_files, file_suffix=platform.arch, prefix=platform.prefix, suffix=platform.suffix) - - -def build_target(platform, platform_headers): - def xcrun_cmd(cmd): - return 'xcrun -sdk %s %s -target %s' % (platform.sdk, cmd, platform.target) - - tag='%s-%s' % (platform.sdk, platform.arch) - build_dir = 'build_%s' % tag - mkdir_p(build_dir) - env = dict(CC=xcrun_cmd('clang'), - LD=xcrun_cmd('ld'), - CFLAGS='%s' % (platform.version_min)) - working_dir = os.getcwd() - try: - os.chdir(build_dir) - subprocess.check_call( - [ - "../configure", - f"--host={platform.target}", - ] + ( - [] if platform.sdk == "macosx" else [f"--build={os.uname().machine}-apple-darwin"] - ), - env=env - ) - finally: - os.chdir(working_dir) - - for src_dir in [build_dir, os.path.join(build_dir, 'include')]: - copy_files(src_dir, - os.path.join(platform.directory, 'include'), - pattern='*.h', - file_suffix=platform.arch, - prefix=platform.prefix, - suffix=platform.suffix) - - for filename in list_files(src_dir, pattern='*.h'): - platform_headers[filename].add((platform.prefix, platform.arch, platform.suffix)) - - -def generate_source_and_headers( - generate_osx=True, - generate_ios=True, - generate_tvos=True, - generate_watchos=True, -): - copy_files('src', 'darwin_common/src', pattern='*.c') - copy_files('include', 'darwin_common/include', pattern='*.h') - - if generate_ios: - copy_src_platform_files(ios_simulator_x86_64_platform) - copy_src_platform_files(ios_simulator_arm64_platform) - copy_src_platform_files(ios_device_armv7_platform) - copy_src_platform_files(ios_device_arm64_platform) - if generate_osx: - copy_src_platform_files(desktop_x86_64_platform) - copy_src_platform_files(desktop_arm64_platform) - if generate_tvos: - copy_src_platform_files(tvos_simulator_x86_64_platform) - copy_src_platform_files(tvos_simulator_arm64_platform) - copy_src_platform_files(tvos_device_arm64_platform) - if generate_watchos: - copy_src_platform_files(watchos_simulator_x86_64_platform) - copy_src_platform_files(watchos_simulator_arm64_platform) - copy_src_platform_files(watchos_device_armv7k_platform) - copy_src_platform_files(watchos_device_arm64_32_platform) - - platform_headers = collections.defaultdict(set) - - if generate_ios: - build_target(ios_simulator_x86_64_platform, platform_headers) - build_target(ios_simulator_arm64_platform, platform_headers) - build_target(ios_device_armv7_platform, platform_headers) - build_target(ios_device_arm64_platform, platform_headers) - if generate_osx: - build_target(desktop_x86_64_platform, platform_headers) - build_target(desktop_arm64_platform, platform_headers) - if generate_tvos: - build_target(tvos_simulator_x86_64_platform, platform_headers) - build_target(tvos_simulator_arm64_platform, platform_headers) - build_target(tvos_device_arm64_platform, platform_headers) - if generate_watchos: - build_target(watchos_simulator_x86_64_platform, platform_headers) - build_target(watchos_simulator_arm64_platform, platform_headers) - build_target(watchos_device_armv7k_platform, platform_headers) - build_target(watchos_device_arm64_32_platform, platform_headers) - - mkdir_p('darwin_common/include') - for header_name, tag_tuples in platform_headers.items(): - basename, suffix = os.path.splitext(header_name) - with open(os.path.join('darwin_common/include', header_name), 'w') as header: - for tag_tuple in tag_tuples: - header.write('%s#include <%s_%s%s>\n%s\n' % (tag_tuple[0], basename, tag_tuple[1], suffix, tag_tuple[2])) - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('--only-ios', action='store_true', default=False) - parser.add_argument('--only-osx', action='store_true', default=False) - parser.add_argument('--only-tvos', action='store_true', default=False) - parser.add_argument('--only-watchos', action='store_true', default=False) - args = parser.parse_args() - - generate_source_and_headers( - generate_osx=not args.only_ios and not args.only_tvos and not args.only_watchos, - generate_ios=not args.only_osx and not args.only_tvos and not args.only_watchos, - generate_tvos=not args.only_ios and not args.only_osx and not args.only_watchos, - generate_watchos=not args.only_ios and not args.only_osx and not args.only_tvos, - ) diff --git a/deps/libffi/generate-headers.py b/deps/libffi/generate-headers.py deleted file mode 100644 index 30a460bb27869c..00000000000000 --- a/deps/libffi/generate-headers.py +++ /dev/null @@ -1,244 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import os -import platform -import sys -from pathlib import Path - - -LIBFFI_VERSION = '3.5.2' -LIBFFI_VERSION_NUMBER = '30502' - -TARGETS = { - ('freebsd', 'arm'): ('ARM', 'arm'), - ('freebsd', 'arm64'): ('AARCH64', 'aarch64'), - ('freebsd', 'x64'): ('X86_64', 'x86'), - ('linux', 'arm'): ('ARM', 'arm'), - ('linux', 'arm64'): ('AARCH64', 'aarch64'), - ('linux', 'x64'): ('X86_64', 'x86'), - ('mac', 'arm64'): ('AARCH64', 'aarch64'), - ('mac', 'x64'): ('X86_64', 'x86'), - ('win', 'arm'): ('ARM_WIN32', 'arm'), - ('win', 'arm64'): ('ARM_WIN64', 'aarch64'), - ('win', 'x64'): ('X86_WIN64', 'x86'), -} - - -def get_target(os_name, target_arch): - try: - return TARGETS[(os_name, target_arch)] - except KeyError as exc: - supported = ', '.join( - f'{os_name}/{arch}' for os_name, arch in sorted(TARGETS)) - raise ValueError( - f'Unsupported libffi target {os_name}/{target_arch}. ' - f'Supported targets: {supported}.') from exc - - -def has_long_double(os_name, target_arch): - if os_name == 'win': - return '0' - - if os_name == 'mac' and target_arch == 'arm64': - return '0' - - if target_arch == 'arm': - return '0' - - return '1' - - -def uses_exec_trampoline_table(os_name, target_arch): - return os_name == 'mac' and target_arch in ('arm', 'arm64') - - -def render_ffi_header(base_dir, os_name, target_arch, target): - template = (base_dir / 'include' / 'ffi.h.in').read_text(encoding='utf-8') - replacements = { - '@FFI_EXEC_TRAMPOLINE_TABLE@': - '1' if uses_exec_trampoline_table(os_name, target_arch) else '0', - '@FFI_VERSION_NUMBER@': LIBFFI_VERSION_NUMBER, - '@FFI_VERSION_STRING@': LIBFFI_VERSION, - '@HAVE_LONG_DOUBLE@': has_long_double(os_name, target_arch), - '@TARGET@': target, - '@VERSION@': LIBFFI_VERSION, - } - - for source, replacement in replacements.items(): - template = template.replace(source, replacement) - - return template - - -def render_fficonfig(os_name, target_arch): - lines = [ - '/* Auto-generated by generate-headers.py. */', - '#ifndef LIBFFI_FFICONFIG_H_', - '#define LIBFFI_FFICONFIG_H_', - '', - '#define HAVE_ALLOCA 1', - '#define HAVE_MEMCPY 1', - '#define HAVE_MEMORY_H 1', - '#define HAVE_STDINT_H 1', - '#define HAVE_STRING_H 1', - '#define STDC_HEADERS 1', - ] - - if os_name != 'win': - lines.extend([ - '#define HAVE_AS_CFI_PSEUDO_OP 1', - '#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1', - '#define HAVE_MKOSTEMP 1', - '#define HAVE_RO_EH_FRAME 1', - '#define EH_FRAME_FLAGS "a"', - ]) - - if target_arch in ('x64', 'x86') and os_name != 'win': - lines.append('#define HAVE_AS_X86_PCREL 1') - - if uses_exec_trampoline_table(os_name, target_arch): - lines.append('#define FFI_EXEC_TRAMPOLINE_TABLE 1') - elif os_name in ('freebsd', 'mac'): - lines.append('#define FFI_MMAP_EXEC_WRIT 1') - - if os_name == 'linux': - lines.extend([ - '#define HAVE_DLFCN_H 1', - '#define HAVE_MMAP 1', - '#define HAVE_MMAP_ANON 1', - '#define HAVE_MMAP_FILE 1', - '#define HAVE_SYS_MMAN_H 1', - '#define HAVE_UNISTD_H 1', - ]) - elif os_name in ('freebsd', 'mac'): - lines.extend([ - '#define HAVE_DLFCN_H 1', - '#define HAVE_MMAP 1', - '#define HAVE_MMAP_ANON 1', - '#define HAVE_MMAP_DEV_ZERO 1', - '#define HAVE_MMAP_FILE 1', - '#define HAVE_SYS_MMAN_H 1', - '#define HAVE_UNISTD_H 1', - ]) - - if os_name == 'mac' and target_arch == 'arm64': - lines.extend([ - '#if defined(__arm64e__)', - '#define HAVE_ARM64E_PTRAUTH 1', - '#endif', - ]) - - lines.extend([ - '', - '#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE', - '#ifdef LIBFFI_ASM', - '#ifdef __APPLE__', - '#define FFI_HIDDEN(name) .private_extern name', - '#else', - '#define FFI_HIDDEN(name) .hidden name', - '#endif', - '#else', - '#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))', - '#endif', - '#else', - '#ifdef LIBFFI_ASM', - '#define FFI_HIDDEN(name)', - '#else', - '#define FFI_HIDDEN', - '#endif', - '#endif', - '', - '#endif /* LIBFFI_FFICONFIG_H_ */', - '', - ]) - - return '\n'.join(lines) - - -def generate_headers(output_dir, target_arch, os_name): - base_dir = Path(__file__).resolve().parent - output_dir = Path(str(output_dir).strip().strip('"')) - output_dir.mkdir(parents=True, exist_ok=True) - - target, target_dir = get_target(os_name, target_arch) - ffitarget_src = base_dir / 'src' / target_dir / 'ffitarget.h' - if not ffitarget_src.exists(): - raise FileNotFoundError(f'Missing libffi target header: {ffitarget_src}') - - (output_dir / 'ffi.h').write_text( - render_ffi_header(base_dir, os_name, target_arch, target), - encoding='utf-8') - (output_dir / 'fficonfig.h').write_text( - render_fficonfig(os_name, target_arch), - encoding='utf-8') - (output_dir / 'ffitarget.h').write_text( - ffitarget_src.read_text(encoding='utf-8'), - encoding='utf-8') - - -def detect_os_name(): - if sys.platform.startswith('win'): - return 'win' - if sys.platform == 'darwin': - return 'mac' - if sys.platform.startswith('linux'): - return 'linux' - if sys.platform.startswith('freebsd'): - return 'freebsd' - raise ValueError(f'Unsupported host platform {sys.platform!r}') - - -def detect_target_arch(): - candidates = [ - os.environ.get('TARGET_ARCH'), - os.environ.get('npm_config_arch'), - os.environ.get('VSCMD_ARG_TGT_ARCH'), - os.environ.get('Platform'), - os.environ.get('PROCESSOR_ARCHITECTURE'), - platform.machine(), - ] - - aliases = { - 'amd64': 'x64', - 'x86_64': 'x64', - 'x64': 'x64', - 'win32': 'x64', - 'i386': 'x86', - 'i686': 'x86', - 'x86': 'x86', - 'arm64': 'arm64', - 'aarch64': 'arm64', - 'arm': 'arm', - } - - for candidate in candidates: - if not candidate: - continue - normalized = aliases.get(candidate.lower()) - if normalized is not None: - return normalized - - raise ValueError('Unable to determine target architecture for libffi headers') - - -def main(argv=None): - parser = argparse.ArgumentParser(description='Generate libffi headers') - parser.add_argument('--output-dir', required=True) - parser.add_argument('--target-arch') - parser.add_argument('--os') - args = parser.parse_args(argv) - - try: - generate_headers(args.output_dir, - args.target_arch or detect_target_arch(), - args.os or detect_os_name()) - except Exception as exc: # pylint: disable=broad-except - print(exc, file=sys.stderr) - return 1 - - return 0 - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/deps/libffi/include/Makefile.am b/deps/libffi/include/Makefile.am deleted file mode 100644 index 5f0d4066f4a97a..00000000000000 --- a/deps/libffi/include/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -## Process this with automake to create Makefile.in - -AUTOMAKE_OPTIONS=foreign - -DISTCLEANFILES=ffitarget.h -noinst_HEADERS=ffi_common.h ffi_cfi.h tramp.h -EXTRA_DIST=ffi.h.in - -nodist_include_HEADERS = ffi.h ffitarget.h diff --git a/deps/libffi/include/ffi.h.in b/deps/libffi/include/ffi.h.in deleted file mode 100644 index 6ce7ac55ec780c..00000000000000 --- a/deps/libffi/include/ffi.h.in +++ /dev/null @@ -1,536 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - libffi @VERSION@ - - Copyright (c) 2011, 2014, 2019, 2021, 2022, 2024, 2025 Anthony Green - - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. - - 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. - - ----------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------- - Most of the API is documented in doc/libffi.texi. - - The raw API is designed to bypass some of the argument packing and - unpacking on architectures for which it can be avoided. Routines - are provided to emulate the raw API if the underlying platform - doesn't allow faster implementation. - - More details on the raw API can be found in: - - http://gcc.gnu.org/ml/java/1999-q3/msg00138.html - - and - - http://gcc.gnu.org/ml/java/1999-q3/msg00174.html - -------------------------------------------------------------------- */ - -#ifndef LIBFFI_H -#define LIBFFI_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Specify which architecture libffi is configured for. */ -#ifndef @TARGET@ -#define @TARGET@ -#endif - -/* ---- System configuration information --------------------------------- */ - -/* If these change, update src/mips/ffitarget.h. */ -#define FFI_TYPE_VOID 0 -#define FFI_TYPE_INT 1 -#define FFI_TYPE_FLOAT 2 -#define FFI_TYPE_DOUBLE 3 -#if @HAVE_LONG_DOUBLE@ -#define FFI_TYPE_LONGDOUBLE 4 -#else -#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE -#endif -#define FFI_TYPE_UINT8 5 -#define FFI_TYPE_SINT8 6 -#define FFI_TYPE_UINT16 7 -#define FFI_TYPE_SINT16 8 -#define FFI_TYPE_UINT32 9 -#define FFI_TYPE_SINT32 10 -#define FFI_TYPE_UINT64 11 -#define FFI_TYPE_SINT64 12 -#define FFI_TYPE_STRUCT 13 -#define FFI_TYPE_POINTER 14 -#define FFI_TYPE_COMPLEX 15 - -/* This should always refer to the last type code (for sanity checks). */ -#define FFI_TYPE_LAST FFI_TYPE_COMPLEX - -#include - -#ifndef LIBFFI_ASM - -#if defined(_MSC_VER) && !defined(__clang__) -#define __attribute__(X) -#endif - -#include -#include - -/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). - But we can find it either under the correct ANSI name, or under GNU - C's internal name. */ - -#define FFI_64_BIT_MAX 9223372036854775807 - -#ifdef LONG_LONG_MAX -# define FFI_LONG_LONG_MAX LONG_LONG_MAX -#else -# ifdef LLONG_MAX -# define FFI_LONG_LONG_MAX LLONG_MAX -# ifdef _AIX52 /* or newer has C99 LLONG_MAX */ -# undef FFI_64_BIT_MAX -# define FFI_64_BIT_MAX 9223372036854775807LL -# endif /* _AIX52 or newer */ -# else -# ifdef __GNUC__ -# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ -# endif -# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */ -# ifndef __PPC64__ -# if defined (__IBMC__) || defined (__IBMCPP__) -# define FFI_LONG_LONG_MAX LONGLONG_MAX -# endif -# endif /* __PPC64__ */ -# undef FFI_64_BIT_MAX -# define FFI_64_BIT_MAX 9223372036854775807LL -# endif -# endif -#endif - -/* The closure code assumes that this works on pointers, i.e. a size_t - can hold a pointer. */ - -typedef struct _ffi_type -{ - size_t size; - unsigned short alignment; - unsigned short type; - struct _ffi_type **elements; -} ffi_type; - -/* Need minimal decorations for DLLs to work on Windows. GCC has - autoimport and autoexport. Always mark externally visible symbols - as dllimport for MSVC clients, even if it means an extra indirection - when using the static version of the library. - Besides, as a workaround, they can define FFI_BUILDING if they - *know* they are going to link with the static library. */ -#if defined _MSC_VER && !defined(FFI_STATIC_BUILD) -# if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */ -# define FFI_API __declspec(dllexport) -# else /* Importing libffi.DLL */ -# define FFI_API __declspec(dllimport) -# endif -#else -# define FFI_API -#endif - -/* The externally visible type declarations also need the MSVC DLL - decorations, or they will not be exported from the object file. */ -#if defined LIBFFI_HIDE_BASIC_TYPES -# define FFI_EXTERN FFI_API -#else -# define FFI_EXTERN extern FFI_API -#endif - -#ifndef LIBFFI_HIDE_BASIC_TYPES -#if SCHAR_MAX == 127 -# define ffi_type_uchar ffi_type_uint8 -# define ffi_type_schar ffi_type_sint8 -#else - #error "char size not supported" -#endif - -#if SHRT_MAX == 32767 -# define ffi_type_ushort ffi_type_uint16 -# define ffi_type_sshort ffi_type_sint16 -#elif SHRT_MAX == 2147483647 -# define ffi_type_ushort ffi_type_uint32 -# define ffi_type_sshort ffi_type_sint32 -#else - #error "short size not supported" -#endif - -#if INT_MAX == 32767 -# define ffi_type_uint ffi_type_uint16 -# define ffi_type_sint ffi_type_sint16 -#elif INT_MAX == 2147483647 -# define ffi_type_uint ffi_type_uint32 -# define ffi_type_sint ffi_type_sint32 -#elif INT_MAX == 9223372036854775807 -# define ffi_type_uint ffi_type_uint64 -# define ffi_type_sint ffi_type_sint64 -#else - #error "int size not supported" -#endif - -#if LONG_MAX == 2147483647 -# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX - #error "no 64-bit data type supported" -# endif -#elif LONG_MAX != FFI_64_BIT_MAX - #error "long size not supported" -#endif - -#if LONG_MAX == 2147483647 -# define ffi_type_ulong ffi_type_uint32 -# define ffi_type_slong ffi_type_sint32 -#elif LONG_MAX == FFI_64_BIT_MAX -# define ffi_type_ulong ffi_type_uint64 -# define ffi_type_slong ffi_type_sint64 -#else - #error "long size not supported" -#endif - -/* These are defined in types.c. */ -FFI_EXTERN ffi_type ffi_type_void; -FFI_EXTERN ffi_type ffi_type_uint8; -FFI_EXTERN ffi_type ffi_type_sint8; -FFI_EXTERN ffi_type ffi_type_uint16; -FFI_EXTERN ffi_type ffi_type_sint16; -FFI_EXTERN ffi_type ffi_type_uint32; -FFI_EXTERN ffi_type ffi_type_sint32; -FFI_EXTERN ffi_type ffi_type_uint64; -FFI_EXTERN ffi_type ffi_type_sint64; -FFI_EXTERN ffi_type ffi_type_float; -FFI_EXTERN ffi_type ffi_type_double; -FFI_EXTERN ffi_type ffi_type_pointer; -FFI_EXTERN ffi_type ffi_type_longdouble; - -#ifdef FFI_TARGET_HAS_COMPLEX_TYPE -FFI_EXTERN ffi_type ffi_type_complex_float; -FFI_EXTERN ffi_type ffi_type_complex_double; -FFI_EXTERN ffi_type ffi_type_complex_longdouble; -#endif -#endif /* LIBFFI_HIDE_BASIC_TYPES */ - -typedef enum { - FFI_OK = 0, - FFI_BAD_TYPEDEF, - FFI_BAD_ABI, - FFI_BAD_ARGTYPE -} ffi_status; - -typedef struct { - ffi_abi abi; - unsigned nargs; - ffi_type **arg_types; - ffi_type *rtype; - unsigned bytes; - unsigned flags; -#ifdef FFI_EXTRA_CIF_FIELDS - FFI_EXTRA_CIF_FIELDS; -#endif -} ffi_cif; - -/* ---- Definitions for the raw API -------------------------------------- */ - -#ifndef FFI_SIZEOF_ARG -# if LONG_MAX == 2147483647 -# define FFI_SIZEOF_ARG 4 -# elif LONG_MAX == FFI_64_BIT_MAX -# define FFI_SIZEOF_ARG 8 -# endif -#endif - -#ifndef FFI_SIZEOF_JAVA_RAW -# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG -#endif - -typedef union { - ffi_sarg sint; - ffi_arg uint; - float flt; - char data[FFI_SIZEOF_ARG]; - void* ptr; -} ffi_raw; - -#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8 -/* This is a special case for mips64/n32 ABI (and perhaps others) where - sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */ -typedef union { - signed int sint; - unsigned int uint; - float flt; - char data[FFI_SIZEOF_JAVA_RAW]; - void* ptr; -} ffi_java_raw; -#else -typedef ffi_raw ffi_java_raw; -#endif - - -FFI_API -void ffi_raw_call (ffi_cif *cif, - void (*fn)(void), - void *rvalue, - ffi_raw *avalue); - -FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); -FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); -FFI_API size_t ffi_raw_size (ffi_cif *cif); - -/* This is analogous to the raw API, except it uses Java parameter - packing, even on 64-bit machines. I.e. on 64-bit machines longs - and doubles are followed by an empty 64-bit word. */ - -#if !FFI_NATIVE_RAW_API -FFI_API -void ffi_java_raw_call (ffi_cif *cif, - void (*fn)(void), - void *rvalue, - ffi_java_raw *avalue) __attribute__((deprecated)); -#endif - -FFI_API -void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated)); -FFI_API -void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) __attribute__((deprecated)); -FFI_API -size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated)); - -/* ---- Version API ------------------------------------------------------ */ - -#define FFI_VERSION_STRING "@FFI_VERSION_STRING@" -#define FFI_VERSION_NUMBER @FFI_VERSION_NUMBER@ - -#ifndef LIBFFI_ASM -/* Return a version string. */ -FFI_API const char *ffi_get_version (void); - -/* Return the version as an unsigned long value: (x * 10000 + y * 100 + z) */ -FFI_API unsigned long ffi_get_version_number (void); -#endif - -/* ---- Internals API ---------------------------------------------------- */ - -FFI_API unsigned int ffi_get_default_abi (void); -FFI_API size_t ffi_get_closure_size (void); - -/* ---- Definitions for closures ----------------------------------------- */ - -#if FFI_CLOSURES - -#ifdef _MSC_VER -__declspec(align(8)) -#endif -typedef struct { -#if @FFI_EXEC_TRAMPOLINE_TABLE@ - void *trampoline_table; - void *trampoline_table_entry; -#else - union { - char tramp[FFI_TRAMPOLINE_SIZE]; - void *ftramp; - }; -#endif - ffi_cif *cif; - void (*fun)(ffi_cif*,void*,void**,void*); - void *user_data; -#if defined(_MSC_VER) && defined(_M_IX86) - void *padding; -#endif -} ffi_closure -#ifdef __GNUC__ - __attribute__((aligned (8))) -#endif - ; - -#ifndef __GNUC__ -# ifdef __sgi -# pragma pack 0 -# endif -#endif - -FFI_API void *ffi_closure_alloc (size_t size, void **code); -FFI_API void ffi_closure_free (void *); - -FFI_API ffi_status -ffi_prep_closure (ffi_closure*, - ffi_cif *, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data) -#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405) - __attribute__((deprecated ("use ffi_prep_closure_loc instead"))) -#elif defined(__GNUC__) && __GNUC__ >= 3 - __attribute__((deprecated)) -#endif - ; - -FFI_API ffi_status -ffi_prep_closure_loc (ffi_closure*, - ffi_cif *, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc); - -#ifdef __sgi -# pragma pack 8 -#endif -typedef struct { -#if @FFI_EXEC_TRAMPOLINE_TABLE@ - void *trampoline_table; - void *trampoline_table_entry; -#else - char tramp[FFI_TRAMPOLINE_SIZE]; -#endif - ffi_cif *cif; - -#if !FFI_NATIVE_RAW_API - - /* If this is enabled, then a raw closure has the same layout - as a regular closure. We use this to install an intermediate - handler to do the translation, void** -> ffi_raw*. */ - - void (*translate_args)(ffi_cif*,void*,void**,void*); - void *this_closure; - -#endif - - void (*fun)(ffi_cif*,void*,ffi_raw*,void*); - void *user_data; - -} ffi_raw_closure; - -typedef struct { -#if @FFI_EXEC_TRAMPOLINE_TABLE@ - void *trampoline_table; - void *trampoline_table_entry; -#else - char tramp[FFI_TRAMPOLINE_SIZE]; -#endif - - ffi_cif *cif; - -#if !FFI_NATIVE_RAW_API - - /* If this is enabled, then a raw closure has the same layout - as a regular closure. We use this to install an intermediate - handler to do the translation, void** -> ffi_raw*. */ - - void (*translate_args)(ffi_cif*,void*,void**,void*); - void *this_closure; - -#endif - - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*); - void *user_data; - -} ffi_java_raw_closure; - -FFI_API ffi_status -ffi_prep_raw_closure (ffi_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data); - -FFI_API ffi_status -ffi_prep_raw_closure_loc (ffi_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data, - void *codeloc); - -#if !FFI_NATIVE_RAW_API -FFI_API ffi_status -ffi_prep_java_raw_closure (ffi_java_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), - void *user_data) __attribute__((deprecated)); - -FFI_API ffi_status -ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), - void *user_data, - void *codeloc) __attribute__((deprecated)); -#endif - -#endif /* FFI_CLOSURES */ - -#ifdef FFI_GO_CLOSURES - -typedef struct { - void *tramp; - ffi_cif *cif; - void (*fun)(ffi_cif*,void*,void**,void*); -} ffi_go_closure; - -FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *, - void (*fun)(ffi_cif*,void*,void**,void*)); - -FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure); - -#endif /* FFI_GO_CLOSURES */ - -/* ---- Public interface definition -------------------------------------- */ - -FFI_API -ffi_status ffi_prep_cif(ffi_cif *cif, - ffi_abi abi, - unsigned int nargs, - ffi_type *rtype, - ffi_type **atypes); - -FFI_API -ffi_status ffi_prep_cif_var(ffi_cif *cif, - ffi_abi abi, - unsigned int nfixedargs, - unsigned int ntotalargs, - ffi_type *rtype, - ffi_type **atypes); - -FFI_API -void ffi_call(ffi_cif *cif, - void (*fn)(void), - void *rvalue, - void **avalue); - -FFI_API -ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, - size_t *offsets); - -/* Convert between closure and function pointers. */ -#if defined(PA_LINUX) || defined(PA_HPUX) -#define FFI_FN(f) ((void (*)(void))((unsigned int)(f) | 2)) -#define FFI_CL(f) ((void *)((unsigned int)(f) & ~3)) -#else -#define FFI_FN(f) ((void (*)(void))f) -#define FFI_CL(f) ((void *)(f)) -#endif - -/* ---- Definitions shared with assembly code ---------------------------- */ - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/deps/libffi/include/ffi_cfi.h b/deps/libffi/include/ffi_cfi.h deleted file mode 100644 index 8565663244c0f8..00000000000000 --- a/deps/libffi/include/ffi_cfi.h +++ /dev/null @@ -1,78 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi_cfi.h - Copyright (c) 2014 Red Hat, Inc. - - Conditionally assemble cfi directives. Only necessary for building libffi. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef FFI_CFI_H -#define FFI_CFI_H - -#ifdef HAVE_AS_CFI_PSEUDO_OP - -# define cfi_startproc .cfi_startproc -# define cfi_endproc .cfi_endproc -# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off -# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg -# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off -# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off -# define cfi_offset(reg, off) .cfi_offset reg, off -# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off -# define cfi_register(r1, r2) .cfi_register r1, r2 -# define cfi_return_column(reg) .cfi_return_column reg -# define cfi_restore(reg) .cfi_restore reg -# define cfi_same_value(reg) .cfi_same_value reg -# define cfi_undefined(reg) .cfi_undefined reg -# define cfi_remember_state .cfi_remember_state -# define cfi_restore_state .cfi_restore_state -# define cfi_window_save .cfi_window_save -# define cfi_personality(enc, exp) .cfi_personality enc, exp -# define cfi_lsda(enc, exp) .cfi_lsda enc, exp -# define cfi_escape(...) .cfi_escape __VA_ARGS__ -# define cfi_window_save .cfi_window_save - -#else - -# define cfi_startproc -# define cfi_endproc -# define cfi_def_cfa(reg, off) -# define cfi_def_cfa_register(reg) -# define cfi_def_cfa_offset(off) -# define cfi_adjust_cfa_offset(off) -# define cfi_offset(reg, off) -# define cfi_rel_offset(reg, off) -# define cfi_register(r1, r2) -# define cfi_return_column(reg) -# define cfi_restore(reg) -# define cfi_same_value(reg) -# define cfi_undefined(reg) -# define cfi_remember_state -# define cfi_restore_state -# define cfi_window_save -# define cfi_personality(enc, exp) -# define cfi_lsda(enc, exp) -# define cfi_escape(...) -# define cfi_window_save - -#endif /* HAVE_AS_CFI_PSEUDO_OP */ -#endif /* FFI_CFI_H */ diff --git a/deps/libffi/include/ffi_common.h b/deps/libffi/include/ffi_common.h deleted file mode 100644 index e4ed2287e580a5..00000000000000 --- a/deps/libffi/include/ffi_common.h +++ /dev/null @@ -1,201 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi_common.h - Copyright (C) 2011, 2012, 2013 Anthony Green - Copyright (C) 2007 Free Software Foundation, Inc - Copyright (c) 1996 Red Hat, Inc. - - Common internal definitions and macros. Only necessary for building - libffi. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef FFI_COMMON_H -#define FFI_COMMON_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* Do not move this. Some versions of AIX are very picky about where - this is positioned. */ -#ifdef __GNUC__ -# if HAVE_ALLOCA_H -# include -# else - /* mingw64 defines this already in malloc.h. */ -# ifndef alloca -# define alloca __builtin_alloca -# endif -# endif -# define MAYBE_UNUSED __attribute__((__unused__)) -# define NORETURN __attribute__((__noreturn__)) -#else -# define MAYBE_UNUSED -# define NORETURN -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX -# pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -# ifdef _MSC_VER -# define alloca _alloca -# else -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -/* Check for the existence of memcpy. */ -#if STDC_HEADERS -# include -#else -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# endif -#endif - -#if defined(FFI_DEBUG) -#include -#endif - -#ifndef __SANITIZE_ADDRESS__ -# ifdef __clang__ -# if __has_feature(address_sanitizer) -# define FFI_ASAN -# endif -# endif -#endif -#ifdef __SANITIZE_ADDRESS__ -#define FFI_ASAN -#endif - -#ifdef FFI_ASAN -#define FFI_ASAN_NO_SANITIZE __attribute__((no_sanitize_address)) -#else -#define FFI_ASAN_NO_SANITIZE -#endif - -#ifdef FFI_DEBUG -NORETURN void ffi_assert(const char *expr, const char *file, int line); -void ffi_stop_here(void); -void ffi_type_test(ffi_type *a, const char *file, int line); - -#define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__)) -#define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l))) -#define FFI_ASSERT_VALID_TYPE(x) ffi_type_test (x, __FILE__, __LINE__) -#else -#define FFI_ASSERT(x) -#define FFI_ASSERT_AT(x, f, l) -#define FFI_ASSERT_VALID_TYPE(x) -#endif - -/* v cast to size_t and aligned up to a multiple of a */ -#define FFI_ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1) -/* v cast to size_t and aligned down to a multiple of a */ -#define FFI_ALIGN_DOWN(v, a) (((size_t) (v)) & -a) - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif); -ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, - unsigned int nfixedargs, unsigned int ntotalargs); - - -#if HAVE_LONG_DOUBLE_VARIANT -/* Used to adjust size/alignment of ffi types. */ -void ffi_prep_types (ffi_abi abi); -#endif - -/* Used internally, but overridden by some architectures */ -ffi_status ffi_prep_cif_core(ffi_cif *cif, - ffi_abi abi, - unsigned int isvariadic, - unsigned int nfixedargs, - unsigned int ntotalargs, - ffi_type *rtype, - ffi_type **atypes); - -/* Translate a data pointer to a code pointer. Needed for closures on - some targets. */ -void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN; - -/* The arch code calls this to determine if a given closure has a - static trampoline. */ -int ffi_tramp_is_present (void *closure) FFI_HIDDEN; - -/* Return a file descriptor of a temporary zero-sized file in a - writable and executable filesystem. */ -int open_temp_exec_file(void) FFI_HIDDEN; - -/* Extended cif, used in callback from assembly routine */ -typedef struct -{ - ffi_cif *cif; - void *rvalue; - void **avalue; -} extended_cif; - -/* Terse sized type definitions. */ -#if defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C) -typedef unsigned char UINT8; -typedef signed char SINT8; -typedef unsigned short UINT16; -typedef signed short SINT16; -typedef unsigned int UINT32; -typedef signed int SINT32; -# ifdef _MSC_VER -typedef unsigned __int64 UINT64; -typedef signed __int64 SINT64; -# else -# include -typedef uint64_t UINT64; -typedef int64_t SINT64; -# endif -#else -typedef unsigned int UINT8 __attribute__((__mode__(__QI__))); -typedef signed int SINT8 __attribute__((__mode__(__QI__))); -typedef unsigned int UINT16 __attribute__((__mode__(__HI__))); -typedef signed int SINT16 __attribute__((__mode__(__HI__))); -typedef unsigned int UINT32 __attribute__((__mode__(__SI__))); -typedef signed int SINT32 __attribute__((__mode__(__SI__))); -typedef unsigned int UINT64 __attribute__((__mode__(__DI__))); -typedef signed int SINT64 __attribute__((__mode__(__DI__))); -#endif - -typedef float FLOAT32; - -#ifndef __GNUC__ -#define __builtin_expect(x, expected_value) (x) -#endif -#define LIKELY(x) __builtin_expect(!!(x),1) -#define UNLIKELY(x) __builtin_expect((x)!=0,0) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/deps/libffi/include/tramp.h b/deps/libffi/include/tramp.h deleted file mode 100644 index e14e463e83a6e0..00000000000000 --- a/deps/libffi/include/tramp.h +++ /dev/null @@ -1,45 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi_tramp.h - Copyright (C) 2021 Microsoft, Inc. - - Static trampoline definitions. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef FFI_TRAMP_H -#define FFI_TRAMP_H - -#ifdef __cplusplus -extern "C" { -#endif - -int ffi_tramp_is_supported(void); -void *ffi_tramp_alloc (int flags); -void ffi_tramp_set_parms (void *tramp, void *data, void *code); -void *ffi_tramp_get_addr (void *tramp); -void ffi_tramp_free (void *tramp); - -#ifdef __cplusplus -} -#endif - -#endif /* FFI_TRAMP_H */ diff --git a/deps/libffi/libffi.gyp b/deps/libffi/libffi.gyp deleted file mode 100644 index a6ca819188ef6f..00000000000000 --- a/deps/libffi/libffi.gyp +++ /dev/null @@ -1,228 +0,0 @@ -{ - 'variables': { - 'libffi_sources': [ - 'src/closures.c', - 'src/debug.c', - 'src/java_raw_api.c', - 'src/prep_cif.c', - 'src/raw_api.c', - 'src/tramp.c', - 'src/types.c', - ], - 'libffi_defines%': [], - 'libffi_arch_sources%': [], - }, - 'conditions': [ - ['OS == "win"', { - 'conditions': [ - ['target_arch == "x64"', { - 'variables': { - 'libffi_arch_sources': [ - 'src/x86/ffiw64.c', - ], - }, - }], - ['target_arch == "arm"', { - 'variables': { - 'libffi_arch_sources': [ - 'src/arm/ffi.c', - 'src/arm/sysv_msvc_arm32.S', - ], - }, - }], - ['target_arch == "arm64"', { - 'variables': { - 'libffi_arch_sources': [ - 'src/aarch64/ffi.c', - ], - }, - }], - ], - }], - ['OS == "linux" or OS == "freebsd"', { - 'conditions': [ - ['target_arch == "x64"', { - 'variables': { - 'libffi_arch_sources': [ - 'src/x86/ffiw64.c', - 'src/x86/ffi64.c', - 'src/x86/unix64.S', - 'src/x86/win64.S', - ], - }, - }], - ['target_arch == "arm"', { - 'variables': { - 'libffi_arch_sources': [ - 'src/arm/ffi.c', - 'src/arm/sysv.S', - ], - }, - }], - ['target_arch == "arm64"', { - 'variables': { - 'libffi_arch_sources': [ - 'src/aarch64/ffi.c', - 'src/aarch64/sysv.S', - ], - }, - }], - ], - }], - ['OS == "mac"', { - 'conditions': [ - ['target_arch == "x64"', { - 'variables': { - 'libffi_arch_sources': [ - 'src/x86/ffiw64.c', - 'src/x86/ffi64.c', - 'src/x86/unix64.S', - 'src/x86/win64.S', - ], - }, - }], - ['target_arch == "arm64"', { - 'variables': { - 'libffi_arch_sources': [ - 'src/aarch64/ffi.c', - 'src/aarch64/sysv.S', - ], - }, - }], - ], - }], - ], - 'targets': [ - { - 'target_name': 'libffi', - 'type': 'static_library', - 'hard_dependency': 1, - 'cflags': ['-fvisibility=hidden'], - 'xcode_settings': { - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', - }, - 'defines': [ - 'FFI_STATIC_BUILD', - '<@(libffi_defines)', - ], - 'include_dirs': [ - 'include', - '<(SHARED_INTERMEDIATE_DIR)/libffi', - ], - 'sources': [ - '<@(libffi_sources)', - '<@(libffi_arch_sources)', - ], - 'actions': [ - { - 'action_name': 'generate_libffi_headers', - 'inputs': [ - 'generate-headers.py', - 'include/ffi.h.in', - 'src/aarch64/ffitarget.h', - 'src/arm/ffitarget.h', - 'src/x86/ffitarget.h', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/libffi/ffi.h', - '<(SHARED_INTERMEDIATE_DIR)/libffi/fficonfig.h', - '<(SHARED_INTERMEDIATE_DIR)/libffi/ffitarget.h', - ], - 'action': [ - '<(python)', - 'generate-headers.py', - '--output-dir', - '<(SHARED_INTERMEDIATE_DIR)/libffi', - ], - }, - ], - 'conditions': [ - ['OS == "win" and target_arch == "x64"', { - 'actions': [ - { - 'action_name': 'preprocess_win64_intel_asm', - 'process_outputs_as_sources': 1, - 'inputs': [ - 'preprocess_asm.py', - 'include/ffi_cfi.h', - 'src/x86/asmnames.h', - 'src/x86/win64_intel.S', - '<(SHARED_INTERMEDIATE_DIR)/libffi/ffi.h', - '<(SHARED_INTERMEDIATE_DIR)/libffi/fficonfig.h', - ], - 'outputs': [ - '<(INTERMEDIATE_DIR)/win64_intel.asm', - ], - 'action': [ - '<(python)', - 'preprocess_asm.py', - '--input', - 'src/x86/win64_intel.S', - '--output', - '<@(_outputs)', - '--include-dir', - 'include', - '--include-dir', - 'src/x86', - '--include-dir', - '<(SHARED_INTERMEDIATE_DIR)/libffi', - '--define', - 'FFI_STATIC_BUILD', - ], - }, - ], - }], - ['OS == "win" and target_arch == "arm64"', { - # Link the prebuilt object file directly - 'libraries': [ - '<(INTERMEDIATE_DIR)/win64_armasm.obj', - ], - 'actions': [ - { - 'action_name': 'assemble_win64_arm_asm', - # Don't use process_outputs_as_sources - we link the .obj directly - 'inputs': [ - 'preprocess_asm.py', - 'include/ffi_cfi.h', - 'src/aarch64/internal.h', - 'src/aarch64/win64_armasm.S', - '<(SHARED_INTERMEDIATE_DIR)/libffi/ffi.h', - '<(SHARED_INTERMEDIATE_DIR)/libffi/fficonfig.h', - ], - 'outputs': [ - '<(INTERMEDIATE_DIR)/win64_armasm.obj', - ], - 'action': [ - '<(python)', - 'preprocess_asm.py', - '--input', - 'src/aarch64/win64_armasm.S', - '--output', - '<(INTERMEDIATE_DIR)/win64_armasm.asm', - '--include-dir', - 'include', - '--include-dir', - 'src/aarch64', - '--include-dir', - '<(SHARED_INTERMEDIATE_DIR)/libffi', - '--define', - 'FFI_STATIC_BUILD', - '--assemble', - '<@(_outputs)', - ], - }, - ], - }], - ], - 'direct_dependent_settings': { - 'include_dirs': [ - 'include', - '<(SHARED_INTERMEDIATE_DIR)/libffi', - ], - 'defines': [ - 'FFI_STATIC_BUILD', - ], - }, - }, - ], -} diff --git a/deps/libffi/libffi.map.in b/deps/libffi/libffi.map.in deleted file mode 100644 index cc135ba8e2915c..00000000000000 --- a/deps/libffi/libffi.map.in +++ /dev/null @@ -1,93 +0,0 @@ -#define LIBFFI_ASM -#define LIBFFI_H -#include -#include - -/* These version numbers correspond to the libtool-version abi numbers, - not to the libffi release numbers. */ - -LIBFFI_BASE_8.0 { - global: - /* Exported data variables. */ - ffi_type_void; - ffi_type_uint8; - ffi_type_sint8; - ffi_type_uint16; - ffi_type_sint16; - ffi_type_uint32; - ffi_type_sint32; - ffi_type_uint64; - ffi_type_sint64; - ffi_type_float; - ffi_type_double; - ffi_type_longdouble; - ffi_type_pointer; - - ffi_call; - ffi_prep_cif; - ffi_prep_cif_var; - - ffi_raw_call; - ffi_ptrarray_to_raw; - ffi_raw_to_ptrarray; - ffi_raw_size; - -#if !FFI_NATIVE_RAW_API - ffi_java_raw_call; -#endif - - ffi_java_ptrarray_to_raw; - ffi_java_raw_to_ptrarray; - ffi_java_raw_size; - - ffi_get_struct_offsets; - local: - *; -}; - -/* ---------------------------------------------------------------------- - Symbols **added in libffi 3.5.0**. - Give them a fresh namespace so that package managers notice when - code requires a newer libffi than 3.4.x. - -------------------------------------------------------------------- */ -LIBFFI_BASE_8.1 { - global: - ffi_get_version; - ffi_get_version_number; - ffi_get_default_abi; - ffi_get_closure_size; -} LIBFFI_BASE_8.0; - -#ifdef FFI_TARGET_HAS_COMPLEX_TYPE -LIBFFI_COMPLEX_8.0 { - global: - /* Exported data variables. */ - ffi_type_complex_float; - ffi_type_complex_double; - ffi_type_complex_longdouble; -} LIBFFI_BASE_8.0; -#endif - -#if FFI_CLOSURES -LIBFFI_CLOSURE_8.0 { - global: - ffi_closure_alloc; - ffi_closure_free; - ffi_prep_closure; - ffi_prep_closure_loc; - ffi_prep_raw_closure; - ffi_prep_raw_closure_loc; -#if !FFI_NATIVE_RAW_API - ffi_prep_java_raw_closure; - ffi_prep_java_raw_closure_loc; -#endif -} LIBFFI_BASE_8.0; -#endif - -#if FFI_GO_CLOSURES -LIBFFI_GO_CLOSURE_8.0 { - global: - ffi_call_go; - ffi_prep_go_closure; -} LIBFFI_CLOSURE_8.0; -#endif diff --git a/deps/libffi/libffi.pc.in b/deps/libffi/libffi.pc.in deleted file mode 100644 index 6fad83b4951c86..00000000000000 --- a/deps/libffi/libffi.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -toolexeclibdir=@toolexeclibdir@ -includedir=@includedir@ - -Name: @PACKAGE_NAME@ -Description: Library supporting Foreign Function Interfaces -Version: @PACKAGE_VERSION@ -Libs: -L${toolexeclibdir} -lffi -Cflags: -I${includedir} diff --git a/deps/libffi/libtool-ldflags b/deps/libffi/libtool-ldflags deleted file mode 100755 index e32e37bf10dd5a..00000000000000 --- a/deps/libffi/libtool-ldflags +++ /dev/null @@ -1,106 +0,0 @@ -#! /bin/sh - -# Script to translate LDFLAGS into a form suitable for use with libtool. - -# Copyright (C) 2005 Free Software Foundation, Inc. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA. - -# Contributed by CodeSourcery, LLC. - -# This script is designed to be used from a Makefile that uses libtool -# to build libraries as follows: -# -# LTLDFLAGS = $(shell libtool-ldflags $(LDFLAGS)) -# -# Then, use (LTLDFLAGS) in place of $(LDFLAGS) in your link line. - -# The output of the script. This string is built up as we process the -# arguments. -result= -prev_arg= - -for arg -do - case $arg in - -f*|--*) - # Libtool does not ascribe any special meaning options - # that begin with -f or with a double-dash. So, it will - # think these options are linker options, and prefix them - # with "-Wl,". Then, the compiler driver will ignore the - # options. So, we prefix these options with -Xcompiler to - # make clear to libtool that they are in fact compiler - # options. - case $prev_arg in - -Xpreprocessor|-Xcompiler|-Xlinker) - # This option is already prefixed; don't prefix it again. - ;; - *) - result="$result -Xcompiler" - ;; - esac - ;; - *) - # We do not want to add -Xcompiler to other options because - # that would prevent libtool itself from recognizing them. - ;; - esac - prev_arg=$arg - - # If $(LDFLAGS) is (say): - # a "b'c d" e - # then the user expects that: - # $(LD) $(LDFLAGS) - # will pass three arguments to $(LD): - # 1) a - # 2) b'c d - # 3) e - # We must ensure, therefore, that the arguments are appropriately - # quoted so that using: - # libtool --mode=link ... $(LTLDFLAGS) - # will result in the same number of arguments being passed to - # libtool. In other words, when this script was invoked, the shell - # removed one level of quoting, present in $(LDFLAGS); we have to put - # it back. - - # Quote any embedded single quotes. - case $arg in - *"'"*) - # The following command creates the script: - # 1s,^X,,;s|'|'"'"'|g - # which removes a leading X, and then quotes and embedded single - # quotes. - sed_script="1s,^X,,;s|'|'\"'\"'|g" - # Add a leading "X" so that if $arg starts with a dash, - # the echo command will not try to interpret the argument - # as a command-line option. - arg="X$arg" - # Generate the quoted string. - quoted_arg=`echo "$arg" | sed -e "$sed_script"` - ;; - *) - quoted_arg=$arg - ;; - esac - # Surround the entire argument with single quotes. - quoted_arg="'"$quoted_arg"'" - - # Add it to the string. - result="$result $quoted_arg" -done - -# Output the string we have built up. -echo "$result" diff --git a/deps/libffi/libtool-version b/deps/libffi/libtool-version deleted file mode 100644 index 37c2bc9035edb6..00000000000000 --- a/deps/libffi/libtool-version +++ /dev/null @@ -1,29 +0,0 @@ -# This file is used to maintain libtool version info for libffi. See -# the libtool manual to understand the meaning of the fields. This is -# a separate file so that version updates don't involve re-running -# automake. -# -# Here are a set of rules to help you update your library version -# information: -# -# 1. Start with version information of `0:0:0' for each libtool library. -# -# 2. Update the version information only immediately before a public -# release of your software. More frequent updates are unnecessary, -# and only guarantee that the current interface number gets larger -# faster. -# -# 3. If the library source code has changed at all since the last -# update, then increment revision (`c:r:a' becomes `c:r+1:a'). -# -# 4. If any interfaces have been added, removed, or changed since the -# last update, increment current, and set revision to 0. -# -# 5. If any interfaces have been added since the last public release, -# then increment age. -# -# 6. If any interfaces have been removed since the last public -# release, then set age to 0. -# -# CURRENT:REVISION:AGE -10:0:2 diff --git a/deps/libffi/m4/asmcfi.m4 b/deps/libffi/m4/asmcfi.m4 deleted file mode 100644 index 6be634b4455293..00000000000000 --- a/deps/libffi/m4/asmcfi.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl ------------------------------------------------------------------ -dnl Check whether the assembler understands .cfi_* pseudo-ops. -dnl ------------------------------------------------------------------ -AC_DEFUN([GCC_AS_CFI_PSEUDO_OP], -[ - AC_CACHE_CHECK([assembler .cfi pseudo-op support], - [gcc_cv_as_cfi_pseudo_op], - [ AC_LANG_PUSH([C]) - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([[ - #ifdef _MSC_VER - Nope. - #endif - int foo (void) - { - __asm__ (".cfi_remember_state\n\t" - ".cfi_restore_state\n\t"); - return 0; - } - ]])], - [gcc_cv_as_cfi_pseudo_op=yes], - [gcc_cv_as_cfi_pseudo_op=no]) - AC_LANG_POP([C]) - ]) - - if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then - AC_DEFINE([HAVE_AS_CFI_PSEUDO_OP], [1], - [Define if your assembler supports .cfi_* directives.]) - fi -]) diff --git a/deps/libffi/m4/ax_append_flag.m4 b/deps/libffi/m4/ax_append_flag.m4 deleted file mode 100644 index dd6d8b61406c32..00000000000000 --- a/deps/libffi/m4/ax_append_flag.m4 +++ /dev/null @@ -1,50 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) -# -# DESCRIPTION -# -# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space -# added in between. -# -# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. -# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains -# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly -# FLAG. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 8 - -AC_DEFUN([AX_APPEND_FLAG], -[dnl -AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF -AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) -AS_VAR_SET_IF(FLAGS,[ - AS_CASE([" AS_VAR_GET(FLAGS) "], - [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], - [ - AS_VAR_APPEND(FLAGS,[" $1"]) - AC_RUN_LOG([: FLAGS="$FLAGS"]) - ]) - ], - [ - AS_VAR_SET(FLAGS,[$1]) - AC_RUN_LOG([: FLAGS="$FLAGS"]) - ]) -AS_VAR_POPDEF([FLAGS])dnl -])dnl AX_APPEND_FLAG diff --git a/deps/libffi/m4/ax_cc_maxopt.m4 b/deps/libffi/m4/ax_cc_maxopt.m4 deleted file mode 100644 index 2f447afbbf7658..00000000000000 --- a/deps/libffi/m4/ax_cc_maxopt.m4 +++ /dev/null @@ -1,198 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_cc_maxopt.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CC_MAXOPT -# -# DESCRIPTION -# -# Try to turn on "good" C optimization flags for various compilers and -# architectures, for some definition of "good". (In our case, good for -# FFTW and hopefully for other scientific codes. Modify as needed.) -# -# The user can override the flags by setting the CFLAGS environment -# variable. The user can also specify --enable-portable-binary in order to -# disable any optimization flags that might result in a binary that only -# runs on the host architecture. -# -# Note also that the flags assume that ANSI C aliasing rules are followed -# by the code (e.g. for gcc's -fstrict-aliasing), and that floating-point -# computations can be re-ordered as needed. -# -# Requires macros: AX_CHECK_COMPILE_FLAG, AX_COMPILER_VENDOR, -# AX_GCC_ARCHFLAG, AX_GCC_X86_CPUID. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2008 Matteo Frigo -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 22 - -AC_DEFUN([AX_CC_MAXOPT], -[ -AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AX_COMPILER_VENDOR]) -AC_REQUIRE([AC_CANONICAL_HOST]) - -AC_ARG_ENABLE(portable-binary, [AS_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])], - acx_maxopt_portable=$enableval, acx_maxopt_portable=no) - -# Try to determine "good" native compiler flags if none specified via CFLAGS -if test "x$ac_test_CFLAGS" = "x"; then - case $ax_cv_c_compiler_vendor in - dec) CFLAGS="$CFLAGS -newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" - if test "x$acx_maxopt_portable" = xno; then - CFLAGS="$CFLAGS -arch host" - fi;; - - sun) CFLAGS="$CFLAGS -native -fast -xO5 -dalign" - if test "x$acx_maxopt_portable" = xyes; then - CFLAGS="$CFLAGS -xarch=generic" - fi;; - - hp) CFLAGS="$CFLAGS +Oall +Optrs_ansi +DSnative" - if test "x$acx_maxopt_portable" = xyes; then - CFLAGS="$CFLAGS +DAportable" - fi;; - - ibm) if test "x$acx_maxopt_portable" = xno; then - xlc_opt="-qarch=auto -qtune=auto" - else - xlc_opt="-qtune=auto" - fi - AX_CHECK_COMPILE_FLAG($xlc_opt, - CFLAGS="$CFLAGS -O3 -qansialias -w $xlc_opt", - [CFLAGS="$CFLAGS -O3 -qansialias -w" - echo "******************************************************" - echo "* You seem to have the IBM C compiler. It is *" - echo "* recommended for best performance that you use: *" - echo "* *" - echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *" - echo "* ^^^ ^^^ *" - echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *" - echo "* CPU you have. (Set the CFLAGS environment var. *" - echo "* and re-run configure.) For more info, man cc. *" - echo "******************************************************"]) - ;; - - intel) CFLAGS="$CFLAGS -O3 -ansi_alias" - if test "x$acx_maxopt_portable" = xno; then - icc_archflag=unknown - icc_flags="" - case $host_cpu in - i686*|x86_64*) - # icc accepts gcc assembly syntax, so these should work: - AX_GCC_X86_CPUID(0) - AX_GCC_X86_CPUID(1) - case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG - *:756e6547:6c65746e:49656e69) # Intel - case $ax_cv_gcc_x86_cpuid_1 in - *0?6[[78ab]]?:*:*:*|?6[[78ab]]?:*:*:*|6[[78ab]]?:*:*:*) icc_flags="-xK" ;; - *0?6[[9d]]?:*:*:*|?6[[9d]]?:*:*:*|6[[9d]]?:*:*:*|*1?65?:*:*:*) icc_flags="-xSSE2 -xB -xK" ;; - *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) icc_flags="-xSSE3 -xP -xO -xB -xK" ;; - *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) icc_flags="-xSSSE3 -xT -xB -xK" ;; - *1?6[[7d]]?:*:*:*) icc_flags="-xSSE4.1 -xS -xT -xB -xK" ;; - *1?6[[aef]]?:*:*:*|*2?6[[5cef]]?:*:*:*) icc_flags="-xSSE4.2 -xS -xT -xB -xK" ;; - *2?6[[ad]]?:*:*:*) icc_flags="-xAVX -SSE4.2 -xS -xT -xB -xK" ;; - *3?6[[ae]]?:*:*:*) icc_flags="-xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; - *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) icc_flags="-xCORE-AVX2 -xCORE-AVX-I -xAVX -SSE4.2 -xS -xT -xB -xK" ;; - *000?f[[346]]?:*:*:*|?f[[346]]?:*:*:*|f[[346]]?:*:*:*) icc_flags="-xSSE3 -xP -xO -xN -xW -xK" ;; - *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) icc_flags="-xSSE2 -xN -xW -xK" ;; - esac ;; - esac ;; - esac - if test "x$icc_flags" != x; then - for flag in $icc_flags; do - AX_CHECK_COMPILE_FLAG($flag, [icc_archflag=$flag; break]) - done - fi - AC_MSG_CHECKING([for icc architecture flag]) - AC_MSG_RESULT($icc_archflag) - if test "x$icc_archflag" != xunknown; then - CFLAGS="$CFLAGS $icc_archflag" - fi - fi - ;; - - nvhpc) - # default optimization flags for nvhpc - CFLAGS="$CFLAGS -O3" - ;; - - gnu) - # default optimization flags for gcc on all systems - CFLAGS="$CFLAGS -O3 -fomit-frame-pointer" - - # -malign-double for x86 systems - # LIBFFI_LOCAL: don't do this. - # The testsuite doesn't use these flags and we'll get test failures. - # AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double") - - # -fstrict-aliasing for gcc-2.95+ - AX_CHECK_COMPILE_FLAG(-fstrict-aliasing, - CFLAGS="$CFLAGS -fstrict-aliasing") - - # note that we enable "unsafe" fp optimization with other compilers, too - AX_CHECK_COMPILE_FLAG(-ffast-math, CFLAGS="$CFLAGS -ffast-math") - - AX_GCC_ARCHFLAG($acx_maxopt_portable) - ;; - - microsoft) - # default optimization flags for MSVC opt builds - CFLAGS="$CFLAGS -O2" - ;; - esac - - if test -z "$CFLAGS"; then - echo "" - echo "********************************************************" - echo "* WARNING: Don't know the best CFLAGS for this system *" - echo "* Use ./configure CFLAGS=... to specify your own flags *" - echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" - echo "********************************************************" - echo "" - CFLAGS="$CFLAGS -O3" - fi - - AX_CHECK_COMPILE_FLAG($CFLAGS, [], [ - echo "" - echo "********************************************************" - echo "* WARNING: The guessed CFLAGS don't seem to work with *" - echo "* your compiler. *" - echo "* Use ./configure CFLAGS=... to specify your own flags *" - echo "********************************************************" - echo "" - ]) - -fi -]) diff --git a/deps/libffi/m4/ax_cflags_warn_all.m4 b/deps/libffi/m4/ax_cflags_warn_all.m4 deleted file mode 100644 index 9235a18c7a8315..00000000000000 --- a/deps/libffi/m4/ax_cflags_warn_all.m4 +++ /dev/null @@ -1,158 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])] -# AX_CXXFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])] -# AX_FCFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])] -# -# DESCRIPTION -# -# Specify compiler options that enable most reasonable warnings. For the -# GNU Compiler Collection (GCC), for example, it will be "-Wall". The -# result is added to shellvar, one of CFLAGS, CXXFLAGS or FCFLAGS if the -# first parameter is not specified. -# -# Each of these macros accepts the following optional arguments: -# -# - $1 - shellvar -# shell variable to use (CFLAGS, CXXFLAGS or FCFLAGS if not -# specified, depending on macro) -# -# - $2 - default -# value to use for flags if compiler vendor cannot be determined (by -# default, "") -# -# - $3 - action-if-found -# action to take if the compiler vendor has been successfully -# determined (by default, add the appropriate compiler flags to -# shellvar) -# -# - $4 - action-if-not-found -# action to take if the compiler vendor has not been determined or -# is unknown (by default, add the default flags, or "" if not -# specified, to shellvar) -# -# These macros use AX_COMPILER_VENDOR to determine which flags should be -# returned for a given compiler. Not all compilers currently have flags -# defined for them; patches are welcome. If need be, compiler flags may -# be made language-dependent: use a construct like the following: -# -# [vendor_name], [m4_if(_AC_LANG_PREFIX,[C], VAR="--relevant-c-flags",dnl -# m4_if(_AC_LANG_PREFIX,[CXX], VAR="--relevant-c++-flags",dnl -# m4_if(_AC_LANG_PREFIX,[FC], VAR="--relevant-fortran-flags",dnl -# VAR="$2"; FOUND="no")))], -# -# Note: These macros also depend on AX_PREPEND_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2010 Rhys Ulerich -# Copyright (c) 2018 John Zaitseff -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 25 - -AC_DEFUN([AX_FLAGS_WARN_ALL], [ - AX_REQUIRE_DEFINED([AX_PREPEND_FLAG])dnl - AC_REQUIRE([AX_COMPILER_VENDOR])dnl - - AS_VAR_PUSHDEF([FLAGS], [m4_default($1,_AC_LANG_PREFIX[]FLAGS)])dnl - AS_VAR_PUSHDEF([VAR], [ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl - AS_VAR_PUSHDEF([FOUND], [ac_save_[]_AC_LANG_ABBREV[]flags_warn_all_found])dnl - - AC_CACHE_CHECK([FLAGS for most reasonable warnings], VAR, [ - VAR="" - FOUND="yes" - dnl Cases are listed in the order found in ax_compiler_vendor.m4 - AS_CASE("$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor", - [intel], [VAR="-w2"], - [ibm], [VAR="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd"], - [pathscale], [], - [clang], [VAR="-Wall"], - [cray], [VAR="-h msglevel 2"], - [fujitsu], [], - [sdcc], [], - [sx], [VAR="-pvctl[,]fullmsg"], - [portland], [], - [gnu], [VAR="-Wall"], - [sun], [VAR="-v"], - [hp], [VAR="+w1"], - [dec], [VAR="-verbose -w0 -warnprotos"], - [borland], [], - [comeau], [], - [kai], [], - [lcc], [], - [sgi], [VAR="-fullwarn"], - [microsoft], [], - [metrowerks], [], - [watcom], [], - [tcc], [], - [unknown], [ - VAR="$2" - FOUND="no" - ], - [ - AC_MSG_WARN([Unknown compiler vendor returned by [AX_COMPILER_VENDOR]]) - VAR="$2" - FOUND="no" - ] - ) - - AS_IF([test "x$FOUND" = "xyes"], [dnl - m4_default($3, [AS_IF([test "x$VAR" != "x"], [AX_PREPEND_FLAG([$VAR], [FLAGS])])]) - ], [dnl - m4_default($4, [m4_ifval($2, [AX_PREPEND_FLAG([$VAR], [FLAGS])], [true])]) - ])dnl - ])dnl - - AS_VAR_POPDEF([FOUND])dnl - AS_VAR_POPDEF([VAR])dnl - AS_VAR_POPDEF([FLAGS])dnl -])dnl AX_FLAGS_WARN_ALL - -AC_DEFUN([AX_CFLAGS_WARN_ALL], [dnl - AC_LANG_PUSH([C]) - AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) - AC_LANG_POP([C]) -])dnl - -AC_DEFUN([AX_CXXFLAGS_WARN_ALL], [dnl - AC_LANG_PUSH([C++]) - AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) - AC_LANG_POP([C++]) -])dnl - -AC_DEFUN([AX_FCFLAGS_WARN_ALL], [dnl - AC_LANG_PUSH([Fortran]) - AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) - AC_LANG_POP([Fortran]) -])dnl diff --git a/deps/libffi/m4/ax_check_compile_flag.m4 b/deps/libffi/m4/ax_check_compile_flag.m4 deleted file mode 100644 index 54191c55353ee5..00000000000000 --- a/deps/libffi/m4/ax_check_compile_flag.m4 +++ /dev/null @@ -1,63 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's compiler -# or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 11 - -AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether the _AC_LANG compiler accepts $1], CACHEVAR, [ - ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - if test x"m4_case(_AC_LANG, - [C], [$GCC], - [C++], [$GXX], - [Fortran], [$GFC], - [Fortran 77], [$G77], - [Objective C], [$GOBJC], - [Objective C++], [$GOBJCXX], - [no])" = xyes ; then - add_gnu_werror="-Werror" - fi - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1 $add_gnu_werror" - AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_COMPILE_FLAGS diff --git a/deps/libffi/m4/ax_compiler_vendor.m4 b/deps/libffi/m4/ax_compiler_vendor.m4 deleted file mode 100644 index 039f99d2bd3851..00000000000000 --- a/deps/libffi/m4/ax_compiler_vendor.m4 +++ /dev/null @@ -1,119 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_COMPILER_VENDOR -# -# DESCRIPTION -# -# Determine the vendor of the C, C++ or Fortran compiler. The vendor is -# returned in the cache variable $ax_cv_c_compiler_vendor for C, -# $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for -# (modern) Fortran. The value is one of "intel", "ibm", "pathscale", -# "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "nvhpc" (NVIDIA HPC -# Compiler), "portland" (PGI), "gnu" (GCC), "sun" (Oracle Developer -# Studio), "hp", "dec", "borland", "comeau", "kai", "lcc", "sgi", -# "microsoft", "metrowerks", "watcom", "tcc" (Tiny CC) or "unknown" (if -# the compiler cannot be determined). -# -# To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT -# with an appropriate preprocessor-enabled extension. For example: -# -# AC_LANG_PUSH([Fortran]) -# AC_PROG_FC -# AC_FC_PP_SRCEXT([F]) -# AX_COMPILER_VENDOR -# AC_LANG_POP([Fortran]) -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2008 Matteo Frigo -# Copyright (c) 2018-19 John Zaitseff -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 32 - -AC_DEFUN([AX_COMPILER_VENDOR], [dnl - AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl - dnl If you modify this list of vendors, please add similar support - dnl to ax_compiler_version.m4 if at all possible. - dnl - dnl Note: Do NOT check for GCC first since some other compilers - dnl define __GNUC__ to remain compatible with it. Compilers that - dnl are very slow to start (such as Intel) are listed first. - - vendors=" - intel: __ICC,__ECC,__INTEL_COMPILER - ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ - pathscale: __PATHCC__,__PATHSCALE__ - clang: __clang__ - cray: _CRAYC - fujitsu: __FUJITSU - sdcc: SDCC,__SDCC - sx: _SX - nvhpc: __NVCOMPILER - portland: __PGI - gnu: __GNUC__ - sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 - hp: __HP_cc,__HP_aCC - dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER - borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ - comeau: __COMO__ - kai: __KCC - lcc: __LCC__ - sgi: __sgi,sgi - microsoft: _MSC_VER - metrowerks: __MWERKS__ - watcom: __WATCOMC__ - tcc: __TINYC__ - unknown: UNKNOWN - " - for ventest in $vendors; do - case $ventest in - *:) - vendor=$ventest - continue - ;; - *) - vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" - ;; - esac - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ -#if !($vencpp) - thisisanerror; -#endif - ]])], [break]) - done - - ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` - ]) -])dnl diff --git a/deps/libffi/m4/ax_configure_args.m4 b/deps/libffi/m4/ax_configure_args.m4 deleted file mode 100644 index 9237efea7a7f45..00000000000000 --- a/deps/libffi/m4/ax_configure_args.m4 +++ /dev/null @@ -1,49 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_configure_args.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CONFIGURE_ARGS -# -# DESCRIPTION -# -# Helper macro for AX_ENABLE_BUILDDIR. -# -# The traditional way of starting a subdir-configure is running the script -# with ${1+"$@"} but since autoconf 2.60 this is broken. Instead we have -# to rely on eval'ing $ac_configure_args however some old autoconf -# versions do not provide that. To ensure maximum portability of autoconf -# extension macros this helper can be AC_REQUIRE'd so that -# $ac_configure_args will always be present. -# -# Sadly, the traditional "exec $SHELL" of the enable_builddir macros is -# spoiled now and must be replaced by "eval + exit $?". -# -# Example: -# -# AC_DEFUN([AX_ENABLE_SUBDIR],[dnl -# AC_REQUIRE([AX_CONFIGURE_ARGS])dnl -# eval $SHELL $ac_configure_args || exit $? -# ...]) -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 14 - -AC_DEFUN([AX_CONFIGURE_ARGS],[ - # [$]@ is unusable in 2.60+ but earlier autoconf had no ac_configure_args - if test "${ac_configure_args+set}" != "set" ; then - ac_configure_args= - for ac_arg in ${1+"[$]@"}; do - ac_configure_args="$ac_configure_args '$ac_arg'" - done - fi -]) diff --git a/deps/libffi/m4/ax_enable_builddir.m4 b/deps/libffi/m4/ax_enable_builddir.m4 deleted file mode 100644 index 710384da545f1f..00000000000000 --- a/deps/libffi/m4/ax_enable_builddir.m4 +++ /dev/null @@ -1,302 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_enable_builddir.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_ENABLE_BUILDDIR [(dirstring-or-command [,Makefile.mk [,-all]])] -# -# DESCRIPTION -# -# If the current configure was run within the srcdir then we move all -# configure-files into a subdir and let the configure steps continue -# there. We provide an option --disable-builddir to suppress the move into -# a separate builddir. -# -# Defaults: -# -# $1 = $host (overridden with $HOST) -# $2 = Makefile.mk -# $3 = -all -# -# This macro must be called before AM_INIT_AUTOMAKE. It creates a default -# toplevel srcdir Makefile from the information found in the created -# toplevel builddir Makefile. It just copies the variables and -# rule-targets, each extended with a default rule-execution that recurses -# into the build directory of the current "HOST". You can override the -# auto-detection through `config.guess` and build-time of course, as in -# -# make HOST=i386-mingw-cross -# -# which can of course set at configure time as well using -# -# configure --host=i386-mingw-cross -# -# After the default has been created, additional rules can be appended -# that will not just recurse into the subdirectories and only ever exist -# in the srcdir toplevel makefile - these parts are read from the $2 = -# Makefile.mk file -# -# The automatic rules are usually scanning the toplevel Makefile for lines -# like '#### $host |$builddir' to recognize the place where to recurse -# into. Usually, the last one is the only one used. However, almost all -# targets have an additional "*-all" rule which makes the script to -# recurse into _all_ variants of the current HOST (!!) setting. The "-all" -# suffix can be overridden for the macro as well. -# -# a special rule is only given for things like "dist" that will copy the -# tarball from the builddir to the sourcedir (or $(PUB)) for reason of -# convenience. -# -# LICENSE -# -# Copyright (c) 2009 Guido U. Draheim -# Copyright (c) 2009 Alan Jenkins -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 30 - -AC_DEFUN([AX_ENABLE_BUILDDIR],[ -AC_REQUIRE([AC_CANONICAL_HOST])[]dnl -AC_REQUIRE([AC_CANONICAL_TARGET])[]dnl -AC_REQUIRE([AX_CONFIGURE_ARGS])[]dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])[]dnl -AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl -AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl -AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl -AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl -SUB="." -AC_ARG_ENABLE([builddir], AS_HELP_STRING( - [--disable-builddir],[disable automatic build in subdir of sources]) - ,[SUB="$enableval"], [SUB="auto"]) -if test ".$ac_srcdir_defaulted" != ".no" ; then -if test ".$srcdir" = ".." ; then - if test -f config.status ; then - AC_MSG_NOTICE(toplevel srcdir already configured... skipping subdir build) - else - test ".$SUB" = "." && SUB="." - test ".$SUB" = ".no" && SUB="." - test ".$TARGET" = "." && TARGET="$target" - test ".$SUB" = ".auto" && SUB="m4_ifval([$1], [$1],[$TARGET])" - if test ".$SUB" != ".." ; then # we know where to go and - AS_MKDIR_P([$SUB]) - echo __.$SUB.__ > $SUB/conftest.tmp - cd $SUB - if grep __.$SUB.__ conftest.tmp >/dev/null 2>/dev/null ; then - rm conftest.tmp - AC_MSG_RESULT([continue configure in default builddir "./$SUB"]) - else - AC_MSG_ERROR([could not change to default builddir "./$SUB"]) - fi - srcdir=`echo "$SUB" | - sed -e 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,[[/]]$,,;'` - # going to restart from subdirectory location - test -f $srcdir/config.log && mv $srcdir/config.log . - test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h . - test -f $srcdir/conftest.log && mv $srcdir/conftest.log . - test -f $srcdir/$cache_file && mv $srcdir/$cache_file . - AC_MSG_RESULT(....exec $SHELL $srcdir/[$]0 "--srcdir=$srcdir" "--enable-builddir=$SUB" ${1+"[$]@"}) - case "[$]0" in # restart - [[\\/]]* | ?:[[\\/]]*) # Absolute name - eval $SHELL "'[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;; - *) eval $SHELL "'$srcdir/[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;; - esac ; exit $? - fi - fi -fi fi -test ".$SUB" = ".auto" && SUB="." -dnl ac_path_prog uses "set dummy" to override $@ which would defeat the "exec" -AC_PATH_PROG(SED,gsed sed, sed) -AUX="$am_aux_dir" -AS_VAR_POPDEF([SED])dnl -AS_VAR_POPDEF([AUX])dnl -AS_VAR_POPDEF([SUB])dnl -AC_CONFIG_COMMANDS([buildir],[dnl .............. config.status .............. -AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl -AS_VAR_PUSHDEF([TOP],[top_srcdir])dnl -AS_VAR_PUSHDEF([SRC],[ac_top_srcdir])dnl -AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl -AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl -pushdef([END],[Makefile.mk])dnl -pushdef([_ALL],[ifelse([$3],,[-all],[$3])])dnl - SRC="$ax_enable_builddir_srcdir" - if test ".$SUB" = ".." ; then - if test -f "$TOP/Makefile" ; then - AC_MSG_NOTICE([skipping TOP/Makefile - left untouched]) - else - AC_MSG_NOTICE([skipping TOP/Makefile - not created]) - fi - else - if test -f "$SRC/Makefile" ; then - a=`grep "^VERSION " "$SRC/Makefile"` ; b=`grep "^VERSION " Makefile` - test "$a" != "$b" && rm "$SRC/Makefile" - fi - if test -f "$SRC/Makefile" ; then - echo "$SRC/Makefile : $SRC/Makefile.in" > $tmp/conftemp.mk - echo " []@ echo 'REMOVED,,,' >\$[]@" >> $tmp/conftemp.mk - eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null" - if grep '^REMOVED,,,' "$SRC/Makefile" >/dev/null - then rm $SRC/Makefile ; fi - cp $tmp/conftemp.mk $SRC/makefiles.mk~ ## DEBUGGING - fi - if test ! -f "$SRC/Makefile" ; then - AC_MSG_NOTICE([create TOP/Makefile guessed from local Makefile]) - x='`' ; cat >$tmp/conftemp.sed <<_EOF -/^\$/n -x -/^\$/bS -x -/\\\\\$/{H;d;} -{H;s/.*//;x;} -bM -:S -x -/\\\\\$/{h;d;} -{h;s/.*//;x;} -:M -s/\\(\\n\\) /\\1 /g -/^ /d -/^[[ ]]*[[\\#]]/d -/^VPATH *=/d -s/^srcdir *=.*/srcdir = ./ -s/^top_srcdir *=.*/top_srcdir = ./ -/[[:=]]/!d -/^\\./d -dnl Now handle rules (i.e. lines containing ":" but not " = "). -/ = /b -/ .= /b -/:/!b -s/:.*/:/ -s/ / /g -s/ \\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/ \\1 \\1[]_ALL\\2/g -s/^\\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/\\1 \\1[]_ALL\\2/ -s/ / /g -/^all all[]_ALL[[ :]]/i\\ -all-configured : all[]_ALL -dnl dist-all exists... and would make for dist-all-all -s/ [[a-zA-Z0-9-]]*[]_ALL [[a-zA-Z0-9-]]*[]_ALL[]_ALL//g -/[]_ALL[]_ALL/d -a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\ - ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ - ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : \\\\\\ - ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\ - ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ - ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\ - ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done -dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree) -/dist[]_ALL *:/a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\ - ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ - ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\ - ; if test "\$\$found" -eq "0" ; then : \\\\\\ - ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ - ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\ - ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done -dnl special rule add-on: "dist-foo" copies all the archives to $(PUB). (source tree) -/dist-[[a-zA-Z0-9]]*[]_ALL *:/a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\ - ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\ - ; found=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\ - ; if test "\$\$found" -eq "0" ; then : \\\\\\ - ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\ - ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\ - ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done -dnl special rule add-on: "distclean" removes all local builddirs completely -/distclean[]_ALL *:/a\\ - @ HOST="\$(HOST)\" \\\\\\ - ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\ - ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\ - ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\ - ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\ - ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\ - ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\ - ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\ - ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\ - ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\ - ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile -_EOF - cp "$tmp/conftemp.sed" "$SRC/makefile.sed~" ## DEBUGGING - $SED -f $tmp/conftemp.sed Makefile >$SRC/Makefile - if test -f "$SRC/m4_ifval([$2],[$2],[END])" ; then - AC_MSG_NOTICE([extend TOP/Makefile with TOP/m4_ifval([$2],[$2],[END])]) - cat $SRC/END >>$SRC/Makefile - fi ; xxxx="####" - echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$SRC/Makefile - # sanity check - if grep '^; echo "MAKE ' $SRC/Makefile >/dev/null ; then - AC_MSG_NOTICE([buggy sed found - it deletes tab in "a" text parts]) - $SED -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \ - >$SRC/Makefile~ - (test -s $SRC/Makefile~ && mv $SRC/Makefile~ $SRC/Makefile) 2>/dev/null - fi - else - xxxx="\\#\\#\\#\\#" - # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed - echo "s!^$xxxx [[^|]]* | *$SUB *\$!$xxxx ...... $SUB!" >$tmp/conftemp.sed - $SED -f "$tmp/conftemp.sed" "$SRC/Makefile" >$tmp/mkfile.tmp - cp "$tmp/conftemp.sed" "$SRC/makefiles.sed~" ## DEBUGGING - cp "$tmp/mkfile.tmp" "$SRC/makefiles.out~" ## DEBUGGING - if cmp -s "$SRC/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then - AC_MSG_NOTICE([keeping TOP/Makefile from earlier configure]) - rm "$tmp/mkfile.tmp" - else - AC_MSG_NOTICE([reusing TOP/Makefile from earlier configure]) - mv "$tmp/mkfile.tmp" "$SRC/Makefile" - fi - fi - AC_MSG_NOTICE([build in $SUB (HOST=$ax_enable_builddir_host)]) - xxxx="####" - echo "$xxxx" "$ax_enable_builddir_host" "|$SUB" >>$SRC/Makefile - fi -popdef([END])dnl -AS_VAR_POPDEF([SED])dnl -AS_VAR_POPDEF([AUX])dnl -AS_VAR_POPDEF([SRC])dnl -AS_VAR_POPDEF([TOP])dnl -AS_VAR_POPDEF([SUB])dnl -],[dnl -ax_enable_builddir_srcdir="$srcdir" # $srcdir -ax_enable_builddir_host="$HOST" # $HOST / $host -ax_enable_builddir_version="$VERSION" # $VERSION -ax_enable_builddir_package="$PACKAGE" # $PACKAGE -ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX -ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED -ax_enable_builddir="$ax_enable_builddir" # $SUB -])dnl -]) diff --git a/deps/libffi/m4/ax_gcc_archflag.m4 b/deps/libffi/m4/ax_gcc_archflag.m4 deleted file mode 100644 index c52b9b296e9fab..00000000000000 --- a/deps/libffi/m4/ax_gcc_archflag.m4 +++ /dev/null @@ -1,267 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE]) -# -# DESCRIPTION -# -# This macro tries to guess the "native" arch corresponding to the target -# architecture for use with gcc's -march=arch or -mtune=arch flags. If -# found, the cache variable $ax_cv_gcc_archflag is set to this flag and -# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is set to -# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is -# to add $ax_cv_gcc_archflag to the end of $CFLAGS. -# -# PORTABLE? should be either [yes] (default) or [no]. In the former case, -# the flag is set to -mtune (or equivalent) so that the architecture is -# only used for tuning, but the instruction set used is still portable. In -# the latter case, the flag is set to -march (or equivalent) so that -# architecture-specific instructions are enabled. -# -# The user can specify --with-gcc-arch= in order to override the -# macro's choice of architecture, or --without-gcc-arch to disable this. -# -# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is -# called unless the user specified --with-gcc-arch manually. -# -# Requires macros: AX_CHECK_COMPILE_FLAG, AX_GCC_X86_CPUID -# -# (The main emphasis here is on recent CPUs, on the principle that doing -# high-performance computing on old hardware is uncommon.) -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2008 Matteo Frigo -# Copyright (c) 2014 Tsukasa Oi -# Copyright (c) 2017-2018 Alexey Kopytov -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 22 - -AC_DEFUN([AX_GCC_ARCHFLAG], -[AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_SED]) -AC_REQUIRE([AX_COMPILER_VENDOR]) - -AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=], [use architecture for gcc -march/-mtune, instead of guessing])], - ax_gcc_arch=$withval, ax_gcc_arch=yes) - -AC_MSG_CHECKING([for gcc architecture flag]) -AC_MSG_RESULT([]) -AC_CACHE_VAL(ax_cv_gcc_archflag, -[ -ax_cv_gcc_archflag="unknown" - -if test "$GCC" = yes; then - -if test "x$ax_gcc_arch" = xyes; then -ax_gcc_arch="" -if test "$cross_compiling" = no; then -case $host_cpu in - i[[3456]]86*|x86_64*|amd64*) # use cpuid codes - AX_GCC_X86_CPUID(0) - AX_GCC_X86_CPUID(1) - case $ax_cv_gcc_x86_cpuid_0 in - *:756e6547:6c65746e:49656e69) # Intel - case $ax_cv_gcc_x86_cpuid_1 in - *5[[4578]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; - *5[[123]]?:*:*:*) ax_gcc_arch=pentium ;; - *0?61?:*:*:*|?61?:*:*:*|61?:*:*:*) ax_gcc_arch=pentiumpro ;; - *0?6[[356]]?:*:*:*|?6[[356]]?:*:*:*|6[[356]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; - *0?6[[78ab]]?:*:*:*|?6[[78ab]]?:*:*:*|6[[78ab]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; - *0?6[[9d]]?:*:*:*|?6[[9d]]?:*:*:*|6[[9d]]?:*:*:*|*1?65?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; - *0?6e?:*:*:*|?6e?:*:*:*|6e?:*:*:*) ax_gcc_arch="yonah pentium-m pentium3 pentiumpro" ;; - *0?6f?:*:*:*|?6f?:*:*:*|6f?:*:*:*|*1?66?:*:*:*) ax_gcc_arch="core2 pentium-m pentium3 pentiumpro" ;; - *1?6[[7d]]?:*:*:*) ax_gcc_arch="penryn core2 pentium-m pentium3 pentiumpro" ;; - *1?6[[aef]]?:*:*:*|*2?6e?:*:*:*) ax_gcc_arch="nehalem corei7 core2 pentium-m pentium3 pentiumpro" ;; - *2?6[[5cf]]?:*:*:*) ax_gcc_arch="westmere corei7 core2 pentium-m pentium3 pentiumpro" ;; - *2?6[[ad]]?:*:*:*) ax_gcc_arch="sandybridge corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; - *3?6[[ae]]?:*:*:*) ax_gcc_arch="ivybridge core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; - *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) ax_gcc_arch="haswell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; - *3?6d?:*:*:*|*4?6[[7f]]?:*:*:*|*5?66?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; - *1?6c?:*:*:*|*2?6[[67]]?:*:*:*|*3?6[[56]]?:*:*:*) ax_gcc_arch="bonnell atom core2 pentium-m pentium3 pentiumpro" ;; - *3?67?:*:*:*|*[[45]]?6[[ad]]?:*:*:*) ax_gcc_arch="silvermont atom core2 pentium-m pentium3 pentiumpro" ;; - *000?f[[012]]?:*:*:*|?f[[012]]?:*:*:*|f[[012]]?:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; - *000?f[[346]]?:*:*:*|?f[[346]]?:*:*:*|f[[346]]?:*:*:*) ax_gcc_arch="nocona prescott pentium4 pentiumpro" ;; - # fallback - *5??:*:*:*) ax_gcc_arch=pentium ;; - *??6??:*:*:*) ax_gcc_arch="core2 pentiumpro" ;; - *6??:*:*:*) ax_gcc_arch=pentiumpro ;; - *00??f??:*:*:*|??f??:*:*:*|?f??:*:*:*|f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; - esac ;; - *:68747541:444d4163:69746e65) # AMD - case $ax_cv_gcc_x86_cpuid_1 in - *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;; - *5[[8]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; - *5[[9d]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; - *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;; - *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; - *6[[678a]]?:*:*:*) ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; - *000?f[[4578bcef]]?:*:*:*|?f[[4578bcef]]?:*:*:*|f[[4578bcef]]?:*:*:*|*001?f[[4578bcf]]?:*:*:*|1?f[[4578bcf]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; - *002?f[[13457bcf]]?:*:*:*|2?f[[13457bcf]]?:*:*:*|*004?f[[138bcf]]?:*:*:*|4?f[[138bcf]]?:*:*:*|*005?f[[df]]?:*:*:*|5?f[[df]]?:*:*:*|*006?f[[8bcf]]?:*:*:*|6?f[[8bcf]]?:*:*:*|*007?f[[cf]]?:*:*:*|7?f[[cf]]?:*:*:*|*00c?f1?:*:*:*|c?f1?:*:*:*|*020?f3?:*:*:*|20?f3?:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; - *010?f[[245689a]]?:*:*:*|10?f[[245689a]]?:*:*:*|*030?f1?:*:*:*|30?f1?:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; - *050?f[[12]]?:*:*:*|50?f[[12]]?:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; - *060?f1?:*:*:*|60?f1?:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; - *060?f2?:*:*:*|60?f2?:*:*:*|*061?f[[03]]?:*:*:*|61?f[[03]]?:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; - *063?f0?:*:*:*|63?f0?:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; - *07[[03]]?f0?:*:*:*|7[[03]]?f0?:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; - # fallback - *0[[13]]??f??:*:*:*|[[13]]??f??:*:*:*) ax_gcc_arch="barcelona amdfam10 k8" ;; - *020?f??:*:*:*|20?f??:*:*:*) ax_gcc_arch="athlon64-sse3 k8-sse3 athlon64 k8" ;; - *05??f??:*:*:*|5??f??:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;; - *060?f??:*:*:*|60?f??:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;; - *061?f??:*:*:*|61?f??:*:*:*) ax_gcc_arch="bdver2 bdver1 amdfam10 k8" ;; - *06??f??:*:*:*|6??f??:*:*:*) ax_gcc_arch="bdver3 bdver2 bdver1 amdfam10 k8" ;; - *070?f??:*:*:*|70?f??:*:*:*) ax_gcc_arch="btver2 btver1 amdfam10 k8" ;; - *???f??:*:*:*) ax_gcc_arch="amdfam10 k8" ;; - esac ;; - *:746e6543:736c7561:48727561) # IDT / VIA (Centaur) - case $ax_cv_gcc_x86_cpuid_1 in - *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; - *5[[89]]?:*:*:*) ax_gcc_arch=winchip2 ;; - *66?:*:*:*) ax_gcc_arch=winchip2 ;; - *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;; - *6[[9adf]]?:*:*:*) ax_gcc_arch="c3-2 c3" ;; - esac ;; - esac - if test x"$ax_gcc_arch" = x; then # fallback - case $host_cpu in - i586*) ax_gcc_arch=pentium ;; - i686*) ax_gcc_arch=pentiumpro ;; - esac - fi - ;; - - sparc*) - AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/]) - cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` - cputype=`echo "$cputype" | tr -d ' -' | $SED 's/SPARCIIi/SPARCII/' |tr $as_cr_LETTERS $as_cr_letters` - case $cputype in - *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; - *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; - *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; - *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;; - *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;; - *cypress*) ax_gcc_arch=cypress ;; - esac ;; - - alphaev5) ax_gcc_arch=ev5 ;; - alphaev56) ax_gcc_arch=ev56 ;; - alphapca56) ax_gcc_arch="pca56 ev56" ;; - alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; - alphaev6) ax_gcc_arch=ev6 ;; - alphaev67) ax_gcc_arch=ev67 ;; - alphaev68) ax_gcc_arch="ev68 ev67" ;; - alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; - alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; - alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; - - powerpc*) - cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | $SED 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` - cputype=`echo $cputype | $SED -e 's/ppc//g;s/ *//g'` - case $cputype in - *750*) ax_gcc_arch="750 G3" ;; - *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;; - *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;; - *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;; - *970*) ax_gcc_arch="970 G5 power4";; - *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; - *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; - 603ev|8240) ax_gcc_arch="$cputype 603e 603";; - *POWER7*) ax_gcc_arch="power7";; - *POWER8*) ax_gcc_arch="power8";; - *POWER9*) ax_gcc_arch="power9";; - *POWER10*) ax_gcc_arch="power10";; - *) ax_gcc_arch=$cputype ;; - esac - ax_gcc_arch="$ax_gcc_arch powerpc" - ;; - aarch64) - cpuimpl=`grep 'CPU implementer' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` - cpuarch=`grep 'CPU architecture' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` - cpuvar=`grep 'CPU variant' /proc/cpuinfo 2> /dev/null | cut -d: -f2 | tr -d " " | head -n 1` - case $cpuimpl in - 0x42) case $cpuarch in - 8) case $cpuvar in - 0x0) ax_gcc_arch="thunderx2t99 vulcan armv8.1-a armv8-a+lse armv8-a native" ;; - esac - ;; - esac - ;; - 0x43) case $cpuarch in - 8) case $cpuvar in - 0x0) ax_gcc_arch="thunderx armv8-a native" ;; - 0x1) ax_gcc_arch="thunderx+lse armv8.1-a armv8-a+lse armv8-a native" ;; - esac - ;; - esac - ;; - esac - ;; -esac -fi # not cross-compiling -fi # guess arch - -if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then -if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code - flag_prefixes="-mtune=" - if test "x$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor" = xclang; then flag_prefixes="-march="; fi - # -mcpu=$arch and m$arch generate nonportable code on every arch except - # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. - case $host_cpu in i*86|x86_64*|amd64*) flag_prefixes="$flag_prefixes -mcpu= -m";; esac -else - flag_prefixes="-march= -mcpu= -m" -fi -for flag_prefix in $flag_prefixes; do - for arch in $ax_gcc_arch; do - flag="$flag_prefix$arch" - AX_CHECK_COMPILE_FLAG($flag, [if test "x$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor" = xclang; then - if test "x[]m4_default([$1],yes)" = xyes; then - if test "x$flag" = "x-march=$arch"; then flag=-mtune=$arch; fi - fi - fi; ax_cv_gcc_archflag=$flag; break]) - done - test "x$ax_cv_gcc_archflag" = xunknown || break -done -fi - -fi # $GCC=yes -]) -AC_MSG_CHECKING([for gcc architecture flag]) -AC_MSG_RESULT($ax_cv_gcc_archflag) -if test "x$ax_cv_gcc_archflag" = xunknown; then - m4_default([$3],:) -else - m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"]) -fi -]) diff --git a/deps/libffi/m4/ax_gcc_x86_cpuid.m4 b/deps/libffi/m4/ax_gcc_x86_cpuid.m4 deleted file mode 100644 index df954658ee1b08..00000000000000 --- a/deps/libffi/m4/ax_gcc_x86_cpuid.m4 +++ /dev/null @@ -1,89 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_GCC_X86_CPUID(OP) -# AX_GCC_X86_CPUID_COUNT(OP, COUNT) -# -# DESCRIPTION -# -# On Pentium and later x86 processors, with gcc or a compiler that has a -# compatible syntax for inline assembly instructions, run a small program -# that executes the cpuid instruction with input OP. This can be used to -# detect the CPU type. AX_GCC_X86_CPUID_COUNT takes an additional COUNT -# parameter that gets passed into register ECX before calling cpuid. -# -# On output, the values of the eax, ebx, ecx, and edx registers are stored -# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable -# ax_cv_gcc_x86_cpuid_OP. -# -# If the cpuid instruction fails (because you are running a -# cross-compiler, or because you are not using gcc, or because you are on -# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP -# is set to the string "unknown". -# -# This macro mainly exists to be used in AX_GCC_ARCHFLAG. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2008 Matteo Frigo -# Copyright (c) 2015 Michael Petch -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 10 - -AC_DEFUN([AX_GCC_X86_CPUID], -[AX_GCC_X86_CPUID_COUNT($1, 0) -]) - -AC_DEFUN([AX_GCC_X86_CPUID_COUNT], -[AC_REQUIRE([AC_PROG_CC]) -AC_LANG_PUSH([C]) -AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1, - [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ], [ - int op = $1, level = $2, eax, ebx, ecx, edx; - FILE *f; - __asm__ __volatile__ ("xchg %%ebx, %1\n" - "cpuid\n" - "xchg %%ebx, %1\n" - : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) - : "a" (op), "2" (level)); - - f = fopen("conftest_cpuid", "w"); if (!f) return 1; - fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); - fclose(f); - return 0; -])], - [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid], - [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid], - [ax_cv_gcc_x86_cpuid_$1=unknown])]) -AC_LANG_POP([C]) -]) diff --git a/deps/libffi/m4/ax_prepend_flag.m4 b/deps/libffi/m4/ax_prepend_flag.m4 deleted file mode 100644 index adac8c5acbbd43..00000000000000 --- a/deps/libffi/m4/ax_prepend_flag.m4 +++ /dev/null @@ -1,51 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_prepend_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PREPEND_FLAG(FLAG, [FLAGS-VARIABLE]) -# -# DESCRIPTION -# -# FLAG is added to the front of the FLAGS-VARIABLE shell variable, with a -# space added in between. -# -# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. -# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains -# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly -# FLAG. -# -# NOTE: Implementation based on AX_APPEND_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# Copyright (c) 2018 John Zaitseff -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 2 - -AC_DEFUN([AX_PREPEND_FLAG], -[dnl -AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF -AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) -AS_VAR_SET_IF(FLAGS,[ - AS_CASE([" AS_VAR_GET(FLAGS) "], - [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], - [ - FLAGS="$1 $FLAGS" - AC_RUN_LOG([: FLAGS="$FLAGS"]) - ]) - ], - [ - AS_VAR_SET(FLAGS,[$1]) - AC_RUN_LOG([: FLAGS="$FLAGS"]) - ]) -AS_VAR_POPDEF([FLAGS])dnl -])dnl AX_PREPEND_FLAG diff --git a/deps/libffi/m4/ax_require_defined.m4 b/deps/libffi/m4/ax_require_defined.m4 deleted file mode 100644 index 17c3eab7dafde6..00000000000000 --- a/deps/libffi/m4/ax_require_defined.m4 +++ /dev/null @@ -1,37 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_REQUIRE_DEFINED(MACRO) -# -# DESCRIPTION -# -# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have -# been defined and thus are available for use. This avoids random issues -# where a macro isn't expanded. Instead the configure script emits a -# non-fatal: -# -# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found -# -# It's like AC_REQUIRE except it doesn't expand the required macro. -# -# Here's an example: -# -# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) -# -# LICENSE -# -# Copyright (c) 2014 Mike Frysinger -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 2 - -AC_DEFUN([AX_REQUIRE_DEFINED], [dnl - m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) -])dnl AX_REQUIRE_DEFINED diff --git a/deps/libffi/make_sunver.pl b/deps/libffi/make_sunver.pl deleted file mode 100644 index 8a90b1fea0d366..00000000000000 --- a/deps/libffi/make_sunver.pl +++ /dev/null @@ -1,333 +0,0 @@ -#!/usr/bin/perl -w - -# make_sunver.pl -# -# This script takes at least two arguments, a GNU style version script and -# a list of object and archive files, and generates a corresponding Sun -# style version script as follows: -# -# Each glob pattern, C++ mangled pattern or literal in the input script is -# matched against all global symbols in the input objects, emitting those -# that matched (or nothing if no match was found). -# A comment with the original pattern and its type is left in the output -# file to make it easy to understand the matches. -# -# It uses elfdump when present (native), GNU readelf otherwise. -# It depends on the GNU version of c++filt, since it must understand the -# GNU mangling style. - -use FileHandle; -use IPC::Open2; - -# Enforce C locale. -$ENV{'LC_ALL'} = "C"; -$ENV{'LANG'} = "C"; - -# Input version script, GNU style. -my $symvers = shift; - -########## -# Get all the symbols from the library, match them, and add them to a hash. - -my %sym_hash = (); - -# List of objects and archives to process. -my @OBJECTS = (); - -# List of shared objects to omit from processing. -my @SHAREDOBJS = (); - -# Filter out those input archives that have corresponding shared objects to -# avoid adding all symbols matched in the archive to the output map. -foreach $file (@ARGV) { - if (($so = $file) =~ s/\.a$/.so/ && -e $so) { - printf STDERR "omitted $file -> $so\n"; - push (@SHAREDOBJS, $so); - } else { - push (@OBJECTS, $file); - } -} - -# We need to detect and ignore hidden symbols. Solaris nm can only detect -# this in the harder to parse default output format, and GNU nm not at all, -# so use elfdump -s in the native case and GNU readelf -s otherwise. -# GNU objdump -t cannot be used since it produces a variable number of -# columns. - -# The path to elfdump. -my $elfdump = "/usr/ccs/bin/elfdump"; - -if (-f $elfdump) { - open ELFDUMP,$elfdump.' -s '.(join ' ',@OBJECTS).'|' or die $!; - my $skip_arsym = 0; - - while () { - chomp; - - # Ignore empty lines. - if (/^$/) { - # End of archive symbol table, stop skipping. - $skip_arsym = 0 if $skip_arsym; - next; - } - - # Keep skipping until end of archive symbol table. - next if ($skip_arsym); - - # Ignore object name header for individual objects and archives. - next if (/:$/); - - # Ignore table header lines. - next if (/^Symbol Table Section:/); - next if (/index.*value.*size/); - - # Start of archive symbol table: start skipping. - if (/^Symbol Table: \(archive/) { - $skip_arsym = 1; - next; - } - - # Split table. - (undef, undef, undef, undef, $bind, $oth, undef, $shndx, $name) = split; - - # Error out for unknown input. - die "unknown input line:\n$_" unless defined($bind); - - # Ignore local symbols. - next if ($bind eq "LOCL"); - # Ignore hidden symbols. - next if ($oth eq "H"); - # Ignore undefined symbols. - next if ($shndx eq "UNDEF"); - # Error out for unhandled cases. - if ($bind !~ /^(GLOB|WEAK)/ or $oth ne "D") { - die "unhandled symbol:\n$_"; - } - - # Remember symbol. - $sym_hash{$name}++; - } - close ELFDUMP or die "$elfdump error"; -} else { - open READELF, 'readelf -s -W '.(join ' ',@OBJECTS).'|' or die $!; - # Process each symbol. - while () { - chomp; - - # Ignore empty lines. - next if (/^$/); - - # Ignore object name header. - next if (/^File: .*$/); - - # Ignore table header lines. - next if (/^Symbol table.*contains.*:/); - next if (/Num:.*Value.*Size/); - - # Split table. - (undef, undef, undef, undef, $bind, $vis, $ndx, $name) = split; - - # Error out for unknown input. - die "unknown input line:\n$_" unless defined($bind); - - # Ignore local symbols. - next if ($bind eq "LOCAL"); - # Ignore hidden symbols. - next if ($vis eq "HIDDEN"); - # Ignore undefined symbols. - next if ($ndx eq "UND"); - # Error out for unhandled cases. - if ($bind !~ /^(GLOBAL|WEAK)/ or $vis ne "DEFAULT") { - die "unhandled symbol:\n$_"; - } - - # Remember symbol. - $sym_hash{$name}++; - } - close READELF or die "readelf error"; -} - -########## -# The various types of glob patterns. -# -# A glob pattern that is to be applied to the demangled name: 'cxx'. -# A glob patterns that applies directly to the name in the .o files: 'glob'. -# This pattern is ignored; used for local variables (usually just '*'): 'ign'. - -# The type of the current pattern. -my $glob = 'glob'; - -# We're currently inside `extern "C++"', which Sun ld doesn't understand. -my $in_extern = 0; - -# The c++filt command to use. This *must* be GNU c++filt; the Sun Studio -# c++filt doesn't handle the GNU mangling style. -my $cxxfilt = $ENV{'CXXFILT'} || "c++filt"; - -# The current version name. -my $current_version = ""; - -# Was there any attempt to match a symbol to this version? -my $matches_attempted; - -# The number of versions which matched this symbol. -my $matched_symbols; - -open F,$symvers or die $!; - -# Print information about generating this file -print "# This file was generated by make_sunver.pl. DO NOT EDIT!\n"; -print "# It was generated by:\n"; -printf "# %s %s %s\n", $0, $symvers, (join ' ',@ARGV); -printf "# Omitted archives with corresponding shared libraries: %s\n", - (join ' ', @SHAREDOBJS) if $#SHAREDOBJS >= 0; -print "#\n\n"; - -while () { - # Lines of the form '};' - if (/^([ \t]*)(\}[ \t]*;[ \t]*)$/) { - $glob = 'glob'; - if ($in_extern) { - $in_extern--; - print "$1##$2\n"; - } else { - print; - } - next; - } - - # Lines of the form '} SOME_VERSION_NAME_1.0;' - if (/^[ \t]*\}[ \tA-Z0-9_.a-z]+;[ \t]*$/) { - $glob = 'glob'; - # We tried to match symbols agains this version, but none matched. - # Emit dummy hidden symbol to avoid marking this version WEAK. - if ($matches_attempted && $matched_symbols == 0) { - print " hidden:\n"; - print " .force_WEAK_off_$current_version = DATA S0x0 V0x0;\n"; - } - print; next; - } - - # Comment and blank lines - if (/^[ \t]*\#/) { print; next; } - if (/^[ \t]*$/) { print; next; } - - # Lines of the form '{' - if (/^([ \t]*){$/) { - if ($in_extern) { - print "$1##{\n"; - } else { - print; - } - next; - } - - # Lines of the form 'SOME_VERSION_NAME_1.1 {' - if (/^([A-Z0-9_.]+)[ \t]+{$/) { - # Record version name. - $current_version = $1; - # Reset match attempts, #matched symbols for this version. - $matches_attempted = 0; - $matched_symbols = 0; - print; - next; - } - - # Ignore 'global:' - if (/^[ \t]*global:$/) { print; next; } - - # After 'local:', globs should be ignored, they won't be exported. - if (/^[ \t]*local:$/) { - $glob = 'ign'; - print; - next; - } - - # After 'extern "C++"', globs are C++ patterns - if (/^([ \t]*)(extern \"C\+\+\"[ \t]*)$/) { - $in_extern++; - $glob = 'cxx'; - # Need to comment, Sun ld cannot handle this. - print "$1##$2\n"; next; - } - - # Chomp newline now we're done with passing through the input file. - chomp; - - # Catch globs. Note that '{}' is not allowed in globs by this script, - # so only '*' and '[]' are available. - if (/^([ \t]*)([^ \t;{}#]+);?[ \t]*$/) { - my $ws = $1; - my $ptn = $2; - # Turn the glob into a regex by replacing '*' with '.*', '?' with '.'. - # Keep $ptn so we can still print the original form. - ($pattern = $ptn) =~ s/\*/\.\*/g; - $pattern =~ s/\?/\./g; - - if ($glob eq 'ign') { - # We're in a local: * section; just continue. - print "$_\n"; - next; - } - - # Print the glob commented for human readers. - print "$ws##$ptn ($glob)\n"; - # We tried to match a symbol to this version. - $matches_attempted++; - - if ($glob eq 'glob') { - my %ptn_syms = (); - - # Match ptn against symbols in %sym_hash. - foreach my $sym (keys %sym_hash) { - # Maybe it matches one of the patterns based on the symbol in - # the .o file. - $ptn_syms{$sym}++ if ($sym =~ /^$pattern$/); - } - - foreach my $sym (sort keys(%ptn_syms)) { - $matched_symbols++; - print "$ws$sym;\n"; - } - } elsif ($glob eq 'cxx') { - my %dem_syms = (); - - # Verify that we're actually using GNU c++filt. Other versions - # most likely cannot handle GNU style symbol mangling. - my $cxxout = `$cxxfilt --version 2>&1`; - $cxxout =~ m/GNU/ or die "$0 requires GNU c++filt to function"; - - # Talk to c++filt through a pair of file descriptors. - # Need to start a fresh instance per pattern, otherwise the - # process grows to 500+ MB. - my $pid = open2(*FILTIN, *FILTOUT, $cxxfilt) or die $!; - - # Match ptn against symbols in %sym_hash. - foreach my $sym (keys %sym_hash) { - # No? Well, maybe its demangled form matches one of those - # patterns. - printf FILTOUT "%s\n",$sym; - my $dem = ; - chomp $dem; - $dem_syms{$sym}++ if ($dem =~ /^$pattern$/); - } - - close FILTOUT or die "c++filt error"; - close FILTIN or die "c++filt error"; - # Need to wait for the c++filt process to avoid lots of zombies. - waitpid $pid, 0; - - foreach my $sym (sort keys(%dem_syms)) { - $matched_symbols++; - print "$ws$sym;\n"; - } - } else { - # No? Well, then ignore it. - } - next; - } - # Important sanity check. This script can't handle lots of formats - # that GNU ld can, so be sure to error out if one is seen! - die "strange line `$_'"; -} -close F; diff --git a/deps/libffi/man/Makefile.am b/deps/libffi/man/Makefile.am deleted file mode 100644 index afcbfb69f1d3de..00000000000000 --- a/deps/libffi/man/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this with automake to create Makefile.in - -AUTOMAKE_OPTIONS=foreign - -EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3 - -man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3 - diff --git a/deps/libffi/man/ffi.3 b/deps/libffi/man/ffi.3 deleted file mode 100644 index 1f1d3031c99772..00000000000000 --- a/deps/libffi/man/ffi.3 +++ /dev/null @@ -1,41 +0,0 @@ -.Dd February 15, 2008 -.Dt FFI 3 -.Sh NAME -.Nm FFI -.Nd Foreign Function Interface -.Sh LIBRARY -libffi, -lffi -.Sh SYNOPSIS -.In ffi.h -.Ft ffi_status -.Fo ffi_prep_cif -.Fa "ffi_cif *cif" -.Fa "ffi_abi abi" -.Fa "unsigned int nargs" -.Fa "ffi_type *rtype" -.Fa "ffi_type **atypes" -.Fc -.Ft void -.Fo ffi_prep_cif_var -.Fa "ffi_cif *cif" -.Fa "ffi_abi abi" -.Fa "unsigned int nfixedargs" -.Fa "unsigned int ntotalargs" -.Fa "ffi_type *rtype" -.Fa "ffi_type **atypes" -.Fc -.Ft void -.Fo ffi_call -.Fa "ffi_cif *cif" -.Fa "void (*fn)(void)" -.Fa "void *rvalue" -.Fa "void **avalue" -.Fc -.Sh DESCRIPTION -The foreign function interface provides a mechanism by which a function can -generate a call to another function at runtime without requiring knowledge of -the called function's interface at compile time. -.Sh SEE ALSO -.Xr ffi_prep_cif 3 , -.Xr ffi_prep_cif_var 3 , -.Xr ffi_call 3 diff --git a/deps/libffi/man/ffi_call.3 b/deps/libffi/man/ffi_call.3 deleted file mode 100644 index 5351513f90d86e..00000000000000 --- a/deps/libffi/man/ffi_call.3 +++ /dev/null @@ -1,103 +0,0 @@ -.Dd February 15, 2008 -.Dt ffi_call 3 -.Sh NAME -.Nm ffi_call -.Nd Invoke a foreign function. -.Sh SYNOPSIS -.In ffi.h -.Ft void -.Fo ffi_call -.Fa "ffi_cif *cif" -.Fa "void (*fn)(void)" -.Fa "void *rvalue" -.Fa "void **avalue" -.Fc -.Sh DESCRIPTION -The -.Nm ffi_call -function provides a simple mechanism for invoking a function without -requiring knowledge of the function's interface at compile time. -.Fa fn -is called with the values retrieved from the pointers in the -.Fa avalue -array. The return value from -.Fa fn -is placed in storage pointed to by -.Fa rvalue . -.Fa cif -contains information describing the data types, sizes and alignments of the -arguments to and return value from -.Fa fn , -and must be initialized with -.Nm ffi_prep_cif -before it is used with -.Nm ffi_call . -.Pp -.Fa rvalue -must point to storage that is sizeof(ffi_arg) or larger for non-floating point -types. For smaller-sized return value types, the -.Nm ffi_arg -or -.Nm ffi_sarg -integral type must be used to hold -the return value. -.Sh EXAMPLES -.Bd -literal -#include -#include - -unsigned char -foo(unsigned int, float); - -int -main(int argc, const char **argv) -{ - ffi_cif cif; - ffi_type *arg_types[2]; - void *arg_values[2]; - ffi_status status; - - // Because the return value from foo() is smaller than sizeof(long), it - // must be passed as ffi_arg or ffi_sarg. - ffi_arg result; - - // Specify the data type of each argument. Available types are defined - // in . - arg_types[0] = &ffi_type_uint; - arg_types[1] = &ffi_type_float; - - // Prepare the ffi_cif structure. - if ((status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, - 2, &ffi_type_uint8, arg_types)) != FFI_OK) - { - // Handle the ffi_status error. - } - - // Specify the values of each argument. - unsigned int arg1 = 42; - float arg2 = 5.1; - - arg_values[0] = &arg1; - arg_values[1] = &arg2; - - // Invoke the function. - ffi_call(&cif, FFI_FN(foo), &result, arg_values); - - // The ffi_arg 'result' now contains the unsigned char returned from foo(), - // which can be accessed by a typecast. - printf("result is %hhu", (unsigned char)result); - - return 0; -} - -// The target function. -unsigned char -foo(unsigned int x, float y) -{ - unsigned char result = x - y; - return result; -} -.Ed -.Sh SEE ALSO -.Xr ffi 3 , -.Xr ffi_prep_cif 3 diff --git a/deps/libffi/man/ffi_prep_cif.3 b/deps/libffi/man/ffi_prep_cif.3 deleted file mode 100644 index ab2be8adc17a19..00000000000000 --- a/deps/libffi/man/ffi_prep_cif.3 +++ /dev/null @@ -1,68 +0,0 @@ -.Dd February 15, 2008 -.Dt ffi_prep_cif 3 -.Sh NAME -.Nm ffi_prep_cif -.Nd Prepare a -.Nm ffi_cif -structure for use with -.Nm ffi_call -. -.Sh SYNOPSIS -.In ffi.h -.Ft ffi_status -.Fo ffi_prep_cif -.Fa "ffi_cif *cif" -.Fa "ffi_abi abi" -.Fa "unsigned int nargs" -.Fa "ffi_type *rtype" -.Fa "ffi_type **atypes" -.Fc -.Sh DESCRIPTION -The -.Nm ffi_prep_cif -function prepares a -.Nm ffi_cif -structure for use with -.Nm ffi_call -. -.Fa abi -specifies a set of calling conventions to use. -.Fa atypes -is an array of -.Fa nargs -pointers to -.Nm ffi_type -structs that describe the data type, size and alignment of each argument. -.Fa rtype -points to an -.Nm ffi_type -that describes the data type, size and alignment of the -return value. Note that to call a variadic function -.Nm ffi_prep_cif_var -must be used instead. -.Sh RETURN VALUES -Upon successful completion, -.Nm ffi_prep_cif -returns -.Nm FFI_OK . -It will return -.Nm FFI_BAD_TYPEDEF -if -.Fa cif -is -.Nm NULL -or -.Fa atypes -or -.Fa rtype -is malformed. If -.Fa abi -does not refer to a valid ABI, -.Nm FFI_BAD_ABI -will be returned. Available ABIs are -defined in -.Nm . -.Sh SEE ALSO -.Xr ffi 3 , -.Xr ffi_call 3 , -.Xr ffi_prep_cif_var 3 diff --git a/deps/libffi/man/ffi_prep_cif_var.3 b/deps/libffi/man/ffi_prep_cif_var.3 deleted file mode 100644 index 7e19d0b070f17f..00000000000000 --- a/deps/libffi/man/ffi_prep_cif_var.3 +++ /dev/null @@ -1,73 +0,0 @@ -.Dd January 25, 2011 -.Dt ffi_prep_cif_var 3 -.Sh NAME -.Nm ffi_prep_cif_var -.Nd Prepare a -.Nm ffi_cif -structure for use with -.Nm ffi_call -for variadic functions. -.Sh SYNOPSIS -.In ffi.h -.Ft ffi_status -.Fo ffi_prep_cif_var -.Fa "ffi_cif *cif" -.Fa "ffi_abi abi" -.Fa "unsigned int nfixedargs" -.Fa "unsigned int ntotalargs" -.Fa "ffi_type *rtype" -.Fa "ffi_type **atypes" -.Fc -.Sh DESCRIPTION -The -.Nm ffi_prep_cif_var -function prepares a -.Nm ffi_cif -structure for use with -.Nm ffi_call -for variadic functions. -.Fa abi -specifies a set of calling conventions to use. -.Fa atypes -is an array of -.Fa ntotalargs -pointers to -.Nm ffi_type -structs that describe the data type, size and alignment of each argument. -.Fa rtype -points to an -.Nm ffi_type -that describes the data type, size and alignment of the -return value. -.Fa nfixedargs -must contain the number of fixed (non-variadic) arguments. -Note that to call a non-variadic function -.Nm ffi_prep_cif -must be used. -.Sh RETURN VALUES -Upon successful completion, -.Nm ffi_prep_cif_var -returns -.Nm FFI_OK . -It will return -.Nm FFI_BAD_TYPEDEF -if -.Fa cif -is -.Nm NULL -or -.Fa atypes -or -.Fa rtype -is malformed. If -.Fa abi -does not refer to a valid ABI, -.Nm FFI_BAD_ABI -will be returned. Available ABIs are -defined in -.Nm -. -.Sh SEE ALSO -.Xr ffi 3 , -.Xr ffi_call 3 , -.Xr ffi_prep_cif 3 diff --git a/deps/libffi/msvc_build/aarch64/aarch64_include/ffi.h b/deps/libffi/msvc_build/aarch64/aarch64_include/ffi.h deleted file mode 100644 index 2b0b693998a41c..00000000000000 --- a/deps/libffi/msvc_build/aarch64/aarch64_include/ffi.h +++ /dev/null @@ -1,511 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - libffi 3.3-rc0 - Copyright (c) 2011, 2014 Anthony Green - - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. - - 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. - - ----------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------- - Most of the API is documented in doc/libffi.texi. - - The raw API is designed to bypass some of the argument packing and - unpacking on architectures for which it can be avoided. Routines - are provided to emulate the raw API if the underlying platform - doesn't allow faster implementation. - - More details on the raw API can be found in: - - http://gcc.gnu.org/ml/java/1999-q3/msg00138.html - - and - - http://gcc.gnu.org/ml/java/1999-q3/msg00174.html - -------------------------------------------------------------------- */ - -#ifndef LIBFFI_H -#define LIBFFI_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Specify which architecture libffi is configured for. */ -#ifndef AARCH64 -#define AARCH64 -#endif - -/* ---- System configuration information --------------------------------- */ - -#include - -#ifndef LIBFFI_ASM - -#if defined(_MSC_VER) && !defined(__clang__) -#define __attribute__(X) -#endif - -#include -#include - -/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). - But we can find it either under the correct ANSI name, or under GNU - C's internal name. */ - -#define FFI_64_BIT_MAX 9223372036854775807 - -#ifdef LONG_LONG_MAX -# define FFI_LONG_LONG_MAX LONG_LONG_MAX -#else -# ifdef LLONG_MAX -# define FFI_LONG_LONG_MAX LLONG_MAX -# ifdef _AIX52 /* or newer has C99 LLONG_MAX */ -# undef FFI_64_BIT_MAX -# define FFI_64_BIT_MAX 9223372036854775807LL -# endif /* _AIX52 or newer */ -# else -# ifdef __GNUC__ -# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ -# endif -# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */ -# ifndef __PPC64__ -# if defined (__IBMC__) || defined (__IBMCPP__) -# define FFI_LONG_LONG_MAX LONGLONG_MAX -# endif -# endif /* __PPC64__ */ -# undef FFI_64_BIT_MAX -# define FFI_64_BIT_MAX 9223372036854775807LL -# endif -# endif -#endif - -/* The closure code assumes that this works on pointers, i.e. a size_t - can hold a pointer. */ - -typedef struct _ffi_type -{ - size_t size; - unsigned short alignment; - unsigned short type; - struct _ffi_type **elements; -} ffi_type; - -/* Need minimal decorations for DLLs to work on Windows. GCC has - autoimport and autoexport. Always mark externally visible symbols - as dllimport for MSVC clients, even if it means an extra indirection - when using the static version of the library. - Besides, as a workaround, they can define FFI_BUILDING if they - *know* they are going to link with the static library. */ -#if defined _MSC_VER -# if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */ -# define FFI_API __declspec(dllexport) -# elif !defined FFI_BUILDING /* Importing libffi.DLL */ -# define FFI_API __declspec(dllimport) -# else /* Building/linking static library */ -# define FFI_API -# endif -#else -# define FFI_API -#endif - -/* The externally visible type declarations also need the MSVC DLL - decorations, or they will not be exported from the object file. */ -#if defined LIBFFI_HIDE_BASIC_TYPES -# define FFI_EXTERN FFI_API -#else -# define FFI_EXTERN extern FFI_API -#endif - -#ifndef LIBFFI_HIDE_BASIC_TYPES -#if SCHAR_MAX == 127 -# define ffi_type_uchar ffi_type_uint8 -# define ffi_type_schar ffi_type_sint8 -#else - #error "char size not supported" -#endif - -#if SHRT_MAX == 32767 -# define ffi_type_ushort ffi_type_uint16 -# define ffi_type_sshort ffi_type_sint16 -#elif SHRT_MAX == 2147483647 -# define ffi_type_ushort ffi_type_uint32 -# define ffi_type_sshort ffi_type_sint32 -#else - #error "short size not supported" -#endif - -#if INT_MAX == 32767 -# define ffi_type_uint ffi_type_uint16 -# define ffi_type_sint ffi_type_sint16 -#elif INT_MAX == 2147483647 -# define ffi_type_uint ffi_type_uint32 -# define ffi_type_sint ffi_type_sint32 -#elif INT_MAX == 9223372036854775807 -# define ffi_type_uint ffi_type_uint64 -# define ffi_type_sint ffi_type_sint64 -#else - #error "int size not supported" -#endif - -#if LONG_MAX == 2147483647 -# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX - #error "no 64-bit data type supported" -# endif -#elif LONG_MAX != FFI_64_BIT_MAX - #error "long size not supported" -#endif - -#if LONG_MAX == 2147483647 -# define ffi_type_ulong ffi_type_uint32 -# define ffi_type_slong ffi_type_sint32 -#elif LONG_MAX == FFI_64_BIT_MAX -# define ffi_type_ulong ffi_type_uint64 -# define ffi_type_slong ffi_type_sint64 -#else - #error "long size not supported" -#endif - -/* These are defined in types.c. */ -FFI_EXTERN ffi_type ffi_type_void; -FFI_EXTERN ffi_type ffi_type_uint8; -FFI_EXTERN ffi_type ffi_type_sint8; -FFI_EXTERN ffi_type ffi_type_uint16; -FFI_EXTERN ffi_type ffi_type_sint16; -FFI_EXTERN ffi_type ffi_type_uint32; -FFI_EXTERN ffi_type ffi_type_sint32; -FFI_EXTERN ffi_type ffi_type_uint64; -FFI_EXTERN ffi_type ffi_type_sint64; -FFI_EXTERN ffi_type ffi_type_float; -FFI_EXTERN ffi_type ffi_type_double; -FFI_EXTERN ffi_type ffi_type_pointer; - -#ifndef _M_ARM64 -FFI_EXTERN ffi_type ffi_type_longdouble; -#else -#define ffi_type_longdouble ffi_type_double -#endif - -#ifdef FFI_TARGET_HAS_COMPLEX_TYPE -FFI_EXTERN ffi_type ffi_type_complex_float; -FFI_EXTERN ffi_type ffi_type_complex_double; -#if 1 -FFI_EXTERN ffi_type ffi_type_complex_longdouble; -#else -#define ffi_type_complex_longdouble ffi_type_complex_double -#endif -#endif -#endif /* LIBFFI_HIDE_BASIC_TYPES */ - -typedef enum { - FFI_OK = 0, - FFI_BAD_TYPEDEF, - FFI_BAD_ABI -} ffi_status; - -typedef struct { - ffi_abi abi; - unsigned nargs; - ffi_type **arg_types; - ffi_type *rtype; - unsigned bytes; - unsigned flags; -#ifdef FFI_EXTRA_CIF_FIELDS - FFI_EXTRA_CIF_FIELDS; -#endif -} ffi_cif; - -/* ---- Definitions for the raw API -------------------------------------- */ - -#ifndef FFI_SIZEOF_ARG -# if LONG_MAX == 2147483647 -# define FFI_SIZEOF_ARG 4 -# elif LONG_MAX == FFI_64_BIT_MAX -# define FFI_SIZEOF_ARG 8 -# endif -#endif - -#ifndef FFI_SIZEOF_JAVA_RAW -# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG -#endif - -typedef union { - ffi_sarg sint; - ffi_arg uint; - float flt; - char data[FFI_SIZEOF_ARG]; - void* ptr; -} ffi_raw; - -#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8 -/* This is a special case for mips64/n32 ABI (and perhaps others) where - sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */ -typedef union { - signed int sint; - unsigned int uint; - float flt; - char data[FFI_SIZEOF_JAVA_RAW]; - void* ptr; -} ffi_java_raw; -#else -typedef ffi_raw ffi_java_raw; -#endif - - -FFI_API -void ffi_raw_call (ffi_cif *cif, - void (*fn)(void), - void *rvalue, - ffi_raw *avalue); - -FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); -FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); -FFI_API size_t ffi_raw_size (ffi_cif *cif); - -/* This is analogous to the raw API, except it uses Java parameter - packing, even on 64-bit machines. I.e. on 64-bit machines longs - and doubles are followed by an empty 64-bit word. */ - -FFI_API -void ffi_java_raw_call (ffi_cif *cif, - void (*fn)(void), - void *rvalue, - ffi_java_raw *avalue); - -FFI_API -void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw); -FFI_API -void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args); -FFI_API -size_t ffi_java_raw_size (ffi_cif *cif); - -/* ---- Definitions for closures ----------------------------------------- */ - -#if FFI_CLOSURES - -#ifdef _MSC_VER -__declspec(align(8)) -#endif -typedef struct { -#if 0 - void *trampoline_table; - void *trampoline_table_entry; -#else - char tramp[FFI_TRAMPOLINE_SIZE]; -#endif - ffi_cif *cif; - void (*fun)(ffi_cif*,void*,void**,void*); - void *user_data; -} ffi_closure -#ifdef __GNUC__ - __attribute__((aligned (8))) -#endif - ; - -#ifndef __GNUC__ -# ifdef __sgi -# pragma pack 0 -# endif -#endif - -FFI_API void *ffi_closure_alloc (size_t size, void **code); -FFI_API void ffi_closure_free (void *); - -FFI_API ffi_status -ffi_prep_closure (ffi_closure*, - ffi_cif *, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data) -#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405) - __attribute__((deprecated ("use ffi_prep_closure_loc instead"))) -#elif defined(__GNUC__) && __GNUC__ >= 3 - __attribute__((deprecated)) -#endif - ; - -FFI_API ffi_status -ffi_prep_closure_loc (ffi_closure*, - ffi_cif *, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void*codeloc); - -#ifdef __sgi -# pragma pack 8 -#endif -typedef struct { -#if 0 - void *trampoline_table; - void *trampoline_table_entry; -#else - char tramp[FFI_TRAMPOLINE_SIZE]; -#endif - ffi_cif *cif; - -#if !FFI_NATIVE_RAW_API - - /* If this is enabled, then a raw closure has the same layout - as a regular closure. We use this to install an intermediate - handler to do the translation, void** -> ffi_raw*. */ - - void (*translate_args)(ffi_cif*,void*,void**,void*); - void *this_closure; - -#endif - - void (*fun)(ffi_cif*,void*,ffi_raw*,void*); - void *user_data; - -} ffi_raw_closure; - -typedef struct { -#if 0 - void *trampoline_table; - void *trampoline_table_entry; -#else - char tramp[FFI_TRAMPOLINE_SIZE]; -#endif - - ffi_cif *cif; - -#if !FFI_NATIVE_RAW_API - - /* If this is enabled, then a raw closure has the same layout - as a regular closure. We use this to install an intermediate - handler to do the translation, void** -> ffi_raw*. */ - - void (*translate_args)(ffi_cif*,void*,void**,void*); - void *this_closure; - -#endif - - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*); - void *user_data; - -} ffi_java_raw_closure; - -FFI_API ffi_status -ffi_prep_raw_closure (ffi_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data); - -FFI_API ffi_status -ffi_prep_raw_closure_loc (ffi_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data, - void *codeloc); - -FFI_API ffi_status -ffi_prep_java_raw_closure (ffi_java_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), - void *user_data); - -FFI_API ffi_status -ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), - void *user_data, - void *codeloc); - -#endif /* FFI_CLOSURES */ - -#ifdef FFI_GO_CLOSURES - -typedef struct { - void *tramp; - ffi_cif *cif; - void (*fun)(ffi_cif*,void*,void**,void*); -} ffi_go_closure; - -FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *, - void (*fun)(ffi_cif*,void*,void**,void*)); - -FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure); - -#endif /* FFI_GO_CLOSURES */ - -/* ---- Public interface definition -------------------------------------- */ - -FFI_API -ffi_status ffi_prep_cif(ffi_cif *cif, - ffi_abi abi, - unsigned int nargs, - ffi_type *rtype, - ffi_type **atypes); - -FFI_API -ffi_status ffi_prep_cif_var(ffi_cif *cif, - ffi_abi abi, - unsigned int nfixedargs, - unsigned int ntotalargs, - ffi_type *rtype, - ffi_type **atypes); - -FFI_API -void ffi_call(ffi_cif *cif, - void (*fn)(void), - void *rvalue, - void **avalue); - -FFI_API -ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, - size_t *offsets); - -/* Useful for eliminating compiler warnings. */ -#define FFI_FN(f) ((void (*)(void))f) - -/* ---- Definitions shared with assembly code ---------------------------- */ - -#endif - -/* If these change, update src/mips/ffitarget.h. */ -#define FFI_TYPE_VOID 0 -#define FFI_TYPE_INT 1 -#define FFI_TYPE_FLOAT 2 -#define FFI_TYPE_DOUBLE 3 -#ifndef _M_ARM64 -#define FFI_TYPE_LONGDOUBLE 4 -#else -#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE -#endif -#define FFI_TYPE_UINT8 5 -#define FFI_TYPE_SINT8 6 -#define FFI_TYPE_UINT16 7 -#define FFI_TYPE_SINT16 8 -#define FFI_TYPE_UINT32 9 -#define FFI_TYPE_SINT32 10 -#define FFI_TYPE_UINT64 11 -#define FFI_TYPE_SINT64 12 -#define FFI_TYPE_STRUCT 13 -#define FFI_TYPE_POINTER 14 -#define FFI_TYPE_COMPLEX 15 -/* This should always refer to the last type code (for sanity checks). */ -#define FFI_TYPE_LAST FFI_TYPE_COMPLEX - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/deps/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h b/deps/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h deleted file mode 100644 index b3d89b03ec9af1..00000000000000 --- a/deps/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +++ /dev/null @@ -1,219 +0,0 @@ -/* fficonfig.h. Generated from fficonfig.h.in by configure. */ -/* fficonfig.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -/* #undef AC_APPLE_UNIVERSAL_BUILD */ - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -/* #undef CRAY_STACKSEG_END */ - -/* Define to 1 if using `alloca.c'. */ -/* #undef C_ALLOCA */ - -/* Define to the flags needed for the .section .eh_frame directive. */ -#define EH_FRAME_FLAGS "a" - -/* Define this if you want extra debugging. */ -/* #undef FFI_DEBUG */ - -/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */ -/* #undef FFI_EXEC_TRAMPOLINE_TABLE */ - -/* Define this if you want to enable pax emulated trampolines */ -/* #undef FFI_MMAP_EXEC_EMUTRAMP_PAX */ - -/* Cannot use malloc on this target, so, we revert to alternative means */ -/* #undef FFI_MMAP_EXEC_WRIT */ - -/* Define this if you do not want support for the raw API. */ -/* #undef FFI_NO_RAW_API */ - -/* Define this if you do not want support for aggregate types. */ -/* #undef FFI_NO_STRUCTS */ - -/* Define to 1 if you have `alloca', as a function or macro. */ -#define HAVE_ALLOCA 1 - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -/*#define HAVE_ALLOCA_H 1 */ - -/* Define if your assembler supports .cfi_* directives. */ -#define HAVE_AS_CFI_PSEUDO_OP 1 - -/* Define if your assembler supports .register. */ -/* #undef HAVE_AS_REGISTER_PSEUDO_OP */ - -/* Define if the compiler uses zarch features. */ -/* #undef HAVE_AS_S390_ZARCH */ - -/* Define if your assembler and linker support unaligned PC relative relocs. - */ -/* #undef HAVE_AS_SPARC_UA_PCREL */ - -/* Define if your assembler supports unwind section type. */ -/* #undef HAVE_AS_X86_64_UNWIND_SECTION_TYPE */ - -/* Define if your assembler supports PC relative relocs. */ -/* #undef HAVE_AS_X86_PCREL */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define if __attribute__((visibility("hidden"))) is supported. */ -#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define if you have the long double type and it is bigger than a double */ -#define HAVE_LONG_DOUBLE 1 - -/* Define if you support more than one size of the long double type */ -/* #undef HAVE_LONG_DOUBLE_VARIANT */ - -/* Define to 1 if you have the `memcpy' function. */ -#define HAVE_MEMCPY 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `mkostemp' function. */ -#define HAVE_MKOSTEMP 1 - -/* Define to 1 if you have the `mmap' function. */ -#define HAVE_MMAP 1 - -/* Define if mmap with MAP_ANON(YMOUS) works. */ -#define HAVE_MMAP_ANON 1 - -/* Define if mmap of /dev/zero works. */ -#define HAVE_MMAP_DEV_ZERO 1 - -/* Define if read-only mmap of a plain file works. */ -#define HAVE_MMAP_FILE 1 - -/* Define if .eh_frame sections should be read-only. */ -#define HAVE_RO_EH_FRAME 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -//#define HAVE_STDLIB_H 0 -#define LACKS_STDLIB_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_MMAN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if GNU symbol versioning is used for libatomic. */ -#define LIBFFI_GNU_SYMBOL_VERSIONING 1 - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -/* #undef NO_MINUS_C_MINUS_O */ - -/* Name of package */ -#define PACKAGE "libffi" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "http://github.com/libffi/libffi/issues" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "libffi" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libffi 3.3-rc0" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "libffi" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "3.3-rc0" - -/* The size of `double', as computed by sizeof. */ -#define SIZEOF_DOUBLE 8 - -/* The size of `long double', as computed by sizeof. */ -#define SIZEOF_LONG_DOUBLE 8 - -/* The size of `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T 8 - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -/* #undef STACK_DIRECTION */ - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if symbols are underscored. */ -/* #undef SYMBOL_UNDERSCORE */ - -/* Define this if you are using Purify and want to suppress spurious messages. - */ -/* #undef USING_PURIFY */ - -/* Version number of package */ -#define VERSION "3.3-rc0" - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ -# endif -#endif - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ - - -#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE -#ifdef LIBFFI_ASM -#ifdef __APPLE__ -#define FFI_HIDDEN(name) .private_extern name -#else -#define FFI_HIDDEN(name) .hidden name -#endif -#else -#define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) -#endif -#else -#ifdef LIBFFI_ASM -#define FFI_HIDDEN(name) -#else -#define FFI_HIDDEN -#endif -#endif - diff --git a/deps/libffi/msvcc.sh b/deps/libffi/msvcc.sh deleted file mode 100755 index 301e2fbd6840fe..00000000000000 --- a/deps/libffi/msvcc.sh +++ /dev/null @@ -1,353 +0,0 @@ -#!/bin/sh - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (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.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the MSVC wrappificator. -# -# The Initial Developer of the Original Code is -# Timothy Wall . -# Portions created by the Initial Developer are Copyright (C) 2009 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Daniel Witte -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -# -# GCC-compatible wrapper for cl.exe and ml.exe. Arguments are given in GCC -# format and translated into something sensible for cl or ml. -# - -args_orig=$@ -args="-nologo -W3" -linkargs= -static_crt= -debug_crt= -cl="cl" -ml="ml" -safeseh="-safeseh" -output= -libpaths= -libversion=8 -verbose= - -while [ $# -gt 0 ] -do - case $1 - in - --verbose) - verbose=1 - shift 1 - ;; - --version) - args="-help" - shift 1 - ;; - -fexceptions) - # Don't enable exceptions for now. - #args="$args -EHac" - shift 1 - ;; - -m32) - shift 1 - ;; - -m64) - ml="ml64" # "$MSVC/x86_amd64/ml64" - safeseh= - shift 1 - ;; - -marm) - ml='armasm' - safeseh= - shift 1 - ;; - -marm64) - ml='armasm64' - safeseh= - shift 1 - ;; - -clang-cl) - cl="clang-cl" - shift 1 - ;; - -O0) - args="$args -Od" - shift 1 - ;; - -O*) - # Runtime error checks (enabled by setting -RTC1 in the -DFFI_DEBUG - # case below) are not compatible with optimization flags and will - # cause the build to fail. Therefore, drop the optimization flag if - # -DFFI_DEBUG is also set. - case $args_orig in - *-DFFI_DEBUG*) - args="$args" - ;; - *) - # The ax_cc_maxopt.m4 macro from the upstream autoconf-archive - # project doesn't support MSVC and therefore ends up trying to - # use -O3. Use the equivalent "max optimization" flag for MSVC - # instead of erroring out. - case $1 in - -O3) - args="$args -O2" - ;; - *) - args="$args $1" - ;; - esac - opt="true" - ;; - esac - shift 1 - ;; - -g) - # Enable debug symbol generation. - args="$args -Zi" - shift 1 - ;; - -DFFI_DEBUG) - # Enable runtime error checks. - args="$args -RTC1" - defines="$defines $1" - shift 1 - ;; - -DUSE_STATIC_RTL) - # Link against static CRT. - static_crt=1 - shift 1 - ;; - -DUSE_DEBUG_RTL) - # Link against debug CRT. - debug_crt=1 - shift 1 - ;; - -c) - args="$args -c" - args="$(echo $args | sed 's%/Fe%/Fo%g')" - single="-c" - shift 1 - ;; - -D*=*) - name="$(echo $1|sed 's/-D\([^=][^=]*\)=.*/\1/g')" - value="$(echo $1|sed 's/-D[^=][^=]*=//g')" - args="$args -D${name}='$value'" - defines="$defines -D${name}='$value'" - shift 1 - ;; - -D*) - args="$args $1" - defines="$defines $1" - shift 1 - ;; - -I) - p=$(cygpath -ma "$2") - args="$args -I\"$p\"" - includes="$includes -I\"$p\"" - shift 2 - ;; - -I*) - p=$(cygpath -ma "${1#-I}") - args="$args -I\"$p\"" - includes="$includes -I\"$p\"" - shift 1 - ;; - -L) - p=$(cygpath -ma $2) - linkargs="$linkargs -LIBPATH:$p" - shift 2 - ;; - -L*) - p=$(cygpath -ma ${1#-L}) - linkargs="$linkargs -LIBPATH:$p" - shift 1 - ;; - -link) - # add next argument verbatim to linker args - linkargs="$linkargs $2" - shift 2 - ;; - -l*) - case $1 - in - -lffi) - linkargs="$linkargs lib${1#-l}-${libversion}.lib" - ;; - *) - # ignore other libraries like -lm, hope they are - # covered by MSVCRT - # linkargs="$linkargs ${1#-l}.lib" - ;; - esac - shift 1 - ;; - -W|-Wextra) - # TODO map extra warnings - shift 1 - ;; - -Wall) - # -Wall on MSVC is overzealous, and we already build with -W3. Nothing - # to do here. - shift 1 - ;; - -pedantic) - # libffi tests -pedantic with -Wall, so drop it also. - shift 1 - ;; - -warn) - # ignore -warn all from libtool as well. - if test "$2" = "all"; then - shift 2 - else - args="$args -warn" - shift 1 - fi - ;; - -Werror) - args="$args -WX" - shift 1 - ;; - -W*) - # TODO map specific warnings - shift 1 - ;; - -S) - args="$args -FAs" - shift 1 - ;; - -o) - outdir="$(dirname $2)" - base="$(basename $2|sed 's/\.[^.]*//g')" - if [ -n "$single" ]; then - output="-Fo$2" - else - output="-Fe$2" - fi - armasm_output="-o $2" - if [ -n "$assembly" ]; then - args="$args $output" - else - args="$args $output -Fd$outdir/$base -Fp$outdir/$base -Fa$outdir/$base" - fi - shift 2 - ;; - *.S) - src="$(cygpath -ma $1)" - assembly="true" - shift 1 - ;; - *.c) - args="$args $(cygpath -ma $1)" - shift 1 - ;; - *) - # Assume it's an MSVC argument, and pass it through. - args="$args $1" - shift 1 - ;; - esac -done - -if [ -n "$linkargs" ]; then - - # If -Zi is specified, certain optimizations are implicitly disabled - # by MSVC. Add back those optimizations if this is an optimized build. - # NOTE: These arguments must come after all others. - if [ -n "$opt" ]; then - linkargs="$linkargs -OPT:REF -OPT:ICF -INCREMENTAL:NO" - fi - - args="$args -link $linkargs" -fi - -if [ -n "$static_crt" ]; then - md=-MT -else - md=-MD -fi - -if [ -n "$debug_crt" ]; then - md="${md}d" -fi - -if [ -n "$assembly" ]; then - if [ -z "$outdir" ]; then - outdir="." - fi - ppsrc="$outdir/$(basename $src|sed 's/.S$/.asm/g')" - - if [ $ml = "armasm" ]; then - defines="$defines -D_M_ARM" - fi - - if [ $ml = "armasm64" ]; then - defines="$defines -D_M_ARM64" - fi - - if test -n "$verbose"; then - echo "$cl -nologo -EP $includes $defines $src > $ppsrc" - fi - - eval "\"$cl\" -nologo -EP $includes $defines $src" > $ppsrc || exit $? - output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')" - if [ $ml = "armasm" ]; then - args="-nologo -g -oldit $armasm_output $ppsrc -errorReport:prompt" - elif [ $ml = "armasm64" ]; then - args="-nologo -g $armasm_output $ppsrc -errorReport:prompt" - else - args="-nologo $safeseh $single $output $ppsrc" - fi - - if test -n "$verbose"; then - echo "$ml $args" - fi - - eval "\"$ml\" $args" - result=$? - - # required to fix ml64 broken output? - #mv *.obj $outdir -else - args="$md $args" - - if test -n "$verbose"; then - echo "$cl $args" - fi - # Return an error code of 1 if an invalid command line parameter is passed - # instead of just ignoring it. Any output that is not a warning or an - # error is filtered so this command behaves more like gcc. cl.exe prints - # the name of the compiled file otherwise, which breaks the dejagnu checks - # for excess warnings and errors. - eval "(\"$cl\" $args 2>&1 1>&3 | \ - awk '{print \$0} /D9002/ {error=1} END{exit error}' >&2) 3>&1 | \ - awk '/warning|error/'" - result=$? -fi - -exit $result - -# vim: noai:ts=4:sw=4 diff --git a/deps/libffi/preprocess_asm.py b/deps/libffi/preprocess_asm.py deleted file mode 100644 index c5a219e2b68610..00000000000000 --- a/deps/libffi/preprocess_asm.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import os -from pathlib import Path -import re -import shlex -import shutil -import subprocess -import sys - - -def split_command(value): - if not value: - return None - value = value.strip() - if not value: - return None - return shlex.split(value, posix=(os.name != 'nt')) - - -def find_compiler(): - for var in ('CC', 'CXX'): - command = split_command(os.environ.get(var)) - if command and shutil.which(command[0]): - return command - - for name in ('cl.exe', 'cl', 'clang-cl.exe', 'clang-cl', 'cc', 'clang', 'gcc'): - path = shutil.which(name) - if path: - return [path] - - raise RuntimeError('Unable to locate a compiler for preprocessing assembly') - - -def find_armasm64(): - """Find armasm64.exe in the PATH or common Visual Studio locations.""" - # First check PATH - path = shutil.which('armasm64.exe') - if path: - return path - - # Check common VS locations via environment - vc_install_dir = os.environ.get('VCINSTALLDIR', '') - if vc_install_dir: - candidate = os.path.join(vc_install_dir, 'bin', 'Hostx64', 'arm64', 'armasm64.exe') - if os.path.exists(candidate): - return candidate - candidate = os.path.join(vc_install_dir, 'bin', 'Hostarm64', 'arm64', 'armasm64.exe') - if os.path.exists(candidate): - return candidate - - raise RuntimeError('Unable to locate armasm64.exe') - - -def normalize_path(value): - return str(value).strip().strip('"') - - -def unique_paths(paths): - seen = set() - result = [] - for path in paths: - if path in seen: - continue - seen.add(path) - result.append(path) - return result - - -def preprocess(args): - compiler = find_compiler() - input_path = normalize_path(args.input) - output = Path(normalize_path(args.output)) - include_dirs = [normalize_path(include_dir) for include_dir in args.include_dir] - include_dirs.append(str(output.parent)) - include_dirs = unique_paths(include_dirs) - output.parent.mkdir(parents=True, exist_ok=True) - - if os.name == 'nt' and Path(compiler[0]).name.lower() in ('cl.exe', 'cl', 'clang-cl.exe', 'clang-cl'): - command = compiler + ['/nologo', '/EP', '/TC'] - command += [f'/I{include_dir}' for include_dir in include_dirs] - command += [f'/D{define}' for define in args.define] - command += [input_path] - else: - command = compiler + ['-E', '-P', '-x', 'c'] - command += [f'-I{include_dir}' for include_dir in include_dirs] - command += [f'-D{define}' for define in args.define] - command += [input_path] - - result = subprocess.run(command, capture_output=True, text=True) - if result.returncode != 0: - sys.stderr.write(result.stderr) - raise RuntimeError(f'Preprocessing failed: {" ".join(command)}') - - # Strip all preprocessor directives that assemblers can't handle - # (e.g., armasm64.exe doesn't accept any # directives) - # Remove lines starting with # (preprocessor output like #line, # 1 "file", etc.) - lines = result.stdout.splitlines(keepends=True) - cleaned_lines = [line for line in lines if not line.lstrip().startswith('#')] - cleaned = ''.join(cleaned_lines) - - output.write_text(cleaned, encoding='utf-8') - - # If --assemble is specified, also run the assembler to produce an object file - if args.assemble: - assemble_output = Path(normalize_path(args.assemble)) - assemble_output.parent.mkdir(parents=True, exist_ok=True) - - armasm64 = find_armasm64() - asm_command = [armasm64, '-nologo', '-g', str(output), '-o', str(assemble_output)] - - asm_result = subprocess.run(asm_command, capture_output=True, text=True) - if asm_result.returncode != 0: - sys.stderr.write(asm_result.stderr) - sys.stderr.write(asm_result.stdout) - raise RuntimeError(f'Assembly failed: {" ".join(asm_command)}') - - -def main(argv=None): - parser = argparse.ArgumentParser(description='Preprocess libffi assembly source') - parser.add_argument('--input', required=True) - parser.add_argument('--output', required=True) - parser.add_argument('--include-dir', action='append', default=[]) - parser.add_argument('--define', action='append', default=[]) - parser.add_argument('--assemble', help='Also assemble the output to this object file') - args = parser.parse_args(argv) - - preprocess(args) - return 0 - - -if __name__ == '__main__': - raise SystemExit(main()) diff --git a/deps/libffi/src/aarch64/ffi.c b/deps/libffi/src/aarch64/ffi.c deleted file mode 100644 index 94c643b70ab678..00000000000000 --- a/deps/libffi/src/aarch64/ffi.c +++ /dev/null @@ -1,1145 +0,0 @@ -/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. - -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. */ - -#if defined(__aarch64__) || defined(__arm64__)|| defined (_M_ARM64) -#include -#include -#include -#include -#include -#include -#include "internal.h" -#ifdef _WIN32 -#include /* FlushInstructionCache */ -#endif -#include - -/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; - all further uses in this file will refer to the 128-bit type. */ -#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE -# if FFI_TYPE_LONGDOUBLE != 4 -# error FFI_TYPE_LONGDOUBLE out of date -# endif -#else -# undef FFI_TYPE_LONGDOUBLE -# define FFI_TYPE_LONGDOUBLE 4 -#endif - -union _d -{ - UINT64 d; - UINT32 s[2]; -}; - -struct _v -{ - union _d d[2] __attribute__((aligned(16))); -}; - -struct call_context -{ - struct _v v[N_V_ARG_REG]; - UINT64 x[N_X_ARG_REG]; -}; - -#if FFI_EXEC_TRAMPOLINE_TABLE - -#ifdef __MACH__ -#ifdef HAVE_ARM64E_PTRAUTH -#include -#endif -#include -#endif - -#else - -#if defined (__clang__) && defined (__APPLE__) -extern void sys_icache_invalidate (void *start, size_t len); -#endif - -static inline void -ffi_clear_cache (void *start, void *end) -{ -#if defined (__clang__) && defined (__APPLE__) - sys_icache_invalidate (start, (char *)end - (char *)start); -#elif defined (__GNUC__) - __builtin___clear_cache (start, end); -#elif defined (_WIN32) - FlushInstructionCache(GetCurrentProcess(), start, (char*)end - (char*)start); -#else -#error "Missing builtin to flush instruction cache" -#endif -} - -#endif - -/* A subroutine of is_vfp_type. Given a structure type, return the type code - of the first non-structure element. Recurse for structure elements. - Return -1 if the structure is in fact empty, i.e. no nested elements. */ - -static int -is_hfa0 (const ffi_type *ty) -{ - ffi_type **elements = ty->elements; - int i, ret = -1; - - if (elements != NULL) - for (i = 0; elements[i]; ++i) - { - ret = elements[i]->type; - if (ret == FFI_TYPE_STRUCT || ret == FFI_TYPE_COMPLEX) - { - ret = is_hfa0 (elements[i]); - if (ret < 0) - continue; - } - break; - } - - return ret; -} - -/* A subroutine of is_vfp_type. Given a structure type, return true if all - of the non-structure elements are the same as CANDIDATE. */ - -static int -is_hfa1 (const ffi_type *ty, int candidate) -{ - ffi_type **elements = ty->elements; - int i; - - if (elements != NULL) - for (i = 0; elements[i]; ++i) - { - int t = elements[i]->type; - if (t == FFI_TYPE_STRUCT || t == FFI_TYPE_COMPLEX) - { - if (!is_hfa1 (elements[i], candidate)) - return 0; - } - else if (t != candidate) - return 0; - } - - return 1; -} - -/* Determine if TY may be allocated to the FP registers. This is both an - fp scalar type as well as an homogenous floating point aggregate (HFA). - That is, a structure consisting of 1 to 4 members of all the same type, - where that type is an fp scalar. - - Returns non-zero iff TY is an HFA. The result is the AARCH64_RET_* - constant for the type. */ - -static int -is_vfp_type (const ffi_type *ty) -{ - ffi_type **elements; - int candidate, i; - size_t size, ele_count; - - /* Quickest tests first. */ - candidate = ty->type; - switch (candidate) - { - default: - return 0; - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_LONGDOUBLE: - ele_count = 1; - goto done; - case FFI_TYPE_COMPLEX: - candidate = ty->elements[0]->type; - switch (candidate) - { - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_LONGDOUBLE: - ele_count = 2; - goto done; - } - return 0; - case FFI_TYPE_STRUCT: - break; - } - - /* No HFA types are smaller than 4 bytes, or larger than 64 bytes. */ - size = ty->size; - if (size < 4 || size > 64) - return 0; - - /* Find the type of the first non-structure member. */ - elements = ty->elements; - candidate = elements[0]->type; - if (candidate == FFI_TYPE_STRUCT || candidate == FFI_TYPE_COMPLEX) - { - for (i = 0; ; ++i) - { - candidate = is_hfa0 (elements[i]); - if (candidate >= 0) - break; - } - } - - /* If the first member is not a floating point type, it's not an HFA. - Also quickly re-check the size of the structure. */ - switch (candidate) - { - case FFI_TYPE_FLOAT: - ele_count = size / sizeof(float); - if (size != ele_count * sizeof(float)) - return 0; - break; - case FFI_TYPE_DOUBLE: - ele_count = size / sizeof(double); - if (size != ele_count * sizeof(double)) - return 0; - break; - case FFI_TYPE_LONGDOUBLE: - ele_count = size / sizeof(long double); - if (size != ele_count * sizeof(long double)) - return 0; - break; - default: - return 0; - } - if (ele_count > 4) - return 0; - - /* Finally, make sure that all scalar elements are the same type. */ - for (i = 0; elements[i]; ++i) - { - int t = elements[i]->type; - if (t == FFI_TYPE_STRUCT || t == FFI_TYPE_COMPLEX) - { - if (!is_hfa1 (elements[i], candidate)) - return 0; - } - else if (t != candidate) - return 0; - } - - /* All tests succeeded. Encode the result. */ - done: - return candidate * 4 + (4 - (int)ele_count); -} - -/* Representation of the procedure call argument marshalling - state. - - The terse state variable names match the names used in the AARCH64 - PCS. - - The struct area is allocated downwards from the top of the argument - area. It is used to hold copies of structures passed by value that are - bigger than 16 bytes. */ - -struct arg_state -{ - unsigned ngrn; /* Next general-purpose register number. */ - unsigned nsrn; /* Next vector register number. */ - size_t nsaa; /* Next stack offset. */ - size_t next_struct_area; /* Place to allocate big structs. */ - -#if defined (__APPLE__) - unsigned allocating_variadic; -#endif -}; - -/* Initialize a procedure call argument marshalling state. */ -static void -arg_init (struct arg_state *state, size_t size) -{ - state->ngrn = 0; - state->nsrn = 0; - state->nsaa = 0; - state->next_struct_area = size; -#if defined (__APPLE__) - state->allocating_variadic = 0; -#endif -} - -/* Allocate an aligned slot on the stack and return a pointer to it. */ -static void * -allocate_to_stack (struct arg_state *state, void *stack, - size_t alignment, size_t size) -{ - size_t nsaa = state->nsaa; - - /* Round up the NSAA to the larger of 8 or the natural - alignment of the argument's type. */ -#if defined (__APPLE__) - if (state->allocating_variadic && alignment < 8) - alignment = 8; -#else - if (alignment < 8) - alignment = 8; -#endif - - nsaa = FFI_ALIGN (nsaa, alignment); - state->nsaa = nsaa + size; - - return (char *)stack + nsaa; -} - -/* Allocate and copy a structure that is passed by value on the stack and - return a pointer to it. */ -static void * -allocate_and_copy_struct_to_stack (struct arg_state *state, void *stack, - size_t alignment, size_t size, void *value) -{ - size_t dest = state->next_struct_area - size; - - /* Round down to the natural alignment of the value. */ - dest = FFI_ALIGN_DOWN (dest, alignment); - state->next_struct_area = dest; - - return memcpy ((char *) stack + dest, value, size); -} - -static ffi_arg -extend_integer_type (void *source, int type) -{ - switch (type) - { - case FFI_TYPE_UINT8: - { - UINT8 u8; - memcpy (&u8, source, sizeof (u8)); - return u8; - } - case FFI_TYPE_SINT8: - { - SINT8 s8; - memcpy (&s8, source, sizeof (s8)); - return s8; - } - case FFI_TYPE_UINT16: - { - UINT16 u16; - memcpy (&u16, source, sizeof (u16)); - return u16; - } - case FFI_TYPE_SINT16: - { - SINT16 s16; - memcpy (&s16, source, sizeof (s16)); - return s16; - } - case FFI_TYPE_UINT32: - { - UINT32 u32; - memcpy (&u32, source, sizeof (u32)); - return u32; - } - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - { - SINT32 s32; - memcpy (&s32, source, sizeof (s32)); - return s32; - } - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - { - UINT64 u64; - memcpy (&u64, source, sizeof (u64)); - return u64; - } - case FFI_TYPE_POINTER: - { - uintptr_t uptr; - memcpy (&uptr, source, sizeof (uptr)); - return uptr; - } - default: - abort(); - } -} - -#if defined(_MSC_VER) -void extend_hfa_type (void *dest, void *src, int h); -#else -static void -extend_hfa_type (void *dest, void *src, int h) -{ - ssize_t f = h - AARCH64_RET_S4; - void *x0; - -#define BTI_J "hint #36" - asm volatile ( - "adr %0, 0f\n" -" add %0, %0, %1\n" -" br %0\n" -"0: "BTI_J"\n" /* S4 */ -" ldp s16, s17, [%3]\n" -" ldp s18, s19, [%3, #8]\n" -" b 4f\n" -" "BTI_J"\n" /* S3 */ -" ldp s16, s17, [%3]\n" -" ldr s18, [%3, #8]\n" -" b 3f\n" -" "BTI_J"\n" /* S2 */ -" ldp s16, s17, [%3]\n" -" b 2f\n" -" nop\n" -" "BTI_J"\n" /* S1 */ -" ldr s16, [%3]\n" -" b 1f\n" -" nop\n" -" "BTI_J"\n" /* D4 */ -" ldp d16, d17, [%3]\n" -" ldp d18, d19, [%3, #16]\n" -" b 4f\n" -" "BTI_J"\n" /* D3 */ -" ldp d16, d17, [%3]\n" -" ldr d18, [%3, #16]\n" -" b 3f\n" -" "BTI_J"\n" /* D2 */ -" ldp d16, d17, [%3]\n" -" b 2f\n" -" nop\n" -" "BTI_J"\n" /* D1 */ -" ldr d16, [%3]\n" -" b 1f\n" -" nop\n" -" "BTI_J"\n" /* Q4 */ -" ldp q16, q17, [%3]\n" -" ldp q18, q19, [%3, #32]\n" -" b 4f\n" -" "BTI_J"\n" /* Q3 */ -" ldp q16, q17, [%3]\n" -" ldr q18, [%3, #32]\n" -" b 3f\n" -" "BTI_J"\n" /* Q2 */ -" ldp q16, q17, [%3]\n" -" b 2f\n" -" nop\n" -" "BTI_J"\n" /* Q1 */ -" ldr q16, [%3]\n" -" b 1f\n" -"4: str q19, [%2, #48]\n" -"3: str q18, [%2, #32]\n" -"2: str q17, [%2, #16]\n" -"1: str q16, [%2]" - : "=&r"(x0) - : "r"(f * 16), "r"(dest), "r"(src) - : "memory", "v16", "v17", "v18", "v19"); -} -#endif - -#if defined(_MSC_VER) -void* compress_hfa_type (void *dest, void *src, int h); -#else -static void * -compress_hfa_type (void *dest, void *reg, int h) -{ - switch (h) - { - case AARCH64_RET_S1: - if (dest == reg) - { -#ifdef __AARCH64EB__ - dest += 12; -#endif - } - else - *(float *)dest = *(float *)reg; - break; - case AARCH64_RET_S2: - asm ("ldp q16, q17, [%1]\n\t" - "st2 { v16.s, v17.s }[0], [%0]" - : : "r"(dest), "r"(reg) : "memory", "v16", "v17"); - break; - case AARCH64_RET_S3: - asm ("ldp q16, q17, [%1]\n\t" - "ldr q18, [%1, #32]\n\t" - "st3 { v16.s, v17.s, v18.s }[0], [%0]" - : : "r"(dest), "r"(reg) : "memory", "v16", "v17", "v18"); - break; - case AARCH64_RET_S4: - asm ("ldp q16, q17, [%1]\n\t" - "ldp q18, q19, [%1, #32]\n\t" - "st4 { v16.s, v17.s, v18.s, v19.s }[0], [%0]" - : : "r"(dest), "r"(reg) : "memory", "v16", "v17", "v18", "v19"); - break; - - case AARCH64_RET_D1: - if (dest == reg) - { -#ifdef __AARCH64EB__ - dest += 8; -#endif - } - else - *(double *)dest = *(double *)reg; - break; - case AARCH64_RET_D2: - asm ("ldp q16, q17, [%1]\n\t" - "st2 { v16.d, v17.d }[0], [%0]" - : : "r"(dest), "r"(reg) : "memory", "v16", "v17"); - break; - case AARCH64_RET_D3: - asm ("ldp q16, q17, [%1]\n\t" - "ldr q18, [%1, #32]\n\t" - "st3 { v16.d, v17.d, v18.d }[0], [%0]" - : : "r"(dest), "r"(reg) : "memory", "v16", "v17", "v18"); - break; - case AARCH64_RET_D4: - asm ("ldp q16, q17, [%1]\n\t" - "ldp q18, q19, [%1, #32]\n\t" - "st4 { v16.d, v17.d, v18.d, v19.d }[0], [%0]" - : : "r"(dest), "r"(reg) : "memory", "v16", "v17", "v18", "v19"); - break; - - default: - if (dest != reg) - return memcpy (dest, reg, 16 * (4 - (h & 3))); - break; - } - return dest; -} -#endif - -/* Either allocate an appropriate register for the argument type, or if - none are available, allocate a stack slot and return a pointer - to the allocated space. */ - -static void * -allocate_int_to_reg_or_stack (struct call_context *context, - struct arg_state *state, - void *stack, size_t size) -{ - if (state->ngrn < N_X_ARG_REG) - return &context->x[state->ngrn++]; - - state->ngrn = N_X_ARG_REG; - return allocate_to_stack (state, stack, size, size); -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep (ffi_cif *cif) -{ - ffi_type *rtype = cif->rtype; - size_t bytes = cif->bytes; - int flags, i, n; - - switch (rtype->type) - { - case FFI_TYPE_VOID: - flags = AARCH64_RET_VOID; - break; - case FFI_TYPE_UINT8: - flags = AARCH64_RET_UINT8; - break; - case FFI_TYPE_UINT16: - flags = AARCH64_RET_UINT16; - break; - case FFI_TYPE_UINT32: - flags = AARCH64_RET_UINT32; - break; - case FFI_TYPE_SINT8: - flags = AARCH64_RET_SINT8; - break; - case FFI_TYPE_SINT16: - flags = AARCH64_RET_SINT16; - break; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - flags = AARCH64_RET_SINT32; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - flags = AARCH64_RET_INT64; - break; - case FFI_TYPE_POINTER: - flags = (sizeof(void *) == 4 ? AARCH64_RET_UINT32 : AARCH64_RET_INT64); - break; - - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_LONGDOUBLE: - case FFI_TYPE_STRUCT: - case FFI_TYPE_COMPLEX: - flags = is_vfp_type (rtype); - if (flags == 0) - { - size_t s = rtype->size; - if (s > 16) - { - flags = AARCH64_RET_VOID | AARCH64_RET_IN_MEM; - bytes += 8; - } - else if (s == 16) - flags = AARCH64_RET_INT128; - else if (s == 8) - flags = AARCH64_RET_INT64; - else - flags = AARCH64_RET_INT128 | AARCH64_RET_NEED_COPY; - } - break; - - default: - abort(); - } - - for (i = 0, n = cif->nargs; i < n; i++) - if (is_vfp_type (cif->arg_types[i])) - { - flags |= AARCH64_FLAG_ARG_V; - break; - } - - /* Round the stack up to a multiple of the stack alignment requirement. */ - cif->bytes = (unsigned) FFI_ALIGN(bytes, 16); - cif->flags = flags; -#if defined (__APPLE__) - cif->aarch64_nfixedargs = 0; -#endif - - return FFI_OK; -} - -#if defined (__APPLE__) -/* Perform Apple-specific cif processing for variadic calls */ -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, - unsigned int ntotalargs) -{ - ffi_status status = ffi_prep_cif_machdep (cif); - cif->aarch64_nfixedargs = nfixedargs; - return status; -} -#else -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, unsigned int ntotalargs) -{ - ffi_status status = ffi_prep_cif_machdep (cif); - cif->flags |= AARCH64_FLAG_VARARG; - return status; -} -#endif /* __APPLE__ */ - -extern void ffi_call_SYSV (struct call_context *context, void *frame, - void (*fn)(void), void *rvalue, int flags, - void *closure) FFI_HIDDEN; - -/* Call a function with the provided arguments and capture the return - value. - n.b. ffi_call_SYSV will steal the alloca'd `stack` variable here for use - _as its own stack_ - so we need to compile this function without ASAN */ -FFI_ASAN_NO_SANITIZE -static void -ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue, - void **avalue, void *closure) -{ - struct call_context *context; - void *stack, *frame, *rvalue; - struct arg_state state; - size_t stack_bytes, rtype_size, rsize; - int i, nargs, flags, isvariadic = 0; - ffi_type *rtype; - - flags = cif->flags; - rtype = cif->rtype; - rtype_size = rtype->size; - stack_bytes = cif->bytes; - - if (flags & AARCH64_FLAG_VARARG) - { - isvariadic = 1; - flags &= ~AARCH64_FLAG_VARARG; - } - - /* If the target function returns a structure via hidden pointer, - then we cannot allow a null rvalue. Otherwise, mash a null - rvalue to void return type. */ - rsize = 0; - if (flags & AARCH64_RET_IN_MEM) - { - if (orig_rvalue == NULL) - rsize = rtype_size; - } - else if (orig_rvalue == NULL) - flags &= AARCH64_FLAG_ARG_V; - else if (flags & AARCH64_RET_NEED_COPY) - rsize = 16; - - /* Allocate consecutive stack for everything we'll need. - The frame uses 40 bytes for: lr, fp, rvalue, flags, sp */ - context = alloca (sizeof(struct call_context) + stack_bytes + 40 + rsize); - stack = context + 1; - frame = (void*)((uintptr_t)stack + (uintptr_t)stack_bytes); - rvalue = (rsize ? (void*)((uintptr_t)frame + 40) : orig_rvalue); - - arg_init (&state, stack_bytes); - for (i = 0, nargs = cif->nargs; i < nargs; i++) - { - ffi_type *ty = cif->arg_types[i]; - size_t s = ty->size; - void *a = avalue[i]; - int h, t; - void *dest; - - t = ty->type; - switch (t) - { - case FFI_TYPE_VOID: - FFI_ASSERT (0); - break; - - /* If the argument is a basic type the argument is allocated to an - appropriate register, or if none are available, to the stack. */ - case FFI_TYPE_INT: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_POINTER: - do_pointer: - { - ffi_arg ext = extend_integer_type (a, t); - if (state.ngrn < N_X_ARG_REG) - context->x[state.ngrn++] = ext; - else - { - void *d = allocate_to_stack (&state, stack, ty->alignment, s); - state.ngrn = N_X_ARG_REG; - /* Note that the default abi extends each argument - to a full 64-bit slot, while the iOS abi allocates - only enough space. */ -#ifdef __APPLE__ - memcpy(d, a, s); -#else - *(ffi_arg *)d = ext; -#endif - } - } - break; - - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_LONGDOUBLE: - case FFI_TYPE_STRUCT: - case FFI_TYPE_COMPLEX: - { - h = is_vfp_type (ty); - if (h) - { - int elems = 4 - (h & 3); - if (cif->abi == FFI_WIN64 && isvariadic) - { - if (state.ngrn + elems <= N_X_ARG_REG) - { - dest = &context->x[state.ngrn]; - state.ngrn += elems; - extend_hfa_type(dest, a, h); - break; - } - state.nsrn = N_X_ARG_REG; - dest = allocate_to_stack(&state, stack, ty->alignment, s); - } - else - { - if (state.nsrn + elems <= N_V_ARG_REG) - { - dest = &context->v[state.nsrn]; - state.nsrn += elems; - extend_hfa_type (dest, a, h); - break; - } - state.nsrn = N_V_ARG_REG; - dest = allocate_to_stack (&state, stack, ty->alignment, s); - } - } - else if (s > 16) - { - /* If the argument is a composite type that is larger than 16 - bytes, then the argument is copied to memory, and - the argument is replaced by a pointer to the copy. */ - dest = allocate_and_copy_struct_to_stack (&state, stack, - ty->alignment, s, - avalue[i]); - a = &dest; - t = FFI_TYPE_POINTER; - s = sizeof (void *); - goto do_pointer; - } - else - { - size_t n = (s + 7) / 8; - if (state.ngrn + n <= N_X_ARG_REG) - { - /* If the argument is a composite type and the size in - double-words is not more than the number of available - X registers, then the argument is copied into - consecutive X registers. */ - dest = &context->x[state.ngrn]; - state.ngrn += (unsigned int)n; - } - else - { - /* Otherwise, there are insufficient X registers. Further - X register allocations are prevented, the NSAA is - adjusted and the argument is copied to memory at the - adjusted NSAA. */ - state.ngrn = N_X_ARG_REG; - dest = allocate_to_stack (&state, stack, ty->alignment, s); - } - } - memcpy (dest, a, s); - } - break; - - default: - abort(); - } - -#if defined (__APPLE__) - if (i + 1 == cif->aarch64_nfixedargs) - { - state.ngrn = N_X_ARG_REG; - state.nsrn = N_V_ARG_REG; - state.allocating_variadic = 1; - } -#endif - } - - ffi_call_SYSV (context, frame, fn, rvalue, flags, closure); - - if (flags & AARCH64_RET_NEED_COPY) - memcpy (orig_rvalue, rvalue, rtype_size); -} - -void -ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) -{ - ffi_call_int (cif, fn, rvalue, avalue, NULL); -} - -#if FFI_CLOSURES - -#ifdef FFI_GO_CLOSURES -void -ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int (cif, fn, rvalue, avalue, closure); -} -#endif /* FFI_GO_CLOSURES */ - -/* Build a trampoline. */ - -extern void ffi_closure_SYSV (void) FFI_HIDDEN; -extern void ffi_closure_SYSV_V (void) FFI_HIDDEN; -#if defined(FFI_EXEC_STATIC_TRAMP) -extern void ffi_closure_SYSV_alt (void) FFI_HIDDEN; -extern void ffi_closure_SYSV_V_alt (void) FFI_HIDDEN; -#endif - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - if (cif->abi != FFI_SYSV && cif->abi != FFI_WIN64) - return FFI_BAD_ABI; - - void (*start)(void); - - if (cif->flags & AARCH64_FLAG_ARG_V) - start = ffi_closure_SYSV_V; - else - start = ffi_closure_SYSV; - -#if FFI_EXEC_TRAMPOLINE_TABLE -# ifdef __MACH__ -# ifdef HAVE_ARM64E_PTRAUTH - codeloc = ptrauth_auth_data(codeloc, ptrauth_key_function_pointer, 0); -# endif - void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); - config[0] = closure; - config[1] = start; -# endif -#else - static const unsigned char trampoline[16] = { - 0x90, 0x00, 0x00, 0x58, /* ldr x16, tramp+16 */ - 0xf1, 0xff, 0xff, 0x10, /* adr x17, tramp+0 */ - 0x00, 0x02, 0x1f, 0xd6 /* br x16 */ - }; - char *tramp = closure->tramp; - -# if defined(FFI_EXEC_STATIC_TRAMP) - if (ffi_tramp_is_present(closure)) - { - /* Initialize the static trampoline's parameters. */ - if (start == ffi_closure_SYSV_V) - start = ffi_closure_SYSV_V_alt; - else - start = ffi_closure_SYSV_alt; - ffi_tramp_set_parms (closure->ftramp, start, closure); - goto out; - } -# endif - - /* Initialize the dynamic trampoline. */ - memcpy (tramp, trampoline, sizeof(trampoline)); - - *(UINT64 *)(tramp + 16) = (uintptr_t)start; - - ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE); - - /* Also flush the cache for code mapping. */ -# ifdef _WIN32 - // Not using dlmalloc.c for Windows ARM64 builds - // so calling ffi_data_to_code_pointer() isn't necessary - unsigned char *tramp_code = tramp; -# else - unsigned char *tramp_code = ffi_data_to_code_pointer (tramp); -# endif - ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE); -# if defined(FFI_EXEC_STATIC_TRAMP) -out: -# endif -#endif - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - -#ifdef FFI_GO_CLOSURES -extern void ffi_go_closure_SYSV (void) FFI_HIDDEN; -extern void ffi_go_closure_SYSV_V (void) FFI_HIDDEN; - -ffi_status -ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*)) -{ - void (*start)(void); - - if (cif->abi != FFI_SYSV && cif->abi != FFI_WIN64) - return FFI_BAD_ABI; - - if (cif->flags & AARCH64_FLAG_ARG_V) - start = ffi_go_closure_SYSV_V; - else - start = ffi_go_closure_SYSV; - - closure->tramp = start; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} -#endif /* FFI_GO_CLOSURES */ - -/* Primary handler to setup and invoke a function within a closure. - - A closure when invoked enters via the assembler wrapper - ffi_closure_SYSV(). The wrapper allocates a call context on the - stack, saves the interesting registers (from the perspective of - the calling convention) into the context then passes control to - ffi_closure_SYSV_inner() passing the saved context and a pointer to - the stack at the point ffi_closure_SYSV() was invoked. - - On the return path the assembler wrapper will reload call context - registers. - - ffi_closure_SYSV_inner() marshalls the call context into ffi value - descriptors, invokes the wrapped function, then marshalls the return - value back into the call context. */ - -int FFI_HIDDEN -ffi_closure_SYSV_inner (ffi_cif *cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - struct call_context *context, - void *stack, void *rvalue, void *struct_rvalue) -{ - void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); - int i, h, nargs, flags, isvariadic = 0; - struct arg_state state; - - arg_init (&state, cif->bytes); - - flags = cif->flags; - if (flags & AARCH64_FLAG_VARARG) - { - isvariadic = 1; - flags &= ~AARCH64_FLAG_VARARG; - } - - for (i = 0, nargs = cif->nargs; i < nargs; i++) - { - ffi_type *ty = cif->arg_types[i]; - int t = ty->type; - size_t n, s = ty->size; - - switch (t) - { - case FFI_TYPE_VOID: - FFI_ASSERT (0); - break; - - case FFI_TYPE_INT: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_POINTER: - avalue[i] = allocate_int_to_reg_or_stack (context, &state, stack, s); - break; - - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_LONGDOUBLE: - case FFI_TYPE_STRUCT: - case FFI_TYPE_COMPLEX: - h = is_vfp_type (ty); - if (h) - { - n = 4 - (h & 3); - if (cif->abi == FFI_WIN64 && isvariadic) - { - if (state.ngrn + n <= N_X_ARG_REG) - { - void *reg = &context->x[state.ngrn]; - state.ngrn += (unsigned int)n; - - /* Eeek! We need a pointer to the structure, however the - homogeneous float elements are being passed in individual - registers, therefore for float and double the structure - is not represented as a contiguous sequence of bytes in - our saved register context. We don't need the original - contents of the register storage, so we reformat the - structure into the same memory. */ - avalue[i] = compress_hfa_type(reg, reg, h); - } - else - { - state.ngrn = N_X_ARG_REG; - state.nsrn = N_V_ARG_REG; - avalue[i] = allocate_to_stack(&state, stack, - ty->alignment, s); - } - } - else - { - if (state.nsrn + n <= N_V_ARG_REG) - { - void *reg = &context->v[state.nsrn]; - state.nsrn += (unsigned int)n; - avalue[i] = compress_hfa_type(reg, reg, h); - } - else - { - state.nsrn = N_V_ARG_REG; - avalue[i] = allocate_to_stack(&state, stack, - ty->alignment, s); - } - } - } - else if (s > 16) - { - /* Replace Composite type of size greater than 16 with a - pointer. */ -#ifdef __ILP32__ - UINT64 avalue_tmp; - memcpy (&avalue_tmp, - allocate_int_to_reg_or_stack (context, &state, - stack, sizeof (void *)), - sizeof (UINT64)); - avalue[i] = (void *)(UINT32)avalue_tmp; -#else - avalue[i] = *(void **) - allocate_int_to_reg_or_stack (context, &state, stack, - sizeof (void *)); -#endif - } - else - { - n = (s + 7) / 8; - if (state.ngrn + n <= N_X_ARG_REG) - { - avalue[i] = &context->x[state.ngrn]; - state.ngrn += (unsigned int)n; - } - else - { - state.ngrn = N_X_ARG_REG; - avalue[i] = allocate_to_stack(&state, stack, - ty->alignment, s); - } - } - break; - - default: - abort(); - } - -#if defined (__APPLE__) - if (i + 1 == cif->aarch64_nfixedargs) - { - state.ngrn = N_X_ARG_REG; - state.nsrn = N_V_ARG_REG; - state.allocating_variadic = 1; - } -#endif - } - - if (flags & AARCH64_RET_IN_MEM) - rvalue = struct_rvalue; - - fun (cif, rvalue, avalue, user_data); - - return flags; -} - -#if defined(FFI_EXEC_STATIC_TRAMP) -void * -ffi_tramp_arch (size_t *tramp_size, size_t *map_size) -{ - extern void *trampoline_code_table; - - *tramp_size = AARCH64_TRAMP_SIZE; - *map_size = AARCH64_TRAMP_MAP_SIZE; - return &trampoline_code_table; -} -#endif - -#endif /* FFI_CLOSURES */ - -#endif /* (__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)*/ diff --git a/deps/libffi/src/aarch64/ffitarget.h b/deps/libffi/src/aarch64/ffitarget.h deleted file mode 100644 index 2ab95644a311d2..00000000000000 --- a/deps/libffi/src/aarch64/ffitarget.h +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. - -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. */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -#ifdef __ILP32__ -#define FFI_SIZEOF_ARG 8 -#define FFI_SIZEOF_JAVA_RAW 4 -typedef unsigned long long ffi_arg; -typedef signed long long ffi_sarg; -#elif defined(_WIN32) -#define FFI_SIZEOF_ARG 8 -typedef unsigned long long ffi_arg; -typedef signed long long ffi_sarg; -#else -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; -#endif - -typedef enum ffi_abi - { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_WIN64, - FFI_LAST_ABI, -#if defined(_WIN32) - FFI_DEFAULT_ABI = FFI_WIN64 -#else - FFI_DEFAULT_ABI = FFI_SYSV -#endif - } ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 - -#if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE - -#ifdef __MACH__ -#define FFI_TRAMPOLINE_SIZE 16 -#define FFI_TRAMPOLINE_CLOSURE_OFFSET 16 -#else -#error "No trampoline table implementation" -#endif - -#else -#define FFI_TRAMPOLINE_SIZE 24 -#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE -#endif - -#ifdef _WIN32 -#define FFI_EXTRA_CIF_FIELDS unsigned is_variadic -#endif -#define FFI_TARGET_SPECIFIC_VARIADIC - -/* ---- Internal ---- */ - -#if defined (__APPLE__) -#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs -#elif !defined(_WIN32) && !defined(__ANDROID__) -/* iOS, Windows and Android reserve x18 for the system. Disable Go closures until - a new static chain is chosen. */ -#define FFI_GO_CLOSURES 1 -#endif - -#ifndef _WIN32 -/* No complex type on Windows */ -#define FFI_TARGET_HAS_COMPLEX_TYPE -#endif - -#endif diff --git a/deps/libffi/src/aarch64/internal.h b/deps/libffi/src/aarch64/internal.h deleted file mode 100644 index 591b9f5c087eb1..00000000000000 --- a/deps/libffi/src/aarch64/internal.h +++ /dev/null @@ -1,146 +0,0 @@ -/* -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. */ - -#define AARCH64_RET_VOID 0 -#define AARCH64_RET_INT64 1 -#define AARCH64_RET_INT128 2 - -#define AARCH64_RET_UNUSED3 3 -#define AARCH64_RET_UNUSED4 4 -#define AARCH64_RET_UNUSED5 5 -#define AARCH64_RET_UNUSED6 6 -#define AARCH64_RET_UNUSED7 7 - -/* Note that FFI_TYPE_FLOAT == 2, _DOUBLE == 3, _LONGDOUBLE == 4, - so _S4 through _Q1 are layed out as (TYPE * 4) + (4 - COUNT). */ -#define AARCH64_RET_S4 8 -#define AARCH64_RET_S3 9 -#define AARCH64_RET_S2 10 -#define AARCH64_RET_S1 11 - -#define AARCH64_RET_D4 12 -#define AARCH64_RET_D3 13 -#define AARCH64_RET_D2 14 -#define AARCH64_RET_D1 15 - -#define AARCH64_RET_Q4 16 -#define AARCH64_RET_Q3 17 -#define AARCH64_RET_Q2 18 -#define AARCH64_RET_Q1 19 - -/* Note that each of the sub-64-bit integers gets two entries. */ -#define AARCH64_RET_UINT8 20 -#define AARCH64_RET_UINT16 22 -#define AARCH64_RET_UINT32 24 - -#define AARCH64_RET_SINT8 26 -#define AARCH64_RET_SINT16 28 -#define AARCH64_RET_SINT32 30 - -#define AARCH64_RET_MASK 31 - -#define AARCH64_RET_IN_MEM (1 << 5) -#define AARCH64_RET_NEED_COPY (1 << 6) - -#define AARCH64_FLAG_ARG_V_BIT 7 -#define AARCH64_FLAG_ARG_V (1 << AARCH64_FLAG_ARG_V_BIT) -#define AARCH64_FLAG_VARARG (1 << 8) - -#define N_X_ARG_REG 8 -#define N_V_ARG_REG 8 -#define CALL_CONTEXT_SIZE (N_V_ARG_REG * 16 + N_X_ARG_REG * 8) - -#if defined(FFI_EXEC_STATIC_TRAMP) -/* - * For the trampoline code table mapping, a mapping size of 16K is chosen to - * cover the base page sizes of 4K and 16K. - */ -#define AARCH64_TRAMP_MAP_SHIFT 14 -#define AARCH64_TRAMP_MAP_SIZE (1 << AARCH64_TRAMP_MAP_SHIFT) -#define AARCH64_TRAMP_SIZE 32 - -#endif - -/* Helpers for writing assembly compatible with arm ptr auth */ -#ifdef LIBFFI_ASM - - #if defined(HAVE_ARM64E_PTRAUTH) - /* ARM64E ABI For Darwin */ - #define SIGN_LR pacibsp - #define SIGN_LR_WITH_REG(x) pacib lr, x - #define AUTH_LR_AND_RET retab - #define AUTH_LR_WITH_REG(x) autib lr, x - #define BRANCH_AND_LINK_TO_REG blraaz - #define SIGN_LR_LINUX_ONLY - #define BRANCH_TO_REG braaz - #define PAC_CFI_WINDOW_SAVE - #define GNU_PROPERTY_AARCH64_POINTER_AUTH 0 - /* Linux PAC Support */ - #elif defined(__ARM_FEATURE_PAC_DEFAULT) - #define GNU_PROPERTY_AARCH64_POINTER_AUTH (1 << 1) - #define PAC_CFI_WINDOW_SAVE cfi_window_save - #define TMP_REG x9 - #define BRANCH_TO_REG br - #define BRANCH_AND_LINK_TO_REG blr - #define SIGN_LR_LINUX_ONLY SIGN_LR - /* Which key to sign with? */ - #if (__ARM_FEATURE_PAC_DEFAULT & 1) == 1 - /* Signed with A-key */ - #define SIGN_LR hint #25 /* paciasp */ - #define AUTH_LR hint #29 /* autiasp */ - #else - /* Signed with B-key */ - #define SIGN_LR hint #27 /* pacibsp */ - #define AUTH_LR hint #31 /* autibsp */ - #endif /* __ARM_FEATURE_PAC_DEFAULT */ - #define AUTH_LR_WITH_REG(x) _auth_lr_with_reg x -.macro _auth_lr_with_reg modifier - mov TMP_REG, sp - mov sp, \modifier - AUTH_LR - mov sp, TMP_REG -.endm - #define SIGN_LR_WITH_REG(x) _sign_lr_with_reg x -.macro _sign_lr_with_reg modifier - mov TMP_REG, sp - mov sp, \modifier - SIGN_LR - mov sp, TMP_REG -.endm - #define AUTH_LR_AND_RET _auth_lr_and_ret modifier -.macro _auth_lr_and_ret modifier - AUTH_LR - ret -.endm - #undef TMP_REG - - /* No Pointer Auth */ - #else - #define SIGN_LR - #define SIGN_LR_WITH_REG(x) - #define AUTH_LR_AND_RET ret - #define AUTH_LR_WITH_REG(x) - #define BRANCH_AND_LINK_TO_REG blr - #define SIGN_LR_LINUX_ONLY - #define BRANCH_TO_REG br - #define PAC_CFI_WINDOW_SAVE - #define GNU_PROPERTY_AARCH64_POINTER_AUTH 0 - #endif /* HAVE_ARM64E_PTRAUTH */ -#endif /* LIBFFI_ASM */ diff --git a/deps/libffi/src/aarch64/sysv.S b/deps/libffi/src/aarch64/sysv.S deleted file mode 100644 index 81d33f2ef0a5fb..00000000000000 --- a/deps/libffi/src/aarch64/sysv.S +++ /dev/null @@ -1,699 +0,0 @@ -/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. - -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. */ - -#if defined(__aarch64__) || defined(__arm64__) -#define LIBFFI_ASM -#include -#include -#include -#include "internal.h" - -#ifdef HAVE_MACHINE_ASM_H -#include -#else -#ifdef __USER_LABEL_PREFIX__ -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ -#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) -#else -#define CNAME(x) x -#endif -#endif - -#ifdef __APPLE__ -# define L(X) CONCAT1(L, X) -#else -# define L(X) CONCAT1(.L, X) -#endif - -#ifdef __AARCH64EB__ -# define BE(X) X -#else -# define BE(X) 0 -#endif - -#ifdef __ILP32__ -#define PTR_REG(n) w##n -#else -#define PTR_REG(n) x##n -#endif - -#ifdef __ILP32__ -#define PTR_SIZE 4 -#else -#define PTR_SIZE 8 -#endif - -#define BTI_C hint #34 -#define BTI_J hint #36 -/* - * The ELF Notes section needs to indicate if BTI is supported, as the first ELF loaded that doesn't - * declare this support disables it for memory region containing the loaded library. - */ -# define GNU_PROPERTY_AARCH64_BTI (1 << 0) /* Has Branch Target Identification */ - .text - .align 4 - -/* ffi_call_SYSV - extern void ffi_call_SYSV (void *stack, void *frame, - void (*fn)(void), void *rvalue, - int flags, void *closure); - - Therefore on entry we have: - - x0 stack - x1 frame - x2 fn - x3 rvalue - x4 flags - x5 closure -*/ - -CNAME(ffi_call_SYSV): - cfi_startproc - BTI_C - PAC_CFI_WINDOW_SAVE - /* Sign the lr with x1 since that is the CFA which is the modifer used in auth instructions */ - SIGN_LR_WITH_REG(x1) - -#if defined(HAVE_ARM64E_PTRAUTH) && defined(__APPLE__) - /* darwin's libunwind assumes that the cfa is the sp and that's the data - * used to sign the lr. In order to allow unwinding through this - * function it is necessary to point the cfa at the signing register. - */ - cfi_def_cfa(x1, 0); -#endif - /* Use a stack frame allocated by our caller. */ - stp x29, x30, [x1] - cfi_def_cfa_register(x1) - cfi_rel_offset (x29, 0) - cfi_rel_offset (x30, 8) - mov x9, sp - str x9, [x1, #32] - mov x29, x1 - cfi_def_cfa_register(x29) - mov sp, x0 - - mov x9, x2 /* save fn */ - mov x8, x3 /* install structure return */ -#ifdef FFI_GO_CLOSURES - mov x18, x5 /* install static chain */ -#endif - stp x3, x4, [x29, #16] /* save rvalue and flags */ - - /* Load the vector argument passing registers, if necessary. */ - tbz w4, #AARCH64_FLAG_ARG_V_BIT, 1f - ldp q0, q1, [sp, #0] - ldp q2, q3, [sp, #32] - ldp q4, q5, [sp, #64] - ldp q6, q7, [sp, #96] -1: - /* Load the core argument passing registers, including - the structure return pointer. */ - ldp x0, x1, [sp, #16*N_V_ARG_REG + 0] - ldp x2, x3, [sp, #16*N_V_ARG_REG + 16] - ldp x4, x5, [sp, #16*N_V_ARG_REG + 32] - ldp x6, x7, [sp, #16*N_V_ARG_REG + 48] - - /* Deallocate the context, leaving the stacked arguments. */ - add sp, sp, #CALL_CONTEXT_SIZE - - BRANCH_AND_LINK_TO_REG x9 /* call fn */ - - ldp x3, x4, [x29, #16] /* reload rvalue and flags */ - - /* Partially deconstruct the stack frame. */ - ldr x9, [x29, #32] - mov sp, x9 - cfi_def_cfa_register (sp) - mov x2, x29 /* Preserve for auth */ - ldp x29, x30, [x29] - - /* Save the return value as directed. */ - adr x5, 0f - and w4, w4, #AARCH64_RET_MASK - add x5, x5, x4, lsl #4 - br x5 - - /* Note that each table entry is 4 insns, and thus 16 bytes. - For integer data, note that we're storing into ffi_arg - and therefore we want to extend to 64 bits; these types - have two consecutive entries allocated for them. */ - .align 4 -0: BTI_J /* VOID */ - b 99f - nop - nop -1: BTI_J /* INT64 */ - str x0, [x3] - b 99f - nop -2: BTI_J /* INT128 */ - stp x0, x1, [x3] - b 99f - nop -3: brk #1000 /* UNUSED */ - b 99f - nop - nop -4: brk #1000 /* UNUSED */ - b 99f - nop - nop -5: brk #1000 /* UNUSED */ - b 99f - nop - nop -6: brk #1000 /* UNUSED */ - b 99f - nop - nop -7: brk #1000 /* UNUSED */ - b 99f - nop - nop -8: BTI_J /* S4 */ - st4 { v0.s, v1.s, v2.s, v3.s }[0], [x3] - b 99f - nop -9: BTI_J /* S3 */ - st3 { v0.s, v1.s, v2.s }[0], [x3] - b 99f - nop -10: BTI_J /* S2 */ - stp s0, s1, [x3] - b 99f - nop -11: BTI_J - str s0, [x3] /* S1 */ - b 99f - nop -12: BTI_J /* D4 */ - st4 { v0.d, v1.d, v2.d, v3.d }[0], [x3] - b 99f - nop -13: BTI_J /* D3 */ - st3 { v0.d, v1.d, v2.d }[0], [x3] - b 99f - nop -14: BTI_J /* D2 */ - stp d0, d1, [x3] - b 99f - nop -15: BTI_J /* D1 */ - str d0, [x3] - b 99f - nop -16: BTI_J /* Q4 */ - str q3, [x3, #48] - nop - nop -17: BTI_J /* Q3 */ - str q2, [x3, #32] - nop - nop -18: BTI_J /* Q2 */ - stp q0, q1, [x3] - b 99f - nop -19: BTI_J /* Q1 */ - str q0, [x3] - b 99f - nop -20: BTI_J /* UINT8 */ - uxtb w0, w0 - str x0, [x3] - nop -21: b 99f /* reserved */ - nop - nop - nop -22: BTI_J /* UINT16 */ - uxth w0, w0 - str x0, [x3] - nop -23: b 99f /* reserved */ - nop - nop - nop -24: BTI_J /* UINT32 */ - mov w0, w0 - str x0, [x3] - nop -25: b 99f /* reserved */ - nop - nop - nop -26: BTI_J /* SINT8 */ - sxtb x0, w0 - str x0, [x3] - nop -27: b 99f /* reserved */ - nop - nop - nop -28: BTI_J /* SINT16 */ - sxth x0, w0 - str x0, [x3] - nop -29: b 99f /* reserved */ - nop - nop - nop -30: BTI_J /* SINT32 */ - sxtw x0, w0 - str x0, [x3] - nop -31: b 99f /* reserved */ - nop - nop - nop - - /* Return now that result has been populated. */ -99: - AUTH_LR_WITH_REG(x2) - ret - - cfi_endproc - - .globl CNAME(ffi_call_SYSV) - FFI_HIDDEN(CNAME(ffi_call_SYSV)) -#ifdef __ELF__ - .type CNAME(ffi_call_SYSV), #function - .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV) -#endif - -#if FFI_CLOSURES - -/* ffi_closure_SYSV - - Closure invocation glue. This is the low level code invoked directly by - the closure trampoline to setup and call a closure. - - On entry x17 points to a struct ffi_closure, x16 has been clobbered - all other registers are preserved. - - We allocate a call context and save the argument passing registers, - then invoked the generic C ffi_closure_SYSV_inner() function to do all - the real work, on return we load the result passing registers back from - the call context. -*/ - -#define ffi_closure_SYSV_FS (8*2 + CALL_CONTEXT_SIZE + 64) - - .align 4 -CNAME(ffi_closure_SYSV_V): - cfi_startproc - BTI_C - SIGN_LR - PAC_CFI_WINDOW_SAVE - stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! - cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) - cfi_rel_offset (x29, 0) - cfi_rel_offset (x30, 8) - - /* Save the argument passing vector registers. */ - stp q0, q1, [sp, #16 + 0] - stp q2, q3, [sp, #16 + 32] - stp q4, q5, [sp, #16 + 64] - stp q6, q7, [sp, #16 + 96] - b 0f - cfi_endproc - - .globl CNAME(ffi_closure_SYSV_V) - FFI_HIDDEN(CNAME(ffi_closure_SYSV_V)) -#ifdef __ELF__ - .type CNAME(ffi_closure_SYSV_V), #function - .size CNAME(ffi_closure_SYSV_V), . - CNAME(ffi_closure_SYSV_V) -#endif - - .align 4 -CNAME(ffi_closure_SYSV): - cfi_startproc - BTI_C - SIGN_LR - PAC_CFI_WINDOW_SAVE - stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! - cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) - cfi_rel_offset (x29, 0) - cfi_rel_offset (x30, 8) -0: - mov x29, sp - - /* Save the argument passing core registers. */ - stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0] - stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16] - stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32] - stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] - - /* Load ffi_closure_inner arguments. */ - ldp PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */ - ldr PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2] /* load user_data */ -#ifdef FFI_GO_CLOSURES -L(do_closure): -#endif - add x3, sp, #16 /* load context */ - add x4, sp, #ffi_closure_SYSV_FS /* load stack */ - add x5, sp, #16+CALL_CONTEXT_SIZE /* load rvalue */ - mov x6, x8 /* load struct_rval */ - bl CNAME(ffi_closure_SYSV_inner) - - /* Load the return value as directed. */ - adr x1, 0f - and w0, w0, #AARCH64_RET_MASK - add x1, x1, x0, lsl #4 - add x3, sp, #16+CALL_CONTEXT_SIZE - br x1 - - /* Note that each table entry is 4 insns, and thus 16 bytes. */ - .align 4 -0: BTI_J /* VOID */ - b 99f - nop - nop -1: BTI_J /* INT64 */ - ldr x0, [x3] - b 99f - nop -2: BTI_J /* INT128 */ - ldp x0, x1, [x3] - b 99f - nop -3: brk #1000 /* UNUSED */ - nop - nop - nop -4: brk #1000 /* UNUSED */ - nop - nop - nop -5: brk #1000 /* UNUSED */ - nop - nop - nop -6: brk #1000 /* UNUSED */ - nop - nop - nop -7: brk #1000 /* UNUSED */ - nop - nop - nop -8: BTI_J /* S4 */ - ldr s3, [x3, #12] - nop - nop -9: BTI_J /* S3 */ - ldr s2, [x3, #8] - nop - nop -10: BTI_J /* S2 */ - ldp s0, s1, [x3] - b 99f - nop -11: BTI_J /* S1 */ - ldr s0, [x3] - b 99f - nop -12: BTI_J /* D4 */ - ldr d3, [x3, #24] - nop - nop -13: BTI_J /* D3 */ - ldr d2, [x3, #16] - nop - nop -14: BTI_J /* D2 */ - ldp d0, d1, [x3] - b 99f - nop -15: BTI_J /* D1 */ - ldr d0, [x3] - b 99f - nop -16: BTI_J /* Q4 */ - ldr q3, [x3, #48] - nop - nop -17: BTI_J /* Q3 */ - ldr q2, [x3, #32] - nop - nop -18: BTI_J /* Q2 */ - ldp q0, q1, [x3] - b 99f - nop -19: BTI_J /* Q1 */ - ldr q0, [x3] - b 99f - nop -20: BTI_J /* UINT8 */ - ldrb w0, [x3, #BE(7)] - b 99f - nop -21: brk #1000 /* reserved */ - nop - nop - nop -22: BTI_J /* UINT16 */ - ldrh w0, [x3, #BE(6)] - b 99f - nop -23: brk #1000 /* reserved */ - nop - nop - nop -24: BTI_J /* UINT32 */ - ldr w0, [x3, #BE(4)] - b 99f - nop -25: brk #1000 /* reserved */ - nop - nop - nop -26: BTI_J /* SINT8 */ - ldrsb x0, [x3, #BE(7)] - b 99f - nop -27: brk #1000 /* reserved */ - nop - nop - nop -28: BTI_J /* SINT16 */ - ldrsh x0, [x3, #BE(6)] - b 99f - nop -29: brk #1000 /* reserved */ - nop - nop - nop -30: BTI_J /* SINT32 */ - ldrsw x0, [x3, #BE(4)] - nop - nop -31: /* reserved */ -99: ldp x29, x30, [sp], #ffi_closure_SYSV_FS - cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS) - cfi_restore (x29) - cfi_restore (x30) - AUTH_LR_AND_RET - cfi_endproc - - .globl CNAME(ffi_closure_SYSV) - FFI_HIDDEN(CNAME(ffi_closure_SYSV)) -#ifdef __ELF__ - .type CNAME(ffi_closure_SYSV), #function - .size CNAME(ffi_closure_SYSV), . - CNAME(ffi_closure_SYSV) -#endif - -#if defined(FFI_EXEC_STATIC_TRAMP) - .align 4 -CNAME(ffi_closure_SYSV_V_alt): - BTI_C - /* See the comments above trampoline_code_table. */ - ldr x17, [sp, #8] /* Load closure in x17 */ - add sp, sp, #16 /* Restore the stack */ - b CNAME(ffi_closure_SYSV_V) - - .globl CNAME(ffi_closure_SYSV_V_alt) - FFI_HIDDEN(CNAME(ffi_closure_SYSV_V_alt)) -#ifdef __ELF__ - .type CNAME(ffi_closure_SYSV_V_alt), #function - .size CNAME(ffi_closure_SYSV_V_alt), . - CNAME(ffi_closure_SYSV_V_alt) -#endif - - .align 4 -CNAME(ffi_closure_SYSV_alt): - BTI_C - /* See the comments above trampoline_code_table. */ - ldr x17, [sp, #8] /* Load closure in x17 */ - add sp, sp, #16 /* Restore the stack */ - b CNAME(ffi_closure_SYSV) - - .globl CNAME(ffi_closure_SYSV_alt) - FFI_HIDDEN(CNAME(ffi_closure_SYSV_alt)) -#ifdef __ELF__ - .type CNAME(ffi_closure_SYSV_alt), #function - .size CNAME(ffi_closure_SYSV_alt), . - CNAME(ffi_closure_SYSV_alt) -#endif - -/* - * Below is the definition of the trampoline code table. Each element in - * the code table is a trampoline. - */ -/* - * The trampoline uses register x17. It saves the original value of x17 on - * the stack. - * - * The trampoline has two parameters - target code to jump to and data for - * the target code. The trampoline extracts the parameters from its parameter - * block (see tramp_table_map()). The trampoline saves the data address on - * the stack. Finally, it jumps to the target code. - * - * The target code can choose to: - * - * - restore the value of x17 - * - load the data address in a register - * - restore the stack pointer to what it was when the trampoline was invoked. - */ - .align AARCH64_TRAMP_MAP_SHIFT -CNAME(trampoline_code_table): - .rept AARCH64_TRAMP_MAP_SIZE / AARCH64_TRAMP_SIZE - sub sp, sp, #16 /* Make space on the stack */ - str x17, [sp] /* Save x17 on stack */ - adr x17, #16376 /* Get data address */ - ldr x17, [x17] /* Copy data into x17 */ - str x17, [sp, #8] /* Save data on stack */ - adr x17, #16372 /* Get code address */ - ldr x17, [x17] /* Load code address into x17 */ - br x17 /* Jump to code */ - .endr - - .globl CNAME(trampoline_code_table) - FFI_HIDDEN(CNAME(trampoline_code_table)) -#ifdef __ELF__ - .type CNAME(trampoline_code_table), #function - .size CNAME(trampoline_code_table), . - CNAME(trampoline_code_table) -#endif - .align AARCH64_TRAMP_MAP_SHIFT -#endif /* FFI_EXEC_STATIC_TRAMP */ - -#if FFI_EXEC_TRAMPOLINE_TABLE - -#ifdef __MACH__ -#include - .align PAGE_MAX_SHIFT -CNAME(ffi_closure_trampoline_table_page): - .rept PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE - adr x16, -PAGE_MAX_SIZE - ldp x17, x16, [x16] - br x16 - nop /* each entry in the trampoline config page is 2*sizeof(void*) so the trampoline itself cannot be smaller than 16 bytes */ - .endr - - .globl CNAME(ffi_closure_trampoline_table_page) - FFI_HIDDEN(CNAME(ffi_closure_trampoline_table_page)) - #ifdef __ELF__ - .type CNAME(ffi_closure_trampoline_table_page), #function - .size CNAME(ffi_closure_trampoline_table_page), . - CNAME(ffi_closure_trampoline_table_page) - #endif -#endif - -#endif /* FFI_EXEC_TRAMPOLINE_TABLE */ - -#ifdef FFI_GO_CLOSURES - .align 4 -CNAME(ffi_go_closure_SYSV_V): - cfi_startproc - BTI_C - stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! - cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) - cfi_rel_offset (x29, 0) - cfi_rel_offset (x30, 8) - - /* Save the argument passing vector registers. */ - stp q0, q1, [sp, #16 + 0] - stp q2, q3, [sp, #16 + 32] - stp q4, q5, [sp, #16 + 64] - stp q6, q7, [sp, #16 + 96] - b 0f - cfi_endproc - - .globl CNAME(ffi_go_closure_SYSV_V) - FFI_HIDDEN(CNAME(ffi_go_closure_SYSV_V)) -#ifdef __ELF__ - .type CNAME(ffi_go_closure_SYSV_V), #function - .size CNAME(ffi_go_closure_SYSV_V), . - CNAME(ffi_go_closure_SYSV_V) -#endif - - .align 4 -CNAME(ffi_go_closure_SYSV): - cfi_startproc - BTI_C - SIGN_LR_LINUX_ONLY - PAC_CFI_WINDOW_SAVE - stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! - cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) - cfi_rel_offset (x29, 0) - cfi_rel_offset (x30, 8) -0: - mov x29, sp - - /* Save the argument passing core registers. */ - stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0] - stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16] - stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32] - stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] - - /* Load ffi_closure_inner arguments. */ - ldp PTR_REG(0), PTR_REG(1), [x18, #PTR_SIZE]/* load cif, fn */ - mov x2, x18 /* load user_data */ - b L(do_closure) - cfi_endproc - - .globl CNAME(ffi_go_closure_SYSV) - FFI_HIDDEN(CNAME(ffi_go_closure_SYSV)) -#ifdef __ELF__ - .type CNAME(ffi_go_closure_SYSV), #function - .size CNAME(ffi_go_closure_SYSV), . - CNAME(ffi_go_closure_SYSV) -#endif -#endif /* FFI_GO_CLOSURES */ -#endif /* FFI_CLOSURES */ -#endif /* __arm64__ */ - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",%progbits - - .pushsection .note.gnu.property, "a"; - .balign 8; - .long 4; - .long 0x10; - .long 0x5; - .asciz "GNU"; - .long 0xc0000000; /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */ - .long 4; - .long GNU_PROPERTY_AARCH64_BTI | GNU_PROPERTY_AARCH64_POINTER_AUTH; - .long 0; - .popsection; -#endif - diff --git a/deps/libffi/src/aarch64/win64_armasm.S b/deps/libffi/src/aarch64/win64_armasm.S deleted file mode 100644 index 7fc185b3d8baea..00000000000000 --- a/deps/libffi/src/aarch64/win64_armasm.S +++ /dev/null @@ -1,506 +0,0 @@ -/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. -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. */ - -#define LIBFFI_ASM -#include -#include -#include -#include "internal.h" - - OPT 2 /*disable listing */ -/* For some macros to add unwind information */ -#include "ksarm64.h" - OPT 1 /*re-enable listing */ - -#define BE(X) 0 -#define PTR_REG(n) x##n -#define PTR_SIZE 8 - - IMPORT ffi_closure_SYSV_inner - EXPORT ffi_call_SYSV - EXPORT ffi_closure_SYSV_V - EXPORT ffi_closure_SYSV - EXPORT extend_hfa_type - EXPORT compress_hfa_type -#ifdef FFI_GO_CLOSURES - EXPORT ffi_go_closure_SYSV_V - EXPORT ffi_go_closure_SYSV -#endif - - TEXTAREA, ALIGN=8 - -/* ffi_call_SYSV - extern void ffi_call_SYSV (void *stack, void *frame, - void (*fn)(void), void *rvalue, - int flags, void *closure); - Therefore on entry we have: - x0 stack - x1 frame - x2 fn - x3 rvalue - x4 flags - x5 closure -*/ - - NESTED_ENTRY ffi_call_SYSV_fake - - /* For unwind information, Windows has to store fp and lr */ - PROLOG_SAVE_REG_PAIR x29, x30, #-32! - - ALTERNATE_ENTRY ffi_call_SYSV - /* Use a stack frame allocated by our caller. */ - stp x29, x30, [x1] - mov x29, x1 - mov sp, x0 - - mov x9, x2 /* save fn */ - mov x8, x3 /* install structure return */ -#ifdef FFI_GO_CLOSURES - /*mov x18, x5 install static chain */ -#endif - stp x3, x4, [x29, #16] /* save rvalue and flags */ - - /* Load the vector argument passing registers, if necessary. */ - tbz x4, #AARCH64_FLAG_ARG_V_BIT, ffi_call_SYSV_L1 - ldp q0, q1, [sp, #0] - ldp q2, q3, [sp, #32] - ldp q4, q5, [sp, #64] - ldp q6, q7, [sp, #96] - -ffi_call_SYSV_L1 - /* Load the core argument passing registers, including - the structure return pointer. */ - ldp x0, x1, [sp, #16*N_V_ARG_REG + 0] - ldp x2, x3, [sp, #16*N_V_ARG_REG + 16] - ldp x4, x5, [sp, #16*N_V_ARG_REG + 32] - ldp x6, x7, [sp, #16*N_V_ARG_REG + 48] - - /* Deallocate the context, leaving the stacked arguments. */ - add sp, sp, #CALL_CONTEXT_SIZE - - blr x9 /* call fn */ - - ldp x3, x4, [x29, #16] /* reload rvalue and flags */ - - /* Partially deconstruct the stack frame. */ - mov sp, x29 - ldp x29, x30, [x29] - - /* Save the return value as directed. */ - adr x5, ffi_call_SYSV_return - and w4, w4, #AARCH64_RET_MASK - add x5, x5, x4, lsl #3 - br x5 - - /* Note that each table entry is 2 insns, and thus 8 bytes. - For integer data, note that we're storing into ffi_arg - and therefore we want to extend to 64 bits; these types - have two consecutive entries allocated for them. */ - ALIGN 4 -ffi_call_SYSV_return - ret /* VOID */ - nop - str x0, [x3] /* INT64 */ - ret - stp x0, x1, [x3] /* INT128 */ - ret - brk #1000 /* UNUSED */ - ret - brk #1000 /* UNUSED */ - ret - brk #1000 /* UNUSED */ - ret - brk #1000 /* UNUSED */ - ret - brk #1000 /* UNUSED */ - ret - st4 { v0.s, v1.s, v2.s, v3.s }[0], [x3] /* S4 */ - ret - st3 { v0.s, v1.s, v2.s }[0], [x3] /* S3 */ - ret - stp s0, s1, [x3] /* S2 */ - ret - str s0, [x3] /* S1 */ - ret - st4 { v0.d, v1.d, v2.d, v3.d }[0], [x3] /* D4 */ - ret - st3 { v0.d, v1.d, v2.d }[0], [x3] /* D3 */ - ret - stp d0, d1, [x3] /* D2 */ - ret - str d0, [x3] /* D1 */ - ret - str q3, [x3, #48] /* Q4 */ - nop - str q2, [x3, #32] /* Q3 */ - nop - stp q0, q1, [x3] /* Q2 */ - ret - str q0, [x3] /* Q1 */ - ret - uxtb w0, w0 /* UINT8 */ - str x0, [x3] - ret /* reserved */ - nop - uxth w0, w0 /* UINT16 */ - str x0, [x3] - ret /* reserved */ - nop - mov w0, w0 /* UINT32 */ - str x0, [x3] - ret /* reserved */ - nop - sxtb x0, w0 /* SINT8 */ - str x0, [x3] - ret /* reserved */ - nop - sxth x0, w0 /* SINT16 */ - str x0, [x3] - ret /* reserved */ - nop - sxtw x0, w0 /* SINT32 */ - str x0, [x3] - ret /* reserved */ - nop - - - NESTED_END ffi_call_SYSV_fake - - -/* ffi_closure_SYSV - Closure invocation glue. This is the low level code invoked directly by - the closure trampoline to setup and call a closure. - On entry x17 points to a struct ffi_closure, x16 has been clobbered - all other registers are preserved. - We allocate a call context and save the argument passing registers, - then invoked the generic C ffi_closure_SYSV_inner() function to do all - the real work, on return we load the result passing registers back from - the call context. -*/ - -#define ffi_closure_SYSV_FS (8*2 + CALL_CONTEXT_SIZE + 64) - - NESTED_ENTRY ffi_closure_SYSV_V - PROLOG_SAVE_REG_PAIR x29, x30, #-ffi_closure_SYSV_FS! - - /* Save the argument passing vector registers. */ - stp q0, q1, [sp, #16 + 0] - stp q2, q3, [sp, #16 + 32] - stp q4, q5, [sp, #16 + 64] - stp q6, q7, [sp, #16 + 96] - - b ffi_closure_SYSV_save_argument - NESTED_END ffi_closure_SYSV_V - - NESTED_ENTRY ffi_closure_SYSV - PROLOG_SAVE_REG_PAIR x29, x30, #-ffi_closure_SYSV_FS! - -ffi_closure_SYSV_save_argument - /* Save the argument passing core registers. */ - stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0] - stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16] - stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32] - stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] - - /* Load ffi_closure_inner arguments. */ - ldp PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */ - ldr PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2] /* load user_data */ - -do_closure - add x3, sp, #16 /* load context */ - add x4, sp, #ffi_closure_SYSV_FS /* load stack */ - add x5, sp, #16+CALL_CONTEXT_SIZE /* load rvalue */ - mov x6, x8 /* load struct_rval */ - - bl ffi_closure_SYSV_inner - - /* Load the return value as directed. */ - adr x1, ffi_closure_SYSV_return_base - and w0, w0, #AARCH64_RET_MASK - add x1, x1, x0, lsl #3 - add x3, sp, #16+CALL_CONTEXT_SIZE - br x1 - - /* Note that each table entry is 2 insns, and thus 8 bytes. */ - ALIGN 8 -ffi_closure_SYSV_return_base - b ffi_closure_SYSV_epilog /* VOID */ - nop - ldr x0, [x3] /* INT64 */ - b ffi_closure_SYSV_epilog - ldp x0, x1, [x3] /* INT128 */ - b ffi_closure_SYSV_epilog - brk #1000 /* UNUSED */ - nop - brk #1000 /* UNUSED */ - nop - brk #1000 /* UNUSED */ - nop - brk #1000 /* UNUSED */ - nop - brk #1000 /* UNUSED */ - nop - ldr s3, [x3, #12] /* S4 */ - nop - ldr s2, [x3, #8] /* S3 */ - nop - ldp s0, s1, [x3] /* S2 */ - b ffi_closure_SYSV_epilog - ldr s0, [x3] /* S1 */ - b ffi_closure_SYSV_epilog - ldr d3, [x3, #24] /* D4 */ - nop - ldr d2, [x3, #16] /* D3 */ - nop - ldp d0, d1, [x3] /* D2 */ - b ffi_closure_SYSV_epilog - ldr d0, [x3] /* D1 */ - b ffi_closure_SYSV_epilog - ldr q3, [x3, #48] /* Q4 */ - nop - ldr q2, [x3, #32] /* Q3 */ - nop - ldp q0, q1, [x3] /* Q2 */ - b ffi_closure_SYSV_epilog - ldr q0, [x3] /* Q1 */ - b ffi_closure_SYSV_epilog - ldrb w0, [x3, #BE(7)] /* UINT8 */ - b ffi_closure_SYSV_epilog - brk #1000 /* reserved */ - nop - ldrh w0, [x3, #BE(6)] /* UINT16 */ - b ffi_closure_SYSV_epilog - brk #1000 /* reserved */ - nop - ldr w0, [x3, #BE(4)] /* UINT32 */ - b ffi_closure_SYSV_epilog - brk #1000 /* reserved */ - nop - ldrsb x0, [x3, #BE(7)] /* SINT8 */ - b ffi_closure_SYSV_epilog - brk #1000 /* reserved */ - nop - ldrsh x0, [x3, #BE(6)] /* SINT16 */ - b ffi_closure_SYSV_epilog - brk #1000 /* reserved */ - nop - ldrsw x0, [x3, #BE(4)] /* SINT32 */ - nop - /* reserved */ - -ffi_closure_SYSV_epilog - EPILOG_RESTORE_REG_PAIR x29, x30, #ffi_closure_SYSV_FS! - EPILOG_RETURN - NESTED_END ffi_closure_SYSV - - -#ifdef FFI_GO_CLOSURES - NESTED_ENTRY ffi_go_closure_SYSV_V - PROLOG_SAVE_REG_PAIR x29, x30, #-ffi_closure_SYSV_FS! - - /* Save the argument passing vector registers. */ - stp q0, q1, [sp, #16 + 0] - stp q2, q3, [sp, #16 + 32] - stp q4, q5, [sp, #16 + 64] - stp q6, q7, [sp, #16 + 96] - b ffi_go_closure_SYSV_save_argument - NESTED_END ffi_go_closure_SYSV_V - - NESTED_ENTRY ffi_go_closure_SYSV - PROLOG_SAVE_REG_PAIR x29, x30, #-ffi_closure_SYSV_FS! - -ffi_go_closure_SYSV_save_argument - /* Save the argument passing core registers. */ - stp x0, x1, [sp, #16 + 16*N_V_ARG_REG + 0] - stp x2, x3, [sp, #16 + 16*N_V_ARG_REG + 16] - stp x4, x5, [sp, #16 + 16*N_V_ARG_REG + 32] - stp x6, x7, [sp, #16 + 16*N_V_ARG_REG + 48] - - /* Load ffi_closure_inner arguments. */ - ldp PTR_REG(0), PTR_REG(1), [x18, #PTR_SIZE]/* load cif, fn */ - mov x2, x18 /* load user_data */ - b do_closure - NESTED_END ffi_go_closure_SYSV - -#endif /* FFI_GO_CLOSURES */ - - -/* void extend_hfa_type (void *dest, void *src, int h) */ - - LEAF_ENTRY extend_hfa_type - - adr x3, extend_hfa_type_jump_base - and w2, w2, #AARCH64_RET_MASK - sub x2, x2, #AARCH64_RET_S4 - add x3, x3, x2, lsl #4 - br x3 - - ALIGN 4 -extend_hfa_type_jump_base - ldp s16, s17, [x1] /* S4 */ - ldp s18, s19, [x1, #8] - b extend_hfa_type_store_4 - nop - - ldp s16, s17, [x1] /* S3 */ - ldr s18, [x1, #8] - b extend_hfa_type_store_3 - nop - - ldp s16, s17, [x1] /* S2 */ - b extend_hfa_type_store_2 - nop - nop - - ldr s16, [x1] /* S1 */ - b extend_hfa_type_store_1 - nop - nop - - ldp d16, d17, [x1] /* D4 */ - ldp d18, d19, [x1, #16] - b extend_hfa_type_store_4 - nop - - ldp d16, d17, [x1] /* D3 */ - ldr d18, [x1, #16] - b extend_hfa_type_store_3 - nop - - ldp d16, d17, [x1] /* D2 */ - b extend_hfa_type_store_2 - nop - nop - - ldr d16, [x1] /* D1 */ - b extend_hfa_type_store_1 - nop - nop - - ldp q16, q17, [x1] /* Q4 */ - ldp q18, q19, [x1, #16] - b extend_hfa_type_store_4 - nop - - ldp q16, q17, [x1] /* Q3 */ - ldr q18, [x1, #16] - b extend_hfa_type_store_3 - nop - - ldp q16, q17, [x1] /* Q2 */ - b extend_hfa_type_store_2 - nop - nop - - ldr q16, [x1] /* Q1 */ - b extend_hfa_type_store_1 - -extend_hfa_type_store_4 - str q19, [x0, #48] -extend_hfa_type_store_3 - str q18, [x0, #32] -extend_hfa_type_store_2 - str q17, [x0, #16] -extend_hfa_type_store_1 - str q16, [x0] - ret - - LEAF_END extend_hfa_type - - -/* void compress_hfa_type (void *dest, void *reg, int h) */ - - LEAF_ENTRY compress_hfa_type - - adr x3, compress_hfa_type_jump_base - and w2, w2, #AARCH64_RET_MASK - sub x2, x2, #AARCH64_RET_S4 - add x3, x3, x2, lsl #4 - br x3 - - ALIGN 4 -compress_hfa_type_jump_base - ldp q16, q17, [x1] /* S4 */ - ldp q18, q19, [x1, #32] - st4 { v16.s, v17.s, v18.s, v19.s }[0], [x0] - ret - - ldp q16, q17, [x1] /* S3 */ - ldr q18, [x1, #32] - st3 { v16.s, v17.s, v18.s }[0], [x0] - ret - - ldp q16, q17, [x1] /* S2 */ - st2 { v16.s, v17.s }[0], [x0] - ret - nop - - ldr q16, [x1] /* S1 */ - st1 { v16.s }[0], [x0] - ret - nop - - ldp q16, q17, [x1] /* D4 */ - ldp q18, q19, [x1, #32] - st4 { v16.d, v17.d, v18.d, v19.d }[0], [x0] - ret - - ldp q16, q17, [x1] /* D3 */ - ldr q18, [x1, #32] - st3 { v16.d, v17.d, v18.d }[0], [x0] - ret - - ldp q16, q17, [x1] /* D2 */ - st2 { v16.d, v17.d }[0], [x0] - ret - nop - - ldr q16, [x1] /* D1 */ - st1 { v16.d }[0], [x0] - ret - nop - - ldp q16, q17, [x1] /* Q4 */ - ldp q18, q19, [x1, #32] - b compress_hfa_type_store_q4 - nop - - ldp q16, q17, [x1] /* Q3 */ - ldr q18, [x1, #32] - b compress_hfa_type_store_q3 - nop - - ldp q16, q17, [x1] /* Q2 */ - stp q16, q17, [x0] - ret - nop - - ldr q16, [x1] /* Q1 */ - str q16, [x0] - ret - -compress_hfa_type_store_q4 - str q19, [x0, #48] -compress_hfa_type_store_q3 - str q18, [x0, #32] - stp q16, q17, [x0] - ret - - LEAF_END compress_hfa_type - - END \ No newline at end of file diff --git a/deps/libffi/src/alpha/ffi.c b/deps/libffi/src/alpha/ffi.c deleted file mode 100644 index 7a95e9707c3a0f..00000000000000 --- a/deps/libffi/src/alpha/ffi.c +++ /dev/null @@ -1,521 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2012 Anthony Green - Copyright (c) 1998, 2001, 2007, 2008 Red Hat, Inc. - - Alpha Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include -#include -#include "internal.h" - -/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; - all further uses in this file will refer to the 128-bit type. */ -#if defined(__LONG_DOUBLE_128__) -# if FFI_TYPE_LONGDOUBLE != 4 -# error FFI_TYPE_LONGDOUBLE out of date -# endif -#else -# undef FFI_TYPE_LONGDOUBLE -# define FFI_TYPE_LONGDOUBLE 4 -#endif - -extern void ffi_call_osf(void *stack, void *frame, unsigned flags, - void *raddr, void (*fn)(void), void *closure) - FFI_HIDDEN; -extern void ffi_closure_osf(void) FFI_HIDDEN; -extern void ffi_go_closure_osf(void) FFI_HIDDEN; - -/* Promote a float value to its in-register double representation. - Unlike actually casting to double, this does not trap on NaN. */ -static inline UINT64 lds(void *ptr) -{ - UINT64 ret; - asm("lds %0,%1" : "=f"(ret) : "m"(*(UINT32 *)ptr)); - return ret; -} - -/* And the reverse. */ -static inline void sts(void *ptr, UINT64 val) -{ - asm("sts %1,%0" : "=m"(*(UINT32 *)ptr) : "f"(val)); -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep(ffi_cif *cif) -{ - size_t bytes = 0; - int flags, i, avn; - ffi_type *rtype, *itype; - - if (cif->abi != FFI_OSF) - return FFI_BAD_ABI; - - /* Compute the size of the argument area. */ - for (i = 0, avn = cif->nargs; i < avn; i++) - { - itype = cif->arg_types[i]; - switch (itype->type) - { - case FFI_TYPE_INT: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_POINTER: - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_LONGDOUBLE: - /* All take one 8 byte slot. */ - bytes += 8; - break; - - case FFI_TYPE_VOID: - case FFI_TYPE_STRUCT: - /* Passed by value in N slots. */ - bytes += FFI_ALIGN(itype->size, FFI_SIZEOF_ARG); - break; - - case FFI_TYPE_COMPLEX: - /* _Complex long double passed by reference; others in 2 slots. */ - if (itype->elements[0]->type == FFI_TYPE_LONGDOUBLE) - bytes += 8; - else - bytes += 16; - break; - - default: - abort(); - } - } - - /* Set the return type flag */ - rtype = cif->rtype; - switch (rtype->type) - { - case FFI_TYPE_VOID: - flags = ALPHA_FLAGS(ALPHA_ST_VOID, ALPHA_LD_VOID); - break; - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_INT32); - break; - case FFI_TYPE_FLOAT: - flags = ALPHA_FLAGS(ALPHA_ST_FLOAT, ALPHA_LD_FLOAT); - break; - case FFI_TYPE_DOUBLE: - flags = ALPHA_FLAGS(ALPHA_ST_DOUBLE, ALPHA_LD_DOUBLE); - break; - case FFI_TYPE_UINT8: - flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_UINT8); - break; - case FFI_TYPE_SINT8: - flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_SINT8); - break; - case FFI_TYPE_UINT16: - flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_UINT16); - break; - case FFI_TYPE_SINT16: - flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_SINT16); - break; - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_POINTER: - flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_INT64); - break; - case FFI_TYPE_LONGDOUBLE: - case FFI_TYPE_STRUCT: - /* Passed in memory, with a hidden pointer. */ - flags = ALPHA_RET_IN_MEM; - break; - case FFI_TYPE_COMPLEX: - itype = rtype->elements[0]; - switch (itype->type) - { - case FFI_TYPE_FLOAT: - flags = ALPHA_FLAGS(ALPHA_ST_CPLXF, ALPHA_LD_CPLXF); - break; - case FFI_TYPE_DOUBLE: - flags = ALPHA_FLAGS(ALPHA_ST_CPLXD, ALPHA_LD_CPLXD); - break; - default: - if (rtype->size <= 8) - flags = ALPHA_FLAGS(ALPHA_ST_INT, ALPHA_LD_INT64); - else - flags = ALPHA_RET_IN_MEM; - break; - } - break; - default: - abort(); - } - cif->flags = flags; - - /* Include the hidden structure pointer in args requirement. */ - if (flags == ALPHA_RET_IN_MEM) - bytes += 8; - /* Minimum size is 6 slots, so that ffi_call_osf can pop them. */ - if (bytes < 6*8) - bytes = 6*8; - cif->bytes = bytes; - - return FFI_OK; -} - -static unsigned long -extend_basic_type(void *valp, int type, int argn) -{ - switch (type) - { - case FFI_TYPE_SINT8: - return *(SINT8 *)valp; - case FFI_TYPE_UINT8: - return *(UINT8 *)valp; - case FFI_TYPE_SINT16: - return *(SINT16 *)valp; - case FFI_TYPE_UINT16: - return *(UINT16 *)valp; - - case FFI_TYPE_FLOAT: - if (argn < 6) - return lds(valp); - /* FALLTHRU */ - - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - /* Note that unsigned 32-bit quantities are sign extended. */ - return *(SINT32 *)valp; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_POINTER: - case FFI_TYPE_DOUBLE: - return *(UINT64 *)valp; - - default: - abort(); - } -} - -static void -ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - unsigned long *argp; - long i, avn, argn, flags = cif->flags; - ffi_type **arg_types; - void *frame; - - /* If the return value is a struct and we don't have a return - value address then we need to make one. */ - if (rvalue == NULL && flags == ALPHA_RET_IN_MEM) - rvalue = alloca(cif->rtype->size); - - /* Allocate the space for the arguments, plus 4 words of temp - space for ffi_call_osf. */ - argp = frame = alloca(cif->bytes + 4*FFI_SIZEOF_ARG); - frame += cif->bytes; - - argn = 0; - if (flags == ALPHA_RET_IN_MEM) - argp[argn++] = (unsigned long)rvalue; - - avn = cif->nargs; - arg_types = cif->arg_types; - - for (i = 0, avn = cif->nargs; i < avn; i++) - { - ffi_type *ty = arg_types[i]; - void *valp = avalue[i]; - int type = ty->type; - size_t size; - - switch (type) - { - case FFI_TYPE_INT: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_POINTER: - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - argp[argn] = extend_basic_type(valp, type, argn); - argn++; - break; - - case FFI_TYPE_LONGDOUBLE: - by_reference: - /* Note that 128-bit long double is passed by reference. */ - argp[argn++] = (unsigned long)valp; - break; - - case FFI_TYPE_VOID: - case FFI_TYPE_STRUCT: - size = ty->size; - memcpy(argp + argn, valp, size); - argn += FFI_ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; - break; - - case FFI_TYPE_COMPLEX: - type = ty->elements[0]->type; - if (type == FFI_TYPE_LONGDOUBLE) - goto by_reference; - - /* Most complex types passed as two separate arguments. */ - size = ty->elements[0]->size; - argp[argn] = extend_basic_type(valp, type, argn); - argp[argn + 1] = extend_basic_type(valp + size, type, argn + 1); - argn += 2; - break; - - default: - abort(); - } - } - - flags = (flags >> ALPHA_ST_SHIFT) & 0xff; - ffi_call_osf(argp, frame, flags, rvalue, fn, closure); -} - -void -ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - ffi_call_int(cif, fn, rvalue, avalue, NULL); -} - -void -ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int(cif, fn, rvalue, avalue, closure); -} - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - unsigned int *tramp; - - if (cif->abi != FFI_OSF) - return FFI_BAD_ABI; - - tramp = (unsigned int *) &closure->tramp[0]; - tramp[0] = 0x47fb0401; /* mov $27,$1 */ - tramp[1] = 0xa77b0010; /* ldq $27,16($27) */ - tramp[2] = 0x6bfb0000; /* jmp $31,($27),0 */ - tramp[3] = 0x47ff041f; /* nop */ - *(void **) &tramp[4] = ffi_closure_osf; - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - /* Flush the Icache. - - Tru64 UNIX as doesn't understand the imb mnemonic, so use call_pal - instead, since both Compaq as and gas can handle it. - - 0x86 is PAL_imb in Tru64 UNIX . */ - asm volatile ("call_pal 0x86" : : : "memory"); - - return FFI_OK; -} - -ffi_status -ffi_prep_go_closure (ffi_go_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*)) -{ - if (cif->abi != FFI_OSF) - return FFI_BAD_ABI; - - closure->tramp = (void *)ffi_go_closure_osf; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} - -long FFI_HIDDEN -ffi_closure_osf_inner (ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *rvalue, unsigned long *argp) -{ - void **avalue; - ffi_type **arg_types; - long i, avn, argn, flags; - - avalue = alloca(cif->nargs * sizeof(void *)); - flags = cif->flags; - argn = 0; - - /* Copy the caller's structure return address to that the closure - returns the data directly to the caller. */ - if (flags == ALPHA_RET_IN_MEM) - { - rvalue = (void *) argp[0]; - argn = 1; - } - - arg_types = cif->arg_types; - - /* Grab the addresses of the arguments from the stack frame. */ - for (i = 0, avn = cif->nargs; i < avn; i++) - { - ffi_type *ty = arg_types[i]; - int type = ty->type; - void *valp = &argp[argn]; - size_t size; - - switch (type) - { - case FFI_TYPE_INT: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_POINTER: - argn += 1; - break; - - case FFI_TYPE_VOID: - case FFI_TYPE_STRUCT: - size = ty->size; - argn += FFI_ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; - break; - - case FFI_TYPE_FLOAT: - /* Floats coming from registers need conversion from double - back to float format. */ - if (argn < 6) - { - valp = &argp[argn - 6]; - sts(valp, argp[argn - 6]); - } - argn += 1; - break; - - case FFI_TYPE_DOUBLE: - if (argn < 6) - valp = &argp[argn - 6]; - argn += 1; - break; - - case FFI_TYPE_LONGDOUBLE: - by_reference: - /* 128-bit long double is passed by reference. */ - valp = (void *)argp[argn]; - argn += 1; - break; - - case FFI_TYPE_COMPLEX: - type = ty->elements[0]->type; - switch (type) - { - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - /* Passed as separate arguments, but they wind up sequential. */ - break; - - case FFI_TYPE_INT: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - /* Passed as separate arguments. Disjoint, but there's room - enough in one slot to hold the pair. */ - size = ty->elements[0]->size; - memcpy(valp + size, valp + 8, size); - break; - - case FFI_TYPE_FLOAT: - /* Passed as separate arguments. Disjoint, and each piece - may need conversion back to float. */ - if (argn < 6) - { - valp = &argp[argn - 6]; - sts(valp, argp[argn - 6]); - } - if (argn + 1 < 6) - sts(valp + 4, argp[argn + 1 - 6]); - else - *(UINT32 *)(valp + 4) = argp[argn + 1]; - break; - - case FFI_TYPE_DOUBLE: - /* Passed as separate arguments. Only disjoint if one part - is in fp regs and the other is on the stack. */ - if (argn < 5) - valp = &argp[argn - 6]; - else if (argn == 5) - { - valp = alloca(16); - ((UINT64 *)valp)[0] = argp[5 - 6]; - ((UINT64 *)valp)[1] = argp[6]; - } - break; - - case FFI_TYPE_LONGDOUBLE: - goto by_reference; - - default: - abort(); - } - argn += 2; - break; - - default: - abort (); - } - - avalue[i] = valp; - } - - /* Invoke the closure. */ - fun (cif, rvalue, avalue, user_data); - - /* Tell ffi_closure_osf how to perform return type promotions. */ - return (flags >> ALPHA_LD_SHIFT) & 0xff; -} diff --git a/deps/libffi/src/alpha/ffitarget.h b/deps/libffi/src/alpha/ffitarget.h deleted file mode 100644 index a02dbd04f6df30..00000000000000 --- a/deps/libffi/src/alpha/ffitarget.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for Alpha. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_OSF, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_OSF -} ffi_abi; -#endif - -#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION -#define FFI_TARGET_HAS_COMPLEX_TYPE - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 24 -#define FFI_NATIVE_RAW_API 0 - -#endif diff --git a/deps/libffi/src/alpha/internal.h b/deps/libffi/src/alpha/internal.h deleted file mode 100644 index 44da1922bb9fed..00000000000000 --- a/deps/libffi/src/alpha/internal.h +++ /dev/null @@ -1,23 +0,0 @@ -#define ALPHA_ST_VOID 0 -#define ALPHA_ST_INT 1 -#define ALPHA_ST_FLOAT 2 -#define ALPHA_ST_DOUBLE 3 -#define ALPHA_ST_CPLXF 4 -#define ALPHA_ST_CPLXD 5 - -#define ALPHA_LD_VOID 0 -#define ALPHA_LD_INT64 1 -#define ALPHA_LD_INT32 2 -#define ALPHA_LD_UINT16 3 -#define ALPHA_LD_SINT16 4 -#define ALPHA_LD_UINT8 5 -#define ALPHA_LD_SINT8 6 -#define ALPHA_LD_FLOAT 7 -#define ALPHA_LD_DOUBLE 8 -#define ALPHA_LD_CPLXF 9 -#define ALPHA_LD_CPLXD 10 - -#define ALPHA_ST_SHIFT 0 -#define ALPHA_LD_SHIFT 8 -#define ALPHA_RET_IN_MEM 0x10000 -#define ALPHA_FLAGS(S, L) (((L) << ALPHA_LD_SHIFT) | (S)) diff --git a/deps/libffi/src/alpha/osf.S b/deps/libffi/src/alpha/osf.S deleted file mode 100644 index b0318282a015ac..00000000000000 --- a/deps/libffi/src/alpha/osf.S +++ /dev/null @@ -1,282 +0,0 @@ -/* ----------------------------------------------------------------------- - osf.S - Copyright (c) 1998, 2001, 2007, 2008, 2011, 2014 Red Hat - - Alpha/OSF Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#include -#include "internal.h" - - .arch ev6 - .text - -/* Aid in building a direct addressed jump table, 4 insns per entry. */ -.macro E index - .align 4 - .org 99b + \index * 16 -.endm - -/* ffi_call_osf (void *stack, void *frame, unsigned flags, - void *raddr, void (*fnaddr)(void), void *closure) - - Bit o trickiness here -- FRAME is the base of the stack frame - for this function. This has been allocated by ffi_call. We also - deallocate some of the stack that has been alloca'd. */ - - .align 4 - .globl ffi_call_osf - .ent ffi_call_osf - FFI_HIDDEN(ffi_call_osf) - -ffi_call_osf: - cfi_startproc - cfi_def_cfa($17, 32) - mov $16, $30 - stq $26, 0($17) - stq $15, 8($17) - mov $17, $15 - .prologue 0 - cfi_def_cfa_register($15) - cfi_rel_offset($26, 0) - cfi_rel_offset($15, 8) - - stq $18, 16($17) # save flags into frame - stq $19, 24($17) # save rvalue into frame - mov $20, $27 # fn into place for call - mov $21, $1 # closure into static chain - - # Load up all of the (potential) argument registers. - ldq $16, 0($30) - ldt $f16, 0($30) - ldt $f17, 8($30) - ldq $17, 8($30) - ldt $f18, 16($30) - ldq $18, 16($30) - ldt $f19, 24($30) - ldq $19, 24($30) - ldt $f20, 32($30) - ldq $20, 32($30) - ldt $f21, 40($30) - ldq $21, 40($30) - - # Deallocate the register argument area. - lda $30, 48($30) - - jsr $26, ($27), 0 -0: - ldah $29, 0($26) !gpdisp!1 - ldq $2, 24($15) # reload rvalue - lda $29, 0($29) !gpdisp!1 - ldq $3, 16($15) # reload flags - lda $1, 99f-0b($26) - ldq $26, 0($15) - ldq $15, 8($15) - cfi_restore($26) - cfi_restore($15) - cfi_def_cfa($sp, 0) - cmoveq $2, ALPHA_ST_VOID, $3 # mash null rvalue to void - addq $3, $3, $3 - s8addq $3, $1, $1 # 99f + stcode * 16 - jmp $31, ($1), $st_int - - .align 4 -99: -E ALPHA_ST_VOID - ret -E ALPHA_ST_INT -$st_int: - stq $0, 0($2) - ret -E ALPHA_ST_FLOAT - sts $f0, 0($2) - ret -E ALPHA_ST_DOUBLE - stt $f0, 0($2) - ret -E ALPHA_ST_CPLXF - sts $f0, 0($2) - sts $f1, 4($2) - ret -E ALPHA_ST_CPLXD - stt $f0, 0($2) - stt $f1, 8($2) - ret - - cfi_endproc - .end ffi_call_osf - -/* ffi_closure_osf(...) - - Receives the closure argument in $1. */ - -#define CLOSURE_FS (16*8) - - .align 4 - .globl ffi_go_closure_osf - .ent ffi_go_closure_osf - FFI_HIDDEN(ffi_go_closure_osf) - -ffi_go_closure_osf: - cfi_startproc - ldgp $29, 0($27) - subq $30, CLOSURE_FS, $30 - cfi_adjust_cfa_offset(CLOSURE_FS) - stq $26, 0($30) - .prologue 1 - cfi_rel_offset($26, 0) - - stq $16, 10*8($30) - stq $17, 11*8($30) - stq $18, 12*8($30) - - ldq $16, 8($1) # load cif - ldq $17, 16($1) # load fun - mov $1, $18 # closure is user_data - br $do_closure - - cfi_endproc - .end ffi_go_closure_osf - - .align 4 - .globl ffi_closure_osf - .ent ffi_closure_osf - FFI_HIDDEN(ffi_closure_osf) - -ffi_closure_osf: - cfi_startproc - ldgp $29, 0($27) - subq $30, CLOSURE_FS, $30 - cfi_adjust_cfa_offset(CLOSURE_FS) - stq $26, 0($30) - .prologue 1 - cfi_rel_offset($26, 0) - - # Store all of the potential argument registers in va_list format. - stq $16, 10*8($30) - stq $17, 11*8($30) - stq $18, 12*8($30) - - ldq $16, 24($1) # load cif - ldq $17, 32($1) # load fun - ldq $18, 40($1) # load user_data - -$do_closure: - stq $19, 13*8($30) - stq $20, 14*8($30) - stq $21, 15*8($30) - stt $f16, 4*8($30) - stt $f17, 5*8($30) - stt $f18, 6*8($30) - stt $f19, 7*8($30) - stt $f20, 8*8($30) - stt $f21, 9*8($30) - - # Call ffi_closure_osf_inner to do the bulk of the work. - lda $19, 2*8($30) - lda $20, 10*8($30) - jsr $26, ffi_closure_osf_inner -0: - ldah $29, 0($26) !gpdisp!2 - lda $2, 99f-0b($26) - s4addq $0, 0, $1 # ldcode * 4 - ldq $0, 16($30) # preload return value - s4addq $1, $2, $1 # 99f + ldcode * 16 - lda $29, 0($29) !gpdisp!2 - ldq $26, 0($30) - cfi_restore($26) - jmp $31, ($1), $load_32 - -.macro epilogue - addq $30, CLOSURE_FS, $30 - cfi_adjust_cfa_offset(-CLOSURE_FS) - ret - .align 4 - cfi_adjust_cfa_offset(CLOSURE_FS) -.endm - - .align 4 -99: -E ALPHA_LD_VOID - epilogue - -E ALPHA_LD_INT64 - epilogue - -E ALPHA_LD_INT32 -$load_32: - sextl $0, $0 - epilogue - -E ALPHA_LD_UINT16 - zapnot $0, 3, $0 - epilogue - -E ALPHA_LD_SINT16 -#ifdef __alpha_bwx__ - sextw $0, $0 -#else - sll $0, 48, $0 - sra $0, 48, $0 -#endif - epilogue - -E ALPHA_LD_UINT8 - and $0, 0xff, $0 - epilogue - -E ALPHA_LD_SINT8 -#ifdef __alpha_bwx__ - sextb $0, $0 -#else - sll $0, 56, $0 - sra $0, 56, $0 -#endif - epilogue - -E ALPHA_LD_FLOAT - lds $f0, 16($sp) - epilogue - -E ALPHA_LD_DOUBLE - ldt $f0, 16($sp) - epilogue - -E ALPHA_LD_CPLXF - lds $f0, 16($sp) - lds $f1, 20($sp) - epilogue - -E ALPHA_LD_CPLXD - ldt $f0, 16($sp) - ldt $f1, 24($sp) - epilogue - - cfi_endproc - .end ffi_closure_osf - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/arc/arcompact.S b/deps/libffi/src/arc/arcompact.S deleted file mode 100644 index e74934110202b4..00000000000000 --- a/deps/libffi/src/arc/arcompact.S +++ /dev/null @@ -1,210 +0,0 @@ -/* ----------------------------------------------------------------------- - arcompact.S - Copyright (c) 2013 Synposys, Inc. (www.synopsys.com) - - ARCompact Foreign Function Interface - - 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 RENESAS TECHNOLOGY 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#ifdef HAVE_MACHINE_ASM_H -#include -#else -#define CNAME(x) x -#define ENTRY(x) .globl CNAME(x)` .type CNAME(x),%function` CNAME(x): -#endif - -#if __SIZEOF_POINTER__ == 8 -#define PTRS 8 -#define FLTS 8 -#define LARG ldl -#define SARG stl -#define ADDPTR addl -#define MOVPTR movl -#else -#define PTRS 4 -#define FLTS 4 -#define LARG ld -#define SARG st -#define ADDPTR add -#define MOVPTR mov -#endif - -#define FRAME_LEN (8 * PTRS + 16) - -.text - -ENTRY(ffi_call_asm) - .cfi_startproc - - /* Save registers. */ - .cfi_def_cfa r1, FRAME_LEN - SARG fp, [r1, FRAME_LEN - 2*PTRS] - .cfi_offset fp, -2*PTRS - SARG blink, [r1, FRAME_LEN - 1*PTRS] - .cfi_offset blink, -1*PTRS - ADDPTR fp, r1, FRAME_LEN - MOVPTR sp, r0 - .cfi_def_cfa fp, 0 - - /* Load arguments. */ - MOVPTR r11, r2 /* fn */ - MOVPTR r12, r3 /* closure */ - - /* Save arguments. */ - LARG r0, [fp, -FRAME_LEN+0*PTRS] - LARG r1, [fp, -FRAME_LEN+1*PTRS] - LARG r2, [fp, -FRAME_LEN+2*PTRS] - LARG r3, [fp, -FRAME_LEN+3*PTRS] - LARG r4, [fp, -FRAME_LEN+4*PTRS] - LARG r5, [fp, -FRAME_LEN+5*PTRS] - LARG r6, [fp, -FRAME_LEN+6*PTRS] - LARG r7, [fp, -FRAME_LEN+7*PTRS] - - /* Call the function. */ - jl [r11] - - /* Save return value (r0/r1) */ - SARG r0, [fp, -FRAME_LEN+0*PTRS] - SARG r1, [fp, -FRAME_LEN+1*PTRS] - - /* Restore and return. */ - add sp, fp, -FRAME_LEN - .cfi_def_cfa sp, FRAME_LEN - LARG blink, [fp, -1*PTRS] - .cfi_restore blink - LARG fp, [fp, -2*PTRS] - .cfi_restore fp - j_s [blink] - .cfi_endproc - .size ffi_call_asm, .-ffi_call_asm - -/* - ffi_closure_asm. Expects address of the passed-in ffi_closure in r8. - void ffi_closure_inner (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - size_t *stackargs, struct call_context *regargs) -*/ - -ENTRY(ffi_closure_asm) - .cfi_startproc - - ADDPTR sp, sp, -FRAME_LEN - .cfi_def_cfa_offset FRAME_LEN - - /* Make a frame. */ - SARG fp, [sp, FRAME_LEN-2*PTRS] - .cfi_offset fp, -2*PTRS - SARG blink, [sp, FRAME_LEN-1*PTRS] - .cfi_offset blink, -1*PTRS - ADDPTR fp, sp, FRAME_LEN - - /* Save arguments. */ - SARG r0, [sp, 0*PTRS] - SARG r1, [sp, 1*PTRS] - SARG r2, [sp, 2*PTRS] - SARG r3, [sp, 3*PTRS] - SARG r4, [sp, 4*PTRS] - SARG r5, [sp, 5*PTRS] - SARG r6, [sp, 6*PTRS] - SARG r7, [sp, 7*PTRS] - - /* Enter C. */ - LARG r0, [r8, FFI_TRAMPOLINE_SIZE+0*PTRS] - LARG r1, [r8, FFI_TRAMPOLINE_SIZE+1*PTRS] - LARG r2, [r8, FFI_TRAMPOLINE_SIZE+2*PTRS] - ADDPTR r3, sp, FRAME_LEN - MOVPTR r4, sp - - /* Call the C code. */ - bl ffi_closure_inner - - /* Return values. */ - LARG r0, [sp, 0*PTRS] - LARG r1, [sp, 1*PTRS] - - /* Restore and return. */ - LARG blink, [sp, FRAME_LEN-1*PTRS] - .cfi_restore blink - LARG fp, [sp, FRAME_LEN-2*PTRS] - .cfi_restore fp - ADDPTR sp, sp, FRAME_LEN - .cfi_def_cfa_offset 0 - j_s [blink] - .cfi_endproc - .size ffi_closure_asm, .-ffi_closure_asm - -/* - ffi_go_closure_asm. Expects address of the passed-in ffi_go_closure in r12. - void ffi_closure_inner (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - size_t *stackargs, struct call_context *regargs) -*/ - -ENTRY(ffi_go_closure_asm) - .cfi_startproc - - ADDPTR sp, sp, -FRAME_LEN - .cfi_def_cfa_offset FRAME_LEN - - /* make a frame */ - SARG fp, [sp, FRAME_LEN-2*PTRS] - .cfi_offset fp, -2*PTRS - SARG blink, [sp, FRAME_LEN-1*PTRS] - .cfi_offset blink, -1*PTRS - ADDPTR fp, sp, FRAME_LEN - - /* save arguments */ - SARG r0, [sp, 0*PTRS] - SARG r1, [sp, 1*PTRS] - SARG r2, [sp, 2*PTRS] - SARG r3, [sp, 3*PTRS] - SARG r4, [sp, 4*PTRS] - SARG r5, [sp, 5*PTRS] - SARG r6, [sp, 6*PTRS] - SARG r7, [sp, 7*PTRS] - - /* enter C */ - LARG r0, [r12, 1*PTRS] - LARG r1, [r12, 2*PTRS] - MOVPTR r2, r12 - ADDPTR r3, sp, FRAME_LEN - MOVPTR r4, sp - - bl ffi_closure_inner - - /* Return values. */ - LARG r0, [sp, 0*PTRS] - LARG r1, [sp, 1*PTRS] - - - LARG blink, [sp, FRAME_LEN-1*PTRS] - .cfi_restore blink - LARG fp, [sp, FRAME_LEN-2*PTRS] - .cfi_restore fp - ADDPTR sp, sp, FRAME_LEN - .cfi_def_cfa_offset 0 - j_s [blink] - .cfi_endproc - .size ffi_go_closure_asm, .-ffi_go_closure_asm diff --git a/deps/libffi/src/arc/ffi.c b/deps/libffi/src/arc/ffi.c deleted file mode 100644 index 0632319139bb53..00000000000000 --- a/deps/libffi/src/arc/ffi.c +++ /dev/null @@ -1,447 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com) - - ARC Foreign Function Interface - - 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 RENESAS TECHNOLOGY 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include - -#include - -#define NARGREG 8 -#define STKALIGN 4 -#define MAXCOPYARG (2 * sizeof(double)) - -typedef struct call_context -{ - size_t r[8]; - /* used by the assembly code to in-place construct its own stack frame */ - char frame[16]; -} call_context; - -typedef struct call_builder -{ - call_context *aregs; - int used_integer; - //int used_float; - size_t *used_stack; - void *struct_stack; -} call_builder; - -/* integer (not pointer) less than ABI XLEN */ -/* FFI_TYPE_INT does not appear to be used */ -#if defined(__ARC64_ARCH64__) -#define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT64) -#else -#define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT32) -#endif - -/* for little endian ARC, the code is in fact stored as mixed endian for - performance reasons */ -#if __BIG_ENDIAN__ -#define CODE_ENDIAN(x) (x) -#else -#define CODE_ENDIAN(x) ( (((uint32_t) (x)) << 16) | (((uint32_t) (x)) >> 16)) -#endif - -/* Perform machine dependent cif processing. */ -ffi_status -ffi_prep_cif_machdep (ffi_cif * cif) -{ - /* Set the return type flag. */ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - cif->flags = (unsigned) cif->rtype->type; - break; - - case FFI_TYPE_STRUCT: - cif->flags = (unsigned) cif->rtype->type; - break; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_DOUBLE: - cif->flags = FFI_TYPE_DOUBLE; - break; - - case FFI_TYPE_FLOAT: - default: - cif->flags = FFI_TYPE_INT; - break; - } - - return FFI_OK; -} - -/* allocates a single register, float register, or XLEN-sized stack slot to a datum */ -static void marshal_atom(call_builder *cb, int type, void *data) { - size_t value = 0; - switch (type) { - case FFI_TYPE_UINT8: value = *(uint8_t *)data; break; - case FFI_TYPE_SINT8: value = *(int8_t *)data; break; - case FFI_TYPE_UINT16: value = *(uint16_t *)data; break; - case FFI_TYPE_SINT16: value = *(int16_t *)data; break; - /* 32-bit quantities are always sign-extended in the ABI */ - case FFI_TYPE_UINT32: value = *(int32_t *)data; break; - case FFI_TYPE_SINT32: value = *(int32_t *)data; break; -#if defined(__ARC64_ARCH64__) - case FFI_TYPE_UINT64: value = *(uint64_t *)data; break; - case FFI_TYPE_SINT64: value = *(int64_t *)data; break; -#endif - case FFI_TYPE_POINTER: value = *(size_t *)data; break; - default: FFI_ASSERT(0); break; - } - - if (cb->used_integer == NARGREG) { - *cb->used_stack++ = value; - } else { - cb->aregs->r[cb->used_integer++] = value; - } -} - -/* adds an argument to a call, or a not by reference return value */ -static void marshal(call_builder *cb, ffi_type *type, int var, void *data) { - size_t realign[2]; - -#if (defined(__ARC64_ARCH64__) || defined(__ARC64_ARCH32__)) - if (type->size > 2 * __SIZEOF_POINTER__) { - if (var) { - marshal_atom(cb, FFI_TYPE_POINTER, &data); - } else { - /* copy to stack and pass by reference */ - data = memcpy (cb->struct_stack, data, type->size); - cb->struct_stack = (size_t *) FFI_ALIGN ((char *) cb->struct_stack + type->size, __SIZEOF_POINTER__); - marshal_atom(cb, FFI_TYPE_POINTER, &data); - } - } -#else - if (type->type == FFI_TYPE_STRUCT) { - if (var) { - if (type->size > 0) - marshal_atom(cb, FFI_TYPE_POINTER, data); - } else { - int i; - - for (i = 0; i < type->size; i += sizeof(size_t)) { - marshal_atom(cb, FFI_TYPE_POINTER, data); - data += sizeof(size_t); - } - } - } -#endif - else if (IS_INT(type->type) || type->type == FFI_TYPE_POINTER) { - marshal_atom(cb, type->type, data); - } else { - memcpy(realign, data, type->size); - if (type->size > 0) - marshal_atom(cb, FFI_TYPE_POINTER, realign); - if (type->size > __SIZEOF_POINTER__) - marshal_atom(cb, FFI_TYPE_POINTER, realign + 1); - } -} - -static void unmarshal_atom(call_builder *cb, int type, void *data) { - size_t value; - - if (cb->used_integer == NARGREG) { - value = *cb->used_stack++; - } else { - value = cb->aregs->r[cb->used_integer++]; - } - - switch (type) { - case FFI_TYPE_UINT8: *(uint8_t *)data = value; break; - case FFI_TYPE_SINT8: *(uint8_t *)data = value; break; - case FFI_TYPE_UINT16: *(uint16_t *)data = value; break; - case FFI_TYPE_SINT16: *(uint16_t *)data = value; break; - case FFI_TYPE_UINT32: *(uint32_t *)data = value; break; - case FFI_TYPE_SINT32: *(uint32_t *)data = value; break; -#if defined(__ARC64_ARCH64__) - case FFI_TYPE_UINT64: *(uint64_t *)data = value; break; - case FFI_TYPE_SINT64: *(uint64_t *)data = value; break; -#endif - case FFI_TYPE_POINTER: *(size_t *)data = value; break; - default: FFI_ASSERT(0); break; - } -} - -/* for arguments passed by reference returns the pointer, otherwise the arg is copied (up to MAXCOPYARG bytes) */ -static void *unmarshal(call_builder *cb, ffi_type *type, int var, void *data) { - size_t realign[2]; - -#if defined(__ARC64_ARCH64__) - void *pointer; - - if (type->size > 2 * __SIZEOF_POINTER__) { - /* pass by reference */ - unmarshal_atom(cb, FFI_TYPE_POINTER, (char*)&pointer); - return pointer; - } -#elif defined(__ARC64_ARCH32__) - if (type->type == FFI_TYPE_STRUCT) { - if (type->size > 2 * __SIZEOF_POINTER__) { - unmarshal_atom(cb, FFI_TYPE_POINTER, &realign[0]); - memcpy(data, (const void*)realign[0], type->size); - return data; - } else { - int i; - void *pdata = data; - - for (i = 0; i < type->size; i += sizeof(size_t)) { - unmarshal_atom(cb, FFI_TYPE_POINTER, pdata); - pdata += sizeof(size_t); - } - return data; - } - } -#else - if (type->type == FFI_TYPE_STRUCT) { - - if (var) { - int i; - void *pdata = data; - - for (i = 0; i < type->size; i += sizeof(size_t)) { - unmarshal_atom(cb, FFI_TYPE_POINTER, pdata); - pdata += sizeof(size_t); - } - return data; - } else { - if (type->size > 0) - unmarshal_atom(cb, FFI_TYPE_POINTER, &realign[0]); - memcpy(data, (const void*)realign[0], type->size); - return data; - } - } -#endif - else if (IS_INT(type->type) || type->type == FFI_TYPE_POINTER) { - unmarshal_atom(cb, type->type, data); - return data; - } else { - if (type->size > 0) - unmarshal_atom(cb, FFI_TYPE_POINTER, realign); - if (type->size > __SIZEOF_POINTER__) - unmarshal_atom(cb, FFI_TYPE_POINTER, realign + 1); - memcpy(data, realign, type->size); - return data; - } -} - -static int passed_by_ref(ffi_type *type, int var) { - if (type->type == FFI_TYPE_STRUCT) - return 1; - - return type->size > 2 * __SIZEOF_POINTER__; -} - -/* Low level routine for calling functions */ -extern void ffi_call_asm (void *stack, struct call_context *regs, - void (*fn) (void), void *closure) FFI_HIDDEN; - -static void -ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, - void *closure) -{ - int return_by_ref = passed_by_ref(cif->rtype, 0); - - /* Allocate space for stack arg parameters. */ - size_t arg_bytes = FFI_ALIGN(2 * sizeof(size_t) * cif->nargs, STKALIGN); - /* Allocate space for copies of big structures. */ - size_t struct_bytes = FFI_ALIGN(cif->bytes, STKALIGN); - // size_t rval_bytes = 0; - // if (rvalue == NULL && cif->rtype->size > 2*__SIZEOF_POINTER__) - // rval_bytes = FFI_ALIGN(cif->rtype->size, STKALIGN); - size_t alloc_size = arg_bytes + /*rval_bytes +*/ struct_bytes + sizeof(call_context); - size_t alloc_base = (size_t)alloca(alloc_size); - - // if (rval_bytes) - // rvalue = (void*)(alloc_base + arg_bytes); - - call_builder cb; - cb.used_integer = 0; - cb.aregs = (call_context*)(alloc_base + arg_bytes /*+ rval_bytes*/ + struct_bytes); - cb.used_stack = (void*)alloc_base; - cb.struct_stack = (void *)(alloc_base + arg_bytes /*+ rval_bytes*/); - - // if (cif->rtype->type == FFI_TYPE_STRUCT) - // marshal(&cb, &ffi_type_pointer, 0, &rvalue); - - if (return_by_ref) - marshal(&cb, &ffi_type_pointer, 0, &rvalue); - - int i; - for (i = 0; i < cif->nargs; i++) - marshal(&cb, cif->arg_types[i], 0, avalue[i]); - - ffi_call_asm ((void *) alloc_base, cb.aregs, fn, closure); - - cb.used_integer = 0; - if (!return_by_ref && rvalue) - { - if (IS_INT(cif->rtype->type) - && cif->rtype->size < sizeof (ffi_arg)) - { - /* Integer types smaller than ffi_arg need to be extended. */ - switch (cif->rtype->type) { - case FFI_TYPE_SINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_SINT32: - unmarshal_atom (&cb, (sizeof (ffi_arg) > 4 - ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32), - rvalue); - break; - case FFI_TYPE_UINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_UINT32: - unmarshal_atom (&cb, (sizeof (ffi_arg) > 4 - ? FFI_TYPE_UINT64 : FFI_TYPE_UINT32), - rvalue); - break; - } - } - else - unmarshal(&cb, cif->rtype, 0, rvalue); - } -} - -void -ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) -{ - ffi_call_int(cif, fn, rvalue, avalue, NULL); -} - -void -ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int(cif, fn, rvalue, avalue, closure); -} - -extern void ffi_closure_asm(void) FFI_HIDDEN; - -ffi_status -ffi_prep_closure_loc (ffi_closure * closure, ffi_cif * cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, void *codeloc) -{ - uint32_t *tramp = (uint32_t *) & (closure->tramp[0]); - -#if defined(__ARC64_ARCH64__) - size_t address_ffi_closure = (size_t) ffi_closure_asm; -#endif - - switch (cif->abi) - { -#if defined(__ARC64_ARCH64__) - case FFI_ARC64: - FFI_ASSERT (tramp == codeloc); - tramp[0] = CODE_ENDIAN (0x580a1fc0); /* movl r8, pcl */ - tramp[1] = CODE_ENDIAN (0x5c0b1f80); /* movhl r12, limm */ - tramp[2] = CODE_ENDIAN ((uint32_t)(address_ffi_closure >> 32)); - tramp[3] = CODE_ENDIAN (0x5c051f8c); /* orl r12, r12, limm */ - tramp[4] = CODE_ENDIAN ((uint32_t)(address_ffi_closure & 0xffffffff)); - tramp[5] = CODE_ENDIAN (0x20200300); /* j [r12] */ - break; -#else - case FFI_ARCOMPACT: - FFI_ASSERT (tramp == codeloc); - tramp[0] = CODE_ENDIAN (0x200a1fc0); /* mov r8, pcl */ - tramp[1] = CODE_ENDIAN (0x20200f80); /* j [long imm] */ - tramp[2] = CODE_ENDIAN ((uint32_t) ffi_closure_asm); - break; -#endif - - default: - return FFI_BAD_ABI; - } - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - cacheflush (codeloc, FFI_TRAMPOLINE_SIZE, BCACHE); - - return FFI_OK; -} - -extern void ffi_go_closure_asm (void) FFI_HIDDEN; - -ffi_status -ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *)) -{ - if (cif->abi <= FFI_FIRST_ABI || cif->abi >= FFI_LAST_ABI) - return FFI_BAD_ABI; - - closure->tramp = (void *) ffi_go_closure_asm; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} - -/* Called by the assembly code with aregs pointing to saved argument registers - and stack pointing to the stacked arguments. Return values passed in - registers will be reloaded from aregs. */ -void FFI_HIDDEN -ffi_closure_inner (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - size_t *stack, call_context *aregs) -{ - void **avalue = alloca(cif->nargs * sizeof(void*)); - /* storage for arguments which will be copied by unmarshal(). We could - theoretically avoid the copies in many cases and use at most 128 bytes - of memory, but allocating disjoint storage for each argument is - simpler. */ - char *astorage = alloca(cif->bytes); - char *ptr = astorage; - void *rvalue; - call_builder cb; - int i; - - cb.aregs = aregs; - cb.used_integer = 0; - cb.used_stack = stack; - - /* handle hidden argument */ - if (cif->flags == FFI_TYPE_STRUCT) - unmarshal(&cb, &ffi_type_pointer, 0, &rvalue); - else - rvalue = alloca(cif->rtype->size); - - for (i = 0; i < cif->nargs; i++) { - avalue[i] = unmarshal(&cb, cif->arg_types[i], 1, ptr); - ptr += cif->arg_types[i]->size; - } - - fun (cif, rvalue, avalue, user_data); - - if (cif->rtype->type != FFI_TYPE_VOID) { - cb.used_integer = 0; - marshal(&cb, cif->rtype, 1, rvalue); - } -} diff --git a/deps/libffi/src/arc/ffitarget.h b/deps/libffi/src/arc/ffitarget.h deleted file mode 100644 index 5b36902e714a2b..00000000000000 --- a/deps/libffi/src/arc/ffitarget.h +++ /dev/null @@ -1,67 +0,0 @@ -/* ----------------------------------------------------------------------- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com) - Target configuration macros for ARC. - - 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 RENESAS TECHNOLOGY 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- Generic type definitions ----------------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi -{ - FFI_FIRST_ABI = 0, -#if __SIZEOF_POINTER__ == 8 - FFI_ARC64, -#else - FFI_ARCOMPACT, -#endif - FFI_LAST_ABI, -#if __SIZEOF_POINTER__ == 8 - FFI_DEFAULT_ABI = FFI_ARC64 -#else - FFI_DEFAULT_ABI = FFI_ARCOMPACT -#endif -} ffi_abi; -#endif - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 -#if __SIZEOF_POINTER__ == 8 -#define FFI_TRAMPOLINE_SIZE 24 -#else -#define FFI_TRAMPOLINE_SIZE 12 -#endif - -#define FFI_NATIVE_RAW_API 0 - -#endif diff --git a/deps/libffi/src/arm/ffi.c b/deps/libffi/src/arm/ffi.c deleted file mode 100644 index cfd3e9d19ebd4b..00000000000000 --- a/deps/libffi/src/arm/ffi.c +++ /dev/null @@ -1,921 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2011 Timothy Wall - Copyright (c) 2011 Plausible Labs Cooperative, Inc. - Copyright (c) 2011 Anthony Green - Copyright (c) 2011 Free Software Foundation - Copyright (c) 1998, 2008, 2011 Red Hat, Inc. - - ARM Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#if defined(__arm__) || defined(_M_ARM) -#include -#include -#include -#include -#include -#include -#include "internal.h" - -#if defined(_WIN32) -#define WIN32_LEAN_AND_MEAN -#include -#endif - -#if FFI_EXEC_TRAMPOLINE_TABLE - -#ifdef __MACH__ -#include -#endif - -#else -#ifndef _WIN32 -extern unsigned int ffi_arm_trampoline[2] FFI_HIDDEN; -#else -// Declare this as an array of char, instead of array of int, -// otherwise Clang optimizes out the "& 0xFFFFFFFE" for clearing -// the thumb bit. -extern unsigned char ffi_arm_trampoline[12] FFI_HIDDEN; -#endif -#endif - -#if defined(__FreeBSD__) && defined(__arm__) -#include -#include -#endif - -#if defined(__QNX__) -#include -#endif - -/* Forward declares. */ -static int vfp_type_p (const ffi_type *); -static void layout_vfp_args (ffi_cif *); - -static void * -ffi_align (ffi_type *ty, void *p) -{ - /* Align if necessary */ - size_t alignment; -#ifdef _WIN32_WCE - alignment = 4; -#else - alignment = ty->alignment; - if (alignment < 4) - alignment = 4; -#endif - return (void *) FFI_ALIGN (p, alignment); -} - -static size_t -ffi_put_arg (ffi_type *ty, void *src, void *dst) -{ - size_t z = ty->size; - - switch (ty->type) - { - case FFI_TYPE_SINT8: - *(UINT32 *)dst = *(SINT8 *)src; - break; - case FFI_TYPE_UINT8: - *(UINT32 *)dst = *(UINT8 *)src; - break; - case FFI_TYPE_SINT16: - *(UINT32 *)dst = *(SINT16 *)src; - break; - case FFI_TYPE_UINT16: - *(UINT32 *)dst = *(UINT16 *)src; - break; - - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_POINTER: -#ifndef _WIN32 - case FFI_TYPE_FLOAT: -#endif - *(UINT32 *)dst = *(UINT32 *)src; - break; - -#ifdef _WIN32 - // casting a float* to a UINT32* doesn't work on Windows - case FFI_TYPE_FLOAT: - *(uintptr_t *)dst = 0; - *(float *)dst = *(float *)src; - break; -#endif - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_DOUBLE: - *(UINT64 *)dst = *(UINT64 *)src; - break; - - case FFI_TYPE_STRUCT: - case FFI_TYPE_COMPLEX: - memcpy (dst, src, z); - break; - - default: - abort(); - } - - return FFI_ALIGN (z, 4); -} - -/* ffi_prep_args is called once stack space has been allocated - for the function's arguments. - - The vfp_space parameter is the load area for VFP regs, the return - value is cif->vfp_used (word bitset of VFP regs used for passing - arguments). These are only used for the VFP hard-float ABI. -*/ -static void -ffi_prep_args_SYSV (ffi_cif *cif, int flags, void *rvalue, - void **avalue, char *argp) -{ - ffi_type **arg_types = cif->arg_types; - int i, n; - - if (flags == ARM_TYPE_STRUCT) - { - *(void **) argp = rvalue; - argp += 4; - } - - for (i = 0, n = cif->nargs; i < n; i++) - { - ffi_type *ty = arg_types[i]; - argp = ffi_align (ty, argp); - argp += ffi_put_arg (ty, avalue[i], argp); - } -} - -static void -ffi_prep_args_VFP (ffi_cif *cif, int flags, void *rvalue, - void **avalue, char *stack, char *vfp_space) -{ - ffi_type **arg_types = cif->arg_types; - int i, n, vi = 0; - char *argp, *regp, *eo_regp; - char stack_used = 0; - char done_with_regs = 0; - - /* The first 4 words on the stack are used for values - passed in core registers. */ - regp = stack; - eo_regp = argp = regp + 16; - - /* If the function returns an FFI_TYPE_STRUCT in memory, - that address is passed in r0 to the function. */ - if (flags == ARM_TYPE_STRUCT) - { - *(void **) regp = rvalue; - regp += 4; - } - - for (i = 0, n = cif->nargs; i < n; i++) - { - ffi_type *ty = arg_types[i]; - void *a = avalue[i]; - int is_vfp_type = vfp_type_p (ty); - - /* Allocated in VFP registers. */ - if (vi < cif->vfp_nargs && is_vfp_type) - { - char *vfp_slot = vfp_space + cif->vfp_args[vi++] * 4; - ffi_put_arg (ty, a, vfp_slot); - continue; - } - /* Try allocating in core registers. */ - else if (!done_with_regs && !is_vfp_type) - { - char *tregp = ffi_align (ty, regp); - size_t size = ty->size; - size = (size < 4) ? 4 : size; // pad - /* Check if there is space left in the aligned register - area to place the argument. */ - if (tregp + size <= eo_regp) - { - regp = tregp + ffi_put_arg (ty, a, tregp); - done_with_regs = (regp == argp); - // ensure we did not write into the stack area - FFI_ASSERT (regp <= argp); - continue; - } - /* In case there are no arguments in the stack area yet, - the argument is passed in the remaining core registers - and on the stack. */ - else if (!stack_used) - { - stack_used = 1; - done_with_regs = 1; - argp = tregp + ffi_put_arg (ty, a, tregp); - FFI_ASSERT (eo_regp < argp); - continue; - } - } - /* Base case, arguments are passed on the stack */ - stack_used = 1; - argp = ffi_align (ty, argp); - argp += ffi_put_arg (ty, a, argp); - } -} - -/* Perform machine dependent cif processing */ -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep (ffi_cif *cif) -{ - int flags = 0, cabi = cif->abi; - size_t bytes = cif->bytes; - - /* Map out the register placements of VFP register args. The VFP - hard-float calling conventions are slightly more sophisticated - than the base calling conventions, so we do it here instead of - in ffi_prep_args(). */ - if (cabi == FFI_VFP) - layout_vfp_args (cif); - - /* Set the return type flag */ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - flags = ARM_TYPE_VOID; - break; - - case FFI_TYPE_INT: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_POINTER: - flags = ARM_TYPE_INT; - break; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - flags = ARM_TYPE_INT64; - break; - - case FFI_TYPE_FLOAT: - flags = (cabi == FFI_VFP ? ARM_TYPE_VFP_S : ARM_TYPE_INT); - break; - case FFI_TYPE_DOUBLE: - flags = (cabi == FFI_VFP ? ARM_TYPE_VFP_D : ARM_TYPE_INT64); - break; - - case FFI_TYPE_STRUCT: - case FFI_TYPE_COMPLEX: - if (cabi == FFI_VFP) - { - int h = vfp_type_p (cif->rtype); - - flags = ARM_TYPE_VFP_N; - if (h == 0x100 + FFI_TYPE_FLOAT) - flags = ARM_TYPE_VFP_S; - if (h == 0x100 + FFI_TYPE_DOUBLE) - flags = ARM_TYPE_VFP_D; - if (h != 0) - break; - } - - /* A Composite Type not larger than 4 bytes is returned in r0. - A Composite Type larger than 4 bytes, or whose size cannot - be determined statically ... is stored in memory at an - address passed [in r0]. */ - if (cif->rtype->size <= 4) - flags = ARM_TYPE_INT; - else - { - flags = ARM_TYPE_STRUCT; - bytes += 4; - } - break; - - default: - abort(); - } - - /* Round the stack up to a multiple of 8 bytes. This isn't needed - everywhere, but it is on some platforms, and it doesn't harm anything - when it isn't needed. */ - bytes = FFI_ALIGN (bytes, 8); - - /* Minimum stack space is the 4 register arguments that we pop. */ - if (bytes < 4*4) - bytes = 4*4; - - cif->bytes = bytes; - cif->flags = flags; - - return FFI_OK; -} - -/* Perform machine dependent cif processing for variadic calls */ -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep_var (ffi_cif * cif, - unsigned int nfixedargs, unsigned int ntotalargs) -{ - /* VFP variadic calls actually use the SYSV ABI */ - if (cif->abi == FFI_VFP) - cif->abi = FFI_SYSV; - - return ffi_prep_cif_machdep (cif); -} - -/* Prototypes for assembly functions, in sysv.S. */ - -struct call_frame -{ - void *fp; - void *lr; - void *rvalue; - int flags; - void *closure; -}; - -extern void ffi_call_SYSV (void *stack, struct call_frame *, - void (*fn) (void)) FFI_HIDDEN; -extern void ffi_call_VFP (void *vfp_space, struct call_frame *, - void (*fn) (void), unsigned vfp_used) FFI_HIDDEN; - -static void -ffi_call_int (ffi_cif * cif, void (*fn) (void), void *rvalue, - void **avalue, void *closure) -{ - int flags = cif->flags; - ffi_type *rtype = cif->rtype; - size_t bytes, rsize, vfp_size; - char *stack, *vfp_space, *new_rvalue; - struct call_frame *frame; - - rsize = 0; - if (rvalue == NULL) - { - /* If the return value is a struct and we don't have a return - value address then we need to make one. Otherwise the return - value is in registers and we can ignore them. */ - if (flags == ARM_TYPE_STRUCT) - rsize = rtype->size; - else - flags = ARM_TYPE_VOID; - } - else if (flags == ARM_TYPE_VFP_N) - { - /* Largest case is double x 4. */ - rsize = 32; - } - else if (flags == ARM_TYPE_INT && rtype->type == FFI_TYPE_STRUCT) - rsize = 4; - - /* Largest case. */ - vfp_size = (cif->abi == FFI_VFP && cif->vfp_used ? 8*8: 0); - - bytes = cif->bytes; - stack = alloca (vfp_size + bytes + sizeof(struct call_frame) + rsize); - - vfp_space = NULL; - if (vfp_size) - { - vfp_space = stack; - stack += vfp_size; - } - - frame = (struct call_frame *)(stack + bytes); - - new_rvalue = rvalue; - if (rsize) - new_rvalue = (void *)(frame + 1); - - frame->rvalue = new_rvalue; - frame->flags = flags; - frame->closure = closure; - - if (vfp_space) - { - ffi_prep_args_VFP (cif, flags, new_rvalue, avalue, stack, vfp_space); - ffi_call_VFP (vfp_space, frame, fn, cif->vfp_used); - } - else - { - ffi_prep_args_SYSV (cif, flags, new_rvalue, avalue, stack); - ffi_call_SYSV (stack, frame, fn); - } - - if (rvalue && rvalue != new_rvalue) - memcpy (rvalue, new_rvalue, rtype->size); -} - -void -ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) -{ - ffi_call_int (cif, fn, rvalue, avalue, NULL); -} - -#ifdef FFI_GO_CLOSURES -void -ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int (cif, fn, rvalue, avalue, closure); -} -#endif - -static void * -ffi_prep_incoming_args_SYSV (ffi_cif *cif, void *rvalue, - char *argp, void **avalue) -{ - ffi_type **arg_types = cif->arg_types; - int i, n; - - if (cif->flags == ARM_TYPE_STRUCT) - { - rvalue = *(void **) argp; - argp += 4; - } - else - { - if (cif->rtype->size && cif->rtype->size < 4) - *(uint32_t *) rvalue = 0; - } - - for (i = 0, n = cif->nargs; i < n; i++) - { - ffi_type *ty = arg_types[i]; - size_t z = ty->size; - - argp = ffi_align (ty, argp); - avalue[i] = (void *) argp; - argp += z; - } - - return rvalue; -} - -static void * -ffi_prep_incoming_args_VFP (ffi_cif *cif, void *rvalue, char *stack, - char *vfp_space, void **avalue) -{ - ffi_type **arg_types = cif->arg_types; - int i, n, vi = 0; - char *argp, *regp, *eo_regp; - char done_with_regs = 0; - char stack_used = 0; - - regp = stack; - eo_regp = argp = regp + 16; - - if (cif->flags == ARM_TYPE_STRUCT) - { - rvalue = *(void **) regp; - regp += 4; - } - - for (i = 0, n = cif->nargs; i < n; i++) - { - ffi_type *ty = arg_types[i]; - int is_vfp_type = vfp_type_p (ty); - size_t z = ty->size; - - if (vi < cif->vfp_nargs && is_vfp_type) - { - avalue[i] = vfp_space + cif->vfp_args[vi++] * 4; - continue; - } - else if (!done_with_regs && !is_vfp_type) - { - char *tregp = ffi_align (ty, regp); - - z = (z < 4) ? 4 : z; // pad - - /* If the arguments either fits into the registers or uses registers - and stack, while we haven't read other things from the stack */ - if (tregp + z <= eo_regp || !stack_used) - { - /* Because we're little endian, this is what it turns into. */ - avalue[i] = (void *) tregp; - regp = tregp + z; - - /* If we read past the last core register, make sure we - have not read from the stack before and continue - reading after regp. */ - if (regp > eo_regp) - { - FFI_ASSERT (!stack_used); - argp = regp; - } - if (regp >= eo_regp) - { - done_with_regs = 1; - stack_used = 1; - } - continue; - } - } - - stack_used = 1; - argp = ffi_align (ty, argp); - avalue[i] = (void *) argp; - argp += z; - } - - return rvalue; -} - -#if FFI_CLOSURES - -struct closure_frame -{ - char vfp_space[8*8] __attribute__((aligned(8))); - char result[8*4]; - char argp[]; -}; - -int FFI_HIDDEN -ffi_closure_inner_SYSV (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - struct closure_frame *frame) -{ - void **avalue = (void **) alloca (cif->nargs * sizeof (void *)); - void *rvalue = ffi_prep_incoming_args_SYSV (cif, frame->result, - frame->argp, avalue); - fun (cif, rvalue, avalue, user_data); - return cif->flags; -} - -int FFI_HIDDEN -ffi_closure_inner_VFP (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - struct closure_frame *frame) -{ - void **avalue = (void **) alloca (cif->nargs * sizeof (void *)); - void *rvalue = ffi_prep_incoming_args_VFP (cif, frame->result, frame->argp, - frame->vfp_space, avalue); - fun (cif, rvalue, avalue, user_data); - return cif->flags; -} - -void ffi_closure_SYSV (void) FFI_HIDDEN; -void ffi_closure_VFP (void) FFI_HIDDEN; -#if defined(FFI_EXEC_STATIC_TRAMP) -void ffi_closure_SYSV_alt (void) FFI_HIDDEN; -void ffi_closure_VFP_alt (void) FFI_HIDDEN; -#endif - -#ifdef FFI_GO_CLOSURES -void ffi_go_closure_SYSV (void) FFI_HIDDEN; -void ffi_go_closure_VFP (void) FFI_HIDDEN; -#endif - -/* the cif must already be prep'ed */ - -#if defined(__FreeBSD__) && defined(__arm__) -#define __clear_cache(start, end) do { \ - struct arm_sync_icache_args ua; \ - \ - ua.addr = (uintptr_t)(start); \ - ua.len = (char *)(end) - (char *)start; \ - sysarch(ARM_SYNC_ICACHE, &ua); \ - } while (0); -#endif - -ffi_status -ffi_prep_closure_loc (ffi_closure * closure, - ffi_cif * cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, void *codeloc) -{ - void (*closure_func) (void) = ffi_closure_SYSV; - - if (cif->abi == FFI_VFP) - { - /* We only need take the vfp path if there are vfp arguments. */ - if (cif->vfp_used) - closure_func = ffi_closure_VFP; - } - else if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - -#if FFI_EXEC_TRAMPOLINE_TABLE - void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); - config[0] = closure; - config[1] = closure_func; -#else - -# if defined(FFI_EXEC_STATIC_TRAMP) - if (ffi_tramp_is_present(closure)) - { - /* Initialize the static trampoline's parameters. */ - if (closure_func == ffi_closure_SYSV) - closure_func = ffi_closure_SYSV_alt; - else - closure_func = ffi_closure_VFP_alt; - ffi_tramp_set_parms (closure->ftramp, closure_func, closure); - goto out; - } -# endif - - /* Initialize the dynamic trampoline. */ -# ifndef _WIN32 - memcpy(closure->tramp, ffi_arm_trampoline, 8); -# else - // cast away function type so MSVC doesn't set the lower bit of the function pointer - memcpy(closure->tramp, (void*)((uintptr_t)ffi_arm_trampoline & 0xFFFFFFFE), FFI_TRAMPOLINE_CLOSURE_OFFSET); -# endif - -# if defined(__QNX__) - msync (closure->tramp, 8, MS_INVALIDATE_ICACHE); /* clear data map */ - msync (codeloc, 8, MS_INVALIDATE_ICACHE); /* clear insn map */ -# elif defined(_WIN32) - FlushInstructionCache(GetCurrentProcess(), closure->tramp, FFI_TRAMPOLINE_SIZE); -# else - __clear_cache(closure->tramp, closure->tramp + 8); /* clear data map */ - __clear_cache(codeloc, codeloc + 8); /* clear insn map */ -# endif -# ifdef _WIN32 - *(void(**)(void))(closure->tramp + FFI_TRAMPOLINE_CLOSURE_FUNCTION) = closure_func; -# else - *(void (**)(void))(closure->tramp + 8) = closure_func; -# endif -# if defined(FFI_EXEC_STATIC_TRAMP) -out: -# endif -#endif - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - -#ifdef FFI_GO_CLOSURES -ffi_status -ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *)) -{ - void (*closure_func) (void) = ffi_go_closure_SYSV; - - if (cif->abi == FFI_VFP) - { - /* We only need take the vfp path if there are vfp arguments. */ - if (cif->vfp_used) - closure_func = ffi_go_closure_VFP; - } - else if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - closure->tramp = closure_func; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} -#endif - -#endif /* FFI_CLOSURES */ - -/* Below are routines for VFP hard-float support. */ - -/* A subroutine of vfp_type_p. Given a structure type, return the type code - of the first non-structure element. Recurse for structure elements. - Return -1 if the structure is in fact empty, i.e. no nested elements. */ - -static int -is_hfa0 (const ffi_type *ty) -{ - ffi_type **elements = ty->elements; - int i, ret = -1; - - if (elements != NULL) - for (i = 0; elements[i]; ++i) - { - ret = elements[i]->type; - if (ret == FFI_TYPE_STRUCT || ret == FFI_TYPE_COMPLEX) - { - ret = is_hfa0 (elements[i]); - if (ret < 0) - continue; - } - break; - } - - return ret; -} - -/* A subroutine of vfp_type_p. Given a structure type, return true if all - of the non-structure elements are the same as CANDIDATE. */ - -static int -is_hfa1 (const ffi_type *ty, int candidate) -{ - ffi_type **elements = ty->elements; - int i; - - if (elements != NULL) - for (i = 0; elements[i]; ++i) - { - int t = elements[i]->type; - if (t == FFI_TYPE_STRUCT || t == FFI_TYPE_COMPLEX) - { - if (!is_hfa1 (elements[i], candidate)) - return 0; - } - else if (t != candidate) - return 0; - } - - return 1; -} - -/* Determine if TY is an homogenous floating point aggregate (HFA). - That is, a structure consisting of 1 to 4 members of all the same type, - where that type is a floating point scalar. - - Returns non-zero iff TY is an HFA. The result is an encoded value where - bits 0-7 contain the type code, and bits 8-10 contain the element count. */ - -static int -vfp_type_p (const ffi_type *ty) -{ - ffi_type **elements; - int candidate, i; - size_t size, ele_count; - - /* Quickest tests first. */ - candidate = ty->type; - switch (ty->type) - { - default: - return 0; - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - ele_count = 1; - goto done; - case FFI_TYPE_COMPLEX: - candidate = ty->elements[0]->type; - if (candidate != FFI_TYPE_FLOAT && candidate != FFI_TYPE_DOUBLE) - return 0; - ele_count = 2; - goto done; - case FFI_TYPE_STRUCT: - break; - } - - /* No HFA types are smaller than 4 bytes, or larger than 32 bytes. */ - size = ty->size; - if (size < 4 || size > 32) - return 0; - - /* Find the type of the first non-structure member. */ - elements = ty->elements; - candidate = elements[0]->type; - if (candidate == FFI_TYPE_STRUCT || candidate == FFI_TYPE_COMPLEX) - { - for (i = 0; ; ++i) - { - candidate = is_hfa0 (elements[i]); - if (candidate >= 0) - break; - } - } - - /* If the first member is not a floating point type, it's not an HFA. - Also quickly re-check the size of the structure. */ - switch (candidate) - { - case FFI_TYPE_FLOAT: - ele_count = size / sizeof(float); - if (size != ele_count * sizeof(float)) - return 0; - break; - case FFI_TYPE_DOUBLE: - ele_count = size / sizeof(double); - if (size != ele_count * sizeof(double)) - return 0; - break; - default: - return 0; - } - if (ele_count > 4) - return 0; - - /* Finally, make sure that all scalar elements are the same type. */ - for (i = 0; elements[i]; ++i) - { - int t = elements[i]->type; - if (t == FFI_TYPE_STRUCT || t == FFI_TYPE_COMPLEX) - { - if (!is_hfa1 (elements[i], candidate)) - return 0; - } - else if (t != candidate) - return 0; - } - - /* All tests succeeded. Encode the result. */ - done: - return (ele_count << 8) | candidate; -} - -static int -place_vfp_arg (ffi_cif *cif, int h) -{ - unsigned short reg = cif->vfp_reg_free; - int align = 1, nregs = h >> 8; - - if ((h & 0xff) == FFI_TYPE_DOUBLE) - align = 2, nregs *= 2; - - /* Align register number. */ - if ((reg & 1) && align == 2) - reg++; - - while (reg + nregs <= 16) - { - int s, new_used = 0; - for (s = reg; s < reg + nregs; s++) - { - new_used |= (1 << s); - if (cif->vfp_used & (1 << s)) - { - reg += align; - goto next_reg; - } - } - /* Found regs to allocate. */ - cif->vfp_used |= new_used; - cif->vfp_args[cif->vfp_nargs++] = (signed char)reg; - - /* Update vfp_reg_free. */ - if (cif->vfp_used & (1 << cif->vfp_reg_free)) - { - reg += nregs; - while (cif->vfp_used & (1 << reg)) - reg += 1; - cif->vfp_reg_free = reg; - } - return 0; - next_reg:; - } - // done, mark all regs as used - cif->vfp_reg_free = 16; - cif->vfp_used = 0xFFFF; - return 1; -} - -static void -layout_vfp_args (ffi_cif * cif) -{ - unsigned int i; - /* Init VFP fields */ - cif->vfp_used = 0; - cif->vfp_nargs = 0; - cif->vfp_reg_free = 0; - memset (cif->vfp_args, -1, 16); /* Init to -1. */ - - for (i = 0; i < cif->nargs; i++) - { - int h = vfp_type_p (cif->arg_types[i]); - if (h && place_vfp_arg (cif, h) == 1) - break; - } -} - -#if defined(FFI_EXEC_STATIC_TRAMP) -void * -ffi_tramp_arch (size_t *tramp_size, size_t *map_size) -{ - extern void *trampoline_code_table; - - *tramp_size = ARM_TRAMP_SIZE; - *map_size = ARM_TRAMP_MAP_SIZE; - return &trampoline_code_table; -} -#endif - -#endif /* __arm__ or _M_ARM */ diff --git a/deps/libffi/src/arm/ffitarget.h b/deps/libffi/src/arm/ffitarget.h deleted file mode 100644 index 12d5d206953490..00000000000000 --- a/deps/libffi/src/arm/ffitarget.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 2010 CodeSourcery - Copyright (c) 1996-2003 Red Hat, Inc. - - Target configuration macros for ARM. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_VFP, - FFI_LAST_ABI, -#if defined(__ARM_PCS_VFP) || defined(_WIN32) - FFI_DEFAULT_ABI = FFI_VFP, -#else - FFI_DEFAULT_ABI = FFI_SYSV, -#endif -} ffi_abi; -#endif - -#define FFI_EXTRA_CIF_FIELDS \ - int vfp_used; \ - unsigned short vfp_reg_free, vfp_nargs; \ - signed char vfp_args[16] \ - -#define FFI_TARGET_SPECIFIC_VARIADIC -#ifndef _WIN32 -#define FFI_TARGET_HAS_COMPLEX_TYPE -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 - -#if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE - -#ifdef __MACH__ -#define FFI_TRAMPOLINE_SIZE 12 -#define FFI_TRAMPOLINE_CLOSURE_OFFSET 8 -#else -#error "No trampoline table implementation" -#endif - -#else -#ifdef _WIN32 -#define FFI_TRAMPOLINE_SIZE 16 -#define FFI_TRAMPOLINE_CLOSURE_FUNCTION 12 -#else -#define FFI_TRAMPOLINE_SIZE 12 -#endif -#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE -#endif - -#endif diff --git a/deps/libffi/src/arm/internal.h b/deps/libffi/src/arm/internal.h deleted file mode 100644 index fa8ab0b6ebcd70..00000000000000 --- a/deps/libffi/src/arm/internal.h +++ /dev/null @@ -1,17 +0,0 @@ -#define ARM_TYPE_VFP_S 0 -#define ARM_TYPE_VFP_D 1 -#define ARM_TYPE_VFP_N 2 -#define ARM_TYPE_INT64 3 -#define ARM_TYPE_INT 4 -#define ARM_TYPE_VOID 5 -#define ARM_TYPE_STRUCT 6 - -#if defined(FFI_EXEC_STATIC_TRAMP) -/* - * For the trampoline table mapping, a mapping size of 4K (base page size) - * is chosen. - */ -#define ARM_TRAMP_MAP_SHIFT 12 -#define ARM_TRAMP_MAP_SIZE (1 << ARM_TRAMP_MAP_SHIFT) -#define ARM_TRAMP_SIZE 20 -#endif diff --git a/deps/libffi/src/arm/sysv.S b/deps/libffi/src/arm/sysv.S deleted file mode 100644 index e4272a103c542d..00000000000000 --- a/deps/libffi/src/arm/sysv.S +++ /dev/null @@ -1,456 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1998, 2008, 2011 Red Hat, Inc. - Copyright (c) 2011 Plausible Labs Cooperative, Inc. - - ARM Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#ifdef __arm__ -#define LIBFFI_ASM -#include -#include -#include -#include "internal.h" - -/* GCC 4.8 provides __ARM_ARCH; construct it otherwise. */ -#ifndef __ARM_ARCH -# if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ - || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ - || defined(__ARM_ARCH_7EM__) -# define __ARM_ARCH 7 -# elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ - || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \ - || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \ - || defined(__ARM_ARCH_6M__) -# define __ARM_ARCH 6 -# elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \ - || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \ - || defined(__ARM_ARCH_5TEJ__) -# define __ARM_ARCH 5 -# else -# define __ARM_ARCH 4 -# endif -#endif - -/* Conditionally compile unwinder directives. */ -#ifdef __ARM_EABI__ -# define UNWIND(...) __VA_ARGS__ -#else -# define UNWIND(...) -#endif - -#if defined(HAVE_AS_CFI_PSEUDO_OP) && defined(__ARM_EABI__) - .cfi_sections .debug_frame -#endif - -#define CONCAT(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -#ifdef __USER_LABEL_PREFIX__ -# define CNAME(X) CONCAT (__USER_LABEL_PREFIX__, X) -#else -# define CNAME(X) X -#endif -#ifdef __ELF__ -# define SIZE(X) .size CNAME(X), . - CNAME(X) -# define TYPE(X, Y) .type CNAME(X), Y -#else -# define SIZE(X) -# define TYPE(X, Y) -#endif - -#define ARM_FUNC_START_LOCAL(name) \ - .align 3; \ - TYPE(CNAME(name), %function); \ - CNAME(name): - -#define ARM_FUNC_START(name) \ - .globl CNAME(name); \ - FFI_HIDDEN(CNAME(name)); \ - ARM_FUNC_START_LOCAL(name) - -#define ARM_FUNC_END(name) \ - SIZE(name) - - .text - .syntax unified -#if defined(_WIN32) - /* Windows on ARM is thumb-only */ - .thumb -#else - /* Keep the assembly in ARM mode in other cases, for simplicity - * (to avoid interworking issues). */ -#undef __thumb__ - .arm -#endif - -/* Aid in defining a jump table with 8 bytes between entries. */ -#ifdef __thumb__ -/* In thumb mode, instructions can be shorter than expected in arm mode, so - * we need to align the start of each case. */ -# define E(index) .align 3 -#elif defined(__clang__) -/* ??? The clang assembler doesn't handle .if with symbolic expressions. */ -# define E(index) -#else -# define E(index) \ - .if . - 0b - 8*index; \ - .error "type table out of sync"; \ - .endif -#endif - - -#ifndef __clang__ - /* We require interworking on LDM, which implies ARMv5T, - which implies the existance of BLX. */ - .arch armv5t -#endif - - /* Note that we use STC and LDC to encode VFP instructions, - so that we do not need ".fpu vfp", nor get that added to - the object file attributes. These will not be executed - unless the FFI_VFP abi is used. */ - - @ r0: stack - @ r1: frame - @ r2: fn - @ r3: vfp_used - -ARM_FUNC_START(ffi_call_VFP) - UNWIND(.fnstart) - cfi_startproc - - cmp r3, #3 @ load only d0 if possible - ite le - ldcle p11, cr0, [r0] @ vldrle d0, [r0] - ldcgt p11, cr0, [r0], {16} @ vldmgt r0, {d0-d7} - add r0, r0, #64 @ discard the vfp register args - /* FALLTHRU */ -ARM_FUNC_END(ffi_call_VFP) - -ARM_FUNC_START(ffi_call_SYSV) - stm r1, {fp, lr} - mov fp, r1 - - @ This is a bit of a lie wrt the origin of the unwind info, but - @ now we've got the usual frame pointer and two saved registers. - UNWIND(.save {fp,lr}) - UNWIND(.setfp fp, sp) - cfi_def_cfa(fp, 8) - cfi_rel_offset(fp, 0) - cfi_rel_offset(lr, 4) - - mov sp, r0 @ install the stack pointer - mov lr, r2 @ move the fn pointer out of the way - ldr ip, [fp, #16] @ install the static chain - ldmia sp!, {r0-r3} @ move first 4 parameters in registers. - blx lr @ call fn - - @ Load r2 with the pointer to storage for the return value - @ Load r3 with the return type code - ldr r2, [fp, #8] - ldr r3, [fp, #12] - - @ Deallocate the stack with the arguments. - mov sp, fp - cfi_def_cfa_register(sp) - - @ Store values stored in registers. -#ifndef __thumb__ - .align 3 - add pc, pc, r3, lsl #3 - nop -#else - adr ip, 0f - add ip, ip, r3, lsl #3 - mov pc, ip - .align 3 -#endif -0: -E(ARM_TYPE_VFP_S) - stc p10, cr0, [r2] @ vstr s0, [r2] - pop {fp,pc} -E(ARM_TYPE_VFP_D) - stc p11, cr0, [r2] @ vstr d0, [r2] - pop {fp,pc} -E(ARM_TYPE_VFP_N) - stc p11, cr0, [r2], {8} @ vstm r2, {d0-d3} - pop {fp,pc} -E(ARM_TYPE_INT64) - str r1, [r2, #4] - nop -E(ARM_TYPE_INT) - str r0, [r2] - pop {fp,pc} -E(ARM_TYPE_VOID) - pop {fp,pc} - nop -E(ARM_TYPE_STRUCT) - pop {fp,pc} - - cfi_endproc - UNWIND(.fnend) -ARM_FUNC_END(ffi_call_SYSV) - -#if FFI_CLOSURES - -/* - int ffi_closure_inner_* (cif, fun, user_data, frame) -*/ - -ARM_FUNC_START(ffi_go_closure_SYSV) - cfi_startproc - stmdb sp!, {r0-r3} @ save argument regs - cfi_adjust_cfa_offset(16) - ldr r0, [ip, #4] @ load cif - ldr r1, [ip, #8] @ load fun - mov r2, ip @ load user_data - b 0f - cfi_endproc -ARM_FUNC_END(ffi_go_closure_SYSV) - -ARM_FUNC_START(ffi_closure_SYSV) - UNWIND(.fnstart) - cfi_startproc -#ifdef _WIN32 - ldmfd sp!, {r0, ip} @ restore fp (r0 is used for stack alignment) -#endif - stmdb sp!, {r0-r3} @ save argument regs - cfi_adjust_cfa_offset(16) - -#if FFI_EXEC_TRAMPOLINE_TABLE - ldr ip, [ip] @ ip points to the config page, dereference to get the ffi_closure* -#endif - ldr r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET] @ load cif - ldr r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4] @ load fun - ldr r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8] @ load user_data -0: - add ip, sp, #16 @ compute entry sp - sub sp, sp, #64+32 @ allocate frame - cfi_adjust_cfa_offset(64+32) - stmdb sp!, {ip,lr} - - /* Remember that EABI unwind info only applies at call sites. - We need do nothing except note the save of the stack pointer - and the link registers. */ - UNWIND(.save {sp,lr}) - cfi_adjust_cfa_offset(8) - cfi_rel_offset(lr, 4) - - add r3, sp, #8 @ load frame - bl CNAME(ffi_closure_inner_SYSV) - - @ Load values returned in registers. - add r2, sp, #8+64 @ load result - adr r3, CNAME(ffi_closure_ret) -#ifndef __thumb__ - add pc, r3, r0, lsl #3 -#else - add r3, r3, r0, lsl #3 - mov pc, r3 -#endif - cfi_endproc - UNWIND(.fnend) -ARM_FUNC_END(ffi_closure_SYSV) - -ARM_FUNC_START(ffi_go_closure_VFP) - cfi_startproc - stmdb sp!, {r0-r3} @ save argument regs - cfi_adjust_cfa_offset(16) - ldr r0, [ip, #4] @ load cif - ldr r1, [ip, #8] @ load fun - mov r2, ip @ load user_data - b 0f - cfi_endproc -ARM_FUNC_END(ffi_go_closure_VFP) - -ARM_FUNC_START(ffi_closure_VFP) - UNWIND(.fnstart) - cfi_startproc -#ifdef _WIN32 - ldmfd sp!, {r0, ip} @ restore fp (r0 is used for stack alignment) -#endif - stmdb sp!, {r0-r3} @ save argument regs - cfi_adjust_cfa_offset(16) - -#if FFI_EXEC_TRAMPOLINE_TABLE - ldr ip, [ip] @ ip points to the config page, dereference to get the ffi_closure* -#endif - ldr r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET] @ load cif - ldr r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4] @ load fun - ldr r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8] @ load user_data -0: - add ip, sp, #16 - sub sp, sp, #64+32 @ allocate frame - cfi_adjust_cfa_offset(64+32) - stc p11, cr0, [sp], {16} @ vstm sp, {d0-d7} - stmdb sp!, {ip,lr} - - /* See above. */ - UNWIND(.save {sp,lr}) - cfi_adjust_cfa_offset(8) - cfi_rel_offset(lr, 4) - - add r3, sp, #8 @ load frame - bl CNAME(ffi_closure_inner_VFP) - - @ Load values returned in registers. - add r2, sp, #8+64 @ load result - adr r3, CNAME(ffi_closure_ret) -#ifndef __thumb__ - add pc, r3, r0, lsl #3 -#else - add r3, r3, r0, lsl #3 - mov pc, r3 -#endif - cfi_endproc - UNWIND(.fnend) -ARM_FUNC_END(ffi_closure_VFP) - -/* Load values returned in registers for both closure entry points. - Note that we use LDM with SP in the register set. This is deprecated - by ARM, but not yet unpredictable. */ - -ARM_FUNC_START_LOCAL(ffi_closure_ret) - cfi_startproc - cfi_rel_offset(sp, 0) - cfi_rel_offset(lr, 4) -0: -E(ARM_TYPE_VFP_S) - ldc p10, cr0, [r2] @ vldr s0, [r2] - b call_epilogue -E(ARM_TYPE_VFP_D) - ldc p11, cr0, [r2] @ vldr d0, [r2] - b call_epilogue -E(ARM_TYPE_VFP_N) - ldc p11, cr0, [r2], {8} @ vldm r2, {d0-d3} - b call_epilogue -E(ARM_TYPE_INT64) - ldr r1, [r2, #4] - nop -E(ARM_TYPE_INT) - ldr r0, [r2] - b call_epilogue -E(ARM_TYPE_VOID) - b call_epilogue - nop -E(ARM_TYPE_STRUCT) - b call_epilogue -call_epilogue: -#ifndef __thumb__ - ldm sp, {sp,pc} -#else - ldm sp, {ip,lr} - mov sp, ip - bx lr -#endif - cfi_endproc -ARM_FUNC_END(ffi_closure_ret) - -#if defined(FFI_EXEC_STATIC_TRAMP) -ARM_FUNC_START(ffi_closure_SYSV_alt) - /* See the comments above trampoline_code_table. */ - ldr ip, [sp, #4] /* Load closure in ip */ - add sp, sp, 8 /* Restore the stack */ - b CNAME(ffi_closure_SYSV) -ARM_FUNC_END(ffi_closure_SYSV_alt) - -ARM_FUNC_START(ffi_closure_VFP_alt) - /* See the comments above trampoline_code_table. */ - ldr ip, [sp, #4] /* Load closure in ip */ - add sp, sp, 8 /* Restore the stack */ - b CNAME(ffi_closure_VFP) -ARM_FUNC_END(ffi_closure_VFP_alt) - -/* - * Below is the definition of the trampoline code table. Each element in - * the code table is a trampoline. - */ -/* - * The trampoline uses register ip (r12). It saves the original value of ip - * on the stack. - * - * The trampoline has two parameters - target code to jump to and data for - * the target code. The trampoline extracts the parameters from its parameter - * block (see tramp_table_map()). The trampoline saves the data address on - * the stack. Finally, it jumps to the target code. - * - * The target code can choose to: - * - * - restore the value of ip - * - load the data address in a register - * - restore the stack pointer to what it was when the trampoline was invoked. - */ - .align ARM_TRAMP_MAP_SHIFT -ARM_FUNC_START(trampoline_code_table) - .rept ARM_TRAMP_MAP_SIZE / ARM_TRAMP_SIZE - sub sp, sp, #8 /* Make space on the stack */ - str ip, [sp] /* Save ip on stack */ - ldr ip, [pc, #4080] /* Copy data into ip */ - str ip, [sp, #4] /* Save data on stack */ - ldr pc, [pc, #4076] /* Copy code into PC */ - .endr -ARM_FUNC_END(trampoline_code_table) - .align ARM_TRAMP_MAP_SHIFT -#endif /* FFI_EXEC_STATIC_TRAMP */ - -#endif /* FFI_CLOSURES */ - -#if FFI_EXEC_TRAMPOLINE_TABLE - -#ifdef __MACH__ -#include - -.align PAGE_MAX_SHIFT -ARM_FUNC_START(ffi_closure_trampoline_table_page) -.rept PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE - adr ip, #-PAGE_MAX_SIZE @ the config page is PAGE_MAX_SIZE behind the trampoline page - sub ip, #8 @ account for pc bias - ldr pc, [ip, #4] @ jump to ffi_closure_SYSV or ffi_closure_VFP -.endr -ARM_FUNC_END(ffi_closure_trampoline_table_page) -#endif - -#elif defined(_WIN32) - -ARM_FUNC_START(ffi_arm_trampoline) -0: adr ip, 0b - stmdb sp!, {r0, ip} - ldr pc, 1f -1: .long 0 -ARM_FUNC_END(ffi_arm_trampoline) - -#else - -ARM_FUNC_START(ffi_arm_trampoline) -0: adr ip, 0b - ldr pc, 1f -1: .long 0 -ARM_FUNC_END(ffi_arm_trampoline) - -#endif /* FFI_EXEC_TRAMPOLINE_TABLE */ -#endif /* __arm__ */ - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",%progbits -#endif diff --git a/deps/libffi/src/arm/sysv_msvc_arm32.S b/deps/libffi/src/arm/sysv_msvc_arm32.S deleted file mode 100644 index 5c99d0207af317..00000000000000 --- a/deps/libffi/src/arm/sysv_msvc_arm32.S +++ /dev/null @@ -1,311 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1998, 2008, 2011 Red Hat, Inc. - Copyright (c) 2011 Plausible Labs Cooperative, Inc. - Copyright (c) 2019 Microsoft Corporation. - - ARM Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#include -#include "internal.h" -#include "ksarm.h" - - - ; 8 byte aligned AREA to support 8 byte aligned jump tables - MACRO - NESTED_ENTRY_FFI $FuncName, $AreaName, $ExceptHandler - - ; compute the function's labels - __DeriveFunctionLabels $FuncName - - ; determine the area we will put the function into -__FuncArea SETS "|.text|" - IF "$AreaName" != "" -__FuncArea SETS "$AreaName" - ENDIF - - ; set up the exception handler itself -__FuncExceptionHandler SETS "" - IF "$ExceptHandler" != "" -__FuncExceptionHandler SETS "|$ExceptHandler|" - ENDIF - - ; switch to the specified area, jump tables require 8 byte alignment - AREA $__FuncArea,CODE,CODEALIGN,ALIGN=3,READONLY - - ; export the function name - __ExportProc $FuncName - - ; flush any pending literal pool stuff - ROUT - - ; reset the state of the unwind code tracking - __ResetUnwindState - - MEND - -; MACRO -; TABLE_ENTRY $Type, $Table -;$Type_$Table -; MEND - -#define E(index,table) return_##index##_##table - - ; r0: stack - ; r1: frame - ; r2: fn - ; r3: vfp_used - - ; fake entry point exists only to generate exists only to - ; generate .pdata for exception unwinding - NESTED_ENTRY_FFI ffi_call_VFP_fake - PROLOG_PUSH {r11, lr} ; save fp and lr for unwind - - ALTERNATE_ENTRY ffi_call_VFP - cmp r3, #3 ; load only d0 if possible - vldrle d0, [r0] - vldmgt r0, {d0-d7} - add r0, r0, #64 ; discard the vfp register args - b ffi_call_SYSV - NESTED_END ffi_call_VFP_fake - - ; fake entry point exists only to generate exists only to - ; generate .pdata for exception unwinding - NESTED_ENTRY_FFI ffi_call_SYSV_fake - PROLOG_PUSH {r11, lr} ; save fp and lr for unwind - - ALTERNATE_ENTRY ffi_call_SYSV - stm r1, {fp, lr} - mov fp, r1 - - mov sp, r0 ; install the stack pointer - mov lr, r2 ; move the fn pointer out of the way - ldr ip, [fp, #16] ; install the static chain - ldmia sp!, {r0-r3} ; move first 4 parameters in registers. - blx lr ; call fn - - ; Load r2 with the pointer to storage for the return value - ; Load r3 with the return type code - ldr r2, [fp, #8] - ldr r3, [fp, #12] - - ; Deallocate the stack with the arguments. - mov sp, fp - - ; Store values stored in registers. - ALIGN 8 - lsl r3, #3 - add r3, r3, pc - add r3, #8 - mov pc, r3 - - -E(ARM_TYPE_VFP_S, ffi_call) - ALIGN 8 - vstr s0, [r2] - pop {fp,pc} -E(ARM_TYPE_VFP_D, ffi_call) - ALIGN 8 - vstr d0, [r2] - pop {fp,pc} -E(ARM_TYPE_VFP_N, ffi_call) - ALIGN 8 - vstm r2, {d0-d3} - pop {fp,pc} -E(ARM_TYPE_INT64, ffi_call) - ALIGN 8 - str r1, [r2, #4] - nop -E(ARM_TYPE_INT, ffi_call) - ALIGN 8 - str r0, [r2] - pop {fp,pc} -E(ARM_TYPE_VOID, ffi_call) - ALIGN 8 - pop {fp,pc} - nop -E(ARM_TYPE_STRUCT, ffi_call) - ALIGN 8 - cmp r3, #ARM_TYPE_STRUCT - pop {fp,pc} - NESTED_END ffi_call_SYSV_fake - - IMPORT |ffi_closure_inner_SYSV| - /* - int ffi_closure_inner_SYSV - ( - cif, ; r0 - fun, ; r1 - user_data, ; r2 - frame ; r3 - ) - */ - - NESTED_ENTRY_FFI ffi_go_closure_SYSV - stmdb sp!, {r0-r3} ; save argument regs - ldr r0, [ip, #4] ; load cif - ldr r1, [ip, #8] ; load fun - mov r2, ip ; load user_data - b ffi_go_closure_SYSV_0 - NESTED_END ffi_go_closure_SYSV - - ; r3: ffi_closure - - ; fake entry point exists only to generate exists only to - ; generate .pdata for exception unwinding - NESTED_ENTRY_FFI ffi_closure_SYSV_fake - PROLOG_PUSH {r11, lr} ; save fp and lr for unwind - ALTERNATE_ENTRY ffi_closure_SYSV - ldmfd sp!, {ip,r0} ; restore fp (r0 is used for stack alignment) - stmdb sp!, {r0-r3} ; save argument regs - - ldr r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET] ; ffi_closure->cif - ldr r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4] ; ffi_closure->fun - ldr r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8] ; ffi_closure->user_data - - ALTERNATE_ENTRY ffi_go_closure_SYSV_0 - add ip, sp, #16 ; compute entry sp - - sub sp, sp, #64+32 ; allocate frame parameter (sizeof(vfp_space) = 64, sizeof(result) = 32) - mov r3, sp ; set frame parameter - stmdb sp!, {ip,lr} - - bl ffi_closure_inner_SYSV ; call the Python closure - - ; Load values returned in registers. - add r2, sp, #64+8 ; address of closure_frame->result - bl ffi_closure_ret ; move result to correct register or memory for type - - ldmfd sp!, {ip,lr} - mov sp, ip ; restore stack pointer - mov pc, lr - NESTED_END ffi_closure_SYSV_fake - - IMPORT |ffi_closure_inner_VFP| - /* - int ffi_closure_inner_VFP - ( - cif, ; r0 - fun, ; r1 - user_data, ; r2 - frame ; r3 - ) - */ - - NESTED_ENTRY_FFI ffi_go_closure_VFP - stmdb sp!, {r0-r3} ; save argument regs - ldr r0, [ip, #4] ; load cif - ldr r1, [ip, #8] ; load fun - mov r2, ip ; load user_data - b ffi_go_closure_VFP_0 - NESTED_END ffi_go_closure_VFP - - ; fake entry point exists only to generate exists only to - ; generate .pdata for exception unwinding - ; r3: closure - NESTED_ENTRY_FFI ffi_closure_VFP_fake - PROLOG_PUSH {r11, lr} ; save fp and lr for unwind - - ALTERNATE_ENTRY ffi_closure_VFP - ldmfd sp!, {ip,r0} ; restore fp (r0 is used for stack alignment) - stmdb sp!, {r0-r3} ; save argument regs - - ldr r0, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET] ; load cif - ldr r1, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+4] ; load fun - ldr r2, [ip, #FFI_TRAMPOLINE_CLOSURE_OFFSET+8] ; load user_data - - ALTERNATE_ENTRY ffi_go_closure_VFP_0 - add ip, sp, #16 ; compute entry sp - sub sp, sp, #32 ; save space for closure_frame->result - vstmdb sp!, {d0-d7} ; push closure_frame->vfp_space - - mov r3, sp ; save closure_frame - stmdb sp!, {ip,lr} - - bl ffi_closure_inner_VFP - - ; Load values returned in registers. - add r2, sp, #64+8 ; load result - bl ffi_closure_ret - ldmfd sp!, {ip,lr} - mov sp, ip ; restore stack pointer - mov pc, lr - NESTED_END ffi_closure_VFP_fake - -/* Load values returned in registers for both closure entry points. - Note that we use LDM with SP in the register set. This is deprecated - by ARM, but not yet unpredictable. */ - - NESTED_ENTRY_FFI ffi_closure_ret - stmdb sp!, {fp,lr} - - ALIGN 8 - lsl r0, #3 - add r0, r0, pc - add r0, #8 - mov pc, r0 - -E(ARM_TYPE_VFP_S, ffi_closure) - ALIGN 8 - vldr s0, [r2] - b call_epilogue -E(ARM_TYPE_VFP_D, ffi_closure) - ALIGN 8 - vldr d0, [r2] - b call_epilogue -E(ARM_TYPE_VFP_N, ffi_closure) - ALIGN 8 - vldm r2, {d0-d3} - b call_epilogue -E(ARM_TYPE_INT64, ffi_closure) - ALIGN 8 - ldr r1, [r2, #4] - nop -E(ARM_TYPE_INT, ffi_closure) - ALIGN 8 - ldr r0, [r2] - b call_epilogue -E(ARM_TYPE_VOID, ffi_closure) - ALIGN 8 - b call_epilogue - nop -E(ARM_TYPE_STRUCT, ffi_closure) - ALIGN 8 - b call_epilogue -call_epilogue - ldmfd sp!, {fp,pc} - NESTED_END ffi_closure_ret - - AREA |.trampoline|, DATA, THUMB, READONLY - EXPORT |ffi_arm_trampoline| -|ffi_arm_trampoline| DATA -thisproc adr ip, thisproc - stmdb sp!, {ip, r0} - ldr pc, [pc, #0] - DCD 0 - ;ENDP - - END \ No newline at end of file diff --git a/deps/libffi/src/avr32/ffi.c b/deps/libffi/src/avr32/ffi.c deleted file mode 100644 index 3d43397b03ad1f..00000000000000 --- a/deps/libffi/src/avr32/ffi.c +++ /dev/null @@ -1,423 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2011 Anthony Green - Copyright (c) 2009 Bradley Smith - - AVR32 Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include -#include -#include - -/* #define DEBUG */ - -extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned int, unsigned int, unsigned int*, unsigned int, - void (*fn)(void)); -extern void ffi_closure_SYSV (ffi_closure *); - -unsigned int pass_struct_on_stack(ffi_type *type) -{ - if(type->type != FFI_TYPE_STRUCT) - return 0; - - if(type->alignment < type->size && - !(type->size == 4 || type->size == 8) && - !(type->size == 8 && type->alignment >= 4)) - return 1; - - if(type->size == 3 || type->size == 5 || type->size == 6 || - type->size == 7) - return 1; - - return 0; -} - -/* ffi_prep_args is called by the assembly routine once stack space - * has been allocated for the function's arguments - * - * This is annoyingly complex since we need to keep track of used - * registers. - */ - -void ffi_prep_args(char *stack, extended_cif *ecif) -{ - unsigned int i; - void **p_argv; - ffi_type **p_arg; - char *reg_base = stack; - char *stack_base = stack + 20; - unsigned int stack_offset = 0; - unsigned int reg_mask = 0; - - p_argv = ecif->avalue; - - /* If cif->flags is struct then we know it's not passed in registers */ - if(ecif->cif->flags == FFI_TYPE_STRUCT) - { - *(void**)reg_base = ecif->rvalue; - reg_mask |= 1; - } - - for(i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs; - i++, p_arg++) - { - size_t z = (*p_arg)->size; - int alignment = (*p_arg)->alignment; - int type = (*p_arg)->type; - char *addr = 0; - - if(z % 4 != 0) - z += (4 - z % 4); - - if(reg_mask != 0x1f) - { - if(pass_struct_on_stack(*p_arg)) - { - addr = stack_base + stack_offset; - stack_offset += z; - } - else if(z == sizeof(int)) - { - char index = 0; - - while((reg_mask >> index) & 1) - index++; - - addr = reg_base + (index * 4); - reg_mask |= (1 << index); - } - else if(z == 2 * sizeof(int)) - { - if(!((reg_mask >> 1) & 1)) - { - addr = reg_base + 4; - reg_mask |= (3 << 1); - } - else if(!((reg_mask >> 3) & 1)) - { - addr = reg_base + 12; - reg_mask |= (3 << 3); - } - } - } - - if(!addr) - { - addr = stack_base + stack_offset; - stack_offset += z; - } - - if(type == FFI_TYPE_STRUCT && (*p_arg)->elements[1] == NULL) - type = (*p_arg)->elements[0]->type; - - switch(type) - { - case FFI_TYPE_UINT8: - *(unsigned int *)addr = (unsigned int)*(UINT8 *)(*p_argv); - break; - case FFI_TYPE_SINT8: - *(signed int *)addr = (signed int)*(SINT8 *)(*p_argv); - break; - case FFI_TYPE_UINT16: - *(unsigned int *)addr = (unsigned int)*(UINT16 *)(*p_argv); - break; - case FFI_TYPE_SINT16: - *(signed int *)addr = (signed int)*(SINT16 *)(*p_argv); - break; - default: - memcpy(addr, *p_argv, z); - } - - p_argv++; - } - -#ifdef DEBUG - /* Debugging */ - for(i = 0; i < 5; i++) - { - if((reg_mask & (1 << i)) == 0) - printf("r%d: (unused)\n", 12 - i); - else - printf("r%d: 0x%08x\n", 12 - i, ((unsigned int*)reg_base)[i]); - } - - for(i = 0; i < stack_offset / 4; i++) - { - printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack_base)[i]); - } -#endif -} - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - /* Round the stack up to a multiple of 8 bytes. This isn't needed - * everywhere, but it is on some platforms, and it doesn't harm - * anything when it isn't needed. */ - cif->bytes = (cif->bytes + 7) & ~7; - - /* Flag to indicate that he return value is in fact a struct */ - cif->rstruct_flag = 0; - - /* Set the return type flag */ - switch(cif->rtype->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - cif->flags = (unsigned)FFI_TYPE_UINT8; - break; - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - cif->flags = (unsigned)FFI_TYPE_UINT16; - break; - case FFI_TYPE_FLOAT: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_POINTER: - cif->flags = (unsigned)FFI_TYPE_UINT32; - break; - case FFI_TYPE_DOUBLE: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - cif->flags = (unsigned)FFI_TYPE_UINT64; - break; - case FFI_TYPE_STRUCT: - cif->rstruct_flag = 1; - if(!pass_struct_on_stack(cif->rtype)) - { - if(cif->rtype->size <= 1) - cif->flags = (unsigned)FFI_TYPE_UINT8; - else if(cif->rtype->size <= 2) - cif->flags = (unsigned)FFI_TYPE_UINT16; - else if(cif->rtype->size <= 4) - cif->flags = (unsigned)FFI_TYPE_UINT32; - else if(cif->rtype->size <= 8) - cif->flags = (unsigned)FFI_TYPE_UINT64; - else - cif->flags = (unsigned)cif->rtype->type; - } - else - cif->flags = (unsigned)cif->rtype->type; - break; - default: - cif->flags = (unsigned)cif->rtype->type; - break; - } - - return FFI_OK; -} - -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - extended_cif ecif; - - unsigned int size = 0, i = 0; - ffi_type **p_arg; - - ecif.cif = cif; - ecif.avalue = avalue; - - for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++) - size += (*p_arg)->size + (4 - (*p_arg)->size % 4); - - /* If the return value is a struct and we don't have a return value - * address then we need to make one */ - - /* If cif->flags is struct then it's not suitable for registers */ - if((rvalue == NULL) && (cif->flags == FFI_TYPE_STRUCT)) - ecif.rvalue = alloca(cif->rtype->size); - else - ecif.rvalue = rvalue; - - switch(cif->abi) - { - case FFI_SYSV: - ffi_call_SYSV(ffi_prep_args, &ecif, size, cif->flags, - ecif.rvalue, cif->rstruct_flag, fn); - break; - default: - FFI_ASSERT(0); - break; - } -} - -static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, - void **avalue, ffi_cif *cif) -{ - register unsigned int i, reg_mask = 0; - register void **p_argv; - register ffi_type **p_arg; - register char *reg_base = stack; - register char *stack_base = stack + 20; - register unsigned int stack_offset = 0; - -#ifdef DEBUG - /* Debugging */ - for(i = 0; i < cif->nargs + 7; i++) - { - printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack)[i]); - } -#endif - - /* If cif->flags is struct then we know it's not passed in registers */ - if(cif->flags == FFI_TYPE_STRUCT) - { - *rvalue = *(void **)reg_base; - reg_mask |= 1; - } - - p_argv = avalue; - - for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++) - { - size_t z = (*p_arg)->size; - int alignment = (*p_arg)->alignment; - - *p_argv = 0; - - if(z % 4 != 0) - z += (4 - z % 4); - - if(reg_mask != 0x1f) - { - if(pass_struct_on_stack(*p_arg)) - { - *p_argv = (void*)stack_base + stack_offset; - stack_offset += z; - } - else if(z <= sizeof(int)) - { - char index = 0; - - while((reg_mask >> index) & 1) - index++; - - *p_argv = (void*)reg_base + (index * 4); - reg_mask |= (1 << index); - } - else if(z == 2 * sizeof(int)) - { - if(!((reg_mask >> 1) & 1)) - { - *p_argv = (void*)reg_base + 4; - reg_mask |= (3 << 1); - } - else if(!((reg_mask >> 3) & 1)) - { - *p_argv = (void*)reg_base + 12; - reg_mask |= (3 << 3); - } - } - } - - if(!*p_argv) - { - *p_argv = (void*)stack_base + stack_offset; - stack_offset += z; - } - - if((*p_arg)->type != FFI_TYPE_STRUCT || - (*p_arg)->elements[1] == NULL) - { - if(alignment == 1) - **(unsigned int**)p_argv <<= 24; - else if(alignment == 2) - **(unsigned int**)p_argv <<= 16; - } - - p_argv++; - } - -#ifdef DEBUG - /* Debugging */ - for(i = 0; i < cif->nargs; i++) - { - printf("sp+%d: 0x%08x\n", i*4, *(((unsigned int**)avalue)[i])); - } -#endif -} - -/* This function is jumped to by the trampoline */ - -unsigned int ffi_closure_SYSV_inner(ffi_closure *closure, void **respp, - void *args) -{ - ffi_cif *cif; - void **arg_area; - unsigned int i, size = 0; - ffi_type **p_arg; - - cif = closure->cif; - - for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++) - size += (*p_arg)->size + (4 - (*p_arg)->size % 4); - - arg_area = (void **)alloca(size); - - /* this call will initialize ARG_AREA, such that each element in that - * array points to the corresponding value on the stack; and if the - * function returns a structure, it will re-set RESP to point to the - * structure return address. */ - - ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif); - - (closure->fun)(cif, *respp, arg_area, closure->user_data); - - return cif->flags; -} - -ffi_status ffi_prep_closure_loc(ffi_closure* closure, ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), void *user_data, - void *codeloc) -{ - if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - unsigned char *__tramp = (unsigned char*)(&closure->tramp[0]); - unsigned int __fun = (unsigned int)(&ffi_closure_SYSV); - unsigned int __ctx = (unsigned int)(codeloc); - unsigned int __rstruct_flag = (unsigned int)(cif->rstruct_flag); - unsigned int __inner = (unsigned int)(&ffi_closure_SYSV_inner); - *(unsigned int*) &__tramp[0] = 0xebcd1f00; /* pushm r8-r12 */ - *(unsigned int*) &__tramp[4] = 0xfefc0010; /* ld.w r12, pc[16] */ - *(unsigned int*) &__tramp[8] = 0xfefb0010; /* ld.w r11, pc[16] */ - *(unsigned int*) &__tramp[12] = 0xfefa0010; /* ld.w r10, pc[16] */ - *(unsigned int*) &__tramp[16] = 0xfeff0010; /* ld.w pc, pc[16] */ - *(unsigned int*) &__tramp[20] = __ctx; - *(unsigned int*) &__tramp[24] = __rstruct_flag; - *(unsigned int*) &__tramp[28] = __inner; - *(unsigned int*) &__tramp[32] = __fun; - syscall(__NR_cacheflush, 0, (&__tramp[0]), 36); - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; -} - diff --git a/deps/libffi/src/avr32/ffitarget.h b/deps/libffi/src/avr32/ffitarget.h deleted file mode 100644 index d0c7586f9a8b03..00000000000000 --- a/deps/libffi/src/avr32/ffitarget.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 2009 Bradley Smith - Target configuration macros for AVR32. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; -#endif - -#define FFI_EXTRA_CIF_FIELDS unsigned int rstruct_flag - -/* Definitions for closures */ - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 36 -#define FFI_NATIVE_RAW_API 0 - -#endif diff --git a/deps/libffi/src/avr32/sysv.S b/deps/libffi/src/avr32/sysv.S deleted file mode 100644 index a984b3c88a3095..00000000000000 --- a/deps/libffi/src/avr32/sysv.S +++ /dev/null @@ -1,208 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2009 Bradley Smith - - AVR32 Foreign Function Interface - - 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. - --------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - - /* r12: ffi_prep_args - * r11: &ecif - * r10: size - * r9: cif->flags - * r8: ecif.rvalue - * sp+0: cif->rstruct_flag - * sp+4: fn */ - - .text - .align 1 - .globl ffi_call_SYSV - .type ffi_call_SYSV, @function -ffi_call_SYSV: - stm --sp, r0,r1,lr - stm --sp, r8-r12 - mov r0, sp - - /* Make room for all of the new args. */ - sub sp, r10 - /* Pad to make way for potential skipped registers */ - sub sp, 20 - - /* Call ffi_prep_args(stack, &ecif). */ - /* r11 already set */ - mov r1, r12 - mov r12, sp - icall r1 - - /* Save new argument size */ - mov r1, r12 - - /* Move first 5 parameters in registers. */ - ldm sp++, r8-r12 - - /* call (fn) (...). */ - ld.w r1, r0[36] - icall r1 - - /* Remove the space we pushed for the args. */ - mov sp, r0 - - /* Load r1 with the rstruct flag. */ - ld.w r1, sp[32] - - /* Load r9 with the return type code. */ - ld.w r9, sp[12] - - /* Load r8 with the return value pointer. */ - ld.w r8, sp[16] - - /* If the return value pointer is NULL, assume no return value. */ - cp.w r8, 0 - breq .Lend - - /* Check if return type is actually a struct */ - cp.w r1, 0 - breq 1f - - /* Return 8bit */ - cp.w r9, FFI_TYPE_UINT8 - breq .Lstore8 - - /* Return 16bit */ - cp.w r9, FFI_TYPE_UINT16 - breq .Lstore16 - -1: - /* Return 32bit */ - cp.w r9, FFI_TYPE_UINT32 - breq .Lstore32 - cp.w r9, FFI_TYPE_UINT16 - breq .Lstore32 - cp.w r9, FFI_TYPE_UINT8 - breq .Lstore32 - - /* Return 64bit */ - cp.w r9, FFI_TYPE_UINT64 - breq .Lstore64 - - /* Didn't match anything */ - bral .Lend - -.Lstore64: - st.w r8[0], r11 - st.w r8[4], r10 - bral .Lend - -.Lstore32: - st.w r8[0], r12 - bral .Lend - -.Lstore16: - st.h r8[0], r12 - bral .Lend - -.Lstore8: - st.b r8[0], r12 - bral .Lend - -.Lend: - sub sp, -20 - ldm sp++, r0,r1,pc - - .size ffi_call_SYSV, . - ffi_call_SYSV - - - /* r12: __ctx - * r11: __rstruct_flag - * r10: __inner */ - - .align 1 - .globl ffi_closure_SYSV - .type ffi_closure_SYSV, @function -ffi_closure_SYSV: - stm --sp, r0,lr - mov r0, r11 - mov r8, r10 - sub r10, sp, -8 - sub sp, 12 - st.w sp[8], sp - sub r11, sp, -8 - icall r8 - - /* Check if return type is actually a struct */ - cp.w r0, 0 - breq 1f - - /* Return 8bit */ - cp.w r12, FFI_TYPE_UINT8 - breq .Lget8 - - /* Return 16bit */ - cp.w r12, FFI_TYPE_UINT16 - breq .Lget16 - -1: - /* Return 32bit */ - cp.w r12, FFI_TYPE_UINT32 - breq .Lget32 - cp.w r12, FFI_TYPE_UINT16 - breq .Lget32 - cp.w r12, FFI_TYPE_UINT8 - breq .Lget32 - - /* Return 64bit */ - cp.w r12, FFI_TYPE_UINT64 - breq .Lget64 - - /* Didn't match anything */ - bral .Lclend - -.Lget64: - ld.w r11, sp[0] - ld.w r10, sp[4] - bral .Lclend - -.Lget32: - ld.w r12, sp[0] - bral .Lclend - -.Lget16: - ld.uh r12, sp[0] - bral .Lclend - -.Lget8: - ld.ub r12, sp[0] - bral .Lclend - -.Lclend: - sub sp, -12 - ldm sp++, r0,lr - sub sp, -20 - mov pc, lr - - .size ffi_closure_SYSV, . - ffi_closure_SYSV - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/bfin/ffi.c b/deps/libffi/src/bfin/ffi.c deleted file mode 100644 index 22a2acdac192c1..00000000000000 --- a/deps/libffi/src/bfin/ffi.c +++ /dev/null @@ -1,196 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2012 Alexandre K. I. de Mendonca , - Paulo Pizarro - - Blackfin Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ -#include -#include - -#include -#include - -/* Maximum number of GPRs available for argument passing. */ -#define MAX_GPRARGS 3 - -/* - * Return types - */ -#define FFIBFIN_RET_VOID 0 -#define FFIBFIN_RET_BYTE 1 -#define FFIBFIN_RET_HALFWORD 2 -#define FFIBFIN_RET_INT64 3 -#define FFIBFIN_RET_INT32 4 - -/*====================================================================*/ -/* PROTOTYPE * - /*====================================================================*/ -void ffi_prep_args(unsigned char *, extended_cif *); - -/*====================================================================*/ -/* Externals */ -/* (Assembly) */ -/*====================================================================*/ - -extern void ffi_call_SYSV(unsigned, extended_cif *, void(*)(unsigned char *, extended_cif *), unsigned, void *, void(*fn)(void)); - -/*====================================================================*/ -/* Implementation */ -/* */ -/*====================================================================*/ - - -/* - * This function calculates the return type (size) based on type. - */ - -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - /* --------------------------------------* - * Return handling * - * --------------------------------------*/ - switch (cif->rtype->type) { - case FFI_TYPE_VOID: - cif->flags = FFIBFIN_RET_VOID; - break; - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - cif->flags = FFIBFIN_RET_HALFWORD; - break; - case FFI_TYPE_UINT8: - cif->flags = FFIBFIN_RET_BYTE; - break; - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_FLOAT: - case FFI_TYPE_POINTER: - case FFI_TYPE_SINT8: - cif->flags = FFIBFIN_RET_INT32; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_DOUBLE: - cif->flags = FFIBFIN_RET_INT64; - break; - case FFI_TYPE_STRUCT: - if (cif->rtype->size <= 4){ - cif->flags = FFIBFIN_RET_INT32; - }else if (cif->rtype->size == 8){ - cif->flags = FFIBFIN_RET_INT64; - }else{ - //it will return via a hidden pointer in P0 - cif->flags = FFIBFIN_RET_VOID; - } - break; - default: - FFI_ASSERT(0); - break; - } - return FFI_OK; -} - -/* - * This will prepare the arguments and will call the assembly routine - * cif = the call interface - * fn = the function to be called - * rvalue = the return value - * avalue = the arguments - */ -void ffi_call(ffi_cif *cif, void(*fn)(void), void *rvalue, void **avalue) -{ - int ret_type = cif->flags; - extended_cif ecif; - ecif.cif = cif; - ecif.avalue = avalue; - ecif.rvalue = rvalue; - - switch (cif->abi) { - case FFI_SYSV: - ffi_call_SYSV(cif->bytes, &ecif, ffi_prep_args, ret_type, ecif.rvalue, fn); - break; - default: - FFI_ASSERT(0); - break; - } -} - - -/* -* This function prepares the parameters (copies them from the ecif to the stack) -* to call the function (ffi_prep_args is called by the assembly routine in file -* sysv.S, which also calls the actual function) -*/ -void ffi_prep_args(unsigned char *stack, extended_cif *ecif) -{ - register unsigned int i = 0; - void **p_argv; - unsigned char *argp; - ffi_type **p_arg; - argp = stack; - p_argv = ecif->avalue; - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; - (i != 0); - i--, p_arg++) { - size_t z; - z = (*p_arg)->size; - if (z < sizeof(int)) { - z = sizeof(int); - switch ((*p_arg)->type) { - case FFI_TYPE_SINT8: { - signed char v = *(SINT8 *)(* p_argv); - signed int t = v; - *(signed int *) argp = t; - } - break; - case FFI_TYPE_UINT8: { - unsigned char v = *(UINT8 *)(* p_argv); - unsigned int t = v; - *(unsigned int *) argp = t; - } - break; - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int) * (SINT16 *)(* p_argv); - break; - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int) * (UINT16 *)(* p_argv); - break; - case FFI_TYPE_STRUCT: - memcpy(argp, *p_argv, (*p_arg)->size); - break; - default: - FFI_ASSERT(0); - break; - } - } else if (z == sizeof(int)) { - *(unsigned int *) argp = (unsigned int) * (UINT32 *)(* p_argv); - } else { - memcpy(argp, *p_argv, z); - } - p_argv++; - argp += z; - } -} - - - diff --git a/deps/libffi/src/bfin/ffitarget.h b/deps/libffi/src/bfin/ffitarget.h deleted file mode 100644 index 2175c010162f6e..00000000000000 --- a/deps/libffi/src/bfin/ffitarget.h +++ /dev/null @@ -1,43 +0,0 @@ -/* ----------------------------------------------------------------------- - ffitarget.h - Copyright (c) 2012 Alexandre K. I. de Mendonca - - Blackfin Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; -#endif - -#endif - diff --git a/deps/libffi/src/bfin/sysv.S b/deps/libffi/src/bfin/sysv.S deleted file mode 100644 index f4278be2426d25..00000000000000 --- a/deps/libffi/src/bfin/sysv.S +++ /dev/null @@ -1,179 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2012 Alexandre K. I. de Mendonca , - Paulo Pizarro - - Blackfin Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -.text -.align 4 - - /* - There is a "feature" in the bfin toolchain that it puts a _ before function names - that's why the function here it's called _ffi_call_SYSV and not ffi_call_SYSV - */ - .global _ffi_call_SYSV; - .type _ffi_call_SYSV, STT_FUNC; - .func ffi_call_SYSV - - /* - cif->bytes = R0 (fp+8) - &ecif = R1 (fp+12) - ffi_prep_args = R2 (fp+16) - ret_type = stack (fp+20) - ecif.rvalue = stack (fp+24) - fn = stack (fp+28) - got (fp+32) - - There is room for improvement here (we can use temporary registers - instead of saving the values in the memory) - REGS: - P5 => Stack pointer (function arguments) - R5 => cif->bytes - R4 => ret->type - - FP-20 = P3 - FP-16 = SP (parameters area) - FP-12 = SP (temp) - FP-08 = function return part 1 [R0] - FP-04 = function return part 2 [R1] - */ - -_ffi_call_SYSV: -.prologue: - LINK 20; - [FP-20] = P3; - [FP+8] = R0; - [FP+12] = R1; - [FP+16] = R2; - -.allocate_stack: - //alocate cif->bytes into the stack - R1 = [FP+8]; - R0 = SP; - R0 = R0 - R1; - R1 = 4; - R0 = R0 - R1; - [FP-12] = SP; - SP = R0; - [FP-16] = SP; - -.call_prep_args: - //get the addr of prep_args - P0 = [P3 + _ffi_prep_args@FUNCDESC_GOT17M4]; - P1 = [P0]; - P3 = [P0+4]; - R0 = [FP-16];//SP (parameter area) - R1 = [FP+12];//ecif - call (P1); - -.call_user_function: - //ajust SP so as to allow the user function access the parameters on the stack - SP = [FP-16]; //point to function parameters - R0 = [SP]; - R1 = [SP+4]; - R2 = [SP+8]; - //load user function address - P0 = FP; - P0 +=28; - P1 = [P0]; - P1 = [P1]; - P3 = [P0+4]; - /* - For functions returning aggregate values (struct) occupying more than 8 bytes, - the caller allocates the return value object on the stack and the address - of this object is passed to the callee as a hidden argument in register P0. - */ - P0 = [FP+24]; - - call (P1); - SP = [FP-12]; -.compute_return: - P2 = [FP-20]; - [FP-8] = R0; - [FP-4] = R1; - - R0 = [FP+20]; - R1 = R0 << 2; - - R0 = [P2+.rettable@GOT17M4]; - R0 = R1 + R0; - P2 = R0; - R1 = [P2]; - - P2 = [FP+-20]; - R0 = [P2+.rettable@GOT17M4]; - R0 = R1 + R0; - P2 = R0; - R0 = [FP-8]; - R1 = [FP-4]; - jump (P2); - -/* -#define FFIBFIN_RET_VOID 0 -#define FFIBFIN_RET_BYTE 1 -#define FFIBFIN_RET_HALFWORD 2 -#define FFIBFIN_RET_INT64 3 -#define FFIBFIN_RET_INT32 4 -*/ -.align 4 -.align 4 -.rettable: - .dd .epilogue - .rettable - .dd .rbyte - .rettable; - .dd .rhalfword - .rettable; - .dd .rint64 - .rettable; - .dd .rint32 - .rettable; - -.rbyte: - P0 = [FP+24]; - R0 = R0.B (Z); - [P0] = R0; - JUMP .epilogue -.rhalfword: - P0 = [FP+24]; - R0 = R0.L; - [P0] = R0; - JUMP .epilogue -.rint64: - P0 = [FP+24];// &rvalue - [P0] = R0; - [P0+4] = R1; - JUMP .epilogue -.rint32: - P0 = [FP+24]; - [P0] = R0; -.epilogue: - R0 = [FP+8]; - R1 = [FP+12]; - R2 = [FP+16]; - P3 = [FP-20]; - UNLINK; - RTS; - -.size _ffi_call_SYSV,.-_ffi_call_SYSV; -.endfunc diff --git a/deps/libffi/src/closures.c b/deps/libffi/src/closures.c deleted file mode 100644 index 02cf78fa26c0aa..00000000000000 --- a/deps/libffi/src/closures.c +++ /dev/null @@ -1,1107 +0,0 @@ -/* ----------------------------------------------------------------------- - closures.c - Copyright (c) 2019, 2022 Anthony Green - Copyright (c) 2007, 2009, 2010 Red Hat, Inc. - Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc - Copyright (c) 2011 Plausible Labs Cooperative, Inc. - - Code to allocate and deallocate memory for closures. - - 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. - ----------------------------------------------------------------------- */ - -#if (defined __linux__ || defined __CYGWIN__) && !defined _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif - -#ifndef __EMSCRIPTEN__ - -#include -#include -#include -#include - -#ifdef __NetBSD__ -#include -#endif - -#if __NetBSD_Version__ - 0 >= 799007200 -/* NetBSD with PROT_MPROTECT */ -#include - -#include -#include -#ifdef HAVE_SYS_MEMFD_H -#include -#endif - -static const size_t overhead = - (sizeof(max_align_t) > sizeof(void *) + sizeof(size_t)) ? - sizeof(max_align_t) - : sizeof(void *) + sizeof(size_t); - -#define ADD_TO_POINTER(p, d) ((void *)((uintptr_t)(p) + (d))) - -void * -ffi_closure_alloc (size_t size, void **code) -{ - static size_t page_size; - size_t rounded_size; - void *codeseg, *dataseg; - int prot; - - /* Expect that PAX mprotect is active and a separate code mapping is necessary. */ - if (!code) - return NULL; - - /* Obtain system page size. */ - if (!page_size) - page_size = sysconf(_SC_PAGESIZE); - - /* Round allocation size up to the next page, keeping in mind the size field and pointer to code map. */ - rounded_size = (size + overhead + page_size - 1) & ~(page_size - 1); - - /* Primary mapping is RW, but request permission to switch to PROT_EXEC later. */ - prot = PROT_READ | PROT_WRITE | PROT_MPROTECT(PROT_EXEC); - dataseg = mmap(NULL, rounded_size, prot, MAP_ANON | MAP_PRIVATE, -1, 0); - if (dataseg == MAP_FAILED) - return NULL; - - /* Create secondary mapping and switch it to RX. */ - codeseg = mremap(dataseg, rounded_size, NULL, rounded_size, MAP_REMAPDUP); - if (codeseg == MAP_FAILED) { - munmap(dataseg, rounded_size); - return NULL; - } - if (mprotect(codeseg, rounded_size, PROT_READ | PROT_EXEC) == -1) { - munmap(codeseg, rounded_size); - munmap(dataseg, rounded_size); - return NULL; - } - - /* Remember allocation size and location of the secondary mapping for ffi_closure_free. */ - memcpy(dataseg, &rounded_size, sizeof(rounded_size)); - memcpy(ADD_TO_POINTER(dataseg, sizeof(size_t)), &codeseg, sizeof(void *)); - *code = ADD_TO_POINTER(codeseg, overhead); - return ADD_TO_POINTER(dataseg, overhead); -} - -void -ffi_closure_free (void *ptr) -{ - void *codeseg, *dataseg; - size_t rounded_size; - - dataseg = ADD_TO_POINTER(ptr, -overhead); - memcpy(&rounded_size, dataseg, sizeof(rounded_size)); - memcpy(&codeseg, ADD_TO_POINTER(dataseg, sizeof(size_t)), sizeof(void *)); - munmap(dataseg, rounded_size); - munmap(codeseg, rounded_size); -} - -int -ffi_tramp_is_present (__attribute__((unused)) void *ptr) -{ - return 0; -} -#else /* !NetBSD with PROT_MPROTECT */ - -#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE -# if __linux__ && !defined(__ANDROID__) -/* This macro indicates it may be forbidden to map anonymous memory - with both write and execute permission. Code compiled when this - option is defined will attempt to map such pages once, but if it - fails, it falls back to creating a temporary file in a writable and - executable filesystem and mapping pages from it into separate - locations in the virtual memory space, one location writable and - another executable. */ -# define FFI_MMAP_EXEC_WRIT 1 -# define HAVE_MNTENT 1 -# endif -# if defined(__CYGWIN__) || defined(_WIN32) || defined(__OS2__) -/* Windows systems may have Data Execution Protection (DEP) enabled, - which requires the use of VirtualMalloc/VirtualFree to alloc/free - executable memory. */ -# define FFI_MMAP_EXEC_WRIT 1 -# endif -#endif - -#if FFI_MMAP_EXEC_WRIT && defined(__linux__) && !defined(__ANDROID__) -# if !defined FFI_MMAP_EXEC_SELINUX -/* When defined to 1 check for SELinux and if SELinux is active, - don't attempt PROT_EXEC|PROT_WRITE mapping at all, as that - might cause audit messages. */ -# define FFI_MMAP_EXEC_SELINUX 1 -# endif /* !defined FFI_MMAP_EXEC_SELINUX */ -# if !defined FFI_MMAP_PAX -/* Also check for PaX MPROTECT */ -# define FFI_MMAP_PAX 1 -# endif /* !defined FFI_MMAP_PAX */ -#endif /* FFI_MMAP_EXEC_WRIT && defined(__linux__) && !defined(__ANDROID__) */ - -#if FFI_CLOSURES - -#if FFI_EXEC_TRAMPOLINE_TABLE - -#ifdef __MACH__ - -#include -#include -#ifdef HAVE_ARM64E_PTRAUTH -#include -#endif -#include -#include - -extern void *ffi_closure_trampoline_table_page; - -typedef struct ffi_trampoline_table ffi_trampoline_table; -typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry; - -struct ffi_trampoline_table -{ - /* contiguous writable and executable pages */ - vm_address_t config_page; - - /* free list tracking */ - uint16_t free_count; - ffi_trampoline_table_entry *free_list; - ffi_trampoline_table_entry *free_list_pool; - - ffi_trampoline_table *prev; - ffi_trampoline_table *next; -}; - -struct ffi_trampoline_table_entry -{ - void *(*trampoline) (void); - ffi_trampoline_table_entry *next; -}; - -/* Total number of trampolines that fit in one trampoline table */ -#define FFI_TRAMPOLINE_COUNT (PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE) - -static pthread_mutex_t ffi_trampoline_lock = PTHREAD_MUTEX_INITIALIZER; -static ffi_trampoline_table *ffi_trampoline_tables = NULL; - -static ffi_trampoline_table * -ffi_trampoline_table_alloc (void) -{ - ffi_trampoline_table *table; - vm_address_t config_page; - vm_address_t trampoline_page; - vm_address_t trampoline_page_template; - vm_prot_t cur_prot; - vm_prot_t max_prot; - kern_return_t kt; - uint16_t i; - - /* Allocate two pages -- a config page and a placeholder page */ - config_page = 0x0; - kt = vm_allocate (mach_task_self (), &config_page, PAGE_MAX_SIZE * 2, - VM_FLAGS_ANYWHERE); - if (kt != KERN_SUCCESS) - return NULL; - - /* Remap the trampoline table on top of the placeholder page */ - trampoline_page = config_page + PAGE_MAX_SIZE; - -#ifdef HAVE_ARM64E_PTRAUTH - trampoline_page_template = (vm_address_t)(uintptr_t)ptrauth_auth_data((void *)&ffi_closure_trampoline_table_page, ptrauth_key_function_pointer, 0); -#else - trampoline_page_template = (vm_address_t)&ffi_closure_trampoline_table_page; -#endif - -#ifdef __arm__ - /* ffi_closure_trampoline_table_page can be thumb-biased on some ARM archs */ - trampoline_page_template &= ~1UL; -#endif - kt = vm_remap (mach_task_self (), &trampoline_page, PAGE_MAX_SIZE, 0x0, - VM_FLAGS_OVERWRITE, mach_task_self (), trampoline_page_template, - FALSE, &cur_prot, &max_prot, VM_INHERIT_SHARE); - if (kt != KERN_SUCCESS) - { - vm_deallocate (mach_task_self (), config_page, PAGE_MAX_SIZE * 2); - return NULL; - } - - if (!(cur_prot & VM_PROT_EXECUTE)) - { - /* If VM_PROT_EXECUTE isn't set on the remapped trampoline page, set it */ - kt = vm_protect (mach_task_self (), trampoline_page, PAGE_MAX_SIZE, - FALSE, cur_prot | VM_PROT_EXECUTE); - if (kt != KERN_SUCCESS) - { - vm_deallocate (mach_task_self (), config_page, PAGE_MAX_SIZE * 2); - return NULL; - } - } - - /* We have valid trampoline and config pages */ - table = calloc (1, sizeof (ffi_trampoline_table)); - table->free_count = FFI_TRAMPOLINE_COUNT; - table->config_page = config_page; - - /* Create and initialize the free list */ - table->free_list_pool = - calloc (FFI_TRAMPOLINE_COUNT, sizeof (ffi_trampoline_table_entry)); - - for (i = 0; i < table->free_count; i++) - { - ffi_trampoline_table_entry *entry = &table->free_list_pool[i]; - entry->trampoline = - (void *) (trampoline_page + (i * FFI_TRAMPOLINE_SIZE)); -#ifdef HAVE_ARM64E_PTRAUTH - entry->trampoline = ptrauth_sign_unauthenticated(entry->trampoline, ptrauth_key_function_pointer, 0); -#endif - - if (i < table->free_count - 1) - entry->next = &table->free_list_pool[i + 1]; - } - - table->free_list = table->free_list_pool; - - return table; -} - -static void -ffi_trampoline_table_free (ffi_trampoline_table *table) -{ - /* Remove from the list */ - if (table->prev != NULL) - table->prev->next = table->next; - - if (table->next != NULL) - table->next->prev = table->prev; - - /* Deallocate pages */ - vm_deallocate (mach_task_self (), table->config_page, PAGE_MAX_SIZE * 2); - - /* Deallocate free list */ - free (table->free_list_pool); - free (table); -} - -void * -ffi_closure_alloc (size_t size, void **code) -{ - /* Create the closure */ - ffi_closure *closure = malloc (size); - if (closure == NULL) - return NULL; - - pthread_mutex_lock (&ffi_trampoline_lock); - - /* Check for an active trampoline table with available entries. */ - ffi_trampoline_table *table = ffi_trampoline_tables; - if (table == NULL || table->free_list == NULL) - { - table = ffi_trampoline_table_alloc (); - if (table == NULL) - { - pthread_mutex_unlock (&ffi_trampoline_lock); - free (closure); - return NULL; - } - - /* Insert the new table at the top of the list */ - table->next = ffi_trampoline_tables; - if (table->next != NULL) - table->next->prev = table; - - ffi_trampoline_tables = table; - } - - /* Claim the free entry */ - ffi_trampoline_table_entry *entry = ffi_trampoline_tables->free_list; - ffi_trampoline_tables->free_list = entry->next; - ffi_trampoline_tables->free_count--; - entry->next = NULL; - - pthread_mutex_unlock (&ffi_trampoline_lock); - - /* Initialize the return values */ - *code = entry->trampoline; - closure->trampoline_table = table; - closure->trampoline_table_entry = entry; - - return closure; -} - -void -ffi_closure_free (void *ptr) -{ - ffi_closure *closure = ptr; - - pthread_mutex_lock (&ffi_trampoline_lock); - - /* Fetch the table and entry references */ - ffi_trampoline_table *table = closure->trampoline_table; - ffi_trampoline_table_entry *entry = closure->trampoline_table_entry; - - /* Return the entry to the free list */ - entry->next = table->free_list; - table->free_list = entry; - table->free_count++; - - /* If all trampolines within this table are free, and at least one other table exists, deallocate - * the table */ - if (table->free_count == FFI_TRAMPOLINE_COUNT - && ffi_trampoline_tables != table) - { - ffi_trampoline_table_free (table); - } - else if (ffi_trampoline_tables != table) - { - /* Otherwise, bump this table to the top of the list */ - table->prev = NULL; - table->next = ffi_trampoline_tables; - if (ffi_trampoline_tables != NULL) - ffi_trampoline_tables->prev = table; - - ffi_trampoline_tables = table; - } - - pthread_mutex_unlock (&ffi_trampoline_lock); - - /* Free the closure */ - free (closure); -} - -#endif - -// Per-target implementation; It's unclear what can reasonable be shared between two OS/architecture implementations. - -#elif FFI_MMAP_EXEC_WRIT /* !FFI_EXEC_TRAMPOLINE_TABLE */ - -#define USE_LOCKS 1 -#define USE_DL_PREFIX 1 -#ifdef __GNUC__ -#ifndef USE_BUILTIN_FFS -#define USE_BUILTIN_FFS 1 -#endif -#endif - -/* We need to use mmap, not sbrk. */ -#define HAVE_MORECORE 0 - -/* We could, in theory, support mremap, but it wouldn't buy us anything. */ -#define HAVE_MREMAP 0 - -/* We have no use for this, so save some code and data. */ -#define NO_MALLINFO 1 - -/* We need all allocations to be in regular segments, otherwise we - lose track of the corresponding code address. */ -#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T - -/* Don't allocate more than a page unless needed. */ -#define DEFAULT_GRANULARITY ((size_t)malloc_getpagesize) - -#include -#include -#include -#include -#ifndef _MSC_VER -#include -#endif -#include -#include -#if !defined(_WIN32) -#ifdef HAVE_MNTENT -#include -#endif /* HAVE_MNTENT */ -#include -#include - -/* We don't want sys/mman.h to be included after we redefine mmap and - dlmunmap. */ -#include -#define LACKS_SYS_MMAN_H 1 - -#if FFI_MMAP_EXEC_SELINUX -#include -#include - -static int selinux_enabled = -1; - -static int -selinux_enabled_check (void) -{ - struct statfs sfs; - FILE *f; - char *buf = NULL; - size_t len = 0; - - if (statfs ("/selinux", &sfs) >= 0 - && (unsigned int) sfs.f_type == 0xf97cff8cU) - return 1; - f = fopen ("/proc/mounts", "r"); - if (f == NULL) - return 0; - while (getline (&buf, &len, f) >= 0) - { - char *p = strchr (buf, ' '); - if (p == NULL) - break; - p = strchr (p + 1, ' '); - if (p == NULL) - break; - if (strncmp (p + 1, "selinuxfs ", 10) == 0) - { - free (buf); - fclose (f); - return 1; - } - } - free (buf); - fclose (f); - return 0; -} - -#define is_selinux_enabled() (selinux_enabled >= 0 ? selinux_enabled \ - : (selinux_enabled = selinux_enabled_check ())) - -#else - -#define is_selinux_enabled() 0 - -#endif /* !FFI_MMAP_EXEC_SELINUX */ - -/* On PaX enable kernels that have MPROTECT enabled we can't use PROT_EXEC. */ -#if defined FFI_MMAP_PAX -#include - -enum { - PAX_MPROTECT = (1 << 0), - PAX_EMUTRAMP = (1 << 1), -}; -static int cached_pax_flags = -1; - -static int -pax_flags_check (void) -{ - char *buf = NULL; - size_t len = 0; - FILE *f; - int ret; - f = fopen ("/proc/self/status", "r"); - if (f == NULL) - return 0; - ret = 0; - - while (getline (&buf, &len, f) != -1) - if (!strncmp (buf, "PaX:", 4)) - { - if (NULL != strchr (buf + 4, 'M')) - ret |= PAX_MPROTECT; - if (NULL != strchr (buf + 4, 'E')) - ret |= PAX_EMUTRAMP; - break; - } - free (buf); - fclose (f); - return ret; -} - -#define get_pax_flags() (cached_pax_flags >= 0 ? cached_pax_flags \ - : (cached_pax_flags = pax_flags_check ())) -#define has_pax_flags(flags) ((flags) == ((flags) & get_pax_flags ())) -#define is_mprotect_enabled() (has_pax_flags (PAX_MPROTECT)) -#define is_emutramp_enabled() (has_pax_flags (PAX_EMUTRAMP)) - -#endif /* defined FFI_MMAP_PAX */ - -#elif defined (__CYGWIN__) || defined(__INTERIX) - -#include - -/* Cygwin is Linux-like, but not quite that Linux-like. */ -#define is_selinux_enabled() 0 - -#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */ - -#if !defined FFI_MMAP_PAX -# define is_mprotect_enabled() 0 -# define is_emutramp_enabled() 0 -#endif /* !defined FFI_MMAP_PAX */ - -/* Declare all functions defined in dlmalloc.c as static. */ -static void *dlmalloc(size_t); -static void dlfree(void*); -static void *dlcalloc(size_t, size_t) MAYBE_UNUSED; -static void *dlrealloc(void *, size_t) MAYBE_UNUSED; -static void *dlmemalign(size_t, size_t) MAYBE_UNUSED; -static void *dlvalloc(size_t) MAYBE_UNUSED; -static int dlmallopt(int, int) MAYBE_UNUSED; -static size_t dlmalloc_footprint(void) MAYBE_UNUSED; -static size_t dlmalloc_max_footprint(void) MAYBE_UNUSED; -static void** dlindependent_calloc(size_t, size_t, void**) MAYBE_UNUSED; -static void** dlindependent_comalloc(size_t, size_t*, void**) MAYBE_UNUSED; -static void *dlpvalloc(size_t) MAYBE_UNUSED; -static int dlmalloc_trim(size_t) MAYBE_UNUSED; -static size_t dlmalloc_usable_size(void*) MAYBE_UNUSED; -static void dlmalloc_stats(void) MAYBE_UNUSED; - -#if !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) -/* Use these for mmap and munmap within dlmalloc.c. */ -static void *dlmmap(void *, size_t, int, int, int, off_t); -static int dlmunmap(void *, size_t); -#endif /* !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ - -#define mmap dlmmap -#define munmap dlmunmap - -#include "dlmalloc.c" - -#undef mmap -#undef munmap - -#if !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) - -/* A mutex used to synchronize access to *exec* variables in this file. */ -static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER; - -/* A file descriptor of a temporary file from which we'll map - executable pages. */ -static int execfd = -1; - -/* The amount of space already allocated from the temporary file. */ -static size_t execsize = 0; - -#ifdef HAVE_MEMFD_CREATE -/* Open a temporary file name, and immediately unlink it. */ -static int -open_temp_exec_file_memfd (const char *name) -{ - int fd; - fd = memfd_create (name, MFD_CLOEXEC); - return fd; -} -#endif - -/* Open a temporary file name, and immediately unlink it. */ -static int -open_temp_exec_file_name (char *name, int flags MAYBE_UNUSED) -{ - int fd; - -#ifdef HAVE_MKOSTEMP - fd = mkostemp (name, flags); -#else - fd = mkstemp (name); -#endif - - if (fd != -1) - unlink (name); - - return fd; -} - -/* Open a temporary file in the named directory. */ -static int -open_temp_exec_file_dir (const char *dir) -{ - static const char suffix[] = "/ffiXXXXXX"; - int lendir, flags; - char *tempname; -#ifdef O_TMPFILE - int fd; -#endif - -#ifdef O_CLOEXEC - flags = O_CLOEXEC; -#else - flags = 0; -#endif - -#ifdef O_TMPFILE - fd = open (dir, flags | O_RDWR | O_EXCL | O_TMPFILE, 0700); - /* If the running system does not support the O_TMPFILE flag then retry without it. */ - if (fd != -1 || (errno != EINVAL && errno != EISDIR && errno != EOPNOTSUPP)) { - return fd; - } else { - errno = 0; - } -#endif - - lendir = (int) strlen (dir); - tempname = __builtin_alloca (lendir + sizeof (suffix)); - - if (!tempname) - return -1; - - memcpy (tempname, dir, lendir); - memcpy (tempname + lendir, suffix, sizeof (suffix)); - - return open_temp_exec_file_name (tempname, flags); -} - -/* Open a temporary file in the directory in the named environment - variable. */ -static int -open_temp_exec_file_env (const char *envvar) -{ - const char *value = getenv (envvar); - - if (!value) - return -1; - - return open_temp_exec_file_dir (value); -} - -#ifdef HAVE_MNTENT -/* Open a temporary file in an executable and writable mount point - listed in the mounts file. Subsequent calls with the same mounts - keep searching for mount points in the same file. Providing NULL - as the mounts file closes the file. */ -static int -open_temp_exec_file_mnt (const char *mounts) -{ - static const char *last_mounts; - static FILE *last_mntent; - - if (mounts != last_mounts) - { - if (last_mntent) - endmntent (last_mntent); - - last_mounts = mounts; - - if (mounts) - last_mntent = setmntent (mounts, "r"); - else - last_mntent = NULL; - } - - if (!last_mntent) - return -1; - - for (;;) - { - int fd; - struct mntent mnt; - char buf[MAXPATHLEN * 3]; - - if (getmntent_r (last_mntent, &mnt, buf, sizeof (buf)) == NULL) - return -1; - - if (hasmntopt (&mnt, "ro") - || hasmntopt (&mnt, "noexec") - || access (mnt.mnt_dir, W_OK)) - continue; - - fd = open_temp_exec_file_dir (mnt.mnt_dir); - - if (fd != -1) - return fd; - } -} -#endif /* HAVE_MNTENT */ - -/* Instructions to look for a location to hold a temporary file that - can be mapped in for execution. */ -static struct -{ - int (*func)(const char *); - const char *arg; - int repeat; -} open_temp_exec_file_opts[] = { -#ifdef HAVE_MEMFD_CREATE - { open_temp_exec_file_memfd, "libffi", 0 }, -#endif - { open_temp_exec_file_env, "LIBFFI_TMPDIR", 0 }, - { open_temp_exec_file_env, "TMPDIR", 0 }, - { open_temp_exec_file_dir, "/tmp", 0 }, - { open_temp_exec_file_dir, "/var/tmp", 0 }, - { open_temp_exec_file_dir, "/dev/shm", 0 }, - { open_temp_exec_file_env, "HOME", 0 }, -#ifdef HAVE_MNTENT - { open_temp_exec_file_mnt, "/etc/mtab", 1 }, - { open_temp_exec_file_mnt, "/proc/mounts", 1 }, -#endif /* HAVE_MNTENT */ -}; - -/* Current index into open_temp_exec_file_opts. */ -static int open_temp_exec_file_opts_idx = 0; - -/* Reset a current multi-call func, then advances to the next entry. - If we're at the last, go back to the first and return nonzero, - otherwise return zero. */ -static int -open_temp_exec_file_opts_next (void) -{ - if (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat) - open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func (NULL); - - open_temp_exec_file_opts_idx++; - if (open_temp_exec_file_opts_idx - == (sizeof (open_temp_exec_file_opts) - / sizeof (*open_temp_exec_file_opts))) - { - open_temp_exec_file_opts_idx = 0; - return 1; - } - - return 0; -} - -/* Return a file descriptor of a temporary zero-sized file in a - writable and executable filesystem. */ -int -open_temp_exec_file (void) -{ - int fd; - - do - { - fd = open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func - (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].arg); - - if (!open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat - || fd == -1) - { - if (open_temp_exec_file_opts_next ()) - break; - } - } - while (fd == -1); - - return fd; -} - -/* We need to allocate space in a file that will be backing a writable - mapping. Several problems exist with the usual approaches: - - fallocate() is Linux-only - - posix_fallocate() is not available on all platforms - - ftruncate() does not allocate space on filesystems with sparse files - Failure to allocate the space will cause SIGBUS to be thrown when - the mapping is subsequently written to. */ -static int -allocate_space (int fd, off_t len) -{ - static long page_size; - - /* Obtain system page size. */ - if (!page_size) - page_size = sysconf(_SC_PAGESIZE); - - unsigned char buf[page_size]; - memset (buf, 0, page_size); - - while (len > 0) - { - off_t to_write = (len < page_size) ? len : page_size; - if (write (fd, buf, to_write) < to_write) - return -1; - len -= to_write; - } - - return 0; -} - -/* Map in a chunk of memory from the temporary exec file into separate - locations in the virtual memory address space, one writable and one - executable. Returns the address of the writable portion, after - storing an offset to the corresponding executable portion at the - last word of the requested chunk. */ -static void * -dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset) -{ - void *ptr; - - if (execfd == -1) - { - open_temp_exec_file_opts_idx = 0; - retry_open: - execfd = open_temp_exec_file (); - if (execfd == -1) - return MFAIL; - } - - offset = execsize; - - if (allocate_space (execfd, length)) - return MFAIL; - - flags &= ~(MAP_PRIVATE | MAP_ANONYMOUS); - flags |= MAP_SHARED; - - ptr = mmap (NULL, length, (prot & ~PROT_WRITE) | PROT_EXEC, - flags, execfd, offset); - if (ptr == MFAIL) - { - if (!offset) - { - close (execfd); - goto retry_open; - } - if (ftruncate (execfd, offset) != 0) - { - /* Fixme : Error logs can be added here. Returning an error for - * ftruncte() will not add any advantage as it is being - * validating in the error case. */ - } - - return MFAIL; - } - else if (!offset - && open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat) - open_temp_exec_file_opts_next (); - - start = mmap (start, length, prot, flags, execfd, offset); - - if (start == MFAIL) - { - munmap (ptr, length); - if (ftruncate (execfd, offset) != 0) - { - /* Fixme : Error logs can be added here. Returning an error for - * ftruncte() will not add any advantage as it is being - * validating in the error case. */ - } - return start; - } - - mmap_exec_offset ((char *)start, length) = (char*)ptr - (char*)start; - - execsize += length; - - return start; -} - -/* Map in a writable and executable chunk of memory if possible. - Failing that, fall back to dlmmap_locked. */ -static void * -dlmmap (void *start, size_t length, int prot, - int flags, int fd, off_t offset) -{ - void *ptr; - - assert (start == NULL && length % malloc_getpagesize == 0 - && prot == (PROT_READ | PROT_WRITE) - && flags == (MAP_PRIVATE | MAP_ANONYMOUS) - && fd == -1 && offset == 0); - - if (execfd == -1 && ffi_tramp_is_supported ()) - { - ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset); - return ptr; - } - - /* -1 != execfd hints that we already decided to use dlmmap_locked - last time. */ - if (execfd == -1 && is_mprotect_enabled ()) - { -#ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX - if (is_emutramp_enabled ()) - { - /* emutramp requires the kernel recognizing the trampoline pattern - generated by ffi_prep_closure_loc; there is no way to test - in advance whether this will work, so this is experimental. */ - ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset); - return ptr; - } -#endif - /* fallback to dlmmap_locked. */ - } - else if (execfd == -1 && !is_selinux_enabled ()) - { - ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset); - - if (ptr != MFAIL || (errno != EPERM && errno != EACCES)) - /* Cool, no need to mess with separate segments. */ - return ptr; - - /* If MREMAP_DUP is ever introduced and implemented, try mmap - with ((prot & ~PROT_WRITE) | PROT_EXEC) and mremap with - MREMAP_DUP and prot at this point. */ - } - - pthread_mutex_lock (&open_temp_exec_file_mutex); - ptr = dlmmap_locked (start, length, prot, flags, offset); - pthread_mutex_unlock (&open_temp_exec_file_mutex); - - return ptr; -} - -/* Release memory at the given address, as well as the corresponding - executable page if it's separate. */ -static int -dlmunmap (void *start, size_t length) -{ - /* We don't bother decreasing execsize or truncating the file, since - we can't quite tell whether we're unmapping the end of the file. - We don't expect frequent deallocation anyway. If we did, we - could locate pages in the file by writing to the pages being - deallocated and checking that the file contents change. - Yuck. */ - msegmentptr seg = segment_holding (gm, start); - void *code; - - if (seg && (code = add_segment_exec_offset (start, seg)) != start) - { - int ret = munmap (code, length); - if (ret) - return ret; - } - - return munmap (start, length); -} - -#if FFI_CLOSURE_FREE_CODE -/* Return segment holding given code address. */ -static msegmentptr -segment_holding_code (mstate m, char* addr) -{ - msegmentptr sp = &m->seg; - for (;;) { - if (addr >= add_segment_exec_offset (sp->base, sp) - && addr < add_segment_exec_offset (sp->base, sp) + sp->size) - return sp; - if ((sp = sp->next) == 0) - return 0; - } -} -#endif - -#endif /* !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ - -/* Allocate a chunk of memory with the given size. Returns a pointer - to the writable address, and sets *CODE to the executable - corresponding virtual address. */ -void * -ffi_closure_alloc (size_t size, void **code) -{ - void *ptr, *ftramp; - - if (!code) - return NULL; - - ptr = dlmalloc (size); - - if (ptr) - { - msegmentptr seg = segment_holding (gm, ptr); - - *code = FFI_FN (add_segment_exec_offset (ptr, seg)); - if (!ffi_tramp_is_supported ()) - return ptr; - - ftramp = ffi_tramp_alloc (0); - if (ftramp == NULL) - { - dlfree (ptr); - return NULL; - } - *code = FFI_FN (ffi_tramp_get_addr (ftramp)); - ((ffi_closure *) ptr)->ftramp = ftramp; - } - - return ptr; -} - -void * -ffi_data_to_code_pointer (void *data) -{ - msegmentptr seg = segment_holding (gm, data); - /* We expect closures to be allocated with ffi_closure_alloc(), in - which case seg will be non-NULL. However, some users take on the - burden of managing this memory themselves, in which case this - we'll just return data. */ - if (seg) - { - if (!ffi_tramp_is_supported ()) - return add_segment_exec_offset (data, seg); - return ffi_tramp_get_addr (((ffi_closure *) data)->ftramp); - } - else - return data; -} - -/* Release a chunk of memory allocated with ffi_closure_alloc. If - FFI_CLOSURE_FREE_CODE is nonzero, the given address can be the - writable or the executable address given. Otherwise, only the - writable address can be provided here. */ -void -ffi_closure_free (void *ptr) -{ -#if FFI_CLOSURE_FREE_CODE - msegmentptr seg = segment_holding_code (gm, ptr); - - if (seg) - ptr = sub_segment_exec_offset (ptr, seg); -#endif - if (ffi_tramp_is_supported ()) - ffi_tramp_free (((ffi_closure *) ptr)->ftramp); - - dlfree (ptr); -} - -int -ffi_tramp_is_present (void *ptr) -{ - msegmentptr seg = segment_holding (gm, ptr); - return seg != NULL && ffi_tramp_is_supported(); -} - -# else /* ! FFI_MMAP_EXEC_WRIT */ - -/* On many systems, memory returned by malloc is writable and - executable, so just use it. */ - -#include - -void * -ffi_closure_alloc (size_t size, void **code) -{ - void *c; - - if (!code) - return NULL; - - c = malloc (size); - *code = FFI_FN (c); - return c; -} - -void -ffi_closure_free (void *ptr) -{ - free (ptr); -} - -void * -ffi_data_to_code_pointer (void *data) -{ - return data; -} - -int -ffi_tramp_is_present (__attribute__((unused)) void *ptr) -{ - return 0; -} - -# endif /* ! FFI_MMAP_EXEC_WRIT */ -#endif /* FFI_CLOSURES */ - -#endif /* NetBSD with PROT_MPROTECT */ -#endif /* __EMSCRIPTEN__ */ diff --git a/deps/libffi/src/cris/ffi.c b/deps/libffi/src/cris/ffi.c deleted file mode 100644 index 9011fdec03a877..00000000000000 --- a/deps/libffi/src/cris/ffi.c +++ /dev/null @@ -1,386 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998 Cygnus Solutions - Copyright (c) 2004 Simon Posnjak - Copyright (c) 2005 Axis Communications AB - Copyright (C) 2007 Free Software Foundation, Inc. - - CRIS Foreign Function Interface - - 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 SIMON POSNJAK 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#define STACK_ARG_SIZE(x) FFI_ALIGN(x, FFI_SIZEOF_ARG) - -static ffi_status -initialize_aggregate_packed_struct (ffi_type * arg) -{ - ffi_type **ptr; - - FFI_ASSERT (arg != NULL); - - FFI_ASSERT (arg->elements != NULL); - FFI_ASSERT (arg->size == 0); - FFI_ASSERT (arg->alignment == 0); - - ptr = &(arg->elements[0]); - - while ((*ptr) != NULL) - { - if (((*ptr)->size == 0) - && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK)) - return FFI_BAD_TYPEDEF; - - FFI_ASSERT (ffi_type_test ((*ptr))); - - arg->size += (*ptr)->size; - - arg->alignment = (arg->alignment > (*ptr)->alignment) ? - arg->alignment : (*ptr)->alignment; - - ptr++; - } - - if (arg->size == 0) - return FFI_BAD_TYPEDEF; - else - return FFI_OK; -} - -int -ffi_prep_args (char *stack, extended_cif * ecif) -{ - unsigned int i; - unsigned int struct_count = 0; - void **p_argv; - char *argp; - ffi_type **p_arg; - - argp = stack; - - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; - (i != 0); i--, p_arg++) - { - size_t z; - - switch ((*p_arg)->type) - { - case FFI_TYPE_STRUCT: - { - z = (*p_arg)->size; - if (z <= 4) - { - memcpy (argp, *p_argv, z); - z = 4; - } - else if (z <= 8) - { - memcpy (argp, *p_argv, z); - z = 8; - } - else - { - unsigned int uiLocOnStack; - z = sizeof (void *); - uiLocOnStack = 4 * ecif->cif->nargs + struct_count; - struct_count = struct_count + (*p_arg)->size; - *(unsigned int *) argp = - (unsigned int) (UINT32 *) (stack + uiLocOnStack); - memcpy ((stack + uiLocOnStack), *p_argv, (*p_arg)->size); - } - break; - } - default: - z = (*p_arg)->size; - if (z < sizeof (int)) - { - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int) *(SINT8 *) (*p_argv); - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = - (unsigned int) *(UINT8 *) (*p_argv); - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int) *(SINT16 *) (*p_argv); - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = - (unsigned int) *(UINT16 *) (*p_argv); - break; - - default: - FFI_ASSERT (0); - } - z = sizeof (int); - } - else if (z == sizeof (int)) - *(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv); - else - memcpy (argp, *p_argv, z); - break; - } - p_argv++; - argp += z; - } - - return (struct_count); -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_core (ffi_cif * cif, - ffi_abi abi, unsigned int isvariadic, - unsigned int nfixedargs, unsigned int ntotalargs, - ffi_type * rtype, ffi_type ** atypes) -{ - unsigned bytes = 0; - unsigned int i; - ffi_type **ptr; - - FFI_ASSERT (cif != NULL); - FFI_ASSERT((!isvariadic) || (nfixedargs >= 1)); - FFI_ASSERT(nfixedargs <= ntotalargs); - FFI_ASSERT (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI); - - cif->abi = abi; - cif->arg_types = atypes; - cif->nargs = ntotalargs; - cif->rtype = rtype; - - cif->flags = 0; - - if ((cif->rtype->size == 0) - && (initialize_aggregate_packed_struct (cif->rtype) != FFI_OK)) - return FFI_BAD_TYPEDEF; - - FFI_ASSERT_VALID_TYPE (cif->rtype); - - for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) - { - if (((*ptr)->size == 0) - && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK)) - return FFI_BAD_TYPEDEF; - - FFI_ASSERT_VALID_TYPE (*ptr); - - if (((*ptr)->alignment - 1) & bytes) - bytes = FFI_ALIGN (bytes, (*ptr)->alignment); - if ((*ptr)->type == FFI_TYPE_STRUCT) - { - if ((*ptr)->size > 8) - { - bytes += (*ptr)->size; - bytes += sizeof (void *); - } - else - { - if ((*ptr)->size > 4) - bytes += 8; - else - bytes += 4; - } - } - else - bytes += STACK_ARG_SIZE ((*ptr)->size); - } - - cif->bytes = bytes; - - return ffi_prep_cif_machdep (cif); -} - -ffi_status -ffi_prep_cif_machdep (ffi_cif * cif) -{ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - case FFI_TYPE_STRUCT: - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - cif->flags = (unsigned) cif->rtype->type; - break; - - default: - cif->flags = FFI_TYPE_INT; - break; - } - - return FFI_OK; -} - -extern void ffi_call_SYSV (int (*)(char *, extended_cif *), - extended_cif *, - unsigned, unsigned, unsigned *, void (*fn) ()) - __attribute__ ((__visibility__ ("hidden"))); - -void -ffi_call (ffi_cif * cif, void (*fn) (), void *rvalue, void **avalue) -{ - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) - { - ecif.rvalue = alloca (cif->rtype->size); - } - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_SYSV: - ffi_call_SYSV (ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - break; - default: - FFI_ASSERT (0); - break; - } -} - -/* Because the following variables are not exported outside libffi, we - mark them hidden. */ - -/* Assembly code for the jump stub. */ -extern const char ffi_cris_trampoline_template[] - __attribute__ ((__visibility__ ("hidden"))); - -/* Offset into ffi_cris_trampoline_template of where to put the - ffi_prep_closure_inner function. */ -extern const int ffi_cris_trampoline_fn_offset - __attribute__ ((__visibility__ ("hidden"))); - -/* Offset into ffi_cris_trampoline_template of where to put the - closure data. */ -extern const int ffi_cris_trampoline_closure_offset - __attribute__ ((__visibility__ ("hidden"))); - -/* This function is sibling-called (jumped to) by the closure - trampoline. We get R10..R13 at PARAMS[0..3] and a copy of [SP] at - PARAMS[4] to simplify handling of a straddling parameter. A copy - of R9 is at PARAMS[5] and SP at PARAMS[6]. These parameters are - put at the appropriate place in CLOSURE which is then executed and - the return value is passed back to the caller. */ - -static unsigned long long -ffi_prep_closure_inner (void **params, ffi_closure* closure) -{ - char *register_args = (char *) params; - void *struct_ret = params[5]; - char *stack_args = params[6]; - char *ptr = register_args; - ffi_cif *cif = closure->cif; - ffi_type **arg_types = cif->arg_types; - - /* Max room needed is number of arguments as 64-bit values. */ - void **avalue = alloca (closure->cif->nargs * sizeof(void *)); - int i; - int doing_regs; - long long llret = 0; - - /* Find the address of each argument. */ - for (i = 0, doing_regs = 1; i < cif->nargs; i++) - { - /* Types up to and including 8 bytes go by-value. */ - if (arg_types[i]->size <= 4) - { - avalue[i] = ptr; - ptr += 4; - } - else if (arg_types[i]->size <= 8) - { - avalue[i] = ptr; - ptr += 8; - } - else - { - FFI_ASSERT (arg_types[i]->type == FFI_TYPE_STRUCT); - - /* Passed by-reference, so copy the pointer. */ - avalue[i] = *(void **) ptr; - ptr += 4; - } - - /* If we've handled more arguments than fit in registers, start - looking at the those passed on the stack. Step over the - first one if we had a straddling parameter. */ - if (doing_regs && ptr >= register_args + 4*4) - { - ptr = stack_args + ((ptr > register_args + 4*4) ? 4 : 0); - doing_regs = 0; - } - } - - /* Invoke the closure. */ - (closure->fun) (cif, - - cif->rtype->type == FFI_TYPE_STRUCT - /* The caller allocated space for the return - structure, and passed a pointer to this space in - R9. */ - ? struct_ret - - /* We take advantage of being able to ignore that - the high part isn't set if the return value is - not in R10:R11, but in R10 only. */ - : (void *) &llret, - - avalue, closure->user_data); - - return llret; -} - -/* API function: Prepare the trampoline. */ - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif *, void *, void **, void*), - void *user_data, - void *codeloc) -{ - void *innerfn = ffi_prep_closure_inner; - FFI_ASSERT (cif->abi == FFI_SYSV); - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - memcpy (closure->tramp, ffi_cris_trampoline_template, - FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE); - memcpy (closure->tramp + ffi_cris_trampoline_fn_offset, - &innerfn, sizeof (void *)); - memcpy (closure->tramp + ffi_cris_trampoline_closure_offset, - &codeloc, sizeof (void *)); - - return FFI_OK; -} diff --git a/deps/libffi/src/cris/ffitarget.h b/deps/libffi/src/cris/ffitarget.h deleted file mode 100644 index b837e976e4e8b6..00000000000000 --- a/deps/libffi/src/cris/ffitarget.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for CRIS. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE 36 -#define FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE (7*4) -#define FFI_TRAMPOLINE_SIZE \ - (FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE + FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE) -#define FFI_NATIVE_RAW_API 0 - -#endif diff --git a/deps/libffi/src/cris/sysv.S b/deps/libffi/src/cris/sysv.S deleted file mode 100644 index 79abaee4d959ce..00000000000000 --- a/deps/libffi/src/cris/sysv.S +++ /dev/null @@ -1,215 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2004 Simon Posnjak - Copyright (c) 2005 Axis Communications AB - - CRIS Foreign Function Interface - - 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 SIMON POSNJAK 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#define CONCAT(x,y) x ## y -#define XCONCAT(x,y) CONCAT (x, y) -#define L(x) XCONCAT (__USER_LABEL_PREFIX__, x) - - .text - - ;; OK, when we get called we should have this (according to - ;; AXIS ETRAX 100LX Programmer's Manual chapter 6.3). - ;; - ;; R10: ffi_prep_args (func. pointer) - ;; R11: &ecif - ;; R12: cif->bytes - ;; R13: fig->flags - ;; sp+0: ecif.rvalue - ;; sp+4: fn (function pointer to the function that we need to call) - - .globl L(ffi_call_SYSV) - .type L(ffi_call_SYSV),@function - .hidden L(ffi_call_SYSV) - -L(ffi_call_SYSV): - ;; Save the regs to the stack. - push $srp - ;; Used for stack pointer saving. - push $r6 - ;; Used for function address pointer. - push $r7 - ;; Used for stack pointer saving. - push $r8 - ;; We save fig->flags to stack we will need them after we - ;; call The Function. - push $r13 - - ;; Saving current stack pointer. - move.d $sp,$r8 - move.d $sp,$r6 - - ;; Move address of ffi_prep_args to r13. - move.d $r10,$r13 - - ;; Make room on the stack for the args of fn. - sub.d $r12,$sp - - ;; Function void ffi_prep_args(char *stack, extended_cif *ecif) parameters are: - ;; r10 <-- stack pointer - ;; r11 <-- &ecif (already there) - move.d $sp,$r10 - - ;; Call the function. - jsr $r13 - - ;; Save the size of the structures which are passed on stack. - move.d $r10,$r7 - - ;; Move first four args in to r10..r13. - move.d [$sp+0],$r10 - move.d [$sp+4],$r11 - move.d [$sp+8],$r12 - move.d [$sp+12],$r13 - - ;; Adjust the stack and check if any parameters are given on stack. - addq 16,$sp - sub.d $r7,$r6 - cmp.d $sp,$r6 - - bpl go_on - nop - -go_on_no_params_on_stack: - move.d $r6,$sp - -go_on: - ;; Discover if we need to put rval address in to r9. - move.d [$r8+0],$r7 - cmpq FFI_TYPE_STRUCT,$r7 - bne call_now - nop - - ;; Move rval address to $r9. - move.d [$r8+20],$r9 - -call_now: - ;; Move address of The Function in to r7. - move.d [$r8+24],$r7 - - ;; Call The Function. - jsr $r7 - - ;; Reset stack. - move.d $r8,$sp - - ;; Load rval type (fig->flags) in to r13. - pop $r13 - - ;; Detect rval type. - cmpq FFI_TYPE_VOID,$r13 - beq epilogue - - cmpq FFI_TYPE_STRUCT,$r13 - beq epilogue - - cmpq FFI_TYPE_DOUBLE,$r13 - beq return_double_or_longlong - - cmpq FFI_TYPE_UINT64,$r13 - beq return_double_or_longlong - - cmpq FFI_TYPE_SINT64,$r13 - beq return_double_or_longlong - nop - - ;; Just return the 32 bit value. - ba return - nop - -return_double_or_longlong: - ;; Load half of the rval to r10 and the other half to r11. - move.d [$sp+16],$r13 - move.d $r10,[$r13] - addq 4,$r13 - move.d $r11,[$r13] - ba epilogue - nop - -return: - ;; Load the rval to r10. - move.d [$sp+16],$r13 - move.d $r10,[$r13] - -epilogue: - pop $r8 - pop $r7 - pop $r6 - Jump [$sp+] - - .size ffi_call_SYSV,.-ffi_call_SYSV - -/* Save R10..R13 into an array, somewhat like varargs. Copy the next - argument too, to simplify handling of any straddling parameter. - Save R9 and SP after those. Jump to function handling the rest. - Since this is a template, copied and the main function filled in by - the user. */ - - .globl L(ffi_cris_trampoline_template) - .type L(ffi_cris_trampoline_template),@function - .hidden L(ffi_cris_trampoline_template) - -L(ffi_cris_trampoline_template): -0: - /* The value we get for "PC" is right after the prefix instruction, - two bytes from the beginning, i.e. 0b+2. */ - move.d $r10,[$pc+2f-(0b+2)] - move.d $pc,$r10 -1: - addq 2f-1b+4,$r10 - move.d $r11,[$r10+] - move.d $r12,[$r10+] - move.d $r13,[$r10+] - move.d [$sp],$r11 - move.d $r11,[$r10+] - move.d $r9,[$r10+] - move.d $sp,[$r10+] - subq FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE,$r10 - move.d 0,$r11 -3: - jump 0 -2: - .size ffi_cris_trampoline_template,.-0b - -/* This macro create a constant usable as "extern const int \name" in - C from within libffi, when \name has no prefix decoration. */ - - .macro const name,value - .globl \name - .type \name,@object - .hidden \name -\name: - .dword \value - .size \name,4 - .endm - -/* Constants for offsets within the trampoline. We could do this with - just symbols, avoiding memory contents and memory accesses, but the - C usage code would look a bit stranger. */ - - const L(ffi_cris_trampoline_fn_offset),2b-4-0b - const L(ffi_cris_trampoline_closure_offset),3b-4-0b diff --git a/deps/libffi/src/csky/ffi.c b/deps/libffi/src/csky/ffi.c deleted file mode 100644 index af50b7c648dfe1..00000000000000 --- a/deps/libffi/src/csky/ffi.c +++ /dev/null @@ -1,395 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - - CSKY Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments -*/ -void ffi_prep_args(char *stack, extended_cif *ecif) -{ - register unsigned int i; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - - argp = stack; - - if ( ecif->cif->flags == FFI_TYPE_STRUCT ) { - *(void **) argp = ecif->rvalue; - argp += 4; - } - - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; - (i != 0); - i--, p_arg++) - { - size_t z; - size_t alignment; - - /* Align if necessary */ - alignment = (*p_arg)->alignment; -#ifdef __CSKYABIV1__ - /* - * Adapt ABIV1 bug. - * If struct's size is larger than 8 bytes, then it always alignment as 4 bytes. - */ - if (((*p_arg)->type == FFI_TYPE_STRUCT) && ((*p_arg)->size > 8) && (alignment == 8)) { - alignment = 4; - } -#endif - - if ((alignment - 1) & (unsigned) argp) { - argp = (char *) FFI_ALIGN(argp, alignment); - } - - if ((*p_arg)->type == FFI_TYPE_STRUCT) - argp = (char *) FFI_ALIGN(argp, 4); - - z = (*p_arg)->size; - if (z < sizeof(int)) - { - z = sizeof(int); - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); - break; - - case FFI_TYPE_STRUCT: -#ifdef __CSKYBE__ - memcpy((argp + 4 - (*p_arg)->size), *p_argv, (*p_arg)->size); -#else - memcpy(argp, *p_argv, (*p_arg)->size); -#endif - break; - - default: - FFI_ASSERT(0); - } - } - else if (z == sizeof(int)) - { - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - } - else - { - memcpy(argp, *p_argv, z); - } - p_argv++; - argp += z; - } - - return; -} - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - /* Round the stack up to a multiple of 8 bytes. This isn't needed - everywhere, but it is on some platforms, and it doesn't hcsky anything - when it isn't needed. */ - cif->bytes = (cif->bytes + 7) & ~7; - - /* Set the return type flag */ - switch (cif->rtype->type) - { - - case FFI_TYPE_DOUBLE: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - cif->flags = (unsigned) FFI_TYPE_SINT64; - break; - - case FFI_TYPE_STRUCT: - if (cif->rtype->size <= 4) - /* A Composite Type not larger than 4 bytes is returned in r0. */ - cif->flags = (unsigned)FFI_TYPE_INT; - else if (cif->rtype->size <= 8) - /* A Composite Type not larger than 8 bytes is returned in r0, r1. */ - cif->flags = (unsigned)FFI_TYPE_SINT64; - else - /* A Composite Type larger than 8 bytes, or whose size cannot - be determined statically ... is stored in memory at an - address passed [in r0]. */ - cif->flags = (unsigned)FFI_TYPE_STRUCT; - break; - - default: - cif->flags = FFI_TYPE_INT; - break; - } - - return FFI_OK; -} - -/* Perform machine dependent cif processing for variadic calls */ -ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, - unsigned int nfixedargs, - unsigned int ntotalargs) -{ - return ffi_prep_cif_machdep(cif); -} - -/* Prototypes for assembly functions, in sysv.S */ -extern void ffi_call_SYSV (void (*fn)(void), extended_cif *, unsigned, unsigned, unsigned *); - -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - extended_cif ecif; - - int small_struct = (cif->flags == FFI_TYPE_INT - && cif->rtype->type == FFI_TYPE_STRUCT); - - ecif.cif = cif; - ecif.avalue = avalue; - - unsigned int temp; - - /* If the return value is a struct and we don't have a return */ - /* value address then we need to make one */ - - if ((rvalue == NULL) && - (cif->flags == FFI_TYPE_STRUCT)) - { - ecif.rvalue = alloca(cif->rtype->size); - } - else if (small_struct) - ecif.rvalue = &temp; - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_SYSV: - ffi_call_SYSV (fn, &ecif, cif->bytes, cif->flags, ecif.rvalue); - break; - - default: - FFI_ASSERT(0); - break; - } - if (small_struct) -#ifdef __CSKYBE__ - memcpy (rvalue, ((unsigned char *)&temp + (4 - cif->rtype->size)), cif->rtype->size); -#else - memcpy (rvalue, &temp, cif->rtype->size); -#endif -} - -/** private members **/ - -static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, - void** args, ffi_cif* cif); - -void ffi_closure_SYSV (ffi_closure *); - -/* This function is jumped to by the trampoline */ - -unsigned int -ffi_closure_SYSV_inner (closure, respp, args) - ffi_closure *closure; - void **respp; - void *args; -{ - // our various things... - ffi_cif *cif; - void **arg_area; - - cif = closure->cif; - arg_area = (void**) alloca (cif->nargs * sizeof (void*)); - - /* this call will initialize ARG_AREA, such that each - * element in that array points to the corresponding - * value on the stack; and if the function returns - * a structure, it will re-set RESP to point to the - * structure return address. */ - - ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif); - - (closure->fun) (cif, *respp, arg_area, closure->user_data); - -#ifdef __CSKYBE__ - if (cif->flags == FFI_TYPE_INT && cif->rtype->type == FFI_TYPE_STRUCT) { - unsigned int tmp = 0; - tmp = *(unsigned int *)(*respp); - *(unsigned int *)(*respp) = (tmp >> ((4 - cif->rtype->size) * 8)); - } -#endif - - return cif->flags; -} - - -static void -ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, - void **avalue, ffi_cif *cif) -{ - register unsigned int i; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - - argp = stack; - - if ( cif->flags == FFI_TYPE_STRUCT ) { - *rvalue = *(void **) argp; - argp += 4; - } - - p_argv = avalue; - - for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) - { - size_t z; - size_t alignment; - - alignment = (*p_arg)->alignment; - if (alignment < 4) - alignment = 4; - -#ifdef __CSKYABIV1__ - /* - * Adapt ABIV1 bug. - * If struct's size is larger than 8 bytes, then it always alignment as 4 bytes. - */ - if (((*p_arg)->type == FFI_TYPE_STRUCT) && ((*p_arg)->size > 8) && (alignment == 8)) { - alignment = 4; - } -#endif - - /* Align if necessary */ - if ((alignment - 1) & (unsigned) argp) { - argp = (char *) FFI_ALIGN(argp, alignment); - } - - z = (*p_arg)->size; - -#ifdef __CSKYBE__ - unsigned int tmp = 0; - if ((*p_arg)->size < 4) { - tmp = *(unsigned int *)argp; - memcpy(argp, ((unsigned char *)&tmp + (4 - (*p_arg)->size)), (*p_arg)->size); - } -#else - /* because we're little endian, this is what it turns into. */ -#endif - *p_argv = (void*) argp; - - p_argv++; - argp += z; - } - - return; -} - -/* How to make a trampoline. */ - -extern unsigned char ffi_csky_trampoline[TRAMPOLINE_SIZE]; - -/* - * Since there is no __clear_cache in libgcc in csky toolchain. - * define ffi_csky_cacheflush in sysv.S. - * void ffi_csky_cacheflush(uint32 start_addr, uint32 size, int cache) - */ -#define CACHEFLUSH_IN_FFI 1 -#if CACHEFLUSH_IN_FFI -extern void ffi_csky_cacheflush(unsigned char *__tramp, unsigned int k, - int i); -#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ -({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ - unsigned int __fun = (unsigned int)(FUN); \ - unsigned int __ctx = (unsigned int)(CTX); \ - unsigned char *insns = (unsigned char *)(CTX); \ - memcpy (__tramp, ffi_csky_trampoline, TRAMPOLINE_SIZE); \ - *(unsigned int*) &__tramp[TRAMPOLINE_SIZE] = __ctx; \ - *(unsigned int*) &__tramp[TRAMPOLINE_SIZE + 4] = __fun; \ - ffi_csky_cacheflush(&__tramp[0], TRAMPOLINE_SIZE, 3); /* Clear data mapping. */ \ - ffi_csky_cacheflush(insns, TRAMPOLINE_SIZE, 3); \ - /* Clear instruction \ - mapping. */ \ - }) -#else -#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ -({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ - unsigned int __fun = (unsigned int)(FUN); \ - unsigned int __ctx = (unsigned int)(CTX); \ - unsigned char *insns = (unsigned char *)(CTX); \ - memcpy (__tramp, ffi_csky_trampoline, TRAMPOLINE_SIZE); \ - *(unsigned int*) &__tramp[TRAMPOLINE_SIZE] = __ctx; \ - *(unsigned int*) &__tramp[TRAMPOLINE_SIZE + 4] = __fun; \ - __clear_cache((&__tramp[0]), (&__tramp[TRAMPOLINE_SIZE-1])); /* Clear data mapping. */ \ - __clear_cache(insns, insns + TRAMPOLINE_SIZE); \ - /* Clear instruction \ - mapping. */ \ - }) -#endif - -/* the cif must already be prep'ed */ - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - void (*closure_func)(ffi_closure*) = NULL; - - if (cif->abi == FFI_SYSV) - closure_func = &ffi_closure_SYSV; - else - return FFI_BAD_ABI; - - FFI_INIT_TRAMPOLINE (&closure->tramp[0], \ - closure_func, \ - codeloc); - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; -} - - diff --git a/deps/libffi/src/csky/ffitarget.h b/deps/libffi/src/csky/ffitarget.h deleted file mode 100644 index f770aac66f1d4d..00000000000000 --- a/deps/libffi/src/csky/ffitarget.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 2010 CodeSourcery - Copyright (c) 1996-2003 Red Hat, Inc. - - Target configuration macros for CSKY. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV, -} ffi_abi; -#endif - -#ifdef __CSKYABIV2__ -#define FFI_ASM_ARGREG_SIZE 16 -#define TRAMPOLINE_SIZE 16 -#define FFI_TRAMPOLINE_SIZE 24 -#else -#define FFI_ASM_ARGREG_SIZE 24 -#define TRAMPOLINE_SIZE 20 -#define FFI_TRAMPOLINE_SIZE 28 -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 -#endif diff --git a/deps/libffi/src/csky/sysv.S b/deps/libffi/src/csky/sysv.S deleted file mode 100644 index 21670bfd3d0309..00000000000000 --- a/deps/libffi/src/csky/sysv.S +++ /dev/null @@ -1,371 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - - CSKY Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -.macro CSKY_FUNC_START name - .text - .align 2 - .globl \name - .type \name, @function - \name: -.endm - -#ifdef __CSKYABIV2__ - - /* - * a0: fn - * a1: &ecif - * a2: cif->bytes - * a3: fig->flags - * sp+0: ecif.rvalue - */ -CSKY_FUNC_START ffi_call_SYSV - /* Save registers */ - .cfi_startproc - subi sp, 28 - .cfi_def_cfa_offset 28 - stw a0, (sp, 0x0) - .cfi_offset 0, -28 - stw a1, (sp, 0x4) - .cfi_offset 1, -24 - stw a2, (sp, 0x8) - .cfi_offset 2, -20 - stw a3, (sp, 0xC) - .cfi_offset 3, -16 - stw l0, (sp, 0x10) - .cfi_offset 4, -12 - stw l1, (sp, 0x14) - .cfi_offset 5, -8 - stw lr, (sp, 0x18) - .cfi_offset 15, -4 - - mov l0, sp - .cfi_def_cfa_register 4 - - /* Make room for all of the new args. */ - subu sp, sp, a2 - - /* Place all of the ffi_prep_args in position */ - mov a0, sp - /* a1 already set */ - - /* Call ffi_prep_args(stack, &ecif) */ - jsri ffi_prep_args - - /* move first 4 parameters in registers */ - ldw a0, (sp, 0x0) - ldw a1, (sp, 0x4) - ldw a2, (sp, 0x8) - ldw a3, (sp, 0xC) - - /* and adjust stack */ - subu lr, l0, sp /* cif->bytes == l0 - sp */ - cmphsi lr, 16 - movi l1, 16 - movt lr, l1 - addu sp, sp, lr - - ldw l1, (l0, 0) /* load fn() in advance */ - - /* call (fn) (...) */ - jsr l1 - - /* Remove the space we pushed for the args */ - mov sp, l0 - - /* Load r2 with the pointer to storage for the return value */ - ldw a2, (sp, 0x1C) - - /* Load r3 with the return type code */ - ldw a3, (sp, 0xC) - - /* If the return value pointer is NULL, assume no return value. */ - cmpnei a2, 0 - bf .Lepilogue - - cmpnei a3, FFI_TYPE_STRUCT - bf .Lepilogue - - /* return INT64 */ - cmpnei a3, FFI_TYPE_SINT64 - bt .Lretint - /* stw a0, (a2, 0x0) at .Lretint */ - stw a1, (a2, 0x4) - -.Lretint: - /* return INT */ - stw a0, (a2, 0x0) - -.Lepilogue: - ldw a0, (sp, 0x0) - ldw a1, (sp, 0x4) - ldw a2, (sp, 0x8) - ldw a3, (sp, 0xC) - ldw l0, (sp, 0x10) - ldw l1, (sp, 0x14) - ldw lr, (sp, 0x18) - addi sp, sp, 28 - rts - .cfi_endproc - .size ffi_call_SYSV, .-ffi_call_SYSV - - - /* - * unsigned int FFI_HIDDEN - * ffi_closure_SYSV_inner (closure, respp, args) - * ffi_closure *closure; - * void **respp; - * void *args; - */ -CSKY_FUNC_START ffi_closure_SYSV - .cfi_startproc - mov a2, sp - addi a1, sp, 16 - subi sp, sp, 24 - .cfi_def_cfa_offset 40 - stw a1, (sp, 0x10) - .cfi_offset 1, -24 - stw lr, (sp, 0x14) - .cfi_offset 15, -20 - stw sp, (sp, 0x8) - addi a1, sp, 8 - jsri ffi_closure_SYSV_inner - ldw a0, (sp, 0x0) - /* - * if FFI_TYPE_SINT64, need a1. - * if FFI_TYPE_INT, ignore a1. - */ - ldw a1, (sp, 0x4) - - ldw lr, (sp, 0x14) - addi sp, sp, 40 - rts - .cfi_endproc - .size ffi_closure_SYSV, .-ffi_closure_SYSV - -CSKY_FUNC_START ffi_csky_trampoline - subi sp, sp, 16 - stw a0, (sp, 0x0) - stw a1, (sp, 0x4) - stw a2, (sp, 0x8) - stw a3, (sp, 0xC) - lrw a0, [.Lctx] - lrw a1, [.Lfun] - jmp a1 -.Lctx: - mov a0, a0 - mov a0, a0 -.Lfun: - - .size ffi_csky_trampoline, .-ffi_csky_trampoline - -CSKY_FUNC_START ffi_csky_cacheflush - mov t0, r7 - movi r7, 123 - trap 0 - mov r7, t0 - rts - - .size ffi_csky_cacheflush, .-ffi_csky_cacheflush - -#else /* !__CSKYABIV2__ */ - - /* - * a0: fn - * a1: &ecif - * a2: cif->bytes - * a3: fig->flags - * a4: ecif.rvalue - */ -CSKY_FUNC_START ffi_call_SYSV - /* Save registers */ - .cfi_startproc - subi sp, 32 - subi sp, 8 - .cfi_def_cfa_offset 40 - stw a0, (sp, 0x0) - .cfi_offset 2, -40 - stw a1, (sp, 0x4) - .cfi_offset 3, -36 - stw a2, (sp, 0x8) - .cfi_offset 4, -32 - stw a3, (sp, 0xC) - .cfi_offset 5, -28 - stw a4, (sp, 0x10) - .cfi_offset 6, -24 - stw a5, (sp, 0x14) - .cfi_offset 7, -20 - stw l0, (sp, 0x18) - .cfi_offset 8, -16 - stw l1, (sp, 0x1C) - .cfi_offset 9, -12 - stw lr, (sp, 0x20) - .cfi_offset 15, -8 - - mov l0, sp - .cfi_def_cfa_register 8 - - /* Make room for all of the new args. */ - subu sp, sp, a2 - - /* Place all of the ffi_prep_args in position */ - mov a0, sp - /* a1 already set */ - - /* Call ffi_prep_args(stack, &ecif) */ - jsri ffi_prep_args - - /* move first 4 parameters in registers */ - ldw a0, (sp, 0x0) - ldw a1, (sp, 0x4) - ldw a2, (sp, 0x8) - ldw a3, (sp, 0xC) - ldw a4, (sp, 0x10) - ldw a5, (sp, 0x14) - - /* and adjust stack */ - mov lr, l0 - subu lr, sp /* cif->bytes == l0 - sp */ - movi l1, 24 - cmphs lr, l1 - movt lr, l1 - addu sp, sp, lr - - ldw l1, (l0, 0) /* load fn() in advance */ - - /* call (fn) (...) */ - jsr l1 - - /* Remove the space we pushed for the args */ - mov sp, l0 - - /* Load r2 with the pointer to storage for the return value */ - ldw a2, (sp, 0x10) - - /* Load r3 with the return type code */ - ldw a3, (sp, 0xC) - - /* If the return value pointer is NULL, assume no return value. */ - cmpnei a2, 0 - bf .Lepilogue - - cmpnei a3, FFI_TYPE_STRUCT - bf .Lepilogue - - /* return INT64 */ - cmpnei a3, FFI_TYPE_SINT64 - bt .Lretint - /* stw a0, (a2, 0x0) at .Lretint */ - stw a1, (a2, 0x4) - -.Lretint: - /* return INT */ - stw a0, (a2, 0x0) - -.Lepilogue: - ldw a0, (sp, 0x0) - ldw a1, (sp, 0x4) - ldw a2, (sp, 0x8) - ldw a3, (sp, 0xC) - ldw a4, (sp, 0x10) - ldw a5, (sp, 0x14) - ldw l0, (sp, 0x18) - ldw l1, (sp, 0x1C) - ldw lr, (sp, 0x20) - addi sp, sp, 32 - addi sp, sp, 8 - rts - .cfi_endproc - - .size ffi_call_SYSV, .-ffi_call_SYSV - - - /* - * unsigned int FFI_HIDDEN - * ffi_closure_SYSV_inner (closure, respp, args) - * ffi_closure *closure; - * void **respp; - * void *args; - */ -CSKY_FUNC_START ffi_closure_SYSV - .cfi_startproc - mov a2, sp - mov a1, sp - addi a1, 24 - subi sp, sp, 24 - .cfi_def_cfa_offset 48 - stw a1, (sp, 0x10) - .cfi_offset 3, -32 - stw lr, (sp, 0x14) - .cfi_offset 15, -28 - stw sp, (sp, 0x8) - mov a1, sp - addi a1, 8 - jsri ffi_closure_SYSV_inner - ldw a0, (sp, 0x0) - /* - * if FFI_TYPE_SINT64, need a1. - * if FFI_TYPE_INT, ignore a1. - */ - ldw a1, (sp, 0x4) - - ldw lr, (sp, 0x14) - addi sp, sp, 24 - addi sp, sp, 24 - rts - .cfi_endproc - - .size ffi_closure_SYSV, .-ffi_closure_SYSV - -CSKY_FUNC_START ffi_csky_trampoline - subi sp, 24 - stw a0, (sp, 0x0) - stw a1, (sp, 0x4) - stw a2, (sp, 0x8) - stw a3, (sp, 0xC) - stw a4, (sp, 0x10) - stw a5, (sp, 0x14) - lrw a0, [.Lctx] - lrw a1, [.Lfun] - jmp a1 -.Lctx: - mov a0, a0 - mov a0, a0 -.Lfun: - - .size ffi_csky_trampoline, .-ffi_csky_trampoline - -CSKY_FUNC_START ffi_csky_cacheflush - lrw r1, 123 - trap 0 - rts - - .size ffi_csky_cacheflush, .-ffi_csky_cacheflush - -#endif /* __CSKYABIV2__ */ diff --git a/deps/libffi/src/debug.c b/deps/libffi/src/debug.c deleted file mode 100644 index 63321dc013cc27..00000000000000 --- a/deps/libffi/src/debug.c +++ /dev/null @@ -1,64 +0,0 @@ -/* ----------------------------------------------------------------------- - debug.c - Copyright (c) 1996 Red Hat, Inc. - - 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. - ----------------------------------------------------------------------- */ - -#include -#include -#include -#include - -/* General debugging routines */ - -void ffi_stop_here(void) -{ - /* This function is only useful for debugging purposes. - Place a breakpoint on ffi_stop_here to be notified of - significant events. */ -} - -/* This function should only be called via the FFI_ASSERT() macro */ - -NORETURN void ffi_assert(const char *expr, const char *file, int line) -{ - fprintf(stderr, "ASSERTION FAILURE: %s at %s:%d\n", expr, file, line); - ffi_stop_here(); - abort(); -} - -/* Perform a sanity check on an ffi_type structure */ - -void ffi_type_test(ffi_type *a, const char *file, int line) -{ - FFI_ASSERT_AT(a != NULL, file, line); - - FFI_ASSERT_AT(a->type <= FFI_TYPE_LAST, file, line); - FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->size > 0, file, line); - FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->alignment > 0, file, line); - FFI_ASSERT_AT((a->type != FFI_TYPE_STRUCT && a->type != FFI_TYPE_COMPLEX) - || a->elements != NULL, file, line); - FFI_ASSERT_AT(a->type != FFI_TYPE_COMPLEX - || (a->elements != NULL - && a->elements[0] != NULL && a->elements[1] == NULL), - file, line); - -} diff --git a/deps/libffi/src/dlmalloc.c b/deps/libffi/src/dlmalloc.c deleted file mode 100644 index 17193a0db3bb45..00000000000000 --- a/deps/libffi/src/dlmalloc.c +++ /dev/null @@ -1,5172 +0,0 @@ -/* - This is a version (aka dlmalloc) of malloc/free/realloc written by - Doug Lea and released to the public domain, as explained at - http://creativecommons.org/licenses/publicdomain. Send questions, - comments, complaints, performance data, etc to dl@cs.oswego.edu - -* Version 2.8.3 Thu Sep 22 11:16:15 2005 Doug Lea (dl at gee) - - Note: There may be an updated version of this malloc obtainable at - ftp://gee.cs.oswego.edu/pub/misc/malloc.c - Check before installing! - -* Quickstart - - This library is all in one file to simplify the most common usage: - ftp it, compile it (-O3), and link it into another program. All of - the compile-time options default to reasonable values for use on - most platforms. You might later want to step through various - compile-time and dynamic tuning options. - - For convenience, an include file for code using this malloc is at: - ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h - You don't really need this .h file unless you call functions not - defined in your system include files. The .h file contains only the - excerpts from this file needed for using this malloc on ANSI C/C++ - systems, so long as you haven't changed compile-time options about - naming and tuning parameters. If you do, then you can create your - own malloc.h that does include all settings by cutting at the point - indicated below. Note that you may already by default be using a C - library containing a malloc that is based on some version of this - malloc (for example in linux). You might still want to use the one - in this file to customize settings or to avoid overheads associated - with library versions. - -* Vital statistics: - - Supported pointer/size_t representation: 4 or 8 bytes - size_t MUST be an unsigned type of the same width as - pointers. (If you are using an ancient system that declares - size_t as a signed type, or need it to be a different width - than pointers, you can use a previous release of this malloc - (e.g. 2.7.2) supporting these.) - - Alignment: 8 bytes (default) - This suffices for nearly all current machines and C compilers. - However, you can define MALLOC_ALIGNMENT to be wider than this - if necessary (up to 128bytes), at the expense of using more space. - - Minimum overhead per allocated chunk: 4 or 8 bytes (if 4byte sizes) - 8 or 16 bytes (if 8byte sizes) - Each malloced chunk has a hidden word of overhead holding size - and status information, and additional cross-check word - if FOOTERS is defined. - - Minimum allocated size: 4-byte ptrs: 16 bytes (including overhead) - 8-byte ptrs: 32 bytes (including overhead) - - Even a request for zero bytes (i.e., malloc(0)) returns a - pointer to something of the minimum allocatable size. - The maximum overhead wastage (i.e., number of extra bytes - allocated than were requested in malloc) is less than or equal - to the minimum size, except for requests >= mmap_threshold that - are serviced via mmap(), where the worst case wastage is about - 32 bytes plus the remainder from a system page (the minimal - mmap unit); typically 4096 or 8192 bytes. - - Security: static-safe; optionally more or less - The "security" of malloc refers to the ability of malicious - code to accentuate the effects of errors (for example, freeing - space that is not currently malloc'ed or overwriting past the - ends of chunks) in code that calls malloc. This malloc - guarantees not to modify any memory locations below the base of - heap, i.e., static variables, even in the presence of usage - errors. The routines additionally detect most improper frees - and reallocs. All this holds as long as the static bookkeeping - for malloc itself is not corrupted by some other means. This - is only one aspect of security -- these checks do not, and - cannot, detect all possible programming errors. - - If FOOTERS is defined nonzero, then each allocated chunk - carries an additional check word to verify that it was malloced - from its space. These check words are the same within each - execution of a program using malloc, but differ across - executions, so externally crafted fake chunks cannot be - freed. This improves security by rejecting frees/reallocs that - could corrupt heap memory, in addition to the checks preventing - writes to statics that are always on. This may further improve - security at the expense of time and space overhead. (Note that - FOOTERS may also be worth using with MSPACES.) - - By default detected errors cause the program to abort (calling - "abort()"). You can override this to instead proceed past - errors by defining PROCEED_ON_ERROR. In this case, a bad free - has no effect, and a malloc that encounters a bad address - caused by user overwrites will ignore the bad address by - dropping pointers and indices to all known memory. This may - be appropriate for programs that should continue if at all - possible in the face of programming errors, although they may - run out of memory because dropped memory is never reclaimed. - - If you don't like either of these options, you can define - CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything - else. And if if you are sure that your program using malloc has - no errors or vulnerabilities, you can define INSECURE to 1, - which might (or might not) provide a small performance improvement. - - Thread-safety: NOT thread-safe unless USE_LOCKS defined - When USE_LOCKS is defined, each public call to malloc, free, - etc is surrounded with either a pthread mutex or a win32 - spinlock (depending on WIN32). This is not especially fast, and - can be a major bottleneck. It is designed only to provide - minimal protection in concurrent environments, and to provide a - basis for extensions. If you are using malloc in a concurrent - program, consider instead using ptmalloc, which is derived from - a version of this malloc. (See http://www.malloc.de). - - System requirements: Any combination of MORECORE and/or MMAP/MUNMAP - This malloc can use unix sbrk or any emulation (invoked using - the CALL_MORECORE macro) and/or mmap/munmap or any emulation - (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system - memory. On most unix systems, it tends to work best if both - MORECORE and MMAP are enabled. On Win32, it uses emulations - based on VirtualAlloc. It also uses common C library functions - like memset. - - Compliance: I believe it is compliant with the Single Unix Specification - (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably - others as well. - -* Overview of algorithms - - This is not the fastest, most space-conserving, most portable, or - most tunable malloc ever written. However it is among the fastest - while also being among the most space-conserving, portable and - tunable. Consistent balance across these factors results in a good - general-purpose allocator for malloc-intensive programs. - - In most ways, this malloc is a best-fit allocator. Generally, it - chooses the best-fitting existing chunk for a request, with ties - broken in approximately least-recently-used order. (This strategy - normally maintains low fragmentation.) However, for requests less - than 256bytes, it deviates from best-fit when there is not an - exactly fitting available chunk by preferring to use space adjacent - to that used for the previous small request, as well as by breaking - ties in approximately most-recently-used order. (These enhance - locality of series of small allocations.) And for very large requests - (>= 256Kb by default), it relies on system memory mapping - facilities, if supported. (This helps avoid carrying around and - possibly fragmenting memory used only for large chunks.) - - All operations (except malloc_stats and mallinfo) have execution - times that are bounded by a constant factor of the number of bits in - a size_t, not counting any clearing in calloc or copying in realloc, - or actions surrounding MORECORE and MMAP that have times - proportional to the number of non-contiguous regions returned by - system allocation routines, which is often just 1. - - The implementation is not very modular and seriously overuses - macros. Perhaps someday all C compilers will do as good a job - inlining modular code as can now be done by brute-force expansion, - but now, enough of them seem not to. - - Some compilers issue a lot of warnings about code that is - dead/unreachable only on some platforms, and also about intentional - uses of negation on unsigned types. All known cases of each can be - ignored. - - For a longer but out of date high-level description, see - http://gee.cs.oswego.edu/dl/html/malloc.html - -* MSPACES - If MSPACES is defined, then in addition to malloc, free, etc., - this file also defines mspace_malloc, mspace_free, etc. These - are versions of malloc routines that take an "mspace" argument - obtained using create_mspace, to control all internal bookkeeping. - If ONLY_MSPACES is defined, only these versions are compiled. - So if you would like to use this allocator for only some allocations, - and your system malloc for others, you can compile with - ONLY_MSPACES and then do something like... - static mspace mymspace = create_mspace(0,0); // for example - #define mymalloc(bytes) mspace_malloc(mymspace, bytes) - - (Note: If you only need one instance of an mspace, you can instead - use "USE_DL_PREFIX" to relabel the global malloc.) - - You can similarly create thread-local allocators by storing - mspaces as thread-locals. For example: - static __thread mspace tlms = 0; - void* tlmalloc(size_t bytes) { - if (tlms == 0) tlms = create_mspace(0, 0); - return mspace_malloc(tlms, bytes); - } - void tlfree(void* mem) { mspace_free(tlms, mem); } - - Unless FOOTERS is defined, each mspace is completely independent. - You cannot allocate from one and free to another (although - conformance is only weakly checked, so usage errors are not always - caught). If FOOTERS is defined, then each chunk carries around a tag - indicating its originating mspace, and frees are directed to their - originating spaces. - - ------------------------- Compile-time options --------------------------- - -Be careful in setting #define values for numerical constants of type -size_t. On some systems, literal values are not automatically extended -to size_t precision unless they are explicitly casted. - -WIN32 default: defined if _WIN32 defined - Defining WIN32 sets up defaults for MS environment and compilers. - Otherwise defaults are for unix. - -MALLOC_ALIGNMENT default: (size_t)8 - Controls the minimum alignment for malloc'ed chunks. It must be a - power of two and at least 8, even on machines for which smaller - alignments would suffice. It may be defined as larger than this - though. Note however that code and data structures are optimized for - the case of 8-byte alignment. - -MSPACES default: 0 (false) - If true, compile in support for independent allocation spaces. - This is only supported if HAVE_MMAP is true. - -ONLY_MSPACES default: 0 (false) - If true, only compile in mspace versions, not regular versions. - -USE_LOCKS default: 0 (false) - Causes each call to each public routine to be surrounded with - pthread or WIN32 mutex lock/unlock. (If set true, this can be - overridden on a per-mspace basis for mspace versions.) - -FOOTERS default: 0 - If true, provide extra checking and dispatching by placing - information in the footers of allocated chunks. This adds - space and time overhead. - -INSECURE default: 0 - If true, omit checks for usage errors and heap space overwrites. - -USE_DL_PREFIX default: NOT defined - Causes compiler to prefix all public routines with the string 'dl'. - This can be useful when you only want to use this malloc in one part - of a program, using your regular system malloc elsewhere. - -ABORT default: defined as abort() - Defines how to abort on failed checks. On most systems, a failed - check cannot die with an "assert" or even print an informative - message, because the underlying print routines in turn call malloc, - which will fail again. Generally, the best policy is to simply call - abort(). It's not very useful to do more than this because many - errors due to overwriting will show up as address faults (null, odd - addresses etc) rather than malloc-triggered checks, so will also - abort. Also, most compilers know that abort() does not return, so - can better optimize code conditionally calling it. - -PROCEED_ON_ERROR default: defined as 0 (false) - Controls whether detected bad addresses cause them to bypassed - rather than aborting. If set, detected bad arguments to free and - realloc are ignored. And all bookkeeping information is zeroed out - upon a detected overwrite of freed heap space, thus losing the - ability to ever return it from malloc again, but enabling the - application to proceed. If PROCEED_ON_ERROR is defined, the - static variable malloc_corruption_error_count is compiled in - and can be examined to see if errors have occurred. This option - generates slower code than the default abort policy. - -DEBUG default: NOT defined - The DEBUG setting is mainly intended for people trying to modify - this code or diagnose problems when porting to new platforms. - However, it may also be able to better isolate user errors than just - using runtime checks. The assertions in the check routines spell - out in more detail the assumptions and invariants underlying the - algorithms. The checking is fairly extensive, and will slow down - execution noticeably. Calling malloc_stats or mallinfo with DEBUG - set will attempt to check every non-mmapped allocated and free chunk - in the course of computing the summaries. - -ABORT_ON_ASSERT_FAILURE default: defined as 1 (true) - Debugging assertion failures can be nearly impossible if your - version of the assert macro causes malloc to be called, which will - lead to a cascade of further failures, blowing the runtime stack. - ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(), - which will usually make debugging easier. - -MALLOC_FAILURE_ACTION default: sets errno to ENOMEM, or no-op on win32 - The action to take before "return 0" when malloc fails to be able to - return memory because there is none available. - -HAVE_MORECORE default: 1 (true) unless win32 or ONLY_MSPACES - True if this system supports sbrk or an emulation of it. - -MORECORE default: sbrk - The name of the sbrk-style system routine to call to obtain more - memory. See below for guidance on writing custom MORECORE - functions. The type of the argument to sbrk/MORECORE varies across - systems. It cannot be size_t, because it supports negative - arguments, so it is normally the signed type of the same width as - size_t (sometimes declared as "intptr_t"). It doesn't much matter - though. Internally, we only call it with arguments less than half - the max value of a size_t, which should work across all reasonable - possibilities, although sometimes generating compiler warnings. See - near the end of this file for guidelines for creating a custom - version of MORECORE. - -MORECORE_CONTIGUOUS default: 1 (true) - If true, take advantage of fact that consecutive calls to MORECORE - with positive arguments always return contiguous increasing - addresses. This is true of unix sbrk. It does not hurt too much to - set it true anyway, since malloc copes with non-contiguities. - Setting it false when definitely non-contiguous saves time - and possibly wasted space it would take to discover this though. - -MORECORE_CANNOT_TRIM default: NOT defined - True if MORECORE cannot release space back to the system when given - negative arguments. This is generally necessary only if you are - using a hand-crafted MORECORE function that cannot handle negative - arguments. - -HAVE_MMAP default: 1 (true) - True if this system supports mmap or an emulation of it. If so, and - HAVE_MORECORE is not true, MMAP is used for all system - allocation. If set and HAVE_MORECORE is true as well, MMAP is - primarily used to directly allocate very large blocks. It is also - used as a backup strategy in cases where MORECORE fails to provide - space from system. Note: A single call to MUNMAP is assumed to be - able to unmap memory that may have be allocated using multiple calls - to MMAP, so long as they are adjacent. - -HAVE_MREMAP default: 1 on linux, else 0 - If true realloc() uses mremap() to re-allocate large blocks and - extend or shrink allocation spaces. - -MMAP_CLEARS default: 1 on unix - True if mmap clears memory so calloc doesn't need to. This is true - for standard unix mmap using /dev/zero. - -USE_BUILTIN_FFS default: 0 (i.e., not used) - Causes malloc to use the builtin ffs() function to compute indices. - Some compilers may recognize and intrinsify ffs to be faster than the - supplied C version. Also, the case of x86 using gcc is special-cased - to an asm instruction, so is already as fast as it can be, and so - this setting has no effect. (On most x86s, the asm version is only - slightly faster than the C version.) - -malloc_getpagesize default: derive from system includes, or 4096. - The system page size. To the extent possible, this malloc manages - memory from the system in page-size units. This may be (and - usually is) a function rather than a constant. This is ignored - if WIN32, where page size is determined using getSystemInfo during - initialization. - -USE_DEV_RANDOM default: 0 (i.e., not used) - Causes malloc to use /dev/random to initialize secure magic seed for - stamping footers. Otherwise, the current time is used. - -NO_MALLINFO default: 0 - If defined, don't compile "mallinfo". This can be a simple way - of dealing with mismatches between system declarations and - those in this file. - -MALLINFO_FIELD_TYPE default: size_t - The type of the fields in the mallinfo struct. This was originally - defined as "int" in SVID etc, but is more usefully defined as - size_t. The value is used only if HAVE_USR_INCLUDE_MALLOC_H is not set - -REALLOC_ZERO_BYTES_FREES default: not defined - This should be set if a call to realloc with zero bytes should - be the same as a call to free. Some people think it should. Otherwise, - since this malloc returns a unique pointer for malloc(0), so does - realloc(p, 0). - -LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H -LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H, LACKS_ERRNO_H -LACKS_STDLIB_H default: NOT defined unless on WIN32 - Define these if your system does not have these header files. - You might need to manually insert some of the declarations they provide. - -DEFAULT_GRANULARITY default: page size if MORECORE_CONTIGUOUS, - system_info.dwAllocationGranularity in WIN32, - otherwise 64K. - Also settable using mallopt(M_GRANULARITY, x) - The unit for allocating and deallocating memory from the system. On - most systems with contiguous MORECORE, there is no reason to - make this more than a page. However, systems with MMAP tend to - either require or encourage larger granularities. You can increase - this value to prevent system allocation functions to be called so - often, especially if they are slow. The value must be at least one - page and must be a power of two. Setting to 0 causes initialization - to either page size or win32 region size. (Note: In previous - versions of malloc, the equivalent of this option was called - "TOP_PAD") - -DEFAULT_TRIM_THRESHOLD default: 2MB - Also settable using mallopt(M_TRIM_THRESHOLD, x) - The maximum amount of unused top-most memory to keep before - releasing via malloc_trim in free(). Automatic trimming is mainly - useful in long-lived programs using contiguous MORECORE. Because - trimming via sbrk can be slow on some systems, and can sometimes be - wasteful (in cases where programs immediately afterward allocate - more large chunks) the value should be high enough so that your - overall system performance would improve by releasing this much - memory. As a rough guide, you might set to a value close to the - average size of a process (program) running on your system. - Releasing this much memory would allow such a process to run in - memory. Generally, it is worth tuning trim thresholds when a - program undergoes phases where several large chunks are allocated - and released in ways that can reuse each other's storage, perhaps - mixed with phases where there are no such chunks at all. The trim - value must be greater than page size to have any useful effect. To - disable trimming completely, you can set to MAX_SIZE_T. Note that the trick - some people use of mallocing a huge space and then freeing it at - program startup, in an attempt to reserve system memory, doesn't - have the intended effect under automatic trimming, since that memory - will immediately be returned to the system. - -DEFAULT_MMAP_THRESHOLD default: 256K - Also settable using mallopt(M_MMAP_THRESHOLD, x) - The request size threshold for using MMAP to directly service a - request. Requests of at least this size that cannot be allocated - using already-existing space will be serviced via mmap. (If enough - normal freed space already exists it is used instead.) Using mmap - segregates relatively large chunks of memory so that they can be - individually obtained and released from the host system. A request - serviced through mmap is never reused by any other request (at least - not directly; the system may just so happen to remap successive - requests to the same locations). Segregating space in this way has - the benefits that: Mmapped space can always be individually released - back to the system, which helps keep the system level memory demands - of a long-lived program low. Also, mapped memory doesn't become - `locked' between other chunks, as can happen with normally allocated - chunks, which means that even trimming via malloc_trim would not - release them. However, it has the disadvantage that the space - cannot be reclaimed, consolidated, and then used to service later - requests, as happens with normal chunks. The advantages of mmap - nearly always outweigh disadvantages for "large" chunks, but the - value of "large" may vary across systems. The default is an - empirically derived value that works well in most systems. You can - disable mmap by setting to MAX_SIZE_T. - -*/ - -#if defined __linux__ && !defined _GNU_SOURCE -/* mremap() on Linux requires this via sys/mman.h */ -#define _GNU_SOURCE 1 -#endif - -#ifndef WIN32 -#ifdef _WIN32 -#define WIN32 1 -#endif /* _WIN32 */ -#endif /* WIN32 */ -#ifdef WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#define HAVE_MMAP 1 -#define HAVE_MORECORE 0 -#define LACKS_UNISTD_H -#define LACKS_SYS_PARAM_H -#define LACKS_SYS_MMAN_H -#define LACKS_STRING_H -#define LACKS_STRINGS_H -#define LACKS_SYS_TYPES_H -#define LACKS_ERRNO_H -#define MALLOC_FAILURE_ACTION -#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ -#endif /* WIN32 */ - -#ifdef __OS2__ -#define INCL_DOS -#include -#define HAVE_MMAP 1 -#define HAVE_MORECORE 0 -#define LACKS_SYS_MMAN_H -#endif /* __OS2__ */ - -#if defined(DARWIN) || defined(_DARWIN) -/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */ -#ifndef HAVE_MORECORE -#define HAVE_MORECORE 0 -#define HAVE_MMAP 1 -#endif /* HAVE_MORECORE */ -#endif /* DARWIN */ - -#ifndef LACKS_SYS_TYPES_H -#include /* For size_t */ -#endif /* LACKS_SYS_TYPES_H */ - -/* The maximum possible size_t value has all bits set */ -#define MAX_SIZE_T (~(size_t)0) - -#ifndef ONLY_MSPACES -#define ONLY_MSPACES 0 -#endif /* ONLY_MSPACES */ -#ifndef MSPACES -#if ONLY_MSPACES -#define MSPACES 1 -#else /* ONLY_MSPACES */ -#define MSPACES 0 -#endif /* ONLY_MSPACES */ -#endif /* MSPACES */ -#ifndef MALLOC_ALIGNMENT -#define MALLOC_ALIGNMENT ((size_t)8U) -#endif /* MALLOC_ALIGNMENT */ -#ifndef FOOTERS -#define FOOTERS 0 -#endif /* FOOTERS */ -#ifndef ABORT -#define ABORT abort() -#endif /* ABORT */ -#ifndef ABORT_ON_ASSERT_FAILURE -#define ABORT_ON_ASSERT_FAILURE 1 -#endif /* ABORT_ON_ASSERT_FAILURE */ -#ifndef PROCEED_ON_ERROR -#define PROCEED_ON_ERROR 0 -#endif /* PROCEED_ON_ERROR */ -#ifndef USE_LOCKS -#define USE_LOCKS 0 -#endif /* USE_LOCKS */ -#ifndef INSECURE -#define INSECURE 0 -#endif /* INSECURE */ -#ifndef HAVE_MMAP -#define HAVE_MMAP 1 -#endif /* HAVE_MMAP */ -#ifndef MMAP_CLEARS -#define MMAP_CLEARS 1 -#endif /* MMAP_CLEARS */ -#ifndef HAVE_MREMAP -#ifdef linux -#define HAVE_MREMAP 1 -#else /* linux */ -#define HAVE_MREMAP 0 -#endif /* linux */ -#endif /* HAVE_MREMAP */ -#ifndef MALLOC_FAILURE_ACTION -#define MALLOC_FAILURE_ACTION errno = ENOMEM; -#endif /* MALLOC_FAILURE_ACTION */ -#ifndef HAVE_MORECORE -#if ONLY_MSPACES -#define HAVE_MORECORE 0 -#else /* ONLY_MSPACES */ -#define HAVE_MORECORE 1 -#endif /* ONLY_MSPACES */ -#endif /* HAVE_MORECORE */ -#if !HAVE_MORECORE -#define MORECORE_CONTIGUOUS 0 -#else /* !HAVE_MORECORE */ -#ifndef MORECORE -#define MORECORE sbrk -#endif /* MORECORE */ -#ifndef MORECORE_CONTIGUOUS -#define MORECORE_CONTIGUOUS 1 -#endif /* MORECORE_CONTIGUOUS */ -#endif /* HAVE_MORECORE */ -#ifndef DEFAULT_GRANULARITY -#if MORECORE_CONTIGUOUS -#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ -#else /* MORECORE_CONTIGUOUS */ -#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U) -#endif /* MORECORE_CONTIGUOUS */ -#endif /* DEFAULT_GRANULARITY */ -#ifndef DEFAULT_TRIM_THRESHOLD -#ifndef MORECORE_CANNOT_TRIM -#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) -#else /* MORECORE_CANNOT_TRIM */ -#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T -#endif /* MORECORE_CANNOT_TRIM */ -#endif /* DEFAULT_TRIM_THRESHOLD */ -#ifndef DEFAULT_MMAP_THRESHOLD -#if HAVE_MMAP -#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) -#else /* HAVE_MMAP */ -#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T -#endif /* HAVE_MMAP */ -#endif /* DEFAULT_MMAP_THRESHOLD */ -#ifndef USE_BUILTIN_FFS -#define USE_BUILTIN_FFS 0 -#endif /* USE_BUILTIN_FFS */ -#ifndef USE_DEV_RANDOM -#define USE_DEV_RANDOM 0 -#endif /* USE_DEV_RANDOM */ -#ifndef NO_MALLINFO -#define NO_MALLINFO 0 -#endif /* NO_MALLINFO */ -#ifndef MALLINFO_FIELD_TYPE -#define MALLINFO_FIELD_TYPE size_t -#endif /* MALLINFO_FIELD_TYPE */ - -/* - mallopt tuning options. SVID/XPG defines four standard parameter - numbers for mallopt, normally defined in malloc.h. None of these - are used in this malloc, so setting them has no effect. But this - malloc does support the following options. -*/ - -/* The system's malloc.h may have conflicting defines. */ -#undef M_TRIM_THRESHOLD -#undef M_GRANULARITY -#undef M_MMAP_THRESHOLD - -#define M_TRIM_THRESHOLD (-1) -#define M_GRANULARITY (-2) -#define M_MMAP_THRESHOLD (-3) - -/* ------------------------ Mallinfo declarations ------------------------ */ - -#if !NO_MALLINFO -/* - This version of malloc supports the standard SVID/XPG mallinfo - routine that returns a struct containing usage properties and - statistics. It should work on any system that has a - /usr/include/malloc.h defining struct mallinfo. The main - declaration needed is the mallinfo struct that is returned (by-copy) - by mallinfo(). The malloinfo struct contains a bunch of fields that - are not even meaningful in this version of malloc. These fields are - are instead filled by mallinfo() with other numbers that might be of - interest. - - HAVE_USR_INCLUDE_MALLOC_H should be set if you have a - /usr/include/malloc.h file that includes a declaration of struct - mallinfo. If so, it is included; else a compliant version is - declared below. These must be precisely the same for mallinfo() to - work. The original SVID version of this struct, defined on most - systems with mallinfo, declares all fields as ints. But some others - define as unsigned long. If your system defines the fields using a - type of different width than listed here, you MUST #include your - system version and #define HAVE_USR_INCLUDE_MALLOC_H. -*/ - -/* #define HAVE_USR_INCLUDE_MALLOC_H */ - -#ifdef HAVE_USR_INCLUDE_MALLOC_H -#include "/usr/include/malloc.h" -#else /* HAVE_USR_INCLUDE_MALLOC_H */ - -/* HP-UX's stdlib.h redefines mallinfo unless _STRUCT_MALLINFO is defined */ -#define _STRUCT_MALLINFO - -struct mallinfo { - MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ - MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ - MALLINFO_FIELD_TYPE smblks; /* always 0 */ - MALLINFO_FIELD_TYPE hblks; /* always 0 */ - MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ - MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ - MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ - MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ - MALLINFO_FIELD_TYPE fordblks; /* total free space */ - MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ -}; - -#endif /* HAVE_USR_INCLUDE_MALLOC_H */ -#endif /* NO_MALLINFO */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#if !ONLY_MSPACES - -/* ------------------- Declarations of public routines ------------------- */ - -#ifndef USE_DL_PREFIX -#define dlcalloc calloc -#define dlfree free -#define dlmalloc malloc -#define dlmemalign memalign -#define dlrealloc realloc -#define dlvalloc valloc -#define dlpvalloc pvalloc -#define dlmallinfo mallinfo -#define dlmallopt mallopt -#define dlmalloc_trim malloc_trim -#define dlmalloc_stats malloc_stats -#define dlmalloc_usable_size malloc_usable_size -#define dlmalloc_footprint malloc_footprint -#define dlmalloc_max_footprint malloc_max_footprint -#define dlindependent_calloc independent_calloc -#define dlindependent_comalloc independent_comalloc -#endif /* USE_DL_PREFIX */ - - -/* - malloc(size_t n) - Returns a pointer to a newly allocated chunk of at least n bytes, or - null if no space is available, in which case errno is set to ENOMEM - on ANSI C systems. - - If n is zero, malloc returns a minimum-sized chunk. (The minimum - size is 16 bytes on most 32bit systems, and 32 bytes on 64bit - systems.) Note that size_t is an unsigned type, so calls with - arguments that would be negative if signed are interpreted as - requests for huge amounts of space, which will often fail. The - maximum supported value of n differs across systems, but is in all - cases less than the maximum representable value of a size_t. -*/ -void* dlmalloc(size_t); - -/* - free(void* p) - Releases the chunk of memory pointed to by p, that had been previously - allocated using malloc or a related routine such as realloc. - It has no effect if p is null. If p was not malloced or already - freed, free(p) will by default cause the current program to abort. -*/ -void dlfree(void*); - -/* - calloc(size_t n_elements, size_t element_size); - Returns a pointer to n_elements * element_size bytes, with all locations - set to zero. -*/ -void* dlcalloc(size_t, size_t); - -/* - realloc(void* p, size_t n) - Returns a pointer to a chunk of size n that contains the same data - as does chunk p up to the minimum of (n, p's size) bytes, or null - if no space is available. - - The returned pointer may or may not be the same as p. The algorithm - prefers extending p in most cases when possible, otherwise it - employs the equivalent of a malloc-copy-free sequence. - - If p is null, realloc is equivalent to malloc. - - If space is not available, realloc returns null, errno is set (if on - ANSI) and p is NOT freed. - - if n is for fewer bytes than already held by p, the newly unused - space is lopped off and freed if possible. realloc with a size - argument of zero (re)allocates a minimum-sized chunk. - - The old unix realloc convention of allowing the last-free'd chunk - to be used as an argument to realloc is not supported. -*/ - -void* dlrealloc(void*, size_t); - -/* - memalign(size_t alignment, size_t n); - Returns a pointer to a newly allocated chunk of n bytes, aligned - in accord with the alignment argument. - - The alignment argument should be a power of two. If the argument is - not a power of two, the nearest greater power is used. - 8-byte alignment is guaranteed by normal malloc calls, so don't - bother calling memalign with an argument of 8 or less. - - Overreliance on memalign is a sure way to fragment space. -*/ -void* dlmemalign(size_t, size_t); - -/* - valloc(size_t n); - Equivalent to memalign(pagesize, n), where pagesize is the page - size of the system. If the pagesize is unknown, 4096 is used. -*/ -void* dlvalloc(size_t); - -/* - mallopt(int parameter_number, int parameter_value) - Sets tunable parameters The format is to provide a - (parameter-number, parameter-value) pair. mallopt then sets the - corresponding parameter to the argument value if it can (i.e., so - long as the value is meaningful), and returns 1 if successful else - 0. SVID/XPG/ANSI defines four standard param numbers for mallopt, - normally defined in malloc.h. None of these are use in this malloc, - so setting them has no effect. But this malloc also supports other - options in mallopt. See below for details. Briefly, supported - parameters are as follows (listed defaults are for "typical" - configurations). - - Symbol param # default allowed param values - M_TRIM_THRESHOLD -1 2*1024*1024 any (MAX_SIZE_T disables) - M_GRANULARITY -2 page size any power of 2 >= page size - M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support) -*/ -int dlmallopt(int, int); - -/* - malloc_footprint(); - Returns the number of bytes obtained from the system. The total - number of bytes allocated by malloc, realloc etc., is less than this - value. Unlike mallinfo, this function returns only a precomputed - result, so can be called frequently to monitor memory consumption. - Even if locks are otherwise defined, this function does not use them, - so results might not be up to date. -*/ -size_t dlmalloc_footprint(void); - -/* - malloc_max_footprint(); - Returns the maximum number of bytes obtained from the system. This - value will be greater than current footprint if deallocated space - has been reclaimed by the system. The peak number of bytes allocated - by malloc, realloc etc., is less than this value. Unlike mallinfo, - this function returns only a precomputed result, so can be called - frequently to monitor memory consumption. Even if locks are - otherwise defined, this function does not use them, so results might - not be up to date. -*/ -size_t dlmalloc_max_footprint(void); - -#if !NO_MALLINFO -/* - mallinfo() - Returns (by copy) a struct containing various summary statistics: - - arena: current total non-mmapped bytes allocated from system - ordblks: the number of free chunks - smblks: always zero. - hblks: current number of mmapped regions - hblkhd: total bytes held in mmapped regions - usmblks: the maximum total allocated space. This will be greater - than current total if trimming has occurred. - fsmblks: always zero - uordblks: current total allocated space (normal or mmapped) - fordblks: total free space - keepcost: the maximum number of bytes that could ideally be released - back to system via malloc_trim. ("ideally" means that - it ignores page restrictions etc.) - - Because these fields are ints, but internal bookkeeping may - be kept as longs, the reported values may wrap around zero and - thus be inaccurate. -*/ -struct mallinfo dlmallinfo(void); -#endif /* NO_MALLINFO */ - -/* - independent_calloc(size_t n_elements, size_t element_size, void* chunks[]); - - independent_calloc is similar to calloc, but instead of returning a - single cleared space, it returns an array of pointers to n_elements - independent elements that can hold contents of size elem_size, each - of which starts out cleared, and can be independently freed, - realloc'ed etc. The elements are guaranteed to be adjacently - allocated (this is not guaranteed to occur with multiple callocs or - mallocs), which may also improve cache locality in some - applications. - - The "chunks" argument is optional (i.e., may be null, which is - probably the most typical usage). If it is null, the returned array - is itself dynamically allocated and should also be freed when it is - no longer needed. Otherwise, the chunks array must be of at least - n_elements in length. It is filled in with the pointers to the - chunks. - - In either case, independent_calloc returns this pointer array, or - null if the allocation failed. If n_elements is zero and "chunks" - is null, it returns a chunk representing an array with zero elements - (which should be freed if not wanted). - - Each element must be individually freed when it is no longer - needed. If you'd like to instead be able to free all at once, you - should instead use regular calloc and assign pointers into this - space to represent elements. (In this case though, you cannot - independently free elements.) - - independent_calloc simplifies and speeds up implementations of many - kinds of pools. It may also be useful when constructing large data - structures that initially have a fixed number of fixed-sized nodes, - but the number is not known at compile time, and some of the nodes - may later need to be freed. For example: - - struct Node { int item; struct Node* next; }; - - struct Node* build_list() { - struct Node** pool; - int n = read_number_of_nodes_needed(); - if (n <= 0) return 0; - pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0); - if (pool == 0) die(); - // organize into a linked list... - struct Node* first = pool[0]; - for (i = 0; i < n-1; ++i) - pool[i]->next = pool[i+1]; - free(pool); // Can now free the array (or not, if it is needed later) - return first; - } -*/ -void** dlindependent_calloc(size_t, size_t, void**); - -/* - independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]); - - independent_comalloc allocates, all at once, a set of n_elements - chunks with sizes indicated in the "sizes" array. It returns - an array of pointers to these elements, each of which can be - independently freed, realloc'ed etc. The elements are guaranteed to - be adjacently allocated (this is not guaranteed to occur with - multiple callocs or mallocs), which may also improve cache locality - in some applications. - - The "chunks" argument is optional (i.e., may be null). If it is null - the returned array is itself dynamically allocated and should also - be freed when it is no longer needed. Otherwise, the chunks array - must be of at least n_elements in length. It is filled in with the - pointers to the chunks. - - In either case, independent_comalloc returns this pointer array, or - null if the allocation failed. If n_elements is zero and chunks is - null, it returns a chunk representing an array with zero elements - (which should be freed if not wanted). - - Each element must be individually freed when it is no longer - needed. If you'd like to instead be able to free all at once, you - should instead use a single regular malloc, and assign pointers at - particular offsets in the aggregate space. (In this case though, you - cannot independently free elements.) - - independent_comallac differs from independent_calloc in that each - element may have a different size, and also that it does not - automatically clear elements. - - independent_comalloc can be used to speed up allocation in cases - where several structs or objects must always be allocated at the - same time. For example: - - struct Head { ... } - struct Foot { ... } - - void send_message(char* msg) { - int msglen = strlen(msg); - size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) }; - void* chunks[3]; - if (independent_comalloc(3, sizes, chunks) == 0) - die(); - struct Head* head = (struct Head*)(chunks[0]); - char* body = (char*)(chunks[1]); - struct Foot* foot = (struct Foot*)(chunks[2]); - // ... - } - - In general though, independent_comalloc is worth using only for - larger values of n_elements. For small values, you probably won't - detect enough difference from series of malloc calls to bother. - - Overuse of independent_comalloc can increase overall memory usage, - since it cannot reuse existing noncontiguous small chunks that - might be available for some of the elements. -*/ -void** dlindependent_comalloc(size_t, size_t*, void**); - - -/* - pvalloc(size_t n); - Equivalent to valloc(minimum-page-that-holds(n)), that is, - round up n to nearest pagesize. - */ -void* dlpvalloc(size_t); - -/* - malloc_trim(size_t pad); - - If possible, gives memory back to the system (via negative arguments - to sbrk) if there is unused memory at the `high' end of the malloc - pool or in unused MMAP segments. You can call this after freeing - large blocks of memory to potentially reduce the system-level memory - requirements of a program. However, it cannot guarantee to reduce - memory. Under some allocation patterns, some large free blocks of - memory will be locked between two used chunks, so they cannot be - given back to the system. - - The `pad' argument to malloc_trim represents the amount of free - trailing space to leave untrimmed. If this argument is zero, only - the minimum amount of memory to maintain internal data structures - will be left. Non-zero arguments can be supplied to maintain enough - trailing space to service future expected allocations without having - to re-obtain memory from the system. - - Malloc_trim returns 1 if it actually released any memory, else 0. -*/ -int dlmalloc_trim(size_t); - -/* - malloc_usable_size(void* p); - - Returns the number of bytes you can actually use in - an allocated chunk, which may be more than you requested (although - often not) due to alignment and minimum size constraints. - You can use this many bytes without worrying about - overwriting other allocated objects. This is not a particularly great - programming practice. malloc_usable_size can be more useful in - debugging and assertions, for example: - - p = malloc(n); - assert(malloc_usable_size(p) >= 256); -*/ -size_t dlmalloc_usable_size(void*); - -/* - malloc_stats(); - Prints on stderr the amount of space obtained from the system (both - via sbrk and mmap), the maximum amount (which may be more than - current if malloc_trim and/or munmap got called), and the current - number of bytes allocated via malloc (or realloc, etc) but not yet - freed. Note that this is the number of bytes allocated, not the - number requested. It will be larger than the number requested - because of alignment and bookkeeping overhead. Because it includes - alignment wastage as being in use, this figure may be greater than - zero even when no user-level chunks are allocated. - - The reported current and maximum system memory can be inaccurate if - a program makes other calls to system memory allocation functions - (normally sbrk) outside of malloc. - - malloc_stats prints only the most commonly interesting statistics. - More information can be obtained by calling mallinfo. -*/ -void dlmalloc_stats(void); - -#endif /* ONLY_MSPACES */ - -#if MSPACES - -/* - mspace is an opaque type representing an independent - region of space that supports mspace_malloc, etc. -*/ -typedef void* mspace; - -/* - create_mspace creates and returns a new independent space with the - given initial capacity, or, if 0, the default granularity size. It - returns null if there is no system memory available to create the - space. If argument locked is non-zero, the space uses a separate - lock to control access. The capacity of the space will grow - dynamically as needed to service mspace_malloc requests. You can - control the sizes of incremental increases of this space by - compiling with a different DEFAULT_GRANULARITY or dynamically - setting with mallopt(M_GRANULARITY, value). -*/ -mspace create_mspace(size_t capacity, int locked); - -/* - destroy_mspace destroys the given space, and attempts to return all - of its memory back to the system, returning the total number of - bytes freed. After destruction, the results of access to all memory - used by the space become undefined. -*/ -size_t destroy_mspace(mspace msp); - -/* - create_mspace_with_base uses the memory supplied as the initial base - of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this - space is used for bookkeeping, so the capacity must be at least this - large. (Otherwise 0 is returned.) When this initial space is - exhausted, additional memory will be obtained from the system. - Destroying this space will deallocate all additionally allocated - space (if possible) but not the initial base. -*/ -mspace create_mspace_with_base(void* base, size_t capacity, int locked); - -/* - mspace_malloc behaves as malloc, but operates within - the given space. -*/ -void* mspace_malloc(mspace msp, size_t bytes); - -/* - mspace_free behaves as free, but operates within - the given space. - - If compiled with FOOTERS==1, mspace_free is not actually needed. - free may be called instead of mspace_free because freed chunks from - any space are handled by their originating spaces. -*/ -void mspace_free(mspace msp, void* mem); - -/* - mspace_realloc behaves as realloc, but operates within - the given space. - - If compiled with FOOTERS==1, mspace_realloc is not actually - needed. realloc may be called instead of mspace_realloc because - realloced chunks from any space are handled by their originating - spaces. -*/ -void* mspace_realloc(mspace msp, void* mem, size_t newsize); - -/* - mspace_calloc behaves as calloc, but operates within - the given space. -*/ -void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size); - -/* - mspace_memalign behaves as memalign, but operates within - the given space. -*/ -void* mspace_memalign(mspace msp, size_t alignment, size_t bytes); - -/* - mspace_independent_calloc behaves as independent_calloc, but - operates within the given space. -*/ -void** mspace_independent_calloc(mspace msp, size_t n_elements, - size_t elem_size, void* chunks[]); - -/* - mspace_independent_comalloc behaves as independent_comalloc, but - operates within the given space. -*/ -void** mspace_independent_comalloc(mspace msp, size_t n_elements, - size_t sizes[], void* chunks[]); - -/* - mspace_footprint() returns the number of bytes obtained from the - system for this space. -*/ -size_t mspace_footprint(mspace msp); - -/* - mspace_max_footprint() returns the peak number of bytes obtained from the - system for this space. -*/ -size_t mspace_max_footprint(mspace msp); - - -#if !NO_MALLINFO -/* - mspace_mallinfo behaves as mallinfo, but reports properties of - the given space. -*/ -struct mallinfo mspace_mallinfo(mspace msp); -#endif /* NO_MALLINFO */ - -/* - mspace_malloc_stats behaves as malloc_stats, but reports - properties of the given space. -*/ -void mspace_malloc_stats(mspace msp); - -/* - mspace_trim behaves as malloc_trim, but - operates within the given space. -*/ -int mspace_trim(mspace msp, size_t pad); - -/* - An alias for mallopt. -*/ -int mspace_mallopt(int, int); - -#endif /* MSPACES */ - -#ifdef __cplusplus -}; /* end of extern "C" */ -#endif /* __cplusplus */ - -/* - ======================================================================== - To make a fully customizable malloc.h header file, cut everything - above this line, put into file malloc.h, edit to suit, and #include it - on the next line, as well as in programs that use this malloc. - ======================================================================== -*/ - -/* #include "malloc.h" */ - -/*------------------------------ internal #includes ---------------------- */ - -#ifdef _MSC_VER -#pragma warning( disable : 4146 ) /* no "unsigned" warnings */ -#endif /* _MSC_VER */ - -#include /* for printing in malloc_stats */ - -#ifndef LACKS_ERRNO_H -#include /* for MALLOC_FAILURE_ACTION */ -#endif /* LACKS_ERRNO_H */ -#if FOOTERS -#include /* for magic initialization */ -#endif /* FOOTERS */ -#ifndef LACKS_STDLIB_H -#include /* for abort() */ -#endif /* LACKS_STDLIB_H */ -#ifdef DEBUG -#if ABORT_ON_ASSERT_FAILURE -#define assert(x) if(!(x)) ABORT -#else /* ABORT_ON_ASSERT_FAILURE */ -#include -#endif /* ABORT_ON_ASSERT_FAILURE */ -#else /* DEBUG */ -#define assert(x) -#endif /* DEBUG */ -#ifndef LACKS_STRING_H -#include /* for memset etc */ -#endif /* LACKS_STRING_H */ -#if USE_BUILTIN_FFS -#ifndef LACKS_STRINGS_H -#include /* for ffs */ -#endif /* LACKS_STRINGS_H */ -#endif /* USE_BUILTIN_FFS */ -#if HAVE_MMAP -#ifndef LACKS_SYS_MMAN_H -#include /* for mmap */ -#endif /* LACKS_SYS_MMAN_H */ -#ifndef LACKS_FCNTL_H -#include -#endif /* LACKS_FCNTL_H */ -#endif /* HAVE_MMAP */ -#if HAVE_MORECORE -#ifndef LACKS_UNISTD_H -#include /* for sbrk */ -#else /* LACKS_UNISTD_H */ -#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) -extern void* sbrk(ptrdiff_t); -#endif /* FreeBSD etc */ -#endif /* LACKS_UNISTD_H */ -#endif /* HAVE_MMAP */ - -#ifndef WIN32 -#ifndef malloc_getpagesize -# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ -# ifndef _SC_PAGE_SIZE -# define _SC_PAGE_SIZE _SC_PAGESIZE -# endif -# endif -# ifdef _SC_PAGE_SIZE -# define malloc_getpagesize sysconf(_SC_PAGE_SIZE) -# else -# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE) - extern size_t getpagesize(); -# define malloc_getpagesize getpagesize() -# else -# ifdef WIN32 /* use supplied emulation of getpagesize */ -# define malloc_getpagesize getpagesize() -# else -# ifndef LACKS_SYS_PARAM_H -# include -# endif -# ifdef EXEC_PAGESIZE -# define malloc_getpagesize EXEC_PAGESIZE -# else -# ifdef NBPG -# ifndef CLSIZE -# define malloc_getpagesize NBPG -# else -# define malloc_getpagesize (NBPG * CLSIZE) -# endif -# else -# ifdef NBPC -# define malloc_getpagesize NBPC -# else -# ifdef PAGESIZE -# define malloc_getpagesize PAGESIZE -# else /* just guess */ -# define malloc_getpagesize ((size_t)4096U) -# endif -# endif -# endif -# endif -# endif -# endif -# endif -#endif -#endif - -/* ------------------- size_t and alignment properties -------------------- */ - -/* The byte and bit size of a size_t */ -#define SIZE_T_SIZE (sizeof(size_t)) -#define SIZE_T_BITSIZE (sizeof(size_t) << 3) - -/* Some constants coerced to size_t */ -/* Annoying but necessary to avoid errors on some platforms */ -#define SIZE_T_ZERO ((size_t)0) -#define SIZE_T_ONE ((size_t)1) -#define SIZE_T_TWO ((size_t)2) -#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) -#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) -#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) -#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) - -/* The bit mask value corresponding to MALLOC_ALIGNMENT */ -#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) - -/* True if address a has acceptable alignment */ -#define is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) - -/* the number of bytes to offset an address to align it */ -#define align_offset(A)\ - ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\ - ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK)) - -/* -------------------------- MMAP preliminaries ------------------------- */ - -/* - If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and - checks to fail so compiler optimizer can delete code rather than - using so many "#if"s. -*/ - - -/* MORECORE and MMAP must return MFAIL on failure */ -#define MFAIL ((void*)(MAX_SIZE_T)) -#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ - -#if !HAVE_MMAP -#define IS_MMAPPED_BIT (SIZE_T_ZERO) -#define USE_MMAP_BIT (SIZE_T_ZERO) -#define CALL_MMAP(s) MFAIL -#define CALL_MUNMAP(a, s) (-1) -#define DIRECT_MMAP(s) MFAIL - -#else /* HAVE_MMAP */ -#define IS_MMAPPED_BIT (SIZE_T_ONE) -#define USE_MMAP_BIT (SIZE_T_ONE) - -#if !defined(WIN32) && !defined (__OS2__) -#define CALL_MUNMAP(a, s) munmap((a), (s)) -#define MMAP_PROT (PROT_READ|PROT_WRITE) -#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) -#define MAP_ANONYMOUS MAP_ANON -#endif /* MAP_ANON */ -#ifdef MAP_ANONYMOUS -#define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS) -#define CALL_MMAP(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0) -#else /* MAP_ANONYMOUS */ -/* - Nearly all versions of mmap support MAP_ANONYMOUS, so the following - is unlikely to be needed, but is supplied just in case. -*/ -#define MMAP_FLAGS (MAP_PRIVATE) -static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ -#define CALL_MMAP(s) ((dev_zero_fd < 0) ? \ - (dev_zero_fd = open("/dev/zero", O_RDWR), \ - mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \ - mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) -#endif /* MAP_ANONYMOUS */ - -#define DIRECT_MMAP(s) CALL_MMAP(s) - -#elif defined(__OS2__) - -/* OS/2 MMAP via DosAllocMem */ -static void* os2mmap(size_t size) { - void* ptr; - if (DosAllocMem(&ptr, size, OBJ_ANY|PAG_COMMIT|PAG_READ|PAG_WRITE) && - DosAllocMem(&ptr, size, PAG_COMMIT|PAG_READ|PAG_WRITE)) - return MFAIL; - return ptr; -} - -#define os2direct_mmap(n) os2mmap(n) - -/* This function supports releasing coalesed segments */ -static int os2munmap(void* ptr, size_t size) { - while (size) { - ULONG ulSize = size; - ULONG ulFlags = 0; - if (DosQueryMem(ptr, &ulSize, &ulFlags) != 0) - return -1; - if ((ulFlags & PAG_BASE) == 0 ||(ulFlags & PAG_COMMIT) == 0 || - ulSize > size) - return -1; - if (DosFreeMem(ptr) != 0) - return -1; - ptr = ( void * ) ( ( char * ) ptr + ulSize ); - size -= ulSize; - } - return 0; -} - -#define CALL_MMAP(s) os2mmap(s) -#define CALL_MUNMAP(a, s) os2munmap((a), (s)) -#define DIRECT_MMAP(s) os2direct_mmap(s) - -#else /* WIN32 */ - -/* Win32 MMAP via VirtualAlloc */ -static void* win32mmap(size_t size) { - void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE); - return (ptr != 0)? ptr: MFAIL; -} - -/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ -static void* win32direct_mmap(size_t size) { - void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, - PAGE_EXECUTE_READWRITE); - return (ptr != 0)? ptr: MFAIL; -} - -/* This function supports releasing coalesed segments */ -static int win32munmap(void* ptr, size_t size) { - MEMORY_BASIC_INFORMATION minfo; - char* cptr = ptr; - while (size) { - if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0) - return -1; - if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr || - minfo.State != MEM_COMMIT || minfo.RegionSize > size) - return -1; - if (VirtualFree(cptr, 0, MEM_RELEASE) == 0) - return -1; - cptr += minfo.RegionSize; - size -= minfo.RegionSize; - } - return 0; -} - -#define CALL_MMAP(s) win32mmap(s) -#define CALL_MUNMAP(a, s) win32munmap((a), (s)) -#define DIRECT_MMAP(s) win32direct_mmap(s) -#endif /* WIN32 */ -#endif /* HAVE_MMAP */ - -#if HAVE_MMAP && HAVE_MREMAP -#define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv)) -#else /* HAVE_MMAP && HAVE_MREMAP */ -#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL -#endif /* HAVE_MMAP && HAVE_MREMAP */ - -#if HAVE_MORECORE -#define CALL_MORECORE(S) MORECORE(S) -#else /* HAVE_MORECORE */ -#define CALL_MORECORE(S) MFAIL -#endif /* HAVE_MORECORE */ - -/* mstate bit set if contiguous morecore disabled or failed */ -#define USE_NONCONTIGUOUS_BIT (4U) - -/* segment bit set in create_mspace_with_base */ -#define EXTERN_BIT (8U) - - -/* --------------------------- Lock preliminaries ------------------------ */ - -#if USE_LOCKS - -/* - When locks are defined, there are up to two global locks: - - * If HAVE_MORECORE, morecore_mutex protects sequences of calls to - MORECORE. In many cases sys_alloc requires two calls, that should - not be interleaved with calls by other threads. This does not - protect against direct calls to MORECORE by other threads not - using this lock, so there is still code to cope the best we can on - interference. - - * magic_init_mutex ensures that mparams.magic and other - unique mparams values are initialized only once. -*/ - -#if !defined(WIN32) && !defined(__OS2__) -/* By default use posix locks */ -#include -#define MLOCK_T pthread_mutex_t -#define INITIAL_LOCK(l) pthread_mutex_init(l, NULL) -#define ACQUIRE_LOCK(l) pthread_mutex_lock(l) -#define RELEASE_LOCK(l) pthread_mutex_unlock(l) - -#if HAVE_MORECORE -static MLOCK_T morecore_mutex = PTHREAD_MUTEX_INITIALIZER; -#endif /* HAVE_MORECORE */ - -static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER; - -#elif defined(__OS2__) -#define MLOCK_T HMTX -#define INITIAL_LOCK(l) DosCreateMutexSem(0, l, 0, FALSE) -#define ACQUIRE_LOCK(l) DosRequestMutexSem(*l, SEM_INDEFINITE_WAIT) -#define RELEASE_LOCK(l) DosReleaseMutexSem(*l) -#if HAVE_MORECORE -static MLOCK_T morecore_mutex; -#endif /* HAVE_MORECORE */ -static MLOCK_T magic_init_mutex; - -#else /* WIN32 */ -/* - Because lock-protected regions have bounded times, and there - are no recursive lock calls, we can use simple spinlocks. -*/ - -#define MLOCK_T long -static int win32_acquire_lock (MLOCK_T *sl) { - for (;;) { -#ifdef InterlockedCompareExchangePointer - if (!InterlockedCompareExchange(sl, 1, 0)) - return 0; -#else /* Use older void* version */ - if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0)) - return 0; -#endif /* InterlockedCompareExchangePointer */ - Sleep (0); - } -} - -static void win32_release_lock (MLOCK_T *sl) { - InterlockedExchange (sl, 0); -} - -#define INITIAL_LOCK(l) *(l)=0 -#define ACQUIRE_LOCK(l) win32_acquire_lock(l) -#define RELEASE_LOCK(l) win32_release_lock(l) -#if HAVE_MORECORE -static MLOCK_T morecore_mutex; -#endif /* HAVE_MORECORE */ -static MLOCK_T magic_init_mutex; -#endif /* WIN32 */ - -#define USE_LOCK_BIT (2U) -#else /* USE_LOCKS */ -#define USE_LOCK_BIT (0U) -#define INITIAL_LOCK(l) -#endif /* USE_LOCKS */ - -#if USE_LOCKS && HAVE_MORECORE -#define ACQUIRE_MORECORE_LOCK() ACQUIRE_LOCK(&morecore_mutex); -#define RELEASE_MORECORE_LOCK() RELEASE_LOCK(&morecore_mutex); -#else /* USE_LOCKS && HAVE_MORECORE */ -#define ACQUIRE_MORECORE_LOCK() -#define RELEASE_MORECORE_LOCK() -#endif /* USE_LOCKS && HAVE_MORECORE */ - -#if USE_LOCKS -#define ACQUIRE_MAGIC_INIT_LOCK() ACQUIRE_LOCK(&magic_init_mutex); -#define RELEASE_MAGIC_INIT_LOCK() RELEASE_LOCK(&magic_init_mutex); -#else /* USE_LOCKS */ -#define ACQUIRE_MAGIC_INIT_LOCK() -#define RELEASE_MAGIC_INIT_LOCK() -#endif /* USE_LOCKS */ - - -/* ----------------------- Chunk representations ------------------------ */ - -/* - (The following includes lightly edited explanations by Colin Plumb.) - - The malloc_chunk declaration below is misleading (but accurate and - necessary). It declares a "view" into memory allowing access to - necessary fields at known offsets from a given base. - - Chunks of memory are maintained using a `boundary tag' method as - originally described by Knuth. (See the paper by Paul Wilson - ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such - techniques.) Sizes of free chunks are stored both in the front of - each chunk and at the end. This makes consolidating fragmented - chunks into bigger chunks fast. The head fields also hold bits - representing whether chunks are free or in use. - - Here are some pictures to make it clearer. They are "exploded" to - show that the state of a chunk can be thought of as extending from - the high 31 bits of the head field of its header through the - prev_foot and PINUSE_BIT bit of the following chunk header. - - A chunk that's in use looks like: - - chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Size of previous chunk (if P = 1) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P| - | Size of this chunk 1| +-+ - mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | | - +- -+ - | | - +- -+ - | : - +- size - sizeof(size_t) available payload bytes -+ - : | - chunk-> +- -+ - | | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1| - | Size of next chunk (may or may not be in use) | +-+ - mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - And if it's free, it looks like this: - - chunk-> +- -+ - | User payload (must be in use, or we would have merged!) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P| - | Size of this chunk 0| +-+ - mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Next pointer | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Prev pointer | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | : - +- size - sizeof(struct chunk) unused bytes -+ - : | - chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Size of this chunk | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| - | Size of next chunk (must be in use, or we would have merged)| +-+ - mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | : - +- User payload -+ - : | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - |0| - +-+ - Note that since we always merge adjacent free chunks, the chunks - adjacent to a free chunk must be in use. - - Given a pointer to a chunk (which can be derived trivially from the - payload pointer) we can, in O(1) time, find out whether the adjacent - chunks are free, and if so, unlink them from the lists that they - are on and merge them with the current chunk. - - Chunks always begin on even word boundaries, so the mem portion - (which is returned to the user) is also on an even word boundary, and - thus at least double-word aligned. - - The P (PINUSE_BIT) bit, stored in the unused low-order bit of the - chunk size (which is always a multiple of two words), is an in-use - bit for the *previous* chunk. If that bit is *clear*, then the - word before the current chunk size contains the previous chunk - size, and can be used to find the front of the previous chunk. - The very first chunk allocated always has this bit set, preventing - access to non-existent (or non-owned) memory. If pinuse is set for - any given chunk, then you CANNOT determine the size of the - previous chunk, and might even get a memory addressing fault when - trying to do so. - - The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of - the chunk size redundantly records whether the current chunk is - inuse. This redundancy enables usage checks within free and realloc, - and reduces indirection when freeing and consolidating chunks. - - Each freshly allocated chunk must have both cinuse and pinuse set. - That is, each allocated chunk borders either a previously allocated - and still in-use chunk, or the base of its memory arena. This is - ensured by making all allocations from the the `lowest' part of any - found chunk. Further, no free chunk physically borders another one, - so each free chunk is known to be preceded and followed by either - inuse chunks or the ends of memory. - - Note that the `foot' of the current chunk is actually represented - as the prev_foot of the NEXT chunk. This makes it easier to - deal with alignments etc but can be very confusing when trying - to extend or adapt this code. - - The exceptions to all this are - - 1. The special chunk `top' is the top-most available chunk (i.e., - the one bordering the end of available memory). It is treated - specially. Top is never included in any bin, is used only if - no other chunk is available, and is released back to the - system if it is very large (see M_TRIM_THRESHOLD). In effect, - the top chunk is treated as larger (and thus less well - fitting) than any other available chunk. The top chunk - doesn't update its trailing size field since there is no next - contiguous chunk that would have to index off it. However, - space is still allocated for it (TOP_FOOT_SIZE) to enable - separation or merging when space is extended. - - 3. Chunks allocated via mmap, which have the lowest-order bit - (IS_MMAPPED_BIT) set in their prev_foot fields, and do not set - PINUSE_BIT in their head fields. Because they are allocated - one-by-one, each must carry its own prev_foot field, which is - also used to hold the offset this chunk has within its mmapped - region, which is needed to preserve alignment. Each mmapped - chunk is trailed by the first two fields of a fake next-chunk - for sake of usage checks. - -*/ - -struct malloc_chunk { - size_t prev_foot; /* Size of previous chunk (if free). */ - size_t head; /* Size and inuse bits. */ - struct malloc_chunk* fd; /* double links -- used only if free. */ - struct malloc_chunk* bk; -}; - -typedef struct malloc_chunk mchunk; -typedef struct malloc_chunk* mchunkptr; -typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */ -typedef size_t bindex_t; /* Described below */ -typedef unsigned int binmap_t; /* Described below */ -typedef unsigned int flag_t; /* The type of various bit flag sets */ - -/* ------------------- Chunks sizes and alignments ----------------------- */ - -#define MCHUNK_SIZE (sizeof(mchunk)) - -#if FOOTERS -#define CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) -#else /* FOOTERS */ -#define CHUNK_OVERHEAD (SIZE_T_SIZE) -#endif /* FOOTERS */ - -/* MMapped chunks need a second word of overhead ... */ -#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) -/* ... and additional padding for fake next-chunk at foot */ -#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) - -/* The smallest size we can malloc is an aligned minimal chunk */ -#define MIN_CHUNK_SIZE\ - ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) - -/* conversion from malloc headers to user pointers, and back */ -#define chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) -#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) -/* chunk associated with aligned address A */ -#define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A))) - -/* Bounds on request (not chunk) sizes. */ -#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) -#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) - -/* pad request bytes into a usable size */ -#define pad_request(req) \ - (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) - -/* pad request, checking for minimum (but not maximum) */ -#define request2size(req) \ - (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) - - -/* ------------------ Operations on head and foot fields ----------------- */ - -/* - The head field of a chunk is or'ed with PINUSE_BIT when previous - adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in - use. If the chunk was obtained with mmap, the prev_foot field has - IS_MMAPPED_BIT set, otherwise holding the offset of the base of the - mmapped region to the base of the chunk. -*/ - -#define PINUSE_BIT (SIZE_T_ONE) -#define CINUSE_BIT (SIZE_T_TWO) -#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) - -/* Head value for fenceposts */ -#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) - -/* extraction of fields from head words */ -#define cinuse(p) ((p)->head & CINUSE_BIT) -#define pinuse(p) ((p)->head & PINUSE_BIT) -#define chunksize(p) ((p)->head & ~(INUSE_BITS)) - -#define clear_pinuse(p) ((p)->head &= ~PINUSE_BIT) -#define clear_cinuse(p) ((p)->head &= ~CINUSE_BIT) - -/* Treat space at ptr +/- offset as a chunk */ -#define chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) -#define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s))) - -/* Ptr to next or previous physical malloc_chunk. */ -#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS))) -#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) - -/* extract next chunk's pinuse bit */ -#define next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT) - -/* Get/set size at footer */ -#define get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot) -#define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) - -/* Set size, pinuse bit, and foot */ -#define set_size_and_pinuse_of_free_chunk(p, s)\ - ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) - -/* Set size, pinuse bit, foot, and clear next pinuse */ -#define set_free_with_pinuse(p, s, n)\ - (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) - -#define is_mmapped(p)\ - (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT)) - -/* Get the internal overhead associated with chunk p */ -#define overhead_for(p)\ - (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) - -/* Return true if malloced space is not necessarily cleared */ -#if MMAP_CLEARS -#define calloc_must_clear(p) (!is_mmapped(p)) -#else /* MMAP_CLEARS */ -#define calloc_must_clear(p) (1) -#endif /* MMAP_CLEARS */ - -/* ---------------------- Overlaid data structures ----------------------- */ - -/* - When chunks are not in use, they are treated as nodes of either - lists or trees. - - "Small" chunks are stored in circular doubly-linked lists, and look - like this: - - chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Size of previous chunk | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - `head:' | Size of chunk, in bytes |P| - mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Forward pointer to next chunk in list | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Back pointer to previous chunk in list | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Unused space (may be 0 bytes long) . - . . - . | -nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - `foot:' | Size of chunk, in bytes | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - Larger chunks are kept in a form of bitwise digital trees (aka - tries) keyed on chunksizes. Because malloc_tree_chunks are only for - free chunks greater than 256 bytes, their size doesn't impose any - constraints on user chunk sizes. Each node looks like: - - chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Size of previous chunk | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - `head:' | Size of chunk, in bytes |P| - mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Forward pointer to next chunk of same size | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Back pointer to previous chunk of same size | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Pointer to left child (child[0]) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Pointer to right child (child[1]) | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Pointer to parent | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | bin index of this chunk | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - | Unused space . - . | -nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - `foot:' | Size of chunk, in bytes | - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - - Each tree holding treenodes is a tree of unique chunk sizes. Chunks - of the same size are arranged in a circularly-linked list, with only - the oldest chunk (the next to be used, in our FIFO ordering) - actually in the tree. (Tree members are distinguished by a non-null - parent pointer.) If a chunk with the same size an an existing node - is inserted, it is linked off the existing node using pointers that - work in the same way as fd/bk pointers of small chunks. - - Each tree contains a power of 2 sized range of chunk sizes (the - smallest is 0x100 <= x < 0x180), which is is divided in half at each - tree level, with the chunks in the smaller half of the range (0x100 - <= x < 0x140 for the top nose) in the left subtree and the larger - half (0x140 <= x < 0x180) in the right subtree. This is, of course, - done by inspecting individual bits. - - Using these rules, each node's left subtree contains all smaller - sizes than its right subtree. However, the node at the root of each - subtree has no particular ordering relationship to either. (The - dividing line between the subtree sizes is based on trie relation.) - If we remove the last chunk of a given size from the interior of the - tree, we need to replace it with a leaf node. The tree ordering - rules permit a node to be replaced by any leaf below it. - - The smallest chunk in a tree (a common operation in a best-fit - allocator) can be found by walking a path to the leftmost leaf in - the tree. Unlike a usual binary tree, where we follow left child - pointers until we reach a null, here we follow the right child - pointer any time the left one is null, until we reach a leaf with - both child pointers null. The smallest chunk in the tree will be - somewhere along that path. - - The worst case number of steps to add, find, or remove a node is - bounded by the number of bits differentiating chunks within - bins. Under current bin calculations, this ranges from 6 up to 21 - (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case - is of course much better. -*/ - -struct malloc_tree_chunk { - /* The first four fields must be compatible with malloc_chunk */ - size_t prev_foot; - size_t head; - struct malloc_tree_chunk* fd; - struct malloc_tree_chunk* bk; - - struct malloc_tree_chunk* child[2]; - struct malloc_tree_chunk* parent; - bindex_t index; -}; - -typedef struct malloc_tree_chunk tchunk; -typedef struct malloc_tree_chunk* tchunkptr; -typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */ - -/* A little helper macro for trees */ -#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) - -/* ----------------------------- Segments -------------------------------- */ - -/* - Each malloc space may include non-contiguous segments, held in a - list headed by an embedded malloc_segment record representing the - top-most space. Segments also include flags holding properties of - the space. Large chunks that are directly allocated by mmap are not - included in this list. They are instead independently created and - destroyed without otherwise keeping track of them. - - Segment management mainly comes into play for spaces allocated by - MMAP. Any call to MMAP might or might not return memory that is - adjacent to an existing segment. MORECORE normally contiguously - extends the current space, so this space is almost always adjacent, - which is simpler and faster to deal with. (This is why MORECORE is - used preferentially to MMAP when both are available -- see - sys_alloc.) When allocating using MMAP, we don't use any of the - hinting mechanisms (inconsistently) supported in various - implementations of unix mmap, or distinguish reserving from - committing memory. Instead, we just ask for space, and exploit - contiguity when we get it. It is probably possible to do - better than this on some systems, but no general scheme seems - to be significantly better. - - Management entails a simpler variant of the consolidation scheme - used for chunks to reduce fragmentation -- new adjacent memory is - normally prepended or appended to an existing segment. However, - there are limitations compared to chunk consolidation that mostly - reflect the fact that segment processing is relatively infrequent - (occurring only when getting memory from system) and that we - don't expect to have huge numbers of segments: - - * Segments are not indexed, so traversal requires linear scans. (It - would be possible to index these, but is not worth the extra - overhead and complexity for most programs on most platforms.) - * New segments are only appended to old ones when holding top-most - memory; if they cannot be prepended to others, they are held in - different segments. - - Except for the top-most segment of an mstate, each segment record - is kept at the tail of its segment. Segments are added by pushing - segment records onto the list headed by &mstate.seg for the - containing mstate. - - Segment flags control allocation/merge/deallocation policies: - * If EXTERN_BIT set, then we did not allocate this segment, - and so should not try to deallocate or merge with others. - (This currently holds only for the initial segment passed - into create_mspace_with_base.) - * If IS_MMAPPED_BIT set, the segment may be merged with - other surrounding mmapped segments and trimmed/de-allocated - using munmap. - * If neither bit is set, then the segment was obtained using - MORECORE so can be merged with surrounding MORECORE'd segments - and deallocated/trimmed using MORECORE with negative arguments. -*/ - -struct malloc_segment { - char* base; /* base address */ - size_t size; /* allocated size */ - struct malloc_segment* next; /* ptr to next segment */ -#if FFI_MMAP_EXEC_WRIT - /* The mmap magic is supposed to store the address of the executable - segment at the very end of the requested block. */ - -# define mmap_exec_offset(b,s) (*(ptrdiff_t*)((b)+(s)-sizeof(ptrdiff_t))) - - /* We can only merge segments if their corresponding executable - segments are at identical offsets. */ -# define check_segment_merge(S,b,s) \ - (mmap_exec_offset((b),(s)) == (S)->exec_offset) - -# define add_segment_exec_offset(p,S) ((char*)(p) + (S)->exec_offset) -# define sub_segment_exec_offset(p,S) ((char*)(p) - (S)->exec_offset) - - /* The removal of sflags only works with HAVE_MORECORE == 0. */ - -# define get_segment_flags(S) (IS_MMAPPED_BIT) -# define set_segment_flags(S,v) \ - (((v) != IS_MMAPPED_BIT) ? (ABORT, (v)) : \ - (((S)->exec_offset = \ - mmap_exec_offset((S)->base, (S)->size)), \ - (mmap_exec_offset((S)->base + (S)->exec_offset, (S)->size) != \ - (S)->exec_offset) ? (ABORT, (v)) : \ - (mmap_exec_offset((S)->base, (S)->size) = 0), (v))) - - /* We use an offset here, instead of a pointer, because then, when - base changes, we don't have to modify this. On architectures - with segmented addresses, this might not work. */ - ptrdiff_t exec_offset; -#else - -# define get_segment_flags(S) ((S)->sflags) -# define set_segment_flags(S,v) ((S)->sflags = (v)) -# define check_segment_merge(S,b,s) (1) - - flag_t sflags; /* mmap and extern flag */ -#endif -}; - -#define is_mmapped_segment(S) (get_segment_flags(S) & IS_MMAPPED_BIT) -#define is_extern_segment(S) (get_segment_flags(S) & EXTERN_BIT) - -typedef struct malloc_segment msegment; -typedef struct malloc_segment* msegmentptr; - -/* ---------------------------- malloc_state ----------------------------- */ - -/* - A malloc_state holds all of the bookkeeping for a space. - The main fields are: - - Top - The topmost chunk of the currently active segment. Its size is - cached in topsize. The actual size of topmost space is - topsize+TOP_FOOT_SIZE, which includes space reserved for adding - fenceposts and segment records if necessary when getting more - space from the system. The size at which to autotrim top is - cached from mparams in trim_check, except that it is disabled if - an autotrim fails. - - Designated victim (dv) - This is the preferred chunk for servicing small requests that - don't have exact fits. It is normally the chunk split off most - recently to service another small request. Its size is cached in - dvsize. The link fields of this chunk are not maintained since it - is not kept in a bin. - - SmallBins - An array of bin headers for free chunks. These bins hold chunks - with sizes less than MIN_LARGE_SIZE bytes. Each bin contains - chunks of all the same size, spaced 8 bytes apart. To simplify - use in double-linked lists, each bin header acts as a malloc_chunk - pointing to the real first node, if it exists (else pointing to - itself). This avoids special-casing for headers. But to avoid - waste, we allocate only the fd/bk pointers of bins, and then use - repositioning tricks to treat these as the fields of a chunk. - - TreeBins - Treebins are pointers to the roots of trees holding a range of - sizes. There are 2 equally spaced treebins for each power of two - from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything - larger. - - Bin maps - There is one bit map for small bins ("smallmap") and one for - treebins ("treemap). Each bin sets its bit when non-empty, and - clears the bit when empty. Bit operations are then used to avoid - bin-by-bin searching -- nearly all "search" is done without ever - looking at bins that won't be selected. The bit maps - conservatively use 32 bits per map word, even if on 64bit system. - For a good description of some of the bit-based techniques used - here, see Henry S. Warren Jr's book "Hacker's Delight" (and - supplement at http://hackersdelight.org/). Many of these are - intended to reduce the branchiness of paths through malloc etc, as - well as to reduce the number of memory locations read or written. - - Segments - A list of segments headed by an embedded malloc_segment record - representing the initial space. - - Address check support - The least_addr field is the least address ever obtained from - MORECORE or MMAP. Attempted frees and reallocs of any address less - than this are trapped (unless INSECURE is defined). - - Magic tag - A cross-check field that should always hold same value as mparams.magic. - - Flags - Bits recording whether to use MMAP, locks, or contiguous MORECORE - - Statistics - Each space keeps track of current and maximum system memory - obtained via MORECORE or MMAP. - - Locking - If USE_LOCKS is defined, the "mutex" lock is acquired and released - around every public call using this mspace. -*/ - -/* Bin types, widths and sizes */ -#define NSMALLBINS (32U) -#define NTREEBINS (32U) -#define SMALLBIN_SHIFT (3U) -#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) -#define TREEBIN_SHIFT (8U) -#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) -#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) -#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) - -struct malloc_state { - binmap_t smallmap; - binmap_t treemap; - size_t dvsize; - size_t topsize; - char* least_addr; - mchunkptr dv; - mchunkptr top; - size_t trim_check; - size_t magic; - mchunkptr smallbins[(NSMALLBINS+1)*2]; - tbinptr treebins[NTREEBINS]; - size_t footprint; - size_t max_footprint; - flag_t mflags; -#if USE_LOCKS - MLOCK_T mutex; /* locate lock among fields that rarely change */ -#endif /* USE_LOCKS */ - msegment seg; -}; - -typedef struct malloc_state* mstate; - -/* ------------- Global malloc_state and malloc_params ------------------- */ - -/* - malloc_params holds global properties, including those that can be - dynamically set using mallopt. There is a single instance, mparams, - initialized in init_mparams. -*/ - -struct malloc_params { - size_t magic; - size_t page_size; - size_t granularity; - size_t mmap_threshold; - size_t trim_threshold; - flag_t default_mflags; -}; - -static struct malloc_params mparams; - -/* The global malloc_state used for all non-"mspace" calls */ -static struct malloc_state _gm_; -#define gm (&_gm_) -#define is_global(M) ((M) == &_gm_) -#define is_initialized(M) ((M)->top != 0) - -/* -------------------------- system alloc setup ------------------------- */ - -/* Operations on mflags */ - -#define use_lock(M) ((M)->mflags & USE_LOCK_BIT) -#define enable_lock(M) ((M)->mflags |= USE_LOCK_BIT) -#define disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT) - -#define use_mmap(M) ((M)->mflags & USE_MMAP_BIT) -#define enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT) -#define disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT) - -#define use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT) -#define disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT) - -#define set_lock(M,L)\ - ((M)->mflags = (L)?\ - ((M)->mflags | USE_LOCK_BIT) :\ - ((M)->mflags & ~USE_LOCK_BIT)) - -/* page-align a size */ -#define page_align(S)\ - (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE)) - -/* granularity-align a size */ -#define granularity_align(S)\ - (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE)) - -#define is_page_aligned(S)\ - (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) -#define is_granularity_aligned(S)\ - (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) - -/* True if segment S holds address A */ -#define segment_holds(S, A)\ - ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) - -/* Return segment holding given address */ -static msegmentptr segment_holding(mstate m, char* addr) { - msegmentptr sp = &m->seg; - for (;;) { - if (addr >= sp->base && addr < sp->base + sp->size) - return sp; - if ((sp = sp->next) == 0) - return 0; - } -} - -/* Return true if segment contains a segment link */ -static int has_segment_link(mstate m, msegmentptr ss) { - msegmentptr sp = &m->seg; - for (;;) { - if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size) - return 1; - if ((sp = sp->next) == 0) - return 0; - } -} - -#ifndef MORECORE_CANNOT_TRIM -#define should_trim(M,s) ((s) > (M)->trim_check) -#else /* MORECORE_CANNOT_TRIM */ -#define should_trim(M,s) (0) -#endif /* MORECORE_CANNOT_TRIM */ - -/* - TOP_FOOT_SIZE is padding at the end of a segment, including space - that may be needed to place segment records and fenceposts when new - noncontiguous segments are added. -*/ -#define TOP_FOOT_SIZE\ - (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) - - -/* ------------------------------- Hooks -------------------------------- */ - -/* - PREACTION should be defined to return 0 on success, and nonzero on - failure. If you are not using locking, you can redefine these to do - anything you like. -*/ - -#if USE_LOCKS - -/* Ensure locks are initialized */ -#define GLOBALLY_INITIALIZE() (mparams.page_size == 0 && init_mparams()) - -#define PREACTION(M) ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0) -#define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); } -#else /* USE_LOCKS */ - -#ifndef PREACTION -#define PREACTION(M) (0) -#endif /* PREACTION */ - -#ifndef POSTACTION -#define POSTACTION(M) -#endif /* POSTACTION */ - -#endif /* USE_LOCKS */ - -/* - CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses. - USAGE_ERROR_ACTION is triggered on detected bad frees and - reallocs. The argument p is an address that might have triggered the - fault. It is ignored by the two predefined actions, but might be - useful in custom actions that try to help diagnose errors. -*/ - -#if PROCEED_ON_ERROR - -/* A count of the number of corruption errors causing resets */ -int malloc_corruption_error_count; - -/* default corruption action */ -static void reset_on_error(mstate m); - -#define CORRUPTION_ERROR_ACTION(m) reset_on_error(m) -#define USAGE_ERROR_ACTION(m, p) - -#else /* PROCEED_ON_ERROR */ - -#ifndef CORRUPTION_ERROR_ACTION -#define CORRUPTION_ERROR_ACTION(m) ABORT -#endif /* CORRUPTION_ERROR_ACTION */ - -#ifndef USAGE_ERROR_ACTION -#define USAGE_ERROR_ACTION(m,p) ABORT -#endif /* USAGE_ERROR_ACTION */ - -#endif /* PROCEED_ON_ERROR */ - -/* -------------------------- Debugging setup ---------------------------- */ - -#if ! DEBUG - -#define check_free_chunk(M,P) -#define check_inuse_chunk(M,P) -#define check_malloced_chunk(M,P,N) -#define check_mmapped_chunk(M,P) -#define check_malloc_state(M) -#define check_top_chunk(M,P) - -#else /* DEBUG */ -#define check_free_chunk(M,P) do_check_free_chunk(M,P) -#define check_inuse_chunk(M,P) do_check_inuse_chunk(M,P) -#define check_top_chunk(M,P) do_check_top_chunk(M,P) -#define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N) -#define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P) -#define check_malloc_state(M) do_check_malloc_state(M) - -static void do_check_any_chunk(mstate m, mchunkptr p); -static void do_check_top_chunk(mstate m, mchunkptr p); -static void do_check_mmapped_chunk(mstate m, mchunkptr p); -static void do_check_inuse_chunk(mstate m, mchunkptr p); -static void do_check_free_chunk(mstate m, mchunkptr p); -static void do_check_malloced_chunk(mstate m, void* mem, size_t s); -static void do_check_tree(mstate m, tchunkptr t); -static void do_check_treebin(mstate m, bindex_t i); -static void do_check_smallbin(mstate m, bindex_t i); -static void do_check_malloc_state(mstate m); -static int bin_find(mstate m, mchunkptr x); -static size_t traverse_and_check(mstate m); -#endif /* DEBUG */ - -/* ---------------------------- Indexing Bins ---------------------------- */ - -#define is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) -#define small_index(s) ((s) >> SMALLBIN_SHIFT) -#define small_index2size(i) ((i) << SMALLBIN_SHIFT) -#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) - -/* addressing by index. See above about smallbin repositioning */ -#define smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1]))) -#define treebin_at(M,i) (&((M)->treebins[i])) - -/* assign tree index for size S to variable I */ -#if defined(__GNUC__) && defined(__i386__) -#define compute_tree_index(S, I)\ -{\ - size_t X = S >> TREEBIN_SHIFT;\ - if (X == 0)\ - I = 0;\ - else if (X > 0xFFFF)\ - I = NTREEBINS-1;\ - else {\ - unsigned int K;\ - __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm" (X));\ - I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\ - }\ -} -#else /* GNUC */ -#define compute_tree_index(S, I)\ -{\ - size_t X = S >> TREEBIN_SHIFT;\ - if (X == 0)\ - I = 0;\ - else if (X > 0xFFFF)\ - I = NTREEBINS-1;\ - else {\ - unsigned int Y = (unsigned int)X;\ - unsigned int N = ((Y - 0x100) >> 16) & 8;\ - unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\ - N += K;\ - N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\ - K = 14 - N + ((Y <<= K) >> 15);\ - I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\ - }\ -} -#endif /* GNUC */ - -/* Bit representing maximum resolved size in a treebin at i */ -#define bit_for_tree_index(i) \ - (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) - -/* Shift placing maximum resolved bit in a treebin at i as sign bit */ -#define leftshift_for_tree_index(i) \ - ((i == NTREEBINS-1)? 0 : \ - ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2))) - -/* The size of the smallest chunk held in bin with index i */ -#define minsize_for_tree_index(i) \ - ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \ - (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1))) - - -/* ------------------------ Operations on bin maps ----------------------- */ - -/* bit corresponding to given index */ -#define idx2bit(i) ((binmap_t)(1) << (i)) - -/* Mark/Clear bits with given index */ -#define mark_smallmap(M,i) ((M)->smallmap |= idx2bit(i)) -#define clear_smallmap(M,i) ((M)->smallmap &= ~idx2bit(i)) -#define smallmap_is_marked(M,i) ((M)->smallmap & idx2bit(i)) - -#define mark_treemap(M,i) ((M)->treemap |= idx2bit(i)) -#define clear_treemap(M,i) ((M)->treemap &= ~idx2bit(i)) -#define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i)) - -/* index corresponding to given bit */ - -#if defined(__GNUC__) && defined(__i386__) -#define compute_bit2idx(X, I)\ -{\ - unsigned int J;\ - __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\ - I = (bindex_t)J;\ -} - -#else /* GNUC */ -#if USE_BUILTIN_FFS -#define compute_bit2idx(X, I) I = __builtin_ffs(X)-1 - -#else /* USE_BUILTIN_FFS */ -#define compute_bit2idx(X, I)\ -{\ - unsigned int Y = X - 1;\ - unsigned int K = Y >> (16-4) & 16;\ - unsigned int N = K; Y >>= K;\ - N += K = Y >> (8-3) & 8; Y >>= K;\ - N += K = Y >> (4-2) & 4; Y >>= K;\ - N += K = Y >> (2-1) & 2; Y >>= K;\ - N += K = Y >> (1-0) & 1; Y >>= K;\ - I = (bindex_t)(N + Y);\ -} -#endif /* USE_BUILTIN_FFS */ -#endif /* GNUC */ - -/* isolate the least set bit of a bitmap */ -#define least_bit(x) ((x) & -(x)) - -/* mask with all bits to left of least bit of x on */ -#define left_bits(x) ((x<<1) | -(x<<1)) - -/* mask with all bits to left of or equal to least bit of x on */ -#define same_or_left_bits(x) ((x) | -(x)) - - -/* ----------------------- Runtime Check Support ------------------------- */ - -/* - For security, the main invariant is that malloc/free/etc never - writes to a static address other than malloc_state, unless static - malloc_state itself has been corrupted, which cannot occur via - malloc (because of these checks). In essence this means that we - believe all pointers, sizes, maps etc held in malloc_state, but - check all of those linked or offsetted from other embedded data - structures. These checks are interspersed with main code in a way - that tends to minimize their run-time cost. - - When FOOTERS is defined, in addition to range checking, we also - verify footer fields of inuse chunks, which can be used guarantee - that the mstate controlling malloc/free is intact. This is a - streamlined version of the approach described by William Robertson - et al in "Run-time Detection of Heap-based Overflows" LISA'03 - http://www.usenix.org/events/lisa03/tech/robertson.html The footer - of an inuse chunk holds the xor of its mstate and a random seed, - that is checked upon calls to free() and realloc(). This is - (probablistically) unguessable from outside the program, but can be - computed by any code successfully malloc'ing any chunk, so does not - itself provide protection against code that has already broken - security through some other means. Unlike Robertson et al, we - always dynamically check addresses of all offset chunks (previous, - next, etc). This turns out to be cheaper than relying on hashes. -*/ - -#if !INSECURE -/* Check if address a is at least as high as any from MORECORE or MMAP */ -#define ok_address(M, a) ((char*)(a) >= (M)->least_addr) -/* Check if address of next chunk n is higher than base chunk p */ -#define ok_next(p, n) ((char*)(p) < (char*)(n)) -/* Check if p has its cinuse bit on */ -#define ok_cinuse(p) cinuse(p) -/* Check if p has its pinuse bit on */ -#define ok_pinuse(p) pinuse(p) - -#else /* !INSECURE */ -#define ok_address(M, a) (1) -#define ok_next(b, n) (1) -#define ok_cinuse(p) (1) -#define ok_pinuse(p) (1) -#endif /* !INSECURE */ - -#if (FOOTERS && !INSECURE) -/* Check if (alleged) mstate m has expected magic field */ -#define ok_magic(M) ((M)->magic == mparams.magic) -#else /* (FOOTERS && !INSECURE) */ -#define ok_magic(M) (1) -#endif /* (FOOTERS && !INSECURE) */ - - -/* In gcc, use __builtin_expect to minimize impact of checks */ -#if !INSECURE -#if defined(__GNUC__) && __GNUC__ >= 3 -#define RTCHECK(e) __builtin_expect(e, 1) -#else /* GNUC */ -#define RTCHECK(e) (e) -#endif /* GNUC */ -#else /* !INSECURE */ -#define RTCHECK(e) (1) -#endif /* !INSECURE */ - -/* macros to set up inuse chunks with or without footers */ - -#if !FOOTERS - -#define mark_inuse_foot(M,p,s) - -/* Set cinuse bit and pinuse bit of next chunk */ -#define set_inuse(M,p,s)\ - ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ - ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT) - -/* Set cinuse and pinuse of this chunk and pinuse of next chunk */ -#define set_inuse_and_pinuse(M,p,s)\ - ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ - ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT) - -/* Set size, cinuse and pinuse bit of this chunk */ -#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\ - ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) - -#else /* FOOTERS */ - -/* Set foot of inuse chunk to be xor of mstate and seed */ -#define mark_inuse_foot(M,p,s)\ - (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic)) - -#define get_mstate_for(p)\ - ((mstate)(((mchunkptr)((char*)(p) +\ - (chunksize(p))))->prev_foot ^ mparams.magic)) - -#define set_inuse(M,p,s)\ - ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ - (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \ - mark_inuse_foot(M,p,s)) - -#define set_inuse_and_pinuse(M,p,s)\ - ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ - (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\ - mark_inuse_foot(M,p,s)) - -#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\ - ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ - mark_inuse_foot(M, p, s)) - -#endif /* !FOOTERS */ - -/* ---------------------------- setting mparams -------------------------- */ - -/* Initialize mparams */ -static int init_mparams(void) { - if (mparams.page_size == 0) { - size_t s; - - mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD; - mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD; -#if MORECORE_CONTIGUOUS - mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT; -#else /* MORECORE_CONTIGUOUS */ - mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT; -#endif /* MORECORE_CONTIGUOUS */ - -#if (FOOTERS && !INSECURE) - { -#if USE_DEV_RANDOM - int fd; - unsigned char buf[sizeof(size_t)]; - /* Try to use /dev/urandom, else fall back on using time */ - if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 && - read(fd, buf, sizeof(buf)) == sizeof(buf)) { - s = *((size_t *) buf); - close(fd); - } - else -#endif /* USE_DEV_RANDOM */ - s = (size_t)(time(0) ^ (size_t)0x55555555U); - - s |= (size_t)8U; /* ensure nonzero */ - s &= ~(size_t)7U; /* improve chances of fault for bad values */ - - } -#else /* (FOOTERS && !INSECURE) */ - s = (size_t)0x58585858U; -#endif /* (FOOTERS && !INSECURE) */ - ACQUIRE_MAGIC_INIT_LOCK(); - if (mparams.magic == 0) { - mparams.magic = s; - /* Set up lock for main malloc area */ - INITIAL_LOCK(&gm->mutex); - gm->mflags = mparams.default_mflags; - } - RELEASE_MAGIC_INIT_LOCK(); - -#if !defined(WIN32) && !defined(__OS2__) - mparams.page_size = malloc_getpagesize; - mparams.granularity = ((DEFAULT_GRANULARITY != 0)? - DEFAULT_GRANULARITY : mparams.page_size); -#elif defined (__OS2__) - /* if low-memory is used, os2munmap() would break - if it were anything other than 64k */ - mparams.page_size = 4096u; - mparams.granularity = 65536u; -#else /* WIN32 */ - { - SYSTEM_INFO system_info; - GetSystemInfo(&system_info); - mparams.page_size = system_info.dwPageSize; - mparams.granularity = system_info.dwAllocationGranularity; - } -#endif /* WIN32 */ - - /* Sanity-check configuration: - size_t must be unsigned and as wide as pointer type. - ints must be at least 4 bytes. - alignment must be at least 8. - Alignment, min chunk size, and page size must all be powers of 2. - */ - if ((sizeof(size_t) != sizeof(char*)) || - (MAX_SIZE_T < MIN_CHUNK_SIZE) || - (sizeof(int) < 4) || - (MALLOC_ALIGNMENT < (size_t)8U) || - ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) || - ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) || - ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) || - ((mparams.page_size & (mparams.page_size-SIZE_T_ONE)) != 0)) - ABORT; - } - return 0; -} - -/* support for mallopt */ -static int change_mparam(int param_number, int value) { - size_t val = (size_t)value; - init_mparams(); - switch(param_number) { - case M_TRIM_THRESHOLD: - mparams.trim_threshold = val; - return 1; - case M_GRANULARITY: - if (val >= mparams.page_size && ((val & (val-1)) == 0)) { - mparams.granularity = val; - return 1; - } - else - return 0; - case M_MMAP_THRESHOLD: - mparams.mmap_threshold = val; - return 1; - default: - return 0; - } -} - -#if DEBUG -/* ------------------------- Debugging Support --------------------------- */ - -/* Check properties of any chunk, whether free, inuse, mmapped etc */ -static void do_check_any_chunk(mstate m, mchunkptr p) { - assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); - assert(ok_address(m, p)); -} - -/* Check properties of top chunk */ -static void do_check_top_chunk(mstate m, mchunkptr p) { - msegmentptr sp = segment_holding(m, (char*)p); - size_t sz = chunksize(p); - assert(sp != 0); - assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); - assert(ok_address(m, p)); - assert(sz == m->topsize); - assert(sz > 0); - assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE); - assert(pinuse(p)); - assert(!next_pinuse(p)); -} - -/* Check properties of (inuse) mmapped chunks */ -static void do_check_mmapped_chunk(mstate m, mchunkptr p) { - size_t sz = chunksize(p); - size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD); - assert(is_mmapped(p)); - assert(use_mmap(m)); - assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); - assert(ok_address(m, p)); - assert(!is_small(sz)); - assert((len & (mparams.page_size-SIZE_T_ONE)) == 0); - assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD); - assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0); -} - -/* Check properties of inuse chunks */ -static void do_check_inuse_chunk(mstate m, mchunkptr p) { - do_check_any_chunk(m, p); - assert(cinuse(p)); - assert(next_pinuse(p)); - /* If not pinuse and not mmapped, previous chunk has OK offset */ - assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p); - if (is_mmapped(p)) - do_check_mmapped_chunk(m, p); -} - -/* Check properties of free chunks */ -static void do_check_free_chunk(mstate m, mchunkptr p) { - size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); - mchunkptr next = chunk_plus_offset(p, sz); - do_check_any_chunk(m, p); - assert(!cinuse(p)); - assert(!next_pinuse(p)); - assert (!is_mmapped(p)); - if (p != m->dv && p != m->top) { - if (sz >= MIN_CHUNK_SIZE) { - assert((sz & CHUNK_ALIGN_MASK) == 0); - assert(is_aligned(chunk2mem(p))); - assert(next->prev_foot == sz); - assert(pinuse(p)); - assert (next == m->top || cinuse(next)); - assert(p->fd->bk == p); - assert(p->bk->fd == p); - } - else /* markers are always of size SIZE_T_SIZE */ - assert(sz == SIZE_T_SIZE); - } -} - -/* Check properties of malloced chunks at the point they are malloced */ -static void do_check_malloced_chunk(mstate m, void* mem, size_t s) { - if (mem != 0) { - mchunkptr p = mem2chunk(mem); - size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); - do_check_inuse_chunk(m, p); - assert((sz & CHUNK_ALIGN_MASK) == 0); - assert(sz >= MIN_CHUNK_SIZE); - assert(sz >= s); - /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */ - assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE)); - } -} - -/* Check a tree and its subtrees. */ -static void do_check_tree(mstate m, tchunkptr t) { - tchunkptr head = 0; - tchunkptr u = t; - bindex_t tindex = t->index; - size_t tsize = chunksize(t); - bindex_t idx; - compute_tree_index(tsize, idx); - assert(tindex == idx); - assert(tsize >= MIN_LARGE_SIZE); - assert(tsize >= minsize_for_tree_index(idx)); - assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1)))); - - do { /* traverse through chain of same-sized nodes */ - do_check_any_chunk(m, ((mchunkptr)u)); - assert(u->index == tindex); - assert(chunksize(u) == tsize); - assert(!cinuse(u)); - assert(!next_pinuse(u)); - assert(u->fd->bk == u); - assert(u->bk->fd == u); - if (u->parent == 0) { - assert(u->child[0] == 0); - assert(u->child[1] == 0); - } - else { - assert(head == 0); /* only one node on chain has parent */ - head = u; - assert(u->parent != u); - assert (u->parent->child[0] == u || - u->parent->child[1] == u || - *((tbinptr*)(u->parent)) == u); - if (u->child[0] != 0) { - assert(u->child[0]->parent == u); - assert(u->child[0] != u); - do_check_tree(m, u->child[0]); - } - if (u->child[1] != 0) { - assert(u->child[1]->parent == u); - assert(u->child[1] != u); - do_check_tree(m, u->child[1]); - } - if (u->child[0] != 0 && u->child[1] != 0) { - assert(chunksize(u->child[0]) < chunksize(u->child[1])); - } - } - u = u->fd; - } while (u != t); - assert(head != 0); -} - -/* Check all the chunks in a treebin. */ -static void do_check_treebin(mstate m, bindex_t i) { - tbinptr* tb = treebin_at(m, i); - tchunkptr t = *tb; - int empty = (m->treemap & (1U << i)) == 0; - if (t == 0) - assert(empty); - if (!empty) - do_check_tree(m, t); -} - -/* Check all the chunks in a smallbin. */ -static void do_check_smallbin(mstate m, bindex_t i) { - sbinptr b = smallbin_at(m, i); - mchunkptr p = b->bk; - unsigned int empty = (m->smallmap & (1U << i)) == 0; - if (p == b) - assert(empty); - if (!empty) { - for (; p != b; p = p->bk) { - size_t size = chunksize(p); - mchunkptr q; - /* each chunk claims to be free */ - do_check_free_chunk(m, p); - /* chunk belongs in bin */ - assert(small_index(size) == i); - assert(p->bk == b || chunksize(p->bk) == chunksize(p)); - /* chunk is followed by an inuse chunk */ - q = next_chunk(p); - if (q->head != FENCEPOST_HEAD) - do_check_inuse_chunk(m, q); - } - } -} - -/* Find x in a bin. Used in other check functions. */ -static int bin_find(mstate m, mchunkptr x) { - size_t size = chunksize(x); - if (is_small(size)) { - bindex_t sidx = small_index(size); - sbinptr b = smallbin_at(m, sidx); - if (smallmap_is_marked(m, sidx)) { - mchunkptr p = b; - do { - if (p == x) - return 1; - } while ((p = p->fd) != b); - } - } - else { - bindex_t tidx; - compute_tree_index(size, tidx); - if (treemap_is_marked(m, tidx)) { - tchunkptr t = *treebin_at(m, tidx); - size_t sizebits = size << leftshift_for_tree_index(tidx); - while (t != 0 && chunksize(t) != size) { - t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; - sizebits <<= 1; - } - if (t != 0) { - tchunkptr u = t; - do { - if (u == (tchunkptr)x) - return 1; - } while ((u = u->fd) != t); - } - } - } - return 0; -} - -/* Traverse each chunk and check it; return total */ -static size_t traverse_and_check(mstate m) { - size_t sum = 0; - if (is_initialized(m)) { - msegmentptr s = &m->seg; - sum += m->topsize + TOP_FOOT_SIZE; - while (s != 0) { - mchunkptr q = align_as_chunk(s->base); - mchunkptr lastq = 0; - assert(pinuse(q)); - while (segment_holds(s, q) && - q != m->top && q->head != FENCEPOST_HEAD) { - sum += chunksize(q); - if (cinuse(q)) { - assert(!bin_find(m, q)); - do_check_inuse_chunk(m, q); - } - else { - assert(q == m->dv || bin_find(m, q)); - assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */ - do_check_free_chunk(m, q); - } - lastq = q; - q = next_chunk(q); - } - s = s->next; - } - } - return sum; -} - -/* Check all properties of malloc_state. */ -static void do_check_malloc_state(mstate m) { - bindex_t i; - size_t total; - /* check bins */ - for (i = 0; i < NSMALLBINS; ++i) - do_check_smallbin(m, i); - for (i = 0; i < NTREEBINS; ++i) - do_check_treebin(m, i); - - if (m->dvsize != 0) { /* check dv chunk */ - do_check_any_chunk(m, m->dv); - assert(m->dvsize == chunksize(m->dv)); - assert(m->dvsize >= MIN_CHUNK_SIZE); - assert(bin_find(m, m->dv) == 0); - } - - if (m->top != 0) { /* check top chunk */ - do_check_top_chunk(m, m->top); - assert(m->topsize == chunksize(m->top)); - assert(m->topsize > 0); - assert(bin_find(m, m->top) == 0); - } - - total = traverse_and_check(m); - assert(total <= m->footprint); - assert(m->footprint <= m->max_footprint); -} -#endif /* DEBUG */ - -/* ----------------------------- statistics ------------------------------ */ - -#if !NO_MALLINFO -static struct mallinfo internal_mallinfo(mstate m) { - struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - if (!PREACTION(m)) { - check_malloc_state(m); - if (is_initialized(m)) { - size_t nfree = SIZE_T_ONE; /* top always free */ - size_t mfree = m->topsize + TOP_FOOT_SIZE; - size_t sum = mfree; - msegmentptr s = &m->seg; - while (s != 0) { - mchunkptr q = align_as_chunk(s->base); - while (segment_holds(s, q) && - q != m->top && q->head != FENCEPOST_HEAD) { - size_t sz = chunksize(q); - sum += sz; - if (!cinuse(q)) { - mfree += sz; - ++nfree; - } - q = next_chunk(q); - } - s = s->next; - } - - nm.arena = sum; - nm.ordblks = nfree; - nm.hblkhd = m->footprint - sum; - nm.usmblks = m->max_footprint; - nm.uordblks = m->footprint - mfree; - nm.fordblks = mfree; - nm.keepcost = m->topsize; - } - - POSTACTION(m); - } - return nm; -} -#endif /* !NO_MALLINFO */ - -static void internal_malloc_stats(mstate m) { - if (!PREACTION(m)) { - size_t maxfp = 0; - size_t fp = 0; - size_t used = 0; - check_malloc_state(m); - if (is_initialized(m)) { - msegmentptr s = &m->seg; - maxfp = m->max_footprint; - fp = m->footprint; - used = fp - (m->topsize + TOP_FOOT_SIZE); - - while (s != 0) { - mchunkptr q = align_as_chunk(s->base); - while (segment_holds(s, q) && - q != m->top && q->head != FENCEPOST_HEAD) { - if (!cinuse(q)) - used -= chunksize(q); - q = next_chunk(q); - } - s = s->next; - } - } - - fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp)); - fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp)); - fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used)); - - POSTACTION(m); - } -} - -/* ----------------------- Operations on smallbins ----------------------- */ - -/* - Various forms of linking and unlinking are defined as macros. Even - the ones for trees, which are very long but have very short typical - paths. This is ugly but reduces reliance on inlining support of - compilers. -*/ - -/* Link a free chunk into a smallbin */ -#define insert_small_chunk(M, P, S) {\ - bindex_t I = small_index(S);\ - mchunkptr B = smallbin_at(M, I);\ - mchunkptr F = B;\ - assert(S >= MIN_CHUNK_SIZE);\ - if (!smallmap_is_marked(M, I))\ - mark_smallmap(M, I);\ - else if (RTCHECK(ok_address(M, B->fd)))\ - F = B->fd;\ - else {\ - CORRUPTION_ERROR_ACTION(M);\ - }\ - B->fd = P;\ - F->bk = P;\ - P->fd = F;\ - P->bk = B;\ -} - -/* Unlink a chunk from a smallbin */ -#define unlink_small_chunk(M, P, S) {\ - mchunkptr F = P->fd;\ - mchunkptr B = P->bk;\ - bindex_t I = small_index(S);\ - assert(P != B);\ - assert(P != F);\ - assert(chunksize(P) == small_index2size(I));\ - if (F == B)\ - clear_smallmap(M, I);\ - else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\ - (B == smallbin_at(M,I) || ok_address(M, B)))) {\ - F->bk = B;\ - B->fd = F;\ - }\ - else {\ - CORRUPTION_ERROR_ACTION(M);\ - }\ -} - -/* Unlink the first chunk from a smallbin */ -#define unlink_first_small_chunk(M, B, P, I) {\ - mchunkptr F = P->fd;\ - assert(P != B);\ - assert(P != F);\ - assert(chunksize(P) == small_index2size(I));\ - if (B == F)\ - clear_smallmap(M, I);\ - else if (RTCHECK(ok_address(M, F))) {\ - B->fd = F;\ - F->bk = B;\ - }\ - else {\ - CORRUPTION_ERROR_ACTION(M);\ - }\ -} - -/* Replace dv node, binning the old one */ -/* Used only when dvsize known to be small */ -#define replace_dv(M, P, S) {\ - size_t DVS = M->dvsize;\ - if (DVS != 0) {\ - mchunkptr DV = M->dv;\ - assert(is_small(DVS));\ - insert_small_chunk(M, DV, DVS);\ - }\ - M->dvsize = S;\ - M->dv = P;\ -} - -/* ------------------------- Operations on trees ------------------------- */ - -/* Insert chunk into tree */ -#define insert_large_chunk(M, X, S) {\ - tbinptr* H;\ - bindex_t I;\ - compute_tree_index(S, I);\ - H = treebin_at(M, I);\ - X->index = I;\ - X->child[0] = X->child[1] = 0;\ - if (!treemap_is_marked(M, I)) {\ - mark_treemap(M, I);\ - *H = X;\ - X->parent = (tchunkptr)H;\ - X->fd = X->bk = X;\ - }\ - else {\ - tchunkptr T = *H;\ - size_t K = S << leftshift_for_tree_index(I);\ - for (;;) {\ - if (chunksize(T) != S) {\ - tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\ - K <<= 1;\ - if (*C != 0)\ - T = *C;\ - else if (RTCHECK(ok_address(M, C))) {\ - *C = X;\ - X->parent = T;\ - X->fd = X->bk = X;\ - break;\ - }\ - else {\ - CORRUPTION_ERROR_ACTION(M);\ - break;\ - }\ - }\ - else {\ - tchunkptr F = T->fd;\ - if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\ - T->fd = F->bk = X;\ - X->fd = F;\ - X->bk = T;\ - X->parent = 0;\ - break;\ - }\ - else {\ - CORRUPTION_ERROR_ACTION(M);\ - break;\ - }\ - }\ - }\ - }\ -} - -/* - Unlink steps: - - 1. If x is a chained node, unlink it from its same-sized fd/bk links - and choose its bk node as its replacement. - 2. If x was the last node of its size, but not a leaf node, it must - be replaced with a leaf node (not merely one with an open left or - right), to make sure that lefts and rights of descendants - correspond properly to bit masks. We use the rightmost descendant - of x. We could use any other leaf, but this is easy to locate and - tends to counteract removal of leftmosts elsewhere, and so keeps - paths shorter than minimally guaranteed. This doesn't loop much - because on average a node in a tree is near the bottom. - 3. If x is the base of a chain (i.e., has parent links) relink - x's parent and children to x's replacement (or null if none). -*/ - -#define unlink_large_chunk(M, X) {\ - tchunkptr XP = X->parent;\ - tchunkptr R;\ - if (X->bk != X) {\ - tchunkptr F = X->fd;\ - R = X->bk;\ - if (RTCHECK(ok_address(M, F))) {\ - F->bk = R;\ - R->fd = F;\ - }\ - else {\ - CORRUPTION_ERROR_ACTION(M);\ - }\ - }\ - else {\ - tchunkptr* RP;\ - if (((R = *(RP = &(X->child[1]))) != 0) ||\ - ((R = *(RP = &(X->child[0]))) != 0)) {\ - tchunkptr* CP;\ - while ((*(CP = &(R->child[1])) != 0) ||\ - (*(CP = &(R->child[0])) != 0)) {\ - R = *(RP = CP);\ - }\ - if (RTCHECK(ok_address(M, RP)))\ - *RP = 0;\ - else {\ - CORRUPTION_ERROR_ACTION(M);\ - }\ - }\ - }\ - if (XP != 0) {\ - tbinptr* H = treebin_at(M, X->index);\ - if (X == *H) {\ - if ((*H = R) == 0) \ - clear_treemap(M, X->index);\ - }\ - else if (RTCHECK(ok_address(M, XP))) {\ - if (XP->child[0] == X) \ - XP->child[0] = R;\ - else \ - XP->child[1] = R;\ - }\ - else\ - CORRUPTION_ERROR_ACTION(M);\ - if (R != 0) {\ - if (RTCHECK(ok_address(M, R))) {\ - tchunkptr C0, C1;\ - R->parent = XP;\ - if ((C0 = X->child[0]) != 0) {\ - if (RTCHECK(ok_address(M, C0))) {\ - R->child[0] = C0;\ - C0->parent = R;\ - }\ - else\ - CORRUPTION_ERROR_ACTION(M);\ - }\ - if ((C1 = X->child[1]) != 0) {\ - if (RTCHECK(ok_address(M, C1))) {\ - R->child[1] = C1;\ - C1->parent = R;\ - }\ - else\ - CORRUPTION_ERROR_ACTION(M);\ - }\ - }\ - else\ - CORRUPTION_ERROR_ACTION(M);\ - }\ - }\ -} - -/* Relays to large vs small bin operations */ - -#define insert_chunk(M, P, S)\ - if (is_small(S)) insert_small_chunk(M, P, S)\ - else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); } - -#define unlink_chunk(M, P, S)\ - if (is_small(S)) unlink_small_chunk(M, P, S)\ - else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); } - - -/* Relays to internal calls to malloc/free from realloc, memalign etc */ - -#if ONLY_MSPACES -#define internal_malloc(m, b) mspace_malloc(m, b) -#define internal_free(m, mem) mspace_free(m,mem); -#else /* ONLY_MSPACES */ -#if MSPACES -#define internal_malloc(m, b)\ - (m == gm)? dlmalloc(b) : mspace_malloc(m, b) -#define internal_free(m, mem)\ - if (m == gm) dlfree(mem); else mspace_free(m,mem); -#else /* MSPACES */ -#define internal_malloc(m, b) dlmalloc(b) -#define internal_free(m, mem) dlfree(mem) -#endif /* MSPACES */ -#endif /* ONLY_MSPACES */ - -/* ----------------------- Direct-mmapping chunks ----------------------- */ - -/* - Directly mmapped chunks are set up with an offset to the start of - the mmapped region stored in the prev_foot field of the chunk. This - allows reconstruction of the required argument to MUNMAP when freed, - and also allows adjustment of the returned chunk to meet alignment - requirements (especially in memalign). There is also enough space - allocated to hold a fake next chunk of size SIZE_T_SIZE to maintain - the PINUSE bit so frees can be checked. -*/ - -/* Malloc using mmap */ -static void* mmap_alloc(mstate m, size_t nb) { - size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); - if (mmsize > nb) { /* Check for wrap around 0 */ - char* mm = (char*)(DIRECT_MMAP(mmsize)); - if (mm != CMFAIL) { - size_t offset = align_offset(chunk2mem(mm)); - size_t psize = mmsize - offset - MMAP_FOOT_PAD; - mchunkptr p = (mchunkptr)(mm + offset); - p->prev_foot = offset | IS_MMAPPED_BIT; - (p)->head = (psize|CINUSE_BIT); - mark_inuse_foot(m, p, psize); - chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD; - chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0; - - if (mm < m->least_addr) - m->least_addr = mm; - if ((m->footprint += mmsize) > m->max_footprint) - m->max_footprint = m->footprint; - assert(is_aligned(chunk2mem(p))); - check_mmapped_chunk(m, p); - return chunk2mem(p); - } - } - return 0; -} - -/* Realloc using mmap */ -static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) { - size_t oldsize = chunksize(oldp); - if (is_small(nb)) /* Can't shrink mmap regions below small size */ - return 0; - /* Keep old chunk if big enough but not too big */ - if (oldsize >= nb + SIZE_T_SIZE && - (oldsize - nb) <= (mparams.granularity << 1)) - return oldp; - else { - size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT; - size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD; - size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES + - CHUNK_ALIGN_MASK); - char* cp = (char*)CALL_MREMAP((char*)oldp - offset, - oldmmsize, newmmsize, 1); - if (cp != CMFAIL) { - mchunkptr newp = (mchunkptr)(cp + offset); - size_t psize = newmmsize - offset - MMAP_FOOT_PAD; - newp->head = (psize|CINUSE_BIT); - mark_inuse_foot(m, newp, psize); - chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD; - chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0; - - if (cp < m->least_addr) - m->least_addr = cp; - if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint) - m->max_footprint = m->footprint; - check_mmapped_chunk(m, newp); - return newp; - } - } - return 0; -} - -/* -------------------------- mspace management -------------------------- */ - -/* Initialize top chunk and its size */ -static void init_top(mstate m, mchunkptr p, size_t psize) { - /* Ensure alignment */ - size_t offset = align_offset(chunk2mem(p)); - p = (mchunkptr)((char*)p + offset); - psize -= offset; - - m->top = p; - m->topsize = psize; - p->head = psize | PINUSE_BIT; - /* set size of fake trailing chunk holding overhead space only once */ - chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; - m->trim_check = mparams.trim_threshold; /* reset on each update */ -} - -/* Initialize bins for a new mstate that is otherwise zeroed out */ -static void init_bins(mstate m) { - /* Establish circular links for smallbins */ - bindex_t i; - for (i = 0; i < NSMALLBINS; ++i) { - sbinptr bin = smallbin_at(m,i); - bin->fd = bin->bk = bin; - } -} - -#if PROCEED_ON_ERROR - -/* default corruption action */ -static void reset_on_error(mstate m) { - int i; - ++malloc_corruption_error_count; - /* Reinitialize fields to forget about all memory */ - m->smallbins = m->treebins = 0; - m->dvsize = m->topsize = 0; - m->seg.base = 0; - m->seg.size = 0; - m->seg.next = 0; - m->top = m->dv = 0; - for (i = 0; i < NTREEBINS; ++i) - *treebin_at(m, i) = 0; - init_bins(m); -} -#endif /* PROCEED_ON_ERROR */ - -/* Allocate chunk and prepend remainder with chunk in successor base. */ -static void* prepend_alloc(mstate m, char* newbase, char* oldbase, - size_t nb) { - mchunkptr p = align_as_chunk(newbase); - mchunkptr oldfirst = align_as_chunk(oldbase); - size_t psize = (char*)oldfirst - (char*)p; - mchunkptr q = chunk_plus_offset(p, nb); - size_t qsize = psize - nb; - set_size_and_pinuse_of_inuse_chunk(m, p, nb); - - assert((char*)oldfirst > (char*)q); - assert(pinuse(oldfirst)); - assert(qsize >= MIN_CHUNK_SIZE); - - /* consolidate remainder with first chunk of old base */ - if (oldfirst == m->top) { - size_t tsize = m->topsize += qsize; - m->top = q; - q->head = tsize | PINUSE_BIT; - check_top_chunk(m, q); - } - else if (oldfirst == m->dv) { - size_t dsize = m->dvsize += qsize; - m->dv = q; - set_size_and_pinuse_of_free_chunk(q, dsize); - } - else { - if (!cinuse(oldfirst)) { - size_t nsize = chunksize(oldfirst); - unlink_chunk(m, oldfirst, nsize); - oldfirst = chunk_plus_offset(oldfirst, nsize); - qsize += nsize; - } - set_free_with_pinuse(q, qsize, oldfirst); - insert_chunk(m, q, qsize); - check_free_chunk(m, q); - } - - check_malloced_chunk(m, chunk2mem(p), nb); - return chunk2mem(p); -} - - -/* Add a segment to hold a new noncontiguous region */ -static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) { - /* Determine locations and sizes of segment, fenceposts, old top */ - char* old_top = (char*)m->top; - msegmentptr oldsp = segment_holding(m, old_top); - char* old_end = oldsp->base + oldsp->size; - size_t ssize = pad_request(sizeof(struct malloc_segment)); - char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK); - size_t offset = align_offset(chunk2mem(rawsp)); - char* asp = rawsp + offset; - char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp; - mchunkptr sp = (mchunkptr)csp; - msegmentptr ss = (msegmentptr)(chunk2mem(sp)); - mchunkptr tnext = chunk_plus_offset(sp, ssize); - mchunkptr p = tnext; - int nfences = 0; - (void)nfences; // Suppress unused variable warning - - /* reset top to new space */ - init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); - - /* Set up segment record */ - assert(is_aligned(ss)); - set_size_and_pinuse_of_inuse_chunk(m, sp, ssize); - *ss = m->seg; /* Push current record */ - m->seg.base = tbase; - m->seg.size = tsize; - (void)set_segment_flags(&m->seg, mmapped); - m->seg.next = ss; - - /* Insert trailing fenceposts */ - for (;;) { - mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); - p->head = FENCEPOST_HEAD; - ++nfences; - if ((char*)(&(nextp->head)) < old_end) - p = nextp; - else - break; - } - assert(nfences >= 2); - - /* Insert the rest of old top into a bin as an ordinary free chunk */ - if (csp != old_top) { - mchunkptr q = (mchunkptr)old_top; - size_t psize = csp - old_top; - mchunkptr tn = chunk_plus_offset(q, psize); - set_free_with_pinuse(q, psize, tn); - insert_chunk(m, q, psize); - } - - check_top_chunk(m, m->top); -} - -/* -------------------------- System allocation -------------------------- */ - -/* Get memory from system using MORECORE or MMAP */ -static void* sys_alloc(mstate m, size_t nb) { - char* tbase = CMFAIL; - size_t tsize = 0; - flag_t mmap_flag = 0; - - init_mparams(); - - /* Directly map large chunks */ - if (use_mmap(m) && nb >= mparams.mmap_threshold) { - void* mem = mmap_alloc(m, nb); - if (mem != 0) - return mem; - } - - /* - Try getting memory in any of three ways (in most-preferred to - least-preferred order): - 1. A call to MORECORE that can normally contiguously extend memory. - (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or - or main space is mmapped or a previous contiguous call failed) - 2. A call to MMAP new space (disabled if not HAVE_MMAP). - Note that under the default settings, if MORECORE is unable to - fulfill a request, and HAVE_MMAP is true, then mmap is - used as a noncontiguous system allocator. This is a useful backup - strategy for systems with holes in address spaces -- in this case - sbrk cannot contiguously expand the heap, but mmap may be able to - find space. - 3. A call to MORECORE that cannot usually contiguously extend memory. - (disabled if not HAVE_MORECORE) - */ - - if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) { - char* br = CMFAIL; - msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top); - size_t asize = 0; - ACQUIRE_MORECORE_LOCK(); - - if (ss == 0) { /* First time through or recovery */ - char* base = (char*)CALL_MORECORE(0); - if (base != CMFAIL) { - asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE); - /* Adjust to end on a page boundary */ - if (!is_page_aligned(base)) - asize += (page_align((size_t)base) - (size_t)base); - /* Can't call MORECORE if size is negative when treated as signed */ - if (asize < HALF_MAX_SIZE_T && - (br = (char*)(CALL_MORECORE(asize))) == base) { - tbase = base; - tsize = asize; - } - } - } - else { - /* Subtract out existing available top space from MORECORE request. */ - asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + SIZE_T_ONE); - /* Use mem here only if it did continuously extend old space */ - if (asize < HALF_MAX_SIZE_T && - (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) { - tbase = br; - tsize = asize; - } - } - - if (tbase == CMFAIL) { /* Cope with partial failure */ - if (br != CMFAIL) { /* Try to use/extend the space we did get */ - if (asize < HALF_MAX_SIZE_T && - asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) { - size_t esize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE - asize); - if (esize < HALF_MAX_SIZE_T) { - char* end = (char*)CALL_MORECORE(esize); - if (end != CMFAIL) - asize += esize; - else { /* Can't use; try to release */ - (void)CALL_MORECORE(-asize); - br = CMFAIL; - } - } - } - } - if (br != CMFAIL) { /* Use the space we did get */ - tbase = br; - tsize = asize; - } - else - disable_contiguous(m); /* Don't try contiguous path in the future */ - } - - RELEASE_MORECORE_LOCK(); - } - - if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */ - size_t req = nb + TOP_FOOT_SIZE + SIZE_T_ONE; - size_t rsize = granularity_align(req); - if (rsize > nb) { /* Fail if wraps around zero */ - char* mp = (char*)(CALL_MMAP(rsize)); - if (mp != CMFAIL) { - tbase = mp; - tsize = rsize; - mmap_flag = IS_MMAPPED_BIT; - } - } - } - - if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */ - size_t asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE); - if (asize < HALF_MAX_SIZE_T) { - char* br = CMFAIL; - char* end = CMFAIL; - ACQUIRE_MORECORE_LOCK(); - br = (char*)(CALL_MORECORE(asize)); - end = (char*)(CALL_MORECORE(0)); - RELEASE_MORECORE_LOCK(); - if (br != CMFAIL && end != CMFAIL && br < end) { - size_t ssize = end - br; - if (ssize > nb + TOP_FOOT_SIZE) { - tbase = br; - tsize = ssize; - } - } - } - } - - if (tbase != CMFAIL) { - - if ((m->footprint += tsize) > m->max_footprint) - m->max_footprint = m->footprint; - - if (!is_initialized(m)) { /* first-time initialization */ - m->seg.base = m->least_addr = tbase; - m->seg.size = tsize; - (void)set_segment_flags(&m->seg, mmap_flag); - m->magic = mparams.magic; - init_bins(m); - if (is_global(m)) - init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); - else { - /* Offset top by embedded malloc_state */ - mchunkptr mn = next_chunk(mem2chunk(m)); - init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE); - } - } - - else { - /* Try to merge with an existing segment */ - msegmentptr sp = &m->seg; - while (sp != 0 && tbase != sp->base + sp->size) - sp = sp->next; - if (sp != 0 && - !is_extern_segment(sp) && - check_segment_merge(sp, tbase, tsize) && - (get_segment_flags(sp) & IS_MMAPPED_BIT) == mmap_flag && - segment_holds(sp, m->top)) { /* append */ - sp->size += tsize; - init_top(m, m->top, m->topsize + tsize); - } - else { - if (tbase < m->least_addr) - m->least_addr = tbase; - sp = &m->seg; - while (sp != 0 && sp->base != tbase + tsize) - sp = sp->next; - if (sp != 0 && - !is_extern_segment(sp) && - check_segment_merge(sp, tbase, tsize) && - (get_segment_flags(sp) & IS_MMAPPED_BIT) == mmap_flag) { - char* oldbase = sp->base; - sp->base = tbase; - sp->size += tsize; - return prepend_alloc(m, tbase, oldbase, nb); - } - else - add_segment(m, tbase, tsize, mmap_flag); - } - } - - if (nb < m->topsize) { /* Allocate from new or extended top space */ - size_t rsize = m->topsize -= nb; - mchunkptr p = m->top; - mchunkptr r = m->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(m, p, nb); - check_top_chunk(m, m->top); - check_malloced_chunk(m, chunk2mem(p), nb); - return chunk2mem(p); - } - } - - MALLOC_FAILURE_ACTION; - return 0; -} - -/* ----------------------- system deallocation -------------------------- */ - -/* Unmap and unlink any mmapped segments that don't contain used chunks */ -static size_t release_unused_segments(mstate m) { - size_t released = 0; - msegmentptr pred = &m->seg; - msegmentptr sp = pred->next; - while (sp != 0) { - char* base = sp->base; - size_t size = sp->size; - msegmentptr next = sp->next; - if (is_mmapped_segment(sp) && !is_extern_segment(sp)) { - mchunkptr p = align_as_chunk(base); - size_t psize = chunksize(p); - /* Can unmap if first chunk holds entire segment and not pinned */ - if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) { - tchunkptr tp = (tchunkptr)p; - assert(segment_holds(sp, (char*)sp)); - if (p == m->dv) { - m->dv = 0; - m->dvsize = 0; - } - else { - unlink_large_chunk(m, tp); - } - if (CALL_MUNMAP(base, size) == 0) { - released += size; - m->footprint -= size; - /* unlink obsoleted record */ - sp = pred; - sp->next = next; - } - else { /* back out if cannot unmap */ - insert_large_chunk(m, tp, psize); - } - } - } - pred = sp; - sp = next; - } - return released; -} - -static int sys_trim(mstate m, size_t pad) { - size_t released = 0; - if (pad < MAX_REQUEST && is_initialized(m)) { - pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */ - - if (m->topsize > pad) { - /* Shrink top space in granularity-size units, keeping at least one */ - size_t unit = mparams.granularity; - size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit - - SIZE_T_ONE) * unit; - msegmentptr sp = segment_holding(m, (char*)m->top); - - if (!is_extern_segment(sp)) { - if (is_mmapped_segment(sp)) { - if (HAVE_MMAP && - sp->size >= extra && - !has_segment_link(m, sp)) { /* can't shrink if pinned */ - size_t newsize = sp->size - extra; - /* Prefer mremap, fall back to munmap */ - if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) || - (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { - released = extra; - } - } - } - else if (HAVE_MORECORE) { - if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */ - extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit; - ACQUIRE_MORECORE_LOCK(); - { - /* Make sure end of memory is where we last set it. */ - char* old_br = (char*)(CALL_MORECORE(0)); - if (old_br == sp->base + sp->size) { - char* rel_br = (char*)(CALL_MORECORE(-extra)); - char* new_br = (char*)(CALL_MORECORE(0)); - if (rel_br != CMFAIL && new_br < old_br) - released = old_br - new_br; - } - } - RELEASE_MORECORE_LOCK(); - } - } - - if (released != 0) { - sp->size -= released; - m->footprint -= released; - init_top(m, m->top, m->topsize - released); - check_top_chunk(m, m->top); - } - } - - /* Unmap any unused mmapped segments */ - if (HAVE_MMAP) - released += release_unused_segments(m); - - /* On failure, disable autotrim to avoid repeated failed future calls */ - if (released == 0) - m->trim_check = MAX_SIZE_T; - } - - return (released != 0)? 1 : 0; -} - -/* ---------------------------- malloc support --------------------------- */ - -/* allocate a large request from the best fitting chunk in a treebin */ -static void* tmalloc_large(mstate m, size_t nb) { - tchunkptr v = 0; - size_t rsize = -nb; /* Unsigned negation */ - tchunkptr t; - bindex_t idx; - compute_tree_index(nb, idx); - - if ((t = *treebin_at(m, idx)) != 0) { - /* Traverse tree for this bin looking for node with size == nb */ - size_t sizebits = nb << leftshift_for_tree_index(idx); - tchunkptr rst = 0; /* The deepest untaken right subtree */ - for (;;) { - tchunkptr rt; - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - v = t; - if ((rsize = trem) == 0) - break; - } - rt = t->child[1]; - t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; - if (rt != 0 && rt != t) - rst = rt; - if (t == 0) { - t = rst; /* set t to least subtree holding sizes > nb */ - break; - } - sizebits <<= 1; - } - } - - if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */ - binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap; - if (leftbits != 0) { - bindex_t i; - binmap_t leastbit = least_bit(leftbits); - compute_bit2idx(leastbit, i); - t = *treebin_at(m, i); - } - } - - while (t != 0) { /* find smallest of tree or subtree */ - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - rsize = trem; - v = t; - } - t = leftmost_child(t); - } - - /* If dv is a better fit, return 0 so malloc will use it */ - if (v != 0 && rsize < (size_t)(m->dvsize - nb)) { - if (RTCHECK(ok_address(m, v))) { /* split */ - mchunkptr r = chunk_plus_offset(v, nb); - assert(chunksize(v) == rsize + nb); - if (RTCHECK(ok_next(v, r))) { - unlink_large_chunk(m, v); - if (rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(m, v, (rsize + nb)); - else { - set_size_and_pinuse_of_inuse_chunk(m, v, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - insert_chunk(m, r, rsize); - } - return chunk2mem(v); - } - } - CORRUPTION_ERROR_ACTION(m); - } - return 0; -} - -/* allocate a small request from the best fitting chunk in a treebin */ -static void* tmalloc_small(mstate m, size_t nb) { - tchunkptr t, v; - size_t rsize; - bindex_t i; - binmap_t leastbit = least_bit(m->treemap); - compute_bit2idx(leastbit, i); - - v = t = *treebin_at(m, i); - rsize = chunksize(t) - nb; - - while ((t = leftmost_child(t)) != 0) { - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - rsize = trem; - v = t; - } - } - - if (RTCHECK(ok_address(m, v))) { - mchunkptr r = chunk_plus_offset(v, nb); - assert(chunksize(v) == rsize + nb); - if (RTCHECK(ok_next(v, r))) { - unlink_large_chunk(m, v); - if (rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(m, v, (rsize + nb)); - else { - set_size_and_pinuse_of_inuse_chunk(m, v, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(m, r, rsize); - } - return chunk2mem(v); - } - } - - CORRUPTION_ERROR_ACTION(m); - return 0; -} - -/* --------------------------- realloc support --------------------------- */ - -static void* internal_realloc(mstate m, void* oldmem, size_t bytes) { - if (bytes >= MAX_REQUEST) { - MALLOC_FAILURE_ACTION; - return 0; - } - if (!PREACTION(m)) { - mchunkptr oldp = mem2chunk(oldmem); - size_t oldsize = chunksize(oldp); - mchunkptr next = chunk_plus_offset(oldp, oldsize); - mchunkptr newp = 0; - void* extra = 0; - - /* Try to either shrink or extend into top. Else malloc-copy-free */ - - if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) && - ok_next(oldp, next) && ok_pinuse(next))) { - size_t nb = request2size(bytes); - if (is_mmapped(oldp)) - newp = mmap_resize(m, oldp, nb); - else if (oldsize >= nb) { /* already big enough */ - size_t rsize = oldsize - nb; - newp = oldp; - if (rsize >= MIN_CHUNK_SIZE) { - mchunkptr remainder = chunk_plus_offset(newp, nb); - set_inuse(m, newp, nb); - set_inuse(m, remainder, rsize); - extra = chunk2mem(remainder); - } - } - else if (next == m->top && oldsize + m->topsize > nb) { - /* Expand into top */ - size_t newsize = oldsize + m->topsize; - size_t newtopsize = newsize - nb; - mchunkptr newtop = chunk_plus_offset(oldp, nb); - set_inuse(m, oldp, nb); - newtop->head = newtopsize |PINUSE_BIT; - m->top = newtop; - m->topsize = newtopsize; - newp = oldp; - } - } - else { - USAGE_ERROR_ACTION(m, oldmem); - POSTACTION(m); - return 0; - } - - POSTACTION(m); - - if (newp != 0) { - if (extra != 0) { - internal_free(m, extra); - } - check_inuse_chunk(m, newp); - return chunk2mem(newp); - } - else { - void* newmem = internal_malloc(m, bytes); - if (newmem != 0) { - size_t oc = oldsize - overhead_for(oldp); - memcpy(newmem, oldmem, (oc < bytes)? oc : bytes); - internal_free(m, oldmem); - } - return newmem; - } - } - return 0; -} - -/* --------------------------- memalign support -------------------------- */ - -static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { - if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */ - return internal_malloc(m, bytes); - if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ - alignment = MIN_CHUNK_SIZE; - if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */ - size_t a = MALLOC_ALIGNMENT << 1; - while (a < alignment) a <<= 1; - alignment = a; - } - - if (bytes >= MAX_REQUEST - alignment) { - if (m != 0) { /* Test isn't needed but avoids compiler warning */ - MALLOC_FAILURE_ACTION; - } - } - else { - size_t nb = request2size(bytes); - size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD; - char* mem = (char*)internal_malloc(m, req); - if (mem != 0) { - void* leader = 0; - void* trailer = 0; - mchunkptr p = mem2chunk(mem); - - if (PREACTION(m)) return 0; - if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */ - /* - Find an aligned spot inside chunk. Since we need to give - back leading space in a chunk of at least MIN_CHUNK_SIZE, if - the first calculation places us at a spot with less than - MIN_CHUNK_SIZE leader, we can move to the next aligned spot. - We've allocated enough total room so that this is always - possible. - */ - char* br = (char*)mem2chunk((size_t)(((size_t)(mem + - alignment - - SIZE_T_ONE)) & - -alignment)); - char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)? - br : br+alignment; - mchunkptr newp = (mchunkptr)pos; - size_t leadsize = pos - (char*)(p); - size_t newsize = chunksize(p) - leadsize; - - if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */ - newp->prev_foot = p->prev_foot + leadsize; - newp->head = (newsize|CINUSE_BIT); - } - else { /* Otherwise, give back leader, use the rest */ - set_inuse(m, newp, newsize); - set_inuse(m, p, leadsize); - leader = chunk2mem(p); - } - p = newp; - } - - /* Give back spare room at the end */ - if (!is_mmapped(p)) { - size_t size = chunksize(p); - if (size > nb + MIN_CHUNK_SIZE) { - size_t remainder_size = size - nb; - mchunkptr remainder = chunk_plus_offset(p, nb); - set_inuse(m, p, nb); - set_inuse(m, remainder, remainder_size); - trailer = chunk2mem(remainder); - } - } - - assert (chunksize(p) >= nb); - assert((((size_t)(chunk2mem(p))) % alignment) == 0); - check_inuse_chunk(m, p); - POSTACTION(m); - if (leader != 0) { - internal_free(m, leader); - } - if (trailer != 0) { - internal_free(m, trailer); - } - return chunk2mem(p); - } - } - return 0; -} - -/* ------------------------ comalloc/coalloc support --------------------- */ - -static void** ialloc(mstate m, - size_t n_elements, - size_t* sizes, - int opts, - void* chunks[]) { - /* - This provides common support for independent_X routines, handling - all of the combinations that can result. - - The opts arg has: - bit 0 set if all elements are same size (using sizes[0]) - bit 1 set if elements should be zeroed - */ - - size_t element_size; /* chunksize of each element, if all same */ - size_t contents_size; /* total size of elements */ - size_t array_size; /* request size of pointer array */ - void* mem; /* malloced aggregate space */ - mchunkptr p; /* corresponding chunk */ - size_t remainder_size; /* remaining bytes while splitting */ - void** marray; /* either "chunks" or malloced ptr array */ - mchunkptr array_chunk; /* chunk for malloced ptr array */ - flag_t was_enabled; /* to disable mmap */ - size_t size; - size_t i; - - /* compute array length, if needed */ - if (chunks != 0) { - if (n_elements == 0) - return chunks; /* nothing to do */ - marray = chunks; - array_size = 0; - } - else { - /* if empty req, must still return chunk representing empty array */ - if (n_elements == 0) - return (void**)internal_malloc(m, 0); - marray = 0; - array_size = request2size(n_elements * (sizeof(void*))); - } - - /* compute total element size */ - if (opts & 0x1) { /* all-same-size */ - element_size = request2size(*sizes); - contents_size = n_elements * element_size; - } - else { /* add up all the sizes */ - element_size = 0; - contents_size = 0; - for (i = 0; i != n_elements; ++i) - contents_size += request2size(sizes[i]); - } - - size = contents_size + array_size; - - /* - Allocate the aggregate chunk. First disable direct-mmapping so - malloc won't use it, since we would not be able to later - free/realloc space internal to a segregated mmap region. - */ - was_enabled = use_mmap(m); - disable_mmap(m); - mem = internal_malloc(m, size - CHUNK_OVERHEAD); - if (was_enabled) - enable_mmap(m); - if (mem == 0) - return 0; - - if (PREACTION(m)) return 0; - p = mem2chunk(mem); - remainder_size = chunksize(p); - - assert(!is_mmapped(p)); - - if (opts & 0x2) { /* optionally clear the elements */ - memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size); - } - - /* If not provided, allocate the pointer array as final part of chunk */ - if (marray == 0) { - size_t array_chunk_size; - array_chunk = chunk_plus_offset(p, contents_size); - array_chunk_size = remainder_size - contents_size; - marray = (void**) (chunk2mem(array_chunk)); - set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size); - remainder_size = contents_size; - } - - /* split out elements */ - for (i = 0; ; ++i) { - marray[i] = chunk2mem(p); - if (i != n_elements-1) { - if (element_size != 0) - size = element_size; - else - size = request2size(sizes[i]); - remainder_size -= size; - set_size_and_pinuse_of_inuse_chunk(m, p, size); - p = chunk_plus_offset(p, size); - } - else { /* the final element absorbs any overallocation slop */ - set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size); - break; - } - } - -#if DEBUG - if (marray != chunks) { - /* final element must have exactly exhausted chunk */ - if (element_size != 0) { - assert(remainder_size == element_size); - } - else { - assert(remainder_size == request2size(sizes[i])); - } - check_inuse_chunk(m, mem2chunk(marray)); - } - for (i = 0; i != n_elements; ++i) - check_inuse_chunk(m, mem2chunk(marray[i])); - -#endif /* DEBUG */ - - POSTACTION(m); - return marray; -} - - -/* -------------------------- public routines ---------------------------- */ - -#if !ONLY_MSPACES - -void* dlmalloc(size_t bytes) { - /* - Basic algorithm: - If a small request (< 256 bytes minus per-chunk overhead): - 1. If one exists, use a remainderless chunk in associated smallbin. - (Remainderless means that there are too few excess bytes to - represent as a chunk.) - 2. If it is big enough, use the dv chunk, which is normally the - chunk adjacent to the one used for the most recent small request. - 3. If one exists, split the smallest available chunk in a bin, - saving remainder in dv. - 4. If it is big enough, use the top chunk. - 5. If available, get memory from system and use it - Otherwise, for a large request: - 1. Find the smallest available binned chunk that fits, and use it - if it is better fitting than dv chunk, splitting if necessary. - 2. If better fitting than any binned chunk, use the dv chunk. - 3. If it is big enough, use the top chunk. - 4. If request size >= mmap threshold, try to directly mmap this chunk. - 5. If available, get memory from system and use it - - The ugly goto's here ensure that postaction occurs along all paths. - */ - - if (!PREACTION(gm)) { - void* mem; - size_t nb; - if (bytes <= MAX_SMALL_REQUEST) { - bindex_t idx; - binmap_t smallbits; - nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); - idx = small_index(nb); - smallbits = gm->smallmap >> idx; - - if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ - mchunkptr b, p; - idx += ~smallbits & 1; /* Uses next bin if idx empty */ - b = smallbin_at(gm, idx); - p = b->fd; - assert(chunksize(p) == small_index2size(idx)); - unlink_first_small_chunk(gm, b, p, idx); - set_inuse_and_pinuse(gm, p, small_index2size(idx)); - mem = chunk2mem(p); - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - - else if (nb > gm->dvsize) { - if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ - mchunkptr b, p, r; - size_t rsize; - bindex_t i; - binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); - binmap_t leastbit = least_bit(leftbits); - compute_bit2idx(leastbit, i); - b = smallbin_at(gm, i); - p = b->fd; - assert(chunksize(p) == small_index2size(i)); - unlink_first_small_chunk(gm, b, p, i); - rsize = small_index2size(i) - nb; - /* Fit here cannot be remainderless if 4byte sizes */ - if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(gm, p, small_index2size(i)); - else { - set_size_and_pinuse_of_inuse_chunk(gm, p, nb); - r = chunk_plus_offset(p, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(gm, r, rsize); - } - mem = chunk2mem(p); - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - - else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) { - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - } - } - else if (bytes >= MAX_REQUEST) - nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ - else { - nb = pad_request(bytes); - if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) { - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - } - - if (nb <= gm->dvsize) { - size_t rsize = gm->dvsize - nb; - mchunkptr p = gm->dv; - if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ - mchunkptr r = gm->dv = chunk_plus_offset(p, nb); - gm->dvsize = rsize; - set_size_and_pinuse_of_free_chunk(r, rsize); - set_size_and_pinuse_of_inuse_chunk(gm, p, nb); - } - else { /* exhaust dv */ - size_t dvs = gm->dvsize; - gm->dvsize = 0; - gm->dv = 0; - set_inuse_and_pinuse(gm, p, dvs); - } - mem = chunk2mem(p); - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - - else if (nb < gm->topsize) { /* Split top */ - size_t rsize = gm->topsize -= nb; - mchunkptr p = gm->top; - mchunkptr r = gm->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(gm, p, nb); - mem = chunk2mem(p); - check_top_chunk(gm, gm->top); - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - - mem = sys_alloc(gm, nb); - - postaction: - POSTACTION(gm); - return mem; - } - - return 0; -} - -void dlfree(void* mem) { - /* - Consolidate freed chunks with preceding or succeeding bordering - free chunks, if they exist, and then place in a bin. Intermixed - with special cases for top, dv, mmapped chunks, and usage errors. - */ - - if (mem != 0) { - mchunkptr p = mem2chunk(mem); -#if FOOTERS - mstate fm = get_mstate_for(p); - if (!ok_magic(fm)) { - USAGE_ERROR_ACTION(fm, p); - return; - } -#else /* FOOTERS */ -#define fm gm -#endif /* FOOTERS */ - if (!PREACTION(fm)) { - check_inuse_chunk(fm, p); - if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { - size_t psize = chunksize(p); - mchunkptr next = chunk_plus_offset(p, psize); - if (!pinuse(p)) { - size_t prevsize = p->prev_foot; - if ((prevsize & IS_MMAPPED_BIT) != 0) { - prevsize &= ~IS_MMAPPED_BIT; - psize += prevsize + MMAP_FOOT_PAD; - if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) - fm->footprint -= psize; - goto postaction; - } - else { - mchunkptr prev = chunk_minus_offset(p, prevsize); - psize += prevsize; - p = prev; - if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ - if (p != fm->dv) { - unlink_chunk(fm, p, prevsize); - } - else if ((next->head & INUSE_BITS) == INUSE_BITS) { - fm->dvsize = psize; - set_free_with_pinuse(p, psize, next); - goto postaction; - } - } - else - goto erroraction; - } - } - - if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { - if (!cinuse(next)) { /* consolidate forward */ - if (next == fm->top) { - size_t tsize = fm->topsize += psize; - fm->top = p; - p->head = tsize | PINUSE_BIT; - if (p == fm->dv) { - fm->dv = 0; - fm->dvsize = 0; - } - if (should_trim(fm, tsize)) - sys_trim(fm, 0); - goto postaction; - } - else if (next == fm->dv) { - size_t dsize = fm->dvsize += psize; - fm->dv = p; - set_size_and_pinuse_of_free_chunk(p, dsize); - goto postaction; - } - else { - size_t nsize = chunksize(next); - psize += nsize; - unlink_chunk(fm, next, nsize); - set_size_and_pinuse_of_free_chunk(p, psize); - if (p == fm->dv) { - fm->dvsize = psize; - goto postaction; - } - } - } - else - set_free_with_pinuse(p, psize, next); - insert_chunk(fm, p, psize); - check_free_chunk(fm, p); - goto postaction; - } - } - erroraction: - USAGE_ERROR_ACTION(fm, p); - postaction: - POSTACTION(fm); - } - } -#if !FOOTERS -#undef fm -#endif /* FOOTERS */ -} - -void* dlcalloc(size_t n_elements, size_t elem_size) { - void* mem; - size_t req = 0; - if (n_elements != 0) { - req = n_elements * elem_size; - if (((n_elements | elem_size) & ~(size_t)0xffff) && - (req / n_elements != elem_size)) - req = MAX_SIZE_T; /* force downstream failure on overflow */ - } - mem = dlmalloc(req); - if (mem != 0 && calloc_must_clear(mem2chunk(mem))) - memset(mem, 0, req); - return mem; -} - -void* dlrealloc(void* oldmem, size_t bytes) { - if (oldmem == 0) - return dlmalloc(bytes); -#ifdef REALLOC_ZERO_BYTES_FREES - if (bytes == 0) { - dlfree(oldmem); - return 0; - } -#endif /* REALLOC_ZERO_BYTES_FREES */ - else { -#if ! FOOTERS - mstate m = gm; -#else /* FOOTERS */ - mstate m = get_mstate_for(mem2chunk(oldmem)); - if (!ok_magic(m)) { - USAGE_ERROR_ACTION(m, oldmem); - return 0; - } -#endif /* FOOTERS */ - return internal_realloc(m, oldmem, bytes); - } -} - -void* dlmemalign(size_t alignment, size_t bytes) { - return internal_memalign(gm, alignment, bytes); -} - -void** dlindependent_calloc(size_t n_elements, size_t elem_size, - void* chunks[]) { - size_t sz = elem_size; /* serves as 1-element array */ - return ialloc(gm, n_elements, &sz, 3, chunks); -} - -void** dlindependent_comalloc(size_t n_elements, size_t sizes[], - void* chunks[]) { - return ialloc(gm, n_elements, sizes, 0, chunks); -} - -void* dlvalloc(size_t bytes) { - size_t pagesz; - init_mparams(); - pagesz = mparams.page_size; - return dlmemalign(pagesz, bytes); -} - -void* dlpvalloc(size_t bytes) { - size_t pagesz; - init_mparams(); - pagesz = mparams.page_size; - return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE)); -} - -int dlmalloc_trim(size_t pad) { - int result = 0; - if (!PREACTION(gm)) { - result = sys_trim(gm, pad); - POSTACTION(gm); - } - return result; -} - -size_t dlmalloc_footprint(void) { - return gm->footprint; -} - -size_t dlmalloc_max_footprint(void) { - return gm->max_footprint; -} - -#if !NO_MALLINFO -struct mallinfo dlmallinfo(void) { - return internal_mallinfo(gm); -} -#endif /* NO_MALLINFO */ - -void dlmalloc_stats(void) { - internal_malloc_stats(gm); -} - -size_t dlmalloc_usable_size(void* mem) { - if (mem != 0) { - mchunkptr p = mem2chunk(mem); - if (cinuse(p)) - return chunksize(p) - overhead_for(p); - } - return 0; -} - -int dlmallopt(int param_number, int value) { - return change_mparam(param_number, value); -} - -#endif /* !ONLY_MSPACES */ - -/* ----------------------------- user mspaces ---------------------------- */ - -#if MSPACES - -static mstate init_user_mstate(char* tbase, size_t tsize) { - size_t msize = pad_request(sizeof(struct malloc_state)); - mchunkptr mn; - mchunkptr msp = align_as_chunk(tbase); - mstate m = (mstate)(chunk2mem(msp)); - memset(m, 0, msize); - INITIAL_LOCK(&m->mutex); - msp->head = (msize|PINUSE_BIT|CINUSE_BIT); - m->seg.base = m->least_addr = tbase; - m->seg.size = m->footprint = m->max_footprint = tsize; - m->magic = mparams.magic; - m->mflags = mparams.default_mflags; - disable_contiguous(m); - init_bins(m); - mn = next_chunk(mem2chunk(m)); - init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE); - check_top_chunk(m, m->top); - return m; -} - -mspace create_mspace(size_t capacity, int locked) { - mstate m = 0; - size_t msize = pad_request(sizeof(struct malloc_state)); - init_mparams(); /* Ensure pagesize etc initialized */ - - if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { - size_t rs = ((capacity == 0)? mparams.granularity : - (capacity + TOP_FOOT_SIZE + msize)); - size_t tsize = granularity_align(rs); - char* tbase = (char*)(CALL_MMAP(tsize)); - if (tbase != CMFAIL) { - m = init_user_mstate(tbase, tsize); - set_segment_flags(&m->seg, IS_MMAPPED_BIT); - set_lock(m, locked); - } - } - return (mspace)m; -} - -mspace create_mspace_with_base(void* base, size_t capacity, int locked) { - mstate m = 0; - size_t msize = pad_request(sizeof(struct malloc_state)); - init_mparams(); /* Ensure pagesize etc initialized */ - - if (capacity > msize + TOP_FOOT_SIZE && - capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { - m = init_user_mstate((char*)base, capacity); - set_segment_flags(&m->seg, EXTERN_BIT); - set_lock(m, locked); - } - return (mspace)m; -} - -size_t destroy_mspace(mspace msp) { - size_t freed = 0; - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - msegmentptr sp = &ms->seg; - while (sp != 0) { - char* base = sp->base; - size_t size = sp->size; - flag_t flag = get_segment_flags(sp); - sp = sp->next; - if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) && - CALL_MUNMAP(base, size) == 0) - freed += size; - } - } - else { - USAGE_ERROR_ACTION(ms,ms); - } - return freed; -} - -/* - mspace versions of routines are near-clones of the global - versions. This is not so nice but better than the alternatives. -*/ - - -void* mspace_malloc(mspace msp, size_t bytes) { - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - if (!PREACTION(ms)) { - void* mem; - size_t nb; - if (bytes <= MAX_SMALL_REQUEST) { - bindex_t idx; - binmap_t smallbits; - nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); - idx = small_index(nb); - smallbits = ms->smallmap >> idx; - - if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ - mchunkptr b, p; - idx += ~smallbits & 1; /* Uses next bin if idx empty */ - b = smallbin_at(ms, idx); - p = b->fd; - assert(chunksize(p) == small_index2size(idx)); - unlink_first_small_chunk(ms, b, p, idx); - set_inuse_and_pinuse(ms, p, small_index2size(idx)); - mem = chunk2mem(p); - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - - else if (nb > ms->dvsize) { - if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ - mchunkptr b, p, r; - size_t rsize; - bindex_t i; - binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); - binmap_t leastbit = least_bit(leftbits); - compute_bit2idx(leastbit, i); - b = smallbin_at(ms, i); - p = b->fd; - assert(chunksize(p) == small_index2size(i)); - unlink_first_small_chunk(ms, b, p, i); - rsize = small_index2size(i) - nb; - /* Fit here cannot be remainderless if 4byte sizes */ - if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(ms, p, small_index2size(i)); - else { - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - r = chunk_plus_offset(p, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(ms, r, rsize); - } - mem = chunk2mem(p); - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - - else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) { - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - } - } - else if (bytes >= MAX_REQUEST) - nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ - else { - nb = pad_request(bytes); - if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - } - - if (nb <= ms->dvsize) { - size_t rsize = ms->dvsize - nb; - mchunkptr p = ms->dv; - if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ - mchunkptr r = ms->dv = chunk_plus_offset(p, nb); - ms->dvsize = rsize; - set_size_and_pinuse_of_free_chunk(r, rsize); - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - } - else { /* exhaust dv */ - size_t dvs = ms->dvsize; - ms->dvsize = 0; - ms->dv = 0; - set_inuse_and_pinuse(ms, p, dvs); - } - mem = chunk2mem(p); - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - - else if (nb < ms->topsize) { /* Split top */ - size_t rsize = ms->topsize -= nb; - mchunkptr p = ms->top; - mchunkptr r = ms->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - mem = chunk2mem(p); - check_top_chunk(ms, ms->top); - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - - mem = sys_alloc(ms, nb); - - postaction: - POSTACTION(ms); - return mem; - } - - return 0; -} - -void mspace_free(mspace msp, void* mem) { - if (mem != 0) { - mchunkptr p = mem2chunk(mem); -#if FOOTERS - mstate fm = get_mstate_for(p); -#else /* FOOTERS */ - mstate fm = (mstate)msp; -#endif /* FOOTERS */ - if (!ok_magic(fm)) { - USAGE_ERROR_ACTION(fm, p); - return; - } - if (!PREACTION(fm)) { - check_inuse_chunk(fm, p); - if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { - size_t psize = chunksize(p); - mchunkptr next = chunk_plus_offset(p, psize); - if (!pinuse(p)) { - size_t prevsize = p->prev_foot; - if ((prevsize & IS_MMAPPED_BIT) != 0) { - prevsize &= ~IS_MMAPPED_BIT; - psize += prevsize + MMAP_FOOT_PAD; - if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) - fm->footprint -= psize; - goto postaction; - } - else { - mchunkptr prev = chunk_minus_offset(p, prevsize); - psize += prevsize; - p = prev; - if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ - if (p != fm->dv) { - unlink_chunk(fm, p, prevsize); - } - else if ((next->head & INUSE_BITS) == INUSE_BITS) { - fm->dvsize = psize; - set_free_with_pinuse(p, psize, next); - goto postaction; - } - } - else - goto erroraction; - } - } - - if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { - if (!cinuse(next)) { /* consolidate forward */ - if (next == fm->top) { - size_t tsize = fm->topsize += psize; - fm->top = p; - p->head = tsize | PINUSE_BIT; - if (p == fm->dv) { - fm->dv = 0; - fm->dvsize = 0; - } - if (should_trim(fm, tsize)) - sys_trim(fm, 0); - goto postaction; - } - else if (next == fm->dv) { - size_t dsize = fm->dvsize += psize; - fm->dv = p; - set_size_and_pinuse_of_free_chunk(p, dsize); - goto postaction; - } - else { - size_t nsize = chunksize(next); - psize += nsize; - unlink_chunk(fm, next, nsize); - set_size_and_pinuse_of_free_chunk(p, psize); - if (p == fm->dv) { - fm->dvsize = psize; - goto postaction; - } - } - } - else - set_free_with_pinuse(p, psize, next); - insert_chunk(fm, p, psize); - check_free_chunk(fm, p); - goto postaction; - } - } - erroraction: - USAGE_ERROR_ACTION(fm, p); - postaction: - POSTACTION(fm); - } - } -} - -void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) { - void* mem; - size_t req = 0; - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - if (n_elements != 0) { - req = n_elements * elem_size; - if (((n_elements | elem_size) & ~(size_t)0xffff) && - (req / n_elements != elem_size)) - req = MAX_SIZE_T; /* force downstream failure on overflow */ - } - mem = internal_malloc(ms, req); - if (mem != 0 && calloc_must_clear(mem2chunk(mem))) - memset(mem, 0, req); - return mem; -} - -void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) { - if (oldmem == 0) - return mspace_malloc(msp, bytes); -#ifdef REALLOC_ZERO_BYTES_FREES - if (bytes == 0) { - mspace_free(msp, oldmem); - return 0; - } -#endif /* REALLOC_ZERO_BYTES_FREES */ - else { -#if FOOTERS - mchunkptr p = mem2chunk(oldmem); - mstate ms = get_mstate_for(p); -#else /* FOOTERS */ - mstate ms = (mstate)msp; -#endif /* FOOTERS */ - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - return internal_realloc(ms, oldmem, bytes); - } -} - -void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) { - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - return internal_memalign(ms, alignment, bytes); -} - -void** mspace_independent_calloc(mspace msp, size_t n_elements, - size_t elem_size, void* chunks[]) { - size_t sz = elem_size; /* serves as 1-element array */ - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - return ialloc(ms, n_elements, &sz, 3, chunks); -} - -void** mspace_independent_comalloc(mspace msp, size_t n_elements, - size_t sizes[], void* chunks[]) { - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - return ialloc(ms, n_elements, sizes, 0, chunks); -} - -int mspace_trim(mspace msp, size_t pad) { - int result = 0; - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - if (!PREACTION(ms)) { - result = sys_trim(ms, pad); - POSTACTION(ms); - } - } - else { - USAGE_ERROR_ACTION(ms,ms); - } - return result; -} - -void mspace_malloc_stats(mspace msp) { - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - internal_malloc_stats(ms); - } - else { - USAGE_ERROR_ACTION(ms,ms); - } -} - -size_t mspace_footprint(mspace msp) { - size_t result; - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - result = ms->footprint; - } - USAGE_ERROR_ACTION(ms,ms); - return result; -} - - -size_t mspace_max_footprint(mspace msp) { - size_t result; - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - result = ms->max_footprint; - } - USAGE_ERROR_ACTION(ms,ms); - return result; -} - - -#if !NO_MALLINFO -struct mallinfo mspace_mallinfo(mspace msp) { - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - } - return internal_mallinfo(ms); -} -#endif /* NO_MALLINFO */ - -int mspace_mallopt(int param_number, int value) { - return change_mparam(param_number, value); -} - -#endif /* MSPACES */ - -/* -------------------- Alternative MORECORE functions ------------------- */ - -/* - Guidelines for creating a custom version of MORECORE: - - * For best performance, MORECORE should allocate in multiples of pagesize. - * MORECORE may allocate more memory than requested. (Or even less, - but this will usually result in a malloc failure.) - * MORECORE must not allocate memory when given argument zero, but - instead return one past the end address of memory from previous - nonzero call. - * For best performance, consecutive calls to MORECORE with positive - arguments should return increasing addresses, indicating that - space has been contiguously extended. - * Even though consecutive calls to MORECORE need not return contiguous - addresses, it must be OK for malloc'ed chunks to span multiple - regions in those cases where they do happen to be contiguous. - * MORECORE need not handle negative arguments -- it may instead - just return MFAIL when given negative arguments. - Negative arguments are always multiples of pagesize. MORECORE - must not misinterpret negative args as large positive unsigned - args. You can suppress all such calls from even occurring by defining - MORECORE_CANNOT_TRIM, - - As an example alternative MORECORE, here is a custom allocator - kindly contributed for pre-OSX macOS. It uses virtually but not - necessarily physically contiguous non-paged memory (locked in, - present and won't get swapped out). You can use it by uncommenting - this section, adding some #includes, and setting up the appropriate - defines above: - - #define MORECORE osMoreCore - - There is also a shutdown routine that should somehow be called for - cleanup upon program exit. - - #define MAX_POOL_ENTRIES 100 - #define MINIMUM_MORECORE_SIZE (64 * 1024U) - static int next_os_pool; - void *our_os_pools[MAX_POOL_ENTRIES]; - - void *osMoreCore(int size) - { - void *ptr = 0; - static void *sbrk_top = 0; - - if (size > 0) - { - if (size < MINIMUM_MORECORE_SIZE) - size = MINIMUM_MORECORE_SIZE; - if (CurrentExecutionLevel() == kTaskLevel) - ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0); - if (ptr == 0) - { - return (void *) MFAIL; - } - // save ptrs so they can be freed during cleanup - our_os_pools[next_os_pool] = ptr; - next_os_pool++; - ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK); - sbrk_top = (char *) ptr + size; - return ptr; - } - else if (size < 0) - { - // we don't currently support shrink behavior - return (void *) MFAIL; - } - else - { - return sbrk_top; - } - } - - // cleanup any allocated memory pools - // called as last thing before shutting down driver - - void osCleanupMem(void) - { - void **ptr; - - for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++) - if (*ptr) - { - PoolDeallocate(*ptr); - *ptr = 0; - } - } - -*/ - - -/* ----------------------------------------------------------------------- -History: - V2.8.3 Thu Sep 22 11:16:32 2005 Doug Lea (dl at gee) - * Add max_footprint functions - * Ensure all appropriate literals are size_t - * Fix conditional compilation problem for some #define settings - * Avoid concatenating segments with the one provided - in create_mspace_with_base - * Rename some variables to avoid compiler shadowing warnings - * Use explicit lock initialization. - * Better handling of sbrk interference. - * Simplify and fix segment insertion, trimming and mspace_destroy - * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x - * Thanks especially to Dennis Flanagan for help on these. - - V2.8.2 Sun Jun 12 16:01:10 2005 Doug Lea (dl at gee) - * Fix memalign brace error. - - V2.8.1 Wed Jun 8 16:11:46 2005 Doug Lea (dl at gee) - * Fix improper #endif nesting in C++ - * Add explicit casts needed for C++ - - V2.8.0 Mon May 30 14:09:02 2005 Doug Lea (dl at gee) - * Use trees for large bins - * Support mspaces - * Use segments to unify sbrk-based and mmap-based system allocation, - removing need for emulation on most platforms without sbrk. - * Default safety checks - * Optional footer checks. Thanks to William Robertson for the idea. - * Internal code refactoring - * Incorporate suggestions and platform-specific changes. - Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas, - Aaron Bachmann, Emery Berger, and others. - * Speed up non-fastbin processing enough to remove fastbins. - * Remove useless cfree() to avoid conflicts with other apps. - * Remove internal memcpy, memset. Compilers handle builtins better. - * Remove some options that no one ever used and rename others. - - V2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee) - * Fix malloc_state bitmap array misdeclaration - - V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee) - * Allow tuning of FIRST_SORTED_BIN_SIZE - * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte. - * Better detection and support for non-contiguousness of MORECORE. - Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger - * Bypass most of malloc if no frees. Thanks To Emery Berger. - * Fix freeing of old top non-contiguous chunk im sysmalloc. - * Raised default trim and map thresholds to 256K. - * Fix mmap-related #defines. Thanks to Lubos Lunak. - * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield. - * Branch-free bin calculation - * Default trim and mmap thresholds now 256K. - - V2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee) - * Introduce independent_comalloc and independent_calloc. - Thanks to Michael Pachos for motivation and help. - * Make optional .h file available - * Allow > 2GB requests on 32bit systems. - * new WIN32 sbrk, mmap, munmap, lock code from . - Thanks also to Andreas Mueller , - and Anonymous. - * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for - helping test this.) - * memalign: check alignment arg - * realloc: don't try to shift chunks backwards, since this - leads to more fragmentation in some programs and doesn't - seem to help in any others. - * Collect all cases in malloc requiring system memory into sysmalloc - * Use mmap as backup to sbrk - * Place all internal state in malloc_state - * Introduce fastbins (although similar to 2.5.1) - * Many minor tunings and cosmetic improvements - * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK - * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS - Thanks to Tony E. Bennett and others. - * Include errno.h to support default failure action. - - V2.6.6 Sun Dec 5 07:42:19 1999 Doug Lea (dl at gee) - * return null for negative arguments - * Added Several WIN32 cleanups from Martin C. Fong - * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h' - (e.g. WIN32 platforms) - * Cleanup header file inclusion for WIN32 platforms - * Cleanup code to avoid Microsoft Visual C++ compiler complaints - * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing - memory allocation routines - * Set 'malloc_getpagesize' for WIN32 platforms (needs more work) - * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to - usage of 'assert' in non-WIN32 code - * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to - avoid infinite loop - * Always call 'fREe()' rather than 'free()' - - V2.6.5 Wed Jun 17 15:57:31 1998 Doug Lea (dl at gee) - * Fixed ordering problem with boundary-stamping - - V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee) - * Added pvalloc, as recommended by H.J. Liu - * Added 64bit pointer support mainly from Wolfram Gloger - * Added anonymously donated WIN32 sbrk emulation - * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen - * malloc_extend_top: fix mask error that caused wastage after - foreign sbrks - * Add linux mremap support code from HJ Liu - - V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee) - * Integrated most documentation with the code. - * Add support for mmap, with help from - Wolfram Gloger (Gloger@lrz.uni-muenchen.de). - * Use last_remainder in more cases. - * Pack bins using idea from colin@nyx10.cs.du.edu - * Use ordered bins instead of best-fit threshold - * Eliminate block-local decls to simplify tracing and debugging. - * Support another case of realloc via move into top - * Fix error occurring when initial sbrk_base not word-aligned. - * Rely on page size for units instead of SBRK_UNIT to - avoid surprises about sbrk alignment conventions. - * Add mallinfo, mallopt. Thanks to Raymond Nijssen - (raymond@es.ele.tue.nl) for the suggestion. - * Add `pad' argument to malloc_trim and top_pad mallopt parameter. - * More precautions for cases where other routines call sbrk, - courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de). - * Added macros etc., allowing use in linux libc from - H.J. Lu (hjl@gnu.ai.mit.edu) - * Inverted this history list - - V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee) - * Re-tuned and fixed to behave more nicely with V2.6.0 changes. - * Removed all preallocation code since under current scheme - the work required to undo bad preallocations exceeds - the work saved in good cases for most test programs. - * No longer use return list or unconsolidated bins since - no scheme using them consistently outperforms those that don't - given above changes. - * Use best fit for very large chunks to prevent some worst-cases. - * Added some support for debugging - - V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee) - * Removed footers when chunks are in use. Thanks to - Paul Wilson (wilson@cs.texas.edu) for the suggestion. - - V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee) - * Added malloc_trim, with help from Wolfram Gloger - (wmglo@Dent.MED.Uni-Muenchen.DE). - - V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g) - - V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g) - * realloc: try to expand in both directions - * malloc: swap order of clean-bin strategy; - * realloc: only conditionally expand backwards - * Try not to scavenge used bins - * Use bin counts as a guide to preallocation - * Occasionally bin return list chunks in first scan - * Add a few optimizations from colin@nyx10.cs.du.edu - - V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g) - * faster bin computation & slightly different binning - * merged all consolidations to one part of malloc proper - (eliminating old malloc_find_space & malloc_clean_bin) - * Scan 2 returns chunks (not just 1) - * Propagate failure in realloc if malloc returns 0 - * Add stuff to allow compilation on non-ANSI compilers - from kpv@research.att.com - - V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu) - * removed potential for odd address access in prev_chunk - * removed dependency on getpagesize.h - * misc cosmetics and a bit more internal documentation - * anticosmetics: mangled names in macros to evade debugger strangeness - * tested on sparc, hp-700, dec-mips, rs6000 - with gcc & native cc (hp, dec only) allowing - Detlefs & Zorn comparison study (in SIGPLAN Notices.) - - Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu) - * Based loosely on libg++-1.2X malloc. (It retains some of the overall - structure of old version, but most details differ.) - -*/ diff --git a/deps/libffi/src/frv/eabi.S b/deps/libffi/src/frv/eabi.S deleted file mode 100644 index 379ea4bb0a743d..00000000000000 --- a/deps/libffi/src/frv/eabi.S +++ /dev/null @@ -1,128 +0,0 @@ -/* ----------------------------------------------------------------------- - eabi.S - Copyright (c) 2004 Anthony Green - - FR-V Assembly glue. - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - - .globl ffi_prep_args_EABI - - .text - .p2align 4 - .globl ffi_call_EABI - .type ffi_call_EABI, @function - - # gr8 : ffi_prep_args - # gr9 : &ecif - # gr10: cif->bytes - # gr11: fig->flags - # gr12: ecif.rvalue - # gr13: fn - -ffi_call_EABI: - addi sp, #-80, sp - sti fp, @(sp, #24) - addi sp, #24, fp - movsg lr, gr5 - - /* Make room for the new arguments. */ - /* subi sp, fp, gr10 */ - - /* Store return address and incoming args on stack. */ - sti gr5, @(fp, #8) - sti gr8, @(fp, #-4) - sti gr9, @(fp, #-8) - sti gr10, @(fp, #-12) - sti gr11, @(fp, #-16) - sti gr12, @(fp, #-20) - sti gr13, @(fp, #-24) - - sub sp, gr10, sp - - /* Call ffi_prep_args. */ - ldi @(fp, #-4), gr4 - addi sp, #0, gr8 - ldi @(fp, #-8), gr9 -#ifdef __FRV_FDPIC__ - ldd @(gr4, gr0), gr14 - calll @(gr14, gr0) -#else - calll @(gr4, gr0) -#endif - - /* ffi_prep_args returns the new stack pointer. */ - mov gr8, gr4 - - ldi @(sp, #0), gr8 - ldi @(sp, #4), gr9 - ldi @(sp, #8), gr10 - ldi @(sp, #12), gr11 - ldi @(sp, #16), gr12 - ldi @(sp, #20), gr13 - - /* Always copy the return value pointer into the hidden - parameter register. This is only strictly necessary - when we're returning an aggregate type, but it doesn't - hurt to do this all the time, and it saves a branch. */ - ldi @(fp, #-20), gr3 - - /* Use the ffi_prep_args return value for the new sp. */ - mov gr4, sp - - /* Call the target function. */ - ldi @(fp, -24), gr4 -#ifdef __FRV_FDPIC__ - ldd @(gr4, gr0), gr14 - calll @(gr14, gr0) -#else - calll @(gr4, gr0) -#endif - - /* Store the result. */ - ldi @(fp, #-16), gr10 /* fig->flags */ - ldi @(fp, #-20), gr4 /* ecif.rvalue */ - - /* Is the return value stored in two registers? */ - cmpi gr10, #8, icc0 - bne icc0, 0, .L2 - /* Yes, save them. */ - sti gr8, @(gr4, #0) - sti gr9, @(gr4, #4) - bra .L3 -.L2: - /* Is the return value a structure? */ - cmpi gr10, #-1, icc0 - beq icc0, 0, .L3 - /* No, save a 4 byte return value. */ - sti gr8, @(gr4, #0) -.L3: - - /* Restore the stack, and return. */ - ldi @(fp, 8), gr5 - ld @(fp, gr0), fp - addi sp,#80,sp - jmpl @(gr5,gr0) - .size ffi_call_EABI, .-ffi_call_EABI - diff --git a/deps/libffi/src/frv/ffi.c b/deps/libffi/src/frv/ffi.c deleted file mode 100644 index ed1c65a1a362b0..00000000000000 --- a/deps/libffi/src/frv/ffi.c +++ /dev/null @@ -1,292 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (C) 2004 Anthony Green - Copyright (C) 2007 Free Software Foundation, Inc. - Copyright (C) 2008 Red Hat, Inc. - - FR-V Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - -void *ffi_prep_args(char *stack, extended_cif *ecif) -{ - register unsigned int i; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - register int count = 0; - - p_argv = ecif->avalue; - argp = stack; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; - (i != 0); - i--, p_arg++) - { - size_t z; - - z = (*p_arg)->size; - - if ((*p_arg)->type == FFI_TYPE_STRUCT) - { - z = sizeof(void*); - *(void **) argp = *p_argv; - } - /* if ((*p_arg)->type == FFI_TYPE_FLOAT) - { - if (count > 24) - { - // This is going on the stack. Turn it into a double. - *(double *) argp = (double) *(float*)(* p_argv); - z = sizeof(double); - } - else - *(void **) argp = *(void **)(* p_argv); - } */ - else if (z < sizeof(int)) - { - z = sizeof(int); - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); - break; - - default: - FFI_ASSERT(0); - } - } - else if (z == sizeof(int)) - { - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - } - else - { - memcpy(argp, *p_argv, z); - } - p_argv++; - argp += z; - count += z; - } - - return (stack + ((count > 24) ? 24 : FFI_ALIGN_DOWN(count, 8))); -} - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - if (cif->rtype->type == FFI_TYPE_STRUCT) - cif->flags = -1; - else - cif->flags = cif->rtype->size; - - cif->bytes = FFI_ALIGN (cif->bytes, 8); - - return FFI_OK; -} - -extern void ffi_call_EABI(void *(*)(char *, extended_cif *), - extended_cif *, - unsigned, unsigned, - unsigned *, - void (*fn)(void)); - -void ffi_call(ffi_cif *cif, - void (*fn)(void), - void *rvalue, - void **avalue) -{ - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return */ - /* value address then we need to make one */ - - if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) - { - ecif.rvalue = alloca(cif->rtype->size); - } - else - ecif.rvalue = rvalue; - - - switch (cif->abi) - { - case FFI_EABI: - ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - break; - default: - FFI_ASSERT(0); - break; - } -} - -void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3, - unsigned arg4, unsigned arg5, unsigned arg6) -{ - /* This function is called by a trampoline. The trampoline stows a - pointer to the ffi_closure object in gr7. We must save this - pointer in a place that will persist while we do our work. */ - register ffi_closure *creg __asm__ ("gr7"); - ffi_closure *closure = creg; - - /* Arguments that don't fit in registers are found on the stack - at a fixed offset above the current frame pointer. */ - register char *frame_pointer __asm__ ("fp"); - char *stack_args = frame_pointer + 16; - - /* Lay the register arguments down in a continuous chunk of memory. */ - unsigned register_args[6] = - { arg1, arg2, arg3, arg4, arg5, arg6 }; - - ffi_cif *cif = closure->cif; - ffi_type **arg_types = cif->arg_types; - void **avalue = alloca (cif->nargs * sizeof(void *)); - char *ptr = (char *) register_args; - int i; - - /* Find the address of each argument. */ - for (i = 0; i < cif->nargs; i++) - { - switch (arg_types[i]->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - avalue[i] = ptr + 3; - break; - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - avalue[i] = ptr + 2; - break; - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_FLOAT: - avalue[i] = ptr; - break; - case FFI_TYPE_STRUCT: - avalue[i] = *(void**)ptr; - break; - default: - /* This is an 8-byte value. */ - avalue[i] = ptr; - ptr += 4; - break; - } - ptr += 4; - - /* If we've handled more arguments than fit in registers, - start looking at the those passed on the stack. */ - if (ptr == ((char *)register_args + (6*4))) - ptr = stack_args; - } - - /* Invoke the closure. */ - if (cif->rtype->type == FFI_TYPE_STRUCT) - { - /* The caller allocates space for the return structure, and - passes a pointer to this space in gr3. Use this value directly - as the return value. */ - register void *return_struct_ptr __asm__("gr3"); - (closure->fun) (cif, return_struct_ptr, avalue, closure->user_data); - } - else - { - /* Allocate space for the return value and call the function. */ - long long rvalue; - (closure->fun) (cif, &rvalue, avalue, closure->user_data); - - /* Functions return 4-byte or smaller results in gr8. 8-byte - values also use gr9. We fill the both, even for small return - values, just to avoid a branch. */ - asm ("ldi @(%0, #0), gr8" : : "r" (&rvalue)); - asm ("ldi @(%0, #0), gr9" : : "r" (&((int *) &rvalue)[1])); - } -} - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - unsigned int *tramp = (unsigned int *) &closure->tramp[0]; - unsigned long fn = (long) ffi_closure_eabi; - unsigned long cls = (long) codeloc; -#ifdef __FRV_FDPIC__ - register void *got __asm__("gr15"); -#endif - int i; - - fn = (unsigned long) ffi_closure_eabi; - -#ifdef __FRV_FDPIC__ - tramp[0] = &((unsigned int *)codeloc)[2]; - tramp[1] = got; - tramp[2] = 0x8cfc0000 + (fn & 0xffff); /* setlos lo(fn), gr6 */ - tramp[3] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7 */ - tramp[4] = 0x8cf80000 + (fn >> 16); /* sethi hi(fn), gr6 */ - tramp[5] = 0x8ef80000 + (cls >> 16); /* sethi hi(cls), gr7 */ - tramp[6] = 0x9cc86000; /* ldi @(gr6, #0), gr14 */ - tramp[7] = 0x8030e000; /* jmpl @(gr14, gr0) */ -#else - tramp[0] = 0x8cfc0000 + (fn & 0xffff); /* setlos lo(fn), gr6 */ - tramp[1] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7 */ - tramp[2] = 0x8cf80000 + (fn >> 16); /* sethi hi(fn), gr6 */ - tramp[3] = 0x8ef80000 + (cls >> 16); /* sethi hi(cls), gr7 */ - tramp[4] = 0x80300006; /* jmpl @(gr0, gr6) */ -#endif - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - /* Cache flushing. */ - for (i = 0; i < FFI_TRAMPOLINE_SIZE; i++) - __asm__ volatile ("dcf @(%0,%1)\n\tici @(%2,%1)" :: "r" (tramp), "r" (i), - "r" (codeloc)); - - return FFI_OK; -} diff --git a/deps/libffi/src/frv/ffitarget.h b/deps/libffi/src/frv/ffitarget.h deleted file mode 100644 index d42540e53d3ad6..00000000000000 --- a/deps/libffi/src/frv/ffitarget.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2004 Red Hat, Inc. - Target configuration macros for FR-V - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- System specific configurations ----------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_EABI, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_EABI -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 - -#ifdef __FRV_FDPIC__ -/* Trampolines are 8 4-byte instructions long. */ -#define FFI_TRAMPOLINE_SIZE (8*4) -#else -/* Trampolines are 5 4-byte instructions long. */ -#define FFI_TRAMPOLINE_SIZE (5*4) -#endif - -#endif diff --git a/deps/libffi/src/ia64/ffi.c b/deps/libffi/src/ia64/ffi.c deleted file mode 100644 index 1395f26a88feab..00000000000000 --- a/deps/libffi/src/ia64/ffi.c +++ /dev/null @@ -1,616 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 1998, 2007, 2008, 2012 Red Hat, Inc. - Copyright (c) 2000 Hewlett Packard Company - Copyright (c) 2011 Anthony Green - - IA64 Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include -#include - -#include "ia64_flags.h" - -/* A 64-bit pointer value. In LP64 mode, this is effectively a plain - pointer. In ILP32 mode, it's a pointer that's been extended to - 64 bits by "addp4". */ -#ifdef __hpux -typedef void *PTR64; -#else // some other unix -typedef void *PTR64 __attribute__((mode(DI))); -#endif - -/* Memory image of fp register contents. This is the implementation - specific format used by ldf.fill/stf.spill. All we care about is - that it wants a 16 byte aligned slot. */ -typedef struct -{ - UINT64 x[2] __attribute__((aligned(16))); -} fpreg; - - -/* The stack layout given to ffi_call_unix and ffi_closure_unix_inner. */ - -struct ia64_args -{ - fpreg fp_regs[8]; /* Contents of 8 fp arg registers. */ - UINT64 gp_regs[8]; /* Contents of 8 gp arg registers. */ - UINT64 other_args[]; /* Arguments passed on stack, variable size. */ -}; - - -/* Adjust ADDR, a pointer to an 8 byte slot, to point to the low LEN bytes. */ - -static inline void * -endian_adjust (void *addr, size_t len) -{ -#ifdef __BIG_ENDIAN__ - return addr + (8 - len); -#else - return addr; -#endif -} - -/* Store VALUE to ADDR in the current cpu implementation's fp spill format. - This is a macro instead of a function, so that it works for all 3 floating - point types without type conversions. Type conversion to long double breaks - the denorm support. */ - -#ifdef __hpux -#define stf_spill(addr, value) -#else -#define stf_spill(addr, value) \ - asm ("stf.spill %0 = %1%P0" : "=m" (*addr) : "f"(value)); -#endif - -/* Load a value from ADDR, which is in the current cpu implementation's - fp spill format. As above, this must also be a macro. */ - -#ifdef __hpux -#define ldf_fill(result, addr) -#else -#define ldf_fill(result, addr) \ - asm ("ldf.fill %0 = %1%P1" : "=f"(result) : "m"(*addr)); -#endif - -/* Return the size of the C type associated with with TYPE. Which will - be one of the FFI_IA64_TYPE_HFA_* values. */ - -static size_t -hfa_type_size (int type) -{ - switch (type) - { - case FFI_IA64_TYPE_HFA_FLOAT: - return sizeof(float); - case FFI_IA64_TYPE_HFA_DOUBLE: - return sizeof(double); - case FFI_IA64_TYPE_HFA_LDOUBLE: - return sizeof(__float80); - default: - abort (); - } -} - -/* Load from ADDR a value indicated by TYPE. Which will be one of - the FFI_IA64_TYPE_HFA_* values. */ - -static void -hfa_type_load (fpreg *fpaddr, int type, void *addr) -{ - switch (type) - { - case FFI_IA64_TYPE_HFA_FLOAT: - stf_spill (fpaddr, *(float *) addr); - return; - case FFI_IA64_TYPE_HFA_DOUBLE: - stf_spill (fpaddr, *(double *) addr); - return; - case FFI_IA64_TYPE_HFA_LDOUBLE: - stf_spill (fpaddr, *(__float80 *) addr); - return; - default: - abort (); - } -} - -/* Load VALUE into ADDR as indicated by TYPE. Which will be one of - the FFI_IA64_TYPE_HFA_* values. */ - -static void -hfa_type_store (int type, void *addr, fpreg *fpaddr) -{ - switch (type) - { - case FFI_IA64_TYPE_HFA_FLOAT: - { - float result; - ldf_fill (result, fpaddr); - *(float *) addr = result; - break; - } - case FFI_IA64_TYPE_HFA_DOUBLE: - { - double result; - ldf_fill (result, fpaddr); - *(double *) addr = result; - break; - } - case FFI_IA64_TYPE_HFA_LDOUBLE: - { - __float80 result; - ldf_fill (result, fpaddr); - *(__float80 *) addr = result; - break; - } - default: - abort (); - } -} - -/* Is TYPE a struct containing floats, doubles, or extended doubles, - all of the same fp type? If so, return the element type. Return - FFI_TYPE_VOID if not. */ - -static int -hfa_element_type (ffi_type *type, int nested) -{ - int element = FFI_TYPE_VOID; - - switch (type->type) - { - case FFI_TYPE_FLOAT: - /* We want to return VOID for raw floating-point types, but the - synthetic HFA type if we're nested within an aggregate. */ - if (nested) - element = FFI_IA64_TYPE_HFA_FLOAT; - break; - - case FFI_TYPE_DOUBLE: - /* Similarly. */ - if (nested) - element = FFI_IA64_TYPE_HFA_DOUBLE; - break; - - case FFI_TYPE_LONGDOUBLE: - /* Similarly, except that that HFA is true for double extended, - but not quad precision. Both have sizeof == 16, so tell the - difference based on the precision. */ - if (LDBL_MANT_DIG == 64 && nested) - element = FFI_IA64_TYPE_HFA_LDOUBLE; - break; - - case FFI_TYPE_STRUCT: - { - ffi_type **ptr = &type->elements[0]; - - for (ptr = &type->elements[0]; *ptr ; ptr++) - { - int sub_element = hfa_element_type (*ptr, 1); - if (sub_element == FFI_TYPE_VOID) - return FFI_TYPE_VOID; - - if (element == FFI_TYPE_VOID) - element = sub_element; - else if (element != sub_element) - return FFI_TYPE_VOID; - } - } - break; - - default: - return FFI_TYPE_VOID; - } - - return element; -} - - -/* Perform machine dependent cif processing. */ - -static ffi_status -ffi_prep_cif_machdep_core(ffi_cif *cif) -{ - int flags; - - /* Adjust cif->bytes to include space for the bits of the ia64_args frame - that precedes the integer register portion. The estimate that the - generic bits did for the argument space required is good enough for the - integer component. */ - cif->bytes += offsetof(struct ia64_args, gp_regs[0]); - if (cif->bytes < sizeof(struct ia64_args)) - cif->bytes = sizeof(struct ia64_args); - - /* Set the return type flag. */ - flags = cif->rtype->type; - switch (cif->rtype->type) - { - case FFI_TYPE_LONGDOUBLE: - /* Leave FFI_TYPE_LONGDOUBLE as meaning double extended precision, - and encode quad precision as a two-word integer structure. */ - if (LDBL_MANT_DIG != 64) - flags = FFI_IA64_TYPE_SMALL_STRUCT | (16 << 8); - break; - - case FFI_TYPE_STRUCT: - { - size_t size = cif->rtype->size; - int hfa_type = hfa_element_type (cif->rtype, 0); - - if (hfa_type != FFI_TYPE_VOID) - { - size_t nelts = size / hfa_type_size (hfa_type); - if (nelts <= 8) - flags = hfa_type | (size << 8); - } - else - { - if (size <= 32) - flags = FFI_IA64_TYPE_SMALL_STRUCT | (size << 8); - } - } - break; - - default: - break; - } - cif->flags = flags; - - return FFI_OK; -} - -ffi_status -ffi_prep_cif_machdep(ffi_cif *cif) -{ - cif->nfixedargs = cif->nargs; - return ffi_prep_cif_machdep_core(cif); -} - -ffi_status -ffi_prep_cif_machdep_var(ffi_cif *cif, - unsigned int nfixedargs, - unsigned int ntotalargs MAYBE_UNUSED) -{ - cif->nfixedargs = nfixedargs; - return ffi_prep_cif_machdep_core(cif); -} - -extern int ffi_call_unix (struct ia64_args *, PTR64, void (*)(void), UINT64); - -void -ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - struct ia64_args *stack; - long i, avn, gpcount, fpcount; - ffi_type **p_arg; - - FFI_ASSERT (cif->abi == FFI_UNIX); - - /* If we have no spot for a return value, make one. */ - if (rvalue == NULL && cif->rtype->type != FFI_TYPE_VOID) - rvalue = alloca (cif->rtype->size); - - /* Allocate the stack frame. */ - stack = alloca (cif->bytes); - - gpcount = fpcount = 0; - avn = cif->nargs; - for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) - { - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - stack->gp_regs[gpcount++] = *(SINT8 *)avalue[i]; - break; - case FFI_TYPE_UINT8: - stack->gp_regs[gpcount++] = *(UINT8 *)avalue[i]; - break; - case FFI_TYPE_SINT16: - stack->gp_regs[gpcount++] = *(SINT16 *)avalue[i]; - break; - case FFI_TYPE_UINT16: - stack->gp_regs[gpcount++] = *(UINT16 *)avalue[i]; - break; - case FFI_TYPE_SINT32: - stack->gp_regs[gpcount++] = *(SINT32 *)avalue[i]; - break; - case FFI_TYPE_UINT32: - stack->gp_regs[gpcount++] = *(UINT32 *)avalue[i]; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - stack->gp_regs[gpcount++] = *(UINT64 *)avalue[i]; - break; - - case FFI_TYPE_POINTER: - stack->gp_regs[gpcount++] = (UINT64)(PTR64) *(void **)avalue[i]; - break; - - case FFI_TYPE_FLOAT: - if (gpcount < 8 && fpcount < 8) - stf_spill (&stack->fp_regs[fpcount++], *(float *)avalue[i]); - { - UINT32 tmp; - memcpy (&tmp, avalue[i], sizeof (UINT32)); - stack->gp_regs[gpcount++] = tmp; - } - break; - - case FFI_TYPE_DOUBLE: - if (gpcount < 8 && fpcount < 8) - stf_spill (&stack->fp_regs[fpcount++], *(double *)avalue[i]); - memcpy (&stack->gp_regs[gpcount++], avalue[i], sizeof (UINT64)); - break; - - case FFI_TYPE_LONGDOUBLE: - if (gpcount & 1) - gpcount++; - if (LDBL_MANT_DIG == 64 && gpcount < 8 && fpcount < 8) - stf_spill (&stack->fp_regs[fpcount++], *(__float80 *)avalue[i]); - memcpy (&stack->gp_regs[gpcount], avalue[i], 16); - gpcount += 2; - break; - - case FFI_TYPE_STRUCT: - { - size_t size = (*p_arg)->size; - size_t align = (*p_arg)->alignment; - int hfa_type = hfa_element_type (*p_arg, 0); - - FFI_ASSERT (align <= 16); - if (align == 16 && (gpcount & 1)) - gpcount++; - - if (hfa_type != FFI_TYPE_VOID) - { - size_t hfa_size = hfa_type_size (hfa_type); - size_t offset = 0; - size_t gp_offset = gpcount * 8; - - while (fpcount < 8 - && offset < size - && gp_offset < 8 * 8) - { - hfa_type_load (&stack->fp_regs[fpcount], hfa_type, - avalue[i] + offset); - offset += hfa_size; - gp_offset += hfa_size; - fpcount += 1; - } - } - - memcpy (&stack->gp_regs[gpcount], avalue[i], size); - gpcount += (size + 7) / 8; - } - break; - - default: - abort (); - } - } - - ffi_call_unix (stack, rvalue, fn, cif->flags); -} - -/* Closures represent a pair consisting of a function pointer, and - some user data. A closure is invoked by reinterpreting the closure - as a function pointer, and branching to it. Thus we can make an - interpreted function callable as a C function: We turn the - interpreter itself, together with a pointer specifying the - interpreted procedure, into a closure. - - For IA64, function pointer are already pairs consisting of a code - pointer, and a gp pointer. The latter is needed to access global - variables. Here we set up such a pair as the first two words of - the closure (in the "trampoline" area), but we replace the gp - pointer with a pointer to the closure itself. We also add the real - gp pointer to the closure. This allows the function entry code to - both retrieve the user data, and to restore the correct gp pointer. */ - -extern void ffi_closure_unix (); - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - /* The layout of a function descriptor. A C function pointer really - points to one of these. */ - struct ia64_fd - { - UINT64 code_pointer; - UINT64 gp; - }; - - struct ffi_ia64_trampoline_struct - { - UINT64 code_pointer; /* Pointer to ffi_closure_unix. */ - UINT64 fake_gp; /* Pointer to closure, installed as gp. */ - UINT64 real_gp; /* Real gp value. */ - }; - - struct ffi_ia64_trampoline_struct *tramp; - struct ia64_fd *fd; - - if (cif->abi != FFI_UNIX) - return FFI_BAD_ABI; - - tramp = (struct ffi_ia64_trampoline_struct *)closure->tramp; - fd = (struct ia64_fd *)(void *)ffi_closure_unix; - - tramp->code_pointer = fd->code_pointer; - tramp->real_gp = fd->gp; - tramp->fake_gp = (UINT64)(PTR64)codeloc; - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; -} - - -UINT64 -ffi_closure_unix_inner (ffi_closure *closure, struct ia64_args *stack, - void *rvalue, void *r8) -{ - ffi_cif *cif; - void **avalue; - ffi_type **p_arg; - long i, avn, gpcount, fpcount, nfixedargs; - - cif = closure->cif; - avn = cif->nargs; - nfixedargs = cif->nfixedargs; - avalue = alloca (avn * sizeof (void *)); - - /* If the structure return value is passed in memory get that location - from r8 so as to pass the value directly back to the caller. */ - if (cif->flags == FFI_TYPE_STRUCT) - rvalue = r8; - - gpcount = fpcount = 0; - for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) - { - int named = i < nfixedargs; - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 1); - break; - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 2); - break; - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 4); - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - avalue[i] = &stack->gp_regs[gpcount++]; - break; - case FFI_TYPE_POINTER: - avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], sizeof(void*)); - break; - - case FFI_TYPE_FLOAT: - if (named && gpcount < 8 && fpcount < 8) - { - fpreg *addr = &stack->fp_regs[fpcount++]; - float result; - avalue[i] = addr; - ldf_fill (result, addr); - *(float *)addr = result; - } - else - avalue[i] = endian_adjust(&stack->gp_regs[gpcount], 4); - gpcount++; - break; - - case FFI_TYPE_DOUBLE: - if (named && gpcount < 8 && fpcount < 8) - { - fpreg *addr = &stack->fp_regs[fpcount++]; - double result; - avalue[i] = addr; - ldf_fill (result, addr); - *(double *)addr = result; - } - else - avalue[i] = &stack->gp_regs[gpcount]; - gpcount++; - break; - - case FFI_TYPE_LONGDOUBLE: - if (gpcount & 1) - gpcount++; - if (LDBL_MANT_DIG == 64 && named && gpcount < 8 && fpcount < 8) - { - fpreg *addr = &stack->fp_regs[fpcount++]; - __float80 result; - avalue[i] = addr; - ldf_fill (result, addr); - *(__float80 *)addr = result; - } - else - avalue[i] = &stack->gp_regs[gpcount]; - gpcount += 2; - break; - - case FFI_TYPE_STRUCT: - { - size_t size = (*p_arg)->size; - size_t align = (*p_arg)->alignment; - int hfa_type = hfa_element_type (*p_arg, 0); - - FFI_ASSERT (align <= 16); - if (align == 16 && (gpcount & 1)) - gpcount++; - - if (hfa_type != FFI_TYPE_VOID) - { - size_t hfa_size = hfa_type_size (hfa_type); - size_t offset = 0; - size_t gp_offset = gpcount * 8; - void *addr = alloca (size); - - avalue[i] = addr; - - while (fpcount < 8 - && offset < size - && gp_offset < 8 * 8) - { - hfa_type_store (hfa_type, addr + offset, - &stack->fp_regs[fpcount]); - offset += hfa_size; - gp_offset += hfa_size; - fpcount += 1; - } - - if (offset < size) - memcpy (addr + offset, (char *)stack->gp_regs + gp_offset, - size - offset); - } - else - avalue[i] = &stack->gp_regs[gpcount]; - - gpcount += (size + 7) / 8; - } - break; - - default: - abort (); - } - } - - closure->fun (cif, rvalue, avalue, closure->user_data); - - return cif->flags; -} diff --git a/deps/libffi/src/ia64/ffitarget.h b/deps/libffi/src/ia64/ffitarget.h deleted file mode 100644 index fd5b9a0ee1c7c9..00000000000000 --- a/deps/libffi/src/ia64/ffitarget.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for IA-64. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long long ffi_arg; -typedef signed long long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_UNIX, /* Linux and all Unix variants use the same conventions */ - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_UNIX -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 24 /* Really the following struct, which */ - /* can be interpreted as a C function */ - /* descriptor: */ -#define FFI_TARGET_SPECIFIC_VARIADIC 1 -#define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs - -#endif diff --git a/deps/libffi/src/ia64/ia64_flags.h b/deps/libffi/src/ia64/ia64_flags.h deleted file mode 100644 index 9d652cef14cee7..00000000000000 --- a/deps/libffi/src/ia64/ia64_flags.h +++ /dev/null @@ -1,40 +0,0 @@ -/* ----------------------------------------------------------------------- - ia64_flags.h - Copyright (c) 2000 Hewlett Packard Company - - IA64/unix Foreign Function Interface - - Original author: Hans Boehm, HP Labs - - 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. - ----------------------------------------------------------------------- */ - -/* "Type" codes used between assembly and C. When used as a part of - a cfi->flags value, the low byte will be these extra type codes, - and bits 8-31 will be the actual size of the type. */ - -/* Small structures containing N words in integer registers. */ -#define FFI_IA64_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 1) - -/* Homogeneous Floating Point Aggregates (HFAs) which are returned - in FP registers. */ -#define FFI_IA64_TYPE_HFA_FLOAT (FFI_TYPE_LAST + 2) -#define FFI_IA64_TYPE_HFA_DOUBLE (FFI_TYPE_LAST + 3) -#define FFI_IA64_TYPE_HFA_LDOUBLE (FFI_TYPE_LAST + 4) diff --git a/deps/libffi/src/ia64/unix.S b/deps/libffi/src/ia64/unix.S deleted file mode 100644 index 04908368c3e26a..00000000000000 --- a/deps/libffi/src/ia64/unix.S +++ /dev/null @@ -1,585 +0,0 @@ -/* ----------------------------------------------------------------------- - unix.S - Copyright (c) 1998, 2008 Red Hat, Inc. - Copyright (c) 2000 Hewlett Packard Company - - IA64/unix Foreign Function Interface - - Primary author: Hans Boehm, HP Labs - - Loosely modeled on Cygnus code for other platforms. - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#include "ia64_flags.h" - - .pred.safe_across_calls p1-p5,p16-p63 -.text -/* HPUX assembler needs to see these symbols, otherwise compilation - fails */ -#ifdef __hpux - .global memcpy - .global ffi_closure_unix_inner -#endif - -/* int ffi_call_unix (struct ia64_args *stack, PTR64 rvalue, - void (*fn)(void), int flags); - */ - - .align 16 - .global ffi_call_unix - .proc ffi_call_unix -ffi_call_unix: - .prologue - /* Bit o trickiness. We actually share a stack frame with ffi_call. - Rely on the fact that ffi_call uses a vframe and don't bother - tracking one here at all. */ - .fframe 0 - .save ar.pfs, r36 // loc0 - alloc loc0 = ar.pfs, 4, 3, 8, 0 - .save rp, loc1 - mov loc1 = b0 - .body - add r16 = 16, in0 - mov loc2 = gp - mov r8 = in1 - ;; - - /* Load up all of the argument registers. */ - ldf.fill f8 = [in0], 32 - ldf.fill f9 = [r16], 32 - ;; - ldf.fill f10 = [in0], 32 - ldf.fill f11 = [r16], 32 - ;; - ldf.fill f12 = [in0], 32 - ldf.fill f13 = [r16], 32 - ;; - ldf.fill f14 = [in0], 32 - ldf.fill f15 = [r16], 24 - ;; - ld8 out0 = [in0], 16 - ld8 out1 = [r16], 16 - ;; - ld8 out2 = [in0], 16 - ld8 out3 = [r16], 16 - ;; - ld8 out4 = [in0], 16 - ld8 out5 = [r16], 16 - ;; - ld8 out6 = [in0] - ld8 out7 = [r16] - ;; - - /* Deallocate the register save area from the stack frame. */ - mov sp = in0 - - /* Call the target function. */ - ld8 r16 = [in2], 8 - ;; - ld8 gp = [in2] - mov b6 = r16 - br.call.sptk.many b0 = b6 - ;; - - /* Dispatch to handle return value. */ - mov gp = loc2 - zxt1 r16 = in3 - ;; - mov ar.pfs = loc0 - addl r18 = @ltoffx(.Lst_table), gp - ;; - /* default assembler on HP-UX does not support LDXMOV */ -#ifdef __hpux - ld8 r18 = [r18] -#else - ld8.mov r18 = [r18], .Lst_table -#endif - mov b0 = loc1 - ;; - shladd r18 = r16, 3, r18 - ;; - ld8 r17 = [r18] - shr in3 = in3, 8 - ;; - add r17 = r17, r18 - ;; - mov b6 = r17 - br b6 - ;; - -.Lst_void: - br.ret.sptk.many b0 - ;; -.Lst_uint8: - zxt1 r8 = r8 - ;; - st8 [in1] = r8 - br.ret.sptk.many b0 - ;; -.Lst_sint8: - sxt1 r8 = r8 - ;; - st8 [in1] = r8 - br.ret.sptk.many b0 - ;; -.Lst_uint16: - zxt2 r8 = r8 - ;; - st8 [in1] = r8 - br.ret.sptk.many b0 - ;; -.Lst_sint16: - sxt2 r8 = r8 - ;; - st8 [in1] = r8 - br.ret.sptk.many b0 - ;; -.Lst_uint32: - zxt4 r8 = r8 - ;; - st8 [in1] = r8 - br.ret.sptk.many b0 - ;; -.Lst_sint32: - sxt4 r8 = r8 - ;; - st8 [in1] = r8 - br.ret.sptk.many b0 - ;; -.Lst_int64: - st8 [in1] = r8 - br.ret.sptk.many b0 - ;; -.Lst_float: - stfs [in1] = f8 - br.ret.sptk.many b0 - ;; -.Lst_double: - stfd [in1] = f8 - br.ret.sptk.many b0 - ;; -.Lst_ldouble: - stfe [in1] = f8 - br.ret.sptk.many b0 - ;; - -.Lst_small_struct: - cmp.lt p6, p0 = 8, in3 - cmp.lt p7, p0 = 16, in3 - cmp.lt p8, p0 = 24, in3 - ;; - add r16 = 8, sp - add r17 = 16, sp - add r18 = 24, sp - ;; - st8 [sp] = r8 -(p6) st8 [r16] = r9 - mov out0 = in1 -(p7) st8 [r17] = r10 -(p8) st8 [r18] = r11 - mov out1 = sp - mov out2 = in3 - ;; - // ia64 software calling convention requires - // top 16 bytes of stack to be scratch space - // PLT resolver uses that scratch space at - // 'memcpy' symbol reolution time - add sp = -16, sp - br.call.sptk.many b0 = memcpy# - ;; - mov ar.pfs = loc0 - mov b0 = loc1 - mov gp = loc2 - br.ret.sptk.many b0 - -.Lst_hfa_float: - add r16 = 4, in1 - cmp.lt p6, p0 = 4, in3 - ;; - stfs [in1] = f8, 8 -(p6) stfs [r16] = f9, 8 - cmp.lt p7, p0 = 8, in3 - cmp.lt p8, p0 = 12, in3 - ;; -(p7) stfs [in1] = f10, 8 -(p8) stfs [r16] = f11, 8 - cmp.lt p9, p0 = 16, in3 - cmp.lt p10, p0 = 20, in3 - ;; -(p9) stfs [in1] = f12, 8 -(p10) stfs [r16] = f13, 8 - cmp.lt p6, p0 = 24, in3 - cmp.lt p7, p0 = 28, in3 - ;; -(p6) stfs [in1] = f14 -(p7) stfs [r16] = f15 - br.ret.sptk.many b0 - ;; - -.Lst_hfa_double: - add r16 = 8, in1 - cmp.lt p6, p0 = 8, in3 - ;; - stfd [in1] = f8, 16 -(p6) stfd [r16] = f9, 16 - cmp.lt p7, p0 = 16, in3 - cmp.lt p8, p0 = 24, in3 - ;; -(p7) stfd [in1] = f10, 16 -(p8) stfd [r16] = f11, 16 - cmp.lt p9, p0 = 32, in3 - cmp.lt p10, p0 = 40, in3 - ;; -(p9) stfd [in1] = f12, 16 -(p10) stfd [r16] = f13, 16 - cmp.lt p6, p0 = 48, in3 - cmp.lt p7, p0 = 56, in3 - ;; -(p6) stfd [in1] = f14 -(p7) stfd [r16] = f15 - br.ret.sptk.many b0 - ;; - -.Lst_hfa_ldouble: - add r16 = 16, in1 - cmp.lt p6, p0 = 16, in3 - ;; - stfe [in1] = f8, 32 -(p6) stfe [r16] = f9, 32 - cmp.lt p7, p0 = 32, in3 - cmp.lt p8, p0 = 48, in3 - ;; -(p7) stfe [in1] = f10, 32 -(p8) stfe [r16] = f11, 32 - cmp.lt p9, p0 = 64, in3 - cmp.lt p10, p0 = 80, in3 - ;; -(p9) stfe [in1] = f12, 32 -(p10) stfe [r16] = f13, 32 - cmp.lt p6, p0 = 96, in3 - cmp.lt p7, p0 = 112, in3 - ;; -(p6) stfe [in1] = f14 -(p7) stfe [r16] = f15 - br.ret.sptk.many b0 - ;; - - .endp ffi_call_unix - - .align 16 - .global ffi_closure_unix - .proc ffi_closure_unix - -#define FRAME_SIZE (8*16 + 8*8 + 8*16) - -ffi_closure_unix: - .prologue - .save ar.pfs, r40 // loc0 - alloc loc0 = ar.pfs, 8, 4, 4, 0 - .fframe FRAME_SIZE - add r12 = -FRAME_SIZE, r12 - .save rp, loc1 - mov loc1 = b0 - .save ar.unat, loc2 - mov loc2 = ar.unat - .body - - /* Retrieve closure pointer and real gp. */ -#ifdef _ILP32 - addp4 out0 = 0, gp - addp4 gp = 16, gp -#else - mov out0 = gp - add gp = 16, gp -#endif - ;; - ld8 gp = [gp] - - /* Spill all of the possible argument registers. */ - add r16 = 16 + 8*16, sp - add r17 = 16 + 8*16 + 16, sp - ;; - stf.spill [r16] = f8, 32 - stf.spill [r17] = f9, 32 - mov loc3 = gp - ;; - stf.spill [r16] = f10, 32 - stf.spill [r17] = f11, 32 - ;; - stf.spill [r16] = f12, 32 - stf.spill [r17] = f13, 32 - ;; - stf.spill [r16] = f14, 32 - stf.spill [r17] = f15, 24 - ;; - .mem.offset 0, 0 - st8.spill [r16] = in0, 16 - .mem.offset 8, 0 - st8.spill [r17] = in1, 16 - add out1 = 16 + 8*16, sp - ;; - .mem.offset 0, 0 - st8.spill [r16] = in2, 16 - .mem.offset 8, 0 - st8.spill [r17] = in3, 16 - add out2 = 16, sp - ;; - .mem.offset 0, 0 - st8.spill [r16] = in4, 16 - .mem.offset 8, 0 - st8.spill [r17] = in5, 16 - mov out3 = r8 - ;; - .mem.offset 0, 0 - st8.spill [r16] = in6 - .mem.offset 8, 0 - st8.spill [r17] = in7 - - /* Invoke ffi_closure_unix_inner for the hard work. */ - br.call.sptk.many b0 = ffi_closure_unix_inner - ;; - - /* Dispatch to handle return value. */ - mov gp = loc3 - zxt1 r16 = r8 - ;; - addl r18 = @ltoffx(.Lld_table), gp - mov ar.pfs = loc0 - ;; -#ifdef __hpux - ld8 r18 = [r18] -#else - ld8.mov r18 = [r18], .Lst_table -#endif - mov b0 = loc1 - ;; - shladd r18 = r16, 3, r18 - mov ar.unat = loc2 - ;; - ld8 r17 = [r18] - shr r8 = r8, 8 - ;; - add r17 = r17, r18 - add r16 = 16, sp - ;; - mov b6 = r17 - br b6 - ;; - .label_state 1 - -.Lld_void: - .restore sp - add sp = FRAME_SIZE, sp - br.ret.sptk.many b0 - ;; -.Lld_int: - .body - .copy_state 1 - ld8 r8 = [r16] - .restore sp - add sp = FRAME_SIZE, sp - br.ret.sptk.many b0 - ;; -.Lld_float: - .body - .copy_state 1 - ldfs f8 = [r16] - .restore sp - add sp = FRAME_SIZE, sp - br.ret.sptk.many b0 - ;; -.Lld_double: - .body - .copy_state 1 - ldfd f8 = [r16] - .restore sp - add sp = FRAME_SIZE, sp - br.ret.sptk.many b0 - ;; -.Lld_ldouble: - .body - .copy_state 1 - ldfe f8 = [r16] - .restore sp - add sp = FRAME_SIZE, sp - br.ret.sptk.many b0 - ;; - -.Lld_small_struct: - .body - .copy_state 1 - add r17 = 8, r16 - cmp.lt p6, p0 = 8, r8 - cmp.lt p7, p0 = 16, r8 - cmp.lt p8, p0 = 24, r8 - ;; - ld8 r8 = [r16], 16 -(p6) ld8 r9 = [r17], 16 - ;; -(p7) ld8 r10 = [r16] -(p8) ld8 r11 = [r17] - .restore sp - add sp = FRAME_SIZE, sp - br.ret.sptk.many b0 - ;; - -.Lld_hfa_float: - .body - .copy_state 1 - add r17 = 4, r16 - cmp.lt p6, p0 = 4, r8 - ;; - ldfs f8 = [r16], 8 -(p6) ldfs f9 = [r17], 8 - cmp.lt p7, p0 = 8, r8 - cmp.lt p8, p0 = 12, r8 - ;; -(p7) ldfs f10 = [r16], 8 -(p8) ldfs f11 = [r17], 8 - cmp.lt p9, p0 = 16, r8 - cmp.lt p10, p0 = 20, r8 - ;; -(p9) ldfs f12 = [r16], 8 -(p10) ldfs f13 = [r17], 8 - cmp.lt p6, p0 = 24, r8 - cmp.lt p7, p0 = 28, r8 - ;; -(p6) ldfs f14 = [r16] -(p7) ldfs f15 = [r17] - .restore sp - add sp = FRAME_SIZE, sp - br.ret.sptk.many b0 - ;; - -.Lld_hfa_double: - .body - .copy_state 1 - add r17 = 8, r16 - cmp.lt p6, p0 = 8, r8 - ;; - ldfd f8 = [r16], 16 -(p6) ldfd f9 = [r17], 16 - cmp.lt p7, p0 = 16, r8 - cmp.lt p8, p0 = 24, r8 - ;; -(p7) ldfd f10 = [r16], 16 -(p8) ldfd f11 = [r17], 16 - cmp.lt p9, p0 = 32, r8 - cmp.lt p10, p0 = 40, r8 - ;; -(p9) ldfd f12 = [r16], 16 -(p10) ldfd f13 = [r17], 16 - cmp.lt p6, p0 = 48, r8 - cmp.lt p7, p0 = 56, r8 - ;; -(p6) ldfd f14 = [r16] -(p7) ldfd f15 = [r17] - .restore sp - add sp = FRAME_SIZE, sp - br.ret.sptk.many b0 - ;; - -.Lld_hfa_ldouble: - .body - .copy_state 1 - add r17 = 16, r16 - cmp.lt p6, p0 = 16, r8 - ;; - ldfe f8 = [r16], 32 -(p6) ldfe f9 = [r17], 32 - cmp.lt p7, p0 = 32, r8 - cmp.lt p8, p0 = 48, r8 - ;; -(p7) ldfe f10 = [r16], 32 -(p8) ldfe f11 = [r17], 32 - cmp.lt p9, p0 = 64, r8 - cmp.lt p10, p0 = 80, r8 - ;; -(p9) ldfe f12 = [r16], 32 -(p10) ldfe f13 = [r17], 32 - cmp.lt p6, p0 = 96, r8 - cmp.lt p7, p0 = 112, r8 - ;; -(p6) ldfe f14 = [r16] -(p7) ldfe f15 = [r17] - .restore sp - add sp = FRAME_SIZE, sp - br.ret.sptk.many b0 - ;; - - .endp ffi_closure_unix -#ifdef __hpux - .rodata -#else - .section .rodata -#endif - .align 8 -.Lst_table: - data8 @pcrel(.Lst_void) // FFI_TYPE_VOID - data8 @pcrel(.Lst_sint32) // FFI_TYPE_INT - data8 @pcrel(.Lst_float) // FFI_TYPE_FLOAT - data8 @pcrel(.Lst_double) // FFI_TYPE_DOUBLE - data8 @pcrel(.Lst_ldouble) // FFI_TYPE_LONGDOUBLE - data8 @pcrel(.Lst_uint8) // FFI_TYPE_UINT8 - data8 @pcrel(.Lst_sint8) // FFI_TYPE_SINT8 - data8 @pcrel(.Lst_uint16) // FFI_TYPE_UINT16 - data8 @pcrel(.Lst_sint16) // FFI_TYPE_SINT16 - data8 @pcrel(.Lst_uint32) // FFI_TYPE_UINT32 - data8 @pcrel(.Lst_sint32) // FFI_TYPE_SINT32 - data8 @pcrel(.Lst_int64) // FFI_TYPE_UINT64 - data8 @pcrel(.Lst_int64) // FFI_TYPE_SINT64 - data8 @pcrel(.Lst_void) // FFI_TYPE_STRUCT - data8 @pcrel(.Lst_int64) // FFI_TYPE_POINTER - data8 @pcrel(.Lst_void) // FFI_TYPE_COMPLEX (not implemented) - data8 @pcrel(.Lst_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT - data8 @pcrel(.Lst_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT - data8 @pcrel(.Lst_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE - data8 @pcrel(.Lst_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE - -.Lld_table: - data8 @pcrel(.Lld_void) // FFI_TYPE_VOID - data8 @pcrel(.Lld_int) // FFI_TYPE_INT - data8 @pcrel(.Lld_float) // FFI_TYPE_FLOAT - data8 @pcrel(.Lld_double) // FFI_TYPE_DOUBLE - data8 @pcrel(.Lld_ldouble) // FFI_TYPE_LONGDOUBLE - data8 @pcrel(.Lld_int) // FFI_TYPE_UINT8 - data8 @pcrel(.Lld_int) // FFI_TYPE_SINT8 - data8 @pcrel(.Lld_int) // FFI_TYPE_UINT16 - data8 @pcrel(.Lld_int) // FFI_TYPE_SINT16 - data8 @pcrel(.Lld_int) // FFI_TYPE_UINT32 - data8 @pcrel(.Lld_int) // FFI_TYPE_SINT32 - data8 @pcrel(.Lld_int) // FFI_TYPE_UINT64 - data8 @pcrel(.Lld_int) // FFI_TYPE_SINT64 - data8 @pcrel(.Lld_void) // FFI_TYPE_STRUCT - data8 @pcrel(.Lld_int) // FFI_TYPE_POINTER - data8 @pcrel(.Lld_void) // FFI_TYPE_COMPLEX (not implemented) - data8 @pcrel(.Lld_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT - data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT - data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE - data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/java_raw_api.c b/deps/libffi/src/java_raw_api.c deleted file mode 100644 index 114d3e47fcdef3..00000000000000 --- a/deps/libffi/src/java_raw_api.c +++ /dev/null @@ -1,374 +0,0 @@ -/* ----------------------------------------------------------------------- - java_raw_api.c - Copyright (c) 1999, 2007, 2008 Red Hat, Inc. - - Cloned from raw_api.c - - Raw_api.c author: Kresten Krab Thorup - Java_raw_api.c author: Hans-J. Boehm - - $Id $ - - 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. - ----------------------------------------------------------------------- */ - -/* This defines a Java- and 64-bit specific variant of the raw API. */ -/* It assumes that "raw" argument blocks look like Java stacks on a */ -/* 64-bit machine. Arguments that can be stored in a single stack */ -/* stack slots (longs, doubles) occupy 128 bits, but only the first */ -/* 64 bits are actually used. */ - -#include -#include -#include - -#if !defined(NO_JAVA_RAW_API) - -size_t -ffi_java_raw_size (ffi_cif *cif) -{ - size_t result = 0; - int i; - - ffi_type **at = cif->arg_types; - - for (i = cif->nargs-1; i >= 0; i--, at++) - { - switch((*at) -> type) { - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_DOUBLE: - result += 2 * FFI_SIZEOF_JAVA_RAW; - break; - case FFI_TYPE_STRUCT: - /* No structure parameters in Java. */ - abort(); - case FFI_TYPE_COMPLEX: - /* Not supported yet. */ - abort(); - default: - result += FFI_SIZEOF_JAVA_RAW; - } - } - - return result; -} - - -void -ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) -{ - unsigned i; - ffi_type **tp = cif->arg_types; - -#if WORDS_BIGENDIAN - - for (i = 0; i < cif->nargs; i++, tp++, args++) - { - switch ((*tp)->type) - { - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - *args = (void*) ((char*)(raw++) + 3); - break; - - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - *args = (void*) ((char*)(raw++) + 2); - break; - -#if FFI_SIZEOF_JAVA_RAW == 8 - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_DOUBLE: - *args = (void *)raw; - raw += 2; - break; -#endif - - case FFI_TYPE_POINTER: - *args = (void*) &(raw++)->ptr; - break; - - case FFI_TYPE_COMPLEX: - /* Not supported yet. */ - abort(); - - default: - *args = raw; - raw += - FFI_ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw); - } - } - -#else /* WORDS_BIGENDIAN */ - -#if !PDP - - /* then assume little endian */ - for (i = 0; i < cif->nargs; i++, tp++, args++) - { -#if FFI_SIZEOF_JAVA_RAW == 8 - switch((*tp)->type) { - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_DOUBLE: - *args = (void*) raw; - raw += 2; - break; - case FFI_TYPE_COMPLEX: - /* Not supported yet. */ - abort(); - default: - *args = (void*) raw++; - } -#else /* FFI_SIZEOF_JAVA_RAW != 8 */ - *args = (void*) raw; - raw += - FFI_ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw); -#endif /* FFI_SIZEOF_JAVA_RAW == 8 */ - } - -#else -#error "pdp endian not supported" -#endif /* ! PDP */ - -#endif /* WORDS_BIGENDIAN */ -} - -void -ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) -{ - unsigned i; - ffi_type **tp = cif->arg_types; - - for (i = 0; i < cif->nargs; i++, tp++, args++) - { - switch ((*tp)->type) - { - case FFI_TYPE_UINT8: -#if WORDS_BIGENDIAN - *(UINT32*)(raw++) = *(UINT8*) (*args); -#else - (raw++)->uint = *(UINT8*) (*args); -#endif - break; - - case FFI_TYPE_SINT8: -#if WORDS_BIGENDIAN - *(SINT32*)(raw++) = *(SINT8*) (*args); -#else - (raw++)->sint = *(SINT8*) (*args); -#endif - break; - - case FFI_TYPE_UINT16: -#if WORDS_BIGENDIAN - *(UINT32*)(raw++) = *(UINT16*) (*args); -#else - (raw++)->uint = *(UINT16*) (*args); -#endif - break; - - case FFI_TYPE_SINT16: -#if WORDS_BIGENDIAN - *(SINT32*)(raw++) = *(SINT16*) (*args); -#else - (raw++)->sint = *(SINT16*) (*args); -#endif - break; - - case FFI_TYPE_UINT32: -#if WORDS_BIGENDIAN - *(UINT32*)(raw++) = *(UINT32*) (*args); -#else - (raw++)->uint = *(UINT32*) (*args); -#endif - break; - - case FFI_TYPE_SINT32: -#if WORDS_BIGENDIAN - *(SINT32*)(raw++) = *(SINT32*) (*args); -#else - (raw++)->sint = *(SINT32*) (*args); -#endif - break; - - case FFI_TYPE_FLOAT: - (raw++)->flt = *(FLOAT32*) (*args); - break; - -#if FFI_SIZEOF_JAVA_RAW == 8 - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_DOUBLE: - raw->uint = *(UINT64*) (*args); - raw += 2; - break; -#endif - - case FFI_TYPE_POINTER: - (raw++)->ptr = **(void***) args; - break; - - default: -#if FFI_SIZEOF_JAVA_RAW == 8 - FFI_ASSERT(0); /* Should have covered all cases */ -#else - memcpy ((void*) raw->data, (void*)*args, (*tp)->size); - raw += - FFI_ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw); -#endif - } - } -} - -#if !FFI_NATIVE_RAW_API - -static void -ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) -{ -#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8 - switch (cif->rtype->type) - { - case FFI_TYPE_UINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_UINT32: - *(UINT64 *)rvalue <<= 32; - break; - - case FFI_TYPE_SINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_SINT32: - case FFI_TYPE_INT: -#if FFI_SIZEOF_JAVA_RAW == 4 - case FFI_TYPE_POINTER: -#endif - *(SINT64 *)rvalue <<= 32; - break; - - case FFI_TYPE_COMPLEX: - /* Not supported yet. */ - abort(); - - default: - break; - } -#endif -} - -static void -ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) -{ -#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8 - switch (cif->rtype->type) - { - case FFI_TYPE_UINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_UINT32: - *(UINT64 *)rvalue >>= 32; - break; - - case FFI_TYPE_SINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_SINT32: - case FFI_TYPE_INT: - *(SINT64 *)rvalue >>= 32; - break; - - case FFI_TYPE_COMPLEX: - /* Not supported yet. */ - abort(); - - default: - break; - } -#endif -} - -/* This is a generic definition of ffi_raw_call, to be used if the - * native system does not provide a machine-specific implementation. - * Having this, allows code to be written for the raw API, without - * the need for system-specific code to handle input in that format; - * these following couple of functions will handle the translation forth - * and back automatically. */ - -void ffi_java_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, - ffi_java_raw *raw) -{ - void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); - ffi_java_raw_to_ptrarray (cif, raw, avalue); - ffi_call (cif, fn, rvalue, avalue); - ffi_java_rvalue_to_raw (cif, rvalue); -} - -#if FFI_CLOSURES /* base system provides closures */ - -static void -ffi_java_translate_args (ffi_cif *cif, void *rvalue, - void **avalue, void *user_data) -{ - ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif)); - ffi_raw_closure *cl = (ffi_raw_closure*)user_data; - - ffi_java_ptrarray_to_raw (cif, avalue, raw); - (*cl->fun) (cif, rvalue, (ffi_raw*)raw, cl->user_data); - ffi_java_raw_to_rvalue (cif, rvalue); -} - -ffi_status -ffi_prep_java_raw_closure_loc (ffi_java_raw_closure* cl, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), - void *user_data, - void *codeloc) -{ - ffi_status status; - - status = ffi_prep_closure_loc ((ffi_closure*) cl, - cif, - &ffi_java_translate_args, - codeloc, - codeloc); - if (status == FFI_OK) - { - cl->fun = fun; - cl->user_data = user_data; - } - - return status; -} - -/* Again, here is the generic version of ffi_prep_raw_closure, which - * will install an intermediate "hub" for translation of arguments from - * the pointer-array format, to the raw format */ - -ffi_status -ffi_prep_java_raw_closure (ffi_java_raw_closure* cl, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), - void *user_data) -{ - return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl); -} - -#endif /* FFI_CLOSURES */ -#endif /* !FFI_NATIVE_RAW_API */ -#endif /* !NO_JAVA_RAW_API */ diff --git a/deps/libffi/src/kvx/asm.h b/deps/libffi/src/kvx/asm.h deleted file mode 100644 index 4edba410d82062..00000000000000 --- a/deps/libffi/src/kvx/asm.h +++ /dev/null @@ -1,5 +0,0 @@ -/* args are passed on registers from r0 up to r11 => 12*8 bytes */ -#define REG_ARGS_SIZE (12*8) -#define KVX_REGISTER_SIZE (8) -#define KVX_ABI_SLOT_SIZE (KVX_REGISTER_SIZE) -#define KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE (4*KVX_ABI_SLOT_SIZE) diff --git a/deps/libffi/src/kvx/ffi.c b/deps/libffi/src/kvx/ffi.c deleted file mode 100644 index 58f6aef5ca473b..00000000000000 --- a/deps/libffi/src/kvx/ffi.c +++ /dev/null @@ -1,273 +0,0 @@ -/* Copyright (c) 2020 Kalray - -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. */ - -#if defined(__kvx__) -#include -#include -#include -#include -#include -#include "ffi_common.h" -#include "asm.h" - -#define ALIGN(x, a) ALIGN_MASK(x, (typeof(x))(a) - 1) -#define ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) -#define KVX_ABI_STACK_ALIGNMENT (32) -#define KVX_ABI_STACK_ARG_ALIGNMENT (8) -#define max(a,b) ((a) > (b) ? (a) : (b)) - -#ifdef FFI_DEBUG -#define DEBUG_PRINT(...) do{ fprintf( stderr, __VA_ARGS__ ); } while(0) -#else -#define DEBUG_PRINT(...) -#endif - -struct ret_value { - unsigned long int r0; - unsigned long int r1; - unsigned long int r2; - unsigned long int r3; -}; - -extern struct ret_value ffi_call_SYSV(unsigned total_size, - unsigned size, - extended_cif *ecif, - unsigned *rvalue_addr, - void *fn, - unsigned int_ext_method); - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - cif->flags = cif->rtype->size; - return FFI_OK; -} - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - -void *ffi_prep_args(char *stack, unsigned int arg_slots_size, extended_cif *ecif) -{ - char *stacktemp = stack; - char *current_arg_passed_by_value = stack + arg_slots_size; - int i, s; - ffi_type **arg; - int count = 0; - ffi_cif *cif = ecif->cif; - void **argv = ecif->avalue; - - arg = cif->arg_types; - - DEBUG_PRINT("stack: %p\n", stack); - DEBUG_PRINT("arg_slots_size: %u\n", arg_slots_size); - DEBUG_PRINT("current_arg_passed_by_value: %p\n", current_arg_passed_by_value); - DEBUG_PRINT("ecif: %p\n", ecif); - DEBUG_PRINT("ecif->avalue: %p\n", ecif->avalue); - - for (i = 0; i < cif->nargs; i++) { - - s = KVX_ABI_SLOT_SIZE; - switch((*arg)->type) { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_POINTER: - DEBUG_PRINT("INT64/32/16/8/FLOAT/DOUBLE or POINTER @%p\n", stack); - *(uint64_t *) stack = *(uint64_t *)(* argv); - break; - - case FFI_TYPE_COMPLEX: - if ((*arg)->size == 8) - *(_Complex float *) stack = *(_Complex float *)(* argv); - else if ((*arg)->size == 16) { - *(_Complex double *) stack = *(_Complex double *)(* argv); - s = 16; - } else - abort(); - break; - case FFI_TYPE_STRUCT: { - char *value; - unsigned int written_size = 0; - DEBUG_PRINT("struct by value @%p\n", stack); - if ((*arg)->size > KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) { - DEBUG_PRINT("big struct\n"); - *(uint64_t *) stack = (uintptr_t)current_arg_passed_by_value; - value = current_arg_passed_by_value; - current_arg_passed_by_value += (*arg)->size; - written_size = KVX_ABI_SLOT_SIZE; - } else { - value = stack; - written_size = (*arg)->size; - } - memcpy(value, *argv, (*arg)->size); - s = ALIGN(written_size, KVX_ABI_STACK_ARG_ALIGNMENT); - break; - } - default: - printf("Error: unsupported arg type %d\n", (*arg)->type); - abort(); - break; - - } - stack += s; - count += s; - argv++; - arg++; - } -#ifdef FFI_DEBUG - FFI_ASSERT(((intptr_t)(stacktemp + REG_ARGS_SIZE) & (KVX_ABI_STACK_ALIGNMENT-1)) == 0); -#endif - return stacktemp + REG_ARGS_SIZE; -} - -/* Perform machine dependent cif processing when we have a variadic function */ - -ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, - unsigned int ntotalargs) -{ - cif->flags = cif->rtype->size; - return FFI_OK; -} - -static unsigned long handle_small_int_ext(kvx_intext_method *int_ext_method, - const ffi_type *rtype) -{ - switch (rtype->type) { - case FFI_TYPE_SINT8: - *int_ext_method = KVX_RET_SXBD; - return KVX_REGISTER_SIZE; - - case FFI_TYPE_SINT16: - *int_ext_method = KVX_RET_SXHD; - return KVX_REGISTER_SIZE; - - case FFI_TYPE_SINT32: - *int_ext_method = KVX_RET_SXWD; - return KVX_REGISTER_SIZE; - - case FFI_TYPE_UINT8: - *int_ext_method = KVX_RET_ZXBD; - return KVX_REGISTER_SIZE; - - case FFI_TYPE_UINT16: - *int_ext_method = KVX_RET_ZXHD; - return KVX_REGISTER_SIZE; - - case FFI_TYPE_UINT32: - *int_ext_method = KVX_RET_ZXWD; - return KVX_REGISTER_SIZE; - - default: - *int_ext_method = KVX_RET_NONE; - return rtype->size; - } -} - -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - int i; - unsigned long int slot_fitting_args_size = 0; - unsigned long int total_size = 0; - unsigned long int big_struct_size = 0; - kvx_intext_method int_extension_method; - ffi_type **arg; - struct ret_value local_rvalue = {0}; - size_t wb_size; - - - /* Calculate size to allocate on stack */ - for (i = 0, arg = cif->arg_types; i < cif->nargs; i++, arg++) { - DEBUG_PRINT("argument %d, type %d, size %lu\n", i, (*arg)->type, (*arg)->size); - if (((*arg)->type == FFI_TYPE_STRUCT) || ((*arg)->type == FFI_TYPE_COMPLEX)) { - if ((*arg)->size <= KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) { - slot_fitting_args_size += ALIGN((*arg)->size, KVX_ABI_SLOT_SIZE); - } else { - slot_fitting_args_size += KVX_ABI_SLOT_SIZE; /* aggregate passed by reference */ - big_struct_size += ALIGN((*arg)->size, KVX_ABI_SLOT_SIZE); - } - } else if ((*arg)->size <= KVX_ABI_SLOT_SIZE) { - slot_fitting_args_size += KVX_ABI_SLOT_SIZE; - } else { - printf("Error: unsupported arg size %ld arg type %d\n", (*arg)->size, (*arg)->type); - abort(); /* should never happen? */ - } - } - - extended_cif ecif; - ecif.cif = cif; - ecif.avalue = avalue; - ecif.rvalue = rvalue; - - /* This implementation allocates anyway for all register based args */ - slot_fitting_args_size = max(slot_fitting_args_size, REG_ARGS_SIZE); - total_size = slot_fitting_args_size + big_struct_size; - total_size = ALIGN(total_size, KVX_ABI_STACK_ALIGNMENT); - - /* wb_size: write back size, the size we will need to write back to user - * provided buffer. In theory it should always be cif->flags which is - * cif->rtype->size. But libffi API mandates that for integral types - * of size <= system register size, then we *MUST* write back - * the size of system register size. - * in our case, if size <= 8 bytes we must write back 8 bytes. - * floats, complex and structs are not affected, only integrals. - */ - wb_size = handle_small_int_ext(&int_extension_method, cif->rtype); - - switch (cif->abi) { - case FFI_SYSV: - DEBUG_PRINT("total_size: %lu\n", total_size); - DEBUG_PRINT("slot fitting args size: %lu\n", slot_fitting_args_size); - DEBUG_PRINT("rvalue: %p\n", rvalue); - DEBUG_PRINT("fn: %p\n", fn); - DEBUG_PRINT("rsize: %u\n", cif->flags); - DEBUG_PRINT("wb_size: %u\n", wb_size); - DEBUG_PRINT("int_extension_method: %u\n", int_extension_method); - local_rvalue = ffi_call_SYSV(total_size, slot_fitting_args_size, - &ecif, rvalue, fn, int_extension_method); - if ((cif->flags <= KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) - && (cif->rtype->type != FFI_TYPE_VOID)) - memcpy(rvalue, &local_rvalue, wb_size); - break; - default: - abort(); - break; - } -} - -/* Closures not supported yet */ -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - return FFI_BAD_ABI; -} - -#endif /* (__kvx__) */ diff --git a/deps/libffi/src/kvx/ffitarget.h b/deps/libffi/src/kvx/ffitarget.h deleted file mode 100644 index 8df8735e3f2d85..00000000000000 --- a/deps/libffi/src/kvx/ffitarget.h +++ /dev/null @@ -1,75 +0,0 @@ -/* ----------------------------------------------------------------------- - ffitarget.h - Copyright (c) 2020 Kalray - - KVX Target configuration macros - - 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. - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- System specific configurations ----------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; - -/* Those values are set depending on return type - * they are used in the assembly code in sysv.S - */ -typedef enum kvx_intext_method { - KVX_RET_NONE = 0, - KVX_RET_SXBD = 1, - KVX_RET_SXHD = 2, - KVX_RET_SXWD = 3, - KVX_RET_ZXBD = 4, - KVX_RET_ZXHD = 5, - KVX_RET_ZXWD = 6 -} kvx_intext_method; - -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -/* This is only to allow Python to compile - * but closures are not supported yet - */ -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 0 - -#define FFI_NATIVE_RAW_API 0 -#define FFI_TARGET_SPECIFIC_VARIADIC 1 -#define FFI_TARGET_HAS_COMPLEX_TYPE - -#endif - diff --git a/deps/libffi/src/kvx/sysv.S b/deps/libffi/src/kvx/sysv.S deleted file mode 100644 index 952afc7063bc0c..00000000000000 --- a/deps/libffi/src/kvx/sysv.S +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright (c) 2020 Kalray - -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. */ - -#if defined(__kvx__) -#define LIBFFI_ASM -#include -#include -#include -#include - -.text -.global ffi_call_SYSV -.type ffi_call_SYSV, @function -.type ffi_prep_args, @function -.align 8 - -/* ffi_call_SYSV - - r0: total size to allocate on stack - r1: size of arg slots - r2: extended cif structure, DO NOT REMOVE: it is used by ffi_prep_args() - r3: return value address - r4: function to call - r5: integer sign extension method to be used -*/ -ffi_call_SYSV: - addd $r12 = $r12, -64 - so (-32)[$r12] = $r20r21r22r23 - ;; - sd (0)[$r12] = $r24 - ;; - get $r23 = $ra - copyd $r20 = $r12 - sbfd $r12 = $r0, $r12 - ;; - copyd $r0 = $r12 - copyd $r21 = $r3 - copyd $r22 = $r4 - copyd $r24 = $r5 - call ffi_prep_args - ;; - lo $r8r9r10r11 = (64)[$r12] - ;; - lo $r4r5r6r7 = (32)[$r12] - ;; - lo $r0r1r2r3 = (0)[$r12] - copyd $r12 = $r0 - /* $r15 is the register used by the ABI to return big (>32 bytes) - * structs by value. - * It is also referred to as the "struct register" in the ABI. - */ - copyd $r15 = $r21 - icall $r22 - ;; - pcrel $r4 = @pcrel(.Ltable) - cb.deqz $r24 ? .Lend - ;; - addx8d $r24 = $r24, $r4 - ;; - igoto $r24 - ;; -.Ltable: -0: /* we should never arrive here */ - goto .Lerror - nop - ;; -1: /* Sign extend byte to double */ - sxbd $r0 = $r0 - goto .Lend - ;; -2: /* Sign extend half to double */ - sxhd $r0 = $r0 - goto .Lend - ;; -3: /* Sign extend word to double */ - sxwd $r0 = $r0 - goto .Lend - ;; -4: /* Zero extend byte to double */ - zxbd $r0 = $r0 - goto .Lend - ;; -5: /* Zero extend half to double */ - zxhd $r0 = $r0 - goto .Lend - ;; -6: /* Zero extend word to double */ - zxwd $r0 = $r0 - /* Fallthrough to .Lend */ - ;; -.Lend: - ld $r24 = (0)[$r12] - ;; - set $ra = $r23 - lo $r20r21r22r23 = (32)[$r20] - addd $r12 = $r20, 64 - ;; - ret - ;; -.Lerror: - errop - ;; - -#endif /* __kvx__ */ - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",%progbits -#endif - diff --git a/deps/libffi/src/loongarch64/ffi.c b/deps/libffi/src/loongarch64/ffi.c deleted file mode 100644 index 93c337749f171d..00000000000000 --- a/deps/libffi/src/loongarch64/ffi.c +++ /dev/null @@ -1,624 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2022 Xu Chenghua - 2022 Cheng Lulu - Based on RISC-V port - - LoongArch Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include -#include - -#include -#include - -#if defined(__loongarch_soft_float) -# define ABI_FRLEN 0 -#elif defined(__loongarch_single_float) -# define ABI_FRLEN 32 -# define ABI_FLOAT float -#elif defined(__loongarch_double_float) -# define ABI_FRLEN 64 -# define ABI_FLOAT double -#else -#error unsupported LoongArch floating-point ABI -#endif - -#define NARGREG 8 -#define STKALIGN 16 -#define MAXCOPYARG (2 * sizeof (double)) - -/* call_context registers - - 8 floating point parameter/result registers. - - 8 integer parameter/result registers. - - 2 registers used by the assembly code to in-place construct its own - stack frame - - frame register - - return register -*/ -typedef struct call_context -{ -#if !defined(__loongarch_soft_float) - ABI_FLOAT fa[8]; -#endif - size_t a[10]; -} call_context; - -typedef struct call_builder -{ - call_context *aregs; - int used_integer; - int used_float; - size_t *used_stack; - size_t *stack; - size_t next_struct_area; -} call_builder; - -/* Integer (not pointer) less than ABI GRLEN. */ -/* FFI_TYPE_INT does not appear to be used. */ -#if __SIZEOF_POINTER__ == 8 -# define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT64) -#else -# define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT32) -#endif - -#if ABI_FRLEN -typedef struct float_struct_info -{ - char as_elements; - char type1; - char offset2; - char type2; -} float_struct_info; - -#if ABI_FRLEN >= 64 -# define IS_FLOAT(type) ((type) >= FFI_TYPE_FLOAT && (type) <= FFI_TYPE_DOUBLE) -#else -# define IS_FLOAT(type) ((type) == FFI_TYPE_FLOAT) -#endif - -static ffi_type ** -flatten_struct (ffi_type *in, ffi_type **out, ffi_type **out_end) -{ - int i; - - if (out == out_end) - return out; - if (in->type != FFI_TYPE_STRUCT) - *(out++) = in; - else - for (i = 0; in->elements[i]; i++) - out = flatten_struct (in->elements[i], out, out_end); - return out; -} - -/* Structs with at most two fields after flattening, one of which is of - floating point type, are passed in multiple registers if sufficient - registers are available. */ -static float_struct_info -struct_passed_as_elements (call_builder *cb, ffi_type *top) -{ - float_struct_info ret = {0, 0, 0, 0}; - ffi_type *fields[3]; - int num_floats, num_ints; - int num_fields = flatten_struct (top, fields, fields + 3) - fields; - - if (num_fields == 1) - { - if (IS_FLOAT (fields[0]->type)) - { - ret.as_elements = 1; - ret.type1 = fields[0]->type; - } - } - else if (num_fields == 2) - { - num_floats = IS_FLOAT (fields[0]->type) + IS_FLOAT (fields[1]->type); - num_ints = IS_INT (fields[0]->type) + IS_INT (fields[1]->type); - if (num_floats == 0 || num_floats + num_ints != 2) - return ret; - if (cb->used_float + num_floats > NARGREG - || cb->used_integer + (2 - num_floats) > NARGREG) - return ret; - if (!IS_FLOAT (fields[0]->type) && !IS_FLOAT (fields[1]->type)) - return ret; - - ret.type1 = fields[0]->type; - ret.type2 = fields[1]->type; - ret.offset2 = FFI_ALIGN (fields[0]->size, fields[1]->alignment); - ret.as_elements = 1; - } - return ret; -} -#endif - -/* Allocates a single register, float register, or GRLEN-sized stack slot to a - datum. */ -static void -marshal_atom (call_builder *cb, int type, void *data) -{ - size_t value = 0; - switch (type) - { - case FFI_TYPE_UINT8: - value = *(uint8_t *) data; - break; - case FFI_TYPE_SINT8: - value = *(int8_t *) data; - break; - case FFI_TYPE_UINT16: - value = *(uint16_t *) data; - break; - case FFI_TYPE_SINT16: - value = *(int16_t *) data; - break; - /* 32-bit quantities are always sign-extended in the ABI. */ - case FFI_TYPE_UINT32: - value = *(int32_t *) data; - break; - case FFI_TYPE_SINT32: - value = *(int32_t *) data; - break; -#if __SIZEOF_POINTER__ == 8 - case FFI_TYPE_UINT64: - value = *(uint64_t *) data; - break; - case FFI_TYPE_SINT64: - value = *(int64_t *) data; - break; -#endif - case FFI_TYPE_POINTER: - value = *(size_t *) data; - break; - -#if ABI_FRLEN >= 32 - case FFI_TYPE_FLOAT: - *(float *)(cb->aregs->fa + cb->used_float++) = *(float *) data; - return; -#endif -#if ABI_FRLEN >= 64 - case FFI_TYPE_DOUBLE: - (cb->aregs->fa[cb->used_float++]) = *(double *) data; - return; -#endif - default: - FFI_ASSERT (0); - break; - } - - if (cb->used_integer == NARGREG) - *cb->used_stack++ = value; - else - cb->aregs->a[cb->used_integer++] = value; -} - -static void -unmarshal_atom (call_builder *cb, int type, void *data) -{ - size_t value; - switch (type) - { -#if ABI_FRLEN >= 32 - case FFI_TYPE_FLOAT: - *(float *) data = *(float *)(cb->aregs->fa + cb->used_float++); - return; -#endif -#if ABI_FRLEN >= 64 - case FFI_TYPE_DOUBLE: - *(double *) data = cb->aregs->fa[cb->used_float++]; - return; -#endif - } - - if (cb->used_integer == NARGREG) - value = *cb->used_stack++; - else - value = cb->aregs->a[cb->used_integer++]; - - switch (type) - { - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: -#if __SIZEOF_POINTER__ == 8 - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: -#endif - case FFI_TYPE_POINTER: - *(ffi_arg *)data = value; - break; - default: - FFI_ASSERT (0); - break; - } -} - -/* Allocate and copy a structure that is passed by value on the stack and - return a pointer to it. */ -static void * -allocate_and_copy_struct_to_stack (call_builder *cb, void *data, - ffi_type *type) -{ - size_t dest = cb->next_struct_area - type->size; - - dest = FFI_ALIGN_DOWN (dest, type->alignment); - cb->next_struct_area = dest; - - return memcpy ((char *)cb->stack + dest, data, type->size); -} - -/* Adds an argument to a call, or a not by reference return value. */ -static void -marshal (call_builder *cb, ffi_type *type, int var, void *data) -{ - size_t realign[2]; - -#if ABI_FRLEN - if (!var && type->type == FFI_TYPE_STRUCT) - { - float_struct_info fsi = struct_passed_as_elements (cb, type); - if (fsi.as_elements) - { - marshal_atom (cb, fsi.type1, data); - if (fsi.offset2) - marshal_atom (cb, fsi.type2, ((char *) data) + fsi.offset2); - return; - } - } - - if (!var && cb->used_float < NARGREG - && IS_FLOAT (type->type)) - { - marshal_atom (cb, type->type, data); - return; - } - - double promoted; - if (var && type->type == FFI_TYPE_FLOAT) - { - /* C standard requires promoting float -> double for variable arg. */ - promoted = *(float *) data; - type = &ffi_type_double; - data = &promoted; - } -#endif - - if (type->size > 2 * __SIZEOF_POINTER__) - /* Pass by reference. */ - { - allocate_and_copy_struct_to_stack (cb, data, type); - data = (char *)cb->stack + cb->next_struct_area; - marshal_atom (cb, FFI_TYPE_POINTER, &data); - } - else if (IS_INT (type->type) || type->type == FFI_TYPE_POINTER) - marshal_atom (cb, type->type, data); - else - { - /* Overlong integers, soft-float floats, and structs without special - float handling are treated identically from this point on. */ - - /* Variadics are aligned even in registers. */ - if (type->alignment > __SIZEOF_POINTER__) - { - if (var) - cb->used_integer = FFI_ALIGN (cb->used_integer, 2); - cb->used_stack - = (size_t *) FFI_ALIGN (cb->used_stack, 2 * __SIZEOF_POINTER__); - } - - memcpy (realign, data, type->size); - if (type->size > 0) - marshal_atom (cb, FFI_TYPE_POINTER, realign); - if (type->size > __SIZEOF_POINTER__) - marshal_atom (cb, FFI_TYPE_POINTER, realign + 1); - } -} - -/* For arguments passed by reference returns the pointer, otherwise the arg - is copied (up to MAXCOPYARG bytes). */ -static void * -unmarshal (call_builder *cb, ffi_type *type, int var, void *data) -{ - size_t realign[2]; - void *pointer; - -#if ABI_FRLEN - if (!var && type->type == FFI_TYPE_STRUCT) - { - float_struct_info fsi = struct_passed_as_elements (cb, type); - if (fsi.as_elements) - { - unmarshal_atom (cb, fsi.type1, data); - if (fsi.offset2) - unmarshal_atom (cb, fsi.type2, ((char *) data) + fsi.offset2); - return data; - } - } - - if (!var && cb->used_float < NARGREG - && IS_FLOAT (type->type)) - { - unmarshal_atom (cb, type->type, data); - return data; - } - - if (var && type->type == FFI_TYPE_FLOAT) - { - int m = cb->used_integer; - void *promoted - = m < NARGREG ? cb->aregs->a + m : cb->used_stack + m - NARGREG + 1; - *(float *) promoted = *(double *) promoted; - } -#endif - - if (type->size > 2 * __SIZEOF_POINTER__) - { - /* Pass by reference. */ - unmarshal_atom (cb, FFI_TYPE_POINTER, (char *) &pointer); - return pointer; - } - else if (IS_INT (type->type) || type->type == FFI_TYPE_POINTER) - { - unmarshal_atom (cb, type->type, data); - return data; - } - else - { - /* Overlong integers, soft-float floats, and structs without special - float handling are treated identically from this point on. */ - - /* Variadics are aligned even in registers. */ - if (type->alignment > __SIZEOF_POINTER__) - { - if (var) - cb->used_integer = FFI_ALIGN (cb->used_integer, 2); - cb->used_stack - = (size_t *) FFI_ALIGN (cb->used_stack, 2 * __SIZEOF_POINTER__); - } - - if (type->size > 0) - unmarshal_atom (cb, FFI_TYPE_POINTER, realign); - if (type->size > __SIZEOF_POINTER__) - unmarshal_atom (cb, FFI_TYPE_POINTER, realign + 1); - memcpy (data, realign, type->size); - return data; - } -} - -static int -passed_by_ref (call_builder *cb, ffi_type *type, int var) -{ -#if ABI_FRLEN - if (!var && type->type == FFI_TYPE_STRUCT) - { - float_struct_info fsi = struct_passed_as_elements (cb, type); - if (fsi.as_elements) - return 0; - } -#endif - - return type->size > 2 * __SIZEOF_POINTER__; -} - -/* Perform machine dependent cif processing. */ -ffi_status -ffi_prep_cif_machdep (ffi_cif *cif) -{ - cif->loongarch_nfixedargs = cif->nargs; - return FFI_OK; -} - -/* Perform machine dependent cif processing when we have a variadic - function. */ -ffi_status -ffi_prep_cif_machdep_var (ffi_cif *cif, unsigned int nfixedargs, - unsigned int ntotalargs) -{ - cif->loongarch_nfixedargs = nfixedargs; - return FFI_OK; -} - -/* Low level routine for calling functions. */ -extern void ffi_call_asm (void *stack, struct call_context *regs, - void (*fn) (void), void *closure) FFI_HIDDEN; - -static void -ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, - void *closure) -{ - /* This is a conservative estimate, assuming a complex return value and - that all remaining arguments are long long / __int128 */ - size_t arg_bytes = cif->bytes; - size_t rval_bytes = 0; - if (rvalue == NULL && cif->rtype->size > 2 * __SIZEOF_POINTER__) - rval_bytes = FFI_ALIGN (cif->rtype->size, STKALIGN); - size_t alloc_size = arg_bytes + rval_bytes + sizeof (call_context); - - /* The assembly code will deallocate all stack data at lower addresses - than the argument region, so we need to allocate the frame and the - return value after the arguments in a single allocation. */ - size_t alloc_base; - /* Argument region must be 16-byte aligned in LP64 ABIs. */ - if (_Alignof(max_align_t) >= STKALIGN) - /* Since sizeof long double is normally 16, the compiler will - guarantee alloca alignment to at least that much. */ - alloc_base = (size_t) alloca (alloc_size); - else - alloc_base = FFI_ALIGN (alloca (alloc_size + STKALIGN - 1), STKALIGN); - - if (rval_bytes) - rvalue = (void *) (alloc_base + arg_bytes); - - call_builder cb; - cb.used_float = cb.used_integer = 0; - cb.aregs = (call_context *) (alloc_base + arg_bytes + rval_bytes); - cb.used_stack = (void *) alloc_base; - cb.stack = (void *) alloc_base; - cb.next_struct_area = arg_bytes; - - int return_by_ref = passed_by_ref (&cb, cif->rtype, 0); - if (return_by_ref) - cb.aregs->a[cb.used_integer++] = (size_t)rvalue; - - int i; - for (i = 0; i < cif->nargs; i++) - marshal (&cb, cif->arg_types[i], i >= cif->loongarch_nfixedargs, - avalue[i]); - - ffi_call_asm ((void *) alloc_base, cb.aregs, fn, closure); - - cb.used_float = cb.used_integer = 0; - if (!return_by_ref && rvalue) - unmarshal (&cb, cif->rtype, 0, rvalue); -} - -void -ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) -{ - ffi_call_int (cif, fn, rvalue, avalue, NULL); -} - -void -ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, - void *closure) -{ - ffi_call_int (cif, fn, rvalue, avalue, closure); -} - -extern void ffi_closure_asm (void) FFI_HIDDEN; - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, void *codeloc) -{ - uint32_t *tramp = (uint32_t *) &closure->tramp[0]; - uint64_t fn = (uint64_t) (uintptr_t) ffi_closure_asm; - - if (cif->abi <= FFI_FIRST_ABI || cif->abi >= FFI_LAST_ABI) - return FFI_BAD_ABI; - -#if defined(FFI_EXEC_STATIC_TRAMP) - if (ffi_tramp_is_present(closure)) - { - ffi_tramp_set_parms (closure->ftramp, ffi_closure_asm, closure); - goto out; - } -#endif - - /* Fill the dynamic trampoline. We will call ffi_closure_inner with codeloc, - not closure, but as long as the memory is readable it should work. */ - tramp[0] = 0x1800000c; /* pcaddi $t0, 0 (i.e. $t0 <- tramp) */ - tramp[1] = 0x28c0418d; /* ld.d $t1, $t0, 16 */ - tramp[2] = 0x4c0001a0; /* jirl $zero, $t1, 0 */ - tramp[3] = 0x03400000; /* nop */ - tramp[4] = fn; - tramp[5] = fn >> 32; - - __builtin___clear_cache (codeloc, codeloc + FFI_TRAMPOLINE_SIZE); - -#if defined(FFI_EXEC_STATIC_TRAMP) -out: -#endif - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - -extern void ffi_go_closure_asm (void) FFI_HIDDEN; - -ffi_status -ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *)) -{ - if (cif->abi <= FFI_FIRST_ABI || cif->abi >= FFI_LAST_ABI) - return FFI_BAD_ABI; - - closure->tramp = (void *) ffi_go_closure_asm; - closure->cif = cif; - closure->fun = fun; - return FFI_OK; -} - -/* Called by the assembly code with aregs pointing to saved argument registers - and stack pointing to the stacked arguments. Return values passed in - registers will be reloaded from aregs. */ -void FFI_HIDDEN -ffi_closure_inner (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, size_t *stack, call_context *aregs) -{ - void **avalue = alloca (cif->nargs * sizeof (void *)); - /* Storage for arguments which will be copied by unmarshal(). We could - theoretically avoid the copies in many cases and use at most 128 bytes - of memory, but allocating disjoint storage for each argument is - simpler. */ - char *astorage = alloca (cif->nargs * MAXCOPYARG); - void *rvalue; - call_builder cb; - int return_by_ref; - int i; - - cb.aregs = aregs; - cb.used_integer = cb.used_float = 0; - cb.used_stack = stack; - - return_by_ref = passed_by_ref (&cb, cif->rtype, 0); - if (return_by_ref) - unmarshal (&cb, &ffi_type_pointer, 0, &rvalue); - else - rvalue = alloca (cif->rtype->size); - - for (i = 0; i < cif->nargs; i++) - avalue[i] - = unmarshal (&cb, cif->arg_types[i], i >= cif->loongarch_nfixedargs, - astorage + i * MAXCOPYARG); - - fun (cif, rvalue, avalue, user_data); - - if (!return_by_ref && cif->rtype->type != FFI_TYPE_VOID) - { - cb.used_integer = cb.used_float = 0; - marshal (&cb, cif->rtype, 0, rvalue); - } -} - -#if defined(FFI_EXEC_STATIC_TRAMP) -void * -ffi_tramp_arch (size_t *tramp_size, size_t *map_size) -{ - extern void *trampoline_code_table; - - *tramp_size = 16; - /* A mapping size of 64K is chosen to cover the page sizes of 4K, 16K, and - 64K. */ - *map_size = 1 << 16; - return &trampoline_code_table; -} -#endif diff --git a/deps/libffi/src/loongarch64/ffitarget.h b/deps/libffi/src/loongarch64/ffitarget.h deleted file mode 100644 index 5a4698af308d0a..00000000000000 --- a/deps/libffi/src/loongarch64/ffitarget.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2022 Xu Chenghua - 2022 Cheng Lulu - - Target configuration macros for LoongArch. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error \ - "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef __loongarch__ -#error \ - "libffi was configured for a LoongArch target but this does not appear to be a LoongArch compiler." -#endif - -#ifndef LIBFFI_ASM - -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi -{ - FFI_FIRST_ABI = 0, - FFI_LP64S, - FFI_LP64F, - FFI_LP64D, - FFI_LAST_ABI, - -#if defined(__loongarch64) -#if defined(__loongarch_soft_float) - FFI_DEFAULT_ABI = FFI_LP64S -#elif defined(__loongarch_single_float) - FFI_DEFAULT_ABI = FFI_LP64F -#elif defined(__loongarch_double_float) - FFI_DEFAULT_ABI = FFI_LP64D -#else -#error unsupported LoongArch floating-point ABI -#endif -#else -#error unsupported LoongArch base architecture -#endif -} ffi_abi; - -#endif /* LIBFFI_ASM */ - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 24 -#define FFI_NATIVE_RAW_API 0 -#define FFI_EXTRA_CIF_FIELDS \ - unsigned loongarch_nfixedargs; \ - unsigned loongarch_unused; -#define FFI_TARGET_SPECIFIC_VARIADIC -#endif diff --git a/deps/libffi/src/loongarch64/sysv.S b/deps/libffi/src/loongarch64/sysv.S deleted file mode 100644 index aa7bde2c1efcee..00000000000000 --- a/deps/libffi/src/loongarch64/sysv.S +++ /dev/null @@ -1,327 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2022 Xu Chenghua - 2022 Cheng Lulu - - LoongArch Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -/* Define aliases so that we can handle all ABIs uniformly. */ - -#if __SIZEOF_POINTER__ == 8 -# define PTRS 8 -# define LARG ld.d -# define SARG st.d -#else -# define PTRS 4 -# define LARG ld.w -# define SARG st.w -#endif - -#if defined(__loongarch_single_float) -# define FLTS 4 -# define FLD fld.w -# define FST fst.w -#elif defined(__loongarch_double_float) -# define FLTS 8 -# define FLARG fld.d -# define FSARG fst.d -#elif defined(__loongarch_soft_float) -# define FLTS 0 -#else -#error unsupported LoongArch floating-point ABI -#endif - - .text - .globl ffi_call_asm - .type ffi_call_asm, @function - .hidden ffi_call_asm -/* struct call_context - { - ABI_FLOAT fa[8]; - size_t a[10]; - } - - - 8 floating point parameter/result registers (fa[0] - fa[7]) - - 8 integer parameter/result registers (a[0] - a[7]) - - 2 registers used by the assembly code to in-place construct its own stack - frame. - - frame pointer (a[8]) - - return address (a[9]) - - void ffi_call_asm (size_t *stackargs, struct call_context *regargs, - void (*fn)(void), void *closure); */ - -#define FRAME_LEN (8 * FLTS + 10 * PTRS) - -ffi_call_asm: - .cfi_startproc - - /* We are NOT going to set up an ordinary stack frame. In order to pass - the stacked args to the called function, we adjust our stack pointer - to a0, which is in the _caller's_ alloca area. We establish our own - stack frame at the end of the call_context. - - Anything below the arguments will be freed at this point, although - we preserve the call_context so that it can be read back in the - caller. */ - - .cfi_def_cfa 5, FRAME_LEN # Interim CFA based on a1. - SARG $fp, $a1, FRAME_LEN - 2*PTRS - .cfi_offset 22, -2*PTRS - SARG $ra, $a1, FRAME_LEN - 1*PTRS - .cfi_offset 1, -1*PTRS - - addi.d $fp, $a1, FRAME_LEN - move $sp, $a0 - .cfi_def_cfa 22, 0 # Our frame is fully set up. - - # Load arguments. - move $t1, $a2 - move $t2, $a3 - -#if FLTS - FLARG $fa0, $fp, -FRAME_LEN+0*FLTS - FLARG $fa1, $fp, -FRAME_LEN+1*FLTS - FLARG $fa2, $fp, -FRAME_LEN+2*FLTS - FLARG $fa3, $fp, -FRAME_LEN+3*FLTS - FLARG $fa4, $fp, -FRAME_LEN+4*FLTS - FLARG $fa5, $fp, -FRAME_LEN+5*FLTS - FLARG $fa6, $fp, -FRAME_LEN+6*FLTS - FLARG $fa7, $fp, -FRAME_LEN+7*FLTS -#endif - - LARG $a0, $fp, -FRAME_LEN+8*FLTS+0*PTRS - LARG $a1, $fp, -FRAME_LEN+8*FLTS+1*PTRS - LARG $a2, $fp, -FRAME_LEN+8*FLTS+2*PTRS - LARG $a3, $fp, -FRAME_LEN+8*FLTS+3*PTRS - LARG $a4, $fp, -FRAME_LEN+8*FLTS+4*PTRS - LARG $a5, $fp, -FRAME_LEN+8*FLTS+5*PTRS - LARG $a6, $fp, -FRAME_LEN+8*FLTS+6*PTRS - LARG $a7, $fp, -FRAME_LEN+8*FLTS+7*PTRS - - /* Call */ - jirl $ra, $t1, 0 - -#if FLTS - /* Save return values - only a0/a1 (fa0/fa1) are used. */ - FSARG $fa0, $fp, -FRAME_LEN+0*FLTS - FSARG $fa1, $fp, -FRAME_LEN+1*FLTS -#endif - - SARG $a0, $fp, -FRAME_LEN+8*FLTS+0*PTRS - SARG $a1, $fp, -FRAME_LEN+8*FLTS+1*PTRS - - /* Restore and return. */ - addi.d $sp, $fp, -FRAME_LEN - .cfi_def_cfa 3, FRAME_LEN - LARG $ra, $fp, -1*PTRS - .cfi_restore 1 - LARG $fp, $fp, -2*PTRS - .cfi_restore 22 - jr $ra - .cfi_endproc - .size ffi_call_asm, .-ffi_call_asm - - -/* ffi_closure_asm. Expects address of the passed-in ffi_closure in t0. - void ffi_closure_inner (ffi_cif *cif, - void (*fun)(ffi_cif *, void *, void **, void *), - void *user_data, - size_t *stackargs, struct call_context *regargs) */ - - .globl ffi_closure_asm - .hidden ffi_closure_asm - .type ffi_closure_asm, @function - -ffi_closure_asm: - .cfi_startproc - addi.d $sp, $sp, -FRAME_LEN - .cfi_def_cfa_offset FRAME_LEN - - /* Make a frame. */ - SARG $fp, $sp, FRAME_LEN - 2*PTRS - .cfi_offset 22, -2*PTRS - SARG $ra, $sp, FRAME_LEN - 1*PTRS - .cfi_offset 1, -1*PTRS - addi.d $fp, $sp, FRAME_LEN - - /* Save arguments. */ -#if FLTS - FSARG $fa0, $sp, 0*FLTS - FSARG $fa1, $sp, 1*FLTS - FSARG $fa2, $sp, 2*FLTS - FSARG $fa3, $sp, 3*FLTS - FSARG $fa4, $sp, 4*FLTS - FSARG $fa5, $sp, 5*FLTS - FSARG $fa6, $sp, 6*FLTS - FSARG $fa7, $sp, 7*FLTS -#endif - - SARG $a0, $sp, 8*FLTS+0*PTRS - SARG $a1, $sp, 8*FLTS+1*PTRS - SARG $a2, $sp, 8*FLTS+2*PTRS - SARG $a3, $sp, 8*FLTS+3*PTRS - SARG $a4, $sp, 8*FLTS+4*PTRS - SARG $a5, $sp, 8*FLTS+5*PTRS - SARG $a6, $sp, 8*FLTS+6*PTRS - SARG $a7, $sp, 8*FLTS+7*PTRS - - /* Enter C */ - LARG $a0, $t0, FFI_TRAMPOLINE_SIZE+0*PTRS - LARG $a1, $t0, FFI_TRAMPOLINE_SIZE+1*PTRS - LARG $a2, $t0, FFI_TRAMPOLINE_SIZE+2*PTRS - addi.d $a3, $sp, FRAME_LEN - move $a4, $sp - - bl ffi_closure_inner - - /* Return values. */ -#if FLTS - FLARG $fa0, $sp, 0*FLTS - FLARG $fa1, $sp, 1*FLTS -#endif - - LARG $a0, $sp, 8*FLTS+0*PTRS - LARG $a1, $sp, 8*FLTS+1*PTRS - - /* Restore and return. */ - LARG $ra, $sp, FRAME_LEN-1*PTRS - .cfi_restore 1 - LARG $fp, $sp, FRAME_LEN-2*PTRS - .cfi_restore 22 - addi.d $sp, $sp, FRAME_LEN - .cfi_def_cfa_offset 0 - jr $ra - .cfi_endproc - .size ffi_closure_asm, .-ffi_closure_asm - -/* Static trampoline code table, in which each element is a trampoline. - - The trampoline clobbers t0 and t1, but we don't save them on the stack - because our psABI explicitly says they are scratch registers, at least for - ELF. Our dynamic trampoline is already clobbering them anyway. - - The trampoline has two parameters - target code to jump to and data for - the target code. The trampoline extracts the parameters from its parameter - block (see tramp_table_map()). The trampoline saves the data address in - t0 and jumps to the target code. As ffi_closure_asm() already expects the - data address to be in t0, we don't need a "ffi_closure_asm_alt". */ - -#if defined(FFI_EXEC_STATIC_TRAMP) - .align 16 - .globl trampoline_code_table - .hidden trampoline_code_table - .type trampoline_code_table, @function - -trampoline_code_table: - - .rept 65536 / 16 - pcaddu12i $t1, 16 # 65536 >> 12 - ld.d $t0, $t1, 0 - ld.d $t1, $t1, 8 - jirl $zero, $t1, 0 - .endr - .size trampoline_code_table, .-trampoline_code_table - - .align 2 -#endif - -/* ffi_go_closure_asm. Expects address of the passed-in ffi_go_closure in t2. - void ffi_closure_inner (ffi_cif *cif, - void (*fun)(ffi_cif *, void *, void **, void *), - void *user_data, - size_t *stackargs, struct call_context *regargs) */ - - .globl ffi_go_closure_asm - .hidden ffi_go_closure_asm - .type ffi_go_closure_asm, @function - -ffi_go_closure_asm: - .cfi_startproc - addi.d $sp, $sp, -FRAME_LEN - .cfi_def_cfa_offset FRAME_LEN - - /* Make a frame. */ - SARG $fp, $sp, FRAME_LEN - 2*PTRS - .cfi_offset 22, -2*PTRS - SARG $ra, $sp, FRAME_LEN - 1*PTRS - .cfi_offset 1, -1*PTRS - addi.d $fp, $sp, FRAME_LEN - - /* Save arguments. */ -#if FLTS - FSARG $fa0, $sp, 0*FLTS - FSARG $fa1, $sp, 1*FLTS - FSARG $fa2, $sp, 2*FLTS - FSARG $fa3, $sp, 3*FLTS - FSARG $fa4, $sp, 4*FLTS - FSARG $fa5, $sp, 5*FLTS - FSARG $fa6, $sp, 6*FLTS - FSARG $fa7, $sp, 7*FLTS -#endif - - SARG $a0, $sp, 8*FLTS+0*PTRS - SARG $a1, $sp, 8*FLTS+1*PTRS - SARG $a2, $sp, 8*FLTS+2*PTRS - SARG $a3, $sp, 8*FLTS+3*PTRS - SARG $a4, $sp, 8*FLTS+4*PTRS - SARG $a5, $sp, 8*FLTS+5*PTRS - SARG $a6, $sp, 8*FLTS+6*PTRS - SARG $a7, $sp, 8*FLTS+7*PTRS - - /* Enter C */ - LARG $a0, $t2, 1*PTRS - LARG $a1, $t2, 2*PTRS - move $a2, $t2 - addi.d $a3, $sp, FRAME_LEN - move $a4, $sp - - bl ffi_closure_inner - - /* Return values. */ -#if FLTS - FLARG $fa0, $sp, 0*FLTS - FLARG $fa1, $sp, 1*FLTS -#endif - - LARG $a0, $sp, 8*FLTS+0*PTRS - LARG $a1, $sp, 8*FLTS+1*PTRS - - /* Restore and return. */ - LARG $ra, $sp, FRAME_LEN-1*PTRS - .cfi_restore 1 - LARG $fp, $sp, FRAME_LEN-2*PTRS - .cfi_restore 22 - addi.d $sp, $sp, FRAME_LEN - .cfi_def_cfa_offset 0 - jr $ra - .cfi_endproc - .size ffi_go_closure_asm, .-ffi_go_closure_asm - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",%progbits -#endif diff --git a/deps/libffi/src/m32r/ffi.c b/deps/libffi/src/m32r/ffi.c deleted file mode 100644 index 6fab50b115ed24..00000000000000 --- a/deps/libffi/src/m32r/ffi.c +++ /dev/null @@ -1,249 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2004 Renesas Technology - Copyright (c) 2008 Red Hat, Inc. - Copyright (c) 2022 Anthony Green - - M32R Foreign Function Interface - - 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 RENESAS TECHNOLOGY 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include - -/* ffi_prep_args is called by the assembly routine once stack - space has been allocated for the function's arguments. */ - -void ffi_prep_args(char *stack, extended_cif *ecif) -{ - unsigned int i; - int tmp; - unsigned int avn; - void **p_argv; - char *argp; - ffi_type **p_arg; - - tmp = 0; - argp = stack; - - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 8) - { - *(void **) argp = ecif->rvalue; - argp += 4; - } - - avn = ecif->cif->nargs; - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; - (i != 0) && (avn != 0); - i--, p_arg++) - { - size_t z; - - /* Align if necessary. */ - if (((*p_arg)->alignment - 1) & (unsigned) argp) - argp = (char *) FFI_ALIGN (argp, (*p_arg)->alignment); - - if (avn != 0) - { - avn--; - z = (*p_arg)->size; - if (z < sizeof (int)) - { - z = sizeof (int); - - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); - break; - - case FFI_TYPE_STRUCT: - z = (*p_arg)->size; - if ((*p_arg)->alignment != 1) - memcpy (argp, *p_argv, z); - else - memcpy (argp + 4 - z, *p_argv, z); - z = sizeof (int); - break; - - default: - FFI_ASSERT(0); - } - } - else if (z == sizeof (int)) - { - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - } - else - { - if ((*p_arg)->type == FFI_TYPE_STRUCT) - { - if (z > 8) - { - *(unsigned int *) argp = (unsigned int)(void *)(* p_argv); - z = sizeof(void *); - } - else - { - memcpy(argp, *p_argv, z); - z = 8; - } - } - else - { - /* Double or long long 64bit. */ - memcpy (argp, *p_argv, z); - } - } - p_argv++; - argp += z; - } - } - - return; -} - -/* Perform machine dependent cif processing. */ -ffi_status -ffi_prep_cif_machdep(ffi_cif *cif) -{ - /* Set the return type flag. */ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - cif->flags = (unsigned) cif->rtype->type; - break; - - case FFI_TYPE_STRUCT: - if (cif->rtype->size <= 4) - cif->flags = FFI_TYPE_INT; - - else if (cif->rtype->size <= 8) - cif->flags = FFI_TYPE_DOUBLE; - - else - cif->flags = (unsigned) cif->rtype->type; - break; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_DOUBLE: - cif->flags = FFI_TYPE_DOUBLE; - break; - - case FFI_TYPE_FLOAT: - default: - cif->flags = FFI_TYPE_INT; - break; - } - - return FFI_OK; -} - -extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)(void)); - -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - extended_cif ecif; - ffi_type **arg_types = cif->arg_types; - int i, nargs = cif->nargs; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have - a return value address then we need to make one. */ - if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) - { - ecif.rvalue = alloca (cif->rtype->size); - } - else - ecif.rvalue = rvalue; - - /* If we have any large structure arguments, make a copy so we are passing - by value. */ - for (i = 0; i < nargs; i++) - { - ffi_type *at = arg_types[i]; - int size = at->size; - if (at->type == FFI_TYPE_STRUCT && size > 4) - { - char *argcopy = alloca (size); - memcpy (argcopy, avalue[i], size); - avalue[i] = argcopy; - } - } - - switch (cif->abi) - { - case FFI_SYSV: - ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - if (cif->rtype->type == FFI_TYPE_STRUCT) - { - int size = cif->rtype->size; - int align = cif->rtype->alignment; - - if (size < 4) - { - if (align == 1) - *(unsigned long *)(ecif.rvalue) <<= (4 - size) * 8; - } - else if (4 < size && size < 8) - { - if (align == 1) - { - memcpy (ecif.rvalue, ecif.rvalue + 8-size, size); - } - else if (align == 2) - { - if (size & 1) - size += 1; - - if (size != 8) - memcpy (ecif.rvalue, ecif.rvalue + 8-size, size); - } - } - } - break; - - default: - FFI_ASSERT(0); - break; - } -} diff --git a/deps/libffi/src/m32r/ffitarget.h b/deps/libffi/src/m32r/ffitarget.h deleted file mode 100644 index 6c34801982f6ed..00000000000000 --- a/deps/libffi/src/m32r/ffitarget.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 2004 Renesas Technology. - Target configuration macros for M32R. - - 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 RENESAS TECHNOLOGY 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- Generic type definitions ----------------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi - { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV - } ffi_abi; -#endif - -#define FFI_CLOSURES 0 -#define FFI_TRAMPOLINE_SIZE 24 -#define FFI_NATIVE_RAW_API 0 - -#endif diff --git a/deps/libffi/src/m32r/sysv.S b/deps/libffi/src/m32r/sysv.S deleted file mode 100644 index 06b75c22634a67..00000000000000 --- a/deps/libffi/src/m32r/sysv.S +++ /dev/null @@ -1,121 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2004 Renesas Technology - - M32R Foreign Function Interface - - 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 RENESAS TECHNOLOGY 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#ifdef HAVE_MACHINE_ASM_H -#include -#else -/* XXX these lose for some platforms, I'm sure. */ -#define CNAME(x) x -#define ENTRY(x) .globl CNAME(x)! .type CNAME(x),%function! CNAME(x): -#endif - -.text - - /* R0: ffi_prep_args */ - /* R1: &ecif */ - /* R2: cif->bytes */ - /* R3: fig->flags */ - /* sp+0: ecif.rvalue */ - /* sp+4: fn */ - - /* This assumes we are using gas. */ -ENTRY(ffi_call_SYSV) - /* Save registers. */ - push fp - push lr - push r3 - push r2 - push r1 - push r0 - mv fp, sp - - /* Make room for all of the new args. */ - sub sp, r2 - - /* Place all of the ffi_prep_args in position. */ - mv lr, r0 - mv r0, sp - /* R1 already set. */ - - /* And call. */ - jl lr - - /* Move first 4 parameters in registers... */ - ld r0, @(0,sp) - ld r1, @(4,sp) - ld r2, @(8,sp) - ld r3, @(12,sp) - - /* ...and adjust the stack. */ - ld lr, @(8,fp) - cmpi lr, #16 - bc adjust_stack - ldi lr, #16 -adjust_stack: - add sp, lr - - /* Call the function. */ - ld lr, @(28,fp) - jl lr - - /* Remove the space we pushed for the args. */ - mv sp, fp - - /* Load R2 with the pointer to storage for the return value. */ - ld r2, @(24,sp) - - /* Load R3 with the return type code. */ - ld r3, @(12,sp) - - /* If the return value pointer is NULL, assume no return value. */ - beqz r2, epilogue - - /* Return INT. */ - ldi r4, #FFI_TYPE_INT - bne r3, r4, return_double - st r0, @r2 - bra epilogue - -return_double: - /* Return DOUBLE or LONGDOUBLE. */ - ldi r4, #FFI_TYPE_DOUBLE - bne r3, r4, epilogue - st r0, @r2 - st r1, @(4,r2) - -epilogue: - pop r0 - pop r1 - pop r2 - pop r3 - pop lr - pop fp - jmp lr - -.ffi_call_SYSV_end: - .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) diff --git a/deps/libffi/src/m68k/ffi.c b/deps/libffi/src/m68k/ffi.c deleted file mode 100644 index 033018480ca933..00000000000000 --- a/deps/libffi/src/m68k/ffi.c +++ /dev/null @@ -1,362 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - - m68k Foreign Function Interface - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include -#ifdef __rtems__ -void rtems_cache_flush_multiple_data_lines( const void *, size_t ); -#else -#include -#ifdef __MINT__ -#include -#include -#else -#include -#endif -#endif - -void ffi_call_SYSV (extended_cif *, - unsigned, unsigned, - void *, void (*fn) ()); -void *ffi_prep_args (void *stack, extended_cif *ecif); -void ffi_closure_SYSV (ffi_closure *); -void ffi_closure_struct_SYSV (ffi_closure *); -unsigned int ffi_closure_SYSV_inner (ffi_closure *closure, - void *resp, void *args); - -/* ffi_prep_args is called by the assembly routine once stack space has - been allocated for the function's arguments. */ - -void * -ffi_prep_args (void *stack, extended_cif *ecif) -{ - unsigned int i; - void **p_argv; - char *argp; - ffi_type **p_arg; - void *struct_value_ptr; - - argp = stack; - - if ( -#ifdef __MINT__ - (ecif->cif->rtype->type == FFI_TYPE_LONGDOUBLE) || -#endif - (((ecif->cif->rtype->type == FFI_TYPE_STRUCT) - && !ecif->cif->flags))) - struct_value_ptr = ecif->rvalue; - else - struct_value_ptr = NULL; - - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; - i != 0; - i--, p_arg++) - { - size_t z = (*p_arg)->size; - int type = (*p_arg)->type; - - if (z < sizeof (int)) - { - switch (type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int) *(SINT8 *) *p_argv; - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv; - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int) *(SINT16 *) *p_argv; - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv; - break; - - case FFI_TYPE_STRUCT: -#ifdef __MINT__ - if (z == 1 || z == 2) - memcpy (argp + 2, *p_argv, z); - else - memcpy (argp, *p_argv, z); -#else - memcpy (argp + sizeof (int) - z, *p_argv, z); -#endif - break; - - default: - FFI_ASSERT (0); - } - z = sizeof (int); - } - else - { - memcpy (argp, *p_argv, z); - - /* Align if necessary. */ - if ((sizeof(int) - 1) & z) - z = FFI_ALIGN(z, sizeof(int)); - } - - p_argv++; - argp += z; - } - - return struct_value_ptr; -} - -#define CIF_FLAGS_INT 1 -#define CIF_FLAGS_DINT 2 -#define CIF_FLAGS_FLOAT 4 -#define CIF_FLAGS_DOUBLE 8 -#define CIF_FLAGS_LDOUBLE 16 -#define CIF_FLAGS_POINTER 32 -#define CIF_FLAGS_STRUCT1 64 -#define CIF_FLAGS_STRUCT2 128 -#define CIF_FLAGS_SINT8 256 -#define CIF_FLAGS_SINT16 512 - -/* Perform machine dependent cif processing */ -ffi_status -ffi_prep_cif_machdep (ffi_cif *cif) -{ - /* Set the return type flag */ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - cif->flags = 0; - break; - - case FFI_TYPE_STRUCT: - if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT && - cif->rtype->elements[1]) - { - cif->flags = 0; - break; - } - - switch (cif->rtype->size) - { - case 1: -#ifdef __MINT__ - cif->flags = CIF_FLAGS_STRUCT2; -#else - cif->flags = CIF_FLAGS_STRUCT1; -#endif - break; - case 2: - cif->flags = CIF_FLAGS_STRUCT2; - break; -#ifdef __MINT__ - case 3: -#endif - case 4: - cif->flags = CIF_FLAGS_INT; - break; -#ifdef __MINT__ - case 7: -#endif - case 8: - cif->flags = CIF_FLAGS_DINT; - break; - default: - cif->flags = 0; - break; - } - break; - - case FFI_TYPE_FLOAT: - cif->flags = CIF_FLAGS_FLOAT; - break; - - case FFI_TYPE_DOUBLE: - cif->flags = CIF_FLAGS_DOUBLE; - break; - -#if (FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE) - case FFI_TYPE_LONGDOUBLE: -#ifdef __MINT__ - cif->flags = 0; -#else - cif->flags = CIF_FLAGS_LDOUBLE; -#endif - break; -#endif - - case FFI_TYPE_POINTER: - cif->flags = CIF_FLAGS_POINTER; - break; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - cif->flags = CIF_FLAGS_DINT; - break; - - case FFI_TYPE_SINT16: - cif->flags = CIF_FLAGS_SINT16; - break; - - case FFI_TYPE_SINT8: - cif->flags = CIF_FLAGS_SINT8; - break; - - default: - cif->flags = CIF_FLAGS_INT; - break; - } - - return FFI_OK; -} - -void -ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue) -{ - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return value - address then we need to make one. */ - - if (rvalue == NULL - && cif->rtype->type == FFI_TYPE_STRUCT - && cif->rtype->size > 8) - ecif.rvalue = alloca (cif->rtype->size); - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_SYSV: - ffi_call_SYSV (&ecif, cif->bytes, cif->flags, - ecif.rvalue, fn); - break; - - default: - FFI_ASSERT (0); - break; - } -} - -static void -ffi_prep_incoming_args_SYSV (char *stack, void **avalue, ffi_cif *cif) -{ - unsigned int i; - void **p_argv; - char *argp; - ffi_type **p_arg; - - argp = stack; - p_argv = avalue; - - for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) - { - size_t z; - - z = (*p_arg)->size; -#ifdef __MINT__ - if (cif->flags && - cif->rtype->type == FFI_TYPE_STRUCT && - (z == 1 || z == 2)) - { - *p_argv = (void *) (argp + 2); - - z = 4; - } - else - if (cif->flags && - cif->rtype->type == FFI_TYPE_STRUCT && - (z == 3 || z == 4)) - { - *p_argv = (void *) (argp); - - z = 4; - } - else -#endif - if (z <= 4) - { - *p_argv = (void *) (argp + 4 - z); - - z = 4; - } - else - { - *p_argv = (void *) argp; - - /* Align if necessary */ - if ((sizeof(int) - 1) & z) - z = FFI_ALIGN(z, sizeof(int)); - } - - p_argv++; - argp += z; - } -} - -unsigned int -ffi_closure_SYSV_inner (ffi_closure *closure, void *resp, void *args) -{ - ffi_cif *cif; - void **arg_area; - - cif = closure->cif; - arg_area = (void**) alloca (cif->nargs * sizeof (void *)); - - ffi_prep_incoming_args_SYSV(args, arg_area, cif); - - (closure->fun) (cif, resp, arg_area, closure->user_data); - - return cif->flags; -} - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - *(unsigned short *)closure->tramp = 0x207c; - *(void **)(closure->tramp + 2) = codeloc; - *(unsigned short *)(closure->tramp + 6) = 0x4ef9; - - if ( -#ifdef __MINT__ - (cif->rtype->type == FFI_TYPE_LONGDOUBLE) || -#endif - (((cif->rtype->type == FFI_TYPE_STRUCT) - && !cif->flags))) - *(void **)(closure->tramp + 8) = ffi_closure_struct_SYSV; - else - *(void **)(closure->tramp + 8) = ffi_closure_SYSV; - -#ifdef __rtems__ - rtems_cache_flush_multiple_data_lines( codeloc, FFI_TRAMPOLINE_SIZE ); -#elif defined(__MINT__) - Ssystem(S_FLUSHCACHE, codeloc, FFI_TRAMPOLINE_SIZE); -#else - syscall(SYS_cacheflush, codeloc, FLUSH_SCOPE_LINE, - FLUSH_CACHE_BOTH, FFI_TRAMPOLINE_SIZE); -#endif - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; -} diff --git a/deps/libffi/src/m68k/ffitarget.h b/deps/libffi/src/m68k/ffitarget.h deleted file mode 100644 index e81dde2b2eb404..00000000000000 --- a/deps/libffi/src/m68k/ffitarget.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for Motorola 68K. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 16 -#define FFI_NATIVE_RAW_API 0 - -#endif - diff --git a/deps/libffi/src/m68k/sysv.S b/deps/libffi/src/m68k/sysv.S deleted file mode 100644 index ea40f1100ba9e4..00000000000000 --- a/deps/libffi/src/m68k/sysv.S +++ /dev/null @@ -1,357 +0,0 @@ -/* ----------------------------------------------------------------------- - - sysv.S - Copyright (c) 2012 Alan Hourihane - Copyright (c) 1998, 2012 Andreas Schwab - Copyright (c) 2008 Red Hat, Inc. - Copyright (c) 2012, 2016 Thorsten Glaser - - m68k Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -#ifdef HAVE_AS_CFI_PSEUDO_OP -#define CFI_STARTPROC() .cfi_startproc -#define CFI_OFFSET(reg,off) .cfi_offset reg,off -#define CFI_DEF_CFA(reg,off) .cfi_def_cfa reg,off -#define CFI_ENDPROC() .cfi_endproc -#else -#define CFI_STARTPROC() -#define CFI_OFFSET(reg,off) -#define CFI_DEF_CFA(reg,off) -#define CFI_ENDPROC() -#endif - -#ifdef __MINT__ -#define CALLFUNC(funcname) _ ## funcname -#else -#define CALLFUNC(funcname) funcname -#endif - - .text - - .globl CALLFUNC(ffi_call_SYSV) - .type CALLFUNC(ffi_call_SYSV),@function - .align 4 - -CALLFUNC(ffi_call_SYSV): - CFI_STARTPROC() - link %fp,#0 - CFI_OFFSET(14,-8) - CFI_DEF_CFA(14,8) - move.l %d2,-(%sp) - CFI_OFFSET(2,-12) - - | Make room for all of the new args. - sub.l 12(%fp),%sp - - | Call ffi_prep_args - move.l 8(%fp),-(%sp) - pea 4(%sp) -#if !defined __PIC__ - jsr CALLFUNC(ffi_prep_args) -#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__) - move.l _current_shared_library_a5_offset_(%a5),%a0 - move.l CALLFUNC(ffi_prep_args@GOT)(%a0),%a0 - jsr (%a0) -#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__) - move.l #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0 - lea (-6,%pc,%a0),%a0 - move.l CALLFUNC(ffi_prep_args@GOT)(%a0),%a0 - jsr (%a0) -#else - bsr.l CALLFUNC(ffi_prep_args@PLTPC) -#endif - addq.l #8,%sp - - | Pass pointer to struct value, if any -#ifdef __MINT__ - move.l %d0,%a1 -#else - move.l %a0,%a1 -#endif - - | Call the function - move.l 24(%fp),%a0 - jsr (%a0) - - | Remove the space we pushed for the args - add.l 12(%fp),%sp - - | Load the pointer to storage for the return value - move.l 20(%fp),%a1 - - | Load the return type code - move.l 16(%fp),%d2 - - | If the return value pointer is NULL, assume no return value. - | NOTE: On the mc68000, tst on an address register is not supported. -#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__) - cmp.w #0, %a1 -#else - tst.l %a1 -#endif - jbeq noretval - - btst #0,%d2 - jbeq retlongint - move.l %d0,(%a1) - jbra epilogue - -retlongint: - btst #1,%d2 - jbeq retfloat - move.l %d0,(%a1) - move.l %d1,4(%a1) - jbra epilogue - -retfloat: - btst #2,%d2 - jbeq retdouble -#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.s %fp0,(%a1) -#else - move.l %d0,(%a1) -#endif - jbra epilogue - -retdouble: - btst #3,%d2 - jbeq retlongdouble -#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.d %fp0,(%a1) -#else - move.l %d0,(%a1)+ - move.l %d1,(%a1) -#endif - jbra epilogue - -retlongdouble: - btst #4,%d2 - jbeq retpointer -#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.x %fp0,(%a1) -#else - move.l %d0,(%a1)+ - move.l %d1,(%a1)+ - move.l %d2,(%a1) -#endif - jbra epilogue - -retpointer: - btst #5,%d2 - jbeq retstruct1 -#ifdef __MINT__ - move.l %d0,(%a1) -#else - move.l %a0,(%a1) -#endif - jbra epilogue - -retstruct1: - btst #6,%d2 - jbeq retstruct2 - move.b %d0,(%a1) - jbra epilogue - -retstruct2: - btst #7,%d2 - jbeq retsint8 - move.w %d0,(%a1) - jbra epilogue - -retsint8: - btst #8,%d2 - jbeq retsint16 - | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32. -#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__) - ext.w %d0 - ext.l %d0 -#else - extb.l %d0 -#endif - move.l %d0,(%a1) - jbra epilogue - -retsint16: - btst #9,%d2 - jbeq noretval - ext.l %d0 - move.l %d0,(%a1) - -noretval: -epilogue: - move.l (%sp)+,%d2 - unlk %fp - rts - CFI_ENDPROC() - .size CALLFUNC(ffi_call_SYSV),.-CALLFUNC(ffi_call_SYSV) - - .globl CALLFUNC(ffi_closure_SYSV) - .type CALLFUNC(ffi_closure_SYSV), @function - .align 4 - -CALLFUNC(ffi_closure_SYSV): - CFI_STARTPROC() - link %fp,#-12 - CFI_OFFSET(14,-8) - CFI_DEF_CFA(14,8) - move.l %sp,-12(%fp) - pea 8(%fp) - pea -12(%fp) - move.l %a0,-(%sp) -#if !defined __PIC__ - jsr CALLFUNC(ffi_closure_SYSV_inner) -#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__) - move.l _current_shared_library_a5_offset_(%a5),%a0 - move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0 - jsr (%a0) -#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__) - move.l #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0 - lea (-6,%pc,%a0),%a0 - move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0 - jsr (%a0) -#else - bsr.l CALLFUNC(ffi_closure_SYSV_inner@PLTPC) -#endif - - lsr.l #1,%d0 - jne 1f - jcc .Lcls_epilogue - | CIF_FLAGS_INT - move.l -12(%fp),%d0 -.Lcls_epilogue: - | no CIF_FLAGS_* - unlk %fp - rts -1: - lea -12(%fp),%a0 - lsr.l #2,%d0 - jne 1f - jcs .Lcls_ret_float - | CIF_FLAGS_DINT - move.l (%a0)+,%d0 - move.l (%a0),%d1 - jra .Lcls_epilogue -.Lcls_ret_float: -#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.s (%a0),%fp0 -#else - move.l (%a0),%d0 -#endif - jra .Lcls_epilogue -1: - lsr.l #2,%d0 - jne 1f - jcs .Lcls_ret_ldouble - | CIF_FLAGS_DOUBLE -#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.d (%a0),%fp0 -#else - move.l (%a0)+,%d0 - move.l (%a0),%d1 -#endif - jra .Lcls_epilogue -.Lcls_ret_ldouble: -#if defined(__MC68881__) || defined(__HAVE_68881__) - fmove.x (%a0),%fp0 -#else - move.l (%a0)+,%d0 - move.l (%a0)+,%d1 - move.l (%a0),%d2 -#endif - jra .Lcls_epilogue -1: - lsr.l #2,%d0 - jne 1f - jcs .Lcls_ret_struct1 - | CIF_FLAGS_POINTER - move.l (%a0),%a0 - move.l %a0,%d0 - jra .Lcls_epilogue -.Lcls_ret_struct1: - move.b (%a0),%d0 - jra .Lcls_epilogue -1: - lsr.l #2,%d0 - jne 1f - jcs .Lcls_ret_sint8 - | CIF_FLAGS_STRUCT2 - move.w (%a0),%d0 - jra .Lcls_epilogue -.Lcls_ret_sint8: - move.l (%a0),%d0 - | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32. -#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__) - ext.w %d0 - ext.l %d0 -#else - extb.l %d0 -#endif - jra .Lcls_epilogue -1: - | CIF_FLAGS_SINT16 - move.l (%a0),%d0 - ext.l %d0 - jra .Lcls_epilogue - CFI_ENDPROC() - - .size CALLFUNC(ffi_closure_SYSV),.-CALLFUNC(ffi_closure_SYSV) - - .globl CALLFUNC(ffi_closure_struct_SYSV) - .type CALLFUNC(ffi_closure_struct_SYSV), @function - .align 4 - -CALLFUNC(ffi_closure_struct_SYSV): - CFI_STARTPROC() - link %fp,#0 - CFI_OFFSET(14,-8) - CFI_DEF_CFA(14,8) - move.l %sp,-12(%fp) - pea 8(%fp) - move.l %a1,-(%sp) - move.l %a0,-(%sp) -#if !defined __PIC__ - jsr CALLFUNC(ffi_closure_SYSV_inner) -#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__) - move.l _current_shared_library_a5_offset_(%a5),%a0 - move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0 - jsr (%a0) -#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__) - move.l #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0 - lea (-6,%pc,%a0),%a0 - move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0 - jsr (%a0) -#else - bsr.l CALLFUNC(ffi_closure_SYSV_inner@PLTPC) -#endif - unlk %fp - rts - CFI_ENDPROC() - .size CALLFUNC(ffi_closure_struct_SYSV),.-CALLFUNC(ffi_closure_struct_SYSV) - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/m88k/ffi.c b/deps/libffi/src/m88k/ffi.c deleted file mode 100644 index 57b344f4b9a0e8..00000000000000 --- a/deps/libffi/src/m88k/ffi.c +++ /dev/null @@ -1,400 +0,0 @@ -/* - * Copyright (c) 2013 Miodrag Vallat. - * - * 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. - */ - -/* - * m88k Foreign Function Interface - * - * This file attempts to provide all the FFI entry points which can reliably - * be implemented in C. - * - * Only OpenBSD/m88k is currently supported; other platforms (such as - * Motorola's SysV/m88k) could be supported with the following tweaks: - * - * - non-OpenBSD systems use an `outgoing parameter area' as part of the - * 88BCS calling convention, which is not supported under OpenBSD from - * release 3.6 onwards. Supporting it should be as easy as taking it - * into account when adjusting the stack, in the assembly code. - * - * - the logic deciding whether a function argument gets passed through - * registers, or on the stack, has changed several times in OpenBSD in - * edge cases (especially for structs larger than 32 bytes being passed - * by value). The code below attemps to match the logic used by the - * system compiler of OpenBSD 5.3, i.e. gcc 3.3.6 with many m88k backend - * fixes. - */ - -#include -#include - -#include -#include - -void ffi_call_OBSD (unsigned int, extended_cif *, unsigned int, void *, - void (*fn) ()); -void *ffi_prep_args (void *, extended_cif *); -void ffi_closure_OBSD (ffi_closure *); -void ffi_closure_struct_OBSD (ffi_closure *); -unsigned int ffi_closure_OBSD_inner (ffi_closure *, void *, unsigned int *, - char *); -void ffi_cacheflush_OBSD (unsigned int, unsigned int); - -#define CIF_FLAGS_INT (1 << 0) -#define CIF_FLAGS_DINT (1 << 1) - -/* - * Foreign Function Interface API - */ - -/* ffi_prep_args is called by the assembly routine once stack space has - been allocated for the function's arguments. */ - -void * -ffi_prep_args (void *stack, extended_cif *ecif) -{ - unsigned int i; - void **p_argv; - char *argp, *stackp; - unsigned int *regp; - unsigned int regused; - ffi_type **p_arg; - void *struct_value_ptr; - - regp = (unsigned int *)stack; - stackp = (char *)(regp + 8); - regused = 0; - - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT - && !ecif->cif->flags) - struct_value_ptr = ecif->rvalue; - else - struct_value_ptr = NULL; - - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i != 0; i--, p_arg++) - { - size_t z; - unsigned short t, a; - - z = (*p_arg)->size; - t = (*p_arg)->type; - a = (*p_arg)->alignment; - - /* - * Figure out whether the argument can be passed through registers - * or on the stack. - * The rule is that registers can only receive simple types not larger - * than 64 bits, or structs the exact size of a register and aligned to - * the size of a register. - */ - if (t == FFI_TYPE_STRUCT) - { - if (z == sizeof (int) && a == sizeof (int) && regused < 8) - argp = (char *)regp; - else - argp = stackp; - } - else - { - if (z > sizeof (int) && regused < 8 - 1) - { - /* align to an even register pair */ - if (regused & 1) - { - regp++; - regused++; - } - } - if (regused < 8) - argp = (char *)regp; - else - argp = stackp; - } - - /* Enforce proper stack alignment of 64-bit types */ - if (argp == stackp && a > sizeof (int)) - { - stackp = (char *) FFI_ALIGN(stackp, a); - argp = stackp; - } - - switch (t) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int) *(SINT8 *) *p_argv; - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv; - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int) *(SINT16 *) *p_argv; - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv; - break; - - case FFI_TYPE_INT: - case FFI_TYPE_FLOAT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_POINTER: - *(unsigned int *) argp = *(unsigned int *) *p_argv; - break; - - case FFI_TYPE_DOUBLE: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_STRUCT: - memcpy (argp, *p_argv, z); - break; - - default: - FFI_ASSERT (0); - } - - /* Align if necessary. */ - if ((sizeof (int) - 1) & z) - z = FFI_ALIGN(z, sizeof (int)); - - p_argv++; - - /* Be careful, once all registers are filled, and about to continue - on stack, regp == stackp. Therefore the check for regused as well. */ - if (argp == (char *)regp && regused < 8) - { - regp += z / sizeof (int); - regused += z / sizeof (int); - } - else - stackp += z; - } - - return struct_value_ptr; -} - -/* Perform machine dependent cif processing */ -ffi_status -ffi_prep_cif_machdep (ffi_cif *cif) -{ - /* Set the return type flag */ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - cif->flags = 0; - break; - - case FFI_TYPE_STRUCT: - if (cif->rtype->size == sizeof (int) && - cif->rtype->alignment == sizeof (int)) - cif->flags = CIF_FLAGS_INT; - else - cif->flags = 0; - break; - - case FFI_TYPE_DOUBLE: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - cif->flags = CIF_FLAGS_DINT; - break; - - default: - cif->flags = CIF_FLAGS_INT; - break; - } - - return FFI_OK; -} - -void -ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue) -{ - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return value - address then we need to make one. */ - - if (rvalue == NULL - && cif->rtype->type == FFI_TYPE_STRUCT - && (cif->rtype->size != sizeof (int) - || cif->rtype->alignment != sizeof (int))) - ecif.rvalue = alloca (cif->rtype->size); - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_OBSD: - ffi_call_OBSD (cif->bytes, &ecif, cif->flags, ecif.rvalue, fn); - break; - - default: - FFI_ASSERT (0); - break; - } -} - -/* - * Closure API - */ - -static void -ffi_prep_closure_args_OBSD (ffi_cif *cif, void **avalue, unsigned int *regp, - char *stackp) -{ - unsigned int i; - void **p_argv; - char *argp; - unsigned int regused; - ffi_type **p_arg; - - regused = 0; - - p_argv = avalue; - - for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) - { - size_t z; - unsigned short t, a; - - z = (*p_arg)->size; - t = (*p_arg)->type; - a = (*p_arg)->alignment; - - /* - * Figure out whether the argument has been passed through registers - * or on the stack. - * The rule is that registers can only receive simple types not larger - * than 64 bits, or structs the exact size of a register and aligned to - * the size of a register. - */ - if (t == FFI_TYPE_STRUCT) - { - if (z == sizeof (int) && a == sizeof (int) && regused < 8) - argp = (char *)regp; - else - argp = stackp; - } - else - { - if (z > sizeof (int) && regused < 8 - 1) - { - /* align to an even register pair */ - if (regused & 1) - { - regp++; - regused++; - } - } - if (regused < 8) - argp = (char *)regp; - else - argp = stackp; - } - - /* Enforce proper stack alignment of 64-bit types */ - if (argp == stackp && a > sizeof (int)) - { - stackp = (char *) FFI_ALIGN(stackp, a); - argp = stackp; - } - - if (z < sizeof (int) && t != FFI_TYPE_STRUCT) - *p_argv = (void *) (argp + sizeof (int) - z); - else - *p_argv = (void *) argp; - - /* Align if necessary */ - if ((sizeof (int) - 1) & z) - z = FFI_ALIGN(z, sizeof (int)); - - p_argv++; - - /* Be careful, once all registers are exhausted, and about to fetch from - stack, regp == stackp. Therefore the check for regused as well. */ - if (argp == (char *)regp && regused < 8) - { - regp += z / sizeof (int); - regused += z / sizeof (int); - } - else - stackp += z; - } -} - -unsigned int -ffi_closure_OBSD_inner (ffi_closure *closure, void *resp, unsigned int *regp, - char *stackp) -{ - ffi_cif *cif; - void **arg_area; - - cif = closure->cif; - arg_area = (void**) alloca (cif->nargs * sizeof (void *)); - - ffi_prep_closure_args_OBSD(cif, arg_area, regp, stackp); - - (closure->fun) (cif, resp, arg_area, closure->user_data); - - return cif->flags; -} - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, void *codeloc) -{ - unsigned int *tramp = (unsigned int *) codeloc; - void *fn; - - FFI_ASSERT (cif->abi == FFI_OBSD); - - if (cif->rtype->type == FFI_TYPE_STRUCT && !cif->flags) - fn = &ffi_closure_struct_OBSD; - else - fn = &ffi_closure_OBSD; - - /* or.u %r10, %r0, %hi16(fn) */ - tramp[0] = 0x5d400000 | (((unsigned int)fn) >> 16); - /* or.u %r13, %r0, %hi16(closure) */ - tramp[1] = 0x5da00000 | ((unsigned int)closure >> 16); - /* or %r10, %r10, %lo16(fn) */ - tramp[2] = 0x594a0000 | (((unsigned int)fn) & 0xffff); - /* jmp.n %r10 */ - tramp[3] = 0xf400c40a; - /* or %r13, %r13, %lo16(closure) */ - tramp[4] = 0x59ad0000 | ((unsigned int)closure & 0xffff); - - ffi_cacheflush_OBSD((unsigned int)codeloc, FFI_TRAMPOLINE_SIZE); - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; -} diff --git a/deps/libffi/src/m88k/ffitarget.h b/deps/libffi/src/m88k/ffitarget.h deleted file mode 100644 index e52bf9fa30a487..00000000000000 --- a/deps/libffi/src/m88k/ffitarget.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2013 Miodrag Vallat. - * - * 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. - */ - -/* - * m88k Foreign Function Interface - */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_OBSD, - FFI_DEFAULT_ABI = FFI_OBSD, - FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 0x14 -#define FFI_NATIVE_RAW_API 0 - -#endif diff --git a/deps/libffi/src/m88k/obsd.S b/deps/libffi/src/m88k/obsd.S deleted file mode 100644 index 1944a23de42459..00000000000000 --- a/deps/libffi/src/m88k/obsd.S +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2013 Miodrag Vallat. - * - * 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. - */ - -/* - * m88k Foreign Function Interface - */ - -#define LIBFFI_ASM -#include -#include - - .text - -/* - * ffi_cacheflush_OBSD(unsigned int addr, %r2 - * unsigned int size); %r3 - */ - .align 4 - .globl ffi_cacheflush_OBSD - .type ffi_cacheflush_OBSD,@function -ffi_cacheflush_OBSD: - tb0 0, %r0, 451 - or %r0, %r0, %r0 - jmp %r1 - .size ffi_cacheflush_OBSD, . - ffi_cacheflush_OBSD - -/* - * ffi_call_OBSD(unsigned bytes, %r2 - * extended_cif *ecif, %r3 - * unsigned flags, %r4 - * void *rvalue, %r5 - * void (*fn)()); %r6 - */ - .align 4 - .globl ffi_call_OBSD - .type ffi_call_OBSD,@function -ffi_call_OBSD: - subu %r31, %r31, 32 - st %r30, %r31, 4 - st %r1, %r31, 0 - addu %r30, %r31, 32 - - | Save the few arguments we'll need after ffi_prep_args() - st.d %r4, %r31, 8 - st %r6, %r31, 16 - - | Allocate room for the image of r2-r9, and the stack space for - | the args (rounded to a 16-byte boundary) - addu %r2, %r2, (8 * 4) + 15 - clr %r2, %r2, 4<0> - subu %r31, %r31, %r2 - - | Fill register and stack image - or %r2, %r31, %r0 -#ifdef PIC - bsr ffi_prep_args#plt -#else - bsr ffi_prep_args -#endif - - | Save pointer to return struct address, if any - or %r12, %r2, %r0 - - | Get function pointer - subu %r4, %r30, 32 - ld %r1, %r4, 16 - - | Fetch the register arguments - ld.d %r2, %r31, (0 * 4) - ld.d %r4, %r31, (2 * 4) - ld.d %r6, %r31, (4 * 4) - ld.d %r8, %r31, (6 * 4) - addu %r31, %r31, (8 * 4) - - | Invoke the function - jsr %r1 - - | Restore stack now that we don't need the args anymore - subu %r31, %r30, 32 - - | Figure out what to return as the function's return value - ld %r5, %r31, 12 | rvalue - ld %r4, %r31, 8 | flags - - bcnd eq0, %r5, 9f - - bb0 0, %r4, 1f | CIF_FLAGS_INT - st %r2, %r5, 0 - br 9f - -1: - bb0 1, %r4, 1f | CIF_FLAGS_DINT - st.d %r2, %r5, 0 - br 9f - -1: -9: - ld %r1, %r31, 0 - ld %r30, %r31, 4 - jmp.n %r1 - addu %r31, %r31, 32 - .size ffi_call_OBSD, . - ffi_call_OBSD - -/* - * ffi_closure_OBSD(ffi_closure *closure); %r13 - */ - .align 4 - .globl ffi_closure_OBSD - .type ffi_closure_OBSD, @function -ffi_closure_OBSD: - subu %r31, %r31, 16 - st %r30, %r31, 4 - st %r1, %r31, 0 - addu %r30, %r31, 16 - - | Make room on the stack for saved register arguments and return - | value - subu %r31, %r31, (8 * 4) + (2 * 4) - st.d %r2, %r31, (0 * 4) - st.d %r4, %r31, (2 * 4) - st.d %r6, %r31, (4 * 4) - st.d %r8, %r31, (6 * 4) - - | Invoke the closure function - or %r5, %r30, 0 | calling stack - addu %r4, %r31, 0 | saved registers - addu %r3, %r31, (8 * 4) | return value - or %r2, %r13, %r0 | closure -#ifdef PIC - bsr ffi_closure_OBSD_inner#plt -#else - bsr ffi_closure_OBSD_inner -#endif - - | Figure out what to return as the function's return value - bb0 0, %r2, 1f | CIF_FLAGS_INT - ld %r2, %r31, (8 * 4) - br 9f - -1: - bb0 1, %r2, 1f | CIF_FLAGS_DINT - ld.d %r2, %r31, (8 * 4) - br 9f - -1: -9: - subu %r31, %r30, 16 - ld %r1, %r31, 0 - ld %r30, %r31, 4 - jmp.n %r1 - addu %r31, %r31, 16 - .size ffi_closure_OBSD,.-ffi_closure_OBSD - -/* - * ffi_closure_struct_OBSD(ffi_closure *closure); %r13 - */ - .align 4 - .globl ffi_closure_struct_OBSD - .type ffi_closure_struct_OBSD, @function -ffi_closure_struct_OBSD: - subu %r31, %r31, 16 - st %r30, %r31, 4 - st %r1, %r31, 0 - addu %r30, %r31, 16 - - | Make room on the stack for saved register arguments - subu %r31, %r31, (8 * 4) - st.d %r2, %r31, (0 * 4) - st.d %r4, %r31, (2 * 4) - st.d %r6, %r31, (4 * 4) - st.d %r8, %r31, (6 * 4) - - | Invoke the closure function - or %r5, %r30, 0 | calling stack - addu %r4, %r31, 0 | saved registers - or %r3, %r12, 0 | return value - or %r2, %r13, %r0 | closure -#ifdef PIC - bsr ffi_closure_OBSD_inner#plt -#else - bsr ffi_closure_OBSD_inner -#endif - - subu %r31, %r30, 16 - ld %r1, %r31, 0 - ld %r30, %r31, 4 - jmp.n %r1 - addu %r31, %r31, 16 - .size ffi_closure_struct_OBSD,.-ffi_closure_struct_OBSD diff --git a/deps/libffi/src/metag/ffi.c b/deps/libffi/src/metag/ffi.c deleted file mode 100644 index 3aecb0b8115631..00000000000000 --- a/deps/libffi/src/metag/ffi.c +++ /dev/null @@ -1,330 +0,0 @@ -/* ---------------------------------------------------------------------- - ffi.c - Copyright (c) 2013 Imagination Technologies - - Meta Foreign Function Interface - 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 SIMON POSNJAK 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. ------------------------------------------------------------------------ */ - -#include -#include - -#include - -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) - -/* - * ffi_prep_args is called by the assembly routine once stack space has been - * allocated for the function's arguments - */ - -unsigned int ffi_prep_args(char *stack, extended_cif *ecif) -{ - register unsigned int i; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - - argp = stack; - - /* Store return value */ - if ( ecif->cif->flags == FFI_TYPE_STRUCT ) { - argp -= 4; - *(void **) argp = ecif->rvalue; - } - - p_argv = ecif->avalue; - - /* point to next location */ - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; (i != 0); i--, p_arg++, p_argv++) - { - size_t z; - - /* Move argp to address of argument */ - z = (*p_arg)->size; - argp -= z; - - /* Align if necessary */ - argp = (char *) FFI_ALIGN_DOWN(FFI_ALIGN_DOWN(argp, (*p_arg)->alignment), 4); - - if (z < sizeof(int)) { - z = sizeof(int); - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); - break; - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); - break; - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); - break; - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); - case FFI_TYPE_STRUCT: - memcpy(argp, *p_argv, (*p_arg)->size); - break; - default: - FFI_ASSERT(0); - } - } else if ( z == sizeof(int)) { - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - } else { - memcpy(argp, *p_argv, z); - } - } - - /* return the size of the arguments to be passed in registers, - padded to an 8 byte boundary to preserve stack alignment */ - return FFI_ALIGN(MIN(stack - argp, 6*4), 8); -} - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - ffi_type **ptr; - unsigned i, bytes = 0; - - for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) { - if ((*ptr)->size == 0) - return FFI_BAD_TYPEDEF; - - /* Perform a sanity check on the argument type, do this - check after the initialization. */ - FFI_ASSERT_VALID_TYPE(*ptr); - - /* Add any padding if necessary */ - if (((*ptr)->alignment - 1) & bytes) - bytes = FFI_ALIGN(bytes, (*ptr)->alignment); - - bytes += FFI_ALIGN((*ptr)->size, 4); - } - - /* Ensure arg space is aligned to an 8-byte boundary */ - bytes = FFI_ALIGN(bytes, 8); - - /* Make space for the return structure pointer */ - if (cif->rtype->type == FFI_TYPE_STRUCT) { - bytes += sizeof(void*); - - /* Ensure stack is aligned to an 8-byte boundary */ - bytes = FFI_ALIGN(bytes, 8); - } - - cif->bytes = bytes; - - /* Set the return type flag */ - switch (cif->rtype->type) { - case FFI_TYPE_VOID: - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - cif->flags = (unsigned) cif->rtype->type; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - cif->flags = (unsigned) FFI_TYPE_SINT64; - break; - case FFI_TYPE_STRUCT: - /* Meta can store return values which are <= 64 bits */ - if (cif->rtype->size <= 4) - /* Returned to D0Re0 as 32-bit value */ - cif->flags = (unsigned)FFI_TYPE_INT; - else if ((cif->rtype->size > 4) && (cif->rtype->size <= 8)) - /* Returned valued is stored to D1Re0|R0Re0 */ - cif->flags = (unsigned)FFI_TYPE_DOUBLE; - else - /* value stored in memory */ - cif->flags = (unsigned)FFI_TYPE_STRUCT; - break; - default: - cif->flags = (unsigned)FFI_TYPE_INT; - break; - } - return FFI_OK; -} - -extern void ffi_call_SYSV(void (*fn)(void), extended_cif *, unsigned, unsigned, double *); - -/* - * Exported in API. Entry point - * cif -> ffi_cif object - * fn -> function pointer - * rvalue -> pointer to return value - * avalue -> vector of void * pointers pointing to memory locations holding the - * arguments - */ -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - extended_cif ecif; - - int small_struct = (((cif->flags == FFI_TYPE_INT) || (cif->flags == FFI_TYPE_DOUBLE)) && (cif->rtype->type == FFI_TYPE_STRUCT)); - ecif.cif = cif; - ecif.avalue = avalue; - - double temp; - - /* - * If the return value is a struct and we don't have a return value address - * then we need to make one - */ - - if ((rvalue == NULL ) && (cif->flags == FFI_TYPE_STRUCT)) - ecif.rvalue = alloca(cif->rtype->size); - else if (small_struct) - ecif.rvalue = &temp; - else - ecif.rvalue = rvalue; - - switch (cif->abi) { - case FFI_SYSV: - ffi_call_SYSV(fn, &ecif, cif->bytes, cif->flags, ecif.rvalue); - break; - default: - FFI_ASSERT(0); - break; - } - - if (small_struct) - memcpy (rvalue, &temp, cif->rtype->size); -} - -/* private members */ - -static void ffi_prep_incoming_args_SYSV (char *, void **, void **, - ffi_cif*, float *); - -void ffi_closure_SYSV (ffi_closure *); - -/* Do NOT change that without changing the FFI_TRAMPOLINE_SIZE */ -extern unsigned int ffi_metag_trampoline[10]; /* 10 instructions */ - -/* end of private members */ - -/* - * __tramp: trampoline memory location - * __fun: assembly routine - * __ctx: memory location for wrapper - * - * At this point, tramp[0] == __ctx ! - */ -void ffi_init_trampoline(unsigned char *__tramp, unsigned int __fun, unsigned int __ctx) { - memcpy (__tramp, ffi_metag_trampoline, sizeof(ffi_metag_trampoline)); - *(unsigned int*) &__tramp[40] = __ctx; - *(unsigned int*) &__tramp[44] = __fun; - /* This will flush the instruction cache */ - __builtin_meta2_cachewd(&__tramp[0], 1); - __builtin_meta2_cachewd(&__tramp[47], 1); -} - - - -/* the cif must already be prepared */ - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - void (*closure_func)(ffi_closure*) = NULL; - - if (cif->abi == FFI_SYSV) - closure_func = &ffi_closure_SYSV; - else - return FFI_BAD_ABI; - - ffi_init_trampoline( - (unsigned char*)&closure->tramp[0], - (unsigned int)closure_func, - (unsigned int)codeloc); - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; -} - - -/* This function is jumped to by the trampoline */ -unsigned int ffi_closure_SYSV_inner (closure, respp, args, vfp_args) - ffi_closure *closure; - void **respp; - void *args; - void *vfp_args; -{ - ffi_cif *cif; - void **arg_area; - - cif = closure->cif; - arg_area = (void**) alloca (cif->nargs * sizeof (void*)); - - /* - * This call will initialize ARG_AREA, such that each - * element in that array points to the corresponding - * value on the stack; and if the function returns - * a structure, it will re-set RESP to point to the - * structure return address. - */ - ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args); - - (closure->fun) ( cif, *respp, arg_area, closure->user_data); - - return cif->flags; -} - -static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, - void **avalue, ffi_cif *cif, - float *vfp_stack) -{ - register unsigned int i; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - - /* stack points to original arguments */ - argp = stack; - - /* Store return value */ - if ( cif->flags == FFI_TYPE_STRUCT ) { - argp -= 4; - *rvalue = *(void **) argp; - } - - p_argv = avalue; - - for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) { - size_t z; - size_t alignment; - - alignment = (*p_arg)->alignment; - if (alignment < 4) - alignment = 4; - if ((alignment - 1) & (unsigned)argp) - argp = (char *) FFI_ALIGN(argp, alignment); - - z = (*p_arg)->size; - *p_argv = (void*) argp; - p_argv++; - argp -= z; - } - return; -} diff --git a/deps/libffi/src/metag/ffitarget.h b/deps/libffi/src/metag/ffitarget.h deleted file mode 100644 index 7b9dbebca86919..00000000000000 --- a/deps/libffi/src/metag/ffitarget.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2013 Imagination Technologies Ltd. - Target configuration macros for Meta - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_DEFAULT_ABI = FFI_SYSV, - FFI_LAST_ABI = FFI_DEFAULT_ABI + 1, -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 48 -#define FFI_NATIVE_RAW_API 0 - -#endif - diff --git a/deps/libffi/src/metag/sysv.S b/deps/libffi/src/metag/sysv.S deleted file mode 100644 index b4b2a3b26bbfbd..00000000000000 --- a/deps/libffi/src/metag/sysv.S +++ /dev/null @@ -1,311 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2013 Imagination Technologies Ltd. - - Meta Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#ifdef HAVE_MACHINE_ASM_H -#include -#else -#ifdef __USER_LABEL_PREFIX__ -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ -#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) -#else -#define CNAME(x) x -#endif -#define ENTRY(x) .globl CNAME(x); .type CNAME(x), %function; CNAME(x): -#endif - -#ifdef __ELF__ -#define LSYM(x) .x -#else -#define LSYM(x) x -#endif - -.macro call_reg x= - .text - .balign 4 - mov D1RtP, \x - swap D1RtP, PC -.endm - -! Save register arguments -.macro SAVE_ARGS - .text - .balign 4 - setl [A0StP++], D0Ar6, D1Ar5 - setl [A0StP++], D0Ar4, D1Ar3 - setl [A0StP++], D0Ar2, D1Ar1 -.endm - -! Save retrun, frame pointer and other regs -.macro SAVE_REGS regs= - .text - .balign 4 - setl [A0StP++], D0FrT, D1RtP - ! Needs to be a pair of regs - .ifnc "\regs","" - setl [A0StP++], \regs - .endif -.endm - -! Declare a global function -.macro METAG_FUNC_START name - .text - .balign 4 - ENTRY(\name) -.endm - -! Return registers from the stack. Reverse SAVE_REGS operation -.macro RET_REGS regs=, cond= - .ifnc "\regs", "" - getl \regs, [--A0StP] - .endif - getl D0FrT, D1RtP, [--A0StP] -.endm - -! Return arguments -.macro RET_ARGS - getl D0Ar2, D1Ar1, [--A0StP] - getl D0Ar4, D1Ar3, [--A0StP] - getl D0Ar6, D1Ar5, [--A0StP] -.endm - - - ! D1Ar1: fn - ! D0Ar2: &ecif - ! D1Ar3: cif->bytes - ! D0Ar4: fig->flags - ! D1Ar5: ecif.rvalue - - ! This assumes we are using GNU as -METAG_FUNC_START ffi_call_SYSV - ! Save argument registers - - SAVE_ARGS - - ! new frame - mov D0FrT, A0FrP - add A0FrP, A0StP, #0 - - ! Preserve the old frame pointer - SAVE_REGS "D1.5, D0.5" - - ! Make room for new args. cifs->bytes is the total space for input - ! and return arguments - - add A0StP, A0StP, D1Ar3 - - ! Preserve cifs->bytes & fn - mov D0.5, D1Ar3 - mov D1.5, D1Ar1 - - ! Place all of the ffi_prep_args in position - mov D1Ar1, A0StP - - ! Call ffi_prep_args(stack, &ecif) -#ifdef __PIC__ - callr D1RtP, CNAME(ffi_prep_args@PLT) -#else - callr D1RtP, CNAME(ffi_prep_args) -#endif - - ! Restore fn pointer - - ! The foreign stack should look like this - ! XXXXX XXXXXX <--- stack pointer - ! FnArgN rvalue - ! FnArgN+2 FnArgN+1 - ! FnArgN+4 FnArgN+3 - ! .... - ! - - ! A0StP now points to the first (or return) argument + 4 - - ! Preserve cif->bytes - getl D0Ar2, D1Ar1, [--A0StP] - getl D0Ar4, D1Ar3, [--A0StP] - getl D0Ar6, D1Ar5, [--A0StP] - - ! Place A0StP to the first argument again - add A0StP, A0StP, #24 ! That's because we loaded 6 regs x 4 byte each - - ! A0FrP points to the initial stack without the reserved space for the - ! cifs->bytes, whilst A0StP points to the stack after the space allocation - - ! fn was the first argument of ffi_call_SYSV. - ! The stack at this point looks like this: - ! - ! A0StP(on entry to _SYSV) -> Arg6 Arg5 | low - ! Arg4 Arg3 | - ! Arg2 Arg1 | - ! A0FrP ----> D0FrtP D1RtP | - ! D1.5 D0.5 | - ! A0StP(bf prep_args) -> FnArgn FnArgn-1 | - ! FnArgn-2FnArgn-3 | - ! ................ | <= cifs->bytes - ! FnArg4 FnArg3 | - ! A0StP (prv_A0StP+cifs->bytes) FnArg2 FnArg1 | high - ! - ! fn was in Arg1 so it's located in in A0FrP+#-0xC - ! - - ! D0Re0 contains the size of arguments stored in registers - sub A0StP, A0StP, D0Re0 - - ! Arg1 is the function pointer for the foreign call. This has been - ! preserved in D1.5 - - ! Time to call (fn). Arguments should be like this: - ! Arg1-Arg6 are loaded to regs - ! The rest of the arguments are stored in stack pointed by A0StP - - call_reg D1.5 - - ! Reset stack. - - mov A0StP, A0FrP - - ! Load Arg1 with the pointer to storage for the return type - ! This was stored in Arg5 - - getd D1Ar1, [A0FrP+#-20] - - ! Load D0Ar2 with the return type code. This was stored in Arg4 (flags) - - getd D0Ar2, [A0FrP+#-16] - - ! We are ready to start processing the return value - ! D0Re0 (and D1Re0) hold the return value - - ! If the return value is NULL, assume no return value - cmp D1Ar1, #0 - beq LSYM(Lepilogue) - - ! return INT - cmp D0Ar2, #FFI_TYPE_INT - ! Sadly, there is no setd{cc} instruction so we need to workaround that - bne .INT64 - setd [D1Ar1], D0Re0 - b LSYM(Lepilogue) - - ! return INT64 -.INT64: - cmp D0Ar2, #FFI_TYPE_SINT64 - setleq [D1Ar1], D0Re0, D1Re0 - - ! return DOUBLE - cmp D0Ar2, #FFI_TYPE_DOUBLE - setl [D1AR1++], D0Re0, D1Re0 - -LSYM(Lepilogue): - ! At this point, the stack pointer points right after the argument - ! saved area. We need to restore 4 regs, therefore we need to move - ! 16 bytes ahead. - add A0StP, A0StP, #16 - RET_REGS "D1.5, D0.5" - RET_ARGS - getd D0Re0, [A0StP] - mov A0FrP, D0FrT - swap D1RtP, PC - -.ffi_call_SYSV_end: - .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) - - -/* - (called by ffi_metag_trampoline) - void ffi_closure_SYSV (ffi_closure*) - - (called by ffi_closure_SYSV) - unsigned int FFI_HIDDEN - ffi_closure_SYSV_inner (closure,respp, args) - ffi_closure *closure; - void **respp; - void *args; -*/ - -METAG_FUNC_START ffi_closure_SYSV - ! We assume that D1Ar1 holds the address of the - ! ffi_closure struct. We will use that to fetch the - ! arguments. The stack pointer points to an empty space - ! and it is ready to store more data. - - ! D1Ar1 is ready - ! Allocate stack space for return value - add A0StP, A0StP, #8 - ! Store it to D0Ar2 - sub D0Ar2, A0StP, #8 - - sub D1Ar3, A0FrP, #4 - - ! D1Ar3 contains the address of the original D1Ar1 argument - ! We need to subtract #4 later on - - ! Preverve D0Ar2 - mov D0.5, D0Ar2 - -#ifdef __PIC__ - callr D1RtP, CNAME(ffi_closure_SYSV_inner@PLT) -#else - callr D1RtP, CNAME(ffi_closure_SYSV_inner) -#endif - - ! Check the return value and store it to D0.5 - cmp D0Re0, #FFI_TYPE_INT - beq .Lretint - cmp D0Re0, #FFI_TYPE_DOUBLE - beq .Lretdouble -.Lclosure_epilogue: - sub A0StP, A0StP, #8 - RET_REGS "D1.5, D0.5" - RET_ARGS - swap D1RtP, PC - -.Lretint: - setd [D0.5], D0Re0 - b .Lclosure_epilogue -.Lretdouble: - setl [D0.5++], D0Re0, D1Re0 - b .Lclosure_epilogue -.ffi_closure_SYSV_end: -.size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) - - -ENTRY(ffi_metag_trampoline) - SAVE_ARGS - ! New frame - mov A0FrP, A0StP - SAVE_REGS "D1.5, D0.5" - mov D0.5, PC - ! Load D1Ar1 the value of ffi_metag_trampoline - getd D1Ar1, [D0.5 + #8] - ! Jump to ffi_closure_SYSV - getd PC, [D0.5 + #12] diff --git a/deps/libffi/src/microblaze/ffi.c b/deps/libffi/src/microblaze/ffi.c deleted file mode 100644 index df6e33c97d4c00..00000000000000 --- a/deps/libffi/src/microblaze/ffi.c +++ /dev/null @@ -1,321 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2012, 2013 Xilinx, Inc - - MicroBlaze Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -extern void ffi_call_SYSV(void (*)(void*, extended_cif*), extended_cif*, - unsigned int, unsigned int, unsigned int*, void (*fn)(void), - unsigned int, unsigned int); - -extern void ffi_closure_SYSV(void); - -#define WORD_SIZE sizeof(unsigned int) -#define ARGS_REGISTER_SIZE (WORD_SIZE * 6) -#define WORD_FFI_ALIGN(x) FFI_ALIGN(x, WORD_SIZE) - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ -void ffi_prep_args(void* stack, extended_cif* ecif) -{ - unsigned int i; - ffi_type** p_arg; - void** p_argv; - void* stack_args_p = stack; - - if (ecif == NULL || ecif->cif == NULL) { - return; /* no description to prepare */ - } - - p_argv = ecif->avalue; - - if ((ecif->cif->rtype != NULL) && - (ecif->cif->rtype->type == FFI_TYPE_STRUCT)) - { - /* if return type is a struct which is referenced on the stack/reg5, - * by a pointer. Stored the return value pointer in r5. - */ - char* addr = stack_args_p; - memcpy(addr, &(ecif->rvalue), WORD_SIZE); - stack_args_p += WORD_SIZE; - } - - if (ecif->avalue == NULL) { - return; /* no arguments to prepare */ - } - - for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs; - i++, p_arg++) - { - size_t size = (*p_arg)->size; - int type = (*p_arg)->type; - void* value = p_argv[i]; - char* addr = stack_args_p; - int aligned_size = WORD_FFI_ALIGN(size); - - /* force word alignment on the stack */ - stack_args_p += aligned_size; - - switch (type) - { - case FFI_TYPE_UINT8: - *(unsigned int *)addr = (unsigned int)*(UINT8*)(value); - break; - case FFI_TYPE_SINT8: - *(signed int *)addr = (signed int)*(SINT8*)(value); - break; - case FFI_TYPE_UINT16: - *(unsigned int *)addr = (unsigned int)*(UINT16*)(value); - break; - case FFI_TYPE_SINT16: - *(signed int *)addr = (signed int)*(SINT16*)(value); - break; - case FFI_TYPE_STRUCT: -#if __BIG_ENDIAN__ - /* - * MicroBlaze toolchain appears to emit: - * bsrli r5, r5, 8 (caller) - * ... - * - * ... - * bslli r5, r5, 8 (callee) - * - * For structs like "struct a { uint8_t a[3]; };", when passed - * by value. - * - * Structs like "struct b { uint16_t a; };" are also expected - * to be packed strangely in registers. - * - * This appears to be because the microblaze toolchain expects - * "struct b == uint16_t", which is only any issue for big - * endian. - * - * The following is a work around for big-endian only, for the - * above mentioned case, it will re-align the contents of a - * <= 3-byte struct value. - */ - if (size < WORD_SIZE) - { - memcpy (addr + (WORD_SIZE - size), value, size); - break; - } -#endif - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_FLOAT: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_DOUBLE: - default: - memcpy(addr, value, aligned_size); - } - } -} - -ffi_status ffi_prep_cif_machdep(ffi_cif* cif) -{ - /* check ABI */ - switch (cif->abi) - { - case FFI_SYSV: - break; - default: - return FFI_BAD_ABI; - } - return FFI_OK; -} - -void ffi_call(ffi_cif* cif, void (*fn)(void), void* rvalue, void** avalue) -{ - extended_cif ecif; - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return */ - /* value address then we need to make one */ - if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { - ecif.rvalue = alloca(cif->rtype->size); - } else { - ecif.rvalue = rvalue; - } - - switch (cif->abi) - { - case FFI_SYSV: - ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, - ecif.rvalue, fn, cif->rtype->type, cif->rtype->size); - break; - default: - FFI_ASSERT(0); - break; - } -} - -void ffi_closure_call_SYSV(void* register_args, void* stack_args, - ffi_closure* closure, void* rvalue, - unsigned int* rtype, unsigned int* rsize) -{ - /* prepare arguments for closure call */ - ffi_cif* cif = closure->cif; - ffi_type** arg_types = cif->arg_types; - - /* re-allocate data for the args. This needs to be done in order to keep - * multi-word objects (e.g. structs) in contiguous memory. Callers are not - * required to store the value of args in the lower 6 words in the stack - * (although they are allocated in the stack). - */ - char* stackclone = alloca(cif->bytes); - void** avalue = alloca(cif->nargs * sizeof(void*)); - void* struct_rvalue = NULL; - char* ptr = stackclone; - int i; - - /* copy registers into stack clone */ - int registers_used = cif->bytes; - if (registers_used > ARGS_REGISTER_SIZE) { - registers_used = ARGS_REGISTER_SIZE; - } - memcpy(stackclone, register_args, registers_used); - - /* copy stack allocated args into stack clone */ - if (cif->bytes > ARGS_REGISTER_SIZE) { - int stack_used = cif->bytes - ARGS_REGISTER_SIZE; - memcpy(stackclone + ARGS_REGISTER_SIZE, stack_args, stack_used); - } - - /* preserve struct type return pointer passing */ - if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { - struct_rvalue = *((void**)ptr); - ptr += WORD_SIZE; - } - - /* populate arg pointer list */ - for (i = 0; i < cif->nargs; i++) - { - switch (arg_types[i]->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: -#ifdef __BIG_ENDIAN__ - avalue[i] = ptr + 3; -#else - avalue[i] = ptr; -#endif - break; - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: -#ifdef __BIG_ENDIAN__ - avalue[i] = ptr + 2; -#else - avalue[i] = ptr; -#endif - break; - case FFI_TYPE_STRUCT: -#if __BIG_ENDIAN__ - /* - * Work around strange ABI behaviour. - * (see info in ffi_prep_args) - */ - if (arg_types[i]->size < WORD_SIZE) - { - memcpy (ptr, ptr + (WORD_SIZE - arg_types[i]->size), arg_types[i]->size); - } -#endif - avalue[i] = (void*)ptr; - break; - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_DOUBLE: - avalue[i] = ptr; - break; - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_FLOAT: - default: - /* default 4-byte argument */ - avalue[i] = ptr; - break; - } - ptr += WORD_FFI_ALIGN(arg_types[i]->size); - } - - /* set the return type info passed back to the wrapper */ - *rsize = cif->rtype->size; - *rtype = cif->rtype->type; - if (struct_rvalue != NULL) { - closure->fun(cif, struct_rvalue, avalue, closure->user_data); - /* copy struct return pointer value into function return value */ - *((void**)rvalue) = struct_rvalue; - } else { - closure->fun(cif, rvalue, avalue, closure->user_data); - } -} - -ffi_status ffi_prep_closure_loc( - ffi_closure* closure, ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void* user_data, void* codeloc) -{ - unsigned long* tramp = (unsigned long*)&(closure->tramp[0]); - unsigned long cls = (unsigned long)codeloc; - unsigned long fn = 0; - unsigned long fn_closure_call_sysv = (unsigned long)ffi_closure_call_SYSV; - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - switch (cif->abi) - { - case FFI_SYSV: - fn = (unsigned long)ffi_closure_SYSV; - - /* load r11 (temp) with fn */ - /* imm fn(upper) */ - tramp[0] = 0xb0000000 | ((fn >> 16) & 0xffff); - /* addik r11, r0, fn(lower) */ - tramp[1] = 0x31600000 | (fn & 0xffff); - - /* load r12 (temp) with cls */ - /* imm cls(upper) */ - tramp[2] = 0xb0000000 | ((cls >> 16) & 0xffff); - /* addik r12, r0, cls(lower) */ - tramp[3] = 0x31800000 | (cls & 0xffff); - - /* load r3 (temp) with ffi_closure_call_SYSV */ - /* imm fn_closure_call_sysv(upper) */ - tramp[4] = 0xb0000000 | ((fn_closure_call_sysv >> 16) & 0xffff); - /* addik r3, r0, fn_closure_call_sysv(lower) */ - tramp[5] = 0x30600000 | (fn_closure_call_sysv & 0xffff); - /* branch/jump to address stored in r11 (fn) */ - tramp[6] = 0x98085800; /* bra r11 */ - - break; - default: - return FFI_BAD_ABI; - } - return FFI_OK; -} diff --git a/deps/libffi/src/microblaze/ffitarget.h b/deps/libffi/src/microblaze/ffitarget.h deleted file mode 100644 index c6fa5a4115d980..00000000000000 --- a/deps/libffi/src/microblaze/ffitarget.h +++ /dev/null @@ -1,53 +0,0 @@ -/* ----------------------------------------------------------------------- - ffitarget.h - Copyright (c) 2012, 2013 Xilinx, Inc - - Target configuration macros for MicroBlaze. - - 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. - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; -#endif - -/* Definitions for closures */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 - -#define FFI_TRAMPOLINE_SIZE (4*8) - -#endif diff --git a/deps/libffi/src/microblaze/sysv.S b/deps/libffi/src/microblaze/sysv.S deleted file mode 100644 index ea43e9d5453943..00000000000000 --- a/deps/libffi/src/microblaze/sysv.S +++ /dev/null @@ -1,302 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2012, 2013 Xilinx, Inc - - MicroBlaze Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - - /* - * arg[0] (r5) = ffi_prep_args, - * arg[1] (r6) = &ecif, - * arg[2] (r7) = cif->bytes, - * arg[3] (r8) = cif->flags, - * arg[4] (r9) = ecif.rvalue, - * arg[5] (r10) = fn - * arg[6] (sp[0]) = cif->rtype->type - * arg[7] (sp[4]) = cif->rtype->size - */ - .text - .globl ffi_call_SYSV - .type ffi_call_SYSV, @function -ffi_call_SYSV: - /* push callee saves */ - addik r1, r1, -20 - swi r19, r1, 0 /* Frame Pointer */ - swi r20, r1, 4 /* PIC register */ - swi r21, r1, 8 /* PIC register */ - swi r22, r1, 12 /* save for locals */ - swi r23, r1, 16 /* save for locals */ - - /* save the r5-r10 registers in the stack */ - addik r1, r1, -24 /* increment sp to store 6x 32-bit words */ - swi r5, r1, 0 - swi r6, r1, 4 - swi r7, r1, 8 - swi r8, r1, 12 - swi r9, r1, 16 - swi r10, r1, 20 - - /* save function pointer */ - addik r3, r5, 0 /* copy ffi_prep_args into r3 */ - addik r22, r1, 0 /* save sp for unallocated args into r22 (callee-saved) */ - addik r23, r10, 0 /* save function address into r23 (callee-saved) */ - - /* prepare stack with allocation for n (bytes = r7) args */ - rsub r1, r7, r1 /* subtract bytes from sp */ - - /* prep args for ffi_prep_args call */ - addik r5, r1, 0 /* store stack pointer into arg[0] */ - /* r6 still holds ecif for arg[1] */ - - /* Call ffi_prep_args(stack, &ecif). */ - addik r1, r1, -4 - swi r15, r1, 0 /* store the link register in the frame */ - brald r15, r3 - nop /* branch has delay slot */ - lwi r15, r1, 0 - addik r1, r1, 4 /* restore the link register from the frame */ - /* returns calling stack pointer location */ - - /* prepare args for fn call, prep_args populates them onto the stack */ - lwi r5, r1, 0 /* arg[0] */ - lwi r6, r1, 4 /* arg[1] */ - lwi r7, r1, 8 /* arg[2] */ - lwi r8, r1, 12 /* arg[3] */ - lwi r9, r1, 16 /* arg[4] */ - lwi r10, r1, 20 /* arg[5] */ - - /* call (fn) (...). */ - addik r1, r1, -4 - swi r15, r1, 0 /* store the link register in the frame */ - brald r15, r23 - nop /* branch has delay slot */ - lwi r15, r1, 0 - addik r1, r1, 4 /* restore the link register from the frame */ - - /* Remove the space we pushed for the args. */ - addik r1, r22, 0 /* restore old SP */ - - /* restore this functions parameters */ - lwi r5, r1, 0 /* arg[0] */ - lwi r6, r1, 4 /* arg[1] */ - lwi r7, r1, 8 /* arg[2] */ - lwi r8, r1, 12 /* arg[3] */ - lwi r9, r1, 16 /* arg[4] */ - lwi r10, r1, 20 /* arg[5] */ - addik r1, r1, 24 /* decrement sp to de-allocate 6x 32-bit words */ - - /* If the return value pointer is NULL, assume no return value. */ - beqi r9, ffi_call_SYSV_end - - lwi r22, r1, 48 /* get return type (20 for locals + 28 for arg[6]) */ - lwi r23, r1, 52 /* get return size (20 for locals + 32 for arg[7]) */ - - /* Check if return type is actually a struct, do nothing */ - rsubi r11, r22, FFI_TYPE_STRUCT - beqi r11, ffi_call_SYSV_end - - /* Return 8bit */ - rsubi r11, r23, 1 - beqi r11, ffi_call_SYSV_store8 - - /* Return 16bit */ - rsubi r11, r23, 2 - beqi r11, ffi_call_SYSV_store16 - - /* Return 32bit */ - rsubi r11, r23, 4 - beqi r11, ffi_call_SYSV_store32 - - /* Return 64bit */ - rsubi r11, r23, 8 - beqi r11, ffi_call_SYSV_store64 - - /* Didn't match anything */ - bri ffi_call_SYSV_end - -ffi_call_SYSV_store64: - swi r3, r9, 0 /* store word r3 into return value */ - swi r4, r9, 4 /* store word r4 into return value */ - bri ffi_call_SYSV_end - -ffi_call_SYSV_store32: - swi r3, r9, 0 /* store word r3 into return value */ - bri ffi_call_SYSV_end - -ffi_call_SYSV_store16: -#ifdef __BIG_ENDIAN__ - shi r3, r9, 2 /* store half-word r3 into return value */ -#else - shi r3, r9, 0 /* store half-word r3 into return value */ -#endif - bri ffi_call_SYSV_end - -ffi_call_SYSV_store8: -#ifdef __BIG_ENDIAN__ - sbi r3, r9, 3 /* store byte r3 into return value */ -#else - sbi r3, r9, 0 /* store byte r3 into return value */ -#endif - bri ffi_call_SYSV_end - -ffi_call_SYSV_end: - /* callee restores */ - lwi r19, r1, 0 /* frame pointer */ - lwi r20, r1, 4 /* PIC register */ - lwi r21, r1, 8 /* PIC register */ - lwi r22, r1, 12 - lwi r23, r1, 16 - addik r1, r1, 20 - - /* return from sub-routine (with delay slot) */ - rtsd r15, 8 - nop - - .size ffi_call_SYSV, . - ffi_call_SYSV - -/* ------------------------------------------------------------------------- */ - - /* - * args passed into this function, are passed down to the callee. - * this function is the target of the closure trampoline, as such r12 is - * a pointer to the closure object. - */ - .text - .globl ffi_closure_SYSV - .type ffi_closure_SYSV, @function -ffi_closure_SYSV: - /* push callee saves */ - addik r11, r1, 28 /* save stack args start location (excluding regs/link) */ - addik r1, r1, -12 - swi r19, r1, 0 /* Frame Pointer */ - swi r20, r1, 4 /* PIC register */ - swi r21, r1, 8 /* PIC register */ - - /* store register args on stack */ - addik r1, r1, -24 - swi r5, r1, 0 - swi r6, r1, 4 - swi r7, r1, 8 - swi r8, r1, 12 - swi r9, r1, 16 - swi r10, r1, 20 - - /* setup args */ - addik r5, r1, 0 /* register_args */ - addik r6, r11, 0 /* stack_args */ - addik r7, r12, 0 /* closure object */ - addik r1, r1, -8 /* allocate return value */ - addik r8, r1, 0 /* void* rvalue */ - addik r1, r1, -8 /* allocate for return type/size values */ - addik r9, r1, 0 /* void* rtype */ - addik r10, r1, 4 /* void* rsize */ - - /* call the wrap_call function */ - addik r1, r1, -28 /* allocate args + link reg */ - swi r15, r1, 0 /* store the link register in the frame */ - brald r15, r3 - nop /* branch has delay slot */ - lwi r15, r1, 0 - addik r1, r1, 28 /* restore the link register from the frame */ - -ffi_closure_SYSV_prepare_return: - lwi r9, r1, 0 /* rtype */ - lwi r10, r1, 4 /* rsize */ - addik r1, r1, 8 /* de-allocate return info values */ - - /* Check if return type is actually a struct, store 4 bytes */ - rsubi r11, r9, FFI_TYPE_STRUCT - beqi r11, ffi_closure_SYSV_store32 - - /* Return 8bit */ - rsubi r11, r10, 1 - beqi r11, ffi_closure_SYSV_store8 - - /* Return 16bit */ - rsubi r11, r10, 2 - beqi r11, ffi_closure_SYSV_store16 - - /* Return 32bit */ - rsubi r11, r10, 4 - beqi r11, ffi_closure_SYSV_store32 - - /* Return 64bit */ - rsubi r11, r10, 8 - beqi r11, ffi_closure_SYSV_store64 - - /* Didn't match anything */ - bri ffi_closure_SYSV_end - -ffi_closure_SYSV_store64: - lwi r3, r1, 0 /* store word r3 into return value */ - lwi r4, r1, 4 /* store word r4 into return value */ - /* 64 bits == 2 words, no sign extend occurs */ - bri ffi_closure_SYSV_end - -ffi_closure_SYSV_store32: - lwi r3, r1, 0 /* store word r3 into return value */ - /* 32 bits == 1 word, no sign extend occurs */ - bri ffi_closure_SYSV_end - -ffi_closure_SYSV_store16: -#ifdef __BIG_ENDIAN__ - lhui r3, r1, 2 /* store half-word r3 into return value */ -#else - lhui r3, r1, 0 /* store half-word r3 into return value */ -#endif - rsubi r11, r9, FFI_TYPE_SINT16 - bnei r11, ffi_closure_SYSV_end - sext16 r3, r3 /* fix sign extend of sint8 */ - bri ffi_closure_SYSV_end - -ffi_closure_SYSV_store8: -#ifdef __BIG_ENDIAN__ - lbui r3, r1, 3 /* store byte r3 into return value */ -#else - lbui r3, r1, 0 /* store byte r3 into return value */ -#endif - rsubi r11, r9, FFI_TYPE_SINT8 - bnei r11, ffi_closure_SYSV_end - sext8 r3, r3 /* fix sign extend of sint8 */ - bri ffi_closure_SYSV_end - -ffi_closure_SYSV_end: - addik r1, r1, 8 /* de-allocate return value */ - - /* de-allocate stored args */ - addik r1, r1, 24 - - /* callee restores */ - lwi r19, r1, 0 /* frame pointer */ - lwi r20, r1, 4 /* PIC register */ - lwi r21, r1, 8 /* PIC register */ - addik r1, r1, 12 - - /* return from sub-routine (with delay slot) */ - rtsd r15, 8 - nop - - .size ffi_closure_SYSV, . - ffi_closure_SYSV diff --git a/deps/libffi/src/mips/ffi.c b/deps/libffi/src/mips/ffi.c deleted file mode 100644 index 5c8c6bc5d4473d..00000000000000 --- a/deps/libffi/src/mips/ffi.c +++ /dev/null @@ -1,1317 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2011 Anthony Green - Copyright (c) 2008 David Daney - Copyright (c) 1996, 2007, 2008, 2011 Red Hat, Inc. - - MIPS Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include -#include - -#ifdef __GNUC__ -# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) -# define USE__BUILTIN___CLEAR_CACHE 1 -# endif -#endif - -#ifndef USE__BUILTIN___CLEAR_CACHE -# if defined(__FreeBSD__) -# include -# elif defined(__OpenBSD__) -# include -# else -# include -# endif -#endif - -#ifdef FFI_DEBUG -# define FFI_MIPS_STOP_HERE() ffi_stop_here() -#else -# define FFI_MIPS_STOP_HERE() do {} while(0) -#endif - -#ifdef FFI_MIPS_N32 -#define FIX_ARGP \ -FFI_ASSERT(argp <= &stack[bytes]); \ -if (argp == &stack[bytes]) \ -{ \ - argp = stack; \ - FFI_MIPS_STOP_HERE(); \ -} -#else -#define FIX_ARGP -#endif - - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - -static void ffi_prep_args(char *stack, - extended_cif *ecif, - int bytes, - int flags) -{ - int i; - void **p_argv; - char *argp, *argp_f; - ffi_type **p_arg; - - memset(stack, 0, bytes); - -#ifdef FFI_MIPS_N32 - int soft_float = (ecif->cif->abi == FFI_N32_SOFT_FLOAT - || ecif->cif->abi == FFI_N64_SOFT_FLOAT); - /* If more than 8 double words are used, the remainder go - on the stack. We reorder stuff on the stack here to - support this easily. */ - /* if ret is _Complex long double, args reg shift2, and a0 should holds pointer to rvalue */ - if (ecif->cif->rtype->type == FFI_TYPE_COMPLEX && ecif->cif->rtype->elements[0]->type == FFI_TYPE_LONGDOUBLE) - { - if (bytes + 16 > 8 * sizeof(ffi_arg)) - argp = &stack[bytes - (8 * sizeof(ffi_arg))]; - else - argp = stack; - * (unsigned long *) argp = (unsigned long) ecif->rvalue; - argp += 16; - } - else - { - if (bytes > 8 * sizeof(ffi_arg)) - argp = &stack[bytes - (8 * sizeof(ffi_arg))]; - else - argp = stack; - } -#else - argp = stack; -#endif - - argp_f = argp; - -#ifdef FFI_MIPS_N32 - if ( ecif->cif->rstruct_flag != 0 ) -#else - if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) -#endif - { - *(ffi_arg *) argp = (ffi_arg) ecif->rvalue; - argp += sizeof(ffi_arg); - FIX_ARGP; - } - - p_argv = ecif->avalue; - - for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs; i++, p_arg++) - { - size_t z; - unsigned int a; - - /* Align if necessary. */ - a = (*p_arg)->alignment; - if (a < sizeof(ffi_arg)) - a = sizeof(ffi_arg); - - if ((a - 1) & (unsigned long) argp) - { - argp = (char *) FFI_ALIGN(argp, a); - FIX_ARGP; - } - - z = (*p_arg)->size; - if (z <= sizeof(ffi_arg)) - { - int type = (*p_arg)->type; - z = sizeof(ffi_arg); - - /* The size of a pointer depends on the ABI */ - if (type == FFI_TYPE_POINTER) - type = (ecif->cif->abi == FFI_N64 - || ecif->cif->abi == FFI_N64_SOFT_FLOAT) - ? FFI_TYPE_SINT64 : FFI_TYPE_UINT32; - - if (i < 8 && (ecif->cif->abi == FFI_N32_SOFT_FLOAT - || ecif->cif->abi == FFI_N64_SOFT_FLOAT)) - { - switch (type) - { - case FFI_TYPE_FLOAT: - type = FFI_TYPE_UINT32; - break; - case FFI_TYPE_DOUBLE: - type = FFI_TYPE_UINT64; - break; - default: - break; - } - } - switch (type) - { - case FFI_TYPE_SINT8: - *(ffi_arg *)argp = *(SINT8 *)(* p_argv); - break; - - case FFI_TYPE_UINT8: - *(ffi_arg *)argp = *(UINT8 *)(* p_argv); - break; - - case FFI_TYPE_SINT16: - *(ffi_arg *)argp = *(SINT16 *)(* p_argv); - break; - - case FFI_TYPE_UINT16: - *(ffi_arg *)argp = *(UINT16 *)(* p_argv); - break; - - case FFI_TYPE_SINT32: - *(ffi_arg *)argp = *(SINT32 *)(* p_argv); - break; - - case FFI_TYPE_UINT32: -#ifdef FFI_MIPS_N32 - /* The N32 ABI requires that 32-bit integers - be sign-extended to 64-bits, regardless of - whether they are signed or unsigned. */ - *(ffi_arg *)argp = *(SINT32 *)(* p_argv); -#else - *(ffi_arg *)argp = *(UINT32 *)(* p_argv); -#endif - break; - -#ifdef FFI_MIPS_N32 - case FFI_TYPE_COMPLEX: - /* expand from 4+4 to 8+8 if pass with fpr reg */ - /* argp will wind back to stack when we process all of reg args */ - /* all var_args passed with gpr, should be expand */ - if(!soft_float - && (*p_arg)->elements[0]->type == FFI_TYPE_FLOAT - && argp>=argp_f - && i < ecif->cif->mips_nfixedargs) - { - *(float *) argp = *(float *)(* p_argv); - argp += z; - char *tmp = (void *) (*p_argv); - *(float *) argp = *(float *)(tmp+4); - } - else - memcpy(argp, *p_argv, (*p_arg)->size); - break; -#endif - /* This can only happen with 64bit slots. */ - case FFI_TYPE_FLOAT: - *(float *) argp = *(float *)(* p_argv); - break; - - /* Handle structures. */ - default: - memcpy(argp, *p_argv, (*p_arg)->size); - break; - } - } - else - { -#ifdef FFI_MIPS_O32 - memcpy(argp, *p_argv, z); -#else - { - unsigned long end = (unsigned long) argp + z; - unsigned long cap = (unsigned long) stack + bytes; - - /* Check if the data will fit within the register space. - Handle it if it doesn't. */ - - if (end <= cap) - memcpy(argp, *p_argv, z); - else - { - unsigned long portion = cap - (unsigned long)argp; - - memcpy(argp, *p_argv, portion); - argp = stack; - z -= portion; - memcpy(argp, (void*)((unsigned long)(*p_argv) + portion), - z); - } - } -#endif - } - p_argv++; - argp += z; - FIX_ARGP; - } -} - -#ifdef FFI_MIPS_N32 - -/* The n32 spec says that if "a chunk consists solely of a double - float field (but not a double, which is part of a union), it - is passed in a floating point register. Any other chunk is - passed in an integer register". This code traverses structure - definitions and generates the appropriate flags. */ - -static int -calc_n32_struct_flags_element(unsigned *flags, ffi_type *e, - unsigned *loc, unsigned *arg_reg) -{ - /* Align this object. */ - *loc = FFI_ALIGN(*loc, e->alignment); - if (e->type == FFI_TYPE_DOUBLE) - { - /* Already aligned to FFI_SIZEOF_ARG. */ - *arg_reg = *loc / FFI_SIZEOF_ARG; - if (*arg_reg > 7) - return 1; - *flags += (FFI_TYPE_DOUBLE << (*arg_reg * FFI_FLAG_BITS)); - } - *loc += e->size; - return 0; -} - -static unsigned -calc_n32_struct_flags(int soft_float, ffi_type *arg, - unsigned *loc, unsigned *arg_reg) -{ - unsigned flags = 0; - unsigned index = 0; - - ffi_type *e; - - if (soft_float) - return 0; - - while ((e = arg->elements[index])) - { - if (e->type == FFI_TYPE_COMPLEX) - { - if (calc_n32_struct_flags_element(&flags, e->elements[0], loc, arg_reg)) - break; - if (calc_n32_struct_flags_element(&flags, e->elements[0], loc, arg_reg)) - break; - } - else - if (calc_n32_struct_flags_element(&flags, e, loc, arg_reg)) - break; - index++; - } - /* Next Argument register at alignment of FFI_SIZEOF_ARG. */ - *arg_reg = FFI_ALIGN(*loc, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; - - return flags; -} - -static unsigned -calc_n32_return_struct_flags(int soft_float, ffi_type *arg) -{ - unsigned flags; - unsigned small = FFI_TYPE_SMALLSTRUCT; - ffi_type *e; - - /* Returning structures under n32 is a tricky thing. - A struct with only one or two floating point fields - is returned in $f0 (and $f2 if necessary). Any other - struct results at most 128 bits are returned in $2 - (the first 64 bits) and $3 (remainder, if necessary). - Larger structs are handled normally. */ - - if (arg->size > 16) - return 0; - - if (arg->size > 8) - small = FFI_TYPE_SMALLSTRUCT2; - - e = arg->elements[0]; - - if (e->type == FFI_TYPE_COMPLEX) - { - int type = e->elements[0]->type; - - if (type != FFI_TYPE_DOUBLE && type != FFI_TYPE_FLOAT) - return small; - - if (arg->elements[1]) - { - /* Two floating point fields with more fields! - This must be passed the old way. */ - return small; - } - - flags = (type << FFI_FLAG_BITS) + type; - } - else - { - if (e->type != FFI_TYPE_DOUBLE && e->type != FFI_TYPE_FLOAT) - return small; - - flags = e->type; - - if (arg->elements[1]) - { - e = arg->elements[1]; - if (e->type != FFI_TYPE_DOUBLE && e->type != FFI_TYPE_FLOAT) - return small; - - if (arg->elements[2]) - { - /* There are three arguments and the first two are - floats! This must be passed the old way. */ - return small; - } - - flags += e->type << FFI_FLAG_BITS; - } - } - - if (soft_float) - flags += FFI_TYPE_STRUCT_SOFT; - return flags; -} - -#endif - -/* Perform machine dependent cif processing */ -static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) -{ - cif->flags = 0; - cif->mips_nfixedargs = nfixedargs; - -#ifdef FFI_MIPS_O32 - /* Set the flags necessary for O32 processing. FFI_O32_SOFT_FLOAT - * does not have special handling for floating point args. - */ - - if (cif->rtype->type != FFI_TYPE_STRUCT && cif->rtype->type != FFI_TYPE_COMPLEX && cif->abi == FFI_O32) - { - if (cif->nargs > 0 && cif->nargs == nfixedargs) - { - switch ((cif->arg_types)[0]->type) - { - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - cif->flags += (cif->arg_types)[0]->type; - break; - - default: - break; - } - - if (cif->nargs > 1) - { - /* Only handle the second argument if the first - is a float or double. */ - if (cif->flags) - { - switch ((cif->arg_types)[1]->type) - { - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - cif->flags += (cif->arg_types)[1]->type << FFI_FLAG_BITS; - break; - - default: - break; - } - } - } - } - } - - /* Set the return type flag */ - - if (cif->abi == FFI_O32_SOFT_FLOAT) - { - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - case FFI_TYPE_STRUCT: - cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2); - break; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_DOUBLE: - cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2); - break; - - case FFI_TYPE_FLOAT: - default: - cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2); - break; - } - } - else - { - /* FFI_O32 */ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - case FFI_TYPE_STRUCT: - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_COMPLEX: - cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2); - if (cif->rtype->type == FFI_TYPE_COMPLEX) - cif->flags += ((*cif->rtype->elements[0]).type) << (FFI_FLAG_BITS * 4); - break; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2); - break; - - default: - cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2); - break; - } - } -#endif - -#ifdef FFI_MIPS_N32 - /* Set the flags necessary for N32 processing */ - { - unsigned arg_reg = 0; - unsigned loc = 0; - unsigned count = (cif->nargs < 8) ? cif->nargs : 8; - unsigned index = 0; - - unsigned struct_flags = 0; - int soft_float = (cif->abi == FFI_N32_SOFT_FLOAT - || cif->abi == FFI_N64_SOFT_FLOAT); - - if (cif->rtype->type == FFI_TYPE_STRUCT) - { - struct_flags = calc_n32_return_struct_flags(soft_float, cif->rtype); - - if (struct_flags == 0) - { - /* This means that the structure is being passed as - a hidden argument */ - - arg_reg = 1; - count = (cif->nargs < 7) ? cif->nargs : 7; - - cif->rstruct_flag = !0; - } - else - cif->rstruct_flag = 0; - } - else - cif->rstruct_flag = 0; - - while (count-- > 0 && arg_reg < 8) - { - ffi_type *t = cif->arg_types[index]; - - switch (t->type) - { - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - if (!soft_float && index < nfixedargs) - cif->flags += t->type << (arg_reg * FFI_FLAG_BITS); - arg_reg++; - break; - case FFI_TYPE_LONGDOUBLE: - /* Align it. */ - arg_reg = FFI_ALIGN(arg_reg, 2); - /* Treat it as two adjacent doubles. */ - if (soft_float || index >= nfixedargs) - { - arg_reg += 2; - } - else - { - cif->flags += - (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); - arg_reg++; - if (arg_reg >= 8) - continue; - cif->flags += - (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); - arg_reg++; - } - break; - - case FFI_TYPE_COMPLEX: - switch (t->elements[0]->type) - { - case FFI_TYPE_LONGDOUBLE: - arg_reg = FFI_ALIGN(arg_reg, 2); - if (soft_float || index >= nfixedargs) - { - arg_reg += 2; - } - else - { - cif->flags += - (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); - arg_reg++; - if (arg_reg >= 8) - continue; - cif->flags += - (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); - arg_reg++; - if (arg_reg >= 8) - continue; - } - /* passthrough */ - case FFI_TYPE_FLOAT: - // one fpr can only holds one arg even it is single - cif->bytes += 16; - /* passthrough */ - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_DOUBLE: - if (soft_float || index >= nfixedargs) - { - arg_reg += 2; - } - else - { - uint32_t type = t->elements[0]->type != FFI_TYPE_LONGDOUBLE? t->elements[0]->type: FFI_TYPE_DOUBLE; - cif->flags += - (type << (arg_reg * FFI_FLAG_BITS)); - arg_reg++; - if (arg_reg >= 8) - continue; - cif->flags += - (type << (arg_reg * FFI_FLAG_BITS)); - arg_reg++; - } - break; - default: - arg_reg += 2; - break; - } - break; - - case FFI_TYPE_STRUCT: - loc = arg_reg * FFI_SIZEOF_ARG; - cif->flags += calc_n32_struct_flags(soft_float || index >= nfixedargs, - t, &loc, &arg_reg); - break; - - default: - arg_reg++; - break; - } - - index++; - } - - /* Set the return type flag */ - switch (cif->rtype->type) - { - case FFI_TYPE_STRUCT: - { - if (struct_flags == 0) - { - /* The structure is returned through a hidden - first argument. Do nothing, 'cause FFI_TYPE_VOID - is 0 */ - } - else - { - /* The structure is returned via some tricky - mechanism */ - cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8); - cif->flags += struct_flags << (4 + (FFI_FLAG_BITS * 8)); - } - break; - } - - case FFI_TYPE_VOID: - /* Do nothing, 'cause FFI_TYPE_VOID is 0 */ - break; - - case FFI_TYPE_POINTER: - if (cif->abi == FFI_N32_SOFT_FLOAT || cif->abi == FFI_N32) - cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8); - else - cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 8); - break; - - case FFI_TYPE_FLOAT: - if (soft_float) - { - cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8); - break; - } - /* else fall through */ - case FFI_TYPE_DOUBLE: - if (soft_float) - cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 8); - else - cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8); - break; - - case FFI_TYPE_LONGDOUBLE: - /* Long double is returned as if it were a struct containing - two doubles. */ - if (soft_float) - { - /* if ret is long double, the ret is given by v0 and a0, no idea why - * Let's us VOID | VOID | LONGDOUBLE for it*/ - cif->flags += FFI_TYPE_LONGDOUBLE << (FFI_FLAG_BITS * 8); - } - else - { - cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8); - cif->flags += (FFI_TYPE_DOUBLE - + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS)) - << (4 + (FFI_FLAG_BITS * 8)); - } - break; - case FFI_TYPE_COMPLEX: - { - int type = cif->rtype->elements[0]->type; - - cif->flags += (FFI_TYPE_COMPLEX << (FFI_FLAG_BITS * 8)); - if (soft_float || (type != FFI_TYPE_FLOAT && type != FFI_TYPE_DOUBLE && type != FFI_TYPE_LONGDOUBLE)) - { - switch (type) - { - case FFI_TYPE_DOUBLE: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_INT: - type = FFI_TYPE_SMALLSTRUCT2; - break; - case FFI_TYPE_LONGDOUBLE: - type = FFI_TYPE_LONGDOUBLE; - break; - case FFI_TYPE_FLOAT: - default: - type = FFI_TYPE_SMALLSTRUCT; - } - cif->flags += type << (4 + (FFI_FLAG_BITS * 8)); - } - else - { - //cif->flags += (type + (type << FFI_FLAG_BITS)) - // << (4 + (FFI_FLAG_BITS * 8)); - cif->flags += type << (4 + (FFI_FLAG_BITS * 8)); - } - break; - } - case FFI_TYPE_UINT32: - /* In the N32 or N64 ABI unsigned 32-bit integer should be - *sign*-extended. */ - cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8); - break; - case FFI_TYPE_SINT64: - cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 8); - break; - default: - cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8); - break; - } - } -#endif - return FFI_OK; -} - -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - return ffi_prep_cif_machdep_int(cif, cif->nargs); -} - -ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, - unsigned nfixedargs, - unsigned ntotalargs MAYBE_UNUSED) -{ - return ffi_prep_cif_machdep_int(cif, nfixedargs); -} - -/* Low level routine for calling O32 functions */ -extern int ffi_call_O32(void (*)(char *, extended_cif *, int, int), - extended_cif *, unsigned, - unsigned, unsigned *, void (*)(void), void *closure); - -/* Low level routine for calling N32 functions */ -extern int ffi_call_N32(void (*)(char *, extended_cif *, int, int), - extended_cif *, unsigned, - unsigned, void *, void (*)(void), void *closure); - -void ffi_call_int(ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return */ - /* value address then we need to make one */ - - if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT || cif->rtype->type == FFI_TYPE_COMPLEX)) - ecif.rvalue = alloca(cif->rtype->size); - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { -#ifdef FFI_MIPS_O32 - case FFI_O32: - case FFI_O32_SOFT_FLOAT: - ffi_call_O32(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn, closure); - break; -#endif - -#ifdef FFI_MIPS_N32 - case FFI_N32: - case FFI_N32_SOFT_FLOAT: - case FFI_N64: - case FFI_N64_SOFT_FLOAT: - { - int copy_rvalue = 0; - int copy_offset = 0; - char *rvalue_copy = ecif.rvalue; - if (cif->rtype->type == FFI_TYPE_STRUCT && cif->rtype->size < 16) - { - /* For structures smaller than 16 bytes we clobber memory - in 8 byte increments. Make a copy so we don't clobber - the callers memory outside of the struct bounds. */ - rvalue_copy = alloca(16); - copy_rvalue = 1; - } - else if (cif->rtype->type == FFI_TYPE_FLOAT - && (cif->abi == FFI_N64_SOFT_FLOAT - || cif->abi == FFI_N32_SOFT_FLOAT)) - { - rvalue_copy = alloca (8); - copy_rvalue = 1; -#if defined(__MIPSEB__) || defined(_MIPSEB) - copy_offset = 4; -#endif - } - ffi_call_N32(ffi_prep_args, &ecif, cif->bytes, - cif->flags, rvalue_copy, fn, closure); - if (copy_rvalue) - memcpy(ecif.rvalue, rvalue_copy + copy_offset, cif->rtype->size); - } - break; -#endif - - default: - FFI_ASSERT(0); - break; - } -} - -void -ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - ffi_call_int (cif, fn, rvalue, avalue, NULL); -} - -void -ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int (cif, fn, rvalue, avalue, closure); -} - - -#if FFI_CLOSURES -#if defined(FFI_MIPS_O32) -extern void ffi_closure_O32(void); -extern void ffi_go_closure_O32(void); -#else -extern void ffi_closure_N32(void); -extern void ffi_go_closure_N32(void); -#endif /* FFI_MIPS_O32 */ - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - unsigned int *tramp = (unsigned int *) &closure->tramp[0]; - void * fn; - char *clear_location = (char *) codeloc; - -#if defined(FFI_MIPS_O32) - if (cif->abi != FFI_O32 && cif->abi != FFI_O32_SOFT_FLOAT) - return FFI_BAD_ABI; - fn = ffi_closure_O32; -#else -#if _MIPS_SIM ==_ABIN32 - if (cif->abi != FFI_N32 - && cif->abi != FFI_N32_SOFT_FLOAT) - return FFI_BAD_ABI; -#else - if (cif->abi != FFI_N64 - && cif->abi != FFI_N64_SOFT_FLOAT) - return FFI_BAD_ABI; -#endif - fn = ffi_closure_N32; -#endif /* FFI_MIPS_O32 */ - -#if defined(FFI_MIPS_O32) || (_MIPS_SIM ==_ABIN32) - /* lui $25,high(fn) */ - tramp[0] = 0x3c190000 | ((unsigned)fn >> 16); - /* ori $25,low(fn) */ - tramp[1] = 0x37390000 | ((unsigned)fn & 0xffff); - /* lui $12,high(codeloc) */ - tramp[2] = 0x3c0c0000 | ((unsigned)codeloc >> 16); - /* jr $25 */ -#if !defined(__mips_isa_rev) || (__mips_isa_rev<6) - tramp[3] = 0x03200008; -#else - tramp[3] = 0x03200009; -#endif - /* ori $12,low(codeloc) */ - tramp[4] = 0x358c0000 | ((unsigned)codeloc & 0xffff); -#else - /* N64 has a somewhat larger trampoline. */ - /* lui $25,high(fn) */ - tramp[0] = 0x3c190000 | ((unsigned long)fn >> 48); - /* lui $12,high(codeloc) */ - tramp[1] = 0x3c0c0000 | ((unsigned long)codeloc >> 48); - /* ori $25,mid-high(fn) */ - tramp[2] = 0x37390000 | (((unsigned long)fn >> 32 ) & 0xffff); - /* ori $12,mid-high(codeloc) */ - tramp[3] = 0x358c0000 | (((unsigned long)codeloc >> 32) & 0xffff); - /* dsll $25,$25,16 */ - tramp[4] = 0x0019cc38; - /* dsll $12,$12,16 */ - tramp[5] = 0x000c6438; - /* ori $25,mid-low(fn) */ - tramp[6] = 0x37390000 | (((unsigned long)fn >> 16 ) & 0xffff); - /* ori $12,mid-low(codeloc) */ - tramp[7] = 0x358c0000 | (((unsigned long)codeloc >> 16) & 0xffff); - /* dsll $25,$25,16 */ - tramp[8] = 0x0019cc38; - /* dsll $12,$12,16 */ - tramp[9] = 0x000c6438; - /* ori $25,low(fn) */ - tramp[10] = 0x37390000 | ((unsigned long)fn & 0xffff); - /* jr $25 */ -#if !defined(__mips_isa_rev) || (__mips_isa_rev<6) - tramp[11] = 0x03200008; -#else - tramp[11] = 0x03200009; -#endif - /* ori $12,low(codeloc) */ - tramp[12] = 0x358c0000 | ((unsigned long)codeloc & 0xffff); - -#endif - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - -#if !defined(__FreeBSD__) -#ifdef USE__BUILTIN___CLEAR_CACHE - __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE); -#else - cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE); -#endif -#endif /* ! __FreeBSD__ */ - return FFI_OK; -} - -/* - * Decodes the arguments to a function, which will be stored on the - * stack. AR is the pointer to the beginning of the integer arguments - * (and, depending upon the arguments, some floating-point arguments - * as well). FPR is a pointer to the area where floating point - * registers have been saved, if any. - * - * RVALUE is the location where the function return value will be - * stored. CLOSURE is the prepared closure to invoke. - * - * This function should only be called from assembly, which is in - * turn called from a trampoline. - * - * Returns the function return type. - * - * Based on the similar routine for sparc. - */ -int -ffi_closure_mips_inner_O32 (ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *rvalue, ffi_arg *ar, - double *fpr) -{ - void **avaluep; - ffi_arg *avalue; - ffi_type **arg_types; - int i, avn, argn, seen_int; - - avalue = alloca (cif->nargs * sizeof (ffi_arg)); - avaluep = alloca (cif->nargs * sizeof (ffi_arg)); - - seen_int = (cif->abi == FFI_O32_SOFT_FLOAT) || (cif->mips_nfixedargs != cif->nargs); - argn = 0; - - if ((cif->flags >> (FFI_FLAG_BITS * 2)) == FFI_TYPE_STRUCT) - { - rvalue = (void *)(uintptr_t)ar[0]; - argn = 1; - seen_int = 1; - } - if ((cif->flags >> (FFI_FLAG_BITS * 2)) == FFI_TYPE_COMPLEX) - { - rvalue = fpr; - argn = 1; - } - - i = 0; - avn = cif->nargs; - arg_types = cif->arg_types; - - while (i < avn) - { - if (arg_types[i]->alignment == 8 && (argn & 0x1)) - argn++; - if (i < 2 && !seen_int && - (arg_types[i]->type == FFI_TYPE_FLOAT || - arg_types[i]->type == FFI_TYPE_DOUBLE || - arg_types[i]->type == FFI_TYPE_LONGDOUBLE)) - { -#if defined(__MIPSEB__) || defined(_MIPSEB) - if (arg_types[i]->type == FFI_TYPE_FLOAT) - avaluep[i] = ((char *) &fpr[i]) + sizeof (float); - else -#endif - avaluep[i] = (char *) &fpr[i]; - } - else - { - switch (arg_types[i]->type) - { - case FFI_TYPE_SINT8: - avaluep[i] = &avalue[i]; - *(SINT8 *) &avalue[i] = (SINT8) ar[argn]; - break; - - case FFI_TYPE_UINT8: - avaluep[i] = &avalue[i]; - *(UINT8 *) &avalue[i] = (UINT8) ar[argn]; - break; - - case FFI_TYPE_SINT16: - avaluep[i] = &avalue[i]; - *(SINT16 *) &avalue[i] = (SINT16) ar[argn]; - break; - - case FFI_TYPE_UINT16: - avaluep[i] = &avalue[i]; - *(UINT16 *) &avalue[i] = (UINT16) ar[argn]; - break; - - default: - avaluep[i] = (char *) &ar[argn]; - break; - } - seen_int = 1; - } - argn += FFI_ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; - i++; - } - - /* Invoke the closure. */ - fun(cif, rvalue, avaluep, user_data); - - if (cif->abi == FFI_O32_SOFT_FLOAT) - { - switch (cif->rtype->type) - { - case FFI_TYPE_FLOAT: - return FFI_TYPE_INT; - case FFI_TYPE_DOUBLE: - return FFI_TYPE_UINT64; - default: - return cif->rtype->type; - } - } - else - { - if (cif->rtype->type == FFI_TYPE_COMPLEX) { - __asm__ volatile ("move $v1, %0" : : "r"(cif->rtype->size)); - } - return cif->rtype->type; - } -} - -#if defined(FFI_MIPS_N32) - -static void -copy_struct_N32(char *target, unsigned offset, ffi_abi abi, ffi_type *type, - int argn, unsigned arg_offset, ffi_arg *ar, - ffi_arg *fpr, int soft_float) -{ - ffi_type **elt_typep = type->elements; - while(*elt_typep) - { - ffi_type *elt_type = *elt_typep; - unsigned o; - char *tp; - char *argp; - char *fpp; - - o = FFI_ALIGN(offset, elt_type->alignment); - arg_offset += o - offset; - offset = o; - argn += arg_offset / sizeof(ffi_arg); - arg_offset = arg_offset % sizeof(ffi_arg); - - argp = (char *)(ar + argn); - fpp = (char *)(argn >= 8 ? ar + argn : fpr + argn); - - tp = target + offset; - - if (elt_type->type == FFI_TYPE_DOUBLE && !soft_float) - *(double *)tp = *(double *)fpp; - else - memcpy(tp, argp + arg_offset, elt_type->size); - - offset += elt_type->size; - arg_offset += elt_type->size; - elt_typep++; - argn += arg_offset / sizeof(ffi_arg); - arg_offset = arg_offset % sizeof(ffi_arg); - } -} - -/* - * Decodes the arguments to a function, which will be stored on the - * stack. AR is the pointer to the beginning of the integer - * arguments. FPR is a pointer to the area where floating point - * registers have been saved. - * - * RVALUE is the location where the function return value will be - * stored. CLOSURE is the prepared closure to invoke. - * - * This function should only be called from assembly, which is in - * turn called from a trampoline. - * - * Returns the function return flags. - * - */ -int -ffi_closure_mips_inner_N32 (ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *rvalue, ffi_arg *ar, - ffi_arg *fpr) -{ - void **avaluep; - ffi_arg *avalue; - ffi_type **arg_types; - int i, avn, argn; - int soft_float; - ffi_arg *argp; - - soft_float = cif->abi == FFI_N64_SOFT_FLOAT - || cif->abi == FFI_N32_SOFT_FLOAT; - avalue = alloca (cif->nargs * sizeof (ffi_arg)); - avaluep = alloca (cif->nargs * sizeof (ffi_arg)); - - argn = 0; - - if (cif->rstruct_flag) - { -#if _MIPS_SIM==_ABIN32 - rvalue = (void *)(UINT32)ar[0]; -#else /* N64 */ - rvalue = (void *)ar[0]; -#endif - argn = 1; - } - if (cif->rtype->type == FFI_TYPE_COMPLEX && cif->rtype->elements[0]->type == FFI_TYPE_LONGDOUBLE) - argn = 2; - - i = 0; - avn = cif->nargs; - arg_types = cif->arg_types; - - while (i < avn) - { - if (arg_types[i]->type == FFI_TYPE_FLOAT - || arg_types[i]->type == FFI_TYPE_DOUBLE - || arg_types[i]->type == FFI_TYPE_LONGDOUBLE) - { - argp = (argn >= 8 || i >= cif->mips_nfixedargs || soft_float) ? ar + argn : fpr + argn; - if ((arg_types[i]->type == FFI_TYPE_LONGDOUBLE) && ((uintptr_t)argp & (arg_types[i]->alignment-1))) - { - argp=(ffi_arg*)FFI_ALIGN(argp,arg_types[i]->alignment); - argn++; - } -#if defined(__MIPSEB__) || defined(_MIPSEB) - if (arg_types[i]->type == FFI_TYPE_FLOAT && argn < 8) - avaluep[i] = ((char *) argp) + sizeof (float); - else -#endif - avaluep[i] = (char *) argp; - } - else if (arg_types[i]->type == FFI_TYPE_COMPLEX && arg_types[i]->elements[0]->type == FFI_TYPE_DOUBLE) - { - argp = (argn >= 8 || i >= cif->mips_nfixedargs || soft_float) ? ar + argn : fpr + argn; - avaluep[i] = (char *) argp; - } - else if (arg_types[i]->type == FFI_TYPE_COMPLEX && arg_types[i]->elements[0]->type == FFI_TYPE_LONGDOUBLE) - { - /* align long double */ - argn += ((argn & 0x1)? 1 : 0); - argp = (argn >= 8 || i >= cif->mips_nfixedargs || soft_float) ? ar + argn : fpr + argn; - avaluep[i] = (char *) argp; - } - else if (arg_types[i]->type == FFI_TYPE_COMPLEX && arg_types[i]->elements[0]->type == FFI_TYPE_FLOAT) - { - if (argn >= 8 || i >= cif->mips_nfixedargs || soft_float) - argp = ar + argn; - else - { - argp = fpr + argn; - /* the normal args for function holds 8bytes, while here we convert it to ptr */ - uint32_t *tmp = (uint32_t *)argp; - tmp[1] = tmp[2]; - } - avaluep[i] = (char *) argp; - } - else - { - unsigned type = arg_types[i]->type; - - if (arg_types[i]->alignment > sizeof(ffi_arg)) - argn = FFI_ALIGN(argn, arg_types[i]->alignment / sizeof(ffi_arg)); - - argp = ar + argn; - - /* The size of a pointer depends on the ABI */ - if (type == FFI_TYPE_POINTER) - type = (cif->abi == FFI_N64 || cif->abi == FFI_N64_SOFT_FLOAT) - ? FFI_TYPE_SINT64 : FFI_TYPE_UINT32; - - if (soft_float && type == FFI_TYPE_FLOAT) - type = FFI_TYPE_SINT32; - - switch (type) - { - case FFI_TYPE_SINT8: - avaluep[i] = &avalue[i]; - *(SINT8 *) &avalue[i] = (SINT8) *argp; - break; - - case FFI_TYPE_UINT8: - avaluep[i] = &avalue[i]; - *(UINT8 *) &avalue[i] = (UINT8) *argp; - break; - - case FFI_TYPE_SINT16: - avaluep[i] = &avalue[i]; - *(SINT16 *) &avalue[i] = (SINT16) *argp; - break; - - case FFI_TYPE_UINT16: - avaluep[i] = &avalue[i]; - *(UINT16 *) &avalue[i] = (UINT16) *argp; - break; - - case FFI_TYPE_SINT32: - avaluep[i] = &avalue[i]; - *(SINT32 *) &avalue[i] = (SINT32) *argp; - break; - - case FFI_TYPE_UINT32: - avaluep[i] = &avalue[i]; - *(UINT32 *) &avalue[i] = (UINT32) *argp; - break; - - case FFI_TYPE_STRUCT: - if (argn < 8) - { - /* Allocate space for the struct as at least part of - it was passed in registers. */ - avaluep[i] = alloca(arg_types[i]->size); - copy_struct_N32(avaluep[i], 0, cif->abi, arg_types[i], - argn, 0, ar, fpr, i >= cif->mips_nfixedargs || soft_float); - - break; - } - /* Else fall through. */ - default: - avaluep[i] = (char *) argp; - break; - } - } - argn += FFI_ALIGN(arg_types[i]->size, sizeof(ffi_arg)) / sizeof(ffi_arg); - i++; - } - - /* Invoke the closure. */ - fun (cif, rvalue, avaluep, user_data); - - return cif->flags >> (FFI_FLAG_BITS * 8); -} - -#endif /* FFI_MIPS_N32 */ - -#if defined(FFI_MIPS_O32) -extern void ffi_closure_O32(void); -extern void ffi_go_closure_O32(void); -#else -extern void ffi_closure_N32(void); -extern void ffi_go_closure_N32(void); -#endif /* FFI_MIPS_O32 */ - -ffi_status -ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*)) -{ - void * fn; - -#if defined(FFI_MIPS_O32) - if (cif->abi != FFI_O32 && cif->abi != FFI_O32_SOFT_FLOAT) - return FFI_BAD_ABI; - fn = ffi_go_closure_O32; -#else -#if _MIPS_SIM ==_ABIN32 - if (cif->abi != FFI_N32 - && cif->abi != FFI_N32_SOFT_FLOAT) - return FFI_BAD_ABI; -#else - if (cif->abi != FFI_N64 - && cif->abi != FFI_N64_SOFT_FLOAT) - return FFI_BAD_ABI; -#endif - fn = ffi_go_closure_N32; -#endif /* FFI_MIPS_O32 */ - - closure->tramp = (void *)fn; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} - -#endif /* FFI_CLOSURES */ diff --git a/deps/libffi/src/mips/ffitarget.h b/deps/libffi/src/mips/ffitarget.h deleted file mode 100644 index cc7250cc1c051b..00000000000000 --- a/deps/libffi/src/mips/ffitarget.h +++ /dev/null @@ -1,249 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for MIPS. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifdef __rtems__ -/* - * Subprogram calling convention - copied from sgidefs.h - */ -#define _MIPS_SIM_ABI32 1 -#define _MIPS_SIM_NABI32 2 -#define _MIPS_SIM_ABI64 3 -#elif !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__linux__) -# include -#endif - -# ifndef _ABIN32 -# define _ABIN32 _MIPS_SIM_NABI32 -# endif -# ifndef _ABI64 -# define _ABI64 _MIPS_SIM_ABI64 -# endif -# ifndef _ABIO32 -# define _ABIO32 _MIPS_SIM_ABI32 -# endif - -#if !defined(_MIPS_SIM) -# error -- something is very wrong -- -#else -# if (_MIPS_SIM==_ABIN32 && defined(_ABIN32)) || (_MIPS_SIM==_ABI64 && defined(_ABI64)) -# define FFI_MIPS_N32 -# else -# if (_MIPS_SIM==_ABIO32 && defined(_ABIO32)) -# define FFI_MIPS_O32 -# else -# error -- this is an unsupported platform -- -# endif -# endif -#endif - -#ifdef FFI_MIPS_O32 -/* O32 stack frames have 32bit integer args */ -# define FFI_SIZEOF_ARG 4 -#else -/* N32 and N64 frames have 64bit integer args */ -# define FFI_SIZEOF_ARG 8 -# if _MIPS_SIM == _ABIN32 -# define FFI_SIZEOF_JAVA_RAW 4 -# endif -#endif - -#define FFI_TARGET_HAS_COMPLEX_TYPE 1 -#define FFI_FLAG_BITS 2 - -/* SGI's strange assembler requires that we multiply by 4 rather - than shift left by FFI_FLAG_BITS */ - -#define FFI_ARGS_D FFI_TYPE_DOUBLE -#define FFI_ARGS_F FFI_TYPE_FLOAT -#define FFI_ARGS_DD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_DOUBLE -#define FFI_ARGS_FF FFI_TYPE_FLOAT * 4 + FFI_TYPE_FLOAT -#define FFI_ARGS_FD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_FLOAT -#define FFI_ARGS_DF FFI_TYPE_FLOAT * 4 + FFI_TYPE_DOUBLE - -/* Needed for N32 structure returns */ -#define FFI_TYPE_SMALLSTRUCT FFI_TYPE_UINT8 -#define FFI_TYPE_SMALLSTRUCT2 FFI_TYPE_SINT8 - -#if 0 -/* The SGI assembler can't handle this.. */ -#define FFI_TYPE_STRUCT_DD (( FFI_ARGS_DD ) << 4) + FFI_TYPE_STRUCT -/* (and so on) */ -#else -/* ...so we calculate these by hand! */ -#define FFI_TYPE_STRUCT_D 61 -#define FFI_TYPE_STRUCT_F 45 -#define FFI_TYPE_STRUCT_DD 253 -#define FFI_TYPE_STRUCT_FF 173 -#define FFI_TYPE_STRUCT_FD 237 -#define FFI_TYPE_STRUCT_DF 189 -#define FFI_TYPE_STRUCT_SMALL 93 -#define FFI_TYPE_STRUCT_SMALL2 109 - -#define FFI_TYPE_COMPLEX_SMALL 95 -#define FFI_TYPE_COMPLEX_SMALL2 111 -#define FFI_TYPE_COMPLEX_FF 47 -#define FFI_TYPE_COMPLEX_DD 63 -#define FFI_TYPE_COMPLEX_LDLD 79 - -/* and for n32 soft float, add 16 * 2^4 */ -#define FFI_TYPE_STRUCT_D_SOFT 317 -#define FFI_TYPE_STRUCT_F_SOFT 301 -#define FFI_TYPE_STRUCT_DD_SOFT 509 -#define FFI_TYPE_STRUCT_FF_SOFT 429 -#define FFI_TYPE_STRUCT_FD_SOFT 493 -#define FFI_TYPE_STRUCT_DF_SOFT 445 -#define FFI_TYPE_STRUCT_SOFT 16 -#endif - -#ifdef LIBFFI_ASM -#define v0 $2 -#define v1 $3 -#define a0 $4 -#define a1 $5 -#define a2 $6 -#define a3 $7 -#define a4 $8 -#define a5 $9 -#define a6 $10 -#define a7 $11 -#define t0 $8 -#define t1 $9 -#define t2 $10 -#define t3 $11 -#define t4 $12 -#define t5 $13 -#define t6 $14 -#define t7 $15 -#define t8 $24 -#define t9 $25 -#define ra $31 - -#ifdef FFI_MIPS_O32 -# define REG_L lw -# define REG_S sw -# define SUBU subu -# define ADDU addu -# define SRL srl -# define LI li -#else /* !FFI_MIPS_O32 */ -# define REG_L ld -# define REG_S sd -# define SUBU dsubu -# define ADDU daddu -# define SRL dsrl -# define LI dli -# if (_MIPS_SIM==_ABI64) -# define LA dla -# define EH_FRAME_ALIGN 3 -# define FDE_ADDR_BYTES .8byte -# else -# define LA la -# define EH_FRAME_ALIGN 2 -# define FDE_ADDR_BYTES .4byte -# endif /* _MIPS_SIM==_ABI64 */ -#endif /* !FFI_MIPS_O32 */ -#else /* !LIBFFI_ASM */ -# ifdef __GNUC__ -# ifdef FFI_MIPS_O32 -/* O32 stack frames have 32bit integer args */ -typedef unsigned int ffi_arg __attribute__((__mode__(__SI__))); -typedef signed int ffi_sarg __attribute__((__mode__(__SI__))); -#else -/* N32 and N64 frames have 64bit integer args */ -typedef unsigned int ffi_arg __attribute__((__mode__(__DI__))); -typedef signed int ffi_sarg __attribute__((__mode__(__DI__))); -# endif -# else -# ifdef FFI_MIPS_O32 -/* O32 stack frames have 32bit integer args */ -typedef __uint32_t ffi_arg; -typedef __int32_t ffi_sarg; -# else -/* N32 and N64 frames have 64bit integer args */ -typedef __uint64_t ffi_arg; -typedef __int64_t ffi_sarg; -# endif -# endif /* __GNUC__ */ - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_O32, - FFI_N32, - FFI_N64, - FFI_O32_SOFT_FLOAT, - FFI_N32_SOFT_FLOAT, - FFI_N64_SOFT_FLOAT, - FFI_LAST_ABI, - -#ifdef FFI_MIPS_O32 -#ifdef __mips_soft_float - FFI_DEFAULT_ABI = FFI_O32_SOFT_FLOAT -#else - FFI_DEFAULT_ABI = FFI_O32 -#endif -#else -# if _MIPS_SIM==_ABI64 -# ifdef __mips_soft_float - FFI_DEFAULT_ABI = FFI_N64_SOFT_FLOAT -# else - FFI_DEFAULT_ABI = FFI_N64 -# endif -# else -# ifdef __mips_soft_float - FFI_DEFAULT_ABI = FFI_N32_SOFT_FLOAT -# else - FFI_DEFAULT_ABI = FFI_N32 -# endif -# endif -#endif -} ffi_abi; - -#define FFI_EXTRA_CIF_FIELDS unsigned rstruct_flag; unsigned mips_nfixedargs -#define FFI_TARGET_SPECIFIC_VARIADIC -#endif /* !LIBFFI_ASM */ - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 - -#if defined(FFI_MIPS_O32) || (_MIPS_SIM ==_ABIN32) -# define FFI_TRAMPOLINE_SIZE 20 -#else -# define FFI_TRAMPOLINE_SIZE 56 -#endif - -#endif - diff --git a/deps/libffi/src/mips/n32.S b/deps/libffi/src/mips/n32.S deleted file mode 100644 index 08cbb956667e36..00000000000000 --- a/deps/libffi/src/mips/n32.S +++ /dev/null @@ -1,827 +0,0 @@ -/* ----------------------------------------------------------------------- - n32.S - Copyright (c) 1996, 1998, 2005, 2007, 2009, 2010 Red Hat, Inc. - - MIPS Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -/* Only build this code if we are compiling for n32 */ - -#if defined(FFI_MIPS_N32) - -#define callback a0 -#define bytes a2 -#define flags a3 -#define raddr a4 -#define fn a5 -#define closure a6 - -/* Note: to keep stack 16 byte aligned we need even number slots - used 9 slots here -*/ -#define SIZEOF_FRAME ( 10 * FFI_SIZEOF_ARG ) - -#ifdef __GNUC__ - .abicalls -#endif -#if !defined(__mips_isa_rev) || (__mips_isa_rev<6) - .set mips4 -#endif - .text - .align 2 - .globl ffi_call_N32 - .ent ffi_call_N32 -ffi_call_N32: -.LFB0: - .frame $fp, SIZEOF_FRAME, ra - .mask 0xc0000000,-FFI_SIZEOF_ARG - .fmask 0x00000000,0 - - # Prologue - SUBU $sp, SIZEOF_FRAME # Frame size -.LCFI00: - REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer - REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address -.LCFI01: - move $fp, $sp -.LCFI02: - move t9, callback # callback function pointer - REG_S bytes, 2*FFI_SIZEOF_ARG($fp) # bytes - REG_S flags, 3*FFI_SIZEOF_ARG($fp) # flags - REG_S raddr, 4*FFI_SIZEOF_ARG($fp) # raddr - REG_S fn, 5*FFI_SIZEOF_ARG($fp) # fn - REG_S closure, 6*FFI_SIZEOF_ARG($fp) # closure - - # Allocate at least 4 words in the argstack - move v0, bytes - bge bytes, 4 * FFI_SIZEOF_ARG, bigger - LI v0, 4 * FFI_SIZEOF_ARG - b sixteen - - bigger: - ADDU t4, v0, 2 * FFI_SIZEOF_ARG -1 # make sure it is aligned - and v0, t4, -2 * FFI_SIZEOF_ARG # to a proper boundry. - -sixteen: - SUBU $sp, $sp, v0 # move the stack pointer to reflect the - # arg space - - move a0, $sp # 4 * FFI_SIZEOF_ARG - ADDU a3, $fp, 3 * FFI_SIZEOF_ARG - - # Call ffi_prep_args - jal t9 - - # Copy the stack pointer to t9 - move t9, $sp - - # Fix the stack if there are more than 8 64bit slots worth - # of arguments. - - # Load the number of bytes - REG_L t6, 2*FFI_SIZEOF_ARG($fp) - - # Is it bigger than 8 * FFI_SIZEOF_ARG? - daddiu t8, t6, -(8 * FFI_SIZEOF_ARG) - bltz t8, loadregs - - ADDU t9, t9, t8 - -loadregs: - - REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. - - # when retval is _Complex long double, $f12/$a0, $f13/$a1 will be skipped - # no idea why, but gcc does it. - SRL t4, t6, 8*FFI_FLAG_BITS - move t8, t6 - bne t4, FFI_TYPE_COMPLEX_LDLD, loadregs1 - - SLL t8, t6, 2*FFI_FLAG_BITS - - -loadregs1: -#ifdef __mips_soft_float - REG_L a0, 0*FFI_SIZEOF_ARG(t9) - REG_L a1, 1*FFI_SIZEOF_ARG(t9) - REG_L a2, 2*FFI_SIZEOF_ARG(t9) - REG_L a3, 3*FFI_SIZEOF_ARG(t9) - REG_L a4, 4*FFI_SIZEOF_ARG(t9) - REG_L a5, 5*FFI_SIZEOF_ARG(t9) - REG_L a6, 6*FFI_SIZEOF_ARG(t9) - REG_L a7, 7*FFI_SIZEOF_ARG(t9) -#else - and t4, t8, ((1< -#include - -/* Only build this code if we are compiling for o32 */ - -#if defined(FFI_MIPS_O32) - -#define callback a0 -#define bytes a2 -#define flags a3 - -#define SIZEOF_FRAME (4 * FFI_SIZEOF_ARG + 2 * FFI_SIZEOF_ARG) -#define A3_OFF (SIZEOF_FRAME + 3 * FFI_SIZEOF_ARG) -#define FP_OFF (SIZEOF_FRAME - 2 * FFI_SIZEOF_ARG) -#define RA_OFF (SIZEOF_FRAME - 1 * FFI_SIZEOF_ARG) - - .abicalls - .text - .align 2 - .globl ffi_call_O32 - .ent ffi_call_O32 -ffi_call_O32: -$LFB0: - # Prologue - SUBU $sp, SIZEOF_FRAME # Frame size -$LCFI00: - REG_S $fp, FP_OFF($sp) # Save frame pointer -$LCFI01: - REG_S ra, RA_OFF($sp) # Save return address -$LCFI02: - move $fp, $sp - -$LCFI03: - move t9, callback # callback function pointer - REG_S flags, A3_OFF($fp) # flags - - # Allocate at least 4 words in the argstack - LI v0, 4 * FFI_SIZEOF_ARG - blt bytes, v0, sixteen - - ADDU v0, bytes, 7 # make sure it is aligned - and v0, -8 # to an 8 byte boundry - -sixteen: - SUBU $sp, v0 # move the stack pointer to reflect the - # arg space - - ADDU a0, $sp, 4 * FFI_SIZEOF_ARG - - jalr t9 - - REG_L t0, A3_OFF($fp) # load the flags word - SRL t2, t0, 4 # shift our arg info - and t0, ((1<<4)-1) # mask out the return type - - ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args - -#ifndef __mips_soft_float - bnez t0, pass_d # make it quick for int -#endif - REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the - REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs. - REG_L a2, 2*FFI_SIZEOF_ARG($sp) - REG_L a3, 3*FFI_SIZEOF_ARG($sp) - b call_it - -#ifndef __mips_soft_float -pass_d: - bne t0, FFI_ARGS_D, pass_f - l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args - REG_L a2, 2*FFI_SIZEOF_ARG($sp) # passing a double - REG_L a3, 3*FFI_SIZEOF_ARG($sp) - b call_it - -pass_f: - bne t0, FFI_ARGS_F, pass_d_d - l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args - REG_L a1, 1*FFI_SIZEOF_ARG($sp) # passing a float - REG_L a2, 2*FFI_SIZEOF_ARG($sp) - REG_L a3, 3*FFI_SIZEOF_ARG($sp) - b call_it - -pass_d_d: - bne t0, FFI_ARGS_DD, pass_f_f - l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args - l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing two doubles - b call_it - -pass_f_f: - bne t0, FFI_ARGS_FF, pass_d_f - l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args - l.s $f14, 1*FFI_SIZEOF_ARG($sp) # passing two floats - REG_L a2, 2*FFI_SIZEOF_ARG($sp) - REG_L a3, 3*FFI_SIZEOF_ARG($sp) - b call_it - -pass_d_f: - bne t0, FFI_ARGS_DF, pass_f_d - l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args - l.s $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float - REG_L a3, 3*FFI_SIZEOF_ARG($sp) - b call_it - -pass_f_d: - # assume that the only other combination must be float then double - # bne t0, FFI_ARGS_F_D, call_it - l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args - l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float - -#endif - -call_it: - # Load the static chain pointer - REG_L t7, SIZEOF_FRAME + 6*FFI_SIZEOF_ARG($fp) - - # Load the function pointer - REG_L t9, SIZEOF_FRAME + 5*FFI_SIZEOF_ARG($fp) - - # If the return value pointer is NULL, assume no return value. - REG_L t1, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) - beqz t1, noretval - - and t1, t2, ((1<<4)-1) - bne t1, FFI_TYPE_INT, retlonglong - jalr t9 - REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) - REG_S v0, 0(t0) - b epilogue - -retlonglong: - # Really any 64-bit int, signed or not. - bne t1, FFI_TYPE_UINT64, retfloat - jalr t9 - REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) - REG_S v1, 4(t0) - REG_S v0, 0(t0) - b epilogue - -retfloat: - bne t1, FFI_TYPE_FLOAT, retdouble - jalr t9 - REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) -#ifndef __mips_soft_float - s.s $f0, 0(t0) -#else - REG_S v0, 0(t0) -#endif - b epilogue - -retdouble: - bne t1, FFI_TYPE_DOUBLE, retcomplex - jalr t9 - REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) -#ifndef __mips_soft_float - s.d $f0, 0(t0) -#else - REG_S v1, 4(t0) - REG_S v0, 0(t0) -#endif - b epilogue - -retcomplex: - # mask out the complex elements type. - # the struct of flags (bits): - # 0-1: arg0 - # 2-3: arg1 - # 4-7: return type - # 8-11: rtype elements type: for complex - # Note here: t2 is flags>>4 - bne t1, FFI_TYPE_COMPLEX, noretval - jalr t9 - REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) - REG_L t1, A3_OFF($fp) # load the flags word - SRL t1, t1, 8 - li t3, 3 - beq t1, t3, 3f # double - li t3, 2 - beq t1, t3, 2f # float - # FIXME: long double - slti t3, t1, 5 - beqz t3, 5f # (u)int8/16/32/64 -2: -#ifndef __mips_soft_float - s.s $f0, 0(t0) - s.s $f2, 4(t0) -#else - # FIXME: do nothing can pass all of the testsuite -#endif - b epilogue -3: -#ifndef __mips_soft_float - s.d $f0, 0(t0) - s.d $f2, 8(t0) -#else - # FIXME: do nothing can pass all of the testsuite -#endif - b epilogue - -5: - REG_S v1, 4(t0) - REG_S v0, 0(t0) - b epilogue - -noretval: - jalr t9 - - # Epilogue -epilogue: - move $sp, $fp - REG_L $fp, FP_OFF($sp) # Restore frame pointer - REG_L ra, RA_OFF($sp) # Restore return address - ADDU $sp, SIZEOF_FRAME # Fix stack pointer - j ra - -$LFE0: - .end ffi_call_O32 - - -/* ffi_closure_O32. Expects address of the passed-in ffi_closure - in t4 ($12). Stores any arguments passed in registers onto the - stack, then calls ffi_closure_mips_inner_O32, which - then decodes them. - - Stack layout: - - 3 - a3 save - 2 - a2 save - 1 - a1 save - 0 - a0 save, original sp - -1 - ra save - -2 - fp save - -3 - $16 (s0) save - -4 - cprestore - -5 - return value high (v1) - -6 - return value low (v0) - -7 - f14 (le high, be low) - -8 - f14 (le low, be high) - -9 - f12 (le high, be low) - -10 - f12 (le low, be high) - -11 - Called function a5 save - -12 - Called function a4 save - -13 - Called function a3 save - -14 - Called function a2 save - -15 - Called function a1 save - -16 - Called function a0 save, our sp and fp point here - */ - -#define SIZEOF_FRAME2 (16 * FFI_SIZEOF_ARG) -#define A3_OFF2 (SIZEOF_FRAME2 + 3 * FFI_SIZEOF_ARG) -#define A2_OFF2 (SIZEOF_FRAME2 + 2 * FFI_SIZEOF_ARG) -#define A1_OFF2 (SIZEOF_FRAME2 + 1 * FFI_SIZEOF_ARG) -#define A0_OFF2 (SIZEOF_FRAME2 + 0 * FFI_SIZEOF_ARG) -#define RA_OFF2 (SIZEOF_FRAME2 - 1 * FFI_SIZEOF_ARG) -#define FP_OFF2 (SIZEOF_FRAME2 - 2 * FFI_SIZEOF_ARG) -#define S0_OFF2 (SIZEOF_FRAME2 - 3 * FFI_SIZEOF_ARG) -#define GP_OFF2 (SIZEOF_FRAME2 - 4 * FFI_SIZEOF_ARG) -#define V1_OFF2 (SIZEOF_FRAME2 - 5 * FFI_SIZEOF_ARG) -#define V0_OFF2 (SIZEOF_FRAME2 - 6 * FFI_SIZEOF_ARG) -#define FA_1_1_OFF2 (SIZEOF_FRAME2 - 7 * FFI_SIZEOF_ARG) -#define FA_1_0_OFF2 (SIZEOF_FRAME2 - 8 * FFI_SIZEOF_ARG) -#define FA_0_1_OFF2 (SIZEOF_FRAME2 - 9 * FFI_SIZEOF_ARG) -#define FA_0_0_OFF2 (SIZEOF_FRAME2 - 10 * FFI_SIZEOF_ARG) -#define CALLED_A5_OFF2 (SIZEOF_FRAME2 - 11 * FFI_SIZEOF_ARG) -#define CALLED_A4_OFF2 (SIZEOF_FRAME2 - 12 * FFI_SIZEOF_ARG) - - .text - - .align 2 - .globl ffi_go_closure_O32 - .ent ffi_go_closure_O32 -ffi_go_closure_O32: -$LFB1: - # Prologue - .frame $fp, SIZEOF_FRAME2, ra - .set noreorder - .cpload t9 - .set reorder - SUBU $sp, SIZEOF_FRAME2 - .cprestore GP_OFF2 -$LCFI10: - - REG_S $16, S0_OFF2($sp) # Save s0 - REG_S $fp, FP_OFF2($sp) # Save frame pointer - REG_S ra, RA_OFF2($sp) # Save return address -$LCFI11: - - move $fp, $sp -$LCFI12: - - REG_S a0, A0_OFF2($fp) - REG_S a1, A1_OFF2($fp) - REG_S a2, A2_OFF2($fp) - REG_S a3, A3_OFF2($fp) - - # Load ABI enum to s0 - REG_L $16, 4($15) # cif - REG_L $16, 0($16) # abi is first member. - - li $13, 1 # FFI_O32 - bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT - -#ifndef __mips_soft_float - # Store all possible float/double registers. - s.d $f12, FA_0_0_OFF2($fp) - s.d $f14, FA_1_0_OFF2($fp) -#endif -1: - # prepare arguments for ffi_closure_mips_inner_O32 - REG_L a0, 4($15) # cif - REG_L a1, 8($15) # fun - move a2, $15 # user_data = go closure - addu a3, $fp, V0_OFF2 # rvalue - - addu t9, $fp, A0_OFF2 # ar - REG_S t9, CALLED_A4_OFF2($fp) - - addu t9, $fp, FA_0_0_OFF2 #fpr - REG_S t9, CALLED_A5_OFF2($fp) - - b $do_closure - -$LFE1: - .end ffi_go_closure_O32 - - .align 2 - .globl ffi_closure_O32 - .ent ffi_closure_O32 -ffi_closure_O32: -$LFB2: - # Prologue - .frame $fp, SIZEOF_FRAME2, ra - .set noreorder - .cpload t9 - .set reorder - SUBU $sp, SIZEOF_FRAME2 - .cprestore GP_OFF2 -$LCFI20: - REG_S $16, S0_OFF2($sp) # Save s0 - REG_S $fp, FP_OFF2($sp) # Save frame pointer - REG_S ra, RA_OFF2($sp) # Save return address -$LCFI21: - move $fp, $sp - -$LCFI22: - # Store all possible argument registers. If there are more than - # four arguments, then they are stored above where we put a3. - REG_S a0, A0_OFF2($fp) - REG_S a1, A1_OFF2($fp) - REG_S a2, A2_OFF2($fp) - REG_S a3, A3_OFF2($fp) - - # Load ABI enum to s0 - REG_L $16, 20($12) # cif pointer follows tramp. - REG_L $16, 0($16) # abi is first member. - - li $13, 1 # FFI_O32 - bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT - -#ifndef __mips_soft_float - # Store all possible float/double registers. - s.d $f12, FA_0_0_OFF2($fp) - s.d $f14, FA_1_0_OFF2($fp) -#endif -1: - # prepare arguments for ffi_closure_mips_inner_O32 - REG_L a0, 20($12) # cif pointer follows tramp. - REG_L a1, 24($12) # fun - REG_L a2, 28($12) # user_data - addu a3, $fp, V0_OFF2 # rvalue - - addu t9, $fp, A0_OFF2 # ar - REG_S t9, CALLED_A4_OFF2($fp) - - addu t9, $fp, FA_0_0_OFF2 #fpr - REG_S t9, CALLED_A5_OFF2($fp) - -$do_closure: - la t9, ffi_closure_mips_inner_O32 - # Call ffi_closure_mips_inner_O32 to do the work. - jalr t9 - - # Load the return value into the appropriate register. - move $8, $2 - li $9, FFI_TYPE_VOID - beq $8, $9, closure_done - - li $13, 1 # FFI_O32 - bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT - -#ifndef __mips_soft_float - li $9, FFI_TYPE_FLOAT - l.s $f0, V0_OFF2($fp) - beq $8, $9, closure_done - - li $9, FFI_TYPE_DOUBLE - l.d $f0, V0_OFF2($fp) - beq $8, $9, closure_done - - li $9, FFI_TYPE_COMPLEX - bne $8, $9, 1f - - li $9, 8 - l.s $f0, V0_OFF2($fp) - l.s $f2, V1_OFF2($fp) - beq $3, $9, closure_done - - li $9, 16 - l.d $f0, V0_OFF2($fp) - l.d $f2, (V0_OFF2+8)($fp) - beq $3, $9, closure_done -#endif -1: - REG_L $3, V1_OFF2($fp) - REG_L $2, V0_OFF2($fp) - -closure_done: - # Epilogue - move $sp, $fp - REG_L $16, S0_OFF2($sp) # Restore s0 - REG_L $fp, FP_OFF2($sp) # Restore frame pointer - REG_L ra, RA_OFF2($sp) # Restore return address - ADDU $sp, SIZEOF_FRAME2 - j ra -$LFE2: - .end ffi_closure_O32 - -/* DWARF-2 unwind info. */ - - .section .eh_frame,"a",@progbits -$Lframe0: - .4byte $LECIE0-$LSCIE0 # Length of Common Information Entry -$LSCIE0: - .4byte 0x0 # CIE Identifier Tag - .byte 0x1 # CIE Version - .ascii "zR\0" # CIE Augmentation - .uleb128 0x1 # CIE Code Alignment Factor - .sleb128 4 # CIE Data Alignment Factor - .byte 0x1f # CIE RA Column - .uleb128 0x1 # Augmentation size - .byte 0x00 # FDE Encoding (absptr) - .byte 0xc # DW_CFA_def_cfa - .uleb128 0x1d - .uleb128 0x0 - .align 2 -$LECIE0: - -$LSFDE0: - .4byte $LEFDE0-$LASFDE0 # FDE Length -$LASFDE0: - .4byte $LASFDE0-$Lframe0 # FDE CIE offset - .4byte $LFB0 # FDE initial location - .4byte $LFE0-$LFB0 # FDE address range - .uleb128 0x0 # Augmentation size - .byte 0x4 # DW_CFA_advance_loc4 - .4byte $LCFI00-$LFB0 - .byte 0xe # DW_CFA_def_cfa_offset - .uleb128 0x18 - .byte 0x4 # DW_CFA_advance_loc4 - .4byte $LCFI01-$LCFI00 - .byte 0x11 # DW_CFA_offset_extended_sf - .uleb128 0x1e # $fp - .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp) - .byte 0x11 # DW_CFA_offset_extended_sf - .uleb128 0x1f # $ra - .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp) - .byte 0x4 # DW_CFA_advance_loc4 - .4byte $LCFI02-$LCFI01 - .byte 0xc # DW_CFA_def_cfa - .uleb128 0x1e - .uleb128 0x18 - .align 2 -$LEFDE0: - -$LSFDE1: - .4byte $LEFDE1-$LASFDE1 # FDE Length -$LASFDE1: - .4byte $LASFDE1-$Lframe0 # FDE CIE offset - .4byte $LFB1 # FDE initial location - .4byte $LFE1-$LFB1 # FDE address range - .uleb128 0x0 # Augmentation size - .byte 0x4 # DW_CFA_advance_loc4 - .4byte $LCFI10-$LFB1 - .byte 0xe # DW_CFA_def_cfa_offset - .uleb128 SIZEOF_FRAME2 - .byte 0x4 # DW_CFA_advance_loc4 - .4byte $LCFI11-$LCFI10 - .byte 0x11 # DW_CFA_offset_extended_sf - .uleb128 0x10 # $16 - .sleb128 -3 # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp) - .byte 0x11 # DW_CFA_offset_extended_sf - .uleb128 0x1e # $fp - .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp) - .byte 0x11 # DW_CFA_offset_extended_sf - .uleb128 0x1f # $ra - .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp) - .byte 0x4 # DW_CFA_advance_loc4 - .4byte $LCFI12-$LCFI11 - .byte 0xc # DW_CFA_def_cfa - .uleb128 0x1e - .uleb128 SIZEOF_FRAME2 - .align 2 -$LEFDE1: - -$LSFDE2: - .4byte $LEFDE2-$LASFDE2 # FDE Length -$LASFDE2: - .4byte $LASFDE2-$Lframe0 # FDE CIE offset - .4byte $LFB2 # FDE initial location - .4byte $LFE2-$LFB2 # FDE address range - .uleb128 0x0 # Augmentation size - .byte 0x4 # DW_CFA_advance_loc4 - .4byte $LCFI20-$LFB2 - .byte 0xe # DW_CFA_def_cfa_offset - .uleb128 SIZEOF_FRAME2 - .byte 0x4 # DW_CFA_advance_loc4 - .4byte $LCFI21-$LCFI20 - .byte 0x11 # DW_CFA_offset_extended_sf - .uleb128 0x10 # $16 - .sleb128 -3 # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp) - .byte 0x11 # DW_CFA_offset_extended_sf - .uleb128 0x1e # $fp - .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp) - .byte 0x11 # DW_CFA_offset_extended_sf - .uleb128 0x1f # $ra - .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp) - .byte 0x4 # DW_CFA_advance_loc4 - .4byte $LCFI22-$LCFI21 - .byte 0xc # DW_CFA_def_cfa - .uleb128 0x1e - .uleb128 SIZEOF_FRAME2 - .align 2 -$LEFDE2: - -#endif - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",%progbits -#endif diff --git a/deps/libffi/src/moxie/eabi.S b/deps/libffi/src/moxie/eabi.S deleted file mode 100644 index 10cfb0448ea937..00000000000000 --- a/deps/libffi/src/moxie/eabi.S +++ /dev/null @@ -1,101 +0,0 @@ -/* ----------------------------------------------------------------------- - eabi.S - Copyright (c) 2012, 2013 Anthony Green - - Moxie Assembly glue. - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - - .globl ffi_prep_args_EABI - - .text - .p2align 4 - .globl ffi_call_EABI - .type ffi_call_EABI, @function - - # $r0 : ffi_prep_args - # $r1 : &ecif - # $r2 : cif->bytes - # $r3 : fig->flags - # $r4 : ecif.rvalue - # $r5 : fn - -ffi_call_EABI: - push $sp, $r6 - push $sp, $r7 - push $sp, $r8 - dec $sp, 24 - - /* Store incoming args on stack. */ - sto.l 0($sp), $r0 /* ffi_prep_args */ - sto.l 4($sp), $r1 /* ecif */ - sto.l 8($sp), $r2 /* bytes */ - sto.l 12($sp), $r3 /* flags */ - sto.l 16($sp), $r4 /* &rvalue */ - sto.l 20($sp), $r5 /* fn */ - - /* Call ffi_prep_args. */ - mov $r6, $r4 /* Save result buffer */ - mov $r7, $r5 /* Save the target fn */ - mov $r8, $r3 /* Save the flags */ - sub $sp, $r2 /* Allocate stack space */ - mov $r0, $sp /* We can stomp over $r0 */ - /* $r1 is already set up */ - jsra ffi_prep_args - - /* Load register arguments. */ - ldo.l $r0, 0($sp) - ldo.l $r1, 4($sp) - ldo.l $r2, 8($sp) - ldo.l $r3, 12($sp) - ldo.l $r4, 16($sp) - ldo.l $r5, 20($sp) - - /* Call the target function. */ - jsr $r7 - - ldi.l $r7, 0xffffffff - cmp $r8, $r7 - beq retstruct - - ldi.l $r7, 4 - cmp $r8, $r7 - bgt ret2reg - - st.l ($r6), $r0 - jmpa retdone - -ret2reg: - st.l ($r6), $r0 - sto.l 4($r6), $r1 - -retstruct: -retdone: - /* Return. */ - ldo.l $r6, -4($fp) - ldo.l $r7, -8($fp) - ldo.l $r8, -12($fp) - ret - .size ffi_call_EABI, .-ffi_call_EABI - diff --git a/deps/libffi/src/moxie/ffi.c b/deps/libffi/src/moxie/ffi.c deleted file mode 100644 index 99bcf4077ce890..00000000000000 --- a/deps/libffi/src/moxie/ffi.c +++ /dev/null @@ -1,310 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (C) 2012, 2013, 2018, 2021, 2022 Anthony Green - - Moxie Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - -void *ffi_prep_args(char *stack, extended_cif *ecif) -{ - register unsigned int i; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - register int count = 0; - - p_argv = ecif->avalue; - argp = stack; - - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) - { - *(void **) argp = ecif->rvalue; - argp += 4; - } - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; - (i != 0); - i--, p_arg++) - { - size_t z; - - z = (*p_arg)->size; - - if ((*p_arg)->type == FFI_TYPE_STRUCT) - { - z = sizeof(void*); - *(void **) argp = *p_argv; - } - else if (z < sizeof(int)) - { - z = sizeof(int); - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); - break; - - default: - FFI_ASSERT(0); - } - } - else if (z == sizeof(int)) - { - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - } - else - { - memcpy(argp, *p_argv, z); - } - p_argv++; - argp += z; - count += z; - } - - return (stack + ((count > 24) ? 24 : FFI_ALIGN_DOWN(count, 8))); -} - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - if (cif->rtype->type == FFI_TYPE_STRUCT) - cif->flags = -1; - else - cif->flags = cif->rtype->size; - - cif->bytes = FFI_ALIGN (cif->bytes, 8); - - return FFI_OK; -} - -extern void ffi_call_EABI(void *(*)(char *, extended_cif *), - extended_cif *, - unsigned, unsigned, - unsigned *, - void (*fn)(void)); - -void ffi_call(ffi_cif *cif, - void (*fn)(void), - void *rvalue, - void **avalue) -{ - extended_cif ecif; - ffi_type **arg_types = cif->arg_types; - int i, nargs = cif->nargs; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return */ - /* value address then we need to make one */ - - if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) - { - ecif.rvalue = alloca(cif->rtype->size); - } - else - ecif.rvalue = rvalue; - - /* If we have any large structure arguments, make a copy so we are passing - by value. */ - for (i = 0; i < nargs; i++) - { - ffi_type *at = arg_types[i]; - int size = at->size; - if (at->type == FFI_TYPE_STRUCT) /* && size > 4) All struct args?? */ - { - char *argcopy = alloca (size); - memcpy (argcopy, avalue[i], size); - avalue[i] = argcopy; - } - } - - switch (cif->abi) - { - case FFI_EABI: - ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - break; - default: - FFI_ASSERT(0); - break; - } -} - -void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3, - unsigned arg4, unsigned arg5, unsigned arg6) -{ - /* This function is called by a trampoline. The trampoline stows a - pointer to the ffi_closure object in $r12. We must save this - pointer in a place that will persist while we do our work. */ - register ffi_closure *creg __asm__ ("$r12"); - ffi_closure *closure = creg; - - /* Arguments that don't fit in registers are found on the stack - at a fixed offset above the current frame pointer. */ - register char *frame_pointer __asm__ ("$fp"); - - /* Pointer to a struct return value. */ - void *struct_rvalue = (void *) arg1; - - /* 6 words reserved for register args + 3 words from jsr */ - char *stack_args = frame_pointer + 9*4; - - /* Lay the register arguments down in a continuous chunk of memory. */ - unsigned register_args[6] = - { arg1, arg2, arg3, arg4, arg5, arg6 }; - char *register_args_ptr = (char *) register_args; - - ffi_cif *cif = closure->cif; - ffi_type **arg_types = cif->arg_types; - void **avalue = alloca (cif->nargs * sizeof(void *)); - char *ptr = (char *) register_args; - int i; - - /* preserve struct type return pointer passing */ - if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { - ptr += 4; - register_args_ptr = (char *)®ister_args[1]; - } - - /* Find the address of each argument. */ - for (i = 0; i < cif->nargs; i++) - { - switch (arg_types[i]->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - avalue[i] = ptr + 3; - break; - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - avalue[i] = ptr + 2; - break; - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_FLOAT: - case FFI_TYPE_POINTER: - avalue[i] = ptr; - break; - case FFI_TYPE_STRUCT: - { - if (arg_types[i]->size > 4) - { - void *copy = alloca(arg_types[i]->size); - memcpy(copy, *(void**)ptr, arg_types[i]->size); - avalue[i] = copy; - } - else - avalue[i] = *(void**)ptr; - } - break; - default: - /* This is an 8-byte value. */ - if (ptr == (char *) ®ister_args[5]) - { - /* The value is split across two locations */ - unsigned *ip = alloca(8); - avalue[i] = ip; - ip[0] = *(unsigned *) ptr; - ip[1] = *(unsigned *) stack_args; - } - else - { - avalue[i] = ptr; - } - ptr += 4; - break; - } - ptr += 4; - - /* If we've handled more arguments than fit in registers, - start looking at the those passed on the stack. */ - if (ptr == (char *) ®ister_args[6]) - ptr = stack_args; - else if (ptr == (char *) ®ister_args[7]) - ptr = stack_args + 4; - } - - /* Invoke the closure. */ - if (cif->rtype && (cif->rtype->type == FFI_TYPE_STRUCT)) - { - (closure->fun) (cif, struct_rvalue, avalue, closure->user_data); - } - else - { - /* Allocate space for the return value and call the function. */ - long long rvalue; - (closure->fun) (cif, &rvalue, avalue, closure->user_data); - asm ("mov $r12, %0\n ld.l $r0, ($r12)\n ldo.l $r1, 4($r12)" : : "r" (&rvalue)); - } -} - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - unsigned short *tramp = (unsigned short *) &closure->tramp[0]; - unsigned long fn = (long) ffi_closure_eabi; - unsigned long cls = (long) codeloc; - - if (cif->abi != FFI_EABI) - return FFI_BAD_ABI; - - fn = (unsigned long) ffi_closure_eabi; - - tramp[0] = 0x01e0; /* ldi.l $r12, .... */ - tramp[1] = cls >> 16; - tramp[2] = cls & 0xffff; - tramp[3] = 0x1a00; /* jmpa .... */ - tramp[4] = fn >> 16; - tramp[5] = fn & 0xffff; - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} diff --git a/deps/libffi/src/moxie/ffitarget.h b/deps/libffi/src/moxie/ffitarget.h deleted file mode 100644 index 623e3ece57d56f..00000000000000 --- a/deps/libffi/src/moxie/ffitarget.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012, 2013 Anthony Green - Target configuration macros for Moxie - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -/* ---- System specific configurations ----------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_EABI, - FFI_DEFAULT_ABI = FFI_EABI, - FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 - -/* Trampolines are 12-bytes long. See ffi_prep_closure_loc. */ -#define FFI_TRAMPOLINE_SIZE (12) - -#endif diff --git a/deps/libffi/src/or1k/ffi.c b/deps/libffi/src/or1k/ffi.c deleted file mode 100644 index 7a6d28c2c12e39..00000000000000 --- a/deps/libffi/src/or1k/ffi.c +++ /dev/null @@ -1,341 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2014 Sebastian Macke - - OpenRISC Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include "ffi_common.h" - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - -void* ffi_prep_args(char *stack, extended_cif *ecif) -{ - char *stacktemp = stack; - int i, s; - ffi_type **arg; - int count = 0; - int nfixedargs; - - nfixedargs = ecif->cif->nfixedargs; - arg = ecif->cif->arg_types; - void **argv = ecif->avalue; - - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) - { - *(void **) stack = ecif->rvalue; - stack += 4; - count = 4; - } - for(i=0; icif->nargs; i++) - { - - /* variadic args are saved on stack */ - if ((nfixedargs == 0) && (count < 24)) - { - count = 24; - stack = stacktemp + 24; - } - nfixedargs--; - - s = 4; - switch((*arg)->type) - { - case FFI_TYPE_STRUCT: - *(void **)stack = *argv; - break; - - case FFI_TYPE_SINT8: - *(signed int *) stack = (signed int)*(SINT8 *)(* argv); - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) stack = (unsigned int)*(UINT8 *)(* argv); - break; - - case FFI_TYPE_SINT16: - *(signed int *) stack = (signed int)*(SINT16 *)(* argv); - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) stack = (unsigned int)*(UINT16 *)(* argv); - break; - - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_FLOAT: - case FFI_TYPE_POINTER: - *(int *)stack = *(int*)(*argv); - break; - - default: /* 8 byte types */ - if (count == 20) /* never split arguments */ - { - stack += 4; - count += 4; - } - s = (*arg)->size; - memcpy(stack, *argv, s); - break; - } - - stack += s; - count += s; - argv++; - arg++; - } - return stacktemp + ((count>24)?24:0); -} - -extern void ffi_call_SYSV(unsigned, - extended_cif *, - void *(*)(char *, extended_cif *), - unsigned *, - void (*fn)(void), - unsigned); - - -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - int i; - int size; - ffi_type **arg; - - /* Calculate size to allocate on stack */ - - for(i = 0, arg = cif->arg_types, size=0; i < cif->nargs; i++, arg++) - { - if ((*arg)->type == FFI_TYPE_STRUCT) - size += 4; - else - if ((*arg)->size <= 4) - size += 4; - else - size += 8; - - /* If we have any large structure arguments, make a copy so we are passing - by value. */ - { - ffi_type *at = cif->arg_types[i]; - int size = at->size; - if (at->type == FFI_TYPE_STRUCT) /* && size > 4) All struct args? */ - { - char *argcopy = alloca (size); - memcpy (argcopy, avalue[i], size); - avalue[i] = argcopy; - } - } - } - - /* for variadic functions more space is needed on the stack */ - if (cif->nargs != cif->nfixedargs) - size += 24; - - if (cif->rtype->type == FFI_TYPE_STRUCT) - size += 4; - - - extended_cif ecif; - ecif.cif = cif; - ecif.avalue = avalue; - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_SYSV: - ffi_call_SYSV(size, &ecif, ffi_prep_args, rvalue, fn, cif->flags); - break; - default: - FFI_ASSERT(0); - break; - } -} - - -void ffi_closure_SYSV(unsigned long r3, unsigned long r4, unsigned long r5, - unsigned long r6, unsigned long r7, unsigned long r8) -{ - register int *sp __asm__ ("r17"); - register int *r13 __asm__ ("r13"); - - ffi_closure* closure = (ffi_closure*) r13; - char *stack_args = (char*) sp; - - /* Lay the register arguments down in a continuous chunk of memory. */ - unsigned register_args[6] = - { r3, r4, r5, r6, r7, r8 }; - - /* Pointer to a struct return value. */ - void *struct_rvalue = (void *) r3; - - ffi_cif *cif = closure->cif; - ffi_type **arg_types = cif->arg_types; - void **avalue = alloca (cif->nargs * sizeof(void *)); - char *ptr = (char *) register_args; - int count = 0; - int nfixedargs = cif->nfixedargs; - int i; - - /* preserve struct type return pointer passing */ - - if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) - { - ptr += 4; - count = 4; - } - - /* Find the address of each argument. */ - for (i = 0; i < cif->nargs; i++) - { - - /* variadic args are saved on stack */ - if ((nfixedargs == 0) && (count < 24)) - { - ptr = stack_args; - count = 24; - } - nfixedargs--; - - switch (arg_types[i]->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - avalue[i] = ptr + 3; - break; - - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - avalue[i] = ptr + 2; - break; - - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_FLOAT: - case FFI_TYPE_POINTER: - avalue[i] = ptr; - break; - - case FFI_TYPE_STRUCT: - avalue[i] = *(void**)ptr; - break; - - default: - /* 8-byte values */ - - /* arguments are never splitted */ - if (ptr == ®ister_args[5]) - ptr = stack_args; - avalue[i] = ptr; - ptr += 4; - count += 4; - break; - } - ptr += 4; - count += 4; - - /* If we've handled more arguments than fit in registers, - start looking at the those passed on the stack. */ - - if (count == 24) - ptr = stack_args; - } - - if (cif->rtype && (cif->rtype->type == FFI_TYPE_STRUCT)) - { - (closure->fun) (cif, struct_rvalue, avalue, closure->user_data); - } else - { - long long rvalue; - (closure->fun) (cif, &rvalue, avalue, closure->user_data); - if (cif->rtype) - asm ("l.ori r12, %0, 0x0\n l.lwz r11, 0(r12)\n l.lwz r12, 4(r12)" : : "r" (&rvalue)); - } -} - - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - unsigned short *tramp = (unsigned short *) closure->tramp; - unsigned long fn = (unsigned long) ffi_closure_SYSV; - unsigned long cls = (unsigned long) codeloc; - - if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - /* write pointers to temporary registers */ - tramp[0] = (0x6 << 10) | (13 << 5); /* l.movhi r13, ... */ - tramp[1] = cls >> 16; - tramp[2] = (0x2a << 10) | (13 << 5) | 13; /* l.ori r13, r13, ... */ - tramp[3] = cls & 0xFFFF; - - tramp[4] = (0x6 << 10) | (15 << 5); /* l.movhi r15, ... */ - tramp[5] = fn >> 16; - tramp[6] = (0x2a << 10) | (15 << 5) | 15; /* l.ori r15, r15 ... */ - tramp[7] = fn & 0xFFFF; - - tramp[8] = (0x11 << 10); /* l.jr r15 */ - tramp[9] = 15 << 11; - - tramp[10] = (0x2a << 10) | (17 << 5) | 1; /* l.ori r17, r1, ... */ - tramp[11] = 0x0; - - return FFI_OK; -} - - -ffi_status ffi_prep_cif_machdep (ffi_cif *cif) -{ - cif->flags = 0; - - /* structures are returned as pointers */ - if (cif->rtype->type == FFI_TYPE_STRUCT) - cif->flags = FFI_TYPE_STRUCT; - else - if (cif->rtype->size > 4) - cif->flags = FFI_TYPE_UINT64; - - cif->nfixedargs = cif->nargs; - - return FFI_OK; -} - - -ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, - unsigned int nfixedargs, unsigned int ntotalargs) -{ - ffi_status status; - - status = ffi_prep_cif_machdep (cif); - cif->nfixedargs = nfixedargs; - return status; -} diff --git a/deps/libffi/src/or1k/ffitarget.h b/deps/libffi/src/or1k/ffitarget.h deleted file mode 100644 index e55da286185a10..00000000000000 --- a/deps/libffi/src/or1k/ffitarget.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ----------------------------------------------------------------------- - ffitarget.h - Copyright (c) 2014 Sebastian Macke - - OpenRISC Target configuration macros - - 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. - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- System specific configurations ----------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 -#define FFI_TRAMPOLINE_SIZE (24) - -#define FFI_TARGET_SPECIFIC_VARIADIC 1 -#define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs; - -#endif - diff --git a/deps/libffi/src/or1k/sysv.S b/deps/libffi/src/or1k/sysv.S deleted file mode 100644 index df6570ba9d3e7c..00000000000000 --- a/deps/libffi/src/or1k/sysv.S +++ /dev/null @@ -1,107 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2014 Sebastian Macke - - OpenRISC Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -.text - .globl ffi_call_SYSV - .type ffi_call_SYSV, @function -/* - r3: size to allocate on stack - r4: extended cif structure - r5: function pointer ffi_prep_args - r6: ret address - r7: function to call - r8: flag for return type -*/ - -ffi_call_SYSV: - /* Store registers used on stack */ - l.sw -4(r1), r9 /* return address */ - l.sw -8(r1), r1 /* stack address */ - l.sw -12(r1), r14 /* callee saved registers */ - l.sw -16(r1), r16 - l.sw -20(r1), r18 - l.sw -24(r1), r20 - - l.ori r14, r1, 0x0 /* save stack pointer */ - l.addi r1, r1, -24 - - l.ori r16, r7, 0x0 /* save function address */ - l.ori r18, r6, 0x0 /* save ret address */ - l.ori r20, r8, 0x0 /* save flag */ - - l.sub r1, r1, r3 /* reserve space on stack */ - - /* Call ffi_prep_args */ - l.ori r3, r1, 0x0 /* first argument stack address, second already ecif */ - l.jalr r5 - l.nop - - /* Load register arguments and call*/ - - l.lwz r3, 0(r1) - l.lwz r4, 4(r1) - l.lwz r5, 8(r1) - l.lwz r6, 12(r1) - l.lwz r7, 16(r1) - l.lwz r8, 20(r1) - l.ori r1, r11, 0x0 /* new stack pointer */ - l.jalr r16 - l.nop - - /* handle return values */ - - l.sfeqi r20, FFI_TYPE_STRUCT - l.bf ret /* structs don't return an rvalue */ - l.nop - - /* copy ret address */ - - l.sfeqi r20, FFI_TYPE_UINT64 - l.bnf four_byte_ret /* 8 byte value is returned */ - l.nop - - l.sw 4(r18), r12 - -four_byte_ret: - l.sw 0(r18), r11 - -ret: - /* return */ - l.ori r1, r14, 0x0 /* reset stack pointer */ - l.lwz r9, -4(r1) - l.lwz r1, -8(r1) - l.lwz r14, -12(r1) - l.lwz r16, -16(r1) - l.lwz r18, -20(r1) - l.lwz r20, -24(r1) - l.jr r9 - l.nop - -.size ffi_call_SYSV, .-ffi_call_SYSV diff --git a/deps/libffi/src/pa/ffi.c b/deps/libffi/src/pa/ffi.c deleted file mode 100644 index f6012397e76735..00000000000000 --- a/deps/libffi/src/pa/ffi.c +++ /dev/null @@ -1,673 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - (c) 2011 Anthony Green - (c) 2008 Red Hat, Inc. - (c) 2006 Free Software Foundation, Inc. - (c) 2003-2004 Randolph Chung - - HPPA Foreign Function Interface - HP-UX PA ABI support - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include - -#define ROUND_UP(v, a) (((size_t)(v) + (a) - 1) & ~((a) - 1)) - -#define MIN_STACK_SIZE 64 -#define FIRST_ARG_SLOT 9 -#define DEBUG_LEVEL 0 - -#define fldw(addr, fpreg) \ - __asm__ volatile ("fldw 0(%0), %%" #fpreg "L" : : "r"(addr) : #fpreg) -#define fstw(fpreg, addr) \ - __asm__ volatile ("fstw %%" #fpreg "L, 0(%0)" : : "r"(addr)) -#define fldd(addr, fpreg) \ - __asm__ volatile ("fldd 0(%0), %%" #fpreg : : "r"(addr) : #fpreg) -#define fstd(fpreg, addr) \ - __asm__ volatile ("fstd %%" #fpreg "L, 0(%0)" : : "r"(addr)) - -#define debug(lvl, x...) do { if (lvl <= DEBUG_LEVEL) { printf(x); } } while (0) - -static inline int ffi_struct_type(ffi_type *t) -{ - size_t sz = t->size; - - /* Small structure results are passed in registers, - larger ones are passed by pointer. Note that small - structures differ from the corresponding integer - types in that they have different alignment requirements. */ - - if (sz <= 8) - return -sz; - else - return FFI_TYPE_STRUCT; /* else, we pass it by pointer. */ -} - -/* PA has a downward growing stack, which looks like this: - - Offset - [ Variable args ] - SP = (4*(n+9)) arg word N - ... - SP-52 arg word 4 - [ Fixed args ] - SP-48 arg word 3 - SP-44 arg word 2 - SP-40 arg word 1 - SP-36 arg word 0 - [ Frame marker ] - ... - SP-20 RP - SP-4 previous SP - - The first four argument words on the stack are reserved for use by - the callee. Instead, the general and floating registers replace - the first four argument slots. Non FP arguments are passed solely - in the general registers. FP arguments are passed in both general - and floating registers when using libffi. - - Non-FP 32-bit args are passed in gr26, gr25, gr24 and gr23. - Non-FP 64-bit args are passed in register pairs, starting - on an odd numbered register (i.e. r25+r26 and r23+r24). - FP 32-bit arguments are passed in fr4L, fr5L, fr6L and fr7L. - FP 64-bit arguments are passed in fr5 and fr7. - - The registers are allocated in the same manner as stack slots. - This allows the callee to save its arguments on the stack if - necessary: - - arg word 3 -> gr23 or fr7L - arg word 2 -> gr24 or fr6L or fr7R - arg word 1 -> gr25 or fr5L - arg word 0 -> gr26 or fr4L or fr5R - - Note that fr4R and fr6R are never used for arguments (i.e., - doubles are not passed in fr4 or fr6). - - The rest of the arguments are passed on the stack starting at SP-52, - but 64-bit arguments need to be aligned to an 8-byte boundary - - This means we can have holes either in the register allocation, - or in the stack. */ - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments - - The following code will put everything into the stack frame - (which was allocated by the asm routine), and on return - the asm routine will load the arguments that should be - passed by register into the appropriate registers - - NOTE: We load floating point args in this function... that means we - assume gcc will not mess with fp regs in here. */ - -void ffi_prep_args_pa32(UINT32 *stack, extended_cif *ecif, unsigned bytes) -{ - register unsigned int i; - register ffi_type **p_arg; - register void **p_argv; - unsigned int slot = FIRST_ARG_SLOT; - char *dest_cpy; - size_t len; - - debug(1, "%s: stack = %p, ecif = %p, bytes = %u\n", __FUNCTION__, stack, - ecif, bytes); - - p_arg = ecif->cif->arg_types; - p_argv = ecif->avalue; - - for (i = 0; i < ecif->cif->nargs; i++) - { - int type = (*p_arg)->type; - - switch (type) - { - case FFI_TYPE_SINT8: - *(SINT32 *)(stack - slot) = *(SINT8 *)(*p_argv); - break; - - case FFI_TYPE_UINT8: - *(UINT32 *)(stack - slot) = *(UINT8 *)(*p_argv); - break; - - case FFI_TYPE_SINT16: - *(SINT32 *)(stack - slot) = *(SINT16 *)(*p_argv); - break; - - case FFI_TYPE_UINT16: - *(UINT32 *)(stack - slot) = *(UINT16 *)(*p_argv); - break; - - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_POINTER: - debug(3, "Storing UINT32 %u in slot %u\n", *(UINT32 *)(*p_argv), - slot); - *(UINT32 *)(stack - slot) = *(UINT32 *)(*p_argv); - break; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - /* Align slot for 64-bit type. */ - slot += (slot & 1) ? 1 : 2; - *(UINT64 *)(stack - slot) = *(UINT64 *)(*p_argv); - break; - - case FFI_TYPE_FLOAT: - /* First 4 args go in fr4L - fr7L. */ - debug(3, "Storing UINT32(float) in slot %u\n", slot); - *(UINT32 *)(stack - slot) = *(UINT32 *)(*p_argv); - switch (slot - FIRST_ARG_SLOT) - { - /* First 4 args go in fr4L - fr7L. */ - case 0: fldw(stack - slot, fr4); break; - case 1: fldw(stack - slot, fr5); break; - case 2: fldw(stack - slot, fr6); break; - case 3: fldw(stack - slot, fr7); break; - } - break; - - case FFI_TYPE_DOUBLE: - /* Align slot for 64-bit type. */ - slot += (slot & 1) ? 1 : 2; - debug(3, "Storing UINT64(double) at slot %u\n", slot); - *(UINT64 *)(stack - slot) = *(UINT64 *)(*p_argv); - switch (slot - FIRST_ARG_SLOT) - { - /* First 2 args go in fr5, fr7. */ - case 1: fldd(stack - slot, fr5); break; - case 3: fldd(stack - slot, fr7); break; - } - break; - -#ifdef PA_HPUX - case FFI_TYPE_LONGDOUBLE: - /* Long doubles are passed in the same manner as structures - larger than 8 bytes. */ - *(UINT32 *)(stack - slot) = (UINT32)(*p_argv); - break; -#endif - - case FFI_TYPE_STRUCT: - - /* Structs smaller or equal than 4 bytes are passed in one - register. Structs smaller or equal 8 bytes are passed in two - registers. Larger structures are passed by pointer. */ - - len = (*p_arg)->size; - if (len <= 4) - { - dest_cpy = (char *)(stack - slot) + 4 - len; - memcpy(dest_cpy, (char *)*p_argv, len); - } - else if (len <= 8) - { - slot += (slot & 1) ? 1 : 2; - dest_cpy = (char *)(stack - slot) + 8 - len; - memcpy(dest_cpy, (char *)*p_argv, len); - } - else - *(UINT32 *)(stack - slot) = (UINT32)(*p_argv); - break; - - default: - FFI_ASSERT(0); - } - - slot++; - p_arg++; - p_argv++; - } - - /* Make sure we didn't mess up and scribble on the stack. */ - { - unsigned int n; - - debug(5, "Stack setup:\n"); - for (n = 0; n < (bytes + 3) / 4; n++) - { - if ((n%4) == 0) { debug(5, "\n%08x: ", (unsigned int)(stack - n)); } - debug(5, "%08x ", *(stack - n)); - } - debug(5, "\n"); - } - - FFI_ASSERT(slot * 4 <= bytes); - - return; -} - -static void ffi_size_stack_pa32(ffi_cif *cif) -{ - ffi_type **ptr; - int i; - int z = 0; /* # stack slots */ - - for (ptr = cif->arg_types, i = 0; i < cif->nargs; ptr++, i++) - { - int type = (*ptr)->type; - - switch (type) - { - case FFI_TYPE_DOUBLE: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - z += 2 + (z & 1); /* must start on even regs, so we may waste one */ - break; - -#ifdef PA_HPUX - case FFI_TYPE_LONGDOUBLE: -#endif - case FFI_TYPE_STRUCT: - z += 1; /* pass by ptr, callee will copy */ - break; - - default: /* <= 32-bit values */ - z++; - } - } - - /* We can fit up to 6 args in the default 64-byte stack frame, - if we need more, we need more stack. */ - if (z <= 6) - cif->bytes = MIN_STACK_SIZE; /* min stack size */ - else - cif->bytes = 64 + ROUND_UP((z - 6) * sizeof(UINT32), MIN_STACK_SIZE); - - debug(3, "Calculated stack size is %u bytes\n", cif->bytes); -} - -/* Perform machine dependent cif processing. */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - /* Set the return type flag */ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - cif->flags = (unsigned) cif->rtype->type; - break; - -#ifdef PA_HPUX - case FFI_TYPE_LONGDOUBLE: - /* Long doubles are treated like a structure. */ - cif->flags = FFI_TYPE_STRUCT; - break; -#endif - - case FFI_TYPE_STRUCT: - /* For the return type we have to check the size of the structures. - If the size is smaller or equal 4 bytes, the result is given back - in one register. If the size is smaller or equal 8 bytes than we - return the result in two registers. But if the size is bigger than - 8 bytes, we work with pointers. */ - cif->flags = ffi_struct_type(cif->rtype); - break; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - cif->flags = FFI_TYPE_UINT64; - break; - - default: - cif->flags = FFI_TYPE_INT; - break; - } - - /* Lucky us, because of the unique PA ABI we get to do our - own stack sizing. */ - switch (cif->abi) - { - case FFI_PA32: - ffi_size_stack_pa32(cif); - break; - - default: - FFI_ASSERT(0); - break; - } - - return FFI_OK; -} - -extern void ffi_call_pa32(void (*)(UINT32 *, extended_cif *, unsigned), - extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)(void)); - -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - extended_cif ecif; - size_t i, nargs = cif->nargs; - ffi_type **arg_types = cif->arg_types; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If we have any large structure arguments, make a copy so we are passing - by value. */ - for (i = 0; i < nargs; i++) - { - ffi_type *at = arg_types[i]; - int size = at->size; - if (at->type == FFI_TYPE_STRUCT && size > 8) - { - char *argcopy = alloca (size); - memcpy (argcopy, avalue[i], size); - avalue[i] = argcopy; - } - } - - /* If the return value is a struct and we don't have a return - value address then we need to make one. */ - - if (rvalue == NULL -#ifdef PA_HPUX - && (cif->rtype->type == FFI_TYPE_STRUCT - || cif->rtype->type == FFI_TYPE_LONGDOUBLE)) -#else - && cif->rtype->type == FFI_TYPE_STRUCT) -#endif - { - ecif.rvalue = alloca(cif->rtype->size); - } - else - ecif.rvalue = rvalue; - - - switch (cif->abi) - { - case FFI_PA32: - debug(3, "Calling ffi_call_pa32: ecif=%p, bytes=%u, flags=%u, rvalue=%p, fn=%p\n", &ecif, cif->bytes, cif->flags, ecif.rvalue, (void *)fn); - ffi_call_pa32(ffi_prep_args_pa32, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - break; - - default: - FFI_ASSERT(0); - break; - } -} - -#if FFI_CLOSURES -/* This is more-or-less an inverse of ffi_call -- we have arguments on - the stack, and we need to fill them into a cif structure and invoke - the user function. This really ought to be in asm to make sure - the compiler doesn't do things we don't expect. */ -ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack) -{ - ffi_cif *cif; - void **avalue; - void *rvalue; - /* Functions can return up to 64-bits in registers. Return address - must be double word aligned. */ - union { double rd; UINT32 ret[2]; } u; - ffi_type **p_arg; - char *tmp; - int i, avn; - unsigned int slot = FIRST_ARG_SLOT; - register UINT32 r28 asm("r28"); - - cif = closure->cif; - - /* If returning via structure, callee will write to our pointer. */ - if (cif->flags == FFI_TYPE_STRUCT) - rvalue = (void *)r28; - else - rvalue = &u; - - avalue = (void **)alloca(cif->nargs * FFI_SIZEOF_ARG); - avn = cif->nargs; - p_arg = cif->arg_types; - - for (i = 0; i < avn; i++) - { - int type = (*p_arg)->type; - - switch (type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_POINTER: - avalue[i] = (char *)(stack - slot) + sizeof(UINT32) - (*p_arg)->size; - break; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - slot += (slot & 1) ? 1 : 2; - avalue[i] = (void *)(stack - slot); - break; - - case FFI_TYPE_FLOAT: -#ifdef PA_LINUX - /* The closure call is indirect. In Linux, floating point - arguments in indirect calls with a prototype are passed - in the floating point registers instead of the general - registers. So, we need to replace what was previously - stored in the current slot with the value in the - corresponding floating point register. */ - switch (slot - FIRST_ARG_SLOT) - { - case 0: fstw(fr4, (void *)(stack - slot)); break; - case 1: fstw(fr5, (void *)(stack - slot)); break; - case 2: fstw(fr6, (void *)(stack - slot)); break; - case 3: fstw(fr7, (void *)(stack - slot)); break; - } -#endif - avalue[i] = (void *)(stack - slot); - break; - - case FFI_TYPE_DOUBLE: - slot += (slot & 1) ? 1 : 2; -#ifdef PA_LINUX - /* See previous comment for FFI_TYPE_FLOAT. */ - switch (slot - FIRST_ARG_SLOT) - { - case 1: fstd(fr5, (void *)(stack - slot)); break; - case 3: fstd(fr7, (void *)(stack - slot)); break; - } -#endif - avalue[i] = (void *)(stack - slot); - break; - -#ifdef PA_HPUX - case FFI_TYPE_LONGDOUBLE: - /* Long doubles are treated like a big structure. */ - avalue[i] = (void *) *(stack - slot); - break; -#endif - - case FFI_TYPE_STRUCT: - /* Structs smaller or equal than 4 bytes are passed in one - register. Structs smaller or equal 8 bytes are passed in two - registers. Larger structures are passed by pointer. */ - if((*p_arg)->size <= 4) - { - avalue[i] = (void *)(stack - slot) + sizeof(UINT32) - - (*p_arg)->size; - } - else if ((*p_arg)->size <= 8) - { - slot += (slot & 1) ? 1 : 2; - avalue[i] = (void *)(stack - slot) + sizeof(UINT64) - - (*p_arg)->size; - } - else - avalue[i] = (void *) *(stack - slot); - break; - - default: - FFI_ASSERT(0); - } - - slot++; - p_arg++; - } - - /* Invoke the closure. */ - (closure->fun) (cif, rvalue, avalue, closure->user_data); - - debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", u.ret[0], - u.ret[1]); - - /* Store the result using the lower 2 bytes of the flags. */ - switch (cif->flags) - { - case FFI_TYPE_UINT8: - *(stack - FIRST_ARG_SLOT) = (UINT8)u.ret[0]; - break; - case FFI_TYPE_SINT8: - *(stack - FIRST_ARG_SLOT) = (SINT8)u.ret[0]; - break; - case FFI_TYPE_UINT16: - *(stack - FIRST_ARG_SLOT) = (UINT16)u.ret[0]; - break; - case FFI_TYPE_SINT16: - *(stack - FIRST_ARG_SLOT) = (SINT16)u.ret[0]; - break; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - *(stack - FIRST_ARG_SLOT) = u.ret[0]; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - *(stack - FIRST_ARG_SLOT) = u.ret[0]; - *(stack - FIRST_ARG_SLOT - 1) = u.ret[1]; - break; - - case FFI_TYPE_DOUBLE: - fldd(rvalue, fr4); - break; - - case FFI_TYPE_FLOAT: - fldw(rvalue, fr4); - break; - - case FFI_TYPE_STRUCT: - /* Don't need a return value, done by caller. */ - break; - - case FFI_TYPE_SMALL_STRUCT1: - case FFI_TYPE_SMALL_STRUCT2: - case FFI_TYPE_SMALL_STRUCT3: - case FFI_TYPE_SMALL_STRUCT4: - tmp = (void*)(stack - FIRST_ARG_SLOT); - tmp += 4 - cif->rtype->size; - memcpy((void*)tmp, &u, cif->rtype->size); - break; - - case FFI_TYPE_SMALL_STRUCT5: - case FFI_TYPE_SMALL_STRUCT6: - case FFI_TYPE_SMALL_STRUCT7: - case FFI_TYPE_SMALL_STRUCT8: - { - unsigned int ret2[2]; - int off; - - /* Right justify ret[0] and ret[1] */ - switch (cif->flags) - { - case FFI_TYPE_SMALL_STRUCT5: off = 3; break; - case FFI_TYPE_SMALL_STRUCT6: off = 2; break; - case FFI_TYPE_SMALL_STRUCT7: off = 1; break; - default: off = 0; break; - } - - memset (ret2, 0, sizeof (ret2)); - memcpy ((char *)ret2 + off, &u, 8 - off); - - *(stack - FIRST_ARG_SLOT) = ret2[0]; - *(stack - FIRST_ARG_SLOT - 1) = ret2[1]; - } - break; - - case FFI_TYPE_POINTER: - case FFI_TYPE_VOID: - break; - - default: - debug(0, "assert with cif->flags: %d\n",cif->flags); - FFI_ASSERT(0); - break; - } - return FFI_OK; -} - -/* Fill in a closure to refer to the specified fun and user_data. - cif specifies the argument and result types for fun. - The cif must already be prep'ed. */ - -extern void ffi_closure_pa32(void); - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - /* The layout of a function descriptor. A function pointer with the PLABEL - bit set points to a function descriptor. */ - struct pa32_fd - { - UINT32 code_pointer; - UINT32 gp; - }; - - struct ffi_pa32_trampoline_struct - { - UINT32 code_pointer; /* Pointer to ffi_closure_unix. */ - UINT32 fake_gp; /* Pointer to closure, installed as gp. */ - UINT32 real_gp; /* Real gp value. */ - }; - - struct ffi_pa32_trampoline_struct *tramp; - struct pa32_fd *fd; - - if (cif->abi != FFI_PA32) - return FFI_BAD_ABI; - - /* Get function descriptor address for ffi_closure_pa32. */ - fd = (struct pa32_fd *)((UINT32)ffi_closure_pa32 & ~3); - - /* Setup trampoline. */ - tramp = (struct ffi_pa32_trampoline_struct *)closure->tramp; - tramp->code_pointer = fd->code_pointer; - tramp->fake_gp = (UINT32)codeloc & ~3; - tramp->real_gp = fd->gp; - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; -} -#endif diff --git a/deps/libffi/src/pa/ffi64.c b/deps/libffi/src/pa/ffi64.c deleted file mode 100644 index 08807c8af15a45..00000000000000 --- a/deps/libffi/src/pa/ffi64.c +++ /dev/null @@ -1,614 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi64.c - (c) 2022 John David Anglin - - HPPA Foreign Function Interface - PA 64-Bit ABI support - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include - -#define ROUND_UP(v, a) (((size_t)(v) + (a) - 1) & ~((a) - 1)) - -#define FIRST_ARG_SLOT 0 -#define DEBUG_LEVEL 0 - -#define fldw(addr, fpreg) \ - __asm__ volatile ("fldw 4(%0), %%" #fpreg "R" : : "r"(addr) : #fpreg) -#define fstw(fpreg, addr) \ - __asm__ volatile ("fstw %%" #fpreg "R, 4(%0)" : : "r"(addr)) -#define fldd(addr, fpreg) \ - __asm__ volatile ("fldd 0(%0), %%" #fpreg "L" : : "r"(addr) : #fpreg) -#define fstd(fpreg, addr) \ - __asm__ volatile ("fstd %%" #fpreg "L, 0(%0)" : : "r"(addr)) - -#define debug(lvl, x...) do { if (lvl <= DEBUG_LEVEL) { printf(x); } } while (0) - -static inline int ffi_struct_type(ffi_type *t) -{ - int sz = t->size; - - /* Small structure results are returned in registers 28 and 29, - larger ones are in a buffer allocated by the callee. The - address of the buffer is passed in r28. The buffer is supposed - to be aligned on a 16-byte boundary. Register return values are - padded on the right. The pad bits on the right are undefined. */ - - if (sz <= 16) - return -sz; - else - return FFI_TYPE_STRUCT; -} - -/* PA has a downward growing stack, which looks like this. Stack - arguments are offset from the argument ponter (AP) in r29. - - Offset - [ Fixed args ] - AP-64 arg word 0 (r26, fr4) - AP-56 arg word 1 (r25, fr5) - AP-48 arg word 2 (r24, fr6) - AP-40 arg word 3 (r23, fr7) - AP-32 arg word 4 (r22, fr8) - AP-24 arg word 5 (r21, fr9) - AP-16 arg word 6 (r20, fr10) - AP-8 arg word 7 (r19, fr11) - [ Variable args; AP = SP-16 if there are no variable args ] - AP stack arg 0 - AP+8 stack arg 1 - ... - [ Frame marker ] - SP-16 RP - SP-8 previous SP - - The first eight argument words on the stack are reserved for use by - the callee. Instead, the general and floating registers replace - the first four argument slots. Non FP arguments are passed solely - in the general registers. Single and double FP arguments are passed - in both general and floating registers when using libffi. - - The registers are allocated in the same manner as stack slots. - This allows the callee to save its arguments on the stack if - necessary: - - arg word 0 -> gr26 or fr4L or fr4R - arg word 1 -> gr25 or fr5L or fr5R - arg word 2 -> gr24 or fr6L or fr6R - arg word 3 -> gr23 or fr7L or fr7R - ... - - Single Single-precision floating-point parameters, when passed in - floating-point registers, are passed in the right halves of the - floating point registers; the left halves are unused. - - Quad-precision floating-point parameters within the first 64 bytes of - the parameter list are always passed in general registers. - - The rest of the arguments are passed on the stack starting at AP. - - This means we can have holes either in the register allocation, - or in the stack. */ - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments - - The following code will put everything into the stack frame - (which was allocated by the asm routine), and on return - the asm routine will load the arguments that should be - passed by register into the appropriate registers - - NOTE: We load floating point args in this function... that means we - assume gcc will not mess with fp regs in here. */ - -void ffi_prep_args_pa64(UINT64 *stack, extended_cif *ecif, unsigned bytes) -{ - register unsigned int i; - register ffi_type **p_arg; - register void **p_argv; - unsigned int slot = FIRST_ARG_SLOT; - size_t len; - - debug(1, "%s: stack = %p, ecif = %p, bytes = %u\n", __FUNCTION__, stack, - ecif, bytes); - - p_arg = ecif->cif->arg_types; - p_argv = ecif->avalue; - - for (i = 0; i < ecif->cif->nargs; i++) - { - int type = (*p_arg)->type; - - len = (*p_arg)->size; - - switch (type) - { - case FFI_TYPE_SINT8: - *(SINT64 *)(stack + slot) = *(SINT8 *)(*p_argv); - break; - - case FFI_TYPE_UINT8: - *(UINT64 *)(stack + slot) = *(UINT8 *)(*p_argv); - break; - - case FFI_TYPE_SINT16: - *(SINT64 *)(stack + slot) = *(SINT16 *)(*p_argv); - break; - - case FFI_TYPE_UINT16: - *(UINT64 *)(stack + slot) = *(UINT16 *)(*p_argv); - break; - - case FFI_TYPE_SINT32: - *(SINT64 *)(stack + slot) = *(SINT32 *)(*p_argv); - break; - - case FFI_TYPE_UINT32: - *(UINT64 *)(stack + slot) = *(UINT32 *)(*p_argv); - break; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_POINTER: - debug(3, "Storing UINT64 %lu in slot %u\n", *(UINT64 *)(*p_argv), - slot); - *(UINT64 *)(stack + slot) = *(UINT64 *)(*p_argv); - break; - - case FFI_TYPE_FLOAT: - /* First 8 args go in fr4L - fr11L. */ - debug(3, "Storing UINT32(float) in slot %u\n", slot); - *(UINT64 *)(stack + slot) = *(UINT32 *)(*p_argv); - switch (slot - FIRST_ARG_SLOT) - { - /* First 4 args go in fr4L - fr7L. */ - case 0: fldw(stack + slot, fr4); break; - case 1: fldw(stack + slot, fr5); break; - case 2: fldw(stack + slot, fr6); break; - case 3: fldw(stack + slot, fr7); break; - case 4: fldw(stack + slot, fr8); break; - case 5: fldw(stack + slot, fr9); break; - case 6: fldw(stack + slot, fr10); break; - case 7: fldw(stack + slot, fr11); break; - } - break; - - case FFI_TYPE_DOUBLE: - debug(3, "Storing UINT64(double) at slot %u\n", slot); - *(UINT64 *)(stack + slot) = *(UINT64 *)(*p_argv); - switch (slot - FIRST_ARG_SLOT) - { - /* First 8 args go in fr4 to fr11. */ - case 0: fldd(stack + slot, fr4); break; - case 1: fldd(stack + slot, fr5); break; - case 2: fldd(stack + slot, fr6); break; - case 3: fldd(stack + slot, fr7); break; - case 4: fldd(stack + slot, fr8); break; - case 5: fldd(stack + slot, fr9); break; - case 6: fldd(stack + slot, fr10); break; - case 7: fldd(stack + slot, fr11); break; - } - break; - -#ifdef PA64_HPUX - case FFI_TYPE_LONGDOUBLE: - /* Align slot to a 16-byte boundary. */ - slot += (slot & 1); - *(UINT64 *)(stack + slot) = *(UINT64 *)(*p_argv); - *(UINT64 *)(stack + slot + 1) = *(UINT64 *)(*p_argv + 8); - break; -#endif - - case FFI_TYPE_STRUCT: - /* Structs larger than 8 bytes are aligned on a 16-byte boundary. */ - if (len > 8) - slot += (slot & 1); - memcpy((char *)(stack + slot), (char *)*p_argv, len); - break; - - default: - FFI_ASSERT(0); - } - - slot += ROUND_UP (len, 8) >> 3; - p_arg++; - p_argv++; - } - - FFI_ASSERT(slot * 8 <= bytes); - - return; -} - -static void ffi_size_stack_pa64(ffi_cif *cif) -{ - ffi_type **ptr; - int i; - int z = 0; /* # stack slots */ - - for (ptr = cif->arg_types, i = 0; i < cif->nargs; ptr++, i++) - { - int type = (*ptr)->type; - int size = (*ptr)->size; - - switch (type) - { -#ifdef PA64_HPUX - case FFI_TYPE_LONGDOUBLE: - z += 2 + (z & 1); - break; -#endif - - case FFI_TYPE_STRUCT: - if (size > 8) - z += (z & 1); - z += ROUND_UP (size, 8) >> 3; - break; - - default: /* 64-bit values */ - z++; - } - } - - /* We need a minimum of 8 argument slots. Stack must be 16-byte - aligned. */ - if (z <= 8) - z = 8; - else - z += (z & 1); - - /* Add 16 bytes for frame marker. */ - cif->bytes = z * 8 + 64; - debug(3, "Calculated stack size is %u bytes\n", cif->bytes); -} - -/* Perform machine dependent cif processing. */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - /* Set the return type flag for jump table. */ - switch (cif->rtype->type) - { - case FFI_TYPE_COMPLEX: - case FFI_TYPE_STRUCT: - /* For the return type we have to check the size of the structures. - If the size is smaller or equal 8 bytes, the result is given back - in one register. If the size is smaller or equal 16 bytes than we - return the result in two registers. If the size is bigger than - 16 bytes, the return is in a buffer allocated by the caller. */ - cif->flags = ffi_struct_type(cif->rtype); - break; - - default: - cif->flags = (unsigned) cif->rtype->type; - break; - } - - /* Lucky us, because of the unique PA ABI we get to do our - own stack sizing. */ - switch (cif->abi) - { - case FFI_PA64: - ffi_size_stack_pa64(cif); - break; - - default: - FFI_ASSERT(0); - break; - } - - return FFI_OK; -} - -extern void ffi_call_pa64(void (*)(UINT64 *, extended_cif *, unsigned), - extended_cif *, unsigned, unsigned, unsigned *, - void (*fn)(void)); - -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return - value address then we need to make one. */ - - if (rvalue == NULL - && (cif->rtype->type == FFI_TYPE_STRUCT - || cif->rtype->type == FFI_TYPE_COMPLEX) - && cif->rtype->size > 16) - ecif.rvalue = alloca(ROUND_UP (cif->rtype->size, 16)); - else - ecif.rvalue = rvalue; - - - switch (cif->abi) - { - case FFI_PA64: - debug(3, "Calling ffi_call_pa64: ecif=%p, bytes=%u, flags=%u, rvalue=%p, fn=%p\n", &ecif, cif->bytes, cif->flags, ecif.rvalue, (void *)fn); - ffi_call_pa64(ffi_prep_args_pa64, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - break; - - default: - FFI_ASSERT(0); - break; - } -} - -#if FFI_CLOSURES -/* This is more-or-less an inverse of ffi_call -- we have arguments on - the stack, and we need to fill them into a cif structure and invoke - the user function. This really ought to be in asm to make sure - the compiler doesn't do things we don't expect. */ -ffi_status ffi_closure_inner_pa64(ffi_closure *closure, UINT64 *stack) -{ - ffi_cif *cif; - void **avalue; - void *rvalue; - /* Functions can return up to 128-bits in registers. Return address - must be double word aligned. */ - union { long double rld; UINT64 ret[2]; } u; - ffi_type **p_arg; - char *tmp; - int i, avn; - unsigned int slot = FIRST_ARG_SLOT; - register UINT64 r28 asm("r28"); - - cif = closure->cif; - - /* If returning via structure, callee will write to our pointer. */ - if (cif->flags == FFI_TYPE_STRUCT) - rvalue = (void *)r28; - else - rvalue = &u; - - avalue = (void **)alloca(cif->nargs * FFI_SIZEOF_ARG); - avn = cif->nargs; - p_arg = cif->arg_types; - - for (i = 0; i < avn; i++) - { - int type = (*p_arg)->type; - - switch (type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - avalue[i] = (void *)(stack + slot) + 7; - break; - - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - avalue[i] = (void *)(stack + slot) + 6; - break; - - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - avalue[i] = (void *)(stack + slot) + 4; - break; - - case FFI_TYPE_POINTER: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - avalue[i] = (void *)(stack + slot); - break; - - case FFI_TYPE_FLOAT: - /* The closure call is indirect. In Linux, floating point - arguments in indirect calls with a prototype are passed - in the floating point registers instead of the general - registers. So, we need to replace what was previously - stored in the current slot with the value in the - corresponding floating point register. */ - switch (slot + FIRST_ARG_SLOT) - { - case 0: fstw(fr4, (void *)(stack + slot)); break; - case 1: fstw(fr5, (void *)(stack + slot)); break; - case 2: fstw(fr6, (void *)(stack + slot)); break; - case 3: fstw(fr7, (void *)(stack + slot)); break; - case 4: fstw(fr8, (void *)(stack + slot)); break; - case 5: fstw(fr9, (void *)(stack + slot)); break; - case 6: fstw(fr10, (void *)(stack + slot)); break; - case 7: fstw(fr11, (void *)(stack + slot)); break; - } - avalue[i] = (void *)(stack + slot) + 4; - break; - - case FFI_TYPE_DOUBLE: - /* See previous comment for FFI_TYPE_FLOAT. */ - switch (slot + FIRST_ARG_SLOT) - { - case 0: fstd(fr4, (void *)(stack + slot)); break; - case 1: fstd(fr5, (void *)(stack + slot)); break; - case 2: fstd(fr6, (void *)(stack + slot)); break; - case 3: fstd(fr7, (void *)(stack + slot)); break; - case 4: fstd(fr8, (void *)(stack + slot)); break; - case 5: fstd(fr9, (void *)(stack + slot)); break; - case 6: fstd(fr10, (void *)(stack + slot)); break; - case 7: fstd(fr11, (void *)(stack + slot)); break; - } - avalue[i] = (void *)(stack + slot); - break; - -#ifdef PA64_HPUX - case FFI_TYPE_LONGDOUBLE: - /* Long doubles are treated like a big structure. */ - slot += (slot & 1); - avalue[i] = (void *)(stack + slot); - break; -#endif - - case FFI_TYPE_STRUCT: - /* All structs are passed in registers. Structs larger - than 8 bytes are aligned on a 16-byte boundary. */ - if((*p_arg)->size > 8) - slot += (slot & 1); - avalue[i] = (void *) (stack + slot); - break; - - default: - FFI_ASSERT(0); - } - - slot += (ROUND_UP ((*p_arg)->size, 8) >> 3); - p_arg++; - } - - /* Invoke the closure. */ - (closure->fun) (cif, rvalue, avalue, closure->user_data); - - debug(3, "after calling function, ret[0] = %16lx, ret[1] = %16lx\n", u.ret[0], - u.ret[1]); - - /* Store the result using the lower 2 bytes of the flags. */ - switch (cif->flags) - { - case FFI_TYPE_UINT8: - *(stack + FIRST_ARG_SLOT) = (UINT8)u.ret[0]; - break; - case FFI_TYPE_SINT8: - *(stack + FIRST_ARG_SLOT) = (SINT8)u.ret[0]; - break; - case FFI_TYPE_UINT16: - *(stack + FIRST_ARG_SLOT) = (UINT16)u.ret[0]; - break; - case FFI_TYPE_SINT16: - *(stack + FIRST_ARG_SLOT) = (SINT16)u.ret[0]; - break; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - *(stack + FIRST_ARG_SLOT) = (SINT32)u.ret[0]; - break; - case FFI_TYPE_UINT32: - *(stack - FIRST_ARG_SLOT) = (UINT32)u.ret[0]; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_POINTER: - *(stack - FIRST_ARG_SLOT) = u.ret[0]; - break; - - case FFI_TYPE_LONGDOUBLE: - *(stack + FIRST_ARG_SLOT) = u.ret[0]; - *(stack + FIRST_ARG_SLOT + 1) = u.ret[1]; - break; - - case FFI_TYPE_DOUBLE: - fldd(rvalue, fr4); - break; - - case FFI_TYPE_FLOAT: - /* Adjust for address adjustment in fldw macro. */ - fldw(rvalue - 4, fr4); - break; - - case FFI_TYPE_STRUCT: - /* Don't need a return value, done by caller. */ - break; - - case -1: - case -2: - case -3: - case -4: - case -5: - case -6: - case -7: - case -8: - case -9: - case -10: - case -11: - case -12: - case -13: - case -14: - case -15: - case -16: - tmp = (void*)(stack + FIRST_ARG_SLOT); - memcpy((void*)tmp, &u, cif->rtype->size); - break; - - case FFI_TYPE_VOID: - break; - - default: - debug(0, "assert with cif->flags: %d\n",cif->flags); - FFI_ASSERT(0); - break; - } - return FFI_OK; -} - -/* Fill in a closure to refer to the specified fun and user_data. - cif specifies the argument and result types for fun. - The cif must already be prep'ed. */ - -extern void ffi_closure_pa64(void); - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - /* The layout of a function descriptor. */ - struct pa64_fd - { - UINT64 tmp1; - UINT64 tmp2; - UINT64 code_pointer; - UINT64 gp; - }; - - struct ffi_pa64_trampoline_struct - { - UINT64 real_gp; /* Real gp value. */ - UINT64 tmp2; - UINT64 code_pointer; /* Pointer to ffi_closure_unix. */ - UINT64 fake_gp; /* Pointer to closure, installed as gp. */ - }; - - struct ffi_pa64_trampoline_struct *tramp; - struct pa64_fd *fd; - - if (cif->abi != FFI_PA64) - return FFI_BAD_ABI; - - /* Get function descriptor address for ffi_closure_pa64. */ - fd = (struct pa64_fd *)((UINT64)ffi_closure_pa64); - - /* Setup trampoline. */ - tramp = (struct ffi_pa64_trampoline_struct *)closure->tramp; - tramp->code_pointer = fd->code_pointer; - tramp->fake_gp = (UINT64)codeloc; - tramp->real_gp = fd->gp; - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; -} -#endif diff --git a/deps/libffi/src/pa/ffitarget.h b/deps/libffi/src/pa/ffitarget.h deleted file mode 100644 index dae854a695bb30..00000000000000 --- a/deps/libffi/src/pa/ffitarget.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for hppa. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- System specific configurations ----------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - -#ifdef PA_LINUX - FFI_PA32, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_PA32 -#endif - -#ifdef PA_HPUX - FFI_PA32, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_PA32 -#endif - -#ifdef PA64_HPUX - FFI_PA64, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_PA64 -#endif -} ffi_abi; -#endif - -#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 -#if defined(PA64_HPUX) -#define FFI_TRAMPOLINE_SIZE 32 -#else -#define FFI_TRAMPOLINE_SIZE 12 -#endif - -#define FFI_TYPE_SMALL_STRUCT1 -1 -#define FFI_TYPE_SMALL_STRUCT2 -2 -#define FFI_TYPE_SMALL_STRUCT3 -3 -#define FFI_TYPE_SMALL_STRUCT4 -4 -#define FFI_TYPE_SMALL_STRUCT5 -5 -#define FFI_TYPE_SMALL_STRUCT6 -6 -#define FFI_TYPE_SMALL_STRUCT7 -7 -#define FFI_TYPE_SMALL_STRUCT8 -8 - -/* linux.S and hpux32.S expect FFI_TYPE_COMPLEX is the last generic type. */ -#define FFI_PA_TYPE_LAST FFI_TYPE_COMPLEX - -/* If new generic types are added, the jump tables in linux.S and hpux32.S - likely need updating. */ -#if FFI_TYPE_LAST != FFI_PA_TYPE_LAST -# error "You likely have broken jump tables" -#endif - -#endif diff --git a/deps/libffi/src/pa/hpux32.S b/deps/libffi/src/pa/hpux32.S deleted file mode 100644 index 1629c0356b439d..00000000000000 --- a/deps/libffi/src/pa/hpux32.S +++ /dev/null @@ -1,417 +0,0 @@ -/* ----------------------------------------------------------------------- - hpux32.S - Copyright (c) 2006 Free Software Foundation, Inc. - (c) 2008 Red Hat, Inc. - based on src/pa/linux.S - - HP-UX PA Foreign Function Interface - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - - .LEVEL 1.1 - .SPACE $PRIVATE$ - .IMPORT $global$,DATA - .IMPORT $$dyncall,MILLICODE - .SUBSPA $DATA$ - .align 4 - - /* void ffi_call_pa32(void (*)(char *, extended_cif *), - extended_cif *ecif, - unsigned bytes, - unsigned flags, - unsigned *rvalue, - void (*fn)(void)); - */ - - .export ffi_call_pa32,ENTRY,PRIV_LEV=3 - .import ffi_prep_args_pa32,CODE - - .SPACE $TEXT$ - .SUBSPA $CODE$ - .align 4 - -L$FB1 -ffi_call_pa32 - .proc - .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4 - .entry - stw %rp, -20(%sp) - copy %r3, %r1 -L$CFI11 - copy %sp, %r3 -L$CFI12 - - /* Setup the stack for calling prep_args... - We want the stack to look like this: - - [ Previous stack ] <- %r3 - - [ 64-bytes register save area ] <- %r4 - - [ Stack space for actual call, passed as ] <- %arg0 - [ arg0 to ffi_prep_args_pa32 ] - - [ Stack for calling prep_args ] <- %sp - */ - - stwm %r1, 64(%sp) - stw %r4, 12(%r3) -L$CFI13 - copy %sp, %r4 - - addl %arg2, %r4, %arg0 ; arg stack - stw %arg3, -48(%r3) ; save flags we need it later - - /* Call prep_args: - %arg0(stack) -- set up above - %arg1(ecif) -- same as incoming param - %arg2(bytes) -- same as incoming param */ - bl ffi_prep_args_pa32,%r2 - ldo 64(%arg0), %sp - ldo -64(%sp), %sp - - /* now %sp should point where %arg0 was pointing. */ - - /* Load the arguments that should be passed in registers - The fp args are loaded by the prep_args function. */ - ldw -36(%sp), %arg0 - ldw -40(%sp), %arg1 - ldw -44(%sp), %arg2 - ldw -48(%sp), %arg3 - - /* in case the function is going to return a structure - we need to give it a place to put the result. */ - ldw -52(%r3), %ret0 ; %ret0 <- rvalue - ldw -56(%r3), %r22 ; %r22 <- function to call - bl $$dyncall, %r31 ; Call the user function - copy %r31, %rp - - /* Prepare to store the result; we need to recover flags and rvalue. */ - ldw -48(%r3), %r21 ; r21 <- flags - - /* Adjust flags range from [-8, 15] to [0, 23]. */ - addi 8, %r21, %r21 - - blr %r21, %r0 - ldw -52(%r3), %r20 ; r20 <- rvalue - - /* Giant jump table */ - /* 8-byte small struct */ - b,n L$smst8 - nop - /* 7-byte small struct */ - b,n L$smst7 - nop - /* 6-byte small struct */ - b,n L$smst6 - nop - /* 5-byte small struct */ - b,n L$smst5 - nop - /* 4-byte small struct */ - b,n L$smst4 - nop - /* 3-byte small struct */ - b,n L$smst3 - nop - /* 2-byte small struct */ - b,n L$smst2 - nop - /* 1-byte small struct */ - b L$done - stb %ret0, 0(%r20) - /* void */ - b,n L$done - nop - /* int */ - b L$done - stw %ret0, 0(%r20) - /* float */ - b L$done - fstw %fr4L,0(%r20) - /* double */ - b L$done - fstd %fr4,0(%r20) - /* long double */ - b,n L$done - nop - /* unsigned int8 */ - b L$done - stw %ret0, 0(%r20) - /* signed int8 */ - b L$done - stw %ret0, 0(%r20) - /* unsigned int16 */ - b L$done - stw %ret0, 0(%r20) - /* signed int16 */ - b L$done - stw %ret0, 0(%r20) - /* unsigned int32 */ - b L$done - stw %ret0, 0(%r20) - /* signed int32 */ - b L$done - stw %ret0, 0(%r20) - /* unsigned int64 */ - b,n L$uint64 - nop - /* signed int64 */ - b,n L$sint64 - nop - /* large struct */ - b,n L$done - nop - /* pointer */ - b L$done - stw %ret0, 0(%r20) - /* complex */ - b,n L$done - nop - - /* Store the result according to the return type. The most - likely types should come first. */ - -L$uint64 -L$sint64 - stw %ret0, 0(%r20) - b L$done - stw %ret1, 4(%r20) - -L$smst2 - /* 2-byte structs are returned in ret0 as ????xxyy. */ - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b L$done - stb %ret0, 0(%r20) - -L$smst3 - /* 3-byte structs are returned in ret0 as ??xxyyzz. */ - extru %ret0, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b L$done - stb %ret0, 0(%r20) - -L$smst4 - /* 4-byte structs are returned in ret0 as wwxxyyzz. */ - extru %ret0, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b L$done - stb %ret0, 0(%r20) - -L$smst5 - /* 5 byte values are returned right justified: - ret0 ret1 - 5: ??????aa bbccddee */ - stbs,ma %ret0, 1(%r20) - extru %ret1, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b L$done - stb %ret1, 0(%r20) - -L$smst6 - /* 6 byte values are returned right justified: - ret0 ret1 - 6: ????aabb ccddeeff */ - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - stbs,ma %ret0, 1(%r20) - extru %ret1, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b L$done - stb %ret1, 0(%r20) - -L$smst7 - /* 7 byte values are returned right justified: - ret0 ret1 - 7: ??aabbcc ddeeffgg */ - extru %ret0, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - stbs,ma %ret0, 1(%r20) - extru %ret1, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b L$done - stb %ret1, 0(%r20) - -L$smst8 - /* 8 byte values are returned right justified: - ret0 ret1 - 8: aabbccdd eeffgghh */ - extru %ret0, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - stbs,ma %ret0, 1(%r20) - extru %ret1, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - stb %ret1, 0(%r20) - -L$done - /* all done, return */ - copy %r4, %sp ; pop arg stack - ldw 12(%r3), %r4 - ldwm -64(%sp), %r3 ; .. and pop stack - ldw -20(%sp), %rp - bv %r0(%rp) - nop - .exit - .procend -L$FE1 - - /* void ffi_closure_pa32(void); - Called with closure argument in %r19 */ - - .SPACE $TEXT$ - .SUBSPA $CODE$ - .export ffi_closure_pa32,ENTRY,PRIV_LEV=3,RTNVAL=GR - .import ffi_closure_inner_pa32,CODE - .align 4 -L$FB2 -ffi_closure_pa32 - .proc - .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3 - .entry - - stw %rp, -20(%sp) - copy %r3, %r1 -L$CFI21 - copy %sp, %r3 -L$CFI22 - stwm %r1, 64(%sp) - - /* Put arguments onto the stack and call ffi_closure_inner. */ - stw %arg0, -36(%r3) - stw %arg1, -40(%r3) - stw %arg2, -44(%r3) - stw %arg3, -48(%r3) - - /* Retrieve closure pointer and real gp. */ - copy %r19, %arg0 - ldw 8(%r19), %r19 - bl ffi_closure_inner_pa32, %r2 - copy %r3, %arg1 - ldwm -64(%sp), %r3 - ldw -20(%sp), %rp - ldw -36(%sp), %ret0 - bv %r0(%rp) - ldw -40(%sp), %ret1 - .exit - .procend -L$FE2: - - .SPACE $PRIVATE$ - .SUBSPA $DATA$ - - .align 4 - .EXPORT _GLOBAL__F_ffi_call_pa32,DATA -_GLOBAL__F_ffi_call_pa32 -L$frame1: - .word L$ECIE1-L$SCIE1 ;# Length of Common Information Entry -L$SCIE1: - .word 0x0 ;# CIE Identifier Tag - .byte 0x1 ;# CIE Version - .ascii "\0" ;# CIE Augmentation - .uleb128 0x1 ;# CIE Code Alignment Factor - .sleb128 4 ;# CIE Data Alignment Factor - .byte 0x2 ;# CIE RA Column - .byte 0xc ;# DW_CFA_def_cfa - .uleb128 0x1e - .uleb128 0x0 - .align 4 -L$ECIE1: -L$SFDE1: - .word L$EFDE1-L$ASFDE1 ;# FDE Length -L$ASFDE1: - .word L$ASFDE1-L$frame1 ;# FDE CIE offset - .word L$FB1 ;# FDE initial location - .word L$FE1-L$FB1 ;# FDE address range - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI11-L$FB1 - .byte 0x83 ;# DW_CFA_offset, column 0x3 - .uleb128 0x0 - .byte 0x11 ;# DW_CFA_offset_extended_sf; save r2 at [r30-20] - .uleb128 0x2 - .sleb128 -5 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI12-L$CFI11 - .byte 0xd ;# DW_CFA_def_cfa_register = r3 - .uleb128 0x3 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI13-L$CFI12 - .byte 0x84 ;# DW_CFA_offset, column 0x4 - .uleb128 0x3 - - .align 4 -L$EFDE1: - -L$SFDE2: - .word L$EFDE2-L$ASFDE2 ;# FDE Length -L$ASFDE2: - .word L$ASFDE2-L$frame1 ;# FDE CIE offset - .word L$FB2 ;# FDE initial location - .word L$FE2-L$FB2 ;# FDE address range - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI21-L$FB2 - .byte 0x83 ;# DW_CFA_offset, column 0x3 - .uleb128 0x0 - .byte 0x11 ;# DW_CFA_offset_extended_sf - .uleb128 0x2 - .sleb128 -5 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI22-L$CFI21 - .byte 0xd ;# DW_CFA_def_cfa_register = r3 - .uleb128 0x3 - - .align 4 -L$EFDE2: diff --git a/deps/libffi/src/pa/hpux64.S b/deps/libffi/src/pa/hpux64.S deleted file mode 100644 index 6a82b57ecbbe32..00000000000000 --- a/deps/libffi/src/pa/hpux64.S +++ /dev/null @@ -1,681 +0,0 @@ -/* ----------------------------------------------------------------------- - hpux64.S - (c) 2005-2022 John David Anglin - - HPUX PA 64-Bit Foreign Function Interface - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - - .LEVEL 2.0w - .text - .align 4 - - /* void ffi_call_pa64(void (*)(char *, extended_cif *), - extended_cif *ecif, - unsigned bytes, - unsigned flags, - unsigned *rvalue, - void (*fn)()); - */ - - .export ffi_call_pa64,code - .import ffi_prep_args_pa64,code - - .align 4 - -L$FB1 -ffi_call_pa64 - .proc - .callinfo FRAME=48,CALLS,SAVE_RP,ENTRY_GR=4 - .entry - std %rp, -16(%sp) - copy %r3, %r1 -L$CFI11 - copy %sp, %r3 -L$CFI12 - std,ma %r1, 48(%sp) - - /* Setup the stack for calling prep_args... - We want the stack to look like this: - - [ Previous stack ] <- %r3 - - [ 48-byte register save area ] - - [ Stack space for call arguments ] <- %r4 - - [ 16-byte rame marker ] - - [ 128-byte stack for calling prep_args ] <- %sp - */ - - std %r4, 8(%r3) ; save r4 -L$CFI13 - std %r23, 16(%r3) ; save flags we need it later - std %r22, 24(%r3) ; save rvalue - std %r21, 32(%r3) ; save fn pointer - - copy %sp, %r4 - copy %r4, %r26 ; argument stack pointer - addl %r24, %sp, %sp ; allocate argument space - - ldo 112(%sp), %r29 ; arg pointer for prep args - - /* Call prep_args: - %arg0(stack) -- set up above to point to call arguments - %arg1(ecif) -- same as incoming param - %arg2(bytes) -- same as incoming param */ - bl ffi_prep_args_pa64,%r2 - ldo 128(%sp), %sp - ldo -128(%sp), %sp - - /* Load the arguments that should be passed in registers - The fp args were loaded by the prep_args function. */ - ldd 0(%r4), %r26 - ldd 8(%r4), %r25 - ldd 16(%r4), %r24 - ldd 24(%r4), %r23 - ldd 32(%r4), %r22 - ldd 40(%r4), %r21 - ldd 48(%r4), %r20 - ldd 56(%r4), %r19 - - ldd 24(%r3), %ret0 ; %ret0 <- rvalue - - ldd 32(%r3), %r1 ; %r1 <- function pointer - ldd 16(%r1), %rp ; fn address - ldd 24(%r1), %dp ; New gp - bve,l (%rp), %r2 ; Call the user function - ldo 64(%r4), %r29 ; Argument pointer - - /* Prepare to store the result; recover flags and rvalue. */ - ldd 16(%r3), %r21 ; r21 <- flags - extrd,s %r21, 63, 32, %r21 ; sign extend flags for blr - - /* Adjust flags range from [-16, 15] to [0, 31]. */ - addi 16, %r21, %r21 - - blr %r21, %r0 - ldd 24(%r3), %r20 ; r20 <- rvalue - - /* Giant jump table */ - /* 16-byte small struct */ - b,n L$smst16 - nop - /* 15-byte small struct */ - b,n L$smst15 - nop - /* 14-byte small struct */ - b,n L$smst14 - nop - /* 13-byte small struct */ - b,n L$smst13 - nop - /* 12-byte small struct */ - b,n L$smst12 - nop - /* 11-byte small struct */ - b,n L$smst11 - nop - /* 10-byte small struct */ - b,n L$smst10 - nop - /* 9-byte small struct */ - b,n L$smst9 - nop - /* 8-byte small struct */ - b,n L$smst8 - nop - /* 7-byte small struct */ - b,n L$smst7 - nop - /* 6-byte small struct */ - b,n L$smst6 - nop - /* 5-byte small struct */ - b,n L$smst5 - nop - /* 4-byte small struct */ - b,n L$smst4 - nop - /* 3-byte small struct */ - b,n L$smst3 - nop - /* 2-byte small struct */ - b,n L$smst2 - nop - /* 1-byte small struct */ - b,n L$smst1 - nop - /* void */ - b,n L$done - nop - /* int */ - b L$done - std %ret0, 0(%r20) - /* float */ - b L$done - fstw %fr4R, 0(%r20) - /* double */ - b L$done - fstd %fr4, 0(%r20) - /* long double */ - b,n L$longdouble - nop - /* unsigned int8 */ - b L$done - std %ret0, 0(%r20) - /* signed int8 */ - b L$done - std %ret0, 0(%r20) - /* unsigned int16 */ - b L$done - std %ret0, 0(%r20) - /* signed int16 */ - b L$done - std %ret0, 0(%r20) - /* unsigned int32 */ - b L$done - std %ret0, 0(%r20) - /* signed int32 */ - b L$done - std %ret0, 0(%r20) - /* unsigned int64 */ - b L$done - std %ret0, 0(%r20) - /* signed int64 */ - b L$done - std %ret0, 0(%r20) - /* large struct */ - b,n L$done - nop - /* pointer */ - b L$done - std %ret0, 0(%r20) - /* complex */ - b,n L$done - nop - -L$longdouble - std %ret0, 0(%r20) - b L$done - std %ret1, 8(%r20) - - /* We need to copy byte-by-byte the exact number bytes - in the struct to avoid clobbering other data. */ -L$smst1 - extrd,u %ret0, 7, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst2 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst3 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst4 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst5 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst6 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst7 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst8 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - stb,ma %r22, 1(%r20) - b L$done - stb %ret0, 0(%r20) - -L$smst9 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - stb,ma %r22, 1(%r20) - stb,ma %ret0, 1(%r20) - extrd,u %ret1, 7, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst10 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - stb,ma %r22, 1(%r20) - stb,ma %ret0, 1(%r20) - extrd,u %ret1, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 15, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst11 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - stb,ma %r22, 1(%r20) - stb,ma %ret0, 1(%r20) - extrd,u %ret1, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 23, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst12 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - stb,ma %r22, 1(%r20) - stb,ma %ret0, 1(%r20) - extrd,u %ret1, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 31, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst13 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - stb,ma %r22, 1(%r20) - stb,ma %ret0, 1(%r20) - extrd,u %ret1, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 39, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst14 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - stb,ma %r22, 1(%r20) - stb,ma %ret0, 1(%r20) - extrd,u %ret1, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 47, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst15 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - stb,ma %r22, 1(%r20) - stb,ma %ret0, 1(%r20) - extrd,u %ret1, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 55, 8, %r22 - b L$done - stb %r22, 0(%r20) - -L$smst16 - extrd,u %ret0, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret0, 55, 8, %r22 - stb,ma %r22, 1(%r20) - stb,ma %ret0, 1(%r20) - extrd,u %ret1, 7, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 15, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 23, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 31, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 39, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 47, 8, %r22 - stb,ma %r22, 1(%r20) - extrd,u %ret1, 55, 8, %r22 - stb,ma %r22, 1(%r20) - stb %ret1, 0(%r20) - -L$done - /* all done, restore registers and return */ - copy %r4, %sp - ldd 8(%r3), %r4 - ldd -16(%r3), %rp - bve (%rp) - ldd,mb -48(%sp), %r3 - .exit - .procend -L$FE1 - .size ffi_call_pa64, .-ffi_call_pa64 - - /* void ffi_closure_pa64(void); - Called with closure argument in %r21 */ - - .export ffi_closure_pa64,code - .import ffi_closure_inner_pa64,code - .align 4 -L$FB2 -ffi_closure_pa64 - .proc - .callinfo FRAME=128,CALLS,SAVE_RP,ENTRY_GR=3 - .entry - - std %rp, -16(%sp) - copy %r3, %r1 -L$CFI21 - copy %sp, %r3 -L$CFI22 - std,ma %r1, 128(%sp) -L$CFI23 - - /* Put arguments onto the stack and call ffi_closure_inner. */ - std %r26, -64(%r29) - std %r25, -56(%r29) - std %r24, -48(%r29) - std %r23, -40(%r29) - std %r22, -32(%r29) - std %r21, -24(%r29) - std %r20, -16(%r29) - std %r19, -8(%r29) - - /* Load and save start of argument stack. */ - ldo -64(%r29), %r25 - std %r25, 8(%r3) - - /* Setup arg pointer. */ - ldo -16(%sp), %ret1 - - /* Retrieve closure pointer and real gp. */ - copy %dp, %r26 - bl ffi_closure_inner_pa64, %r2 - ldd 0(%dp), %dp - - /* Retrieve start of argument stack. */ - ldd 8(%r3), %r1 - - /* Restore r3 and op stack. */ - ldd,mb -128(%sp), %r3 - - /* Load return address. */ - ldd -16(%sp), %rp - - /* Load return values from first and second stack slots. */ - ldd 0(%r1), %ret0 - bve (%rp) - ldd 8(%r1), %ret1 - - .exit - .procend - .end -L$FE2: - .size ffi_closure_pa64, .-ffi_closure_pa64 - - .section .eh_frame,"aw",@progbits -L$frame1: - .word L$ECIE1-L$SCIE1 ;# Length of Common Information Entry -L$SCIE1: - .word 0x0 ;# CIE Identifier Tag - .byte 0x3 ;# CIE Version - .stringz "" ;# CIE Augmentation - .uleb128 0x1 ;# CIE Code Alignment Factor - .sleb128 8 ;# CIE Data Alignment Factor - .byte 0x2 ;# CIE RA Column - .byte 0xc ;# DW_CFA_def_cfa - .uleb128 0x1e - .uleb128 0x0 - .align 8 -L$ECIE1: -L$SFDE1: - .word L$EFDE1-L$ASFDE1 ;# FDE Length -L$ASFDE1: - .word L$ASFDE1-L$frame1 ;# FDE CIE offset - .dword L$FB1 ;# FDE initial location - .dword L$FE1-L$FB1 ;# FDE address range - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI11-L$FB1 - .byte 0x9 ;# DW_CFA_register: r3 in r1 - .uleb128 0x3 - .uleb128 0x1 - .byte 0x11 ;# DW_CFA_offset_extended_sf: r2 at cfa-16 - .uleb128 0x2 - .sleb128 -2 - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI12-L$CFI11 - .byte 0xd ;# DW_CFA_def_cfa_register: r3 - .uleb128 0x3 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI13-L$CFI12 - .byte 0x83 ;# DW_CFA_offset: r3 at cfa+0 - .uleb128 0 - .byte 0x84 ;# DW_CFA_offset: r4 at cfa+8 - .uleb128 1 - - .align 8 -L$EFDE1: - -L$SFDE2: - .word L$EFDE2-L$ASFDE2 ;# FDE Length -L$ASFDE2: - .word L$ASFDE2-L$frame1 ;# FDE CIE offset - .dword L$FB2 ;# FDE initial location - .dword L$FE2-L$FB2 ;# FDE address range - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI21-L$FB2 - .byte 0x9 ;# DW_CFA_register: r3 in r1 - .uleb128 0x3 - .uleb128 0x1 - .byte 0x11 ;# DW_CFA_offset_extended_sf: r2 at cfa-16 - .uleb128 0x2 - .sleb128 -2 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI22-L$CFI21 - .byte 0xd ;# DW_CFA_def_cfa_register: r3 - .uleb128 0x3 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word L$CFI23-L$CFI22 - .byte 0x83 ;# DW_CFA_offset: r3 at cfa+0 - .uleb128 0 - - .align 8 -L$EFDE2: diff --git a/deps/libffi/src/pa/linux.S b/deps/libffi/src/pa/linux.S deleted file mode 100644 index fdd43324769d5f..00000000000000 --- a/deps/libffi/src/pa/linux.S +++ /dev/null @@ -1,431 +0,0 @@ -/* ----------------------------------------------------------------------- - linux.S - (c) 2003-2004 Randolph Chung - (c) 2008 Red Hat, Inc. - - HPPA Foreign Function Interface - - 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 RENESAS TECHNOLOGY 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - - .text - .level 1.1 - .align 4 - - /* void ffi_call_pa32(void (*)(char *, extended_cif *), - extended_cif *ecif, - unsigned bytes, - unsigned flags, - unsigned *rvalue, - void (*fn)(void)); - */ - - .export ffi_call_pa32,code - .import ffi_prep_args_pa32,code - - .type ffi_call_pa32, @function -.LFB1: -ffi_call_pa32: - .proc - .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4 - .entry - stw %rp, -20(%sp) - copy %r3, %r1 -.LCFI11: - - copy %sp, %r3 -.LCFI12: - - /* Setup the stack for calling prep_args... - We want the stack to look like this: - - [ Previous stack ] <- %r3 - - [ 64-bytes register save area ] <- %r4 - - [ Stack space for actual call, passed as ] <- %arg0 - [ arg0 to ffi_prep_args_pa32 ] - - [ Stack for calling prep_args ] <- %sp - */ - - stwm %r1, 64(%sp) - stw %r4, 12(%r3) -.LCFI13: - copy %sp, %r4 - - addl %arg2, %r4, %arg0 /* arg stack */ - stw %arg3, -48(%r3) /* save flags; we need it later */ - - /* Call prep_args: - %arg0(stack) -- set up above - %arg1(ecif) -- same as incoming param - %arg2(bytes) -- same as incoming param */ - bl ffi_prep_args_pa32,%r2 - ldo 64(%arg0), %sp - ldo -64(%sp), %sp - - /* now %sp should point where %arg0 was pointing. */ - - /* Load the arguments that should be passed in registers - The fp args were loaded by the prep_args function. */ - ldw -36(%sp), %arg0 - ldw -40(%sp), %arg1 - ldw -44(%sp), %arg2 - ldw -48(%sp), %arg3 - - /* in case the function is going to return a structure - we need to give it a place to put the result. */ - ldw -52(%r3), %ret0 /* %ret0 <- rvalue */ - ldw -56(%r3), %r22 /* %r22 <- function to call */ - bl $$dyncall, %r31 /* Call the user function */ - copy %r31, %rp - - /* Prepare to store the result; we need to recover flags and rvalue. */ - ldw -48(%r3), %r21 /* r21 <- flags */ - - /* Adjust flags range from [-8, 15] to [0, 23]. */ - addi 8, %r21, %r21 - - blr %r21, %r0 - ldw -52(%r3), %r20 /* r20 <- rvalue */ - - /* Giant jump table */ - /* 8-byte small struct */ - b,n .Lsmst8 - nop - /* 7-byte small struct */ - b,n .Lsmst7 - nop - /* 6-byte small struct */ - b,n .Lsmst6 - nop - /* 5-byte small struct */ - b,n .Lsmst5 - nop - /* 4-byte small struct */ - b,n .Lsmst4 - nop - /* 3-byte small struct */ - b,n .Lsmst3 - nop - /* 2-byte small struct */ - b,n .Lsmst2 - nop - /* 1-byte small struct */ - b .Ldone - stb %ret0, 0(%r20) - /* void */ - b,n .Ldone - nop - /* int */ - b .Ldone - stw %ret0, 0(%r20) - /* float */ - b .Ldone - fstw %fr4L,0(%r20) - /* double */ - b .Ldone - fstd %fr4,0(%r20) - /* long double */ - b .Ldone - fstd %fr4,0(%r20) - /* unsigned int8 */ - b .Ldone - stw %ret0, 0(%r20) - /* sint8 */ - b .Ldone - stw %ret0, 0(%r20) - /* unsigned int16 */ - b .Ldone - stw %ret0, 0(%r20) - /* sint16 */ - b .Ldone - stw %ret0, 0(%r20) - /* unsigned int32 */ - b .Ldone - stw %ret0, 0(%r20) - /* sint32 */ - b .Ldone - stw %ret0, 0(%r20) - /* unsigned int64 */ - b,n .Luint64 - nop - /* signed int64 */ - b,n .Lsint64 - nop - /* large struct */ - b,n .Ldone - nop - /* pointer */ - b .Ldone - stw %ret0, 0(%r20) - /* complex */ - b,n .Ldone - nop - - /* Store the result according to the return type. */ - -.Luint64: -.Lsint64: - stw %ret0, 0(%r20) - b .Ldone - stw %ret1, 4(%r20) - -.Lsmst2: - /* 2-byte structs are returned in ret0 as ????xxyy. */ - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b .Ldone - stb %ret0, 0(%r20) - -.Lsmst3: - /* 3-byte structs are returned in ret0 as ??xxyyzz. */ - extru %ret0, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b .Ldone - stb %ret0, 0(%r20) - -.Lsmst4: - /* 4-byte structs are returned in ret0 as wwxxyyzz. */ - extru %ret0, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b .Ldone - stb %ret0, 0(%r20) - -.Lsmst5: - /* 5 byte values are returned right justified: - ret0 ret1 - 5: ??????aa bbccddee */ - stbs,ma %ret0, 1(%r20) - extru %ret1, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b .Ldone - stb %ret1, 0(%r20) - -.Lsmst6: - /* 6 byte values are returned right justified: - ret0 ret1 - 6: ????aabb ccddeeff */ - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - stbs,ma %ret0, 1(%r20) - extru %ret1, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b .Ldone - stb %ret1, 0(%r20) - -.Lsmst7: - /* 7 byte values are returned right justified: - ret0 ret1 - 7: ??aabbcc ddeeffgg */ - extru %ret0, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - stbs,ma %ret0, 1(%r20) - extru %ret1, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - b .Ldone - stb %ret1, 0(%r20) - -.Lsmst8: - /* 8 byte values are returned right justified: - ret0 ret1 - 8: aabbccdd eeffgghh */ - extru %ret0, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret0, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - stbs,ma %ret0, 1(%r20) - extru %ret1, 7, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 15, 8, %r22 - stbs,ma %r22, 1(%r20) - extru %ret1, 23, 8, %r22 - stbs,ma %r22, 1(%r20) - stb %ret1, 0(%r20) - -.Ldone: - /* all done, return */ - copy %r4, %sp /* pop arg stack */ - ldw 12(%r3), %r4 - ldwm -64(%sp), %r3 /* .. and pop stack */ - ldw -20(%sp), %rp - bv %r0(%rp) - nop - .exit - .procend -.LFE1: - - /* void ffi_closure_pa32(void); - Called with closure argument in %r19 */ - .export ffi_closure_pa32,code - .import ffi_closure_inner_pa32,code - - .type ffi_closure_pa32, @function -.LFB2: -ffi_closure_pa32: - .proc - .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3 - .entry - - stw %rp, -20(%sp) -.LCFI20: - copy %r3, %r1 -.LCFI21: - copy %sp, %r3 -.LCFI22: - stwm %r1, 64(%sp) - - /* Put arguments onto the stack and call ffi_closure_inner. */ - stw %arg0, -36(%r3) - stw %arg1, -40(%r3) - stw %arg2, -44(%r3) - stw %arg3, -48(%r3) - - /* Retrieve closure pointer and real gp. */ - copy %r19, %arg0 - ldw 8(%r19), %r19 - bl ffi_closure_inner_pa32, %r2 - copy %r3, %arg1 - - ldwm -64(%sp), %r3 - ldw -20(%sp), %rp - ldw -36(%sp), %ret0 - bv %r0(%r2) - ldw -40(%sp), %ret1 - - .exit - .procend -.LFE2: - - .section ".eh_frame",EH_FRAME_FLAGS,@progbits -.Lframe1: - .word .LECIE1-.LSCIE1 ;# Length of Common Information Entry -.LSCIE1: - .word 0x0 ;# CIE Identifier Tag - .byte 0x1 ;# CIE Version -#ifdef __PIC__ - .ascii "zR\0" ;# CIE Augmentation: 'z' - data, 'R' - DW_EH_PE_... data -#else - .ascii "\0" ;# CIE Augmentation -#endif - .uleb128 0x1 ;# CIE Code Alignment Factor - .sleb128 4 ;# CIE Data Alignment Factor - .byte 0x2 ;# CIE RA Column -#ifdef __PIC__ - .uleb128 0x1 ;# Augmentation size - .byte 0x1b ;# FDE Encoding (DW_EH_PE_pcrel|DW_EH_PE_sdata4) -#endif - .byte 0xc ;# DW_CFA_def_cfa - .uleb128 0x1e - .uleb128 0x0 - .align 4 -.LECIE1: -.LSFDE1: - .word .LEFDE1-.LASFDE1 ;# FDE Length -.LASFDE1: - .word .LASFDE1-.Lframe1 ;# FDE CIE offset -#ifdef __PIC__ - .word .LFB1-. ;# FDE initial location -#else - .word .LFB1 ;# FDE initial location -#endif - .word .LFE1-.LFB1 ;# FDE address range -#ifdef __PIC__ - .uleb128 0x0 ;# Augmentation size: no data -#endif - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI11-.LFB1 - .byte 0x83 ;# DW_CFA_offset, column 0x3 - .uleb128 0x0 - .byte 0x11 ;# DW_CFA_offset_extended_sf; save r2 at [r30-20] - .uleb128 0x2 - .sleb128 -5 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI12-.LCFI11 - .byte 0xd ;# DW_CFA_def_cfa_register = r3 - .uleb128 0x3 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI13-.LCFI12 - .byte 0x84 ;# DW_CFA_offset, column 0x4 - .uleb128 0x3 - - .align 4 -.LEFDE1: - -.LSFDE2: - .word .LEFDE2-.LASFDE2 ;# FDE Length -.LASFDE2: - .word .LASFDE2-.Lframe1 ;# FDE CIE offset -#ifdef __PIC__ - .word .LFB2-. ;# FDE initial location -#else - .word .LFB2 ;# FDE initial location -#endif - .word .LFE2-.LFB2 ;# FDE address range -#ifdef __PIC__ - .uleb128 0x0 ;# Augmentation size: no data -#endif - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI21-.LFB2 - .byte 0x83 ;# DW_CFA_offset, column 0x3 - .uleb128 0x0 - .byte 0x11 ;# DW_CFA_offset_extended_sf - .uleb128 0x2 - .sleb128 -5 - - .byte 0x4 ;# DW_CFA_advance_loc4 - .word .LCFI22-.LCFI21 - .byte 0xd ;# DW_CFA_def_cfa_register = r3 - .uleb128 0x3 - - .align 4 -.LEFDE2: - -#if defined(__ELF__) && defined(__linux__) -.section .note.GNU-stack,"",%progbits -#endif diff --git a/deps/libffi/src/powerpc/aix.S b/deps/libffi/src/powerpc/aix.S deleted file mode 100644 index 7ba541595f23c4..00000000000000 --- a/deps/libffi/src/powerpc/aix.S +++ /dev/null @@ -1,566 +0,0 @@ -/* ----------------------------------------------------------------------- - aix.S - Copyright (c) 2002, 2009 Free Software Foundation, Inc. - based on darwin.S by John Hornkvist - - PowerPC Assembly glue. - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - - .set r0,0 - .set r1,1 - .set r2,2 - .set r3,3 - .set r4,4 - .set r5,5 - .set r6,6 - .set r7,7 - .set r8,8 - .set r9,9 - .set r10,10 - .set r11,11 - .set r12,12 - .set r13,13 - .set r14,14 - .set r15,15 - .set r16,16 - .set r17,17 - .set r18,18 - .set r19,19 - .set r20,20 - .set r21,21 - .set r22,22 - .set r23,23 - .set r24,24 - .set r25,25 - .set r26,26 - .set r27,27 - .set r28,28 - .set r29,29 - .set r30,30 - .set r31,31 - .set f0,0 - .set f1,1 - .set f2,2 - .set f3,3 - .set f4,4 - .set f5,5 - .set f6,6 - .set f7,7 - .set f8,8 - .set f9,9 - .set f10,10 - .set f11,11 - .set f12,12 - .set f13,13 - .set f14,14 - .set f15,15 - .set f16,16 - .set f17,17 - .set f18,18 - .set f19,19 - .set f20,20 - .set f21,21 - - .extern .ffi_prep_args - -#define LIBFFI_ASM -#include -#include -#define JUMPTARGET(name) name -#define L(x) x - .file "aix.S" - .toc - - /* void ffi_call_AIX(extended_cif *ecif, unsigned long bytes, - * unsigned int flags, unsigned int *rvalue, - * void (*fn)(), - * void (*prep_args)(extended_cif*, unsigned *const)); - * r3=ecif, r4=bytes, r5=flags, r6=rvalue, r7=fn, r8=prep_args - */ - -.csect .text[PR] - .align 2 - .globl ffi_call_AIX - .globl .ffi_call_AIX -.csect ffi_call_AIX[DS] -ffi_call_AIX: -#ifdef __64BIT__ - .llong .ffi_call_AIX, TOC[tc0], 0 - .csect .text[PR] -.ffi_call_AIX: - .function .ffi_call_AIX,.ffi_call_AIX,16,044,LFE..0-LFB..0 - .bf __LINE__ - .line 1 -LFB..0: - /* Save registers we use. */ - mflr r0 - - std r28,-32(r1) - std r29,-24(r1) - std r30,-16(r1) - std r31, -8(r1) - - std r0, 16(r1) -LCFI..0: - mr r28, r1 /* our AP. */ - stdux r1, r1, r4 -LCFI..1: - - /* Save arguments over call... */ - mr r31, r5 /* flags, */ - mr r30, r6 /* rvalue, */ - mr r29, r7 /* function address. */ - std r2, 40(r1) - - /* Call ffi_prep_args. */ - mr r4, r1 - bl .ffi_prep_args - nop - - /* Now do the call. */ - ld r0, 0(r29) - ld r2, 8(r29) - ld r11, 16(r29) - /* Set up cr1 with bits 4-7 of the flags. */ - mtcrf 0x40, r31 - mtctr r0 - /* Load all those argument registers. */ - /* We have set up a nice stack frame, just load it into registers. */ - ld r3, 40+(1*8)(r1) - ld r4, 40+(2*8)(r1) - ld r5, 40+(3*8)(r1) - ld r6, 40+(4*8)(r1) - nop - ld r7, 40+(5*8)(r1) - ld r8, 40+(6*8)(r1) - ld r9, 40+(7*8)(r1) - ld r10,40+(8*8)(r1) - -L1: - /* Load all the FP registers. */ - bf 6,L2 /* 2f + 0x18 */ - lfd f1,-32-(13*8)(r28) - lfd f2,-32-(12*8)(r28) - lfd f3,-32-(11*8)(r28) - lfd f4,-32-(10*8)(r28) - nop - lfd f5,-32-(9*8)(r28) - lfd f6,-32-(8*8)(r28) - lfd f7,-32-(7*8)(r28) - lfd f8,-32-(6*8)(r28) - nop - lfd f9,-32-(5*8)(r28) - lfd f10,-32-(4*8)(r28) - lfd f11,-32-(3*8)(r28) - lfd f12,-32-(2*8)(r28) - nop - lfd f13,-32-(1*8)(r28) - -L2: - /* Make the call. */ - bctrl - ld r2, 40(r1) - - /* Now, deal with the return value. */ - mtcrf 0x01, r31 - - bt 30, L(done_return_value) - bt 29, L(fp_return_value) - std r3, 0(r30) - - /* Fall through... */ - -L(done_return_value): - /* Restore the registers we used and return. */ - mr r1, r28 - ld r0, 16(r28) - ld r28, -32(r1) - mtlr r0 - ld r29, -24(r1) - ld r30, -16(r1) - ld r31, -8(r1) - blr - -L(fp_return_value): - bf 28, L(float_return_value) - stfd f1, 0(r30) - bf 31, L(done_return_value) - stfd f2, 8(r30) - b L(done_return_value) -L(float_return_value): - stfs f1, 0(r30) - b L(done_return_value) -LFE..0: -#else /* ! __64BIT__ */ - - .long .ffi_call_AIX, TOC[tc0], 0 - .csect .text[PR] -.ffi_call_AIX: - .function .ffi_call_AIX,.ffi_call_AIX,16,044,LFE..0-LFB..0 - .bf __LINE__ - .line 1 -LFB..0: - /* Save registers we use. */ - mflr r0 - - stw r28,-16(r1) - stw r29,-12(r1) - stw r30, -8(r1) - stw r31, -4(r1) - - stw r0, 8(r1) -LCFI..0: - mr r28, r1 /* out AP. */ - stwux r1, r1, r4 -LCFI..1: - - /* Save arguments over call... */ - mr r31, r5 /* flags, */ - mr r30, r6 /* rvalue, */ - mr r29, r7 /* function address, */ - stw r2, 20(r1) - - /* Call ffi_prep_args. */ - mr r4, r1 - bl .ffi_prep_args - nop - - /* Now do the call. */ - lwz r0, 0(r29) - lwz r2, 4(r29) - lwz r11, 8(r29) - /* Set up cr1 with bits 4-7 of the flags. */ - mtcrf 0x40, r31 - mtctr r0 - /* Load all those argument registers. */ - /* We have set up a nice stack frame, just load it into registers. */ - lwz r3, 20+(1*4)(r1) - lwz r4, 20+(2*4)(r1) - lwz r5, 20+(3*4)(r1) - lwz r6, 20+(4*4)(r1) - nop - lwz r7, 20+(5*4)(r1) - lwz r8, 20+(6*4)(r1) - lwz r9, 20+(7*4)(r1) - lwz r10,20+(8*4)(r1) - -L1: - /* Load all the FP registers. */ - bf 6,L2 /* 2f + 0x18 */ - lfd f1,-16-(13*8)(r28) - lfd f2,-16-(12*8)(r28) - lfd f3,-16-(11*8)(r28) - lfd f4,-16-(10*8)(r28) - nop - lfd f5,-16-(9*8)(r28) - lfd f6,-16-(8*8)(r28) - lfd f7,-16-(7*8)(r28) - lfd f8,-16-(6*8)(r28) - nop - lfd f9,-16-(5*8)(r28) - lfd f10,-16-(4*8)(r28) - lfd f11,-16-(3*8)(r28) - lfd f12,-16-(2*8)(r28) - nop - lfd f13,-16-(1*8)(r28) - -L2: - /* Make the call. */ - bctrl - lwz r2, 20(r1) - - /* Now, deal with the return value. */ - mtcrf 0x01, r31 - - bt 30, L(done_return_value) - bt 29, L(fp_return_value) - stw r3, 0(r30) - bf 28, L(done_return_value) - stw r4, 4(r30) - - /* Fall through... */ - -L(done_return_value): - /* Restore the registers we used and return. */ - mr r1, r28 - lwz r0, 8(r28) - lwz r28,-16(r1) - mtlr r0 - lwz r29,-12(r1) - lwz r30, -8(r1) - lwz r31, -4(r1) - blr - -L(fp_return_value): - bf 28, L(float_return_value) - stfd f1, 0(r30) - b L(done_return_value) -L(float_return_value): - stfs f1, 0(r30) - b L(done_return_value) -LFE..0: -#endif - .ef __LINE__ - .long 0 - .byte 0,0,0,1,128,4,0,0 -/* END(ffi_call_AIX) */ - - /* void ffi_call_go_AIX(extended_cif *ecif, unsigned long bytes, - * unsigned int flags, unsigned int *rvalue, - * void (*fn)(), - * void (*prep_args)(extended_cif*, unsigned *const), - * void *closure); - * r3=ecif, r4=bytes, r5=flags, r6=rvalue, r7=fn, r8=prep_args, r9=closure - */ - -.csect .text[PR] - .align 2 - .globl ffi_call_go_AIX - .globl .ffi_call_go_AIX -.csect ffi_call_go_AIX[DS] -ffi_call_go_AIX: -#ifdef __64BIT__ - .llong .ffi_call_go_AIX, TOC[tc0], 0 - .csect .text[PR] -.ffi_call_go_AIX: - .function .ffi_call_go_AIX,.ffi_call_go_AIX,16,044,LFE..1-LFB..1 - .bf __LINE__ - .line 1 -LFB..1: - /* Save registers we use. */ - mflr r0 - - std r28,-32(r1) - std r29,-24(r1) - std r30,-16(r1) - std r31, -8(r1) - - std r9, 8(r1) /* closure, saved in cr field. */ - std r0, 16(r1) -LCFI..2: - mr r28, r1 /* our AP. */ - stdux r1, r1, r4 -LCFI..3: - - /* Save arguments over call... */ - mr r31, r5 /* flags, */ - mr r30, r6 /* rvalue, */ - mr r29, r7 /* function address, */ - std r2, 40(r1) - - /* Call ffi_prep_args. */ - mr r4, r1 - bl .ffi_prep_args - nop - - /* Now do the call. */ - ld r0, 0(r29) - ld r2, 8(r29) - ld r11, 8(r28) /* closure */ - /* Set up cr1 with bits 4-7 of the flags. */ - mtcrf 0x40, r31 - mtctr r0 - /* Load all those argument registers. */ - /* We have set up a nice stack frame, just load it into registers. */ - ld r3, 40+(1*8)(r1) - ld r4, 40+(2*8)(r1) - ld r5, 40+(3*8)(r1) - ld r6, 40+(4*8)(r1) - nop - ld r7, 40+(5*8)(r1) - ld r8, 40+(6*8)(r1) - ld r9, 40+(7*8)(r1) - ld r10,40+(8*8)(r1) - - b L1 -LFE..1: -#else /* ! __64BIT__ */ - - .long .ffi_call_go_AIX, TOC[tc0], 0 - .csect .text[PR] -.ffi_call_go_AIX: - .function .ffi_call_go_AIX,.ffi_call_go_AIX,16,044,LFE..1-LFB..1 - .bf __LINE__ - .line 1 - /* Save registers we use. */ -LFB..1: - mflr r0 - - stw r28,-16(r1) - stw r29,-12(r1) - stw r30, -8(r1) - stw r31, -4(r1) - - stw r9, 4(r1) /* closure, saved in cr field. */ - stw r0, 8(r1) -LCFI..2: - mr r28, r1 /* out AP. */ - stwux r1, r1, r4 -LCFI..3: - - /* Save arguments over call... */ - mr r31, r5 /* flags, */ - mr r30, r6 /* rvalue, */ - mr r29, r7 /* function address, */ - stw r2, 20(r1) - - /* Call ffi_prep_args. */ - mr r4, r1 - bl .ffi_prep_args - nop - - /* Now do the call. */ - lwz r0, 0(r29) - lwz r2, 4(r29) - lwz r11, 4(r28) /* closure */ - /* Set up cr1 with bits 4-7 of the flags. */ - mtcrf 0x40, r31 - mtctr r0 - /* Load all those argument registers. */ - /* We have set up a nice stack frame, just load it into registers. */ - lwz r3, 20+(1*4)(r1) - lwz r4, 20+(2*4)(r1) - lwz r5, 20+(3*4)(r1) - lwz r6, 20+(4*4)(r1) - nop - lwz r7, 20+(5*4)(r1) - lwz r8, 20+(6*4)(r1) - lwz r9, 20+(7*4)(r1) - lwz r10,20+(8*4)(r1) - - b L1 -LFE..1: -#endif - .ef __LINE__ - .long 0 - .byte 0,0,0,1,128,4,0,0 -/* END(ffi_call_go_AIX) */ - -.csect .text[PR] - .align 2 - .globl ffi_call_DARWIN - .globl .ffi_call_DARWIN -.csect ffi_call_DARWIN[DS] -ffi_call_DARWIN: -#ifdef __64BIT__ - .llong .ffi_call_DARWIN, TOC[tc0], 0 -#else - .long .ffi_call_DARWIN, TOC[tc0], 0 -#endif - .csect .text[PR] -.ffi_call_DARWIN: - blr - .long 0 - .byte 0,0,0,0,0,0,0,0 -/* END(ffi_call_DARWIN) */ - -/* EH frame stuff. */ - -#define LR_REGNO 0x41 /* Link Register (65), see rs6000.md */ -#ifdef __64BIT__ -#define PTRSIZE 8 -#define LOG2_PTRSIZE 3 -#define FDE_ENCODING 0x1c /* DW_EH_PE_pcrel|DW_EH_PE_sdata8 */ -#define EH_DATA_ALIGN_FACT 0x78 /* LEB128 -8 */ -#else -#define PTRSIZE 4 -#define LOG2_PTRSIZE 2 -#define FDE_ENCODING 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4 */ -#define EH_DATA_ALIGN_FACT 0x7c /* LEB128 -4 */ -#endif - .csect _unwind.ro_[RO],4 - .align LOG2_PTRSIZE - .globl _GLOBAL__F_libffi_src_powerpc_aix -_GLOBAL__F_libffi_src_powerpc_aix: -Lframe..1: - .vbyte 4,LECIE..1-LSCIE..1 /* CIE Length */ -LSCIE..1: - .vbyte 4,0 /* CIE Identifier Tag */ - .byte 0x3 /* CIE Version */ - .byte "zR" /* CIE Augmentation */ - .byte 0 - .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ - .byte EH_DATA_ALIGN_FACT /* leb128 -4/-8; CIE Data Alignment Factor */ - .byte 0x41 /* CIE RA Column */ - .byte 0x1 /* uleb128 0x1; Augmentation size */ - .byte FDE_ENCODING /* FDE Encoding (pcrel|sdata4/8) */ - .byte 0xc /* DW_CFA_def_cfa */ - .byte 0x1 /* uleb128 0x1; Register r1 */ - .byte 0 /* uleb128 0x0; Offset 0 */ - .align LOG2_PTRSIZE -LECIE..1: -LSFDE..1: - .vbyte 4,LEFDE..1-LASFDE..1 /* FDE Length */ -LASFDE..1: - .vbyte 4,LASFDE..1-Lframe..1 /* FDE CIE offset */ - .vbyte PTRSIZE,LFB..0-$ /* FDE initial location */ - .vbyte PTRSIZE,LFE..0-LFB..0 /* FDE address range */ - .byte 0 /* uleb128 0x0; Augmentation size */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .vbyte 4,LCFI..0-LFB..0 - .byte 0x11 /* DW_CFA_def_offset_extended_sf */ - .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */ - .byte 0x7e /* leb128 -2; Offset -2 (8/16) */ - .byte 0x9f /* DW_CFA_offset Register r31 */ - .byte 0x1 /* uleb128 0x1; Offset 1 (-4/-8) */ - .byte 0x9e /* DW_CFA_offset Register r30 */ - .byte 0x2 /* uleb128 0x2; Offset 2 (-8/-16) */ - .byte 0x9d /* DW_CFA_offset Register r29 */ - .byte 0x3 /* uleb128 0x3; Offset 3 (-12/-24) */ - .byte 0x9c /* DW_CFA_offset Register r28 */ - .byte 0x4 /* uleb128 0x4; Offset 4 (-16/-32) */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .vbyte 4,LCFI..1-LCFI..0 - .byte 0xd /* DW_CFA_def_cfa_register */ - .byte 0x1c /* uleb128 28; Register r28 */ - .align LOG2_PTRSIZE -LEFDE..1: -LSFDE..2: - .vbyte 4,LEFDE..2-LASFDE..2 /* FDE Length */ -LASFDE..2: - .vbyte 4,LASFDE..2-Lframe..1 /* FDE CIE offset */ - .vbyte PTRSIZE,LFB..1-$ /* FDE initial location */ - .vbyte PTRSIZE,LFE..1-LFB..1 /* FDE address range */ - .byte 0 /* uleb128 0x0; Augmentation size */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .vbyte 4,LCFI..2-LFB..1 - .byte 0x11 /* DW_CFA_def_offset_extended_sf */ - .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */ - .byte 0x7e /* leb128 -2; Offset -2 (8/16) */ - .byte 0x9f /* DW_CFA_offset Register r31 */ - .byte 0x1 /* uleb128 0x1; Offset 1 (-4/-8) */ - .byte 0x9e /* DW_CFA_offset Register r30 */ - .byte 0x2 /* uleb128 0x2; Offset 2 (-8/-16) */ - .byte 0x9d /* DW_CFA_offset Register r29 */ - .byte 0x3 /* uleb128 0x3; Offset 3 (-12/-24) */ - .byte 0x9c /* DW_CFA_offset Register r28 */ - .byte 0x4 /* uleb128 0x4; Offset 4 (-16/-32) */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .vbyte 4,LCFI..3-LCFI..2 - .byte 0xd /* DW_CFA_def_cfa_register */ - .byte 0x1c /* uleb128 28; Register r28 */ - .align LOG2_PTRSIZE -LEFDE..2: - .vbyte 4,0 /* End of FDEs */ - - .csect .text[PR] - .ref _GLOBAL__F_libffi_src_powerpc_aix /* Prevents garbage collection by AIX linker */ - diff --git a/deps/libffi/src/powerpc/aix_closure.S b/deps/libffi/src/powerpc/aix_closure.S deleted file mode 100644 index 132c785eddc855..00000000000000 --- a/deps/libffi/src/powerpc/aix_closure.S +++ /dev/null @@ -1,694 +0,0 @@ -/* ----------------------------------------------------------------------- - aix_closure.S - Copyright (c) 2002, 2003, 2009 Free Software Foundation, Inc. - based on darwin_closure.S - - PowerPC Assembly glue. - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - - .set r0,0 - .set r1,1 - .set r2,2 - .set r3,3 - .set r4,4 - .set r5,5 - .set r6,6 - .set r7,7 - .set r8,8 - .set r9,9 - .set r10,10 - .set r11,11 - .set r12,12 - .set r13,13 - .set r14,14 - .set r15,15 - .set r16,16 - .set r17,17 - .set r18,18 - .set r19,19 - .set r20,20 - .set r21,21 - .set r22,22 - .set r23,23 - .set r24,24 - .set r25,25 - .set r26,26 - .set r27,27 - .set r28,28 - .set r29,29 - .set r30,30 - .set r31,31 - .set f0,0 - .set f1,1 - .set f2,2 - .set f3,3 - .set f4,4 - .set f5,5 - .set f6,6 - .set f7,7 - .set f8,8 - .set f9,9 - .set f10,10 - .set f11,11 - .set f12,12 - .set f13,13 - .set f14,14 - .set f15,15 - .set f16,16 - .set f17,17 - .set f18,18 - .set f19,19 - .set f20,20 - .set f21,21 - - .extern .ffi_closure_helper_DARWIN - .extern .ffi_go_closure_helper_DARWIN - -#define LIBFFI_ASM -#define JUMPTARGET(name) name -#define L(x) x - .file "aix_closure.S" - .toc -LC..60: - .tc L..60[TC],L..60 - .csect .text[PR] - .align 2 - -.csect .text[PR] - .align 2 - .globl ffi_closure_ASM - .globl .ffi_closure_ASM -.csect ffi_closure_ASM[DS] -ffi_closure_ASM: -#ifdef __64BIT__ - .llong .ffi_closure_ASM, TOC[tc0], 0 - .csect .text[PR] -.ffi_closure_ASM: - .function .ffi_closure_ASM,.ffi_closure_ASM,16,044,LFE..0-LFB..0 - .bf __LINE__ - .line 1 -LFB..0: -/* we want to build up an area for the parameters passed */ -/* in registers (both floating point and integer) */ - - /* we store gpr 3 to gpr 10 (aligned to 4) - in the parents outgoing area */ - std r3, 48+(0*8)(r1) - std r4, 48+(1*8)(r1) - std r5, 48+(2*8)(r1) - std r6, 48+(3*8)(r1) - mflr r0 - - std r7, 48+(4*8)(r1) - std r8, 48+(5*8)(r1) - std r9, 48+(6*8)(r1) - std r10, 48+(7*8)(r1) - std r0, 16(r1) /* save the return address */ -LCFI..0: - /* 48 Bytes (Linkage Area) */ - /* 64 Bytes (params) */ - /* 16 Bytes (result) */ - /* 104 Bytes (13*8 from FPR) */ - /* 8 Bytes (alignment) */ - /* 240 Bytes */ - - stdu r1, -240(r1) /* skip over caller save area - keep stack aligned to 16 */ -LCFI..1: - - /* next save fpr 1 to fpr 13 (aligned to 8) */ - stfd f1, 128+(0*8)(r1) - stfd f2, 128+(1*8)(r1) - stfd f3, 128+(2*8)(r1) - stfd f4, 128+(3*8)(r1) - stfd f5, 128+(4*8)(r1) - stfd f6, 128+(5*8)(r1) - stfd f7, 128+(6*8)(r1) - stfd f8, 128+(7*8)(r1) - stfd f9, 128+(8*8)(r1) - stfd f10, 128+(9*8)(r1) - stfd f11, 128+(10*8)(r1) - stfd f12, 128+(11*8)(r1) - stfd f13, 128+(12*8)(r1) - - /* set up registers for the routine that actually does the work */ - /* get the context pointer from the trampoline */ - mr r3, r11 - - /* now load up the pointer to the result storage */ - addi r4, r1, 112 - - /* now load up the pointer to the saved gpr registers */ - addi r5, r1, 288 - - /* now load up the pointer to the saved fpr registers */ - addi r6, r1, 128 - - /* make the call */ - bl .ffi_closure_helper_DARWIN - nop - -.Ldoneclosure: - - /* now r3 contains the return type */ - /* so use it to look up in a table */ - /* so we know how to deal with each type */ - - /* look up the proper starting point in table */ - /* by using return type as offset */ - lhz r3, 10(r3) /* load type from return type */ - ld r4, LC..60(2) /* get address of jump table */ - sldi r3, r3, 4 /* now multiply return type by 16 */ - ld r0, 240+16(r1) /* load return address */ - add r3, r3, r4 /* add contents of table to table address */ - mtctr r3 - bctr /* jump to it */ - -/* Each fragment must be exactly 16 bytes long (4 instructions). - Align to 16 byte boundary for cache and dispatch efficiency. */ - .align 4 - -L..60: -/* case FFI_TYPE_VOID */ - mtlr r0 - addi r1, r1, 240 - blr - nop - -/* case FFI_TYPE_INT */ - lwa r3, 112+4(r1) - mtlr r0 - addi r1, r1, 240 - blr - -/* case FFI_TYPE_FLOAT */ - lfs f1, 112+0(r1) - mtlr r0 - addi r1, r1, 240 - blr - -/* case FFI_TYPE_DOUBLE */ - lfd f1, 112+0(r1) - mtlr r0 - addi r1, r1, 240 - blr - -/* case FFI_TYPE_LONGDOUBLE */ - lfd f1, 112+0(r1) - mtlr r0 - lfd f2, 112+8(r1) - b L..finish - -/* case FFI_TYPE_UINT8 */ - lbz r3, 112+7(r1) - mtlr r0 - addi r1, r1, 240 - blr - -/* case FFI_TYPE_SINT8 */ - lbz r3, 112+7(r1) - mtlr r0 - extsb r3, r3 - b L..finish - -/* case FFI_TYPE_UINT16 */ - lhz r3, 112+6(r1) - mtlr r0 -L..finish: - addi r1, r1, 240 - blr - -/* case FFI_TYPE_SINT16 */ - lha r3, 112+6(r1) - mtlr r0 - addi r1, r1, 240 - blr - -/* case FFI_TYPE_UINT32 */ - lwz r3, 112+4(r1) - mtlr r0 - addi r1, r1, 240 - blr - -/* case FFI_TYPE_SINT32 */ - lwa r3, 112+4(r1) - mtlr r0 - addi r1, r1, 240 - blr - -/* case FFI_TYPE_UINT64 */ - ld r3, 112+0(r1) - mtlr r0 - addi r1, r1, 240 - blr - -/* case FFI_TYPE_SINT64 */ - ld r3, 112+0(r1) - mtlr r0 - addi r1, r1, 240 - blr - -/* case FFI_TYPE_STRUCT */ - mtlr r0 - addi r1, r1, 240 - blr - nop - -/* case FFI_TYPE_POINTER */ - ld r3, 112+0(r1) - mtlr r0 - addi r1, r1, 240 - blr -LFE..0: - -#else /* ! __64BIT__ */ - - .long .ffi_closure_ASM, TOC[tc0], 0 - .csect .text[PR] -.ffi_closure_ASM: - .function .ffi_closure_ASM,.ffi_closure_ASM,16,044,LFE..0-LFB..0 - .bf __LINE__ - .line 1 -LFB..0: -/* we want to build up an area for the parameters passed */ -/* in registers (both floating point and integer) */ - - /* we store gpr 3 to gpr 10 (aligned to 4) - in the parents outgoing area */ - stw r3, 24+(0*4)(r1) - stw r4, 24+(1*4)(r1) - stw r5, 24+(2*4)(r1) - stw r6, 24+(3*4)(r1) - mflr r0 - - stw r7, 24+(4*4)(r1) - stw r8, 24+(5*4)(r1) - stw r9, 24+(6*4)(r1) - stw r10, 24+(7*4)(r1) - stw r0, 8(r1) -LCFI..0: - /* 24 Bytes (Linkage Area) */ - /* 32 Bytes (params) */ - /* 16 Bytes (result) */ - /* 104 Bytes (13*8 from FPR) */ - /* 176 Bytes */ - - stwu r1, -176(r1) /* skip over caller save area - keep stack aligned to 16 */ -LCFI..1: - - /* next save fpr 1 to fpr 13 (aligned to 8) */ - stfd f1, 72+(0*8)(r1) - stfd f2, 72+(1*8)(r1) - stfd f3, 72+(2*8)(r1) - stfd f4, 72+(3*8)(r1) - stfd f5, 72+(4*8)(r1) - stfd f6, 72+(5*8)(r1) - stfd f7, 72+(6*8)(r1) - stfd f8, 72+(7*8)(r1) - stfd f9, 72+(8*8)(r1) - stfd f10, 72+(9*8)(r1) - stfd f11, 72+(10*8)(r1) - stfd f12, 72+(11*8)(r1) - stfd f13, 72+(12*8)(r1) - - /* set up registers for the routine that actually does the work */ - /* get the context pointer from the trampoline */ - mr r3, r11 - - /* now load up the pointer to the result storage */ - addi r4, r1, 56 - - /* now load up the pointer to the saved gpr registers */ - addi r5, r1, 200 - - /* now load up the pointer to the saved fpr registers */ - addi r6, r1, 72 - - /* make the call */ - bl .ffi_closure_helper_DARWIN - nop - -.Ldoneclosure: - - /* now r3 contains the return type */ - /* so use it to look up in a table */ - /* so we know how to deal with each type */ - - /* look up the proper starting point in table */ - /* by using return type as offset */ - lhz r3, 6(r3) /* load type from return type */ - lwz r4, LC..60(2) /* get address of jump table */ - slwi r3, r3, 4 /* now multiply return type by 16 */ - lwz r0, 176+8(r1) /* load return address */ - add r3, r3, r4 /* add contents of table to table address */ - mtctr r3 - bctr /* jump to it */ - -/* Each fragment must be exactly 16 bytes long (4 instructions). - Align to 16 byte boundary for cache and dispatch efficiency. */ - .align 4 - -L..60: -/* case FFI_TYPE_VOID */ - mtlr r0 - addi r1, r1, 176 - blr - nop - -/* case FFI_TYPE_INT */ - lwz r3, 56+0(r1) - mtlr r0 - addi r1, r1, 176 - blr - -/* case FFI_TYPE_FLOAT */ - lfs f1, 56+0(r1) - mtlr r0 - addi r1, r1, 176 - blr - -/* case FFI_TYPE_DOUBLE */ - lfd f1, 56+0(r1) - mtlr r0 - addi r1, r1, 176 - blr - -/* case FFI_TYPE_LONGDOUBLE */ - lfd f1, 56+0(r1) - mtlr r0 - lfd f2, 56+8(r1) - b L..finish - -/* case FFI_TYPE_UINT8 */ - lbz r3, 56+3(r1) - mtlr r0 - addi r1, r1, 176 - blr - -/* case FFI_TYPE_SINT8 */ - lbz r3, 56+3(r1) - mtlr r0 - extsb r3, r3 - b L..finish - -/* case FFI_TYPE_UINT16 */ - lhz r3, 56+2(r1) - mtlr r0 - addi r1, r1, 176 - blr - -/* case FFI_TYPE_SINT16 */ - lha r3, 56+2(r1) - mtlr r0 - addi r1, r1, 176 - blr - -/* case FFI_TYPE_UINT32 */ - lwz r3, 56+0(r1) - mtlr r0 - addi r1, r1, 176 - blr - -/* case FFI_TYPE_SINT32 */ - lwz r3, 56+0(r1) - mtlr r0 - addi r1, r1, 176 - blr - -/* case FFI_TYPE_UINT64 */ - lwz r3, 56+0(r1) - mtlr r0 - lwz r4, 56+4(r1) - b L..finish - -/* case FFI_TYPE_SINT64 */ - lwz r3, 56+0(r1) - mtlr r0 - lwz r4, 56+4(r1) - b L..finish - -/* case FFI_TYPE_STRUCT */ - mtlr r0 - addi r1, r1, 176 - blr - nop - -/* case FFI_TYPE_POINTER */ - lwz r3, 56+0(r1) - mtlr r0 -L..finish: - addi r1, r1, 176 - blr -LFE..0: -#endif - .ef __LINE__ -/* END(ffi_closure_ASM) */ - - -.csect .text[PR] - .align 2 - .globl ffi_go_closure_ASM - .globl .ffi_go_closure_ASM -.csect ffi_go_closure_ASM[DS] -ffi_go_closure_ASM: -#ifdef __64BIT__ - .llong .ffi_go_closure_ASM, TOC[tc0], 0 - .csect .text[PR] -.ffi_go_closure_ASM: - .function .ffi_go_closure_ASM,.ffi_go_closure_ASM,16,044,LFE..1-LFB..1 - .bf __LINE__ - .line 1 -LFB..1: -/* we want to build up an area for the parameters passed */ -/* in registers (both floating point and integer) */ - - /* we store gpr 3 to gpr 10 (aligned to 4) - in the parents outgoing area */ - std r3, 48+(0*8)(r1) - std r4, 48+(1*8)(r1) - std r5, 48+(2*8)(r1) - std r6, 48+(3*8)(r1) - mflr r0 - - std r7, 48+(4*8)(r1) - std r8, 48+(5*8)(r1) - std r9, 48+(6*8)(r1) - std r10, 48+(7*8)(r1) - std r0, 16(r1) /* save the return address */ -LCFI..2: - /* 48 Bytes (Linkage Area) */ - /* 64 Bytes (params) */ - /* 16 Bytes (result) */ - /* 104 Bytes (13*8 from FPR) */ - /* 8 Bytes (alignment) */ - /* 240 Bytes */ - - stdu r1, -240(r1) /* skip over caller save area - keep stack aligned to 16 */ -LCFI..3: - - /* next save fpr 1 to fpr 13 (aligned to 8) */ - stfd f1, 128+(0*8)(r1) - stfd f2, 128+(1*8)(r1) - stfd f3, 128+(2*8)(r1) - stfd f4, 128+(3*8)(r1) - stfd f5, 128+(4*8)(r1) - stfd f6, 128+(5*8)(r1) - stfd f7, 128+(6*8)(r1) - stfd f8, 128+(7*8)(r1) - stfd f9, 128+(8*8)(r1) - stfd f10, 128+(9*8)(r1) - stfd f11, 128+(10*8)(r1) - stfd f12, 128+(11*8)(r1) - stfd f13, 128+(12*8)(r1) - - /* set up registers for the routine that actually does the work */ - mr r3, r11 /* go closure */ - - /* now load up the pointer to the result storage */ - addi r4, r1, 112 - - /* now load up the pointer to the saved gpr registers */ - addi r5, r1, 288 - - /* now load up the pointer to the saved fpr registers */ - addi r6, r1, 128 - - /* make the call */ - bl .ffi_go_closure_helper_DARWIN - nop - - b .Ldoneclosure -LFE..1: - -#else /* ! __64BIT__ */ - - .long .ffi_go_closure_ASM, TOC[tc0], 0 - .csect .text[PR] -.ffi_go_closure_ASM: - .function .ffi_go_closure_ASM,.ffi_go_closure_ASM,16,044,LFE..1-LFB..1 - .bf __LINE__ - .line 1 -LFB..1: -/* we want to build up an area for the parameters passed */ -/* in registers (both floating point and integer) */ - - /* we store gpr 3 to gpr 10 (aligned to 4) - in the parents outgoing area */ - stw r3, 24+(0*4)(r1) - stw r4, 24+(1*4)(r1) - stw r5, 24+(2*4)(r1) - stw r6, 24+(3*4)(r1) - mflr r0 - - stw r7, 24+(4*4)(r1) - stw r8, 24+(5*4)(r1) - stw r9, 24+(6*4)(r1) - stw r10, 24+(7*4)(r1) - stw r0, 8(r1) -LCFI..2: - /* 24 Bytes (Linkage Area) */ - /* 32 Bytes (params) */ - /* 16 Bytes (result) */ - /* 104 Bytes (13*8 from FPR) */ - /* 176 Bytes */ - - stwu r1, -176(r1) /* skip over caller save area - keep stack aligned to 16 */ -LCFI..3: - - /* next save fpr 1 to fpr 13 (aligned to 8) */ - stfd f1, 72+(0*8)(r1) - stfd f2, 72+(1*8)(r1) - stfd f3, 72+(2*8)(r1) - stfd f4, 72+(3*8)(r1) - stfd f5, 72+(4*8)(r1) - stfd f6, 72+(5*8)(r1) - stfd f7, 72+(6*8)(r1) - stfd f8, 72+(7*8)(r1) - stfd f9, 72+(8*8)(r1) - stfd f10, 72+(9*8)(r1) - stfd f11, 72+(10*8)(r1) - stfd f12, 72+(11*8)(r1) - stfd f13, 72+(12*8)(r1) - - /* set up registers for the routine that actually does the work */ - mr r3, 11 /* go closure */ - - /* now load up the pointer to the result storage */ - addi r4, r1, 56 - - /* now load up the pointer to the saved gpr registers */ - addi r5, r1, 200 - - /* now load up the pointer to the saved fpr registers */ - addi r6, r1, 72 - - /* make the call */ - bl .ffi_go_closure_helper_DARWIN - nop - - b .Ldoneclosure -LFE..1: -#endif - .ef __LINE__ -/* END(ffi_go_closure_ASM) */ - -/* EH frame stuff. */ - -#define LR_REGNO 0x41 /* Link Register (65), see rs6000.md */ -#ifdef __64BIT__ -#define PTRSIZE 8 -#define LOG2_PTRSIZE 3 -#define CFA_OFFSET 0xf0,0x01 /* LEB128 240 */ -#define FDE_ENCODING 0x1c /* DW_EH_PE_pcrel|DW_EH_PE_sdata8 */ -#define EH_DATA_ALIGN_FACT 0x78 /* LEB128 -8 */ -#else -#define PTRSIZE 4 -#define LOG2_PTRSIZE 2 -#define CFA_OFFSET 0xb0,0x01 /* LEB128 176 */ -#define FDE_ENCODING 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4 */ -#define EH_DATA_ALIGN_FACT 0x7c /* LEB128 -4 */ -#endif - - .csect _unwind.ro_[RO],4 - .align LOG2_PTRSIZE - .globl _GLOBAL__F_libffi_src_powerpc_aix_closure -_GLOBAL__F_libffi_src_powerpc_aix_closure: -Lframe..1: - .vbyte 4,LECIE..1-LSCIE..1 /* CIE Length */ -LSCIE..1: - .vbyte 4,0 /* CIE Identifier Tag */ - .byte 0x3 /* CIE Version */ - .byte "zR" /* CIE Augmentation */ - .byte 0 - .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ - .byte EH_DATA_ALIGN_FACT /* leb128 -4/-8; CIE Data Alignment Factor */ - .byte LR_REGNO /* CIE RA Column */ - .byte 0x1 /* uleb128 0x1; Augmentation size */ - .byte FDE_ENCODING /* FDE Encoding (pcrel|sdata4/8) */ - .byte 0xc /* DW_CFA_def_cfa */ - .byte 0x1 /* uleb128 0x1; Register r1 */ - .byte 0 /* uleb128 0x0; Offset 0 */ - .align LOG2_PTRSIZE -LECIE..1: -LSFDE..1: - .vbyte 4,LEFDE..1-LASFDE..1 /* FDE Length */ -LASFDE..1: - .vbyte 4,LASFDE..1-Lframe..1 /* FDE CIE offset */ - .vbyte PTRSIZE,LFB..0-$ /* FDE initial location */ - .vbyte PTRSIZE,LFE..0-LFB..0 /* FDE address range */ - .byte 0 /* uleb128 0x0; Augmentation size */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .vbyte 4,LCFI..1-LCFI..0 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte CFA_OFFSET /* uleb128 176/240 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .vbyte 4,LCFI..0-LFB..0 - .byte 0x11 /* DW_CFA_offset_extended_sf */ - .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */ - .byte 0x7e /* leb128 -2; Offset -2 (8/16) */ - .align LOG2_PTRSIZE -LEFDE..1: -LSFDE..2: - .vbyte 4,LEFDE..2-LASFDE..2 /* FDE Length */ -LASFDE..2: - .vbyte 4,LASFDE..2-Lframe..1 /* FDE CIE offset */ - .vbyte PTRSIZE,LFB..1-$ /* FDE initial location */ - .vbyte PTRSIZE,LFE..1-LFB..1 /* FDE address range */ - .byte 0 /* uleb128 0x0; Augmentation size */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .vbyte 4,LCFI..3-LCFI..2 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte CFA_OFFSET /* uleb128 176/240 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .vbyte 4,LCFI..2-LFB..1 - .byte 0x11 /* DW_CFA_offset_extended_sf */ - .byte LR_REGNO /* uleb128 LR_REGNO; Register LR */ - .byte 0x7e /* leb128 -2; Offset -2 (8/16) */ - .align LOG2_PTRSIZE -LEFDE..2: - .vbyte 4,0 /* End of FDEs */ - - .csect .text[PR] - .ref _GLOBAL__F_libffi_src_powerpc_aix_closure /* Prevents garbage collection by AIX linker */ - diff --git a/deps/libffi/src/powerpc/asm.h b/deps/libffi/src/powerpc/asm.h deleted file mode 100644 index 27b22f670a2328..00000000000000 --- a/deps/libffi/src/powerpc/asm.h +++ /dev/null @@ -1,125 +0,0 @@ -/* ----------------------------------------------------------------------- - asm.h - Copyright (c) 1998 Geoffrey Keating - - PowerPC Assembly glue. - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#define ASM_GLOBAL_DIRECTIVE .globl - - -#define C_SYMBOL_NAME(name) name -/* Macro for a label. */ -#ifdef __STDC__ -#define C_LABEL(name) name##: -#else -#define C_LABEL(name) name/**/: -#endif - -/* This seems to always be the case on PPC. */ -#define ALIGNARG(log2) log2 -/* For ELF we need the `.type' directive to make shared libs work right. */ -#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg; -#define ASM_SIZE_DIRECTIVE(name) .size name,.-name - -/* If compiled for profiling, call `_mcount' at the start of each function. */ -#ifdef PROF -/* The mcount code relies on the return address being on the stack - to locate our caller and so it can restore it; so store one just - for its benefit. */ -#ifdef PIC -#define CALL_MCOUNT \ - .pushsection; \ - .section ".data"; \ - .align ALIGNARG(2); \ -0:.long 0; \ - .previous; \ - mflr %r0; \ - stw %r0,4(%r1); \ - bl _GLOBAL_OFFSET_TABLE_@local-4; \ - mflr %r11; \ - lwz %r0,0b@got(%r11); \ - bl JUMPTARGET(_mcount); -#else /* PIC */ -#define CALL_MCOUNT \ - .section ".data"; \ - .align ALIGNARG(2); \ -0:.long 0; \ - .previous; \ - mflr %r0; \ - lis %r11,0b@ha; \ - stw %r0,4(%r1); \ - addi %r0,%r11,0b@l; \ - bl JUMPTARGET(_mcount); -#endif /* PIC */ -#else /* PROF */ -#define CALL_MCOUNT /* Do nothing. */ -#endif /* PROF */ - -#define ENTRY(name) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ - ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ - .align ALIGNARG(2); \ - C_LABEL(name) \ - CALL_MCOUNT - -#define EALIGN_W_0 /* No words to insert. */ -#define EALIGN_W_1 nop -#define EALIGN_W_2 nop;nop -#define EALIGN_W_3 nop;nop;nop -#define EALIGN_W_4 EALIGN_W_3;nop -#define EALIGN_W_5 EALIGN_W_4;nop -#define EALIGN_W_6 EALIGN_W_5;nop -#define EALIGN_W_7 EALIGN_W_6;nop - -/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes - past a 2^align boundary. */ -#ifdef PROF -#define EFFI_ALIGN(name, alignt, words) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ - ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ - .align ALIGNARG(2); \ - C_LABEL(name) \ - CALL_MCOUNT \ - b 0f; \ - .align ALIGNARG(alignt); \ - EALIGN_W_##words; \ - 0: -#else /* PROF */ -#define EFFI_ALIGN(name, alignt, words) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ - ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ - .align ALIGNARG(alignt); \ - EALIGN_W_##words; \ - C_LABEL(name) -#endif - -#define END(name) \ - ASM_SIZE_DIRECTIVE(name) - -#ifdef PIC -#define JUMPTARGET(name) name##@plt -#else -#define JUMPTARGET(name) name -#endif - -/* Local labels stripped out by the linker. */ -#define L(x) .L##x diff --git a/deps/libffi/src/powerpc/darwin.S b/deps/libffi/src/powerpc/darwin.S deleted file mode 100644 index 066eb82efe9381..00000000000000 --- a/deps/libffi/src/powerpc/darwin.S +++ /dev/null @@ -1,378 +0,0 @@ -/* ----------------------------------------------------------------------- - darwin.S - Copyright (c) 2000 John Hornkvist - Copyright (c) 2004, 2010 Free Software Foundation, Inc. - - PowerPC Assembly glue. - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#if defined(__ppc64__) -#define MODE_CHOICE(x, y) y -#else -#define MODE_CHOICE(x, y) x -#endif - -#define machine_choice MODE_CHOICE(ppc7400,ppc64) - -; Define some pseudo-opcodes for size-independent load & store of GPRs ... -#define lgu MODE_CHOICE(lwzu, ldu) -#define lg MODE_CHOICE(lwz,ld) -#define sg MODE_CHOICE(stw,std) -#define sgu MODE_CHOICE(stwu,stdu) -#define sgux MODE_CHOICE(stwux,stdux) - -; ... and the size of GPRs and their storage indicator. -#define GPR_BYTES MODE_CHOICE(4,8) -#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ -#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ - -; From the ABI doc: "Mac OS X ABI Function Call Guide" Version 2009-02-04. -#define LINKAGE_SIZE MODE_CHOICE(24,48) -#define PARAM_AREA MODE_CHOICE(32,64) -#define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* save position for lr */ - -/* If there is any FP stuff we make space for all of the regs. */ -#define SAVED_FPR_COUNT 13 -#define FPR_SIZE 8 -#define RESULT_BYTES 16 - -/* This should be kept in step with the same value in ffi_darwin.c. */ -#define ASM_NEEDS_REGISTERS 4 -#define SAVE_REGS_SIZE (ASM_NEEDS_REGISTERS * GPR_BYTES) - -#include -#include - -#define JUMPTARGET(name) name -#define L(x) x - - .text - .align 2 - .globl _ffi_prep_args - - .align 2 - .globl _ffi_call_DARWIN - - /* We arrive here with: - r3 = ptr to extended cif. - r4 = -bytes. - r5 = cif flags. - r6 = ptr to return value. - r7 = fn pointer (user func). - r8 = fn pointer (ffi_prep_args). - r9 = ffi_type* for the ret val. */ - -_ffi_call_DARWIN: -Lstartcode: - mr r12,r8 /* We only need r12 until the call, - so it does not have to be saved. */ -LFB1: - /* Save the old stack pointer as AP. */ - mr r8,r1 -LCFI0: - - /* Save the retval type in parents frame. */ - sg r9,(LINKAGE_SIZE+6*GPR_BYTES)(r8) - - /* Allocate the stack space we need. */ - sgux r1,r1,r4 - - /* Save registers we use. */ - mflr r9 - sg r9,SAVED_LR_OFFSET(r8) - - sg r28,-(4 * GPR_BYTES)(r8) - sg r29,-(3 * GPR_BYTES)(r8) - sg r30,-(2 * GPR_BYTES)(r8) - sg r31,-( GPR_BYTES)(r8) - -#if !defined(POWERPC_DARWIN) - /* The TOC slot is reserved in the Darwin ABI and r2 is volatile. */ - sg r2,(5 * GPR_BYTES)(r1) -#endif - -LCFI1: - - /* Save arguments over call. */ - mr r31,r5 /* flags, */ - mr r30,r6 /* rvalue, */ - mr r29,r7 /* function address, */ - mr r28,r8 /* our AP. */ -LCFI2: - /* Call ffi_prep_args. r3 = extended cif, r4 = stack ptr copy. */ - mr r4,r1 - li r9,0 - - mtctr r12 /* r12 holds address of _ffi_prep_args. */ - bctrl - -#if !defined(POWERPC_DARWIN) - /* The TOC slot is reserved in the Darwin ABI and r2 is volatile. */ - lg r2,(5 * GPR_BYTES)(r1) -#endif - /* Now do the call. - Set up cr1 with bits 4-7 of the flags. */ - mtcrf 0x40,r31 - /* Get the address to call into CTR. */ - mtctr r29 - /* Load all those argument registers. - We have set up a nice stack frame, just load it into registers. */ - lg r3, (LINKAGE_SIZE )(r1) - lg r4, (LINKAGE_SIZE + GPR_BYTES)(r1) - lg r5, (LINKAGE_SIZE + 2 * GPR_BYTES)(r1) - lg r6, (LINKAGE_SIZE + 3 * GPR_BYTES)(r1) - nop - lg r7, (LINKAGE_SIZE + 4 * GPR_BYTES)(r1) - lg r8, (LINKAGE_SIZE + 5 * GPR_BYTES)(r1) - lg r9, (LINKAGE_SIZE + 6 * GPR_BYTES)(r1) - lg r10,(LINKAGE_SIZE + 7 * GPR_BYTES)(r1) - -L1: - /* ... Load all the FP registers. */ - bf 6,L2 /* No floats to load. */ - lfd f1, -SAVE_REGS_SIZE-(13*FPR_SIZE)(r28) - lfd f2, -SAVE_REGS_SIZE-(12*FPR_SIZE)(r28) - lfd f3, -SAVE_REGS_SIZE-(11*FPR_SIZE)(r28) - lfd f4, -SAVE_REGS_SIZE-(10*FPR_SIZE)(r28) - nop - lfd f5, -SAVE_REGS_SIZE-( 9*FPR_SIZE)(r28) - lfd f6, -SAVE_REGS_SIZE-( 8*FPR_SIZE)(r28) - lfd f7, -SAVE_REGS_SIZE-( 7*FPR_SIZE)(r28) - lfd f8, -SAVE_REGS_SIZE-( 6*FPR_SIZE)(r28) - nop - lfd f9, -SAVE_REGS_SIZE-( 5*FPR_SIZE)(r28) - lfd f10,-SAVE_REGS_SIZE-( 4*FPR_SIZE)(r28) - lfd f11,-SAVE_REGS_SIZE-( 3*FPR_SIZE)(r28) - lfd f12,-SAVE_REGS_SIZE-( 2*FPR_SIZE)(r28) - nop - lfd f13,-SAVE_REGS_SIZE-( 1*FPR_SIZE)(r28) - -L2: - mr r12,r29 /* Put the target address in r12 as specified. */ - mtctr r12 - nop - nop - - /* Make the call. */ - bctrl - - /* Now, deal with the return value. */ - - /* m64 structure returns can occupy the same set of registers as - would be used to pass such a structure as arg0 - so take care - not to step on any possibly hot regs. */ - - /* Get the flags.. */ - mtcrf 0x03,r31 ; we need c6 & cr7 now. - ; FLAG_RETURNS_NOTHING also covers struct ret-by-ref. - bt 30,L(done_return_value) ; FLAG_RETURNS_NOTHING - bf 27,L(scalar_return_value) ; not FLAG_RETURNS_STRUCT - - /* OK, so we have a struct. */ -#if defined(__ppc64__) - bt 31,L(maybe_return_128) ; FLAG_RETURNS_128BITS, special case - - /* OK, we have to map the return back to a mem struct. - We are about to trample the parents param area, so recover the - return type. r29 is free, since the call is done. */ - lg r29,(LINKAGE_SIZE + 6 * GPR_BYTES)(r28) - - sg r3, (LINKAGE_SIZE )(r28) - sg r4, (LINKAGE_SIZE + GPR_BYTES)(r28) - sg r5, (LINKAGE_SIZE + 2 * GPR_BYTES)(r28) - sg r6, (LINKAGE_SIZE + 3 * GPR_BYTES)(r28) - nop - sg r7, (LINKAGE_SIZE + 4 * GPR_BYTES)(r28) - sg r8, (LINKAGE_SIZE + 5 * GPR_BYTES)(r28) - sg r9, (LINKAGE_SIZE + 6 * GPR_BYTES)(r28) - sg r10,(LINKAGE_SIZE + 7 * GPR_BYTES)(r28) - /* OK, so do the block move - we trust that memcpy will not trample - the fprs... */ - mr r3,r30 ; dest - addi r4,r28,LINKAGE_SIZE ; source - /* The size is a size_t, should be long. */ - lg r5,0(r29) - /* Figure out small structs */ - cmpi 0,r5,4 - bgt L3 ; 1, 2 and 4 bytes have special rules. - cmpi 0,r5,3 - beq L3 ; not 3 - addi r4,r4,8 - subf r4,r5,r4 -L3: - bl _memcpy - - /* ... do we need the FP registers? - recover the flags.. */ - mtcrf 0x03,r31 ; we need c6 & cr7 now. - bf 29,L(done_return_value) /* No floats in the struct. */ - stfd f1, -SAVE_REGS_SIZE-(13*FPR_SIZE)(r28) - stfd f2, -SAVE_REGS_SIZE-(12*FPR_SIZE)(r28) - stfd f3, -SAVE_REGS_SIZE-(11*FPR_SIZE)(r28) - stfd f4, -SAVE_REGS_SIZE-(10*FPR_SIZE)(r28) - nop - stfd f5, -SAVE_REGS_SIZE-( 9*FPR_SIZE)(r28) - stfd f6, -SAVE_REGS_SIZE-( 8*FPR_SIZE)(r28) - stfd f7, -SAVE_REGS_SIZE-( 7*FPR_SIZE)(r28) - stfd f8, -SAVE_REGS_SIZE-( 6*FPR_SIZE)(r28) - nop - stfd f9, -SAVE_REGS_SIZE-( 5*FPR_SIZE)(r28) - stfd f10,-SAVE_REGS_SIZE-( 4*FPR_SIZE)(r28) - stfd f11,-SAVE_REGS_SIZE-( 3*FPR_SIZE)(r28) - stfd f12,-SAVE_REGS_SIZE-( 2*FPR_SIZE)(r28) - nop - stfd f13,-SAVE_REGS_SIZE-( 1*FPR_SIZE)(r28) - - mr r3,r29 ; ffi_type * - mr r4,r30 ; dest - addi r5,r28,-SAVE_REGS_SIZE-(13*FPR_SIZE) ; fprs - xor r6,r6,r6 - sg r6,(LINKAGE_SIZE + 7 * GPR_BYTES)(r28) - addi r6,r28,(LINKAGE_SIZE + 7 * GPR_BYTES) ; point to a zeroed counter. - bl _darwin64_struct_floats_to_mem - - b L(done_return_value) -#else - stw r3,0(r30) ; m32 the only struct return in reg is 4 bytes. -#endif - b L(done_return_value) - -L(fp_return_value): - /* Do we have long double to store? */ - bf 31,L(fd_return_value) ; FLAG_RETURNS_128BITS - stfd f1,0(r30) - stfd f2,FPR_SIZE(r30) - b L(done_return_value) - -L(fd_return_value): - /* Do we have double to store? */ - bf 28,L(float_return_value) - stfd f1,0(r30) - b L(done_return_value) - -L(float_return_value): - /* We only have a float to store. */ - stfs f1,0(r30) - b L(done_return_value) - -L(scalar_return_value): - bt 29,L(fp_return_value) ; FLAG_RETURNS_FP - ; ffi_arg is defined as unsigned long. - sg r3,0(r30) ; Save the reg. - bf 28,L(done_return_value) ; not FLAG_RETURNS_64BITS - -#if defined(__ppc64__) -L(maybe_return_128): - std r3,0(r30) - bf 31,L(done_return_value) ; not FLAG_RETURNS_128BITS - std r4,8(r30) -#else - stw r4,4(r30) -#endif - - /* Fall through. */ - /* We want this at the end to simplify eh epilog computation. */ - -L(done_return_value): - /* Restore the registers we used and return. */ - lg r29,SAVED_LR_OFFSET(r28) - ; epilog - lg r31,-(1 * GPR_BYTES)(r28) - mtlr r29 - lg r30,-(2 * GPR_BYTES)(r28) - lg r29,-(3 * GPR_BYTES)(r28) - lg r28,-(4 * GPR_BYTES)(r28) - lg r1,0(r1) - blr -LFE1: - .align 1 -/* END(_ffi_call_DARWIN) */ - -/* Provide a null definition of _ffi_call_AIX. */ - .text - .globl _ffi_call_AIX - .align 2 -_ffi_call_AIX: - blr -/* END(_ffi_call_AIX) */ - -/* EH stuff. */ - -#define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78) - - .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support -EH_frame1: - .set L$set$0,LECIE1-LSCIE1 - .long L$set$0 ; Length of Common Information Entry -LSCIE1: - .long 0x0 ; CIE Identifier Tag - .byte 0x1 ; CIE Version - .ascii "zR\0" ; CIE Augmentation - .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor - .byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor - .byte 0x41 ; CIE RA Column - .byte 0x1 ; uleb128 0x1; Augmentation size - .byte 0x10 ; FDE Encoding (pcrel) - .byte 0xc ; DW_CFA_def_cfa - .byte 0x1 ; uleb128 0x1 - .byte 0x0 ; uleb128 0x0 - .align LOG2_GPR_BYTES -LECIE1: - - .globl _ffi_call_DARWIN.eh -_ffi_call_DARWIN.eh: -LSFDE1: - .set L$set$1,LEFDE1-LASFDE1 - .long L$set$1 ; FDE Length -LASFDE1: - .long LASFDE1-EH_frame1 ; FDE CIE offset - .g_long Lstartcode-. ; FDE initial location - .set L$set$3,LFE1-Lstartcode - .g_long L$set$3 ; FDE address range - .byte 0x0 ; uleb128 0x0; Augmentation size - .byte 0x4 ; DW_CFA_advance_loc4 - .set L$set$4,LCFI0-Lstartcode - .long L$set$4 - .byte 0xd ; DW_CFA_def_cfa_register - .byte 0x08 ; uleb128 0x08 - .byte 0x4 ; DW_CFA_advance_loc4 - .set L$set$5,LCFI1-LCFI0 - .long L$set$5 - .byte 0x11 ; DW_CFA_offset_extended_sf - .byte 0x41 ; uleb128 0x41 - .byte 0x7e ; sleb128 -2 - .byte 0x9f ; DW_CFA_offset, column 0x1f - .byte 0x1 ; uleb128 0x1 - .byte 0x9e ; DW_CFA_offset, column 0x1e - .byte 0x2 ; uleb128 0x2 - .byte 0x9d ; DW_CFA_offset, column 0x1d - .byte 0x3 ; uleb128 0x3 - .byte 0x9c ; DW_CFA_offset, column 0x1c - .byte 0x4 ; uleb128 0x4 - .byte 0x4 ; DW_CFA_advance_loc4 - .set L$set$6,LCFI2-LCFI1 - .long L$set$6 - .byte 0xd ; DW_CFA_def_cfa_register - .byte 0x1c ; uleb128 0x1c - .align LOG2_GPR_BYTES -LEFDE1: - .align 1 - diff --git a/deps/libffi/src/powerpc/darwin_closure.S b/deps/libffi/src/powerpc/darwin_closure.S deleted file mode 100644 index 3121e6ac26d319..00000000000000 --- a/deps/libffi/src/powerpc/darwin_closure.S +++ /dev/null @@ -1,571 +0,0 @@ -/* ----------------------------------------------------------------------- - darwin_closure.S - Copyright (c) 2002, 2003, 2004, 2010, - Free Software Foundation, Inc. - based on ppc_closure.S - - PowerPC Assembly glue. - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#define L(x) x - -#if defined(__ppc64__) -#define MODE_CHOICE(x, y) y -#else -#define MODE_CHOICE(x, y) x -#endif - -#define machine_choice MODE_CHOICE(ppc7400,ppc64) - -; Define some pseudo-opcodes for size-independent load & store of GPRs ... -#define lgu MODE_CHOICE(lwzu, ldu) -#define lg MODE_CHOICE(lwz,ld) -#define sg MODE_CHOICE(stw,std) -#define sgu MODE_CHOICE(stwu,stdu) - -; ... and the size of GPRs and their storage indicator. -#define GPR_BYTES MODE_CHOICE(4,8) -#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ -#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ - -; From the ABI doc: "Mac OS X ABI Function Call Guide" Version 2009-02-04. -#define LINKAGE_SIZE MODE_CHOICE(24,48) -#define PARAM_AREA MODE_CHOICE(32,64) - -#define SAVED_CR_OFFSET MODE_CHOICE(4,8) /* save position for CR */ -#define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* save position for lr */ - -/* WARNING: if ffi_type is changed... here be monsters. - Offsets of items within the result type. */ -#define FFI_TYPE_TYPE MODE_CHOICE(6,10) -#define FFI_TYPE_ELEM MODE_CHOICE(8,16) - -#define SAVED_FPR_COUNT 13 -#define FPR_SIZE 8 -/* biggest m64 struct ret is 8GPRS + 13FPRS = 168 bytes - rounded to 16bytes = 176. */ -#define RESULT_BYTES MODE_CHOICE(16,176) - -; The whole stack frame **MUST** be 16byte-aligned. -#define SAVE_SIZE (((LINKAGE_SIZE+PARAM_AREA+SAVED_FPR_COUNT*FPR_SIZE+RESULT_BYTES)+15) & -16LL) -#define PAD_SIZE (SAVE_SIZE-(LINKAGE_SIZE+PARAM_AREA+SAVED_FPR_COUNT*FPR_SIZE+RESULT_BYTES)) - -#define PARENT_PARM_BASE (SAVE_SIZE+LINKAGE_SIZE) -#define FP_SAVE_BASE (LINKAGE_SIZE+PARAM_AREA) - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 -; We no longer need the pic symbol stub for Darwin >= 9. -#define BLCLS_HELP _ffi_closure_helper_DARWIN -#define STRUCT_RETVALUE_P _darwin64_struct_ret_by_value_p -#define PASS_STR_FLOATS _darwin64_pass_struct_floats -#undef WANT_STUB -#else -#define BLCLS_HELP L_ffi_closure_helper_DARWIN$stub -#define STRUCT_RETVALUE_P L_darwin64_struct_ret_by_value_p$stub -#define PASS_STR_FLOATS L_darwin64_pass_struct_floats$stub -#define WANT_STUB -#endif - -/* m32/m64 - - The stack layout looks like this: - - | Additional params... | | Higher address - ~ ~ ~ - | Parameters (at least 8*4/8=32/64) | | NUM_GPR_ARG_REGISTERS - |--------------------------------------------| | - | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | - |--------------------------------------------| | - | Reserved 2*4/8 | | - |--------------------------------------------| | - | Space for callee`s LR 4/8 | | - |--------------------------------------------| | - | Saved CR [low word for m64] 4/8 | | - |--------------------------------------------| | - | Current backchain pointer 4/8 |-/ Parent`s frame. - |--------------------------------------------| <+ <<< on entry to - | Result Bytes 16/176 | | - |--------------------------------------------| | - ~ padding to 16-byte alignment ~ ~ - |--------------------------------------------| | - | NUM_FPR_ARG_REGISTERS slots | | - | here fp13 .. fp1 13*8 | | - |--------------------------------------------| | - | R3..R10 8*4/8=32/64 | | NUM_GPR_ARG_REGISTERS - |--------------------------------------------| | - | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | - |--------------------------------------------| | stack | - | Reserved [compiler,binder] 2*4/8 | | grows | - |--------------------------------------------| | down V - | Space for callees LR 4/8 | | - |--------------------------------------------| | lower addresses - | Saved CR [low word for m64] 4/8 | | - |--------------------------------------------| | stack pointer here - | Current backchain pointer 4/8 |-/ during - |--------------------------------------------| <<< call. - -*/ - - .file "darwin_closure.S" - - .machine machine_choice - - .text - .globl _ffi_closure_ASM - .align LOG2_GPR_BYTES -_ffi_closure_ASM: -LFB1: -Lstartcode: - mflr r0 /* extract return address */ - sg r0,SAVED_LR_OFFSET(r1) /* save the return address */ -LCFI0: - sgu r1,-SAVE_SIZE(r1) /* skip over caller save area - keep stack aligned to 16. */ -LCFI1: - /* We want to build up an area for the parameters passed - in registers. (both floating point and integer) */ - - /* Put gpr 3 to gpr 10 in the parents outgoing area... - ... the remainder of any params that overflowed the regs will - follow here. */ - sg r3, (PARENT_PARM_BASE )(r1) - sg r4, (PARENT_PARM_BASE + GPR_BYTES )(r1) - sg r5, (PARENT_PARM_BASE + GPR_BYTES * 2)(r1) - sg r6, (PARENT_PARM_BASE + GPR_BYTES * 3)(r1) - sg r7, (PARENT_PARM_BASE + GPR_BYTES * 4)(r1) - sg r8, (PARENT_PARM_BASE + GPR_BYTES * 5)(r1) - sg r9, (PARENT_PARM_BASE + GPR_BYTES * 6)(r1) - sg r10,(PARENT_PARM_BASE + GPR_BYTES * 7)(r1) - - /* We save fpr 1 to fpr 14 in our own save frame. */ - stfd f1, (FP_SAVE_BASE )(r1) - stfd f2, (FP_SAVE_BASE + FPR_SIZE )(r1) - stfd f3, (FP_SAVE_BASE + FPR_SIZE * 2 )(r1) - stfd f4, (FP_SAVE_BASE + FPR_SIZE * 3 )(r1) - stfd f5, (FP_SAVE_BASE + FPR_SIZE * 4 )(r1) - stfd f6, (FP_SAVE_BASE + FPR_SIZE * 5 )(r1) - stfd f7, (FP_SAVE_BASE + FPR_SIZE * 6 )(r1) - stfd f8, (FP_SAVE_BASE + FPR_SIZE * 7 )(r1) - stfd f9, (FP_SAVE_BASE + FPR_SIZE * 8 )(r1) - stfd f10,(FP_SAVE_BASE + FPR_SIZE * 9 )(r1) - stfd f11,(FP_SAVE_BASE + FPR_SIZE * 10)(r1) - stfd f12,(FP_SAVE_BASE + FPR_SIZE * 11)(r1) - stfd f13,(FP_SAVE_BASE + FPR_SIZE * 12)(r1) - - /* Set up registers for the routine that actually does the work - get the context pointer from the trampoline. */ - mr r3,r11 - - /* Now load up the pointer to the result storage. */ - addi r4,r1,(SAVE_SIZE-RESULT_BYTES) - - /* Now load up the pointer to the saved gpr registers. */ - addi r5,r1,PARENT_PARM_BASE - - /* Now load up the pointer to the saved fpr registers. */ - addi r6,r1,FP_SAVE_BASE - - /* Make the call. */ - bl BLCLS_HELP - - /* r3 contains the rtype pointer... save it since we will need - it later. */ - sg r3,LINKAGE_SIZE(r1) ; ffi_type * result_type - lg r0,0(r3) ; size => r0 - lhz r3,FFI_TYPE_TYPE(r3) ; type => r3 - - /* The helper will have intercepted structure returns and inserted - the caller`s destination address for structs returned by ref. */ - - /* r3 contains the return type so use it to look up in a table - so we know how to deal with each type. */ - - addi r5,r1,(SAVE_SIZE-RESULT_BYTES) /* Otherwise, our return is here. */ - bl Lget_ret_type0_addr /* Get pointer to Lret_type0 into LR. */ - mflr r4 /* Move to r4. */ - slwi r3,r3,4 /* Now multiply return type by 16. */ - add r3,r3,r4 /* Add contents of table to table address. */ - mtctr r3 - bctr /* Jump to it. */ -LFE1: -/* Each of the ret_typeX code fragments has to be exactly 16 bytes long - (4 instructions). For cache effectiveness we align to a 16 byte boundary - first. */ - - .align 4 - - nop - nop - nop -Lget_ret_type0_addr: - blrl - -/* case FFI_TYPE_VOID */ -Lret_type0: - b Lfinish - nop - nop - nop - -/* case FFI_TYPE_INT */ -Lret_type1: - lg r3,0(r5) - b Lfinish - nop - nop - -/* case FFI_TYPE_FLOAT */ -Lret_type2: - lfs f1,0(r5) - b Lfinish - nop - nop - -/* case FFI_TYPE_DOUBLE */ -Lret_type3: - lfd f1,0(r5) - b Lfinish - nop - nop - -/* case FFI_TYPE_LONGDOUBLE */ -Lret_type4: - lfd f1,0(r5) - lfd f2,8(r5) - b Lfinish - nop - -/* case FFI_TYPE_UINT8 */ -Lret_type5: -#if defined(__ppc64__) - lbz r3,7(r5) -#else - lbz r3,3(r5) -#endif - b Lfinish - nop - nop - -/* case FFI_TYPE_SINT8 */ -Lret_type6: -#if defined(__ppc64__) - lbz r3,7(r5) -#else - lbz r3,3(r5) -#endif - extsb r3,r3 - b Lfinish - nop - -/* case FFI_TYPE_UINT16 */ -Lret_type7: -#if defined(__ppc64__) - lhz r3,6(r5) -#else - lhz r3,2(r5) -#endif - b Lfinish - nop - nop - -/* case FFI_TYPE_SINT16 */ -Lret_type8: -#if defined(__ppc64__) - lha r3,6(r5) -#else - lha r3,2(r5) -#endif - b Lfinish - nop - nop - -/* case FFI_TYPE_UINT32 */ -Lret_type9: -#if defined(__ppc64__) - lwz r3,4(r5) -#else - lwz r3,0(r5) -#endif - b Lfinish - nop - nop - -/* case FFI_TYPE_SINT32 */ -Lret_type10: -#if defined(__ppc64__) - lwz r3,4(r5) -#else - lwz r3,0(r5) -#endif - b Lfinish - nop - nop - -/* case FFI_TYPE_UINT64 */ -Lret_type11: -#if defined(__ppc64__) - lg r3,0(r5) - b Lfinish - nop -#else - lwz r3,0(r5) - lwz r4,4(r5) - b Lfinish -#endif - nop - -/* case FFI_TYPE_SINT64 */ -Lret_type12: -#if defined(__ppc64__) - lg r3,0(r5) - b Lfinish - nop -#else - lwz r3,0(r5) - lwz r4,4(r5) - b Lfinish -#endif - nop - -/* case FFI_TYPE_STRUCT */ -Lret_type13: -#if defined(__ppc64__) - lg r3,0(r5) ; we need at least this... - cmpi 0,r0,4 - bgt Lstructend ; not a special small case - b Lsmallstruct ; see if we need more. -#else - cmpwi 0,r0,4 - bgt Lfinish ; not by value - lg r3,0(r5) - b Lfinish -#endif -/* case FFI_TYPE_POINTER */ -Lret_type14: - lg r3,0(r5) - b Lfinish - nop - nop - -#if defined(__ppc64__) -Lsmallstruct: - beq Lfour ; continuation of Lret13. - cmpi 0,r0,3 - beq Lfinish ; don`t adjust this - can`t be any floats here... - srdi r3,r3,48 - cmpi 0,r0,2 - beq Lfinish ; .. or here .. - srdi r3,r3,8 - b Lfinish ; .. or here. - -Lfour: - lg r6,LINKAGE_SIZE(r1) ; get the result type - lg r6,FFI_TYPE_ELEM(r6) ; elements array pointer - lg r6,0(r6) ; first element - lhz r0,FFI_TYPE_TYPE(r6) ; OK go the type - cmpi 0,r0,2 ; FFI_TYPE_FLOAT - bne Lfourint - lfs f1,0(r5) ; just one float in the struct. - b Lfinish - -Lfourint: - srdi r3,r3,32 ; four bytes. - b Lfinish - -Lstructend: - lg r3,LINKAGE_SIZE(r1) ; get the result type - bl STRUCT_RETVALUE_P - cmpi 0,r3,0 - beq Lfinish ; nope. - /* Recover a pointer to the results. */ - addi r11,r1,(SAVE_SIZE-RESULT_BYTES) - lg r3,0(r11) ; we need at least this... - lg r4,8(r11) - cmpi 0,r0,16 - beq Lfinish ; special case 16 bytes we don't consider floats. - - /* OK, frustratingly, the process of saving the struct to mem might have - messed with the FPRs, so we have to re-load them :(. - We`ll use our FPRs space again - calling: - void darwin64_pass_struct_floats (ffi_type *s, char *src, - unsigned *nfpr, double **fprs) - We`ll temporarily pinch the first two slots of the param area for local - vars used by the routine. */ - xor r6,r6,r6 - addi r5,r1,PARENT_PARM_BASE ; some space - sg r6,0(r5) ; *nfpr zeroed. - addi r6,r5,8 ; **fprs - addi r3,r1,FP_SAVE_BASE ; pointer to FPRs space - sg r3,0(r6) - mr r4,r11 ; the struct is here... - lg r3,LINKAGE_SIZE(r1) ; ffi_type * result_type. - bl PASS_STR_FLOATS ; get struct floats into FPR save space. - /* See if we used any floats */ - lwz r0,(SAVE_SIZE-RESULT_BYTES)(r1) - cmpi 0,r0,0 - beq Lstructints ; nope. - /* OK load `em up... */ - lfd f1, (FP_SAVE_BASE )(r1) - lfd f2, (FP_SAVE_BASE + FPR_SIZE )(r1) - lfd f3, (FP_SAVE_BASE + FPR_SIZE * 2 )(r1) - lfd f4, (FP_SAVE_BASE + FPR_SIZE * 3 )(r1) - lfd f5, (FP_SAVE_BASE + FPR_SIZE * 4 )(r1) - lfd f6, (FP_SAVE_BASE + FPR_SIZE * 5 )(r1) - lfd f7, (FP_SAVE_BASE + FPR_SIZE * 6 )(r1) - lfd f8, (FP_SAVE_BASE + FPR_SIZE * 7 )(r1) - lfd f9, (FP_SAVE_BASE + FPR_SIZE * 8 )(r1) - lfd f10,(FP_SAVE_BASE + FPR_SIZE * 9 )(r1) - lfd f11,(FP_SAVE_BASE + FPR_SIZE * 10)(r1) - lfd f12,(FP_SAVE_BASE + FPR_SIZE * 11)(r1) - lfd f13,(FP_SAVE_BASE + FPR_SIZE * 12)(r1) - - /* point back at our saved struct. */ -Lstructints: - addi r11,r1,(SAVE_SIZE-RESULT_BYTES) - lg r3,0(r11) ; we end up picking the - lg r4,8(r11) ; first two again. - lg r5,16(r11) - lg r6,24(r11) - lg r7,32(r11) - lg r8,40(r11) - lg r9,48(r11) - lg r10,56(r11) -#endif - -/* case done */ -Lfinish: - addi r1,r1,SAVE_SIZE /* Restore stack pointer. */ - lg r0,SAVED_LR_OFFSET(r1) /* Get return address. */ - mtlr r0 /* Reset link register. */ - blr -Lendcode: - .align 1 - -/* END(ffi_closure_ASM) */ - -/* EH frame stuff. */ -#define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78) -/* 176, 400 */ -#define EH_FRAME_OFFSETA MODE_CHOICE(176,0x90) -#define EH_FRAME_OFFSETB MODE_CHOICE(1,3) - - .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support -EH_frame1: - .set L$set$0,LECIE1-LSCIE1 - .long L$set$0 ; Length of Common Information Entry -LSCIE1: - .long 0x0 ; CIE Identifier Tag - .byte 0x1 ; CIE Version - .ascii "zR\0" ; CIE Augmentation - .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor - .byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor - .byte 0x41 ; CIE RA Column - .byte 0x1 ; uleb128 0x1; Augmentation size - .byte 0x10 ; FDE Encoding (pcrel) - .byte 0xc ; DW_CFA_def_cfa - .byte 0x1 ; uleb128 0x1 - .byte 0x0 ; uleb128 0x0 - .align LOG2_GPR_BYTES -LECIE1: - .globl _ffi_closure_ASM.eh -_ffi_closure_ASM.eh: -LSFDE1: - .set L$set$1,LEFDE1-LASFDE1 - .long L$set$1 ; FDE Length - -LASFDE1: - .long LASFDE1-EH_frame1 ; FDE CIE offset - .g_long Lstartcode-. ; FDE initial location - .set L$set$2,LFE1-Lstartcode - .g_long L$set$2 ; FDE address range - .byte 0x0 ; uleb128 0x0; Augmentation size - .byte 0x4 ; DW_CFA_advance_loc4 - .set L$set$3,LCFI1-LCFI0 - .long L$set$3 - .byte 0xe ; DW_CFA_def_cfa_offset - .byte EH_FRAME_OFFSETA,EH_FRAME_OFFSETB ; uleb128 176,1/190,3 - .byte 0x4 ; DW_CFA_advance_loc4 - .set L$set$4,LCFI0-Lstartcode - .long L$set$4 - .byte 0x11 ; DW_CFA_offset_extended_sf - .byte 0x41 ; uleb128 0x41 - .byte 0x7e ; sleb128 -2 - .align LOG2_GPR_BYTES -LEFDE1: - .align 1 - -#ifdef WANT_STUB - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_ffi_closure_helper_DARWIN$stub: - .indirect_symbol _ffi_closure_helper_DARWIN - mflr r0 - bcl 20,31,"L1$spb" -"L1$spb": - mflr r11 - addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb") - mtlr r0 - lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_ffi_closure_helper_DARWIN$lazy_ptr: - .indirect_symbol _ffi_closure_helper_DARWIN - .g_long dyld_stub_binding_helper - -#if defined(__ppc64__) - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_darwin64_struct_ret_by_value_p$stub: - .indirect_symbol _darwin64_struct_ret_by_value_p - mflr r0 - bcl 20,31,"L2$spb" -"L2$spb": - mflr r11 - addis r11,r11,ha16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb") - mtlr r0 - lwzu r12,lo16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_darwin64_struct_ret_by_value_p$lazy_ptr: - .indirect_symbol _darwin64_struct_ret_by_value_p - .g_long dyld_stub_binding_helper - - .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 5 -L_darwin64_pass_struct_floats$stub: - .indirect_symbol _darwin64_pass_struct_floats - mflr r0 - bcl 20,31,"L3$spb" -"L3$spb": - mflr r11 - addis r11,r11,ha16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb") - mtlr r0 - lwzu r12,lo16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb")(r11) - mtctr r12 - bctr - .lazy_symbol_pointer -L_darwin64_pass_struct_floats$lazy_ptr: - .indirect_symbol _darwin64_pass_struct_floats - .g_long dyld_stub_binding_helper -# endif -#endif diff --git a/deps/libffi/src/powerpc/ffi.c b/deps/libffi/src/powerpc/ffi.c deleted file mode 100644 index 3601cc4ab1e2aa..00000000000000 --- a/deps/libffi/src/powerpc/ffi.c +++ /dev/null @@ -1,194 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (C) 2013 IBM - Copyright (C) 2011 Anthony Green - Copyright (C) 2011 Kyle Moffett - Copyright (C) 2008 Red Hat, Inc - Copyright (C) 2007, 2008 Free Software Foundation, Inc - Copyright (c) 1998 Geoffrey Keating - - PowerPC Foreign Function Interface - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#include "ffi.h" -#include "ffi_common.h" -#include "ffi_powerpc.h" -#include "internal.h" -#include - -#if HAVE_LONG_DOUBLE_VARIANT -/* Adjust ffi_type_longdouble. */ -void FFI_HIDDEN -ffi_prep_types (ffi_abi abi) -{ -# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE -# ifdef POWERPC64 - ffi_prep_types_linux64 (abi); -# else - ffi_prep_types_sysv (abi); -# endif -# endif -} -#endif - -/* Perform machine dependent cif processing */ -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep (ffi_cif *cif) -{ -#ifdef POWERPC64 - return ffi_prep_cif_linux64 (cif); -#else - return ffi_prep_cif_sysv (cif); -#endif -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep_var (ffi_cif *cif, - unsigned int nfixedargs MAYBE_UNUSED, - unsigned int ntotalargs MAYBE_UNUSED) -{ -#ifdef POWERPC64 - return ffi_prep_cif_linux64_var (cif, nfixedargs, ntotalargs); -#else - return ffi_prep_cif_sysv (cif); -#endif -} - -static void -ffi_call_int (ffi_cif *cif, - void (*fn) (void), - void *rvalue, - void **avalue, - void *closure) -{ - /* The final SYSV ABI says that structures smaller or equal 8 bytes - are returned in r3/r4. A draft ABI used by linux instead returns - them in memory. - - We bounce-buffer SYSV small struct return values so that sysv.S - can write r3 and r4 to memory without worrying about struct size. - - For ELFv2 ABI, use a bounce buffer for homogeneous structs too, - for similar reasons. This bounce buffer must be aligned to 16 - bytes for use with homogeneous structs of vectors (float128). */ - float128 smst_buffer[8]; - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - ecif.rvalue = rvalue; - if ((cif->flags & FLAG_RETURNS_SMST) != 0) - ecif.rvalue = smst_buffer; - /* Ensure that we have a valid struct return value. - FIXME: Isn't this just papering over a user problem? */ - else if (!rvalue && cif->rtype->type == FFI_TYPE_STRUCT) - ecif.rvalue = alloca (cif->rtype->size); - -#ifdef POWERPC64 - ffi_call_LINUX64 (&ecif, fn, ecif.rvalue, cif->flags, closure, - -(long) cif->bytes); -#else - ffi_call_SYSV (&ecif, fn, ecif.rvalue, cif->flags, closure, -cif->bytes); -#endif - - /* Check for a bounce-buffered return value */ - if (rvalue && ecif.rvalue == smst_buffer) - { - unsigned int rsize = cif->rtype->size; -#ifndef __LITTLE_ENDIAN__ - /* The SYSV ABI returns a structure of up to 4 bytes in size - left-padded in r3. */ -# ifndef POWERPC64 - if (rsize <= 4) - memcpy (rvalue, (char *) smst_buffer + 4 - rsize, rsize); - else -# endif - /* The SYSV ABI returns a structure of up to 8 bytes in size - left-padded in r3/r4, and the ELFv2 ABI similarly returns a - structure of up to 8 bytes in size left-padded in r3. But - note that a structure of a single float is not paddded. */ - if (rsize <= 8 && (cif->flags & FLAG_RETURNS_FP) == 0) - memcpy (rvalue, (char *) smst_buffer + 8 - rsize, rsize); - else -#endif - memcpy (rvalue, smst_buffer, rsize); - } -} - -void -ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) -{ - ffi_call_int (cif, fn, rvalue, avalue, NULL); -} - -void -ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, - void *closure) -{ - ffi_call_int (cif, fn, rvalue, avalue, closure); -} - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, - ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - void *codeloc) -{ -#ifdef POWERPC64 - return ffi_prep_closure_loc_linux64 (closure, cif, fun, user_data, codeloc); -#else - return ffi_prep_closure_loc_sysv (closure, cif, fun, user_data, codeloc); -#endif -} - -ffi_status -ffi_prep_go_closure (ffi_go_closure *closure, - ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *)) -{ -#ifdef POWERPC64 - closure->tramp = ffi_go_closure_linux64; -#else - closure->tramp = ffi_go_closure_sysv; -#endif - closure->cif = cif; - closure->fun = fun; - return FFI_OK; -} - -#ifdef FFI_EXEC_STATIC_TRAMP -void * -ffi_tramp_arch (size_t *tramp_size, size_t *map_size) -{ - extern void *trampoline_code_table; - *tramp_size = PPC_TRAMP_SIZE; - *map_size = PPC_TRAMP_MAP_SIZE; -#if defined (_CALL_AIX) || _CALL_ELF == 1 - /* The caller wants the entry point address of the trampoline code, - not the address of the function descriptor. */ - return *(void **)trampoline_code_table; -#else - return &trampoline_code_table; -#endif -} -#endif diff --git a/deps/libffi/src/powerpc/ffi_darwin.c b/deps/libffi/src/powerpc/ffi_darwin.c deleted file mode 100644 index afb6750a5bbfb5..00000000000000 --- a/deps/libffi/src/powerpc/ffi_darwin.c +++ /dev/null @@ -1,1464 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi_darwin.c - - Copyright (C) 1998 Geoffrey Keating - Copyright (C) 2001 John Hornkvist - Copyright (C) 2002, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. - - FFI support for Darwin and AIX. - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include - -extern void ffi_closure_ASM (void); - -#if defined (FFI_GO_CLOSURES) -extern void ffi_go_closure_ASM (void); -#endif - -enum { - /* The assembly depends on these exact flags. - For Darwin64 (when FLAG_RETURNS_STRUCT is set): - FLAG_RETURNS_FP indicates that the structure embeds FP data. - FLAG_RETURNS_128BITS signals a special struct size that is not - expanded for float content. */ - FLAG_RETURNS_128BITS = 1 << (31-31), /* These go in cr7 */ - FLAG_RETURNS_NOTHING = 1 << (31-30), - FLAG_RETURNS_FP = 1 << (31-29), - FLAG_RETURNS_64BITS = 1 << (31-28), - - FLAG_RETURNS_STRUCT = 1 << (31-27), /* This goes in cr6 */ - - FLAG_ARG_NEEDS_COPY = 1 << (31- 7), - FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */ - FLAG_4_GPR_ARGUMENTS = 1 << (31- 5), - FLAG_RETVAL_REFERENCE = 1 << (31- 4) -}; - -/* About the DARWIN ABI. */ -enum { - NUM_GPR_ARG_REGISTERS = 8, - NUM_FPR_ARG_REGISTERS = 13, - LINKAGE_AREA_GPRS = 6 -}; - -enum { ASM_NEEDS_REGISTERS = 4 }; /* r28-r31 */ - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments. - - m32/m64 - - The stack layout we want looks like this: - - | Return address from ffi_call_DARWIN | higher addresses - |--------------------------------------------| - | Previous backchain pointer 4/8 | stack pointer here - |--------------------------------------------|<+ <<< on entry to - | ASM_NEEDS_REGISTERS=r28-r31 4*(4/8) | | ffi_call_DARWIN - |--------------------------------------------| | - | When we have any FP activity... the | | - | FPRs occupy NUM_FPR_ARG_REGISTERS slots | | - | here fp13 .. fp1 from high to low addr. | | - ~ ~ ~ - | Parameters (at least 8*4/8=32/64) | | NUM_GPR_ARG_REGISTERS - |--------------------------------------------| | - | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | - |--------------------------------------------| | stack | - | Reserved 2*4/8 | | grows | - |--------------------------------------------| | down V - | Space for callee's LR 4/8 | | - |--------------------------------------------| | lower addresses - | Saved CR [low word for m64] 4/8 | | - |--------------------------------------------| | stack pointer here - | Current backchain pointer 4/8 |-/ during - |--------------------------------------------| <<< ffi_call_DARWIN - - */ - -#if defined(POWERPC_DARWIN64) -static void -darwin64_pass_struct_by_value - (ffi_type *, char *, unsigned, unsigned *, double **, unsigned long **); -#endif - -/* This depends on GPR_SIZE = sizeof (unsigned long) */ - -void -ffi_prep_args (extended_cif *ecif, unsigned long *const stack) -{ - const unsigned bytes = ecif->cif->bytes; - const unsigned flags = ecif->cif->flags; - const unsigned nargs = ecif->cif->nargs; -#if !defined(POWERPC_DARWIN64) - const ffi_abi abi = ecif->cif->abi; -#endif - - /* 'stacktop' points at the previous backchain pointer. */ - unsigned long *const stacktop = stack + (bytes / sizeof(unsigned long)); - - /* 'fpr_base' points at the space for fpr1, and grows upwards as - we use FPR registers. */ - double *fpr_base = (double *) (stacktop - ASM_NEEDS_REGISTERS) - NUM_FPR_ARG_REGISTERS; - int gp_count = 0, fparg_count = 0; - - /* 'next_arg' grows up as we put parameters in it. */ - unsigned long *next_arg = stack + LINKAGE_AREA_GPRS; /* 6 reserved positions. */ - - int i; - double double_tmp; - void **p_argv = ecif->avalue; - unsigned long gprvalue; - ffi_type** ptr = ecif->cif->arg_types; -#if !defined(POWERPC_DARWIN64) - char *dest_cpy; -#endif - unsigned size_al = 0; - - /* Check that everything starts aligned properly. */ - FFI_ASSERT(((unsigned) (char *) stack & 0xF) == 0); - FFI_ASSERT(((unsigned) (char *) stacktop & 0xF) == 0); - FFI_ASSERT((bytes & 0xF) == 0); - - /* Deal with return values that are actually pass-by-reference. - Rule: - Return values are referenced by r3, so r4 is the first parameter. */ - - if (flags & FLAG_RETVAL_REFERENCE) - *next_arg++ = (unsigned long) (char *) ecif->rvalue; - - /* Now for the arguments. */ - for (i = nargs; i > 0; i--, ptr++, p_argv++) - { - switch ((*ptr)->type) - { - /* If a floating-point parameter appears before all of the general- - purpose registers are filled, the corresponding GPRs that match - the size of the floating-point parameter are skipped. */ - case FFI_TYPE_FLOAT: - double_tmp = *(float *) *p_argv; - if (fparg_count < NUM_FPR_ARG_REGISTERS) - *fpr_base++ = double_tmp; -#if defined(POWERPC_DARWIN) - *(float *)next_arg = *(float *) *p_argv; -#else - *(double *)next_arg = double_tmp; -#endif - next_arg++; - gp_count++; - fparg_count++; - FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); - break; - - case FFI_TYPE_DOUBLE: - double_tmp = *(double *) *p_argv; - if (fparg_count < NUM_FPR_ARG_REGISTERS) - *fpr_base++ = double_tmp; - *(double *)next_arg = double_tmp; -#ifdef POWERPC64 - next_arg++; - gp_count++; -#else - next_arg += 2; - gp_count += 2; -#endif - fparg_count++; - FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); - break; - -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - - case FFI_TYPE_LONGDOUBLE: -# if defined(POWERPC64) && !defined(POWERPC_DARWIN64) - /* ??? This will exceed the regs count when the value starts at fp13 - and it will not put the extra bit on the stack. */ - if (fparg_count < NUM_FPR_ARG_REGISTERS) - *(long double *) fpr_base++ = *(long double *) *p_argv; - else - *(long double *) next_arg = *(long double *) *p_argv; - next_arg += 2; - fparg_count += 2; -# else - double_tmp = ((double *) *p_argv)[0]; - if (fparg_count < NUM_FPR_ARG_REGISTERS) - *fpr_base++ = double_tmp; - *(double *) next_arg = double_tmp; -# if defined(POWERPC_DARWIN64) - next_arg++; - gp_count++; -# else - next_arg += 2; - gp_count += 2; -# endif - fparg_count++; - double_tmp = ((double *) *p_argv)[1]; - if (fparg_count < NUM_FPR_ARG_REGISTERS) - *fpr_base++ = double_tmp; - *(double *) next_arg = double_tmp; -# if defined(POWERPC_DARWIN64) - next_arg++; - gp_count++; -# else - next_arg += 2; - gp_count += 2; -# endif - fparg_count++; -# endif - FFI_ASSERT(flags & FLAG_FP_ARGUMENTS); - break; -#endif - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: -#ifdef POWERPC64 - gprvalue = *(long long *) *p_argv; - goto putgpr; -#else - *(long long *) next_arg = *(long long *) *p_argv; - next_arg += 2; - gp_count += 2; -#endif - break; - case FFI_TYPE_POINTER: - gprvalue = *(unsigned long *) *p_argv; - goto putgpr; - case FFI_TYPE_UINT8: - gprvalue = *(unsigned char *) *p_argv; - goto putgpr; - case FFI_TYPE_SINT8: - gprvalue = *(signed char *) *p_argv; - goto putgpr; - case FFI_TYPE_UINT16: - gprvalue = *(unsigned short *) *p_argv; - goto putgpr; - case FFI_TYPE_SINT16: - gprvalue = *(signed short *) *p_argv; - goto putgpr; - - case FFI_TYPE_STRUCT: - size_al = (*ptr)->size; -#if defined(POWERPC_DARWIN64) - next_arg = (unsigned long *)FFI_ALIGN((char *)next_arg, (*ptr)->alignment); - darwin64_pass_struct_by_value (*ptr, (char *) *p_argv, - (unsigned) size_al, - (unsigned int *) &fparg_count, - &fpr_base, &next_arg); -#else - dest_cpy = (char *) next_arg; - - /* If the first member of the struct is a double, then include enough - padding in the struct size to align it to double-word. */ - if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE) - size_al = FFI_ALIGN((*ptr)->size, 8); - -# if defined(POWERPC64) - FFI_ASSERT (abi != FFI_DARWIN); - memcpy ((char *) dest_cpy, (char *) *p_argv, size_al); - next_arg += (size_al + 7) / 8; -# else - /* Structures that match the basic modes (QI 1 byte, HI 2 bytes, - SI 4 bytes) are aligned as if they were those modes. - Structures with 3 byte in size are padded upwards. */ - if (size_al < 3 && abi == FFI_DARWIN) - dest_cpy += 4 - size_al; - - memcpy((char *) dest_cpy, (char *) *p_argv, size_al); - next_arg += (size_al + 3) / 4; -# endif -#endif - break; - - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - gprvalue = *(signed int *) *p_argv; - goto putgpr; - - case FFI_TYPE_UINT32: - gprvalue = *(unsigned int *) *p_argv; - putgpr: - *next_arg++ = gprvalue; - gp_count++; - break; - default: - break; - } - } - - /* Check that we didn't overrun the stack... */ - /* FFI_ASSERT(gpr_base <= stacktop - ASM_NEEDS_REGISTERS); - FFI_ASSERT((unsigned *)fpr_base - <= stacktop - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS); - FFI_ASSERT(flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4); */ -} - -#if defined(POWERPC_DARWIN64) - -/* See if we can put some of the struct into fprs. - This should not be called for structures of size 16 bytes, since these are not - broken out this way. */ -static void -darwin64_scan_struct_for_floats (ffi_type *s, unsigned *nfpr) -{ - int i; - - FFI_ASSERT (s->type == FFI_TYPE_STRUCT) - - for (i = 0; s->elements[i] != NULL; i++) - { - ffi_type *p = s->elements[i]; - switch (p->type) - { - case FFI_TYPE_STRUCT: - darwin64_scan_struct_for_floats (p, nfpr); - break; - case FFI_TYPE_LONGDOUBLE: - (*nfpr) += 2; - break; - case FFI_TYPE_DOUBLE: - case FFI_TYPE_FLOAT: - (*nfpr) += 1; - break; - default: - break; - } - } -} - -static int -darwin64_struct_size_exceeds_gprs_p (ffi_type *s, char *src, unsigned *nfpr) -{ - unsigned struct_offset=0, i; - - for (i = 0; s->elements[i] != NULL; i++) - { - char *item_base; - ffi_type *p = s->elements[i]; - /* Find the start of this item (0 for the first one). */ - if (i > 0) - struct_offset = FFI_ALIGN(struct_offset, p->alignment); - - item_base = src + struct_offset; - - switch (p->type) - { - case FFI_TYPE_STRUCT: - if (darwin64_struct_size_exceeds_gprs_p (p, item_base, nfpr)) - return 1; - break; - case FFI_TYPE_LONGDOUBLE: - if (*nfpr >= NUM_FPR_ARG_REGISTERS) - return 1; - (*nfpr) += 1; - item_base += 8; - /* FALL THROUGH */ - case FFI_TYPE_DOUBLE: - if (*nfpr >= NUM_FPR_ARG_REGISTERS) - return 1; - (*nfpr) += 1; - break; - case FFI_TYPE_FLOAT: - if (*nfpr >= NUM_FPR_ARG_REGISTERS) - return 1; - (*nfpr) += 1; - break; - default: - /* If we try and place any item, that is non-float, once we've - exceeded the 8 GPR mark, then we can't fit the struct. */ - if ((unsigned long)item_base >= 8*8) - return 1; - break; - } - /* now count the size of what we just used. */ - struct_offset += p->size; - } - return 0; -} - -/* Can this struct be returned by value? */ -int -darwin64_struct_ret_by_value_p (ffi_type *s) -{ - unsigned nfp = 0; - - FFI_ASSERT (s && s->type == FFI_TYPE_STRUCT); - - /* The largest structure we can return is 8long + 13 doubles. */ - if (s->size > 168) - return 0; - - /* We can't pass more than 13 floats. */ - darwin64_scan_struct_for_floats (s, &nfp); - if (nfp > 13) - return 0; - - /* If there are not too many floats, and the struct is - small enough to accommodate in the GPRs, then it must be OK. */ - if (s->size <= 64) - return 1; - - /* Well, we have to look harder. */ - nfp = 0; - if (darwin64_struct_size_exceeds_gprs_p (s, NULL, &nfp)) - return 0; - - return 1; -} - -void -darwin64_pass_struct_floats (ffi_type *s, char *src, - unsigned *nfpr, double **fprs) -{ - int i; - double *fpr_base = *fprs; - unsigned struct_offset = 0; - - /* We don't assume anything about the alignment of the source. */ - for (i = 0; s->elements[i] != NULL; i++) - { - char *item_base; - ffi_type *p = s->elements[i]; - /* Find the start of this item (0 for the first one). */ - if (i > 0) - struct_offset = FFI_ALIGN(struct_offset, p->alignment); - item_base = src + struct_offset; - - switch (p->type) - { - case FFI_TYPE_STRUCT: - darwin64_pass_struct_floats (p, item_base, nfpr, - &fpr_base); - break; - case FFI_TYPE_LONGDOUBLE: - if (*nfpr < NUM_FPR_ARG_REGISTERS) - *fpr_base++ = *(double *)item_base; - (*nfpr) += 1; - item_base += 8; - /* FALL THROUGH */ - case FFI_TYPE_DOUBLE: - if (*nfpr < NUM_FPR_ARG_REGISTERS) - *fpr_base++ = *(double *)item_base; - (*nfpr) += 1; - break; - case FFI_TYPE_FLOAT: - if (*nfpr < NUM_FPR_ARG_REGISTERS) - *fpr_base++ = (double) *(float *)item_base; - (*nfpr) += 1; - break; - default: - break; - } - /* now count the size of what we just used. */ - struct_offset += p->size; - } - /* Update the scores. */ - *fprs = fpr_base; -} - -/* Darwin64 special rules. - Break out a struct into params and float registers. */ -static void -darwin64_pass_struct_by_value (ffi_type *s, char *src, unsigned size, - unsigned *nfpr, double **fprs, unsigned long **arg) -{ - unsigned long *next_arg = *arg; - char *dest_cpy = (char *)next_arg; - - FFI_ASSERT (s->type == FFI_TYPE_STRUCT) - - if (!size) - return; - - /* First... special cases. */ - if (size < 3 - || (size == 4 - && s->elements[0] - && s->elements[0]->type != FFI_TYPE_FLOAT)) - { - /* Must be at least one GPR, padding is unspecified in value, - let's make it zero. */ - *next_arg = 0UL; - dest_cpy += 8 - size; - memcpy ((char *) dest_cpy, src, size); - next_arg++; - } - else if (size == 16) - { - memcpy ((char *) dest_cpy, src, size); - next_arg += 2; - } - else - { - /* now the general case, we consider embedded floats. */ - memcpy ((char *) dest_cpy, src, size); - darwin64_pass_struct_floats (s, src, nfpr, fprs); - next_arg += (size+7)/8; - } - - *arg = next_arg; -} - -double * -darwin64_struct_floats_to_mem (ffi_type *s, char *dest, double *fprs, unsigned *nf) -{ - int i; - unsigned struct_offset = 0; - - /* We don't assume anything about the alignment of the source. */ - for (i = 0; s->elements[i] != NULL; i++) - { - char *item_base; - ffi_type *p = s->elements[i]; - /* Find the start of this item (0 for the first one). */ - if (i > 0) - struct_offset = FFI_ALIGN(struct_offset, p->alignment); - item_base = dest + struct_offset; - - switch (p->type) - { - case FFI_TYPE_STRUCT: - fprs = darwin64_struct_floats_to_mem (p, item_base, fprs, nf); - break; - case FFI_TYPE_LONGDOUBLE: - if (*nf < NUM_FPR_ARG_REGISTERS) - { - *(double *)item_base = *fprs++ ; - (*nf) += 1; - } - item_base += 8; - /* FALL THROUGH */ - case FFI_TYPE_DOUBLE: - if (*nf < NUM_FPR_ARG_REGISTERS) - { - *(double *)item_base = *fprs++ ; - (*nf) += 1; - } - break; - case FFI_TYPE_FLOAT: - if (*nf < NUM_FPR_ARG_REGISTERS) - { - *(float *)item_base = (float) *fprs++ ; - (*nf) += 1; - } - break; - default: - break; - } - /* now count the size of what we just used. */ - struct_offset += p->size; - } - return fprs; -} - -#endif - -/* Adjust the size of S to be correct for Darwin. - On Darwin m32, the first field of a structure has natural alignment. - On Darwin m64, all fields have natural alignment. */ - -static void -darwin_adjust_aggregate_sizes (ffi_type *s) -{ - int i; - - if (s->type != FFI_TYPE_STRUCT) - return; - - s->size = 0; - for (i = 0; s->elements[i] != NULL; i++) - { - ffi_type *p; - int align; - - p = s->elements[i]; - if (p->type == FFI_TYPE_STRUCT) - darwin_adjust_aggregate_sizes (p); -#if defined(POWERPC_DARWIN64) - /* Natural alignment for all items. */ - align = p->alignment; -#else - /* Natural alignment for the first item... */ - if (i == 0) - align = p->alignment; - else if (p->alignment == 16 || p->alignment < 4) - /* .. subsequent items with vector or align < 4 have natural align. */ - align = p->alignment; - else - /* .. or align is 4. */ - align = 4; -#endif - /* Pad, if necessary, before adding the current item. */ - s->size = FFI_ALIGN(s->size, align) + p->size; - } - - s->size = FFI_ALIGN(s->size, s->alignment); - - /* This should not be necessary on m64, but harmless. */ - if (s->elements[0]->type == FFI_TYPE_UINT64 - || s->elements[0]->type == FFI_TYPE_SINT64 - || s->elements[0]->type == FFI_TYPE_DOUBLE - || s->elements[0]->alignment == 8) - s->alignment = s->alignment > 8 ? s->alignment : 8; - /* Do not add additional tail padding. */ -} - -/* Adjust the size of S to be correct for AIX. - Word-align double unless it is the first member of a structure recursively. - Return non-zero if we found a recursive first member aggregate of interest. */ - -static int -aix_adjust_aggregate_sizes (ffi_type *s, int outer_most_type_or_first_member) -{ - int i, nested_first_member=0, final_align, rc=0; - - if (s->type != FFI_TYPE_STRUCT) - return 0; - - s->size = 0; - for (i = 0; s->elements[i] != NULL; i++) - { - ffi_type p; - int align; - - /* nested aggregates layout differently on AIX, so take a copy of the type */ - p = *(s->elements[i]); - if (i == 0) - nested_first_member = aix_adjust_aggregate_sizes(&p, outer_most_type_or_first_member); - else - aix_adjust_aggregate_sizes(&p, 0); - align = p.alignment; - if (i != 0 && p.type == FFI_TYPE_DOUBLE) - align = 4; - s->size = FFI_ALIGN(s->size, align) + p.size; - } - - final_align=s->alignment; - if ((s->elements[0]->type == FFI_TYPE_UINT64 - || s->elements[0]->type == FFI_TYPE_SINT64 - || s->elements[0]->type == FFI_TYPE_DOUBLE - || s->elements[0]->alignment == 8 || nested_first_member)) { - final_align = s->alignment > 8 ? s->alignment : 8; - rc=1; - /* still use the adjusted alignment to calculate tail padding, but don't adjust the types alignment if - we aren't in the recursive first position */ - if (outer_most_type_or_first_member) - s->alignment=final_align; - } - - s->size = FFI_ALIGN(s->size, final_align); - return rc; -} - -/* Perform machine dependent cif processing. */ -ffi_status -ffi_prep_cif_machdep (ffi_cif *cif) -{ - /* All this is for the DARWIN ABI. */ - unsigned i; - ffi_type **ptr; - unsigned bytes; - unsigned fparg_count = 0, intarg_count = 0; - unsigned flags = 0; - unsigned size_al = 0; - - /* All the machine-independent calculation of cif->bytes will be wrong. - All the calculation of structure sizes will also be wrong. - Redo the calculation for DARWIN. */ - - if (cif->abi == FFI_DARWIN) - { - darwin_adjust_aggregate_sizes (cif->rtype); - for (i = 0; i < cif->nargs; i++) - darwin_adjust_aggregate_sizes (cif->arg_types[i]); - } - - if (cif->abi == FFI_AIX) - { - aix_adjust_aggregate_sizes (cif->rtype, 1); - for (i = 0; i < cif->nargs; i++) - aix_adjust_aggregate_sizes (cif->arg_types[i], 1); - } - - /* Space for the frame pointer, callee's LR, CR, etc, and for - the asm's temp regs. */ - - bytes = (LINKAGE_AREA_GPRS + ASM_NEEDS_REGISTERS) * sizeof(unsigned long); - - /* Return value handling. - The rules m32 are as follows: - - 32-bit (or less) integer values are returned in gpr3; - - structures of size <= 4 bytes also returned in gpr3; - - 64-bit integer values [??? and structures between 5 and 8 bytes] are - returned in gpr3 and gpr4; - - Single/double FP values are returned in fpr1; - - Long double FP (if not equivalent to double) values are returned in - fpr1 and fpr2; - m64: - - 64-bit or smaller integral values are returned in GPR3 - - Single/double FP values are returned in fpr1; - - Long double FP values are returned in fpr1 and fpr2; - m64 Structures: - - If the structure could be accommodated in registers were it to be the - first argument to a routine, then it is returned in those registers. - m32/m64 structures otherwise: - - Larger structures values are allocated space and a pointer is passed - as the first argument. */ - switch (cif->rtype->type) - { - -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - flags |= FLAG_RETURNS_128BITS; - flags |= FLAG_RETURNS_FP; - break; -#endif - - case FFI_TYPE_DOUBLE: - flags |= FLAG_RETURNS_64BITS; - /* Fall through. */ - case FFI_TYPE_FLOAT: - flags |= FLAG_RETURNS_FP; - break; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: -#ifdef POWERPC64 - case FFI_TYPE_POINTER: -#endif - flags |= FLAG_RETURNS_64BITS; - break; - - case FFI_TYPE_STRUCT: -#if defined(POWERPC_DARWIN64) - { - /* Can we fit the struct into regs? */ - if (darwin64_struct_ret_by_value_p (cif->rtype)) - { - unsigned nfpr = 0; - flags |= FLAG_RETURNS_STRUCT; - if (cif->rtype->size != 16) - darwin64_scan_struct_for_floats (cif->rtype, &nfpr) ; - else - flags |= FLAG_RETURNS_128BITS; - /* Will be 0 for 16byte struct. */ - if (nfpr) - flags |= FLAG_RETURNS_FP; - } - else /* By ref. */ - { - flags |= FLAG_RETVAL_REFERENCE; - flags |= FLAG_RETURNS_NOTHING; - intarg_count++; - } - } -#elif defined(DARWIN_PPC) - if (cif->rtype->size <= 4) - flags |= FLAG_RETURNS_STRUCT; - else /* else by reference. */ - { - flags |= FLAG_RETVAL_REFERENCE; - flags |= FLAG_RETURNS_NOTHING; - intarg_count++; - } -#else /* assume we pass by ref. */ - flags |= FLAG_RETVAL_REFERENCE; - flags |= FLAG_RETURNS_NOTHING; - intarg_count++; -#endif - break; - case FFI_TYPE_VOID: - flags |= FLAG_RETURNS_NOTHING; - break; - - default: - /* Returns 32-bit integer, or similar. Nothing to do here. */ - break; - } - - /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the - first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest - goes on the stack. - ??? Structures are passed as a pointer to a copy of the structure. - Stuff on the stack needs to keep proper alignment. - For m64 the count is effectively of half-GPRs. */ - for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) - { - unsigned align_words; - switch ((*ptr)->type) - { - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - fparg_count++; -#if !defined(POWERPC_DARWIN64) - /* If this FP arg is going on the stack, it must be - 8-byte-aligned. */ - if (fparg_count > NUM_FPR_ARG_REGISTERS - && (intarg_count & 0x01) != 0) - intarg_count++; -#endif - break; - -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - fparg_count += 2; - /* If this FP arg is going on the stack, it must be - 16-byte-aligned. */ - if (fparg_count >= NUM_FPR_ARG_REGISTERS) -#if defined (POWERPC64) - intarg_count = FFI_ALIGN(intarg_count, 2); -#else - intarg_count = FFI_ALIGN(intarg_count, 4); -#endif - break; -#endif - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: -#if defined(POWERPC64) - intarg_count++; -#else - /* 'long long' arguments are passed as two words, but - either both words must fit in registers or both go - on the stack. If they go on the stack, they must - be 8-byte-aligned. */ - if (intarg_count == NUM_GPR_ARG_REGISTERS-1 - || (intarg_count >= NUM_GPR_ARG_REGISTERS - && (intarg_count & 0x01) != 0)) - intarg_count++; - intarg_count += 2; -#endif - break; - - case FFI_TYPE_STRUCT: - size_al = (*ptr)->size; -#if defined(POWERPC_DARWIN64) - align_words = (*ptr)->alignment >> 3; - if (align_words) - intarg_count = FFI_ALIGN(intarg_count, align_words); - /* Base size of the struct. */ - intarg_count += (size_al + 7) / 8; - /* If 16 bytes then don't worry about floats. */ - if (size_al != 16) - /* Scan through for floats to be placed in regs. */ - darwin64_scan_struct_for_floats (*ptr, &fparg_count) ; -#else - align_words = (*ptr)->alignment >> 2; - if (align_words) - intarg_count = FFI_ALIGN(intarg_count, align_words); - /* If the first member of the struct is a double, then align - the struct to double-word. - if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE) - size_al = FFI_ALIGN((*ptr)->size, 8); */ -# ifdef POWERPC64 - intarg_count += (size_al + 7) / 8; -# else - intarg_count += (size_al + 3) / 4; -# endif -#endif - break; - - default: - /* Everything else is passed as a 4-byte word in a GPR, either - the object itself or a pointer to it. */ - intarg_count++; - break; - } - } - - if (fparg_count != 0) - flags |= FLAG_FP_ARGUMENTS; - -#if defined(POWERPC_DARWIN64) - /* Space to image the FPR registers, if needed - which includes when they might be - used in a struct return. */ - if (fparg_count != 0 - || ((flags & FLAG_RETURNS_STRUCT) - && (flags & FLAG_RETURNS_FP))) - bytes += NUM_FPR_ARG_REGISTERS * sizeof(double); -#else - /* Space for the FPR registers, if needed. */ - if (fparg_count != 0) - bytes += NUM_FPR_ARG_REGISTERS * sizeof(double); -#endif - - /* Stack space. */ -#ifdef POWERPC64 - if ((intarg_count + fparg_count) > NUM_GPR_ARG_REGISTERS) - bytes += (intarg_count + fparg_count) * sizeof(long); -#else - if ((intarg_count + 2 * fparg_count) > NUM_GPR_ARG_REGISTERS) - bytes += (intarg_count + 2 * fparg_count) * sizeof(long); -#endif - else - bytes += NUM_GPR_ARG_REGISTERS * sizeof(long); - - /* The stack space allocated needs to be a multiple of 16 bytes. */ - bytes = FFI_ALIGN(bytes, 16) ; - - cif->flags = flags; - cif->bytes = bytes; - - return FFI_OK; -} - -extern void ffi_call_AIX(extended_cif *, long, unsigned, unsigned *, - void (*fn)(void), void (*fn2)(void)); - -#if defined (FFI_GO_CLOSURES) -extern void ffi_call_go_AIX(extended_cif *, long, unsigned, unsigned *, - void (*fn)(void), void (*fn2)(void), void *closure); -#endif - -extern void ffi_call_DARWIN(extended_cif *, long, unsigned, unsigned *, - void (*fn)(void), void (*fn2)(void), ffi_type*); - -void -ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return - value address then we need to make one. */ - - if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) - { - ecif.rvalue = alloca (cif->rtype->size); - } - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_AIX: - ffi_call_AIX(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn, - FFI_FN(ffi_prep_args)); - break; - case FFI_DARWIN: - ffi_call_DARWIN(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn, - FFI_FN(ffi_prep_args), cif->rtype); - break; - default: - FFI_ASSERT(0); - break; - } -} - -#if defined (FFI_GO_CLOSURES) -void -ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, - void *closure) -{ - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return - value address then we need to make one. */ - - if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) - { - ecif.rvalue = alloca (cif->rtype->size); - } - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_AIX: - ffi_call_go_AIX(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn, - FFI_FN(ffi_prep_args), closure); - break; - default: - FFI_ASSERT(0); - break; - } -} -#endif - -static void flush_icache(char *); -static void flush_range(char *, int); - -/* The layout of a function descriptor. A C function pointer really - points to one of these. */ - -typedef struct aix_fd_struct { - void *code_pointer; - void *toc; -} aix_fd; - -/* here I'd like to add the stack frame layout we use in darwin_closure.S - and aix_closure.S - - m32/m64 - - The stack layout looks like this: - - | Additional params... | | Higher address - ~ ~ ~ - | Parameters (at least 8*4/8=32/64) | | NUM_GPR_ARG_REGISTERS - |--------------------------------------------| | - | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | - |--------------------------------------------| | - | Reserved 2*4/8 | | - |--------------------------------------------| | - | Space for callee's LR 4/8 | | - |--------------------------------------------| | - | Saved CR [low word for m64] 4/8 | | - |--------------------------------------------| | - | Current backchain pointer 4/8 |-/ Parent's frame. - |--------------------------------------------| <+ <<< on entry to ffi_closure_ASM - | Result Bytes 16 | | - |--------------------------------------------| | - ~ padding to 16-byte alignment ~ ~ - |--------------------------------------------| | - | NUM_FPR_ARG_REGISTERS slots | | - | here fp13 .. fp1 13*8 | | - |--------------------------------------------| | - | R3..R10 8*4/8=32/64 | | NUM_GPR_ARG_REGISTERS - |--------------------------------------------| | - | TOC=R2 (AIX) Reserved (Darwin) 4/8 | | - |--------------------------------------------| | stack | - | Reserved [compiler,binder] 2*4/8 | | grows | - |--------------------------------------------| | down V - | Space for callee's LR 4/8 | | - |--------------------------------------------| | lower addresses - | Saved CR [low word for m64] 4/8 | | - |--------------------------------------------| | stack pointer here - | Current backchain pointer 4/8 |-/ during - |--------------------------------------------| <<< ffi_closure_ASM. - -*/ - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - unsigned int *tramp; - struct ffi_aix_trampoline_struct *tramp_aix; - aix_fd *fd; - - switch (cif->abi) - { - case FFI_DARWIN: - - FFI_ASSERT (cif->abi == FFI_DARWIN); - - tramp = (unsigned int *) &closure->tramp[0]; -#if defined(POWERPC_DARWIN64) - tramp[0] = 0x7c0802a6; /* mflr r0 */ - tramp[1] = 0x429f0015; /* bcl- 20,4*cr7+so, +0x18 (L1) */ - /* We put the addresses here. */ - tramp[6] = 0x7d6802a6; /*L1: mflr r11 */ - tramp[7] = 0xe98b0000; /* ld r12,0(r11) function address */ - tramp[8] = 0x7c0803a6; /* mtlr r0 */ - tramp[9] = 0x7d8903a6; /* mtctr r12 */ - tramp[10] = 0xe96b0008; /* lwz r11,8(r11) static chain */ - tramp[11] = 0x4e800420; /* bctr */ - - *((unsigned long *)&tramp[2]) = (unsigned long) ffi_closure_ASM; /* function */ - *((unsigned long *)&tramp[4]) = (unsigned long) codeloc; /* context */ -#else - tramp[0] = 0x7c0802a6; /* mflr r0 */ - tramp[1] = 0x429f000d; /* bcl- 20,4*cr7+so,0x10 */ - tramp[4] = 0x7d6802a6; /* mflr r11 */ - tramp[5] = 0x818b0000; /* lwz r12,0(r11) function address */ - tramp[6] = 0x7c0803a6; /* mtlr r0 */ - tramp[7] = 0x7d8903a6; /* mtctr r12 */ - tramp[8] = 0x816b0004; /* lwz r11,4(r11) static chain */ - tramp[9] = 0x4e800420; /* bctr */ - tramp[2] = (unsigned long) ffi_closure_ASM; /* function */ - tramp[3] = (unsigned long) codeloc; /* context */ -#endif - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - /* Flush the icache. Only necessary on Darwin. */ - flush_range(codeloc, FFI_TRAMPOLINE_SIZE); - - break; - - case FFI_AIX: - - tramp_aix = (struct ffi_aix_trampoline_struct *) (closure->tramp); - fd = (aix_fd *)(void *)ffi_closure_ASM; - - FFI_ASSERT (cif->abi == FFI_AIX); - - tramp_aix->code_pointer = fd->code_pointer; - tramp_aix->toc = fd->toc; - tramp_aix->static_chain = codeloc; - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - break; - - default: - return FFI_BAD_ABI; - break; - } - return FFI_OK; -} - -#if defined (FFI_GO_CLOSURES) -ffi_status -ffi_prep_go_closure (ffi_go_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*)) -{ - switch (cif->abi) - { - case FFI_AIX: - - FFI_ASSERT (cif->abi == FFI_AIX); - - closure->tramp = (void *)ffi_go_closure_ASM; - closure->cif = cif; - closure->fun = fun; - return FFI_OK; - - // For now, ffi_prep_go_closure is only implemented for AIX, not for Darwin - default: - return FFI_BAD_ABI; - break; - } - return FFI_OK; -} -#endif - -static void -flush_icache(char *addr) -{ -#ifndef _AIX - __asm__ volatile ( - "dcbf 0,%0\n" - "\tsync\n" - "\ticbi 0,%0\n" - "\tsync\n" - "\tisync" - : : "r"(addr) : "memory"); -#endif -} - -static void -flush_range(char * addr1, int size) -{ -#define MIN_LINE_SIZE 32 - int i; - for (i = 0; i < size; i += MIN_LINE_SIZE) - flush_icache(addr1+i); - flush_icache(addr1+size-1); -} - -typedef union -{ - float f; - double d; -} ffi_dblfl; - -ffi_type * -ffi_closure_helper_DARWIN (ffi_closure *, void *, - unsigned long *, ffi_dblfl *); - -#if defined (FFI_GO_CLOSURES) -ffi_type * -ffi_go_closure_helper_DARWIN (ffi_go_closure*, void *, - unsigned long *, ffi_dblfl *); -#endif - -/* Basically the trampoline invokes ffi_closure_ASM, and on - entry, r11 holds the address of the closure. - After storing the registers that could possibly contain - parameters to be passed into the stack frame and setting - up space for a return value, ffi_closure_ASM invokes the - following helper function to do most of the work. */ - -static ffi_type * -ffi_closure_helper_common (ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, void *rvalue, - unsigned long *pgr, ffi_dblfl *pfr) -{ - /* rvalue is the pointer to space for return value in closure assembly - pgr is the pointer to where r3-r10 are stored in ffi_closure_ASM - pfr is the pointer to where f1-f13 are stored in ffi_closure_ASM. */ - - typedef double ldbits[2]; - - union ldu - { - ldbits lb; - long double ld; - }; - - void ** avalue; - ffi_type ** arg_types; - long i, avn; - ffi_dblfl * end_pfr = pfr + NUM_FPR_ARG_REGISTERS; - unsigned size_al; -#if defined(POWERPC_DARWIN64) - unsigned fpsused = 0; -#endif - - avalue = alloca (cif->nargs * sizeof(void *)); - - if (cif->rtype->type == FFI_TYPE_STRUCT) - { -#if defined(POWERPC_DARWIN64) - if (!darwin64_struct_ret_by_value_p (cif->rtype)) - { - /* Won't fit into the regs - return by ref. */ - rvalue = (void *) *pgr; - pgr++; - } -#elif defined(DARWIN_PPC) - if (cif->rtype->size > 4) - { - rvalue = (void *) *pgr; - pgr++; - } -#else /* assume we return by ref. */ - rvalue = (void *) *pgr; - pgr++; -#endif - } - - i = 0; - avn = cif->nargs; - arg_types = cif->arg_types; - - /* Grab the addresses of the arguments from the stack frame. */ - while (i < avn) - { - switch (arg_types[i]->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: -#if defined(POWERPC64) - avalue[i] = (char *) pgr + 7; -#else - avalue[i] = (char *) pgr + 3; -#endif - pgr++; - break; - - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: -#if defined(POWERPC64) - avalue[i] = (char *) pgr + 6; -#else - avalue[i] = (char *) pgr + 2; -#endif - pgr++; - break; - - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: -#if defined(POWERPC64) - avalue[i] = (char *) pgr + 4; -#else - case FFI_TYPE_POINTER: - avalue[i] = pgr; -#endif - pgr++; - break; - - case FFI_TYPE_STRUCT: - size_al = arg_types[i]->size; -#if defined(POWERPC_DARWIN64) - pgr = (unsigned long *)FFI_ALIGN((char *)pgr, arg_types[i]->alignment); - if (size_al < 3 || size_al == 4) - { - avalue[i] = ((char *)pgr)+8-size_al; - if (arg_types[i]->elements[0]->type == FFI_TYPE_FLOAT - && fpsused < NUM_FPR_ARG_REGISTERS) - { - *(float *)pgr = (float) *(double *)pfr; - pfr++; - fpsused++; - } - } - else - { - if (size_al != 16) - pfr = (ffi_dblfl *) - darwin64_struct_floats_to_mem (arg_types[i], (char *)pgr, - (double *)pfr, &fpsused); - avalue[i] = pgr; - } - pgr += (size_al + 7) / 8; -#else - /* If the first member of the struct is a double, then align - the struct to double-word. */ - if (arg_types[i]->elements[0]->type == FFI_TYPE_DOUBLE) - size_al = FFI_ALIGN(arg_types[i]->size, 8); -# if defined(POWERPC64) - FFI_ASSERT (cif->abi != FFI_DARWIN); - avalue[i] = pgr; - pgr += (size_al + 7) / 8; -# else - /* Structures that match the basic modes (QI 1 byte, HI 2 bytes, - SI 4 bytes) are aligned as if they were those modes. */ - if (size_al < 3 && cif->abi == FFI_DARWIN) - avalue[i] = (char*) pgr + 4 - size_al; - else - avalue[i] = pgr; - pgr += (size_al + 3) / 4; -# endif -#endif - break; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: -#if defined(POWERPC64) - case FFI_TYPE_POINTER: - avalue[i] = pgr; - pgr++; - break; -#else - /* Long long ints are passed in two gpr's. */ - avalue[i] = pgr; - pgr += 2; - break; -#endif - - case FFI_TYPE_FLOAT: - /* A float value consumes a GPR. - There are 13 64bit floating point registers. */ - if (pfr < end_pfr) - { - double temp = pfr->d; - pfr->f = (float) temp; - avalue[i] = pfr; - pfr++; - } - else - { - avalue[i] = pgr; - } - pgr++; - break; - - case FFI_TYPE_DOUBLE: - /* A double value consumes two GPRs. - There are 13 64bit floating point registers. */ - if (pfr < end_pfr) - { - avalue[i] = pfr; - pfr++; - } - else - { - avalue[i] = pgr; - } -#ifdef POWERPC64 - pgr++; -#else - pgr += 2; -#endif - break; - -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - - case FFI_TYPE_LONGDOUBLE: -#ifdef POWERPC64 - if (pfr + 1 < end_pfr) - { - avalue[i] = pfr; - pfr += 2; - } - else - { - if (pfr < end_pfr) - { - *pgr = *(unsigned long *) pfr; - pfr++; - } - avalue[i] = pgr; - } - pgr += 2; -#else /* POWERPC64 */ - /* A long double value consumes four GPRs and two FPRs. - There are 13 64bit floating point registers. */ - if (pfr + 1 < end_pfr) - { - avalue[i] = pfr; - pfr += 2; - } - /* Here we have the situation where one part of the long double - is stored in fpr13 and the other part is already on the stack. - We use a union to pass the long double to avalue[i]. */ - else if (pfr + 1 == end_pfr) - { - union ldu temp_ld; - memcpy (&temp_ld.lb[0], pfr, sizeof(ldbits)); - memcpy (&temp_ld.lb[1], pgr + 2, sizeof(ldbits)); - avalue[i] = &temp_ld.ld; - pfr++; - } - else - { - avalue[i] = pgr; - } - pgr += 4; -#endif /* POWERPC64 */ - break; -#endif - default: - FFI_ASSERT(0); - } - i++; - } - - (fun) (cif, rvalue, avalue, user_data); - - /* Tell ffi_closure_ASM to perform return type promotions. */ - return cif->rtype; -} - -ffi_type * -ffi_closure_helper_DARWIN (ffi_closure *closure, void *rvalue, - unsigned long *pgr, ffi_dblfl *pfr) -{ - return ffi_closure_helper_common (closure->cif, closure->fun, - closure->user_data, rvalue, pgr, pfr); -} - -#if defined (FFI_GO_CLOSURES) -ffi_type * -ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue, - unsigned long *pgr, ffi_dblfl *pfr) -{ - return ffi_closure_helper_common (closure->cif, closure->fun, - closure, rvalue, pgr, pfr); -} -#endif diff --git a/deps/libffi/src/powerpc/ffi_linux64.c b/deps/libffi/src/powerpc/ffi_linux64.c deleted file mode 100644 index 90100a4d8b8b5f..00000000000000 --- a/deps/libffi/src/powerpc/ffi_linux64.c +++ /dev/null @@ -1,1160 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi_linux64.c - Copyright (C) 2013 IBM - Copyright (C) 2011 Anthony Green - Copyright (C) 2011 Kyle Moffett - Copyright (C) 2008 Red Hat, Inc - Copyright (C) 2007, 2008 Free Software Foundation, Inc - Copyright (c) 1998 Geoffrey Keating - - PowerPC Foreign Function Interface - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#include "ffi.h" -#include - -#ifdef POWERPC64 -#include "ffi_common.h" -#include "ffi_powerpc.h" - - -/* About the LINUX64 ABI. */ -enum { - NUM_GPR_ARG_REGISTERS64 = 8, - NUM_FPR_ARG_REGISTERS64 = 13, - NUM_VEC_ARG_REGISTERS64 = 12, -}; -enum { ASM_NEEDS_REGISTERS64 = 4 }; - - -#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE -/* Adjust size of ffi_type_longdouble. */ -void FFI_HIDDEN -ffi_prep_types_linux64 (ffi_abi abi) -{ - if ((abi & (FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128)) == FFI_LINUX) - { - ffi_type_longdouble.size = 8; - ffi_type_longdouble.alignment = 8; - } - else - { - ffi_type_longdouble.size = 16; - ffi_type_longdouble.alignment = 16; - } -} -#endif - - -static unsigned int -discover_homogeneous_aggregate (ffi_abi abi, - const ffi_type *t, - unsigned int *elnum) -{ - switch (t->type) - { -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - /* 64-bit long doubles are equivalent to doubles. */ - if ((abi & FFI_LINUX_LONG_DOUBLE_128) == 0) - { - *elnum = 1; - return FFI_TYPE_DOUBLE; - } - /* IBM extended precision values use unaligned pairs - of FPRs, but according to the ABI must be considered - distinct from doubles. They are also limited to a - maximum of four members in a homogeneous aggregate. */ - else if ((abi & FFI_LINUX_LONG_DOUBLE_IEEE128) == 0) - { - *elnum = 2; - return FFI_TYPE_LONGDOUBLE; - } - /* Fall through. */ -#endif - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - *elnum = 1; - return (int) t->type; - - case FFI_TYPE_STRUCT:; - { - unsigned int base_elt = 0, total_elnum = 0; - ffi_type **el = t->elements; - while (*el) - { - unsigned int el_elt, el_elnum = 0; - el_elt = discover_homogeneous_aggregate (abi, *el, &el_elnum); - if (el_elt == 0 - || (base_elt && base_elt != el_elt)) - return 0; - base_elt = el_elt; - total_elnum += el_elnum; -#if _CALL_ELF == 2 - if (total_elnum > 8) - return 0; -#else - if (total_elnum > 1) - return 0; -#endif - el++; - } - *elnum = total_elnum; - return base_elt; - } - - default: - return 0; - } -} - - -/* Perform machine dependent cif processing */ -static ffi_status -ffi_prep_cif_linux64_core (ffi_cif *cif) -{ - ffi_type **ptr; - unsigned bytes; - unsigned i, fparg_count = 0, intarg_count = 0, vecarg_count = 0; - unsigned flags = cif->flags; - unsigned elt, elnum, rtype; - -#if FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE - /* If compiled without long double support... */ - if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0 || - (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - return FFI_BAD_ABI; -#elif !defined(__VEC__) - /* If compiled without vector register support (used by assembly)... */ - if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - return FFI_BAD_ABI; -#else - /* If the IEEE128 flag is set, but long double is only 64 bits wide... */ - if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) == 0 && - (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - return FFI_BAD_ABI; -#endif - - /* The machine-independent calculation of cif->bytes doesn't work - for us. Redo the calculation. */ -#if _CALL_ELF == 2 - /* Space for backchain, CR, LR, TOC and the asm's temp regs. */ - bytes = (4 + ASM_NEEDS_REGISTERS64) * sizeof (long); - - /* Space for the general registers. */ - bytes += NUM_GPR_ARG_REGISTERS64 * sizeof (long); -#else - /* Space for backchain, CR, LR, cc/ld doubleword, TOC and the asm's temp - regs. */ - bytes = (6 + ASM_NEEDS_REGISTERS64) * sizeof (long); - - /* Space for the mandatory parm save area and general registers. */ - bytes += 2 * NUM_GPR_ARG_REGISTERS64 * sizeof (long); -#endif - - /* Return value handling. */ - rtype = cif->rtype->type; -#if _CALL_ELF == 2 -homogeneous: -#endif - switch (rtype) - { -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - { - flags |= FLAG_RETURNS_VEC; - break; - } - if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) - flags |= FLAG_RETURNS_128BITS; - /* Fall through. */ -#endif - case FFI_TYPE_DOUBLE: - flags |= FLAG_RETURNS_64BITS; - /* Fall through. */ - case FFI_TYPE_FLOAT: - flags |= FLAG_RETURNS_FP; - break; - - case FFI_TYPE_UINT128: - flags |= FLAG_RETURNS_128BITS; - /* Fall through. */ - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_POINTER: - flags |= FLAG_RETURNS_64BITS; - break; - - case FFI_TYPE_STRUCT: -#if _CALL_ELF == 2 - elt = discover_homogeneous_aggregate (cif->abi, cif->rtype, &elnum); - if (elt) - { - flags |= FLAG_RETURNS_SMST; - rtype = elt; - goto homogeneous; - } - if (cif->rtype->size <= 16) - { - flags |= FLAG_RETURNS_SMST; - break; - } -#endif - intarg_count++; - flags |= FLAG_RETVAL_REFERENCE; - /* Fall through. */ - case FFI_TYPE_VOID: - flags |= FLAG_RETURNS_NOTHING; - break; - - default: - /* Returns 32-bit integer, or similar. Nothing to do here. */ - break; - } - - for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) - { - unsigned int align; - - switch ((*ptr)->type) - { -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - { - vecarg_count++; - /* Align to 16 bytes, plus the 16-byte argument. */ - intarg_count = (intarg_count + 3) & ~0x1; - if (vecarg_count > NUM_VEC_ARG_REGISTERS64) - flags |= FLAG_ARG_NEEDS_PSAVE; - break; - } - if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) - { - fparg_count++; - intarg_count++; - } - /* Fall through. */ -#endif - case FFI_TYPE_DOUBLE: - case FFI_TYPE_FLOAT: - fparg_count++; - intarg_count++; - if (fparg_count > NUM_FPR_ARG_REGISTERS64) - flags |= FLAG_ARG_NEEDS_PSAVE; - break; - - case FFI_TYPE_STRUCT: - if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0) - { - align = (*ptr)->alignment; - if (align > 16) - align = 16; - align = align / 8; - if (align > 1) - intarg_count = FFI_ALIGN (intarg_count, align); - } - intarg_count += ((*ptr)->size + 7) / 8; - elt = discover_homogeneous_aggregate (cif->abi, *ptr, &elnum); -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - if (elt == FFI_TYPE_LONGDOUBLE && - (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - { - vecarg_count += elnum; - if (vecarg_count > NUM_VEC_ARG_REGISTERS64) - flags |= FLAG_ARG_NEEDS_PSAVE; - break; - } - else -#endif - if (elt) - { - fparg_count += elnum; - if (fparg_count > NUM_FPR_ARG_REGISTERS64) - flags |= FLAG_ARG_NEEDS_PSAVE; - } - else - { - if (intarg_count > NUM_GPR_ARG_REGISTERS64) - flags |= FLAG_ARG_NEEDS_PSAVE; - } - break; - - case FFI_TYPE_POINTER: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - /* Everything else is passed as a 8-byte word in a GPR, either - the object itself or a pointer to it. */ - intarg_count++; - if (intarg_count > NUM_GPR_ARG_REGISTERS64) - flags |= FLAG_ARG_NEEDS_PSAVE; - break; - default: - FFI_ASSERT (0); - } - } - - if (fparg_count != 0) - flags |= FLAG_FP_ARGUMENTS; - if (intarg_count > 4) - flags |= FLAG_4_GPR_ARGUMENTS; - if (vecarg_count != 0) - flags |= FLAG_VEC_ARGUMENTS; - - /* Space for the FPR registers, if needed. */ - if (fparg_count != 0) - bytes += NUM_FPR_ARG_REGISTERS64 * sizeof (double); - /* Space for the vector registers, if needed, aligned to 16 bytes. */ - if (vecarg_count != 0) { - bytes = (bytes + 15) & ~0xF; - bytes += NUM_VEC_ARG_REGISTERS64 * sizeof (float128); - } - - /* Stack space. */ -#if _CALL_ELF == 2 - if ((flags & FLAG_ARG_NEEDS_PSAVE) != 0) - bytes += intarg_count * sizeof (long); -#else - if (intarg_count > NUM_GPR_ARG_REGISTERS64) - bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long); -#endif - - /* The stack space allocated needs to be a multiple of 16 bytes. */ - bytes = (bytes + 15) & ~0xF; - - cif->flags = flags; - cif->bytes = bytes; - - return FFI_OK; -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_linux64 (ffi_cif *cif) -{ - if ((cif->abi & FFI_LINUX) != 0) - cif->nfixedargs = cif->nargs; -#if _CALL_ELF != 2 - else if (cif->abi == FFI_COMPAT_LINUX64) - { - /* This call is from old code. Don't touch cif->nfixedargs - since old code will be using a smaller cif. */ - cif->flags |= FLAG_COMPAT; - /* Translate to new abi value. */ - cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128; - } -#endif - else - return FFI_BAD_ABI; - return ffi_prep_cif_linux64_core (cif); -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_linux64_var (ffi_cif *cif, - unsigned int nfixedargs, - unsigned int ntotalargs MAYBE_UNUSED) -{ - if ((cif->abi & FFI_LINUX) != 0) - cif->nfixedargs = nfixedargs; -#if _CALL_ELF != 2 - else if (cif->abi == FFI_COMPAT_LINUX64) - { - /* This call is from old code. Don't touch cif->nfixedargs - since old code will be using a smaller cif. */ - cif->flags |= FLAG_COMPAT; - /* Translate to new abi value. */ - cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128; - } -#endif - else - return FFI_BAD_ABI; -#if _CALL_ELF == 2 - cif->flags |= FLAG_ARG_NEEDS_PSAVE; -#endif - return ffi_prep_cif_linux64_core (cif); -} - - -/* ffi_prep_args64 is called by the assembly routine once stack space - has been allocated for the function's arguments. - - The stack layout we want looks like this: - - | Ret addr from ffi_call_LINUX64 8bytes | higher addresses - |--------------------------------------------| - | CR save area 8bytes | - |--------------------------------------------| - | Previous backchain pointer 8 | stack pointer here - |--------------------------------------------|<+ <<< on entry to - | Saved r28-r31 4*8 | | ffi_call_LINUX64 - |--------------------------------------------| | - | GPR registers r3-r10 8*8 | | - |--------------------------------------------| | - | FPR registers f1-f13 (optional) 13*8 | | - |--------------------------------------------| | - | VEC registers v2-v13 (optional) 12*16 | | - |--------------------------------------------| | - | Parameter save area | | - |--------------------------------------------| | - | TOC save area 8 | | - |--------------------------------------------| | stack | - | Linker doubleword 8 | | grows | - |--------------------------------------------| | down V - | Compiler doubleword 8 | | - |--------------------------------------------| | lower addresses - | Space for callee's LR 8 | | - |--------------------------------------------| | - | CR save area 8 | | - |--------------------------------------------| | stack pointer here - | Current backchain pointer 8 |-/ during - |--------------------------------------------| <<< ffi_call_LINUX64 - -*/ - -void FFI_HIDDEN -ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) -{ - const unsigned long bytes = ecif->cif->bytes; - const unsigned long flags = ecif->cif->flags; - - typedef union - { - char *c; - unsigned long *ul; - float *f; - double *d; - float128 *f128; - size_t p; - } valp; - - /* 'stacktop' points at the previous backchain pointer. */ - valp stacktop; - - /* 'next_arg' points at the space for gpr3, and grows upwards as - we use GPR registers, then continues at rest. */ - valp gpr_base; - valp gpr_end; - valp rest; - valp next_arg; - - /* 'fpr_base' points at the space for f1, and grows upwards as - we use FPR registers. */ - valp fpr_base; - unsigned int fparg_count; - - /* 'vec_base' points at the space for v2, and grows upwards as - we use vector registers. */ - valp vec_base; - unsigned int vecarg_count; - - unsigned int i, words, nargs, nfixedargs; - ffi_type **ptr; - double double_tmp; - union - { - void **v; - char **c; - signed char **sc; - unsigned char **uc; - signed short **ss; - unsigned short **us; - signed int **si; - unsigned int **ui; - unsigned long **ul; - float **f; - double **d; - float128 **f128; - } p_argv; - unsigned long gprvalue; - unsigned long align; - - stacktop.c = (char *) stack + bytes; - gpr_base.ul = stacktop.ul - ASM_NEEDS_REGISTERS64 - NUM_GPR_ARG_REGISTERS64; - gpr_end.ul = gpr_base.ul + NUM_GPR_ARG_REGISTERS64; -#if _CALL_ELF == 2 - rest.ul = stack + 4 + NUM_GPR_ARG_REGISTERS64; -#else - rest.ul = stack + 6 + NUM_GPR_ARG_REGISTERS64; -#endif - fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS64; - fparg_count = 0; - /* Place the vector args below the FPRs, if used, else the GPRs. */ - if (ecif->cif->flags & FLAG_FP_ARGUMENTS) - vec_base.p = fpr_base.p & ~0xF; - else - vec_base.p = gpr_base.p; - vec_base.f128 -= NUM_VEC_ARG_REGISTERS64; - vecarg_count = 0; - next_arg.ul = gpr_base.ul; - - /* Check that everything starts aligned properly. */ - FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0); - FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0); - FFI_ASSERT (((unsigned long) gpr_base.c & 0xF) == 0); - FFI_ASSERT (((unsigned long) gpr_end.c & 0xF) == 0); - FFI_ASSERT (((unsigned long) vec_base.c & 0xF) == 0); - FFI_ASSERT ((bytes & 0xF) == 0); - - /* Deal with return values that are actually pass-by-reference. */ - if (flags & FLAG_RETVAL_REFERENCE) - *next_arg.ul++ = (unsigned long) (char *) ecif->rvalue; - - /* Now for the arguments. */ - p_argv.v = ecif->avalue; - nargs = ecif->cif->nargs; -#if _CALL_ELF != 2 - nfixedargs = (unsigned) -1; - if ((flags & FLAG_COMPAT) == 0) -#endif - nfixedargs = ecif->cif->nfixedargs; - for (ptr = ecif->cif->arg_types, i = 0; - i < nargs; - i++, ptr++, p_argv.v++) - { - unsigned int elt, elnum; - - switch ((*ptr)->type) - { -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - { - next_arg.p = FFI_ALIGN (next_arg.p, 16); - if (next_arg.ul == gpr_end.ul) - next_arg.ul = rest.ul; - if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs) - memcpy (vec_base.f128++, *p_argv.f128, sizeof (float128)); - else - memcpy (next_arg.f128, *p_argv.f128, sizeof (float128)); - if (++next_arg.f128 == gpr_end.f128) - next_arg.f128 = rest.f128; - vecarg_count++; - FFI_ASSERT (__LDBL_MANT_DIG__ == 113); - FFI_ASSERT (flags & FLAG_VEC_ARGUMENTS); - break; - } - if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) - { - double_tmp = (*p_argv.d)[0]; - if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) - { - *fpr_base.d++ = double_tmp; -# if _CALL_ELF != 2 - if ((flags & FLAG_COMPAT) != 0) - *next_arg.d = double_tmp; -# endif - } - else - *next_arg.d = double_tmp; - if (++next_arg.ul == gpr_end.ul) - next_arg.ul = rest.ul; - fparg_count++; - double_tmp = (*p_argv.d)[1]; - if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) - { - *fpr_base.d++ = double_tmp; -# if _CALL_ELF != 2 - if ((flags & FLAG_COMPAT) != 0) - *next_arg.d = double_tmp; -# endif - } - else - *next_arg.d = double_tmp; - if (++next_arg.ul == gpr_end.ul) - next_arg.ul = rest.ul; - fparg_count++; - FFI_ASSERT (__LDBL_MANT_DIG__ == 106); - FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); - break; - } - /* Fall through. */ -#endif - case FFI_TYPE_DOUBLE: -#if _CALL_ELF != 2 - do_double: -#endif - double_tmp = **p_argv.d; - if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) - { - *fpr_base.d++ = double_tmp; -#if _CALL_ELF != 2 - if ((flags & FLAG_COMPAT) != 0) - *next_arg.d = double_tmp; -#endif - } - else - *next_arg.d = double_tmp; - if (++next_arg.ul == gpr_end.ul) - next_arg.ul = rest.ul; - fparg_count++; - FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); - break; - - case FFI_TYPE_FLOAT: -#if _CALL_ELF != 2 - do_float: -#endif - double_tmp = **p_argv.f; - if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) - { - *fpr_base.d++ = double_tmp; -#if _CALL_ELF != 2 - if ((flags & FLAG_COMPAT) != 0) - { -# ifndef __LITTLE_ENDIAN__ - next_arg.f[1] = (float) double_tmp; -# else - next_arg.f[0] = (float) double_tmp; -# endif - } -#endif - } - else - { -# ifndef __LITTLE_ENDIAN__ - next_arg.f[1] = (float) double_tmp; -# else - next_arg.f[0] = (float) double_tmp; -# endif - } - if (++next_arg.ul == gpr_end.ul) - next_arg.ul = rest.ul; - fparg_count++; - FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); - break; - - case FFI_TYPE_STRUCT: - if ((ecif->cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0) - { - align = (*ptr)->alignment; - if (align > 16) - align = 16; - if (align > 1) - { - next_arg.p = FFI_ALIGN (next_arg.p, align); - if (next_arg.ul == gpr_end.ul) - next_arg.ul = rest.ul; - } - } - elt = discover_homogeneous_aggregate (ecif->cif->abi, *ptr, &elnum); - if (elt) - { -#if _CALL_ELF == 2 - union { - void *v; - float *f; - double *d; - float128 *f128; - } arg; - - arg.v = *p_argv.v; -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - if (elt == FFI_TYPE_LONGDOUBLE && - (ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - { - do - { - if (vecarg_count < NUM_VEC_ARG_REGISTERS64 - && i < nfixedargs) - memcpy (vec_base.f128++, arg.f128++, sizeof (float128)); - else - memcpy (next_arg.f128, arg.f128++, sizeof (float128)); - if (++next_arg.f128 == gpr_end.f128) - next_arg.f128 = rest.f128; - vecarg_count++; - } - while (--elnum != 0); - } - else -#endif - if (elt == FFI_TYPE_FLOAT) - { - do - { - double_tmp = *arg.f++; - if (fparg_count < NUM_FPR_ARG_REGISTERS64 - && i < nfixedargs) - *fpr_base.d++ = double_tmp; - else - *next_arg.f = (float) double_tmp; - if (++next_arg.f == gpr_end.f) - next_arg.f = rest.f; - fparg_count++; - } - while (--elnum != 0); - if ((next_arg.p & 7) != 0) - if (++next_arg.f == gpr_end.f) - next_arg.f = rest.f; - } - else - do - { - double_tmp = *arg.d++; - if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) - *fpr_base.d++ = double_tmp; - else - *next_arg.d = double_tmp; - if (++next_arg.d == gpr_end.d) - next_arg.d = rest.d; - fparg_count++; - } - while (--elnum != 0); -#else - if (elt == FFI_TYPE_FLOAT) - goto do_float; - else - goto do_double; -#endif - } - else - { - words = ((*ptr)->size + 7) / 8; - if (next_arg.ul >= gpr_base.ul && next_arg.ul + words > gpr_end.ul) - { - size_t first = gpr_end.c - next_arg.c; - memcpy (next_arg.c, *p_argv.c, first); - memcpy (rest.c, *p_argv.c + first, (*ptr)->size - first); - next_arg.c = rest.c + words * 8 - first; - } - else - { - char *where = next_arg.c; - -#ifndef __LITTLE_ENDIAN__ - /* Structures with size less than eight bytes are passed - left-padded. */ - if ((*ptr)->size < 8) - where += 8 - (*ptr)->size; -#endif - memcpy (where, *p_argv.c, (*ptr)->size); - next_arg.ul += words; - if (next_arg.ul == gpr_end.ul) - next_arg.ul = rest.ul; - } - } - break; - - case FFI_TYPE_UINT8: - gprvalue = **p_argv.uc; - goto putgpr; - case FFI_TYPE_SINT8: - gprvalue = **p_argv.sc; - goto putgpr; - case FFI_TYPE_UINT16: - gprvalue = **p_argv.us; - goto putgpr; - case FFI_TYPE_SINT16: - gprvalue = **p_argv.ss; - goto putgpr; - case FFI_TYPE_UINT32: - gprvalue = **p_argv.ui; - goto putgpr; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - gprvalue = **p_argv.si; - goto putgpr; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_POINTER: - gprvalue = **p_argv.ul; - putgpr: - *next_arg.ul++ = gprvalue; - if (next_arg.ul == gpr_end.ul) - next_arg.ul = rest.ul; - break; - } - } - - FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS - || (next_arg.ul >= gpr_base.ul - && next_arg.ul <= gpr_base.ul + 4)); -} - - -#if _CALL_ELF == 2 -#define MIN_CACHE_LINE_SIZE 8 - -static void -flush_icache (char *wraddr, char *xaddr, int size) -{ - int i; - for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) - __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" - : : "r" (xaddr + i), "r" (wraddr + i) : "memory"); - __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;" - : : "r"(xaddr + size - 1), "r"(wraddr + size - 1) - : "memory"); -} -#endif - - -ffi_status FFI_HIDDEN -ffi_prep_closure_loc_linux64 (ffi_closure *closure, - ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - void *codeloc) -{ - if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI) - return FFI_BAD_ABI; - -#ifdef FFI_EXEC_STATIC_TRAMP - if (ffi_tramp_is_present(closure)) - { - /* Initialize the static trampoline's parameters. */ - void (*dest)(void) = ffi_closure_LINUX64; - ffi_tramp_set_parms (closure->ftramp, dest, closure); - } - else -#endif - { -#if _CALL_ELF == 2 - unsigned int *tramp = (unsigned int *) &closure->tramp[0]; - tramp[0] = 0xe96c0018; /* 0: ld 11,2f-0b(12) */ - tramp[1] = 0xe98c0010; /* ld 12,1f-0b(12) */ - tramp[2] = 0x7d8903a6; /* mtctr 12 */ - tramp[3] = 0x4e800420; /* bctr */ - /* 1: .quad function_addr */ - /* 2: .quad context */ - *(void **) &tramp[4] = (void *) ffi_closure_LINUX64; - *(void **) &tramp[6] = codeloc; - flush_icache ((char *) tramp, (char *) codeloc, 4 * 4); -#else - /* Copy function address and TOC from ffi_closure_LINUX64 OPD. */ - void **tramp = (void **) &closure->tramp[0]; - memcpy (&tramp[0], (void **) ffi_closure_LINUX64, sizeof (void *)); - tramp[1] = codeloc; - memcpy (&tramp[2], (void **) ffi_closure_LINUX64 + 1, sizeof (void *)); -#endif - } - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - - -int FFI_HIDDEN -ffi_closure_helper_LINUX64 (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - void *rvalue, - unsigned long *pst, - ffi_dblfl *pfr, - float128 *pvec) -{ - /* rvalue is the pointer to space for return value in closure assembly */ - /* pst is the pointer to parameter save area - (r3-r10 are stored into its first 8 slots by ffi_closure_LINUX64) */ - /* pfr is the pointer to where f1-f13 are stored in ffi_closure_LINUX64 */ - /* pvec is the pointer to where v2-v13 are stored in ffi_closure_LINUX64 */ - - void **avalue; - ffi_type **arg_types; - unsigned long i, avn, nfixedargs; - ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64; - float128 *end_pvec = pvec + NUM_VEC_ARG_REGISTERS64; - unsigned long align; - - avalue = alloca (cif->nargs * sizeof (void *)); - - /* Copy the caller's structure return value address so that the - closure returns the data directly to the caller. */ - if (cif->rtype->type == FFI_TYPE_STRUCT - && (cif->flags & FLAG_RETURNS_SMST) == 0) - { - rvalue = (void *) *pst; - pst++; - } - - i = 0; - avn = cif->nargs; -#if _CALL_ELF != 2 - nfixedargs = (unsigned) -1; - if ((cif->flags & FLAG_COMPAT) == 0) -#endif - nfixedargs = cif->nfixedargs; - arg_types = cif->arg_types; - - /* Grab the addresses of the arguments from the stack frame. */ - while (i < avn) - { - unsigned int elt, elnum; - - switch (arg_types[i]->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: -#ifndef __LITTLE_ENDIAN__ - avalue[i] = (char *) pst + 7; - pst++; - break; -#endif - - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: -#ifndef __LITTLE_ENDIAN__ - avalue[i] = (char *) pst + 6; - pst++; - break; -#endif - - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: -#ifndef __LITTLE_ENDIAN__ - avalue[i] = (char *) pst + 4; - pst++; - break; -#endif - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_POINTER: - avalue[i] = pst; - pst++; - break; - - case FFI_TYPE_STRUCT: - if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0) - { - align = arg_types[i]->alignment; - if (align > 16) - align = 16; - if (align > 1) - pst = (unsigned long *) FFI_ALIGN ((size_t) pst, align); - } - elt = discover_homogeneous_aggregate (cif->abi, arg_types[i], &elnum); - if (elt) - { -#if _CALL_ELF == 2 - union { - void *v; - unsigned long *ul; - float *f; - double *d; - float128 *f128; - size_t p; - } to, from; - - /* Repackage the aggregate from its parts. The - aggregate size is not greater than the space taken by - the registers so store back to the register/parameter - save arrays. */ -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - if (elt == FFI_TYPE_LONGDOUBLE && - (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - { - if (pvec + elnum <= end_pvec) - to.v = pvec; - else - to.v = pst; - } - else -#endif - if (pfr + elnum <= end_pfr) - to.v = pfr; - else - to.v = pst; - - avalue[i] = to.v; - from.ul = pst; -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - if (elt == FFI_TYPE_LONGDOUBLE && - (cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - { - do - { - if (pvec < end_pvec && i < nfixedargs) - memcpy (to.f128, pvec++, sizeof (float128)); - else - memcpy (to.f128, from.f128, sizeof (float128)); - to.f128++; - from.f128++; - } - while (--elnum != 0); - } - else -#endif - if (elt == FFI_TYPE_FLOAT) - { - do - { - if (pfr < end_pfr && i < nfixedargs) - { - *to.f = (float) pfr->d; - pfr++; - } - else - *to.f = *from.f; - to.f++; - from.f++; - } - while (--elnum != 0); - } - else - { - do - { - if (pfr < end_pfr && i < nfixedargs) - { - *to.d = pfr->d; - pfr++; - } - else - *to.d = *from.d; - to.d++; - from.d++; - } - while (--elnum != 0); - } -#else - if (elt == FFI_TYPE_FLOAT) - goto do_float; - else - goto do_double; -#endif - } - else - { -#ifndef __LITTLE_ENDIAN__ - /* Structures with size less than eight bytes are passed - left-padded. */ - if (arg_types[i]->size < 8) - avalue[i] = (char *) pst + 8 - arg_types[i]->size; - else -#endif - avalue[i] = pst; - } - pst += (arg_types[i]->size + 7) / 8; - break; - -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - if ((cif->abi & FFI_LINUX_LONG_DOUBLE_IEEE128) != 0) - { - if (((unsigned long) pst & 0xF) != 0) - ++pst; - if (pvec < end_pvec && i < nfixedargs) - avalue[i] = pvec++; - else - avalue[i] = pst; - pst += 2; - break; - } - else if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) - { - if (pfr + 1 < end_pfr && i + 1 < nfixedargs) - { - avalue[i] = pfr; - pfr += 2; - } - else - { - if (pfr < end_pfr && i < nfixedargs) - { - /* Passed partly in f13 and partly on the stack. - Move it all to the stack. */ - *pst = *(unsigned long *) pfr; - pfr++; - } - avalue[i] = pst; - } - pst += 2; - break; - } - /* Fall through. */ -#endif - case FFI_TYPE_DOUBLE: -#if _CALL_ELF != 2 - do_double: -#endif - /* On the outgoing stack all values are aligned to 8 */ - /* there are 13 64bit floating point registers */ - - if (pfr < end_pfr && i < nfixedargs) - { - avalue[i] = pfr; - pfr++; - } - else - avalue[i] = pst; - pst++; - break; - - case FFI_TYPE_FLOAT: -#if _CALL_ELF != 2 - do_float: -#endif - if (pfr < end_pfr && i < nfixedargs) - { - /* Float values are stored as doubles in the - ffi_closure_LINUX64 code. Fix them here. */ - pfr->f = (float) pfr->d; - avalue[i] = pfr; - pfr++; - } - else - { -#ifndef __LITTLE_ENDIAN__ - avalue[i] = (char *) pst + 4; -#else - avalue[i] = pst; -#endif - } - pst++; - break; - - default: - FFI_ASSERT (0); - } - - i++; - } - - (*fun) (cif, rvalue, avalue, user_data); - - /* Tell ffi_closure_LINUX64 how to perform return type promotions. */ - if ((cif->flags & FLAG_RETURNS_SMST) != 0) - { - if ((cif->flags & (FLAG_RETURNS_FP | FLAG_RETURNS_VEC)) == 0) - return FFI_V2_TYPE_SMALL_STRUCT + cif->rtype->size - 1; - else if ((cif->flags & FLAG_RETURNS_VEC) != 0) - return FFI_V2_TYPE_VECTOR_HOMOG; - else if ((cif->flags & FLAG_RETURNS_64BITS) != 0) - return FFI_V2_TYPE_DOUBLE_HOMOG; - else - return FFI_V2_TYPE_FLOAT_HOMOG; - } - if ((cif->flags & FLAG_RETURNS_VEC) != 0) - return FFI_V2_TYPE_VECTOR; - return cif->rtype->type; -} -#endif diff --git a/deps/libffi/src/powerpc/ffi_powerpc.h b/deps/libffi/src/powerpc/ffi_powerpc.h deleted file mode 100644 index 960a5c42213a0d..00000000000000 --- a/deps/libffi/src/powerpc/ffi_powerpc.h +++ /dev/null @@ -1,105 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi_powerpc.h - Copyright (C) 2013 IBM - Copyright (C) 2011 Anthony Green - Copyright (C) 2011 Kyle Moffett - Copyright (C) 2008 Red Hat, Inc - Copyright (C) 2007, 2008 Free Software Foundation, Inc - Copyright (c) 1998 Geoffrey Keating - - PowerPC Foreign Function Interface - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -enum { - /* The assembly depends on these exact flags. */ - /* These go in cr7 */ - FLAG_RETURNS_SMST = 1 << (31-31), /* Used for FFI_SYSV small structs. */ - FLAG_RETURNS_NOTHING = 1 << (31-30), - FLAG_RETURNS_FP = 1 << (31-29), - FLAG_RETURNS_VEC = 1 << (31-28), - - /* These go in cr6 */ - FLAG_RETURNS_64BITS = 1 << (31-27), - FLAG_RETURNS_128BITS = 1 << (31-26), - - FLAG_COMPAT = 1 << (31- 8), /* Not used by assembly */ - - /* These go in cr1 */ - FLAG_ARG_NEEDS_COPY = 1 << (31- 7), /* Used by sysv code */ - FLAG_ARG_NEEDS_PSAVE = FLAG_ARG_NEEDS_COPY, /* Used by linux64 code */ - FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */ - FLAG_4_GPR_ARGUMENTS = 1 << (31- 5), - FLAG_RETVAL_REFERENCE = 1 << (31- 4), - FLAG_VEC_ARGUMENTS = 1 << (31- 3), -}; - -typedef union -{ - float f; - double d; -} ffi_dblfl; - -#if defined(__FLOAT128_TYPE__) && defined(__HAVE_FLOAT128) -typedef _Float128 float128; -#elif defined(__FLOAT128__) -typedef __float128 float128; -#else -typedef char float128[16] __attribute__((aligned(16))); -#endif - -void FFI_HIDDEN ffi_closure_SYSV (void); -void FFI_HIDDEN ffi_go_closure_sysv (void); -void FFI_HIDDEN ffi_call_SYSV(extended_cif *, void (*)(void), void *, - unsigned, void *, int); - -void FFI_HIDDEN ffi_prep_types_sysv (ffi_abi); -ffi_status FFI_HIDDEN ffi_prep_cif_sysv (ffi_cif *); -ffi_status FFI_HIDDEN ffi_prep_closure_loc_sysv (ffi_closure *, - ffi_cif *, - void (*) (ffi_cif *, void *, - void **, void *), - void *, void *); -int FFI_HIDDEN ffi_closure_helper_SYSV (ffi_cif *, - void (*) (ffi_cif *, void *, - void **, void *), - void *, void *, unsigned long *, - ffi_dblfl *, unsigned long *); - -void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, void (*) (void), void *, - unsigned long, void *, long); -void FFI_HIDDEN ffi_closure_LINUX64 (void); -void FFI_HIDDEN ffi_go_closure_linux64 (void); - -void FFI_HIDDEN ffi_prep_types_linux64 (ffi_abi); -ffi_status FFI_HIDDEN ffi_prep_cif_linux64 (ffi_cif *); -ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var (ffi_cif *, unsigned int, - unsigned int); -void FFI_HIDDEN ffi_prep_args64 (extended_cif *, unsigned long *const); -ffi_status FFI_HIDDEN ffi_prep_closure_loc_linux64 (ffi_closure *, ffi_cif *, - void (*) (ffi_cif *, void *, - void **, void *), - void *, void *); -int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_cif *, - void (*) (ffi_cif *, void *, - void **, void *), - void *, void *, - unsigned long *, ffi_dblfl *, - float128 *); diff --git a/deps/libffi/src/powerpc/ffi_sysv.c b/deps/libffi/src/powerpc/ffi_sysv.c deleted file mode 100644 index 5d7c5c82365899..00000000000000 --- a/deps/libffi/src/powerpc/ffi_sysv.c +++ /dev/null @@ -1,933 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi_sysv.c - Copyright (C) 2013 IBM - Copyright (C) 2011 Anthony Green - Copyright (C) 2011 Kyle Moffett - Copyright (C) 2008 Red Hat, Inc - Copyright (C) 2007, 2008 Free Software Foundation, Inc - Copyright (c) 1998 Geoffrey Keating - - PowerPC Foreign Function Interface - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ - -#include "ffi.h" -#include - -#ifndef POWERPC64 -#include "ffi_common.h" -#include "ffi_powerpc.h" - - -/* About the SYSV ABI. */ -#define ASM_NEEDS_REGISTERS 6 -#define NUM_GPR_ARG_REGISTERS 8 -#define NUM_FPR_ARG_REGISTERS 8 - - -#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE -/* Adjust size of ffi_type_longdouble. */ -void FFI_HIDDEN -ffi_prep_types_sysv (ffi_abi abi) -{ - if ((abi & (FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128)) == FFI_SYSV) - { - ffi_type_longdouble.size = 8; - ffi_type_longdouble.alignment = 8; - } - else - { - ffi_type_longdouble.size = 16; - ffi_type_longdouble.alignment = 16; - } -} -#endif - -/* Transform long double, double and float to other types as per abi. */ -static int -translate_float (int abi, int type) -{ -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - if (type == FFI_TYPE_LONGDOUBLE - && (abi & FFI_SYSV_LONG_DOUBLE_128) == 0) - type = FFI_TYPE_DOUBLE; -#endif - if ((abi & FFI_SYSV_SOFT_FLOAT) != 0) - { - if (type == FFI_TYPE_FLOAT) - type = FFI_TYPE_UINT32; - else if (type == FFI_TYPE_DOUBLE) - type = FFI_TYPE_UINT64; -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - else if (type == FFI_TYPE_LONGDOUBLE) - type = FFI_TYPE_UINT128; - } - else if ((abi & FFI_SYSV_IBM_LONG_DOUBLE) == 0) - { - if (type == FFI_TYPE_LONGDOUBLE) - type = FFI_TYPE_STRUCT; -#endif - } - return type; -} - -/* Perform machine dependent cif processing */ -static ffi_status -ffi_prep_cif_sysv_core (ffi_cif *cif) -{ - ffi_type **ptr; - unsigned bytes; - unsigned i, fpr_count = 0, gpr_count = 0, stack_count = 0; - unsigned flags = cif->flags; - unsigned struct_copy_size = 0; - unsigned type = cif->rtype->type; - unsigned size = cif->rtype->size; - - /* The machine-independent calculation of cif->bytes doesn't work - for us. Redo the calculation. */ - - /* Space for the frame pointer, callee's LR, and the asm's temp regs. */ - bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof (int); - - /* Space for the GPR registers. */ - bytes += NUM_GPR_ARG_REGISTERS * sizeof (int); - - /* Return value handling. The rules for SYSV are as follows: - - 32-bit (or less) integer values are returned in gpr3; - - Structures of size <= 4 bytes also returned in gpr3; - - 64-bit integer values and structures between 5 and 8 bytes are returned - in gpr3 and gpr4; - - Larger structures are allocated space and a pointer is passed as - the first argument. - - Single/double FP values are returned in fpr1; - - long doubles (if not equivalent to double) are returned in - fpr1,fpr2 for Linux and as for large structs for SysV. */ - - type = translate_float (cif->abi, type); - - switch (type) - { -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - flags |= FLAG_RETURNS_128BITS; - /* Fall through. */ -#endif - case FFI_TYPE_DOUBLE: - flags |= FLAG_RETURNS_64BITS; - /* Fall through. */ - case FFI_TYPE_FLOAT: - flags |= FLAG_RETURNS_FP; -#ifdef __NO_FPRS__ - return FFI_BAD_ABI; -#endif - break; - - case FFI_TYPE_UINT128: - flags |= FLAG_RETURNS_128BITS; - /* Fall through. */ - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - flags |= FLAG_RETURNS_64BITS; - break; - - case FFI_TYPE_STRUCT: - /* The final SYSV ABI says that structures smaller or equal 8 bytes - are returned in r3/r4. A draft ABI used by linux instead - returns them in memory. */ - if ((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8) - { - flags |= FLAG_RETURNS_SMST; - break; - } - gpr_count++; - flags |= FLAG_RETVAL_REFERENCE; - /* Fall through. */ - case FFI_TYPE_VOID: - flags |= FLAG_RETURNS_NOTHING; - break; - - default: - /* Returns 32-bit integer, or similar. Nothing to do here. */ - break; - } - - /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the - first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest - goes on the stack. Structures and long doubles (if not equivalent - to double) are passed as a pointer to a copy of the structure. - Stuff on the stack needs to keep proper alignment. */ - for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) - { - unsigned short typenum = (*ptr)->type; - - typenum = translate_float (cif->abi, typenum); - - switch (typenum) - { -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - if (fpr_count >= NUM_FPR_ARG_REGISTERS - 1) - { - fpr_count = NUM_FPR_ARG_REGISTERS; - /* 8-byte align long doubles. */ - stack_count += stack_count & 1; - stack_count += 4; - } - else - fpr_count += 2; -#ifdef __NO_FPRS__ - return FFI_BAD_ABI; -#endif - break; -#endif - - case FFI_TYPE_DOUBLE: - if (fpr_count >= NUM_FPR_ARG_REGISTERS) - { - /* 8-byte align doubles. */ - stack_count += stack_count & 1; - stack_count += 2; - } - else - fpr_count += 1; -#ifdef __NO_FPRS__ - return FFI_BAD_ABI; -#endif - break; - - case FFI_TYPE_FLOAT: - if (fpr_count >= NUM_FPR_ARG_REGISTERS) - /* Yes, we don't follow the ABI, but neither does gcc. */ - stack_count += 1; - else - fpr_count += 1; -#ifdef __NO_FPRS__ - return FFI_BAD_ABI; -#endif - break; - - case FFI_TYPE_UINT128: - /* A long double in FFI_LINUX_SOFT_FLOAT can use only a set - of four consecutive gprs. If we do not have enough, we - have to adjust the gpr_count value. */ - if (gpr_count >= NUM_GPR_ARG_REGISTERS - 3) - gpr_count = NUM_GPR_ARG_REGISTERS; - if (gpr_count >= NUM_GPR_ARG_REGISTERS) - stack_count += 4; - else - gpr_count += 4; - break; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - /* 'long long' arguments are passed as two words, but - either both words must fit in registers or both go - on the stack. If they go on the stack, they must - be 8-byte-aligned. - - Also, only certain register pairs can be used for - passing long long int -- specifically (r3,r4), (r5,r6), - (r7,r8), (r9,r10). */ - gpr_count += gpr_count & 1; - if (gpr_count >= NUM_GPR_ARG_REGISTERS) - { - stack_count += stack_count & 1; - stack_count += 2; - } - else - gpr_count += 2; - break; - - case FFI_TYPE_STRUCT: - /* We must allocate space for a copy of these to enforce - pass-by-value. Pad the space up to a multiple of 16 - bytes (the maximum alignment required for anything under - the SYSV ABI). */ - struct_copy_size += ((*ptr)->size + 15) & ~0xF; - /* Fall through (allocate space for the pointer). */ - - case FFI_TYPE_POINTER: - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - /* Everything else is passed as a 4-byte word in a GPR, either - the object itself or a pointer to it. */ - if (gpr_count >= NUM_GPR_ARG_REGISTERS) - stack_count += 1; - else - gpr_count += 1; - break; - - default: - FFI_ASSERT (0); - } - } - - if (fpr_count != 0) - flags |= FLAG_FP_ARGUMENTS; - if (gpr_count > 4) - flags |= FLAG_4_GPR_ARGUMENTS; - if (struct_copy_size != 0) - flags |= FLAG_ARG_NEEDS_COPY; - - /* Space for the FPR registers, if needed. */ - if (fpr_count != 0) - bytes += NUM_FPR_ARG_REGISTERS * sizeof (double); - - /* Stack space. */ - bytes += stack_count * sizeof (int); - - /* The stack space allocated needs to be a multiple of 16 bytes. */ - bytes = (bytes + 15) & ~0xF; - - /* Add in the space for the copied structures. */ - bytes += struct_copy_size; - - cif->flags = flags; - cif->bytes = bytes; - - return FFI_OK; -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_sysv (ffi_cif *cif) -{ - if ((cif->abi & FFI_SYSV) == 0) - { - /* This call is from old code. Translate to new ABI values. */ - cif->flags |= FLAG_COMPAT; - switch (cif->abi) - { - default: - return FFI_BAD_ABI; - - case FFI_COMPAT_SYSV: - cif->abi = FFI_SYSV | FFI_SYSV_STRUCT_RET | FFI_SYSV_LONG_DOUBLE_128; - break; - - case FFI_COMPAT_GCC_SYSV: - cif->abi = FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128; - break; - - case FFI_COMPAT_LINUX: - cif->abi = (FFI_SYSV | FFI_SYSV_IBM_LONG_DOUBLE - | FFI_SYSV_LONG_DOUBLE_128); - break; - - case FFI_COMPAT_LINUX_SOFT_FLOAT: - cif->abi = (FFI_SYSV | FFI_SYSV_SOFT_FLOAT | FFI_SYSV_IBM_LONG_DOUBLE - | FFI_SYSV_LONG_DOUBLE_128); - break; - } - } - return ffi_prep_cif_sysv_core (cif); -} - -/* ffi_prep_args_SYSV is called by the assembly routine once stack space - has been allocated for the function's arguments. - - The stack layout we want looks like this: - - | Return address from ffi_call_SYSV 4bytes | higher addresses - |--------------------------------------------| - | Previous backchain pointer 4 | stack pointer here - |--------------------------------------------|<+ <<< on entry to - | Saved r28-r31 4*4 | | ffi_call_SYSV - |--------------------------------------------| | - | GPR registers r3-r10 8*4 | | ffi_call_SYSV - |--------------------------------------------| | - | FPR registers f1-f8 (optional) 8*8 | | - |--------------------------------------------| | stack | - | Space for copied structures | | grows | - |--------------------------------------------| | down V - | Parameters that didn't fit in registers | | - |--------------------------------------------| | lower addresses - | Space for callee's LR 4 | | - |--------------------------------------------| | stack pointer here - | Current backchain pointer 4 |-/ during - |--------------------------------------------| <<< ffi_call_SYSV - -*/ - -void FFI_HIDDEN -ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack) -{ - const unsigned bytes = ecif->cif->bytes; - const unsigned flags = ecif->cif->flags; - - typedef union - { - char *c; - unsigned *u; - long long *ll; - float *f; - double *d; - } valp; - - /* 'stacktop' points at the previous backchain pointer. */ - valp stacktop; - - /* 'gpr_base' points at the space for gpr3, and grows upwards as - we use GPR registers. */ - valp gpr_base; - valp gpr_end; - -#ifndef __NO_FPRS__ - /* 'fpr_base' points at the space for fpr1, and grows upwards as - we use FPR registers. */ - valp fpr_base; - valp fpr_end; -#endif - - /* 'copy_space' grows down as we put structures in it. It should - stay 16-byte aligned. */ - valp copy_space; - - /* 'next_arg' grows up as we put parameters in it. */ - valp next_arg; - - int i; - ffi_type **ptr; -#ifndef __NO_FPRS__ - double double_tmp; -#endif - union - { - void **v; - char **c; - signed char **sc; - unsigned char **uc; - signed short **ss; - unsigned short **us; - unsigned int **ui; - long long **ll; - float **f; - double **d; - } p_argv; - size_t struct_copy_size; - unsigned gprvalue; - - stacktop.c = (char *) stack + bytes; - gpr_end.u = stacktop.u - ASM_NEEDS_REGISTERS; - gpr_base.u = gpr_end.u - NUM_GPR_ARG_REGISTERS; -#ifndef __NO_FPRS__ - fpr_end.d = gpr_base.d; - fpr_base.d = fpr_end.d - NUM_FPR_ARG_REGISTERS; - copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c); -#else - copy_space.c = gpr_base.c; -#endif - next_arg.u = stack + 2; - - /* Check that everything starts aligned properly. */ - FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0); - FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0); - FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0); - FFI_ASSERT ((bytes & 0xF) == 0); - FFI_ASSERT (copy_space.c >= next_arg.c); - - /* Deal with return values that are actually pass-by-reference. */ - if (flags & FLAG_RETVAL_REFERENCE) - *gpr_base.u++ = (unsigned) (char *) ecif->rvalue; - - /* Now for the arguments. */ - p_argv.v = ecif->avalue; - for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; - i > 0; - i--, ptr++, p_argv.v++) - { - unsigned int typenum = (*ptr)->type; - - typenum = translate_float (ecif->cif->abi, typenum); - - /* Now test the translated value */ - switch (typenum) - { -#ifndef __NO_FPRS__ -# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - double_tmp = (*p_argv.d)[0]; - - if (fpr_base.d >= fpr_end.d - 1) - { - fpr_base.d = fpr_end.d; - if (((next_arg.u - stack) & 1) != 0) - next_arg.u += 1; - *next_arg.d = double_tmp; - next_arg.u += 2; - double_tmp = (*p_argv.d)[1]; - *next_arg.d = double_tmp; - next_arg.u += 2; - } - else - { - *fpr_base.d++ = double_tmp; - double_tmp = (*p_argv.d)[1]; - *fpr_base.d++ = double_tmp; - } - FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); - break; -# endif - case FFI_TYPE_DOUBLE: - double_tmp = **p_argv.d; - - if (fpr_base.d >= fpr_end.d) - { - if (((next_arg.u - stack) & 1) != 0) - next_arg.u += 1; - *next_arg.d = double_tmp; - next_arg.u += 2; - } - else - *fpr_base.d++ = double_tmp; - FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); - break; - - case FFI_TYPE_FLOAT: - double_tmp = **p_argv.f; - if (fpr_base.d >= fpr_end.d) - { - *next_arg.f = (float) double_tmp; - next_arg.u += 1; - } - else - *fpr_base.d++ = double_tmp; - FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); - break; -#endif /* have FPRs */ - - case FFI_TYPE_UINT128: - /* The soft float ABI for long doubles works like this, a long double - is passed in four consecutive GPRs if available. A maximum of 2 - long doubles can be passed in gprs. If we do not have 4 GPRs - left, the long double is passed on the stack, 4-byte aligned. */ - if (gpr_base.u >= gpr_end.u - 3) - { - unsigned int ii; - gpr_base.u = gpr_end.u; - for (ii = 0; ii < 4; ii++) - { - unsigned int int_tmp = (*p_argv.ui)[ii]; - *next_arg.u++ = int_tmp; - } - } - else - { - unsigned int ii; - for (ii = 0; ii < 4; ii++) - { - unsigned int int_tmp = (*p_argv.ui)[ii]; - *gpr_base.u++ = int_tmp; - } - } - break; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - if (gpr_base.u >= gpr_end.u - 1) - { - gpr_base.u = gpr_end.u; - if (((next_arg.u - stack) & 1) != 0) - next_arg.u++; - *next_arg.ll = **p_argv.ll; - next_arg.u += 2; - } - else - { - /* The abi states only certain register pairs can be - used for passing long long int specifically (r3,r4), - (r5,r6), (r7,r8), (r9,r10). If next arg is long long - but not correct starting register of pair then skip - until the proper starting register. */ - if (((gpr_end.u - gpr_base.u) & 1) != 0) - gpr_base.u++; - *gpr_base.ll++ = **p_argv.ll; - } - break; - - case FFI_TYPE_STRUCT: - struct_copy_size = ((*ptr)->size + 15) & ~0xF; - copy_space.c -= struct_copy_size; - memcpy (copy_space.c, *p_argv.c, (*ptr)->size); - - gprvalue = (unsigned long) copy_space.c; - - FFI_ASSERT (copy_space.c > next_arg.c); - FFI_ASSERT (flags & FLAG_ARG_NEEDS_COPY); - goto putgpr; - - case FFI_TYPE_UINT8: - gprvalue = **p_argv.uc; - goto putgpr; - case FFI_TYPE_SINT8: - gprvalue = **p_argv.sc; - goto putgpr; - case FFI_TYPE_UINT16: - gprvalue = **p_argv.us; - goto putgpr; - case FFI_TYPE_SINT16: - gprvalue = **p_argv.ss; - goto putgpr; - - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_POINTER: - - gprvalue = **p_argv.ui; - - putgpr: - if (gpr_base.u >= gpr_end.u) - *next_arg.u++ = gprvalue; - else - *gpr_base.u++ = gprvalue; - break; - } - } - - /* Check that we didn't overrun the stack... */ - FFI_ASSERT (copy_space.c >= next_arg.c); - FFI_ASSERT (gpr_base.u <= gpr_end.u); -#ifndef __NO_FPRS__ - FFI_ASSERT (fpr_base.u <= fpr_end.u); -#endif - FFI_ASSERT (((flags & FLAG_4_GPR_ARGUMENTS) != 0) - == (gpr_end.u - gpr_base.u < 4)); -} - -#define MIN_CACHE_LINE_SIZE 8 - -static void -flush_icache (char *wraddr, char *xaddr, int size) -{ - int i; - for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) - __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" - : : "r" (xaddr + i), "r" (wraddr + i) : "memory"); - __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;" - : : "r"(xaddr + size - 1), "r"(wraddr + size - 1) - : "memory"); -} - -ffi_status FFI_HIDDEN -ffi_prep_closure_loc_sysv (ffi_closure *closure, - ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - void *codeloc) -{ - if (cif->abi < FFI_SYSV || cif->abi >= FFI_LAST_ABI) - return FFI_BAD_ABI; - -#ifdef FFI_EXEC_STATIC_TRAMP - if (ffi_tramp_is_present(closure)) - { - /* Initialize the static trampoline's parameters. */ - void (*dest)(void) = ffi_closure_SYSV; - ffi_tramp_set_parms (closure->ftramp, dest, closure); - } - else -#endif - { - unsigned int *tramp = (unsigned int *) &closure->tramp[0]; - tramp[0] = 0x7c0802a6; /* mflr r0 */ - tramp[1] = 0x429f0005; /* bcl 20,31,.+4 */ - tramp[2] = 0x7d6802a6; /* mflr r11 */ - tramp[3] = 0x7c0803a6; /* mtlr r0 */ - tramp[4] = 0x800b0018; /* lwz r0,24(r11) */ - tramp[5] = 0x816b001c; /* lwz r11,28(r11) */ - tramp[6] = 0x7c0903a6; /* mtctr r0 */ - tramp[7] = 0x4e800420; /* bctr */ - *(void **) &tramp[8] = (void *) ffi_closure_SYSV; /* function */ - *(void **) &tramp[9] = codeloc; /* context */ - - /* Flush the icache. */ - flush_icache ((char *)tramp, (char *)codeloc, 8 * 4); - } - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - -/* Basically the trampoline invokes ffi_closure_SYSV, and on - entry, r11 holds the address of the closure. - After storing the registers that could possibly contain - parameters to be passed into the stack frame and setting - up space for a return value, ffi_closure_SYSV invokes the - following helper function to do most of the work. */ - -int -ffi_closure_helper_SYSV (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - void *rvalue, - unsigned long *pgr, - ffi_dblfl *pfr, - unsigned long *pst) -{ - /* rvalue is the pointer to space for return value in closure assembly */ - /* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */ - /* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV */ - /* pst is the pointer to outgoing parameter stack in original caller */ - - void ** avalue; - ffi_type ** arg_types; - long i, avn; -#ifndef __NO_FPRS__ - long nf = 0; /* number of floating registers already used */ -#endif - long ng = 0; /* number of general registers already used */ - - unsigned size = cif->rtype->size; - unsigned short rtypenum = cif->rtype->type; - - avalue = alloca (cif->nargs * sizeof (void *)); - - /* First translate for softfloat/nonlinux */ - rtypenum = translate_float (cif->abi, rtypenum); - - /* Copy the caller's structure return value address so that the closure - returns the data directly to the caller. - For FFI_SYSV the result is passed in r3/r4 if the struct size is less - or equal 8 bytes. */ - if (rtypenum == FFI_TYPE_STRUCT - && !((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8)) - { - rvalue = (void *) *pgr; - ng++; - pgr++; - } - - i = 0; - avn = cif->nargs; - arg_types = cif->arg_types; - - /* Grab the addresses of the arguments from the stack frame. */ - while (i < avn) { - unsigned short typenum = arg_types[i]->type; - - /* We may need to handle some values depending on ABI. */ - typenum = translate_float (cif->abi, typenum); - - switch (typenum) - { -#ifndef __NO_FPRS__ - case FFI_TYPE_FLOAT: - /* Unfortunately float values are stored as doubles - in the ffi_closure_SYSV code (since we don't check - the type in that routine). */ - if (nf < NUM_FPR_ARG_REGISTERS) - { - /* FIXME? here we are really changing the values - stored in the original calling routines outgoing - parameter stack. This is probably a really - naughty thing to do but... */ - double temp = pfr->d; - pfr->f = (float) temp; - avalue[i] = pfr; - nf++; - pfr++; - } - else - { - avalue[i] = pst; - pst += 1; - } - break; - - case FFI_TYPE_DOUBLE: - if (nf < NUM_FPR_ARG_REGISTERS) - { - avalue[i] = pfr; - nf++; - pfr++; - } - else - { - if (((long) pst) & 4) - pst++; - avalue[i] = pst; - pst += 2; - } - break; - -# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - if (nf < NUM_FPR_ARG_REGISTERS - 1) - { - avalue[i] = pfr; - pfr += 2; - nf += 2; - } - else - { - if (((long) pst) & 4) - pst++; - avalue[i] = pst; - pst += 4; - nf = 8; - } - break; -# endif -#endif - - case FFI_TYPE_UINT128: - /* Test if for the whole long double, 4 gprs are available. - otherwise the stuff ends up on the stack. */ - if (ng < NUM_GPR_ARG_REGISTERS - 3) - { - avalue[i] = pgr; - pgr += 4; - ng += 4; - } - else - { - avalue[i] = pst; - pst += 4; - ng = 8+4; - } - break; - - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: -#ifndef __LITTLE_ENDIAN__ - if (ng < NUM_GPR_ARG_REGISTERS) - { - avalue[i] = (char *) pgr + 3; - ng++; - pgr++; - } - else - { - avalue[i] = (char *) pst + 3; - pst++; - } - break; -#endif - - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: -#ifndef __LITTLE_ENDIAN__ - if (ng < NUM_GPR_ARG_REGISTERS) - { - avalue[i] = (char *) pgr + 2; - ng++; - pgr++; - } - else - { - avalue[i] = (char *) pst + 2; - pst++; - } - break; -#endif - - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_POINTER: - if (ng < NUM_GPR_ARG_REGISTERS) - { - avalue[i] = pgr; - ng++; - pgr++; - } - else - { - avalue[i] = pst; - pst++; - } - break; - - case FFI_TYPE_STRUCT: - /* Structs are passed by reference. The address will appear in a - gpr if it is one of the first 8 arguments. */ - if (ng < NUM_GPR_ARG_REGISTERS) - { - avalue[i] = (void *) *pgr; - ng++; - pgr++; - } - else - { - avalue[i] = (void *) *pst; - pst++; - } - break; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - /* Passing long long ints are complex, they must - be passed in suitable register pairs such as - (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10) - and if the entire pair aren't available then the outgoing - parameter stack is used for both but an alignment of 8 - must will be kept. So we must either look in pgr - or pst to find the correct address for this type - of parameter. */ - if (ng < NUM_GPR_ARG_REGISTERS - 1) - { - if (ng & 1) - { - /* skip r4, r6, r8 as starting points */ - ng++; - pgr++; - } - avalue[i] = pgr; - ng += 2; - pgr += 2; - } - else - { - if (((long) pst) & 4) - pst++; - avalue[i] = pst; - pst += 2; - ng = NUM_GPR_ARG_REGISTERS; - } - break; - - default: - FFI_ASSERT (0); - } - - i++; - } - - (*fun) (cif, rvalue, avalue, user_data); - - /* Tell ffi_closure_SYSV how to perform return type promotions. - Because the FFI_SYSV ABI returns the structures <= 8 bytes in - r3/r4 we have to tell ffi_closure_SYSV how to treat them. We - combine the base type FFI_SYSV_TYPE_SMALL_STRUCT with the size of - the struct less one. We never have a struct with size zero. - See the comment in ffitarget.h about ordering. */ - if (rtypenum == FFI_TYPE_STRUCT - && (cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8) - return FFI_SYSV_TYPE_SMALL_STRUCT - 1 + size; - return rtypenum; -} -#endif diff --git a/deps/libffi/src/powerpc/ffitarget.h b/deps/libffi/src/powerpc/ffitarget.h deleted file mode 100644 index 7fb9a939082710..00000000000000 --- a/deps/libffi/src/powerpc/ffitarget.h +++ /dev/null @@ -1,204 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc - Copyright (c) 1996-2003 Red Hat, Inc. - - Target configuration macros for PowerPC. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- System specific configurations ----------------------------------- */ - -#if defined (POWERPC) && defined (__powerpc64__) /* linux64 */ -#ifndef POWERPC64 -#define POWERPC64 -#endif -#elif defined (POWERPC_DARWIN) && defined (__ppc64__) /* Darwin64 */ -#ifndef POWERPC64 -#define POWERPC64 -#endif -#ifndef POWERPC_DARWIN64 -#define POWERPC_DARWIN64 -#endif -#elif defined (POWERPC_AIX) && defined (__64BIT__) /* AIX64 */ -#ifndef POWERPC64 -#define POWERPC64 -#endif -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - -#if defined (POWERPC_AIX) - FFI_AIX, - FFI_DARWIN, - FFI_DEFAULT_ABI = FFI_AIX, - FFI_LAST_ABI - -#elif defined (POWERPC_DARWIN) - FFI_AIX, - FFI_DARWIN, - FFI_DEFAULT_ABI = FFI_DARWIN, - FFI_LAST_ABI - -#else - /* The FFI_COMPAT values are used by old code. Since libffi may be - a shared library we have to support old values for backwards - compatibility. */ - FFI_COMPAT_SYSV, - FFI_COMPAT_GCC_SYSV, - FFI_COMPAT_LINUX64, - FFI_COMPAT_LINUX, - FFI_COMPAT_LINUX_SOFT_FLOAT, - -# if defined (POWERPC64) - /* This bit, always set in new code, must not be set in any of the - old FFI_COMPAT values that might be used for 64-bit linux. We - only need worry about FFI_COMPAT_LINUX64, but to be safe avoid - all old values. */ - FFI_LINUX = 8, - /* This and following bits can reuse FFI_COMPAT values. */ - FFI_LINUX_STRUCT_ALIGN = 1, - FFI_LINUX_LONG_DOUBLE_128 = 2, - FFI_LINUX_LONG_DOUBLE_IEEE128 = 4, - FFI_DEFAULT_ABI = (FFI_LINUX -# ifdef __STRUCT_PARM_ALIGN__ - | FFI_LINUX_STRUCT_ALIGN -# endif -# ifdef __LONG_DOUBLE_128__ - | FFI_LINUX_LONG_DOUBLE_128 -# ifdef __LONG_DOUBLE_IEEE128__ - | FFI_LINUX_LONG_DOUBLE_IEEE128 -# endif -# endif - ), - FFI_LAST_ABI = 16 - -# else - /* This bit, always set in new code, must not be set in any of the - old FFI_COMPAT values that might be used for 32-bit linux/sysv/bsd. */ - FFI_SYSV = 8, - /* This and following bits can reuse FFI_COMPAT values. */ - FFI_SYSV_SOFT_FLOAT = 1, - FFI_SYSV_STRUCT_RET = 2, - FFI_SYSV_IBM_LONG_DOUBLE = 4, - FFI_SYSV_LONG_DOUBLE_128 = 16, - - FFI_DEFAULT_ABI = (FFI_SYSV -# ifdef __NO_FPRS__ - | FFI_SYSV_SOFT_FLOAT -# endif -# if (defined (__SVR4_STRUCT_RETURN) \ - || defined (POWERPC_FREEBSD) && !defined (__AIX_STRUCT_RETURN)) - | FFI_SYSV_STRUCT_RET -# endif -# if __LDBL_MANT_DIG__ == 106 - | FFI_SYSV_IBM_LONG_DOUBLE -# endif -# ifdef __LONG_DOUBLE_128__ - | FFI_SYSV_LONG_DOUBLE_128 -# endif - ), - FFI_LAST_ABI = 32 -# endif -#endif - -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 -#if defined (POWERPC) || defined (POWERPC_FREEBSD) -# define FFI_GO_CLOSURES 1 -# define FFI_TARGET_SPECIFIC_VARIADIC 1 -# define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs -#endif -#if defined (POWERPC_AIX) -# define FFI_GO_CLOSURES 1 -#endif - -/* ppc_closure.S and linux64_closure.S expect this. */ -#define FFI_PPC_TYPE_LAST FFI_TYPE_POINTER - -/* We define additional types below. If generic types are added that - must be supported by powerpc libffi then it is likely that - FFI_PPC_TYPE_LAST needs increasing *and* the jump tables in - ppc_closure.S and linux64_closure.S be extended. */ - -#if !(FFI_TYPE_LAST == FFI_PPC_TYPE_LAST \ - || (FFI_TYPE_LAST == FFI_TYPE_COMPLEX \ - && !defined FFI_TARGET_HAS_COMPLEX_TYPE)) -# error "You likely have a broken powerpc libffi" -#endif - -/* Needed for soft-float long-double-128 support. */ -#define FFI_TYPE_UINT128 (FFI_PPC_TYPE_LAST + 1) - -/* Needed for FFI_SYSV small structure returns. */ -#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_PPC_TYPE_LAST + 2) - -/* Used by ELFv2 for homogenous structure returns. */ -#define FFI_V2_TYPE_VECTOR (FFI_PPC_TYPE_LAST + 1) -#define FFI_V2_TYPE_VECTOR_HOMOG (FFI_PPC_TYPE_LAST + 2) -#define FFI_V2_TYPE_FLOAT_HOMOG (FFI_PPC_TYPE_LAST + 3) -#define FFI_V2_TYPE_DOUBLE_HOMOG (FFI_PPC_TYPE_LAST + 4) -#define FFI_V2_TYPE_SMALL_STRUCT (FFI_PPC_TYPE_LAST + 5) - -#if _CALL_ELF == 2 -# define FFI_TRAMPOLINE_SIZE 32 -#else -# if defined(POWERPC64) || defined(POWERPC_AIX) -# if defined(POWERPC_DARWIN64) -# define FFI_TRAMPOLINE_SIZE 48 -# else -# define FFI_TRAMPOLINE_SIZE 24 -# endif -# else /* POWERPC || POWERPC_AIX */ -# define FFI_TRAMPOLINE_SIZE 40 -# endif -#endif - -#ifndef LIBFFI_ASM -#if defined(POWERPC_DARWIN) || defined(POWERPC_AIX) -struct ffi_aix_trampoline_struct { - void * code_pointer; /* Pointer to ffi_closure_ASM */ - void * toc; /* TOC */ - void * static_chain; /* Pointer to closure */ -}; -#endif -#endif - -#endif diff --git a/deps/libffi/src/powerpc/internal.h b/deps/libffi/src/powerpc/internal.h deleted file mode 100644 index b3db5f014a179b..00000000000000 --- a/deps/libffi/src/powerpc/internal.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifdef FFI_EXEC_STATIC_TRAMP -/* For the trampoline code table mapping, a mapping size of 64K is chosen. */ -#define PPC_TRAMP_MAP_SHIFT 16 -#define PPC_TRAMP_MAP_SIZE (1 << PPC_TRAMP_MAP_SHIFT) -# ifdef __PCREL__ -# define PPC_TRAMP_SIZE 24 -# else -# define PPC_TRAMP_SIZE 40 -# endif /* __PCREL__ */ -#endif /* FFI_EXEC_STATIC_TRAMP */ diff --git a/deps/libffi/src/powerpc/linux64.S b/deps/libffi/src/powerpc/linux64.S deleted file mode 100644 index 1f876ea39eddc2..00000000000000 --- a/deps/libffi/src/powerpc/linux64.S +++ /dev/null @@ -1,293 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.h - Copyright (c) 2003 Jakub Jelinek - Copyright (c) 2008 Red Hat, Inc. - - PowerPC64 Assembly glue. - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - - .machine altivec - -#ifdef POWERPC64 - .hidden ffi_call_LINUX64 - .globl ffi_call_LINUX64 - .text - .cfi_startproc -# if _CALL_ELF == 2 -ffi_call_LINUX64: -# ifndef __PCREL__ - addis %r2, %r12, .TOC.-ffi_call_LINUX64@ha - addi %r2, %r2, .TOC.-ffi_call_LINUX64@l -# endif - .localentry ffi_call_LINUX64, . - ffi_call_LINUX64 -# else - .section ".opd","aw" - .align 3 -ffi_call_LINUX64: -# ifdef _CALL_LINUX - .quad .L.ffi_call_LINUX64,.TOC.@tocbase,0 - .type ffi_call_LINUX64,@function - .text -.L.ffi_call_LINUX64: -# else - .hidden .ffi_call_LINUX64 - .globl .ffi_call_LINUX64 - .quad .ffi_call_LINUX64,.TOC.@tocbase,0 - .size ffi_call_LINUX64,24 - .type .ffi_call_LINUX64,@function - .text -.ffi_call_LINUX64: -# endif -# endif - mflr %r0 - std %r28, -32(%r1) - std %r29, -24(%r1) - std %r30, -16(%r1) - std %r31, -8(%r1) - std %r7, 8(%r1) /* closure, saved in cr field. */ - std %r0, 16(%r1) - - mr %r28, %r1 /* our AP. */ - .cfi_def_cfa_register 28 - .cfi_offset 65, 16 - .cfi_offset 31, -8 - .cfi_offset 30, -16 - .cfi_offset 29, -24 - .cfi_offset 28, -32 - - stdux %r1, %r1, %r8 - mr %r31, %r6 /* flags, */ - mr %r30, %r5 /* rvalue, */ - mr %r29, %r4 /* function address. */ -/* Save toc pointer, not for the ffi_prep_args64 call, but for the later - bctrl function call. */ -# if _CALL_ELF == 2 - std %r2, 24(%r1) -# else - std %r2, 40(%r1) -# endif - - /* Call ffi_prep_args64. */ - mr %r4, %r1 -# if defined _CALL_LINUX || _CALL_ELF == 2 -# ifdef __PCREL__ - bl ffi_prep_args64@notoc -# else - bl ffi_prep_args64 - nop -# endif -# else - bl .ffi_prep_args64 - nop -# endif - -# if _CALL_ELF == 2 - mr %r12, %r29 -# else - ld %r12, 0(%r29) - ld %r2, 8(%r29) -# endif - /* Now do the call. */ - /* Set up cr1 with bits 3-7 of the flags. */ - mtcrf 0xc0, %r31 - - /* Get the address to call into CTR. */ - mtctr %r12 - /* Load all those argument registers. */ - addi %r29, %r28, -32-(8*8) - ld %r3, (0*8)(%r29) - ld %r4, (1*8)(%r29) - ld %r5, (2*8)(%r29) - ld %r6, (3*8)(%r29) - bf- 5, 1f - ld %r7, (4*8)(%r29) - ld %r8, (5*8)(%r29) - ld %r9, (6*8)(%r29) - ld %r10, (7*8)(%r29) -1: - - /* Load all the FP registers. */ - bf- 6, 2f - addi %r29, %r29, -(14*8) - lfd %f1, ( 1*8)(%r29) - lfd %f2, ( 2*8)(%r29) - lfd %f3, ( 3*8)(%r29) - lfd %f4, ( 4*8)(%r29) - lfd %f5, ( 5*8)(%r29) - lfd %f6, ( 6*8)(%r29) - lfd %f7, ( 7*8)(%r29) - lfd %f8, ( 8*8)(%r29) - lfd %f9, ( 9*8)(%r29) - lfd %f10, (10*8)(%r29) - lfd %f11, (11*8)(%r29) - lfd %f12, (12*8)(%r29) - lfd %f13, (13*8)(%r29) -2: - - /* Load all the vector registers. */ - bf- 3, 3f - addi %r29, %r29, -16 - lvx %v13, 0, %r29 - addi %r29, %r29, -16 - lvx %v12, 0, %r29 - addi %r29, %r29, -16 - lvx %v11, 0, %r29 - addi %r29, %r29, -16 - lvx %v10, 0, %r29 - addi %r29, %r29, -16 - lvx %v9, 0, %r29 - addi %r29, %r29, -16 - lvx %v8, 0, %r29 - addi %r29, %r29, -16 - lvx %v7, 0, %r29 - addi %r29, %r29, -16 - lvx %v6, 0, %r29 - addi %r29, %r29, -16 - lvx %v5, 0, %r29 - addi %r29, %r29, -16 - lvx %v4, 0, %r29 - addi %r29, %r29, -16 - lvx %v3, 0, %r29 - addi %r29, %r29, -16 - lvx %v2, 0, %r29 -3: - - /* Make the call. */ - ld %r11, 8(%r28) - bctrl - - /* This must follow the call immediately, the unwinder - uses this to find out if r2 has been saved or not. */ -# if _CALL_ELF == 2 - ld %r2, 24(%r1) -# else - ld %r2, 40(%r1) -# endif - - /* Now, deal with the return value. */ - mtcrf 0x01, %r31 - bt 31, .Lstruct_return_value - bt 30, .Ldone_return_value - bt 29, .Lfp_return_value - bt 28, .Lvec_return_value - std %r3, 0(%r30) - /* Fall through... */ - -.Ldone_return_value: - /* Restore the registers we used and return. */ - mr %r1, %r28 - .cfi_def_cfa_register 1 - ld %r0, 16(%r28) - ld %r28, -32(%r28) - mtlr %r0 - ld %r29, -24(%r1) - ld %r30, -16(%r1) - ld %r31, -8(%r1) - blr - -.Lvec_return_value: - stvx %v2, 0, %r30 - b .Ldone_return_value - -.Lfp_return_value: - .cfi_def_cfa_register 28 - mtcrf 0x02, %r31 /* cr6 */ - bf 27, .Lfloat_return_value - stfd %f1, 0(%r30) - bf 26, .Ldone_return_value - stfd %f2, 8(%r30) - b .Ldone_return_value -.Lfloat_return_value: - stfs %f1, 0(%r30) - b .Ldone_return_value - -.Lstruct_return_value: - bf 29, .Lvec_homog_or_small_struct - mtcrf 0x02, %r31 /* cr6 */ - bf 27, .Lfloat_homog_return_value - stfd %f1, 0(%r30) - stfd %f2, 8(%r30) - stfd %f3, 16(%r30) - stfd %f4, 24(%r30) - stfd %f5, 32(%r30) - stfd %f6, 40(%r30) - stfd %f7, 48(%r30) - stfd %f8, 56(%r30) - b .Ldone_return_value - -.Lfloat_homog_return_value: - stfs %f1, 0(%r30) - stfs %f2, 4(%r30) - stfs %f3, 8(%r30) - stfs %f4, 12(%r30) - stfs %f5, 16(%r30) - stfs %f6, 20(%r30) - stfs %f7, 24(%r30) - stfs %f8, 28(%r30) - b .Ldone_return_value - -.Lvec_homog_or_small_struct: - bf 28, .Lsmall_struct - stvx %v2, 0, %r30 - addi %r30, %r30, 16 - stvx %v3, 0, %r30 - addi %r30, %r30, 16 - stvx %v4, 0, %r30 - addi %r30, %r30, 16 - stvx %v5, 0, %r30 - addi %r30, %r30, 16 - stvx %v6, 0, %r30 - addi %r30, %r30, 16 - stvx %v7, 0, %r30 - addi %r30, %r30, 16 - stvx %v8, 0, %r30 - addi %r30, %r30, 16 - stvx %v9, 0, %r30 - b .Ldone_return_value - -.Lsmall_struct: - std %r3, 0(%r30) - std %r4, 8(%r30) - b .Ldone_return_value - - .cfi_endproc -# if _CALL_ELF == 2 - .size ffi_call_LINUX64,.-ffi_call_LINUX64 -# else -# ifdef _CALL_LINUX - .size ffi_call_LINUX64,.-.L.ffi_call_LINUX64 -# else - .long 0 - .byte 0,12,0,1,128,4,0,0 - .size .ffi_call_LINUX64,.-.ffi_call_LINUX64 -# endif -# endif - -#endif - -#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2 - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/powerpc/linux64_closure.S b/deps/libffi/src/powerpc/linux64_closure.S deleted file mode 100644 index d9e5cff64fd07f..00000000000000 --- a/deps/libffi/src/powerpc/linux64_closure.S +++ /dev/null @@ -1,613 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.h - Copyright (c) 2003 Jakub Jelinek - Copyright (c) 2008 Red Hat, Inc. - - PowerPC64 Assembly glue. - - 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. - ----------------------------------------------------------------------- */ -#define LIBFFI_ASM -#include -#include -#include "internal.h" - - .file "linux64_closure.S" - - .machine altivec - -#ifdef POWERPC64 - FFI_HIDDEN (ffi_closure_LINUX64) - .globl ffi_closure_LINUX64 - .text - .cfi_startproc -# if _CALL_ELF == 2 -ffi_closure_LINUX64: -# ifndef __PCREL__ - addis %r2, %r12, .TOC.-ffi_closure_LINUX64@ha - addi %r2, %r2, .TOC.-ffi_closure_LINUX64@l -# endif - .localentry ffi_closure_LINUX64, . - ffi_closure_LINUX64 -# else - .section ".opd","aw" - .align 3 -ffi_closure_LINUX64: -# ifdef _CALL_LINUX - .quad .L.ffi_closure_LINUX64,.TOC.@tocbase,0 - .type ffi_closure_LINUX64,@function - .text -.L.ffi_closure_LINUX64: -# else - FFI_HIDDEN (.ffi_closure_LINUX64) - .globl .ffi_closure_LINUX64 - .quad .ffi_closure_LINUX64,.TOC.@tocbase,0 - .size ffi_closure_LINUX64,24 - .type .ffi_closure_LINUX64,@function - .text -.ffi_closure_LINUX64: -# endif -# endif - -# if _CALL_ELF == 2 -# ifdef __VEC__ -# 32 byte special reg save area + 64 byte parm save area -# + 128 byte retval area + 13*8 fpr save area + 12*16 vec save area + round to 16 -# define STACKFRAME 528 -# else -# 32 byte special reg save area + 64 byte parm save area -# + 64 byte retval area + 13*8 fpr save area + round to 16 -# define STACKFRAME 272 -# endif -# define PARMSAVE 32 -# define RETVAL PARMSAVE+64 -# else -# 48 bytes special reg save area + 64 bytes parm save area -# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16 -# define STACKFRAME 240 -# define PARMSAVE 48 -# define RETVAL PARMSAVE+64 -# endif - -# if _CALL_ELF == 2 - ld %r12, FFI_TRAMPOLINE_SIZE(%r11) # closure->cif - mflr %r0 - lwz %r12, 28(%r12) # cif->flags - mtcrf 0x40, %r12 - addi %r12, %r1, PARMSAVE - bt 7, 0f - # Our caller has not allocated a parameter save area. - # We need to allocate one here and use it to pass gprs to - # ffi_closure_helper_LINUX64. - addi %r12, %r1, -STACKFRAME+PARMSAVE -0: - # Save general regs into parm save area - std %r3, 0(%r12) - std %r4, 8(%r12) - std %r5, 16(%r12) - std %r6, 24(%r12) - std %r7, 32(%r12) - std %r8, 40(%r12) - std %r9, 48(%r12) - std %r10, 56(%r12) - - # load up the pointer to the parm save area - mr %r7, %r12 -# else - # copy r2 to r11 and load TOC into r2 - mr %r11, %r2 - ld %r2, 16(%r2) - - mflr %r0 - # Save general regs into parm save area - # This is the parameter save area set up by our caller. - std %r3, PARMSAVE+0(%r1) - std %r4, PARMSAVE+8(%r1) - std %r5, PARMSAVE+16(%r1) - std %r6, PARMSAVE+24(%r1) - std %r7, PARMSAVE+32(%r1) - std %r8, PARMSAVE+40(%r1) - std %r9, PARMSAVE+48(%r1) - std %r10, PARMSAVE+56(%r1) - - # load up the pointer to the parm save area - addi %r7, %r1, PARMSAVE -# endif - std %r0, 16(%r1) - - # closure->cif - ld %r3, FFI_TRAMPOLINE_SIZE(%r11) - # closure->fun - ld %r4, FFI_TRAMPOLINE_SIZE+8(%r11) - # closure->user_data - ld %r5, FFI_TRAMPOLINE_SIZE+16(%r11) - -.Ldoclosure: - # next save fpr 1 to fpr 13 - stfd %f1, -104+(0*8)(%r1) - stfd %f2, -104+(1*8)(%r1) - stfd %f3, -104+(2*8)(%r1) - stfd %f4, -104+(3*8)(%r1) - stfd %f5, -104+(4*8)(%r1) - stfd %f6, -104+(5*8)(%r1) - stfd %f7, -104+(6*8)(%r1) - stfd %f8, -104+(7*8)(%r1) - stfd %f9, -104+(8*8)(%r1) - stfd %f10, -104+(9*8)(%r1) - stfd %f11, -104+(10*8)(%r1) - stfd %f12, -104+(11*8)(%r1) - stfd %f13, -104+(12*8)(%r1) - - # load up the pointer to the saved fpr registers - addi %r8, %r1, -104 - -# ifdef __VEC__ - # load up the pointer to the saved vector registers - # 8 bytes padding for 16-byte alignment at -112(%r1) - addi %r9, %r8, -24 - stvx %v13, 0, %r9 - addi %r9, %r9, -16 - stvx %v12, 0, %r9 - addi %r9, %r9, -16 - stvx %v11, 0, %r9 - addi %r9, %r9, -16 - stvx %v10, 0, %r9 - addi %r9, %r9, -16 - stvx %v9, 0, %r9 - addi %r9, %r9, -16 - stvx %v8, 0, %r9 - addi %r9, %r9, -16 - stvx %v7, 0, %r9 - addi %r9, %r9, -16 - stvx %v6, 0, %r9 - addi %r9, %r9, -16 - stvx %v5, 0, %r9 - addi %r9, %r9, -16 - stvx %v4, 0, %r9 - addi %r9, %r9, -16 - stvx %v3, 0, %r9 - addi %r9, %r9, -16 - stvx %v2, 0, %r9 -# endif - - # load up the pointer to the result storage - addi %r6, %r1, -STACKFRAME+RETVAL - - stdu %r1, -STACKFRAME(%r1) - .cfi_def_cfa_offset STACKFRAME - .cfi_offset 65, 16 - - # make the call -# if defined _CALL_LINUX || _CALL_ELF == 2 -# ifdef __PCREL__ - bl ffi_closure_helper_LINUX64@notoc -.Lret: -# else - bl ffi_closure_helper_LINUX64 -.Lret: - nop -# endif -# else - bl .ffi_closure_helper_LINUX64 -.Lret: - nop -# endif - - # now r3 contains the return type - # so use it to look up in a table - # so we know how to deal with each type - - # look up the proper starting point in table - # by using return type as offset - ld %r0, STACKFRAME+16(%r1) - cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT - bge .Lsmall - mflr %r4 # move address of .Lret to r4 - sldi %r3, %r3, 4 # now multiply return type by 16 - addi %r4, %r4, .Lret_type0 - .Lret - add %r3, %r3, %r4 # add contents of table to table address - mtctr %r3 - bctr # jump to it - -# Each of the ret_typeX code fragments has to be exactly 16 bytes long -# (4 instructions). For cache effectiveness we align to a 16 byte boundary -# first. - .align 4 - -.Lret_type0: -# case FFI_TYPE_VOID - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME - nop -# case FFI_TYPE_INT -# ifdef __LITTLE_ENDIAN__ - lwa %r3, RETVAL+0(%r1) -# else - lwa %r3, RETVAL+4(%r1) -# endif - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_FLOAT - lfs %f1, RETVAL+0(%r1) - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_DOUBLE - lfd %f1, RETVAL+0(%r1) - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_LONGDOUBLE - lfd %f1, RETVAL+0(%r1) - mtlr %r0 - lfd %f2, RETVAL+8(%r1) - b .Lfinish -# case FFI_TYPE_UINT8 -# ifdef __LITTLE_ENDIAN__ - lbz %r3, RETVAL+0(%r1) -# else - lbz %r3, RETVAL+7(%r1) -# endif - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_SINT8 -# ifdef __LITTLE_ENDIAN__ - lbz %r3, RETVAL+0(%r1) -# else - lbz %r3, RETVAL+7(%r1) -# endif - extsb %r3,%r3 - mtlr %r0 - b .Lfinish -# case FFI_TYPE_UINT16 -# ifdef __LITTLE_ENDIAN__ - lhz %r3, RETVAL+0(%r1) -# else - lhz %r3, RETVAL+6(%r1) -# endif - mtlr %r0 -.Lfinish: - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_SINT16 -# ifdef __LITTLE_ENDIAN__ - lha %r3, RETVAL+0(%r1) -# else - lha %r3, RETVAL+6(%r1) -# endif - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_UINT32 -# ifdef __LITTLE_ENDIAN__ - lwz %r3, RETVAL+0(%r1) -# else - lwz %r3, RETVAL+4(%r1) -# endif - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_SINT32 -# ifdef __LITTLE_ENDIAN__ - lwa %r3, RETVAL+0(%r1) -# else - lwa %r3, RETVAL+4(%r1) -# endif - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_UINT64 - ld %r3, RETVAL+0(%r1) - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_SINT64 - ld %r3, RETVAL+0(%r1) - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_TYPE_STRUCT - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME - nop -# case FFI_TYPE_POINTER - ld %r3, RETVAL+0(%r1) - mtlr %r0 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -# case FFI_V2_TYPE_VECTOR - addi %r3, %r1, RETVAL - lvx %v2, 0, %r3 - mtlr %r0 - b .Lfinish -# case FFI_V2_TYPE_VECTOR_HOMOG - addi %r3, %r1, RETVAL - lvx %v2, 0, %r3 - addi %r3, %r3, 16 - b .Lmorevector -# case FFI_V2_TYPE_FLOAT_HOMOG - lfs %f1, RETVAL+0(%r1) - lfs %f2, RETVAL+4(%r1) - lfs %f3, RETVAL+8(%r1) - b .Lmorefloat -# case FFI_V2_TYPE_DOUBLE_HOMOG - lfd %f1, RETVAL+0(%r1) - lfd %f2, RETVAL+8(%r1) - lfd %f3, RETVAL+16(%r1) - lfd %f4, RETVAL+24(%r1) - mtlr %r0 - lfd %f5, RETVAL+32(%r1) - lfd %f6, RETVAL+40(%r1) - lfd %f7, RETVAL+48(%r1) - lfd %f8, RETVAL+56(%r1) - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -.Lmorevector: - lvx %v3, 0, %r3 - addi %r3, %r3, 16 - lvx %v4, 0, %r3 - addi %r3, %r3, 16 - lvx %v5, 0, %r3 - mtlr %r0 - addi %r3, %r3, 16 - lvx %v6, 0, %r3 - addi %r3, %r3, 16 - lvx %v7, 0, %r3 - addi %r3, %r3, 16 - lvx %v8, 0, %r3 - addi %r3, %r3, 16 - lvx %v9, 0, %r3 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -.Lmorefloat: - lfs %f4, RETVAL+12(%r1) - mtlr %r0 - lfs %f5, RETVAL+16(%r1) - lfs %f6, RETVAL+20(%r1) - lfs %f7, RETVAL+24(%r1) - lfs %f8, RETVAL+28(%r1) - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -.Lsmall: -# ifdef __LITTLE_ENDIAN__ - ld %r3,RETVAL+0(%r1) - mtlr %r0 - ld %r4,RETVAL+8(%r1) - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr -# else - # A struct smaller than a dword is returned in the low bits of r3 - # ie. right justified. Larger structs are passed left justified - # in r3 and r4. The return value area on the stack will have - # the structs as they are usually stored in memory. - cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT + 7 # size 8 bytes? - neg %r5, %r3 - ld %r3,RETVAL+0(%r1) - blt .Lsmalldown - mtlr %r0 - ld %r4,RETVAL+8(%r1) - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset STACKFRAME -.Lsmalldown: - addi %r5, %r5, FFI_V2_TYPE_SMALL_STRUCT + 7 - mtlr %r0 - sldi %r5, %r5, 3 - addi %r1, %r1, STACKFRAME - .cfi_def_cfa_offset 0 - srd %r3, %r3, %r5 - blr -# endif - - .cfi_endproc -# if _CALL_ELF == 2 - .size ffi_closure_LINUX64,.-ffi_closure_LINUX64 -# else -# ifdef _CALL_LINUX - .size ffi_closure_LINUX64,.-.L.ffi_closure_LINUX64 -# else - .long 0 - .byte 0,12,0,1,128,0,0,0 - .size .ffi_closure_LINUX64,.-.ffi_closure_LINUX64 -# endif -# endif - - - FFI_HIDDEN (ffi_go_closure_linux64) - .globl ffi_go_closure_linux64 - .text - .cfi_startproc -# if _CALL_ELF == 2 -ffi_go_closure_linux64: -# ifndef __PCREL__ - addis %r2, %r12, .TOC.-ffi_go_closure_linux64@ha - addi %r2, %r2, .TOC.-ffi_go_closure_linux64@l -# endif - .localentry ffi_go_closure_linux64, . - ffi_go_closure_linux64 -# else - .section ".opd","aw" - .align 3 -ffi_go_closure_linux64: -# ifdef _CALL_LINUX - .quad .L.ffi_go_closure_linux64,.TOC.@tocbase,0 - .type ffi_go_closure_linux64,@function - .text -.L.ffi_go_closure_linux64: -# else - FFI_HIDDEN (.ffi_go_closure_linux64) - .globl .ffi_go_closure_linux64 - .quad .ffi_go_closure_linux64,.TOC.@tocbase,0 - .size ffi_go_closure_linux64,24 - .type .ffi_go_closure_linux64,@function - .text -.ffi_go_closure_linux64: -# endif -# endif - -# if _CALL_ELF == 2 - ld %r12, 8(%r11) # closure->cif - mflr %r0 - lwz %r12, 28(%r12) # cif->flags - mtcrf 0x40, %r12 - addi %r12, %r1, PARMSAVE - bt 7, 0f - # Our caller has not allocated a parameter save area. - # We need to allocate one here and use it to pass gprs to - # ffi_closure_helper_LINUX64. - addi %r12, %r1, -STACKFRAME+PARMSAVE -0: - # Save general regs into parm save area - std %r3, 0(%r12) - std %r4, 8(%r12) - std %r5, 16(%r12) - std %r6, 24(%r12) - std %r7, 32(%r12) - std %r8, 40(%r12) - std %r9, 48(%r12) - std %r10, 56(%r12) - - # load up the pointer to the parm save area - mr %r7, %r12 -# else - mflr %r0 - # Save general regs into parm save area - # This is the parameter save area set up by our caller. - std %r3, PARMSAVE+0(%r1) - std %r4, PARMSAVE+8(%r1) - std %r5, PARMSAVE+16(%r1) - std %r6, PARMSAVE+24(%r1) - std %r7, PARMSAVE+32(%r1) - std %r8, PARMSAVE+40(%r1) - std %r9, PARMSAVE+48(%r1) - std %r10, PARMSAVE+56(%r1) - - # load up the pointer to the parm save area - addi %r7, %r1, PARMSAVE -# endif - std %r0, 16(%r1) - - # closure->cif - ld %r3, 8(%r11) - # closure->fun - ld %r4, 16(%r11) - # user_data - mr %r5, %r11 - b .Ldoclosure - - .cfi_endproc -# if _CALL_ELF == 2 - .size ffi_go_closure_linux64,.-ffi_go_closure_linux64 -# else -# ifdef _CALL_LINUX - .size ffi_go_closure_linux64,.-.L.ffi_go_closure_linux64 -# else - .long 0 - .byte 0,12,0,1,128,0,0,0 - .size .ffi_go_closure_linux64,.-.ffi_go_closure_linux64 -# endif -# endif - -#ifdef FFI_EXEC_STATIC_TRAMP - .text - .align PPC_TRAMP_MAP_SHIFT - FFI_HIDDEN (trampoline_code_table) - .globl trampoline_code_table -# if _CALL_ELF == 2 - .type trampoline_code_table,@function -trampoline_code_table: - .localentry trampoline_code_table,.-trampoline_code_table -# else - .section ".opd","aw" - .align 3 -trampoline_code_table: - .quad .L.trampoline_code_table,.TOC.@tocbase,0 - .type trampoline_code_table,@function - .text -.L.trampoline_code_table: -# endif - .rept PPC_TRAMP_MAP_SIZE / PPC_TRAMP_SIZE -#ifdef __PCREL__ - pla %r2,PPC_TRAMP_MAP_SIZE - ld %r11,0(%r2) - ld %r12,8(%r2) - mtctr %r12 - bctr -#else - mflr %r0 - bcl 20,31,$+4 - mflr %r11 - addis %r11,%r11,PPC_TRAMP_MAP_SIZE@ha - mtlr %r0 - ld %r12,(PPC_TRAMP_MAP_SIZE+0)@l(%r11) - mtctr %r12 - ld %r11,(PPC_TRAMP_MAP_SIZE-8)@l(%r11) - bctr - nop -#endif - .endr - .align PPC_TRAMP_MAP_SHIFT -#if _CALL_ELF == 2 - .size trampoline_code_table,.-trampoline_code_table -#else - .size trampoline_code_table,.-.L.trampoline_code_table -#endif -#endif /* FFI_EXEC_STATIC_TRAMP */ -#endif /* POWERPC64 */ - -#if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2 - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/powerpc/ppc_closure.S b/deps/libffi/src/powerpc/ppc_closure.S deleted file mode 100644 index d3556ebadbab98..00000000000000 --- a/deps/libffi/src/powerpc/ppc_closure.S +++ /dev/null @@ -1,421 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.h - Copyright (c) 2003 Jakub Jelinek - Copyright (c) 2008 Red Hat, Inc. - - PowerPC Assembly glue. - - 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. - ----------------------------------------------------------------------- */ -#define LIBFFI_ASM -#include -#include -#include "internal.h" -#include - - .file "ppc_closure.S" - -#ifndef POWERPC64 - -FFI_HIDDEN(ffi_closure_SYSV) -ENTRY(ffi_closure_SYSV) - .cfi_startproc - stwu %r1,-144(%r1) - .cfi_def_cfa_offset 144 - mflr %r0 - stw %r0,148(%r1) - .cfi_offset 65, 4 - -# we want to build up an areas for the parameters passed -# in registers (both floating point and integer) - - # so first save gpr 3 to gpr 10 (aligned to 4) - stw %r3, 16(%r1) - stw %r4, 20(%r1) - stw %r5, 24(%r1) - - # set up registers for the routine that does the work - - # closure->cif - lwz %r3,FFI_TRAMPOLINE_SIZE(%r11) - # closure->fun - lwz %r4,FFI_TRAMPOLINE_SIZE+4(%r11) - # closure->user_data - lwz %r5,FFI_TRAMPOLINE_SIZE+8(%r11) - -.Ldoclosure: - stw %r6, 28(%r1) - stw %r7, 32(%r1) - stw %r8, 36(%r1) - stw %r9, 40(%r1) - stw %r10,44(%r1) - -#ifndef __NO_FPRS__ - # next save fpr 1 to fpr 8 (aligned to 8) - stfd %f1, 48(%r1) - stfd %f2, 56(%r1) - stfd %f3, 64(%r1) - stfd %f4, 72(%r1) - stfd %f5, 80(%r1) - stfd %f6, 88(%r1) - stfd %f7, 96(%r1) - stfd %f8, 104(%r1) -#endif - - # pointer to the result storage - addi %r6,%r1,112 - - # pointer to the saved gpr registers - addi %r7,%r1,16 - - # pointer to the saved fpr registers - addi %r8,%r1,48 - - # pointer to the outgoing parameter save area in the previous frame - # i.e. the previous frame pointer + 8 - addi %r9,%r1,152 - - # make the call - bl ffi_closure_helper_SYSV@local -.Lret: - # now r3 contains the return type - # so use it to look up in a table - # so we know how to deal with each type - - # look up the proper starting point in table - # by using return type as offset - - mflr %r4 # move address of .Lret to r4 - slwi %r3,%r3,4 # now multiply return type by 16 - addi %r4, %r4, .Lret_type0 - .Lret - lwz %r0,148(%r1) - add %r3,%r3,%r4 # add contents of table to table address - mtctr %r3 - bctr # jump to it - -# Each of the ret_typeX code fragments has to be exactly 16 bytes long -# (4 instructions). For cache effectiveness we align to a 16 byte boundary -# first. - .align 4 -# case FFI_TYPE_VOID -.Lret_type0: - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - nop - -# case FFI_TYPE_INT - lwz %r3,112+0(%r1) - mtlr %r0 -.Lfinish: - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_TYPE_FLOAT -#ifndef __NO_FPRS__ - lfs %f1,112+0(%r1) -#else - nop -#endif - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_TYPE_DOUBLE -#ifndef __NO_FPRS__ - lfd %f1,112+0(%r1) -#else - nop -#endif - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_TYPE_LONGDOUBLE -#ifndef __NO_FPRS__ - lfd %f1,112+0(%r1) - lfd %f2,112+8(%r1) - mtlr %r0 - b .Lfinish -#else - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - nop -#endif - -# case FFI_TYPE_UINT8 -#ifdef __LITTLE_ENDIAN__ - lbz %r3,112+0(%r1) -#else - lbz %r3,112+3(%r1) -#endif - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_TYPE_SINT8 -#ifdef __LITTLE_ENDIAN__ - lbz %r3,112+0(%r1) -#else - lbz %r3,112+3(%r1) -#endif - extsb %r3,%r3 - mtlr %r0 - b .Lfinish - -# case FFI_TYPE_UINT16 -#ifdef __LITTLE_ENDIAN__ - lhz %r3,112+0(%r1) -#else - lhz %r3,112+2(%r1) -#endif - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_TYPE_SINT16 -#ifdef __LITTLE_ENDIAN__ - lha %r3,112+0(%r1) -#else - lha %r3,112+2(%r1) -#endif - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_TYPE_UINT32 - lwz %r3,112+0(%r1) - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_TYPE_SINT32 - lwz %r3,112+0(%r1) - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_TYPE_UINT64 - lwz %r3,112+0(%r1) - lwz %r4,112+4(%r1) - mtlr %r0 - b .Lfinish - -# case FFI_TYPE_SINT64 - lwz %r3,112+0(%r1) - lwz %r4,112+4(%r1) - mtlr %r0 - b .Lfinish - -# case FFI_TYPE_STRUCT - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - nop - -# case FFI_TYPE_POINTER - lwz %r3,112+0(%r1) - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_TYPE_UINT128 - lwz %r3,112+0(%r1) - lwz %r4,112+4(%r1) - lwz %r5,112+8(%r1) - b .Luint128 - -# The return types below are only used when the ABI type is FFI_SYSV. -# case FFI_SYSV_TYPE_SMALL_STRUCT + 1. One byte struct. - lbz %r3,112+0(%r1) - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_SYSV_TYPE_SMALL_STRUCT + 2. Two byte struct. - lhz %r3,112+0(%r1) - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_SYSV_TYPE_SMALL_STRUCT + 3. Three byte struct. - lwz %r3,112+0(%r1) -#ifdef __LITTLE_ENDIAN__ - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 -#else - srwi %r3,%r3,8 - mtlr %r0 - b .Lfinish -#endif - -# case FFI_SYSV_TYPE_SMALL_STRUCT + 4. Four byte struct. - lwz %r3,112+0(%r1) - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 - -# case FFI_SYSV_TYPE_SMALL_STRUCT + 5. Five byte struct. - lwz %r3,112+0(%r1) - lwz %r4,112+4(%r1) -#ifdef __LITTLE_ENDIAN__ - mtlr %r0 - b .Lfinish -#else - li %r5,24 - b .Lstruct567 -#endif - -# case FFI_SYSV_TYPE_SMALL_STRUCT + 6. Six byte struct. - lwz %r3,112+0(%r1) - lwz %r4,112+4(%r1) -#ifdef __LITTLE_ENDIAN__ - mtlr %r0 - b .Lfinish -#else - li %r5,16 - b .Lstruct567 -#endif - -# case FFI_SYSV_TYPE_SMALL_STRUCT + 7. Seven byte struct. - lwz %r3,112+0(%r1) - lwz %r4,112+4(%r1) -#ifdef __LITTLE_ENDIAN__ - mtlr %r0 - b .Lfinish -#else - li %r5,8 - b .Lstruct567 -#endif - -# case FFI_SYSV_TYPE_SMALL_STRUCT + 8. Eight byte struct. - lwz %r3,112+0(%r1) - lwz %r4,112+4(%r1) - mtlr %r0 - b .Lfinish - -#ifndef __LITTLE_ENDIAN__ -.Lstruct567: - subfic %r6,%r5,32 - srw %r4,%r4,%r5 - slw %r6,%r3,%r6 - srw %r3,%r3,%r5 - or %r4,%r6,%r4 - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_def_cfa_offset 144 -#endif - -.Luint128: - lwz %r6,112+12(%r1) - mtlr %r0 - addi %r1,%r1,144 - .cfi_def_cfa_offset 0 - blr - .cfi_endproc -END(ffi_closure_SYSV) - - -FFI_HIDDEN(ffi_go_closure_sysv) -ENTRY(ffi_go_closure_sysv) - .cfi_startproc - stwu %r1,-144(%r1) - .cfi_def_cfa_offset 144 - mflr %r0 - stw %r0,148(%r1) - .cfi_offset 65, 4 - - stw %r3, 16(%r1) - stw %r4, 20(%r1) - stw %r5, 24(%r1) - - # closure->cif - lwz %r3,4(%r11) - # closure->fun - lwz %r4,8(%r11) - # user_data - mr %r5,%r11 - b .Ldoclosure - .cfi_endproc -END(ffi_go_closure_sysv) - -#ifdef FFI_EXEC_STATIC_TRAMP - .text - .align PPC_TRAMP_MAP_SHIFT - FFI_HIDDEN (trampoline_code_table) - .globl trampoline_code_table - .type trampoline_code_table,@function -trampoline_code_table: - .rept PPC_TRAMP_MAP_SIZE / PPC_TRAMP_SIZE - mflr %r0 - bcl 20,31,$+4 - mflr %r11 - addis %r11,%r11,PPC_TRAMP_MAP_SIZE@ha - mtlr %r0 - lwz %r0,(PPC_TRAMP_MAP_SIZE-4)@l(%r11) - mtctr %r0 - lwz %r11,(PPC_TRAMP_MAP_SIZE-8)@l(%r11) - bctr - nop - .endr - .size trampoline_code_table,.-trampoline_code_table - .align PPC_TRAMP_MAP_SHIFT -#endif /* FFI_EXEC_STATIC_TRAMP */ - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif -#endif diff --git a/deps/libffi/src/powerpc/sysv.S b/deps/libffi/src/powerpc/sysv.S deleted file mode 100644 index df9773427cba5c..00000000000000 --- a/deps/libffi/src/powerpc/sysv.S +++ /dev/null @@ -1,173 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 1998 Geoffrey Keating - Copyright (C) 2007 Free Software Foundation, Inc - - PowerPC Assembly glue. - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#include - -#ifndef POWERPC64 -FFI_HIDDEN(ffi_call_SYSV) -ENTRY(ffi_call_SYSV) - .cfi_startproc - /* Save the old stack pointer as AP. */ - mr %r10,%r1 - .cfi_def_cfa_register 10 - - /* Allocate the stack space we need. */ - stwux %r1,%r1,%r8 - /* Save registers we use. */ - mflr %r9 - stw %r28,-16(%r10) - stw %r29,-12(%r10) - stw %r30, -8(%r10) - stw %r31, -4(%r10) - stw %r9, 4(%r10) - .cfi_offset 65, 4 - .cfi_offset 31, -4 - .cfi_offset 30, -8 - .cfi_offset 29, -12 - .cfi_offset 28, -16 - - /* Save arguments over call... */ - stw %r7, -20(%r10) /* closure, */ - mr %r31,%r6 /* flags, */ - mr %r30,%r5 /* rvalue, */ - mr %r29,%r4 /* function address, */ - mr %r28,%r10 /* our AP. */ - .cfi_def_cfa_register 28 - - /* Call ffi_prep_args_SYSV. */ - mr %r4,%r1 - bl ffi_prep_args_SYSV@local - - /* Now do the call. */ - /* Set up cr1 with bits 4-7 of the flags. */ - mtcrf 0x40,%r31 - /* Get the address to call into CTR. */ - mtctr %r29 - /* Load all those argument registers. */ - lwz %r3,-24-(8*4)(%r28) - lwz %r4,-24-(7*4)(%r28) - lwz %r5,-24-(6*4)(%r28) - lwz %r6,-24-(5*4)(%r28) - bf- 5,1f - nop - lwz %r7,-24-(4*4)(%r28) - lwz %r8,-24-(3*4)(%r28) - lwz %r9,-24-(2*4)(%r28) - lwz %r10,-24-(1*4)(%r28) - nop -1: - -#ifndef __NO_FPRS__ - /* Load all the FP registers. */ - bf- 6,2f - lfd %f1,-24-(8*4)-(8*8)(%r28) - lfd %f2,-24-(8*4)-(7*8)(%r28) - lfd %f3,-24-(8*4)-(6*8)(%r28) - lfd %f4,-24-(8*4)-(5*8)(%r28) - nop - lfd %f5,-24-(8*4)-(4*8)(%r28) - lfd %f6,-24-(8*4)-(3*8)(%r28) - lfd %f7,-24-(8*4)-(2*8)(%r28) - lfd %f8,-24-(8*4)-(1*8)(%r28) -#endif -2: - - /* Make the call. */ - lwz %r11, -20(%r28) - bctrl - - /* Now, deal with the return value. */ - mtcrf 0x03,%r31 /* cr6-cr7 */ - bt- 31,L(small_struct_return_value) - bt- 30,L(done_return_value) -#ifndef __NO_FPRS__ - bt- 29,L(fp_return_value) -#endif - stw %r3,0(%r30) - bf+ 27,L(done_return_value) - stw %r4,4(%r30) - bf 26,L(done_return_value) - stw %r5,8(%r30) - stw %r6,12(%r30) - /* Fall through... */ - -L(done_return_value): - /* Restore the registers we used and return. */ - lwz %r9, 4(%r28) - lwz %r31, -4(%r28) - mtlr %r9 - lwz %r30, -8(%r28) - lwz %r29,-12(%r28) - lwz %r28,-16(%r28) - .cfi_remember_state - /* At this point we don't have a cfa register. Say all our - saved regs have been restored. */ - .cfi_same_value 65 - .cfi_same_value 31 - .cfi_same_value 30 - .cfi_same_value 29 - .cfi_same_value 28 - /* Hopefully this works.. */ - .cfi_def_cfa_register 1 - .cfi_offset 1, 0 - lwz %r1,0(%r1) - .cfi_same_value 1 - blr - -#ifndef __NO_FPRS__ -L(fp_return_value): - .cfi_restore_state - bf 27,L(float_return_value) - stfd %f1,0(%r30) - bf 26,L(done_return_value) - stfd %f2,8(%r30) - b L(done_return_value) -L(float_return_value): - stfs %f1,0(%r30) - b L(done_return_value) -#endif - -L(small_struct_return_value): - /* - * The C code always allocates a properly-aligned 8-byte bounce - * buffer to make this assembly code very simple. Just write out - * r3 and r4 to the buffer to allow the C code to handle the rest. - */ - stw %r3, 0(%r30) - stw %r4, 4(%r30) - b L(done_return_value) - .cfi_endproc - -END(ffi_call_SYSV) - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif -#endif diff --git a/deps/libffi/src/powerpc/t-aix b/deps/libffi/src/powerpc/t-aix deleted file mode 100644 index e7be1cafd38844..00000000000000 --- a/deps/libffi/src/powerpc/t-aix +++ /dev/null @@ -1,5 +0,0 @@ -# This file is needed by GCC in order to correctly build AIX FAT -# library for libffi. -# However, it has no sense to include this code here, as it depends -# on GCC multilib architecture. -# Thus, this file is a simple stub replaced in GCC repository. diff --git a/deps/libffi/src/prep_cif.c b/deps/libffi/src/prep_cif.c deleted file mode 100644 index 47c9259470c5ee..00000000000000 --- a/deps/libffi/src/prep_cif.c +++ /dev/null @@ -1,280 +0,0 @@ -/* ----------------------------------------------------------------------- - prep_cif.c - Copyright (c) 2011, 2012, 2021, 2025 Anthony Green - Copyright (c) 1996, 1998, 2007 Red Hat, Inc. - Copyright (c) 2022 Oracle and/or its affiliates. - - 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. - ----------------------------------------------------------------------- */ - -#include -#include -#include - -/* Round up to FFI_SIZEOF_ARG. */ - -#define STACK_ARG_SIZE(x) FFI_ALIGN(x, FFI_SIZEOF_ARG) - -/* Perform machine independent initialization of aggregate type - specifications. */ - -static ffi_status initialize_aggregate(ffi_type *arg, size_t *offsets) -{ - ffi_type **ptr; - - if (UNLIKELY(arg == NULL || arg->elements == NULL)) - return FFI_BAD_TYPEDEF; - - arg->size = 0; - arg->alignment = 0; - - ptr = &(arg->elements[0]); - - if (UNLIKELY(ptr == 0)) - return FFI_BAD_TYPEDEF; - - while ((*ptr) != NULL) - { - if (UNLIKELY(((*ptr)->size == 0) - && (initialize_aggregate((*ptr), NULL) != FFI_OK))) - return FFI_BAD_TYPEDEF; - - /* Perform a sanity check on the argument type */ - FFI_ASSERT_VALID_TYPE(*ptr); - - arg->size = FFI_ALIGN(arg->size, (*ptr)->alignment); - if (offsets) - *offsets++ = arg->size; - arg->size += (*ptr)->size; - - arg->alignment = (arg->alignment > (*ptr)->alignment) ? - arg->alignment : (*ptr)->alignment; - - ptr++; - } - - /* Structure size includes tail padding. This is important for - structures that fit in one register on ABIs like the PowerPC64 - Linux ABI that right justify small structs in a register. - It's also needed for nested structure layout, for example - struct A { long a; char b; }; struct B { struct A x; char y; }; - should find y at an offset of 2*sizeof(long) and result in a - total size of 3*sizeof(long). */ - arg->size = FFI_ALIGN (arg->size, arg->alignment); - - /* On some targets, the ABI defines that structures have an additional - alignment beyond the "natural" one based on their elements. */ -#ifdef FFI_AGGREGATE_ALIGNMENT - if (FFI_AGGREGATE_ALIGNMENT > arg->alignment) - arg->alignment = FFI_AGGREGATE_ALIGNMENT; -#endif - - if (arg->size == 0) - return FFI_BAD_TYPEDEF; - else - return FFI_OK; -} - -#ifndef __CRIS__ -/* The CRIS ABI specifies structure elements to have byte - alignment only, so it completely overrides this functions, - which assumes "natural" alignment and padding. */ - -/* Perform machine independent ffi_cif preparation, then call - machine dependent routine. */ - -/* For non variadic functions isvariadic should be 0 and - nfixedargs==ntotalargs. - - For variadic calls, isvariadic should be 1 and nfixedargs - and ntotalargs set as appropriate. nfixedargs must always be >=1 */ - - -ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi, - unsigned int isvariadic, - unsigned int nfixedargs, - unsigned int ntotalargs, - ffi_type *rtype, ffi_type **atypes) -{ - unsigned bytes = 0; - unsigned int i; - ffi_type **ptr; - - FFI_ASSERT(cif != NULL); - FFI_ASSERT((!isvariadic) || (nfixedargs >= 1)); - FFI_ASSERT(nfixedargs <= ntotalargs); - - if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI)) - return FFI_BAD_ABI; - - cif->abi = abi; - cif->arg_types = atypes; - cif->nargs = ntotalargs; - cif->rtype = rtype; - - cif->flags = 0; -#if (defined(_M_ARM64) || defined(__aarch64__)) && defined(_WIN32) - cif->is_variadic = isvariadic; -#endif -#if HAVE_LONG_DOUBLE_VARIANT - ffi_prep_types (abi); -#endif - - /* Initialize the return type if necessary */ - if ((cif->rtype->size == 0) - && (initialize_aggregate(cif->rtype, NULL) != FFI_OK)) - return FFI_BAD_TYPEDEF; - -#ifndef FFI_TARGET_HAS_COMPLEX_TYPE - if (rtype->type == FFI_TYPE_COMPLEX) - abort(); -#endif - /* Perform a sanity check on the return type */ - FFI_ASSERT_VALID_TYPE(cif->rtype); - - /* x86, x86-64 and s390 stack space allocation is handled in prep_machdep. */ -#if !defined FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION - /* Make space for the return structure pointer */ - if (cif->rtype->type == FFI_TYPE_STRUCT -#ifdef TILE - && (cif->rtype->size > 10 * FFI_SIZEOF_ARG) -#endif -#ifdef XTENSA - && (cif->rtype->size > 16) -#endif - ) - bytes = STACK_ARG_SIZE(sizeof(void*)); -#endif - - for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) - { - - /* Initialize any uninitialized aggregate type definitions */ - if (((*ptr)->size == 0) - && (initialize_aggregate((*ptr), NULL) != FFI_OK)) - return FFI_BAD_TYPEDEF; - -#ifndef FFI_TARGET_HAS_COMPLEX_TYPE - if ((*ptr)->type == FFI_TYPE_COMPLEX) - abort(); -#endif - /* Perform a sanity check on the argument type, do this - check after the initialization. */ - FFI_ASSERT_VALID_TYPE(*ptr); - -#if !defined FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION - { - /* Add any padding if necessary */ - if (((*ptr)->alignment - 1) & bytes) - bytes = (unsigned)FFI_ALIGN(bytes, (*ptr)->alignment); - -#ifdef TILE - if (bytes < 10 * FFI_SIZEOF_ARG && - bytes + STACK_ARG_SIZE((*ptr)->size) > 10 * FFI_SIZEOF_ARG) - { - /* An argument is never split between the 10 parameter - registers and the stack. */ - bytes = 10 * FFI_SIZEOF_ARG; - } -#endif -#ifdef XTENSA - if (bytes <= 6*4 && bytes + STACK_ARG_SIZE((*ptr)->size) > 6*4) - bytes = 6*4; -#endif - - bytes += (unsigned int)STACK_ARG_SIZE((*ptr)->size); - } -#endif - } - - cif->bytes = bytes; - - /* Perform machine dependent cif processing */ -#ifdef FFI_TARGET_SPECIFIC_VARIADIC - if (isvariadic) - return ffi_prep_cif_machdep_var(cif, nfixedargs, ntotalargs); -#endif - - return ffi_prep_cif_machdep(cif); -} -#endif /* not __CRIS__ */ - -ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, - ffi_type *rtype, ffi_type **atypes) -{ - return ffi_prep_cif_core(cif, abi, 0, nargs, nargs, rtype, atypes); -} - -ffi_status ffi_prep_cif_var(ffi_cif *cif, - ffi_abi abi, - unsigned int nfixedargs, - unsigned int ntotalargs, - ffi_type *rtype, - ffi_type **atypes) -{ - ffi_status rc; - size_t int_size = ffi_type_sint.size; - unsigned int i; - - rc = ffi_prep_cif_core(cif, abi, 1, nfixedargs, ntotalargs, rtype, atypes); - - if (rc != FFI_OK) - return rc; - - for (i = nfixedargs; i < ntotalargs; i++) - { - ffi_type *arg_type = atypes[i]; - if (arg_type == &ffi_type_float - || ((arg_type->type != FFI_TYPE_STRUCT - && arg_type->type != FFI_TYPE_COMPLEX) - && arg_type->size < int_size)) - return FFI_BAD_ARGTYPE; - } - - return FFI_OK; -} - -#if FFI_CLOSURES - -ffi_status -ffi_prep_closure (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data) -{ - return ffi_prep_closure_loc (closure, cif, fun, user_data, closure); -} - -#endif - -ffi_status -ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets) -{ - if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI)) - return FFI_BAD_ABI; - if (struct_type->type != FFI_TYPE_STRUCT) - return FFI_BAD_TYPEDEF; - -#if HAVE_LONG_DOUBLE_VARIANT - ffi_prep_types (abi); -#endif - - return initialize_aggregate(struct_type, offsets); -} diff --git a/deps/libffi/src/raw_api.c b/deps/libffi/src/raw_api.c deleted file mode 100644 index be156116cb0d99..00000000000000 --- a/deps/libffi/src/raw_api.c +++ /dev/null @@ -1,267 +0,0 @@ -/* ----------------------------------------------------------------------- - raw_api.c - Copyright (c) 1999, 2008 Red Hat, Inc. - - Author: Kresten Krab Thorup - - 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. - ----------------------------------------------------------------------- */ - -/* This file defines generic functions for use with the raw api. */ - -#include -#include - -#if !FFI_NO_RAW_API - -size_t -ffi_raw_size (ffi_cif *cif) -{ - size_t result = 0; - int i; - - ffi_type **at = cif->arg_types; - - for (i = cif->nargs-1; i >= 0; i--, at++) - { -#if !FFI_NO_STRUCTS - if ((*at)->type == FFI_TYPE_STRUCT) - result += FFI_ALIGN (sizeof (void*), FFI_SIZEOF_ARG); - else -#endif - result += FFI_ALIGN ((*at)->size, FFI_SIZEOF_ARG); - } - - return result; -} - - -void -ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args) -{ - unsigned i; - ffi_type **tp = cif->arg_types; - -#if WORDS_BIGENDIAN - - for (i = 0; i < cif->nargs; i++, tp++, args++) - { - switch ((*tp)->type) - { - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 1); - break; - - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 2); - break; - -#if FFI_SIZEOF_ARG >= 4 - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 4); - break; -#endif - -#if !FFI_NO_STRUCTS - case FFI_TYPE_STRUCT: - *args = (raw++)->ptr; - break; -#endif - - case FFI_TYPE_COMPLEX: - *args = (raw++)->ptr; - break; - - case FFI_TYPE_POINTER: - *args = (void*) &(raw++)->ptr; - break; - - default: - *args = raw; - raw += FFI_ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; - } - } - -#else /* WORDS_BIGENDIAN */ - -#if !PDP - - /* then assume little endian */ - for (i = 0; i < cif->nargs; i++, tp++, args++) - { -#if !FFI_NO_STRUCTS - if ((*tp)->type == FFI_TYPE_STRUCT) - { - *args = (raw++)->ptr; - } - else -#endif - if ((*tp)->type == FFI_TYPE_COMPLEX) - { - *args = (raw++)->ptr; - } - else - { - *args = (void*) raw; - raw += FFI_ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*); - } - } - -#else -#error "pdp endian not supported" -#endif /* ! PDP */ - -#endif /* WORDS_BIGENDIAN */ -} - -void -ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw) -{ - unsigned i; - ffi_type **tp = cif->arg_types; - - for (i = 0; i < cif->nargs; i++, tp++, args++) - { - switch ((*tp)->type) - { - case FFI_TYPE_UINT8: - (raw++)->uint = *(UINT8*) (*args); - break; - - case FFI_TYPE_SINT8: - (raw++)->sint = *(SINT8*) (*args); - break; - - case FFI_TYPE_UINT16: - (raw++)->uint = *(UINT16*) (*args); - break; - - case FFI_TYPE_SINT16: - (raw++)->sint = *(SINT16*) (*args); - break; - -#if FFI_SIZEOF_ARG >= 4 - case FFI_TYPE_UINT32: - (raw++)->uint = *(UINT32*) (*args); - break; - - case FFI_TYPE_SINT32: - (raw++)->sint = *(SINT32*) (*args); - break; -#endif - -#if !FFI_NO_STRUCTS - case FFI_TYPE_STRUCT: - (raw++)->ptr = *args; - break; -#endif - - case FFI_TYPE_COMPLEX: - (raw++)->ptr = *args; - break; - - case FFI_TYPE_POINTER: - (raw++)->ptr = **(void***) args; - break; - - default: - memcpy ((void*) raw->data, (void*)*args, (*tp)->size); - raw += FFI_ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG; - } - } -} - -#if !FFI_NATIVE_RAW_API - - -/* This is a generic definition of ffi_raw_call, to be used if the - * native system does not provide a machine-specific implementation. - * Having this, allows code to be written for the raw API, without - * the need for system-specific code to handle input in that format; - * these following couple of functions will handle the translation forth - * and back automatically. */ - -void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *raw) -{ - void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); - ffi_raw_to_ptrarray (cif, raw, avalue); - ffi_call (cif, fn, rvalue, avalue); -} - -#if FFI_CLOSURES /* base system provides closures */ - -static void -ffi_translate_args (ffi_cif *cif, void *rvalue, - void **avalue, void *user_data) -{ - ffi_raw *raw = (ffi_raw*)alloca (ffi_raw_size (cif)); - ffi_raw_closure *cl = (ffi_raw_closure*)user_data; - - ffi_ptrarray_to_raw (cif, avalue, raw); - (*cl->fun) (cif, rvalue, raw, cl->user_data); -} - -ffi_status -ffi_prep_raw_closure_loc (ffi_raw_closure* cl, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data, - void *codeloc) -{ - ffi_status status; - - status = ffi_prep_closure_loc ((ffi_closure*) cl, - cif, - &ffi_translate_args, - codeloc, - codeloc); - if (status == FFI_OK) - { - cl->fun = fun; - cl->user_data = user_data; - } - - return status; -} - -#endif /* FFI_CLOSURES */ -#endif /* !FFI_NATIVE_RAW_API */ - -#if FFI_CLOSURES - -/* Again, here is the generic version of ffi_prep_raw_closure, which - * will install an intermediate "hub" for translation of arguments from - * the pointer-array format, to the raw format */ - -ffi_status -ffi_prep_raw_closure (ffi_raw_closure* cl, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data) -{ - return ffi_prep_raw_closure_loc (cl, cif, fun, user_data, cl); -} - -#endif /* FFI_CLOSURES */ - -#endif /* !FFI_NO_RAW_API */ diff --git a/deps/libffi/src/riscv/ffi.c b/deps/libffi/src/riscv/ffi.c deleted file mode 100644 index b455b12ae75ca5..00000000000000 --- a/deps/libffi/src/riscv/ffi.c +++ /dev/null @@ -1,514 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2015 Michael Knyszek - 2015 Andrew Waterman - 2018 Stef O'Rear - Based on MIPS N32/64 port - - RISC-V Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include - -#if __riscv_float_abi_double -#define ABI_FLEN 64 -#define ABI_FLOAT double -#elif __riscv_float_abi_single -#define ABI_FLEN 32 -#define ABI_FLOAT float -#endif - -#define NARGREG 8 -#define STKALIGN 16 -#define MAXCOPYARG (2 * sizeof(double)) - -typedef struct call_context -{ -#if ABI_FLEN - ABI_FLOAT fa[8]; -#endif - size_t a[8]; - /* used by the assembly code to in-place construct its own stack frame */ - char frame[16]; -} call_context; - -typedef struct call_builder -{ - call_context *aregs; - int used_integer; - int used_float; - size_t *used_stack; - void *struct_stack; -} call_builder; - -/* integer (not pointer) less than ABI XLEN */ -/* FFI_TYPE_INT does not appear to be used */ -#if __SIZEOF_POINTER__ == 8 -#define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT64) -#else -#define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT32) -#endif - -#if ABI_FLEN -typedef struct { - char as_elements, type1, offset2, type2; -} float_struct_info; - -#if ABI_FLEN >= 64 -#define IS_FLOAT(type) ((type) >= FFI_TYPE_FLOAT && (type) <= FFI_TYPE_DOUBLE) -#else -#define IS_FLOAT(type) ((type) == FFI_TYPE_FLOAT) -#endif - -static ffi_type **flatten_struct(ffi_type *in, ffi_type **out, ffi_type **out_end) { - int i; - if (out == out_end) return out; - if (in->type != FFI_TYPE_STRUCT) { - *(out++) = in; - } else { - for (i = 0; in->elements[i]; i++) - out = flatten_struct(in->elements[i], out, out_end); - } - return out; -} - -/* Structs with at most two fields after flattening, one of which is of - floating point type, are passed in multiple registers if sufficient - registers are available. */ -static float_struct_info struct_passed_as_elements(call_builder *cb, ffi_type *top) { - float_struct_info ret = {0, 0, 0, 0}; - ffi_type *fields[3]; - int num_floats, num_ints; - int num_fields = flatten_struct(top, fields, fields + 3) - fields; - - if (num_fields == 1) { - if (IS_FLOAT(fields[0]->type)) { - ret.as_elements = 1; - ret.type1 = fields[0]->type; - } - } else if (num_fields == 2) { - num_floats = IS_FLOAT(fields[0]->type) + IS_FLOAT(fields[1]->type); - num_ints = IS_INT(fields[0]->type) + IS_INT(fields[1]->type); - if (num_floats == 0 || num_floats + num_ints != 2) - return ret; - if (cb->used_float + num_floats > NARGREG || cb->used_integer + (2 - num_floats) > NARGREG) - return ret; - if (!IS_FLOAT(fields[0]->type) && !IS_FLOAT(fields[1]->type)) - return ret; - - ret.type1 = fields[0]->type; - ret.type2 = fields[1]->type; - ret.offset2 = FFI_ALIGN(fields[0]->size, fields[1]->alignment); - ret.as_elements = 1; - } - - return ret; -} -#endif - -/* allocates a single register, float register, or XLEN-sized stack slot to a datum */ -static void marshal_atom(call_builder *cb, int type, void *data) { - size_t value = 0; - switch (type) { - case FFI_TYPE_UINT8: value = *(uint8_t *)data; break; - case FFI_TYPE_SINT8: value = *(int8_t *)data; break; - case FFI_TYPE_UINT16: value = *(uint16_t *)data; break; - case FFI_TYPE_SINT16: value = *(int16_t *)data; break; - /* 32-bit quantities are always sign-extended in the ABI */ - case FFI_TYPE_UINT32: value = *(int32_t *)data; break; - case FFI_TYPE_SINT32: value = *(int32_t *)data; break; -#if __SIZEOF_POINTER__ == 8 - case FFI_TYPE_UINT64: value = *(uint64_t *)data; break; - case FFI_TYPE_SINT64: value = *(int64_t *)data; break; -#endif - case FFI_TYPE_POINTER: value = *(size_t *)data; break; - - /* float values may be recoded in an implementation-defined way - by hardware conforming to 2.1 or earlier, so use asm to - reinterpret floats as doubles */ -#if ABI_FLEN >= 32 - case FFI_TYPE_FLOAT: - asm("" : "=f"(cb->aregs->fa[cb->used_float++]) : "0"(*(float *)data)); - return; -#endif -#if ABI_FLEN >= 64 - case FFI_TYPE_DOUBLE: - asm("" : "=f"(cb->aregs->fa[cb->used_float++]) : "0"(*(double *)data)); - return; -#endif - default: FFI_ASSERT(0); break; - } - - if (cb->used_integer == NARGREG) { - *cb->used_stack++ = value; - } else { - cb->aregs->a[cb->used_integer++] = value; - } -} - -static void unmarshal_atom(call_builder *cb, int type, void *data) { - size_t value; - switch (type) { -#if ABI_FLEN >= 32 - case FFI_TYPE_FLOAT: - asm("" : "=f"(*(float *)data) : "0"(cb->aregs->fa[cb->used_float++])); - return; -#endif -#if ABI_FLEN >= 64 - case FFI_TYPE_DOUBLE: - asm("" : "=f"(*(double *)data) : "0"(cb->aregs->fa[cb->used_float++])); - return; -#endif - } - - if (cb->used_integer == NARGREG) { - value = *cb->used_stack++; - } else { - value = cb->aregs->a[cb->used_integer++]; - } - - switch (type) { - case FFI_TYPE_UINT8: *(uint8_t *)data = value; break; - case FFI_TYPE_SINT8: *(uint8_t *)data = value; break; - case FFI_TYPE_UINT16: *(uint16_t *)data = value; break; - case FFI_TYPE_SINT16: *(uint16_t *)data = value; break; - case FFI_TYPE_UINT32: *(uint32_t *)data = value; break; - case FFI_TYPE_SINT32: *(uint32_t *)data = value; break; -#if __SIZEOF_POINTER__ == 8 - case FFI_TYPE_UINT64: *(uint64_t *)data = value; break; - case FFI_TYPE_SINT64: *(uint64_t *)data = value; break; -#endif - case FFI_TYPE_POINTER: *(size_t *)data = value; break; - default: FFI_ASSERT(0); break; - } -} - -/* adds an argument to a call, or a not by reference return value */ -static void marshal(call_builder *cb, ffi_type *type, int var, void *data) { - size_t realign[2]; - -#if ABI_FLEN - if (!var && type->type == FFI_TYPE_STRUCT) { - float_struct_info fsi = struct_passed_as_elements(cb, type); - if (fsi.as_elements) { - marshal_atom(cb, fsi.type1, data); - if (fsi.offset2) - marshal_atom(cb, fsi.type2, ((char*)data) + fsi.offset2); - return; - } - } - - if (!var && cb->used_float < NARGREG && IS_FLOAT(type->type)) { - marshal_atom(cb, type->type, data); - return; - } -#endif - - if (type->size > 2 * __SIZEOF_POINTER__) { - /* copy to stack and pass by reference */ - data = memcpy (cb->struct_stack, data, type->size); - cb->struct_stack = (size_t *) FFI_ALIGN ((char *) cb->struct_stack + type->size, __SIZEOF_POINTER__); - marshal_atom(cb, FFI_TYPE_POINTER, &data); - } else if (IS_INT(type->type) || type->type == FFI_TYPE_POINTER) { - marshal_atom(cb, type->type, data); - } else { - /* overlong integers, soft-float floats, and structs without special - float handling are treated identically from this point on */ - - /* variadics are aligned even in registers */ - if (type->alignment > __SIZEOF_POINTER__) { - if (var) - cb->used_integer = FFI_ALIGN(cb->used_integer, 2); - cb->used_stack = (size_t *)FFI_ALIGN(cb->used_stack, 2*__SIZEOF_POINTER__); - } - - memcpy(realign, data, type->size); - if (type->size > 0) - marshal_atom(cb, FFI_TYPE_POINTER, realign); - if (type->size > __SIZEOF_POINTER__) - marshal_atom(cb, FFI_TYPE_POINTER, realign + 1); - } -} - -/* for arguments passed by reference returns the pointer, otherwise the arg is copied (up to MAXCOPYARG bytes) */ -static void *unmarshal(call_builder *cb, ffi_type *type, int var, void *data) { - size_t realign[2]; - void *pointer; - -#if ABI_FLEN - if (!var && type->type == FFI_TYPE_STRUCT) { - float_struct_info fsi = struct_passed_as_elements(cb, type); - if (fsi.as_elements) { - unmarshal_atom(cb, fsi.type1, data); - if (fsi.offset2) - unmarshal_atom(cb, fsi.type2, ((char*)data) + fsi.offset2); - return data; - } - } - - if (!var && cb->used_float < NARGREG && IS_FLOAT(type->type)) { - unmarshal_atom(cb, type->type, data); - return data; - } -#endif - - if (type->size > 2 * __SIZEOF_POINTER__) { - /* pass by reference */ - unmarshal_atom(cb, FFI_TYPE_POINTER, (char*)&pointer); - return pointer; - } else if (IS_INT(type->type) || type->type == FFI_TYPE_POINTER) { - unmarshal_atom(cb, type->type, data); - return data; - } else { - /* overlong integers, soft-float floats, and structs without special - float handling are treated identically from this point on */ - - /* variadics are aligned even in registers */ - if (type->alignment > __SIZEOF_POINTER__) { - if (var) - cb->used_integer = FFI_ALIGN(cb->used_integer, 2); - cb->used_stack = (size_t *)FFI_ALIGN(cb->used_stack, 2*__SIZEOF_POINTER__); - } - - if (type->size > 0) - unmarshal_atom(cb, FFI_TYPE_POINTER, realign); - if (type->size > __SIZEOF_POINTER__) - unmarshal_atom(cb, FFI_TYPE_POINTER, realign + 1); - memcpy(data, realign, type->size); - return data; - } -} - -static int passed_by_ref(call_builder *cb, ffi_type *type, int var) { -#if ABI_FLEN - if (!var && type->type == FFI_TYPE_STRUCT) { - float_struct_info fsi = struct_passed_as_elements(cb, type); - if (fsi.as_elements) return 0; - } -#endif - - return type->size > 2 * __SIZEOF_POINTER__; -} - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) { - cif->riscv_nfixedargs = cif->nargs; - return FFI_OK; -} - -/* Perform machine dependent cif processing when we have a variadic function */ - -ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, unsigned int ntotalargs) { - cif->riscv_nfixedargs = nfixedargs; - return FFI_OK; -} - -/* Low level routine for calling functions */ -extern void ffi_call_asm (void *stack, struct call_context *regs, - void (*fn) (void), void *closure) FFI_HIDDEN; - -static void -ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, - void *closure) -{ - /* this is a conservative estimate, assuming a complex return value and - that all remaining arguments are long long / __int128 */ - size_t arg_bytes = cif->nargs <= 3 ? 0 : - FFI_ALIGN(2 * sizeof(size_t) * (cif->nargs - 3), STKALIGN); - /* Allocate space for copies of big structures. */ - size_t struct_bytes = FFI_ALIGN (cif->bytes, STKALIGN); - size_t rval_bytes = 0; - if (rvalue == NULL && cif->rtype->size > 2*__SIZEOF_POINTER__) - rval_bytes = FFI_ALIGN(cif->rtype->size, STKALIGN); - size_t alloc_size = arg_bytes + rval_bytes + struct_bytes + sizeof(call_context); - - /* the assembly code will deallocate all stack data at lower addresses - than the argument region, so we need to allocate the frame and the - return value after the arguments in a single allocation */ - size_t alloc_base; - /* Argument region must be 16-byte aligned */ - if (_Alignof(max_align_t) >= STKALIGN) { - /* since sizeof long double is normally 16, the compiler will - guarantee alloca alignment to at least that much */ - alloc_base = (size_t)alloca(alloc_size); - } else { - alloc_base = FFI_ALIGN(alloca(alloc_size + STKALIGN - 1), STKALIGN); - } - - if (rval_bytes) - rvalue = (void*)(alloc_base + arg_bytes); - - call_builder cb; - cb.used_float = cb.used_integer = 0; - cb.aregs = (call_context*)(alloc_base + arg_bytes + rval_bytes + struct_bytes); - cb.used_stack = (void*)alloc_base; - cb.struct_stack = (void *) (alloc_base + arg_bytes + rval_bytes); - - int return_by_ref = passed_by_ref(&cb, cif->rtype, 0); - if (return_by_ref) - marshal(&cb, &ffi_type_pointer, 0, &rvalue); - - int i; - for (i = 0; i < cif->nargs; i++) - marshal(&cb, cif->arg_types[i], i >= cif->riscv_nfixedargs, avalue[i]); - - ffi_call_asm ((void *) alloc_base, cb.aregs, fn, closure); - - cb.used_float = cb.used_integer = 0; - if (!return_by_ref && rvalue) - { - if (IS_INT(cif->rtype->type) - && cif->rtype->size < sizeof (ffi_arg)) - { - /* Integer types smaller than ffi_arg need to be extended. */ - switch (cif->rtype->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_SINT32: - unmarshal_atom (&cb, (sizeof (ffi_arg) > 4 - ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32), - rvalue); - break; - case FFI_TYPE_UINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_UINT32: - unmarshal_atom (&cb, (sizeof (ffi_arg) > 4 - ? FFI_TYPE_UINT64 : FFI_TYPE_UINT32), - rvalue); - break; - } - } - else - unmarshal(&cb, cif->rtype, 0, rvalue); - } -} - -void -ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) -{ - ffi_call_int(cif, fn, rvalue, avalue, NULL); -} - -void -ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int(cif, fn, rvalue, avalue, closure); -} - -extern void ffi_closure_asm(void) FFI_HIDDEN; - -ffi_status ffi_prep_closure_loc(ffi_closure *closure, ffi_cif *cif, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data, void *codeloc) -{ - uint32_t *tramp = (uint32_t *) &closure->tramp[0]; - uint64_t fn = (uint64_t) (uintptr_t) ffi_closure_asm; - - if (cif->abi <= FFI_FIRST_ABI || cif->abi >= FFI_LAST_ABI) - return FFI_BAD_ABI; - - /* we will call ffi_closure_inner with codeloc, not closure, but as long - as the memory is readable it should work */ - - tramp[0] = 0x00000317; /* auipc t1, 0 (i.e. t0 <- codeloc) */ -#if __SIZEOF_POINTER__ == 8 - tramp[1] = 0x01033383; /* ld t2, 16(t1) */ -#else - tramp[1] = 0x01032383; /* lw t2, 16(t1) */ -#endif - tramp[2] = 0x00038067; /* jr t2 */ - tramp[3] = 0x00000013; /* nop */ - tramp[4] = fn; - tramp[5] = fn >> 32; - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - -#if !defined(__FreeBSD__) - __builtin___clear_cache(codeloc, codeloc + FFI_TRAMPOLINE_SIZE); -#endif - - return FFI_OK; -} - -extern void ffi_go_closure_asm (void) FFI_HIDDEN; - -ffi_status -ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *)) -{ - if (cif->abi <= FFI_FIRST_ABI || cif->abi >= FFI_LAST_ABI) - return FFI_BAD_ABI; - - closure->tramp = (void *) ffi_go_closure_asm; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} - -/* Called by the assembly code with aregs pointing to saved argument registers - and stack pointing to the stacked arguments. Return values passed in - registers will be reloaded from aregs. */ -void FFI_HIDDEN -ffi_closure_inner (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - size_t *stack, call_context *aregs) -{ - void **avalue = alloca(cif->nargs * sizeof(void*)); - /* storage for arguments which will be copied by unmarshal(). We could - theoretically avoid the copies in many cases and use at most 128 bytes - of memory, but allocating disjoint storage for each argument is - simpler. */ - char *astorage = alloca(cif->nargs * MAXCOPYARG); - void *rvalue; - call_builder cb; - int return_by_ref; - int i; - - cb.aregs = aregs; - cb.used_integer = cb.used_float = 0; - cb.used_stack = stack; - - return_by_ref = passed_by_ref(&cb, cif->rtype, 0); - if (return_by_ref) - unmarshal(&cb, &ffi_type_pointer, 0, &rvalue); - else - rvalue = alloca(cif->rtype->size); - - for (i = 0; i < cif->nargs; i++) - avalue[i] = unmarshal(&cb, cif->arg_types[i], - i >= cif->riscv_nfixedargs, astorage + i*MAXCOPYARG); - - fun (cif, rvalue, avalue, user_data); - - if (!return_by_ref && cif->rtype->type != FFI_TYPE_VOID) { - cb.used_integer = cb.used_float = 0; - marshal(&cb, cif->rtype, 0, rvalue); - } -} diff --git a/deps/libffi/src/riscv/ffitarget.h b/deps/libffi/src/riscv/ffitarget.h deleted file mode 100644 index 75e6462f5bbccd..00000000000000 --- a/deps/libffi/src/riscv/ffitarget.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - 2014 Michael Knyszek - - Target configuration macros for RISC-V. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef __riscv -#error "libffi was configured for a RISC-V target but this does not appear to be a RISC-V compiler." -#endif - -#ifndef LIBFFI_ASM - -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -/* FFI_UNUSED_NN and riscv_unused are to maintain ABI compatibility with a - distributed Berkeley patch from 2014, and can be removed at SONAME bump */ -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_UNUSED_1, - FFI_UNUSED_2, - FFI_UNUSED_3, - FFI_LAST_ABI, - - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; - -#endif /* LIBFFI_ASM */ - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 24 -#define FFI_NATIVE_RAW_API 0 -#define FFI_EXTRA_CIF_FIELDS unsigned riscv_nfixedargs; unsigned riscv_unused; -#define FFI_TARGET_SPECIFIC_VARIADIC - -#endif - diff --git a/deps/libffi/src/riscv/sysv.S b/deps/libffi/src/riscv/sysv.S deleted file mode 100644 index 522d0b0055004b..00000000000000 --- a/deps/libffi/src/riscv/sysv.S +++ /dev/null @@ -1,293 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2015 Michael Knyszek - 2015 Andrew Waterman - 2018 Stef O'Rear - - RISC-V Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -/* Define aliases so that we can handle all ABIs uniformly */ - -#if __SIZEOF_POINTER__ == 8 -#define PTRS 8 -#define LARG ld -#define SARG sd -#else -#define PTRS 4 -#define LARG lw -#define SARG sw -#endif - -#if __riscv_float_abi_double -#define FLTS 8 -#define FLARG fld -#define FSARG fsd -#elif __riscv_float_abi_single -#define FLTS 4 -#define FLARG flw -#define FSARG fsw -#else -#define FLTS 0 -#endif - -#define fp s0 - - .text - .globl ffi_call_asm - .type ffi_call_asm, @function - .hidden ffi_call_asm -/* - struct call_context { - floatreg fa[8]; - intreg a[8]; - intreg pad[rv32 ? 2 : 0]; - intreg save_fp, save_ra; - } - void ffi_call_asm (size_t *stackargs, struct call_context *regargs, - void (*fn) (void), void *closure); -*/ - -#define FRAME_LEN (8 * FLTS + 8 * PTRS + 16) - -ffi_call_asm: - .cfi_startproc - - /* - We are NOT going to set up an ordinary stack frame. In order to pass - the stacked args to the called function, we adjust our stack pointer to - a0, which is in the _caller's_ alloca area. We establish our own stack - frame at the end of the call_context. - - Anything below the arguments will be freed at this point, although we - preserve the call_context so that it can be read back in the caller. - */ - - .cfi_def_cfa 11, FRAME_LEN # interim CFA based on a1 - SARG fp, FRAME_LEN - 2*PTRS(a1) - .cfi_offset 8, -2*PTRS - SARG ra, FRAME_LEN - 1*PTRS(a1) - .cfi_offset 1, -1*PTRS - - addi fp, a1, FRAME_LEN - mv sp, a0 - .cfi_def_cfa 8, 0 # our frame is fully set up - - # Load arguments - mv t1, a2 - mv t2, a3 - -#if FLTS - FLARG fa0, -FRAME_LEN+0*FLTS(fp) - FLARG fa1, -FRAME_LEN+1*FLTS(fp) - FLARG fa2, -FRAME_LEN+2*FLTS(fp) - FLARG fa3, -FRAME_LEN+3*FLTS(fp) - FLARG fa4, -FRAME_LEN+4*FLTS(fp) - FLARG fa5, -FRAME_LEN+5*FLTS(fp) - FLARG fa6, -FRAME_LEN+6*FLTS(fp) - FLARG fa7, -FRAME_LEN+7*FLTS(fp) -#endif - - LARG a0, -FRAME_LEN+8*FLTS+0*PTRS(fp) - LARG a1, -FRAME_LEN+8*FLTS+1*PTRS(fp) - LARG a2, -FRAME_LEN+8*FLTS+2*PTRS(fp) - LARG a3, -FRAME_LEN+8*FLTS+3*PTRS(fp) - LARG a4, -FRAME_LEN+8*FLTS+4*PTRS(fp) - LARG a5, -FRAME_LEN+8*FLTS+5*PTRS(fp) - LARG a6, -FRAME_LEN+8*FLTS+6*PTRS(fp) - LARG a7, -FRAME_LEN+8*FLTS+7*PTRS(fp) - - /* Call */ - jalr t1 - - /* Save return values - only a0/a1 (fa0/fa1) are used */ -#if FLTS - FSARG fa0, -FRAME_LEN+0*FLTS(fp) - FSARG fa1, -FRAME_LEN+1*FLTS(fp) -#endif - - SARG a0, -FRAME_LEN+8*FLTS+0*PTRS(fp) - SARG a1, -FRAME_LEN+8*FLTS+1*PTRS(fp) - - /* Restore and return */ - addi sp, fp, -FRAME_LEN - .cfi_def_cfa 2, FRAME_LEN - LARG ra, -1*PTRS(fp) - .cfi_restore 1 - LARG fp, -2*PTRS(fp) - .cfi_restore 8 - ret - .cfi_endproc - .size ffi_call_asm, .-ffi_call_asm - - -/* - ffi_closure_asm. Expects address of the passed-in ffi_closure in t1. - void ffi_closure_inner (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - size_t *stackargs, struct call_context *regargs) -*/ - - .globl ffi_closure_asm - .hidden ffi_closure_asm - .type ffi_closure_asm, @function -ffi_closure_asm: - .cfi_startproc - - addi sp, sp, -FRAME_LEN - .cfi_def_cfa_offset FRAME_LEN - - /* make a frame */ - SARG fp, FRAME_LEN - 2*PTRS(sp) - .cfi_offset 8, -2*PTRS - SARG ra, FRAME_LEN - 1*PTRS(sp) - .cfi_offset 1, -1*PTRS - addi fp, sp, FRAME_LEN - - /* save arguments */ -#if FLTS - FSARG fa0, 0*FLTS(sp) - FSARG fa1, 1*FLTS(sp) - FSARG fa2, 2*FLTS(sp) - FSARG fa3, 3*FLTS(sp) - FSARG fa4, 4*FLTS(sp) - FSARG fa5, 5*FLTS(sp) - FSARG fa6, 6*FLTS(sp) - FSARG fa7, 7*FLTS(sp) -#endif - - SARG a0, 8*FLTS+0*PTRS(sp) - SARG a1, 8*FLTS+1*PTRS(sp) - SARG a2, 8*FLTS+2*PTRS(sp) - SARG a3, 8*FLTS+3*PTRS(sp) - SARG a4, 8*FLTS+4*PTRS(sp) - SARG a5, 8*FLTS+5*PTRS(sp) - SARG a6, 8*FLTS+6*PTRS(sp) - SARG a7, 8*FLTS+7*PTRS(sp) - - /* enter C */ - LARG a0, FFI_TRAMPOLINE_SIZE+0*PTRS(t1) - LARG a1, FFI_TRAMPOLINE_SIZE+1*PTRS(t1) - LARG a2, FFI_TRAMPOLINE_SIZE+2*PTRS(t1) - addi a3, sp, FRAME_LEN - mv a4, sp - - call ffi_closure_inner - - /* return values */ -#if FLTS - FLARG fa0, 0*FLTS(sp) - FLARG fa1, 1*FLTS(sp) -#endif - - LARG a0, 8*FLTS+0*PTRS(sp) - LARG a1, 8*FLTS+1*PTRS(sp) - - /* restore and return */ - LARG ra, FRAME_LEN-1*PTRS(sp) - .cfi_restore 1 - LARG fp, FRAME_LEN-2*PTRS(sp) - .cfi_restore 8 - addi sp, sp, FRAME_LEN - .cfi_def_cfa_offset 0 - ret - .cfi_endproc - .size ffi_closure_asm, .-ffi_closure_asm - -/* - ffi_go_closure_asm. Expects address of the passed-in ffi_go_closure in t2. - void ffi_closure_inner (ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - size_t *stackargs, struct call_context *regargs) -*/ - - .globl ffi_go_closure_asm - .hidden ffi_go_closure_asm - .type ffi_go_closure_asm, @function -ffi_go_closure_asm: - .cfi_startproc - - addi sp, sp, -FRAME_LEN - .cfi_def_cfa_offset FRAME_LEN - - /* make a frame */ - SARG fp, FRAME_LEN - 2*PTRS(sp) - .cfi_offset 8, -2*PTRS - SARG ra, FRAME_LEN - 1*PTRS(sp) - .cfi_offset 1, -1*PTRS - addi fp, sp, FRAME_LEN - - /* save arguments */ -#if FLTS - FSARG fa0, 0*FLTS(sp) - FSARG fa1, 1*FLTS(sp) - FSARG fa2, 2*FLTS(sp) - FSARG fa3, 3*FLTS(sp) - FSARG fa4, 4*FLTS(sp) - FSARG fa5, 5*FLTS(sp) - FSARG fa6, 6*FLTS(sp) - FSARG fa7, 7*FLTS(sp) -#endif - - SARG a0, 8*FLTS+0*PTRS(sp) - SARG a1, 8*FLTS+1*PTRS(sp) - SARG a2, 8*FLTS+2*PTRS(sp) - SARG a3, 8*FLTS+3*PTRS(sp) - SARG a4, 8*FLTS+4*PTRS(sp) - SARG a5, 8*FLTS+5*PTRS(sp) - SARG a6, 8*FLTS+6*PTRS(sp) - SARG a7, 8*FLTS+7*PTRS(sp) - - /* enter C */ - LARG a0, 1*PTRS(t2) - LARG a1, 2*PTRS(t2) - mv a2, t2 - addi a3, sp, FRAME_LEN - mv a4, sp - - call ffi_closure_inner - - /* return values */ -#if FLTS - FLARG fa0, 0*FLTS(sp) - FLARG fa1, 1*FLTS(sp) -#endif - - LARG a0, 8*FLTS+0*PTRS(sp) - LARG a1, 8*FLTS+1*PTRS(sp) - - /* restore and return */ - LARG ra, FRAME_LEN-1*PTRS(sp) - .cfi_restore 1 - LARG fp, FRAME_LEN-2*PTRS(sp) - .cfi_restore 8 - addi sp, sp, FRAME_LEN - .cfi_def_cfa_offset 0 - ret - .cfi_endproc - .size ffi_go_closure_asm, .-ffi_go_closure_asm diff --git a/deps/libffi/src/s390/ffi.c b/deps/libffi/src/s390/ffi.c deleted file mode 100644 index b197cd5fa609ca..00000000000000 --- a/deps/libffi/src/s390/ffi.c +++ /dev/null @@ -1,783 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2000, 2007 Software AG - Copyright (c) 2008 Red Hat, Inc - - S390 Foreign Function Interface - - 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 AUTHOR 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. - ----------------------------------------------------------------------- */ -/*====================================================================*/ -/* Includes */ -/* -------- */ -/*====================================================================*/ - -#include -#include -#include -#include "internal.h" -#include - -/*====================== End of Includes =============================*/ - -/*====================================================================*/ -/* Defines */ -/* ------- */ -/*====================================================================*/ - -/* Maximum number of GPRs available for argument passing. */ -#define MAX_GPRARGS 5 - -/* Maximum number of FPRs available for argument passing. */ -#ifdef __s390x__ -#define MAX_FPRARGS 4 -#else -#define MAX_FPRARGS 2 -#endif - -/* Round to multiple of 16. */ -#define ROUND_SIZE(size) (((size) + 15) & ~15) - -/*===================== End of Defines ===============================*/ - -/*====================================================================*/ -/* Externals */ -/* --------- */ -/*====================================================================*/ - -struct call_frame -{ - void *back_chain; - void *eos; - unsigned long gpr_args[5]; - unsigned long gpr_save[9]; - unsigned long long fpr_args[4]; -}; - -extern void FFI_HIDDEN ffi_call_SYSV(struct call_frame *, unsigned, void *, - void (*fn)(void), void *); - -extern void ffi_closure_SYSV(void); -extern void ffi_go_closure_SYSV(void); - -/*====================== End of Externals ============================*/ - -/*====================================================================*/ -/* */ -/* Name - ffi_check_struct_type. */ -/* */ -/* Function - Determine if a structure can be passed within a */ -/* general purpose or floating point register. */ -/* */ -/*====================================================================*/ - -static int -ffi_check_struct_type (ffi_type *arg) -{ - size_t size = arg->size; - - /* If the struct has just one element, look at that element - to find out whether to consider the struct as floating point. */ - while (arg->type == FFI_TYPE_STRUCT - && arg->elements[0] && !arg->elements[1]) - arg = arg->elements[0]; - - /* Structs of size 1, 2, 4, and 8 are passed in registers, - just like the corresponding int/float types. */ - switch (size) - { - case 1: - return FFI_TYPE_UINT8; - - case 2: - return FFI_TYPE_UINT16; - - case 4: - if (arg->type == FFI_TYPE_FLOAT) - return FFI_TYPE_FLOAT; - else - return FFI_TYPE_UINT32; - - case 8: - if (arg->type == FFI_TYPE_DOUBLE) - return FFI_TYPE_DOUBLE; - else - return FFI_TYPE_UINT64; - - default: - break; - } - - /* Other structs are passed via a pointer to the data. */ - return FFI_TYPE_POINTER; -} - -/*======================== End of Routine ============================*/ - -/*====================================================================*/ -/* */ -/* Name - ffi_prep_cif_machdep. */ -/* */ -/* Function - Perform machine dependent CIF processing. */ -/* */ -/*====================================================================*/ - -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep(ffi_cif *cif) -{ - size_t struct_size = 0; - int n_gpr = 0; - int n_fpr = 0; - int n_ov = 0; - - ffi_type **ptr; - int i; - - /* Determine return value handling. */ - - switch (cif->rtype->type) - { - /* Void is easy. */ - case FFI_TYPE_VOID: - cif->flags = FFI390_RET_VOID; - break; - - /* Structures and complex are returned via a hidden pointer. */ - case FFI_TYPE_STRUCT: - case FFI_TYPE_COMPLEX: - cif->flags = FFI390_RET_STRUCT; - n_gpr++; /* We need one GPR to pass the pointer. */ - break; - - /* Floating point values are returned in fpr 0. */ - case FFI_TYPE_FLOAT: - cif->flags = FFI390_RET_FLOAT; - break; - - case FFI_TYPE_DOUBLE: - cif->flags = FFI390_RET_DOUBLE; - break; - -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - cif->flags = FFI390_RET_STRUCT; - n_gpr++; - break; -#endif - /* Integer values are returned in gpr 2 (and gpr 3 - for 64-bit values on 31-bit machines). */ - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - cif->flags = FFI390_RET_INT64; - break; - - case FFI_TYPE_POINTER: - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - /* These are to be extended to word size. */ -#ifdef __s390x__ - cif->flags = FFI390_RET_INT64; -#else - cif->flags = FFI390_RET_INT32; -#endif - break; - - default: - FFI_ASSERT (0); - break; - } - - /* Now for the arguments. */ - - for (ptr = cif->arg_types, i = cif->nargs; - i > 0; - i--, ptr++) - { - int type = (*ptr)->type; - -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - /* 16-byte long double is passed like a struct. */ - if (type == FFI_TYPE_LONGDOUBLE) - type = FFI_TYPE_STRUCT; -#endif - - /* Check how a structure type is passed. */ - if (type == FFI_TYPE_STRUCT || type == FFI_TYPE_COMPLEX) - { - if (type == FFI_TYPE_COMPLEX) - type = FFI_TYPE_POINTER; - else - type = ffi_check_struct_type (*ptr); - - /* If we pass the struct via pointer, we must reserve space - to copy its data for proper call-by-value semantics. */ - if (type == FFI_TYPE_POINTER) - struct_size += ROUND_SIZE ((*ptr)->size); - } - - /* Now handle all primitive int/float data types. */ - switch (type) - { - /* The first MAX_FPRARGS floating point arguments - go in FPRs, the rest overflow to the stack. */ - - case FFI_TYPE_DOUBLE: - if (n_fpr < MAX_FPRARGS) - n_fpr++; - else - n_ov += sizeof (double) / sizeof (long); - break; - - case FFI_TYPE_FLOAT: - if (n_fpr < MAX_FPRARGS) - n_fpr++; - else - n_ov++; - break; - - /* On 31-bit machines, 64-bit integers are passed in GPR pairs, - if one is still available, or else on the stack. If only one - register is free, skip the register (it won't be used for any - subsequent argument either). */ - -#ifndef __s390x__ - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - if (n_gpr == MAX_GPRARGS-1) - n_gpr = MAX_GPRARGS; - if (n_gpr < MAX_GPRARGS) - n_gpr += 2; - else - n_ov += 2; - break; -#endif - - /* Everything else is passed in GPRs (until MAX_GPRARGS - have been used) or overflows to the stack. */ - - default: - if (n_gpr < MAX_GPRARGS) - n_gpr++; - else - n_ov++; - break; - } - } - - /* Total stack space as required for overflow arguments - and temporary structure copies. */ - - cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size; - - return FFI_OK; -} - -/*======================== End of Routine ============================*/ - -/*====================================================================*/ -/* */ -/* Name - ffi_call. */ -/* */ -/* Function - Call the FFI routine. */ -/* */ -/*====================================================================*/ - -static void -ffi_call_int(ffi_cif *cif, - void (*fn)(void), - void *rvalue, - void **avalue, - void *closure) -{ - int ret_type = cif->flags; - size_t rsize = 0, bytes = cif->bytes; - unsigned char *stack, *p_struct; - struct call_frame *frame; - unsigned long *p_ov, *p_gpr; - unsigned long long *p_fpr; - int n_fpr, n_gpr, n_ov, i, n; - ffi_type **arg_types; - - FFI_ASSERT (cif->abi == FFI_SYSV); - - /* If we don't have a return value, we need to fake one. */ - if (rvalue == NULL) - { - if (ret_type & FFI390_RET_IN_MEM) - rsize = cif->rtype->size; - else - ret_type = FFI390_RET_VOID; - } - - /* The stack space will be filled with those areas: - - dummy structure return (highest addresses) - FPR argument register save area - GPR argument register save area - stack frame for ffi_call_SYSV - temporary struct copies - overflow argument area (lowest addresses) - - We set up the following pointers: - - p_fpr: bottom of the FPR area (growing upwards) - p_gpr: bottom of the GPR area (growing upwards) - p_ov: bottom of the overflow area (growing upwards) - p_struct: top of the struct copy area (growing downwards) - - All areas are kept aligned to twice the word size. - - Note that we're going to create the stack frame for both - ffi_call_SYSV _and_ the target function right here. This - works because we don't make any function calls with more - than 5 arguments (indeed only memcpy and ffi_call_SYSV), - and thus we don't have any stacked outgoing parameters. */ - - stack = alloca (bytes + sizeof(struct call_frame) + rsize); - frame = (struct call_frame *)(stack + bytes); - if (rsize) - rvalue = frame + 1; - - /* Link the new frame back to the one from this function. */ - frame->back_chain = __builtin_frame_address (0); - - /* Fill in all of the argument stuff. */ - p_ov = (unsigned long *)stack; - p_struct = (unsigned char *)frame; - p_gpr = frame->gpr_args; - p_fpr = frame->fpr_args; - n_fpr = n_gpr = n_ov = 0; - - /* If we returning a structure then we set the first parameter register - to the address of where we are returning this structure. */ - if (cif->flags & FFI390_RET_IN_MEM) - p_gpr[n_gpr++] = (uintptr_t) rvalue; - - /* Now for the arguments. */ - arg_types = cif->arg_types; - for (i = 0, n = cif->nargs; i < n; ++i) - { - ffi_type *ty = arg_types[i]; - void *arg = avalue[i]; - int type = ty->type; - ffi_arg val; - - restart: - switch (type) - { - case FFI_TYPE_SINT8: - val = *(SINT8 *)arg; - goto do_int; - case FFI_TYPE_UINT8: - val = *(UINT8 *)arg; - goto do_int; - case FFI_TYPE_SINT16: - val = *(SINT16 *)arg; - goto do_int; - case FFI_TYPE_UINT16: - val = *(UINT16 *)arg; - goto do_int; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - val = *(SINT32 *)arg; - goto do_int; - case FFI_TYPE_UINT32: - val = *(UINT32 *)arg; - goto do_int; - case FFI_TYPE_POINTER: - val = *(uintptr_t *)arg; - do_int: - *(n_gpr < MAX_GPRARGS ? p_gpr + n_gpr++ : p_ov + n_ov++) = val; - break; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: -#ifdef __s390x__ - val = *(UINT64 *)arg; - goto do_int; -#else - if (n_gpr == MAX_GPRARGS-1) - n_gpr = MAX_GPRARGS; - if (n_gpr < MAX_GPRARGS) - p_gpr[n_gpr++] = ((UINT32 *) arg)[0], - p_gpr[n_gpr++] = ((UINT32 *) arg)[1]; - else - p_ov[n_ov++] = ((UINT32 *) arg)[0], - p_ov[n_ov++] = ((UINT32 *) arg)[1]; -#endif - break; - - case FFI_TYPE_DOUBLE: - if (n_fpr < MAX_FPRARGS) - p_fpr[n_fpr++] = *(UINT64 *) arg; - else - { -#ifdef __s390x__ - p_ov[n_ov++] = *(UINT64 *) arg; -#else - p_ov[n_ov++] = ((UINT32 *) arg)[0], - p_ov[n_ov++] = ((UINT32 *) arg)[1]; -#endif - } - break; - - case FFI_TYPE_FLOAT: - val = *(UINT32 *)arg; - if (n_fpr < MAX_FPRARGS) - p_fpr[n_fpr++] = (UINT64)val << 32; - else - p_ov[n_ov++] = val; - break; - - case FFI_TYPE_STRUCT: - /* Check how a structure type is passed. */ - type = ffi_check_struct_type (ty); - /* Some structures are passed via a type they contain. */ - if (type != FFI_TYPE_POINTER) - goto restart; - /* ... otherwise, passed by reference. fallthru. */ - -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - /* 16-byte long double is passed via reference. */ -#endif - case FFI_TYPE_COMPLEX: - /* Complex types are passed via reference. */ - p_struct -= ROUND_SIZE (ty->size); - memcpy (p_struct, arg, ty->size); - val = (uintptr_t)p_struct; - goto do_int; - - default: - FFI_ASSERT (0); - break; - } - } - - ffi_call_SYSV (frame, ret_type & FFI360_RET_MASK, rvalue, fn, closure); -} - -void -ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - ffi_call_int(cif, fn, rvalue, avalue, NULL); -} - -void -ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int(cif, fn, rvalue, avalue, closure); -} - -/*======================== End of Routine ============================*/ - -/*====================================================================*/ -/* */ -/* Name - ffi_closure_helper_SYSV. */ -/* */ -/* Function - Call a FFI closure target function. */ -/* */ -/*====================================================================*/ - -void FFI_HIDDEN -ffi_closure_helper_SYSV (ffi_cif *cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - unsigned long *p_gpr, - unsigned long long *p_fpr, - unsigned long *p_ov) -{ - unsigned long long ret_buffer; - - void *rvalue = &ret_buffer; - void **avalue; - void **p_arg; - - int n_gpr = 0; - int n_fpr = 0; - int n_ov = 0; - - ffi_type **ptr; - int i; - - /* Allocate buffer for argument list pointers. */ - p_arg = avalue = alloca (cif->nargs * sizeof (void *)); - - /* If we returning a structure, pass the structure address - directly to the target function. Otherwise, have the target - function store the return value to the GPR save area. */ - if (cif->flags & FFI390_RET_IN_MEM) - rvalue = (void *) p_gpr[n_gpr++]; - - /* Now for the arguments. */ - for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, p_arg++, ptr++) - { - int deref_struct_pointer = 0; - int type = (*ptr)->type; - -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - /* 16-byte long double is passed like a struct. */ - if (type == FFI_TYPE_LONGDOUBLE) - type = FFI_TYPE_STRUCT; -#endif - - /* Check how a structure type is passed. */ - if (type == FFI_TYPE_STRUCT || type == FFI_TYPE_COMPLEX) - { - if (type == FFI_TYPE_COMPLEX) - type = FFI_TYPE_POINTER; - else - type = ffi_check_struct_type (*ptr); - - /* If we pass the struct via pointer, remember to - retrieve the pointer later. */ - if (type == FFI_TYPE_POINTER) - deref_struct_pointer = 1; - } - - /* Pointers are passed like UINTs of the same size. */ - if (type == FFI_TYPE_POINTER) - { -#ifdef __s390x__ - type = FFI_TYPE_UINT64; -#else - type = FFI_TYPE_UINT32; -#endif - } - - /* Now handle all primitive int/float data types. */ - switch (type) - { - case FFI_TYPE_DOUBLE: - if (n_fpr < MAX_FPRARGS) - *p_arg = &p_fpr[n_fpr++]; - else - *p_arg = &p_ov[n_ov], - n_ov += sizeof (double) / sizeof (long); - break; - - case FFI_TYPE_FLOAT: - if (n_fpr < MAX_FPRARGS) - *p_arg = &p_fpr[n_fpr++]; - else - *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; - break; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: -#ifdef __s390x__ - if (n_gpr < MAX_GPRARGS) - *p_arg = &p_gpr[n_gpr++]; - else - *p_arg = &p_ov[n_ov++]; -#else - if (n_gpr == MAX_GPRARGS-1) - n_gpr = MAX_GPRARGS; - if (n_gpr < MAX_GPRARGS) - *p_arg = &p_gpr[n_gpr], n_gpr += 2; - else - *p_arg = &p_ov[n_ov], n_ov += 2; -#endif - break; - - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - if (n_gpr < MAX_GPRARGS) - *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4; - else - *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; - break; - - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - if (n_gpr < MAX_GPRARGS) - *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2; - else - *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2; - break; - - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - if (n_gpr < MAX_GPRARGS) - *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1; - else - *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1; - break; - - default: - FFI_ASSERT (0); - break; - } - - /* If this is a struct passed via pointer, we need to - actually retrieve that pointer. */ - if (deref_struct_pointer) - *p_arg = *(void **)*p_arg; - } - - - /* Call the target function. */ - (fun) (cif, rvalue, avalue, user_data); - - /* Convert the return value. */ - switch (cif->rtype->type) - { - /* Void is easy, and so is struct. */ - case FFI_TYPE_VOID: - case FFI_TYPE_STRUCT: - case FFI_TYPE_COMPLEX: -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: -#endif - break; - - /* Floating point values are returned in fpr 0. */ - case FFI_TYPE_FLOAT: - p_fpr[0] = (long long) *(unsigned int *) rvalue << 32; - break; - - case FFI_TYPE_DOUBLE: - p_fpr[0] = *(unsigned long long *) rvalue; - break; - - /* Integer values are returned in gpr 2 (and gpr 3 - for 64-bit values on 31-bit machines). */ - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: -#ifdef __s390x__ - p_gpr[0] = *(unsigned long *) rvalue; -#else - p_gpr[0] = ((unsigned long *) rvalue)[0], - p_gpr[1] = ((unsigned long *) rvalue)[1]; -#endif - break; - - case FFI_TYPE_POINTER: - case FFI_TYPE_UINT32: - case FFI_TYPE_UINT16: - case FFI_TYPE_UINT8: - p_gpr[0] = *(unsigned long *) rvalue; - break; - - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - case FFI_TYPE_SINT16: - case FFI_TYPE_SINT8: - p_gpr[0] = *(signed long *) rvalue; - break; - - default: - FFI_ASSERT (0); - break; - } -} - -/*======================== End of Routine ============================*/ - -/*====================================================================*/ -/* */ -/* Name - ffi_prep_closure_loc. */ -/* */ -/* Function - Prepare a FFI closure. */ -/* */ -/*====================================================================*/ - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, - ffi_cif *cif, - void (*fun) (ffi_cif *, void *, void **, void *), - void *user_data, - void *codeloc) -{ - static unsigned short const template[] = { - 0x0d10, /* basr %r1,0 */ -#ifndef __s390x__ - 0x9801, 0x1006, /* lm %r0,%r1,6(%r1) */ -#else - 0xeb01, 0x100e, 0x0004, /* lmg %r0,%r1,14(%r1) */ -#endif - 0x07f1 /* br %r1 */ - }; - void (*dest)(void); - unsigned long *tramp = (unsigned long *)&closure->tramp; - - if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - -#if defined(FFI_EXEC_STATIC_TRAMP) - if (ffi_tramp_is_present(closure)) - { - /* Initialize the static trampoline's parameters. */ - dest = ffi_closure_SYSV; - ffi_tramp_set_parms (closure->ftramp, dest, closure); - goto out; - } -#endif - - memcpy (tramp, template, sizeof(template)); - tramp[2] = (unsigned long)codeloc; - tramp[3] = (unsigned long)&ffi_closure_SYSV; - -#if defined(FFI_EXEC_STATIC_TRAMP) -out: -#endif - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - -/*======================== End of Routine ============================*/ - -/* Build a Go language closure. */ - -ffi_status -ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, - void (*fun)(ffi_cif*,void*,void**,void*)) -{ - if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - closure->tramp = ffi_go_closure_SYSV; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} - -#if defined(FFI_EXEC_STATIC_TRAMP) -void * -ffi_tramp_arch (size_t *tramp_size, size_t *map_size) -{ - extern void *trampoline_code_table; - - *tramp_size = FFI390_TRAMP_SIZE; - *map_size = FFI390_TRAMP_MAP_SIZE; - return &trampoline_code_table; -} -#endif \ No newline at end of file diff --git a/deps/libffi/src/s390/ffitarget.h b/deps/libffi/src/s390/ffitarget.h deleted file mode 100644 index d8a4ee4bf10360..00000000000000 --- a/deps/libffi/src/s390/ffitarget.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for S390. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#if defined (__s390x__) -#ifndef S390X -#define S390X -#endif -#endif - -/* ---- System specific configurations ----------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; -#endif - -#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION -#define FFI_TARGET_HAS_COMPLEX_TYPE - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 -#ifdef S390X -#define FFI_TRAMPOLINE_SIZE 32 -#else -#define FFI_TRAMPOLINE_SIZE 16 -#endif -#define FFI_NATIVE_RAW_API 0 - -#endif - diff --git a/deps/libffi/src/s390/internal.h b/deps/libffi/src/s390/internal.h deleted file mode 100644 index eba8e86d439cf6..00000000000000 --- a/deps/libffi/src/s390/internal.h +++ /dev/null @@ -1,22 +0,0 @@ -/* If these values change, sysv.S must be adapted! */ -#define FFI390_RET_DOUBLE 0 -#define FFI390_RET_FLOAT 1 -#define FFI390_RET_INT64 2 -#define FFI390_RET_INT32 3 -#define FFI390_RET_VOID 4 - -#define FFI360_RET_MASK 7 -#define FFI390_RET_IN_MEM 8 - -#define FFI390_RET_STRUCT (FFI390_RET_VOID | FFI390_RET_IN_MEM) - - -#if defined(FFI_EXEC_STATIC_TRAMP) -/* - * For the trampoline code table mapping, a mapping size of 4K is chosen. - */ -#define FFI390_TRAMP_MAP_SHIFT 12 -#define FFI390_TRAMP_MAP_SIZE (1 << FFI390_TRAMP_MAP_SHIFT) -#define FFI390_TRAMP_SIZE 16 - -#endif diff --git a/deps/libffi/src/s390/sysv.S b/deps/libffi/src/s390/sysv.S deleted file mode 100644 index d603218e6e200d..00000000000000 --- a/deps/libffi/src/s390/sysv.S +++ /dev/null @@ -1,363 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2000 Software AG - Copyright (c) 2008 Red Hat, Inc. - - S390 Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#include "internal.h" - - .text - -#ifndef __s390x__ - - # r2: frame - # r3: ret_type - # r4: ret_addr - # r5: fun - # r6: closure - - # This assumes we are using gas. - .balign 8 - .globl ffi_call_SYSV - FFI_HIDDEN(ffi_call_SYSV) - .type ffi_call_SYSV,%function -ffi_call_SYSV: - .cfi_startproc - st %r6,44(%r2) # Save registers - stm %r12,%r14,48(%r2) - lr %r13,%r2 # Install frame pointer - .cfi_rel_offset r6, 44 - .cfi_rel_offset r12, 48 - .cfi_rel_offset r13, 52 - .cfi_rel_offset r14, 56 - .cfi_def_cfa_register r13 - st %r2,0(%r15) # Set up back chain - sla %r3,3 # ret_type *= 8 - lr %r12,%r4 # Save ret_addr - lr %r1,%r5 # Save fun - lr %r0,%r6 # Install static chain - - # Set return address, so that there is only one indirect jump. -#ifdef HAVE_AS_S390_ZARCH - larl %r14,.Ltable - ar %r14,%r3 -#else - basr %r14,0 -0: la %r14,.Ltable-0b(%r14,%r3) -#endif - - lm %r2,%r6,8(%r13) # Load arguments - ld %f0,64(%r13) - ld %f2,72(%r13) - br %r1 # ... and call function - - .balign 8 -.Ltable: -# FFI390_RET_DOUBLE - std %f0,0(%r12) - j .Ldone - - .balign 8 -# FFI390_RET_FLOAT - ste %f0,0(%r12) - j .Ldone - - .balign 8 -# FFI390_RET_INT64 - st %r3,4(%r12) - nop - # fallthru - - .balign 8 -# FFI390_RET_INT32 - st %r2,0(%r12) - nop - # fallthru - - .balign 8 -# FFI390_RET_VOID -.Ldone: - l %r14,56(%r13) - l %r12,48(%r13) - l %r6,44(%r13) - l %r13,52(%r13) - .cfi_restore 14 - .cfi_restore 13 - .cfi_restore 12 - .cfi_restore 6 - .cfi_def_cfa r15, 96 - br %r14 - .cfi_endproc - .size ffi_call_SYSV,.-ffi_call_SYSV - - - .balign 8 - .globl ffi_go_closure_SYSV - FFI_HIDDEN(ffi_go_closure_SYSV) - .type ffi_go_closure_SYSV,%function -ffi_go_closure_SYSV: - .cfi_startproc - stm %r2,%r6,8(%r15) # Save arguments - lr %r4,%r0 # Load closure -> user_data - l %r2,4(%r4) # ->cif - l %r3,8(%r4) # ->fun - j .Ldoclosure - .cfi_endproc - - .balign 8 - .globl ffi_closure_SYSV - FFI_HIDDEN(ffi_closure_SYSV) - .type ffi_closure_SYSV,%function -ffi_closure_SYSV: - .cfi_startproc - stm %r2,%r6,8(%r15) # Save arguments - lr %r4,%r0 # Closure - l %r2,16(%r4) # ->cif - l %r3,20(%r4) # ->fun - l %r4,24(%r4) # ->user_data -.Ldoclosure: - stm %r12,%r15,48(%r15) # Save registers - lr %r12,%r15 - .cfi_def_cfa_register r12 - .cfi_rel_offset r6, 24 - .cfi_rel_offset r12, 48 - .cfi_rel_offset r13, 52 - .cfi_rel_offset r14, 56 - .cfi_rel_offset r15, 60 -#ifndef HAVE_AS_S390_ZARCH - basr %r13,0 # Set up base register -.Lcbase: - l %r1,.Lchelper-.Lcbase(%r13) # Get helper function -#endif - ahi %r15,-96-8 # Set up stack frame - st %r12,0(%r15) # Set up back chain - - std %f0,64(%r12) # Save fp arguments - std %f2,72(%r12) - - la %r5,96(%r12) # Overflow - st %r5,96(%r15) - la %r6,64(%r12) # FPRs - la %r5,8(%r12) # GPRs -#ifdef HAVE_AS_S390_ZARCH - brasl %r14,ffi_closure_helper_SYSV -#else - bas %r14,0(%r1,%r13) # Call helper -#endif - - lr %r15,%r12 - .cfi_def_cfa_register r15 - lm %r12,%r14,48(%r12) # Restore saved registers - l %r6,24(%r15) - ld %f0,64(%r15) # Load return registers - lm %r2,%r3,8(%r15) - br %r14 - .cfi_endproc - -#ifndef HAVE_AS_S390_ZARCH - .align 4 -.Lchelper: - .long ffi_closure_helper_SYSV-.Lcbase -#endif - - .size ffi_closure_SYSV,.-ffi_closure_SYSV - -#else - - # r2: frame - # r3: ret_type - # r4: ret_addr - # r5: fun - # r6: closure - - # This assumes we are using gas. - .balign 8 - .globl ffi_call_SYSV - FFI_HIDDEN(ffi_call_SYSV) - .type ffi_call_SYSV,%function -ffi_call_SYSV: - .cfi_startproc - stg %r6,88(%r2) # Save registers - stmg %r12,%r14,96(%r2) - lgr %r13,%r2 # Install frame pointer - .cfi_rel_offset r6, 88 - .cfi_rel_offset r12, 96 - .cfi_rel_offset r13, 104 - .cfi_rel_offset r14, 112 - .cfi_def_cfa_register r13 - stg %r2,0(%r15) # Set up back chain - larl %r14,.Ltable # Set up return address - slag %r3,%r3,3 # ret_type *= 8 - lgr %r12,%r4 # Save ret_addr - lgr %r1,%r5 # Save fun - lgr %r0,%r6 # Install static chain - agr %r14,%r3 - lmg %r2,%r6,16(%r13) # Load arguments - ld %f0,128(%r13) - ld %f2,136(%r13) - ld %f4,144(%r13) - ld %f6,152(%r13) - br %r1 # ... and call function - - .balign 8 -.Ltable: -# FFI390_RET_DOUBLE - std %f0,0(%r12) - j .Ldone - - .balign 8 -# FFI390_RET_DOUBLE - ste %f0,0(%r12) - j .Ldone - - .balign 8 -# FFI390_RET_INT64 - stg %r2,0(%r12) - - .balign 8 -# FFI390_RET_INT32 - # Never used, as we always store type ffi_arg. - # But the stg above is 6 bytes and we cannot - # jump around this case, so fall through. - nop - nop - - .balign 8 -# FFI390_RET_VOID -.Ldone: - lg %r14,112(%r13) - lg %r12,96(%r13) - lg %r6,88(%r13) - lg %r13,104(%r13) - .cfi_restore r14 - .cfi_restore r13 - .cfi_restore r12 - .cfi_restore r6 - .cfi_def_cfa r15, 160 - br %r14 - .cfi_endproc - .size ffi_call_SYSV,.-ffi_call_SYSV - - - .balign 8 - .globl ffi_go_closure_SYSV - FFI_HIDDEN(ffi_go_closure_SYSV) - .type ffi_go_closure_SYSV,%function -ffi_go_closure_SYSV: - .cfi_startproc - stmg %r2,%r6,16(%r15) # Save arguments - lgr %r4,%r0 # Load closure -> user_data - lg %r2,8(%r4) # ->cif - lg %r3,16(%r4) # ->fun - j .Ldoclosure - .cfi_endproc - .size ffi_go_closure_SYSV,.-ffi_go_closure_SYSV - - - .balign 8 - .globl ffi_closure_SYSV - FFI_HIDDEN(ffi_closure_SYSV) - .type ffi_closure_SYSV,%function -ffi_closure_SYSV: - .cfi_startproc - stmg %r2,%r6,16(%r15) # Save arguments - lgr %r4,%r0 # Load closure - lg %r2,32(%r4) # ->cif - lg %r3,40(%r4) # ->fun - lg %r4,48(%r4) # ->user_data -.Ldoclosure: - stmg %r13,%r15,104(%r15) # Save registers - lgr %r13,%r15 - .cfi_def_cfa_register r13 - .cfi_rel_offset r6, 48 - .cfi_rel_offset r13, 104 - .cfi_rel_offset r14, 112 - .cfi_rel_offset r15, 120 - aghi %r15,-160-16 # Set up stack frame - stg %r13,0(%r15) # Set up back chain - - std %f0,128(%r13) # Save fp arguments - std %f2,136(%r13) - std %f4,144(%r13) - std %f6,152(%r13) - la %r5,160(%r13) # Overflow - stg %r5,160(%r15) - la %r6,128(%r13) # FPRs - la %r5,16(%r13) # GPRs - brasl %r14,ffi_closure_helper_SYSV # Call helper - - lgr %r15,%r13 - .cfi_def_cfa_register r15 - lmg %r13,%r14,104(%r13) # Restore saved registers - lg %r6,48(%r15) - ld %f0,128(%r15) # Load return registers - lg %r2,16(%r15) - br %r14 - .cfi_endproc - .size ffi_closure_SYSV,.-ffi_closure_SYSV - - -#if defined(FFI_EXEC_STATIC_TRAMP) -/* - * Below is the definition of the trampoline code table. Each element in - * the code table is a trampoline. - */ -/* - * The trampoline uses the volatile register r0 and r1. As the registers are - * marked volatile in the ABI, the original values are not saved. - * - * The trampoline has two parameters - target code to jump to and data for - * the target code. The trampoline extracts the parameters from its parameter - * block (see tramp_table_map()). The trampoline saves the data address in r0. - * Finally, it jumps to the target code. - */ - - .align FFI390_TRAMP_MAP_SIZE -trampoline_code_table: - .rept FFI390_TRAMP_MAP_SIZE / FFI390_TRAMP_SIZE - basr %r1,0 # load next instruction address to r1 - lmg %r0,%r1,4094(%r1) # load parameter block - # r0 -> data - # r1 -> code - br %r1 # jump to r1/code - .balign 8 - .endr - - .globl trampoline_code_table - FFI_HIDDEN(trampoline_code_table) -#ifdef __ELF__ - .type trampoline_code_table, @function - .size trampoline_code_table,.- trampoline_code_table -#endif - .align FFI390_TRAMP_MAP_SIZE -#endif /* FFI_EXEC_STATIC_TRAMP */ - -#endif /* !s390x */ - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/sh/ffi.c b/deps/libffi/src/sh/ffi.c deleted file mode 100644 index 9ec86bfb205c8f..00000000000000 --- a/deps/libffi/src/sh/ffi.c +++ /dev/null @@ -1,717 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2002-2008, 2012 Kaz Kojima - Copyright (c) 2008 Red Hat, Inc. - - SuperH Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include - -#define NGREGARG 4 -#if defined(__SH4__) -#define NFREGARG 8 -#endif - -#if defined(__HITACHI__) -#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 -#else -#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 -#endif - -/* If the structure has essentially an unique element, return its type. */ -static int -simple_type (ffi_type *arg) -{ - if (arg->type != FFI_TYPE_STRUCT) - return arg->type; - else if (arg->elements[1]) - return FFI_TYPE_STRUCT; - - return simple_type (arg->elements[0]); -} - -static int -return_type (ffi_type *arg) -{ - unsigned short type; - - if (arg->type != FFI_TYPE_STRUCT) - return arg->type; - - type = simple_type (arg->elements[0]); - if (! arg->elements[1]) - { - switch (type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - return FFI_TYPE_INT; - - default: - return type; - } - } - - /* gcc uses r0/r1 pair for some kind of structures. */ - if (arg->size <= 2 * sizeof (int)) - { - int i = 0; - ffi_type *e; - - while ((e = arg->elements[i++])) - { - type = simple_type (e); - switch (type) - { - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_INT: - case FFI_TYPE_FLOAT: - return FFI_TYPE_UINT64; - - default: - break; - } - } - } - - return FFI_TYPE_STRUCT; -} - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - -void ffi_prep_args(char *stack, extended_cif *ecif) -{ - register unsigned int i; - register int tmp; - register unsigned int avn; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - int greg, ireg; -#if defined(__SH4__) - int freg = 0; -#endif - - tmp = 0; - argp = stack; - - if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) - { - *(void **) argp = ecif->rvalue; - argp += 4; - ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; - } - else - ireg = 0; - - /* Set arguments for registers. */ - greg = ireg; - avn = ecif->cif->nargs; - p_argv = ecif->avalue; - - for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) - { - size_t z; - - z = (*p_arg)->size; - if (z < sizeof(int)) - { - if (greg++ >= NGREGARG) - continue; - - z = sizeof(int); - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); - break; - - case FFI_TYPE_STRUCT: - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - break; - - default: - FFI_ASSERT(0); - } - argp += z; - } - else if (z == sizeof(int)) - { -#if defined(__SH4__) - if ((*p_arg)->type == FFI_TYPE_FLOAT) - { - if (freg++ >= NFREGARG) - continue; - } - else -#endif - { - if (greg++ >= NGREGARG) - continue; - } - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - argp += z; - } -#if defined(__SH4__) - else if ((*p_arg)->type == FFI_TYPE_DOUBLE) - { - if (freg + 1 >= NFREGARG) - continue; - freg = (freg + 1) & ~1; - freg += 2; - memcpy (argp, *p_argv, z); - argp += z; - } -#endif - else - { - int n = (z + sizeof (int) - 1) / sizeof (int); -#if defined(__SH4__) - if (greg + n - 1 >= NGREGARG) - continue; -#else - if (greg >= NGREGARG) - continue; -#endif - greg += n; - memcpy (argp, *p_argv, z); - argp += n * sizeof (int); - } - } - - /* Set arguments on stack. */ - greg = ireg; -#if defined(__SH4__) - freg = 0; -#endif - p_argv = ecif->avalue; - - for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) - { - size_t z; - - z = (*p_arg)->size; - if (z < sizeof(int)) - { - if (greg++ < NGREGARG) - continue; - - z = sizeof(int); - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); - break; - - case FFI_TYPE_STRUCT: - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - break; - - default: - FFI_ASSERT(0); - } - argp += z; - } - else if (z == sizeof(int)) - { -#if defined(__SH4__) - if ((*p_arg)->type == FFI_TYPE_FLOAT) - { - if (freg++ < NFREGARG) - continue; - } - else -#endif - { - if (greg++ < NGREGARG) - continue; - } - *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); - argp += z; - } -#if defined(__SH4__) - else if ((*p_arg)->type == FFI_TYPE_DOUBLE) - { - if (freg + 1 < NFREGARG) - { - freg = (freg + 1) & ~1; - freg += 2; - continue; - } - memcpy (argp, *p_argv, z); - argp += z; - } -#endif - else - { - int n = (z + sizeof (int) - 1) / sizeof (int); - if (greg + n - 1 < NGREGARG) - { - greg += n; - continue; - } -#if (! defined(__SH4__)) - else if (greg < NGREGARG) - { - greg = NGREGARG; - continue; - } -#endif - memcpy (argp, *p_argv, z); - argp += n * sizeof (int); - } - } - - return; -} - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - int i, j; - int size, type; - int n, m; - int greg; -#if defined(__SH4__) - int freg = 0; -#endif - - cif->flags = 0; - - greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) && - STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0; - -#if defined(__SH4__) - for (i = j = 0; i < cif->nargs && j < 12; i++) - { - type = (cif->arg_types)[i]->type; - switch (type) - { - case FFI_TYPE_FLOAT: - if (freg >= NFREGARG) - continue; - freg++; - cif->flags += ((cif->arg_types)[i]->type) << (2 * j); - j++; - break; - - case FFI_TYPE_DOUBLE: - if ((freg + 1) >= NFREGARG) - continue; - freg = (freg + 1) & ~1; - freg += 2; - cif->flags += ((cif->arg_types)[i]->type) << (2 * j); - j++; - break; - - default: - size = (cif->arg_types)[i]->size; - n = (size + sizeof (int) - 1) / sizeof (int); - if (greg + n - 1 >= NGREGARG) - continue; - greg += n; - for (m = 0; m < n; m++) - cif->flags += FFI_TYPE_INT << (2 * j++); - break; - } - } -#else - for (i = j = 0; i < cif->nargs && j < 4; i++) - { - size = (cif->arg_types)[i]->size; - n = (size + sizeof (int) - 1) / sizeof (int); - if (greg >= NGREGARG) - continue; - else if (greg + n - 1 >= NGREGARG) - n = NGREGARG - greg; - greg += n; - for (m = 0; m < n; m++) - cif->flags += FFI_TYPE_INT << (2 * j++); - } -#endif - - /* Set the return type flag */ - switch (cif->rtype->type) - { - case FFI_TYPE_STRUCT: - cif->flags += (unsigned) (return_type (cif->rtype)) << 24; - break; - - case FFI_TYPE_VOID: - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - cif->flags += (unsigned) cif->rtype->type << 24; - break; - - default: - cif->flags += FFI_TYPE_INT << 24; - break; - } - - return FFI_OK; -} - -extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, - unsigned, unsigned, unsigned *, void (*fn)(void)); - -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - extended_cif ecif; - UINT64 trvalue; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return */ - /* value address then we need to make one */ - - if (cif->rtype->type == FFI_TYPE_STRUCT - && return_type (cif->rtype) != FFI_TYPE_STRUCT) - ecif.rvalue = &trvalue; - else if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) - { - ecif.rvalue = alloca(cif->rtype->size); - } - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_SYSV: - ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, - fn); - break; - default: - FFI_ASSERT(0); - break; - } - - if (rvalue - && cif->rtype->type == FFI_TYPE_STRUCT - && return_type (cif->rtype) != FFI_TYPE_STRUCT) - memcpy (rvalue, &trvalue, cif->rtype->size); -} - -extern void ffi_closure_SYSV (void); -#if defined(__SH4__) -extern void __ic_invalidate (void *line); -#endif - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - unsigned int *tramp; - unsigned int insn; - - if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - tramp = (unsigned int *) &closure->tramp[0]; - /* Set T bit if the function returns a struct pointed with R2. */ - insn = (return_type (cif->rtype) == FFI_TYPE_STRUCT - ? 0x0018 /* sett */ - : 0x0008 /* clrt */); - -#ifdef __LITTLE_ENDIAN__ - tramp[0] = 0xd301d102; - tramp[1] = 0x0000412b | (insn << 16); -#else - tramp[0] = 0xd102d301; - tramp[1] = 0x412b0000 | insn; -#endif - *(void **) &tramp[2] = (void *)codeloc; /* ctx */ - *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */ - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - -#if defined(__SH4__) - /* Flush the icache. */ - __ic_invalidate(codeloc); -#endif - - return FFI_OK; -} - -/* Basically the trampoline invokes ffi_closure_SYSV, and on - * entry, r3 holds the address of the closure. - * After storing the registers that could possibly contain - * parameters to be passed into the stack frame and setting - * up space for a return value, ffi_closure_SYSV invokes the - * following helper function to do most of the work. - */ - -#ifdef __LITTLE_ENDIAN__ -#define OFS_INT8 0 -#define OFS_INT16 0 -#else -#define OFS_INT8 3 -#define OFS_INT16 2 -#endif - -int -ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, - unsigned long *pgr, unsigned long *pfr, - unsigned long *pst) -{ - void **avalue; - ffi_type **p_arg; - int i, avn; - int ireg, greg = 0; -#if defined(__SH4__) - int freg = 0; -#endif - ffi_cif *cif; - - cif = closure->cif; - avalue = alloca(cif->nargs * sizeof(void *)); - - /* Copy the caller's structure return value address so that the closure - returns the data directly to the caller. */ - if (cif->rtype->type == FFI_TYPE_STRUCT && STRUCT_VALUE_ADDRESS_WITH_ARG) - { - rvalue = (void *) *pgr++; - ireg = 1; - } - else - ireg = 0; - - cif = closure->cif; - greg = ireg; - avn = cif->nargs; - - /* Grab the addresses of the arguments from the stack frame. */ - for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) - { - size_t z; - - z = (*p_arg)->size; - if (z < sizeof(int)) - { - if (greg++ >= NGREGARG) - continue; - - z = sizeof(int); - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - avalue[i] = (((char *)pgr) + OFS_INT8); - break; - - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - avalue[i] = (((char *)pgr) + OFS_INT16); - break; - - case FFI_TYPE_STRUCT: - avalue[i] = pgr; - break; - - default: - FFI_ASSERT(0); - } - pgr++; - } - else if (z == sizeof(int)) - { -#if defined(__SH4__) - if ((*p_arg)->type == FFI_TYPE_FLOAT) - { - if (freg++ >= NFREGARG) - continue; - avalue[i] = pfr; - pfr++; - } - else -#endif - { - if (greg++ >= NGREGARG) - continue; - avalue[i] = pgr; - pgr++; - } - } -#if defined(__SH4__) - else if ((*p_arg)->type == FFI_TYPE_DOUBLE) - { - if (freg + 1 >= NFREGARG) - continue; - if (freg & 1) - pfr++; - freg = (freg + 1) & ~1; - freg += 2; - avalue[i] = pfr; - pfr += 2; - } -#endif - else - { - int n = (z + sizeof (int) - 1) / sizeof (int); -#if defined(__SH4__) - if (greg + n - 1 >= NGREGARG) - continue; -#else - if (greg >= NGREGARG) - continue; -#endif - greg += n; - avalue[i] = pgr; - pgr += n; - } - } - - greg = ireg; -#if defined(__SH4__) - freg = 0; -#endif - - for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) - { - size_t z; - - z = (*p_arg)->size; - if (z < sizeof(int)) - { - if (greg++ < NGREGARG) - continue; - - z = sizeof(int); - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - avalue[i] = (((char *)pst) + OFS_INT8); - break; - - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - avalue[i] = (((char *)pst) + OFS_INT16); - break; - - case FFI_TYPE_STRUCT: - avalue[i] = pst; - break; - - default: - FFI_ASSERT(0); - } - pst++; - } - else if (z == sizeof(int)) - { -#if defined(__SH4__) - if ((*p_arg)->type == FFI_TYPE_FLOAT) - { - if (freg++ < NFREGARG) - continue; - } - else -#endif - { - if (greg++ < NGREGARG) - continue; - } - avalue[i] = pst; - pst++; - } -#if defined(__SH4__) - else if ((*p_arg)->type == FFI_TYPE_DOUBLE) - { - if (freg + 1 < NFREGARG) - { - freg = (freg + 1) & ~1; - freg += 2; - continue; - } - avalue[i] = pst; - pst += 2; - } -#endif - else - { - int n = (z + sizeof (int) - 1) / sizeof (int); - if (greg + n - 1 < NGREGARG) - { - greg += n; - continue; - } -#if (! defined(__SH4__)) - else if (greg < NGREGARG) - { - greg += n; - pst += greg - NGREGARG; - continue; - } -#endif - avalue[i] = pst; - pst += n; - } - } - - (closure->fun) (cif, rvalue, avalue, closure->user_data); - - /* Tell ffi_closure_SYSV how to perform return type promotions. */ - return return_type (cif->rtype); -} diff --git a/deps/libffi/src/sh/ffitarget.h b/deps/libffi/src/sh/ffitarget.h deleted file mode 100644 index a36bf4207046d7..00000000000000 --- a/deps/libffi/src/sh/ffitarget.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for SuperH. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- Generic type definitions ----------------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; -#endif - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 16 -#define FFI_NATIVE_RAW_API 0 - -#endif - diff --git a/deps/libffi/src/sh/sysv.S b/deps/libffi/src/sh/sysv.S deleted file mode 100644 index 5be7516d6559e3..00000000000000 --- a/deps/libffi/src/sh/sysv.S +++ /dev/null @@ -1,850 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2002, 2003, 2004, 2006, 2008 Kaz Kojima - - SuperH Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#ifdef HAVE_MACHINE_ASM_H -#include -#else -/* XXX these lose for some platforms, I'm sure. */ -#define CNAME(x) x -#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): -#endif - -#if defined(__HITACHI__) -#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 -#else -#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 -#endif - -.text - - # r4: ffi_prep_args - # r5: &ecif - # r6: bytes - # r7: flags - # sp+0: rvalue - # sp+4: fn - - # This assumes we are using gas. -ENTRY(ffi_call_SYSV) - # Save registers -.LFB1: - mov.l r8,@-r15 -.LCFI0: - mov.l r9,@-r15 -.LCFI1: - mov.l r10,@-r15 -.LCFI2: - mov.l r12,@-r15 -.LCFI3: - mov.l r14,@-r15 -.LCFI4: - sts.l pr,@-r15 -.LCFI5: - mov r15,r14 -.LCFI6: -#if defined(__SH4__) - mov r6,r8 - mov r7,r9 - - sub r6,r15 - add #-16,r15 - mov #~7,r0 - and r0,r15 - - mov r4,r0 - jsr @r0 - mov r15,r4 - - mov r9,r1 - shlr8 r9 - shlr8 r9 - shlr8 r9 - - mov #FFI_TYPE_STRUCT,r2 - cmp/eq r2,r9 - bf 1f -#if STRUCT_VALUE_ADDRESS_WITH_ARG - mov.l @r15+,r4 - bra 2f - mov #5,r2 -#else - mov.l @r15+,r10 -#endif -1: - mov #4,r2 -2: - mov #4,r3 - -L_pass: - cmp/pl r8 - bf L_call_it - - mov r1,r0 - and #3,r0 - -L_pass_d: - cmp/eq #FFI_TYPE_DOUBLE,r0 - bf L_pass_f - - mov r3,r0 - and #1,r0 - tst r0,r0 - bt 1f - add #1,r3 -1: - mov #12,r0 - cmp/hs r0,r3 - bt/s 3f - shlr2 r1 - bsr L_pop_d - nop -3: - add #2,r3 - bra L_pass - add #-8,r8 - -L_pop_d: - mov r3,r0 - add r0,r0 - add r3,r0 - add #-12,r0 - braf r0 - nop -#ifdef __LITTLE_ENDIAN__ - fmov.s @r15+,fr5 - rts - fmov.s @r15+,fr4 - fmov.s @r15+,fr7 - rts - fmov.s @r15+,fr6 - fmov.s @r15+,fr9 - rts - fmov.s @r15+,fr8 - fmov.s @r15+,fr11 - rts - fmov.s @r15+,fr10 -#else - fmov.s @r15+,fr4 - rts - fmov.s @r15+,fr5 - fmov.s @r15+,fr6 - rts - fmov.s @r15+,fr7 - fmov.s @r15+,fr8 - rts - fmov.s @r15+,fr9 - fmov.s @r15+,fr10 - rts - fmov.s @r15+,fr11 -#endif - -L_pass_f: - cmp/eq #FFI_TYPE_FLOAT,r0 - bf L_pass_i - - mov #12,r0 - cmp/hs r0,r3 - bt/s 2f - shlr2 r1 - bsr L_pop_f - nop -2: - add #1,r3 - bra L_pass - add #-4,r8 - -L_pop_f: - mov r3,r0 - shll2 r0 - add #-16,r0 - braf r0 - nop -#ifdef __LITTLE_ENDIAN__ - rts - fmov.s @r15+,fr5 - rts - fmov.s @r15+,fr4 - rts - fmov.s @r15+,fr7 - rts - fmov.s @r15+,fr6 - rts - fmov.s @r15+,fr9 - rts - fmov.s @r15+,fr8 - rts - fmov.s @r15+,fr11 - rts - fmov.s @r15+,fr10 -#else - rts - fmov.s @r15+,fr4 - rts - fmov.s @r15+,fr5 - rts - fmov.s @r15+,fr6 - rts - fmov.s @r15+,fr7 - rts - fmov.s @r15+,fr8 - rts - fmov.s @r15+,fr9 - rts - fmov.s @r15+,fr10 - rts - fmov.s @r15+,fr11 -#endif - -L_pass_i: - cmp/eq #FFI_TYPE_INT,r0 - bf L_call_it - - mov #8,r0 - cmp/hs r0,r2 - bt/s 2f - shlr2 r1 - bsr L_pop_i - nop -2: - add #1,r2 - bra L_pass - add #-4,r8 - -L_pop_i: - mov r2,r0 - shll2 r0 - add #-16,r0 - braf r0 - nop - rts - mov.l @r15+,r4 - rts - mov.l @r15+,r5 - rts - mov.l @r15+,r6 - rts - mov.l @r15+,r7 - -L_call_it: - # call function -#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) - mov r10, r2 -#endif - mov.l @(28,r14),r1 - jsr @r1 - nop - -L_ret_d: - mov #FFI_TYPE_DOUBLE,r2 - cmp/eq r2,r9 - bf L_ret_ll - - mov.l @(24,r14),r1 -#ifdef __LITTLE_ENDIAN__ - fmov.s fr1,@r1 - add #4,r1 - bra L_epilogue - fmov.s fr0,@r1 -#else - fmov.s fr0,@r1 - add #4,r1 - bra L_epilogue - fmov.s fr1,@r1 -#endif - -L_ret_ll: - mov #FFI_TYPE_SINT64,r2 - cmp/eq r2,r9 - bt/s 1f - mov #FFI_TYPE_UINT64,r2 - cmp/eq r2,r9 - bf L_ret_f - -1: - mov.l @(24,r14),r2 - mov.l r0,@r2 - bra L_epilogue - mov.l r1,@(4,r2) - -L_ret_f: - mov #FFI_TYPE_FLOAT,r2 - cmp/eq r2,r9 - bf L_ret_i - - mov.l @(24,r14),r1 - bra L_epilogue - fmov.s fr0,@r1 - -L_ret_i: - mov #FFI_TYPE_INT,r2 - cmp/eq r2,r9 - bf L_epilogue - - mov.l @(24,r14),r1 - bra L_epilogue - mov.l r0,@r1 - -L_epilogue: - # Remove the space we pushed for the args - mov r14,r15 - - lds.l @r15+,pr - mov.l @r15+,r14 - mov.l @r15+,r12 - mov.l @r15+,r10 - mov.l @r15+,r9 - rts - mov.l @r15+,r8 -#else - mov r6,r8 - mov r7,r9 - - sub r6,r15 - add #-16,r15 - mov #~7,r0 - and r0,r15 - - mov r4,r0 - jsr @r0 - mov r15,r4 - - mov r9,r3 - shlr8 r9 - shlr8 r9 - shlr8 r9 - - mov #FFI_TYPE_STRUCT,r2 - cmp/eq r2,r9 - bf 1f -#if STRUCT_VALUE_ADDRESS_WITH_ARG - mov.l @r15+,r4 - bra 2f - mov #5,r2 -#else - mov.l @r15+,r10 -#endif -1: - mov #4,r2 -2: - -L_pass: - cmp/pl r8 - bf L_call_it - - mov r3,r0 - and #3,r0 - -L_pass_d: - cmp/eq #FFI_TYPE_DOUBLE,r0 - bf L_pass_i - - mov r15,r0 - and #7,r0 - tst r0,r0 - bt 1f - add #4,r15 -1: - mov #8,r0 - cmp/hs r0,r2 - bt/s 2f - shlr2 r3 - bsr L_pop_d - nop -2: - add #2,r2 - bra L_pass - add #-8,r8 - -L_pop_d: - mov r2,r0 - add r0,r0 - add r2,r0 - add #-12,r0 - add r0,r0 - braf r0 - nop - mov.l @r15+,r4 - rts - mov.l @r15+,r5 - mov.l @r15+,r5 - rts - mov.l @r15+,r6 - mov.l @r15+,r6 - rts - mov.l @r15+,r7 - rts - mov.l @r15+,r7 - -L_pass_i: - cmp/eq #FFI_TYPE_INT,r0 - bf L_call_it - - mov #8,r0 - cmp/hs r0,r2 - bt/s 2f - shlr2 r3 - bsr L_pop_i - nop -2: - add #1,r2 - bra L_pass - add #-4,r8 - -L_pop_i: - mov r2,r0 - shll2 r0 - add #-16,r0 - braf r0 - nop - rts - mov.l @r15+,r4 - rts - mov.l @r15+,r5 - rts - mov.l @r15+,r6 - rts - mov.l @r15+,r7 - -L_call_it: - # call function -#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) - mov r10, r2 -#endif - mov.l @(28,r14),r1 - jsr @r1 - nop - -L_ret_d: - mov #FFI_TYPE_DOUBLE,r2 - cmp/eq r2,r9 - bf L_ret_ll - - mov.l @(24,r14),r2 - mov.l r0,@r2 - bra L_epilogue - mov.l r1,@(4,r2) - -L_ret_ll: - mov #FFI_TYPE_SINT64,r2 - cmp/eq r2,r9 - bt/s 1f - mov #FFI_TYPE_UINT64,r2 - cmp/eq r2,r9 - bf L_ret_i - -1: - mov.l @(24,r14),r2 - mov.l r0,@r2 - bra L_epilogue - mov.l r1,@(4,r2) - -L_ret_i: - mov #FFI_TYPE_FLOAT,r2 - cmp/eq r2,r9 - bt 1f - mov #FFI_TYPE_INT,r2 - cmp/eq r2,r9 - bf L_epilogue -1: - mov.l @(24,r14),r1 - bra L_epilogue - mov.l r0,@r1 - -L_epilogue: - # Remove the space we pushed for the args - mov r14,r15 - - lds.l @r15+,pr - mov.l @r15+,r14 - mov.l @r15+,r12 - mov.l @r15+,r10 - mov.l @r15+,r9 - rts - mov.l @r15+,r8 -#endif -.LFE1: -.ffi_call_SYSV_end: - .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) - -.globl ffi_closure_helper_SYSV - -ENTRY(ffi_closure_SYSV) -.LFB2: - mov.l r7,@-r15 -.LCFI7: - mov.l r6,@-r15 -.LCFI8: - mov.l r5,@-r15 -.LCFI9: - mov.l r4,@-r15 -.LCFIA: - mov.l r14,@-r15 -.LCFIB: - sts.l pr,@-r15 - - /* Stack layout: - xx bytes (on stack parameters) - 16 bytes (register parameters) - 4 bytes (saved frame pointer) - 4 bytes (saved return address) - 32 bytes (floating register parameters, SH-4 only) - 8 bytes (result) - 4 bytes (pad) - 4 bytes (5th arg) - <- new stack pointer - */ -.LCFIC: -#if defined(__SH4__) - add #-48,r15 -#else - add #-16,r15 -#endif -.LCFID: - mov r15,r14 -.LCFIE: - -#if defined(__SH4__) - mov r14,r1 - add #48,r1 -#ifdef __LITTLE_ENDIAN__ - fmov.s fr10,@-r1 - fmov.s fr11,@-r1 - fmov.s fr8,@-r1 - fmov.s fr9,@-r1 - fmov.s fr6,@-r1 - fmov.s fr7,@-r1 - fmov.s fr4,@-r1 - fmov.s fr5,@-r1 -#else - fmov.s fr11,@-r1 - fmov.s fr10,@-r1 - fmov.s fr9,@-r1 - fmov.s fr8,@-r1 - fmov.s fr7,@-r1 - fmov.s fr6,@-r1 - fmov.s fr5,@-r1 - fmov.s fr4,@-r1 -#endif - mov r1,r7 - mov r14,r6 - add #56,r6 -#else - mov r14,r6 - add #24,r6 -#endif - - bt/s 10f - mov r2, r5 - mov r14,r1 - add #8,r1 - mov r1,r5 -10: - - mov r14,r1 -#if defined(__SH4__) - add #72,r1 -#else - add #40,r1 -#endif - mov.l r1,@r14 - -#ifdef PIC - mov.l L_got,r1 - mova L_got,r0 - add r0,r1 - mov.l L_helper,r0 - add r1,r0 -#else - mov.l L_helper,r0 -#endif - jsr @r0 - mov r3,r4 - - shll r0 - mov r0,r1 - mova L_table,r0 - add r1,r0 - mov.w @r0,r0 - mov r14,r2 - braf r0 - add #8,r2 -0: - .align 2 -#ifdef PIC -L_got: - .long _GLOBAL_OFFSET_TABLE_ -L_helper: - .long ffi_closure_helper_SYSV@GOTOFF -#else -L_helper: - .long ffi_closure_helper_SYSV -#endif -L_table: - .short L_case_v - 0b /* FFI_TYPE_VOID */ - .short L_case_i - 0b /* FFI_TYPE_INT */ -#if defined(__SH4__) - .short L_case_f - 0b /* FFI_TYPE_FLOAT */ - .short L_case_d - 0b /* FFI_TYPE_DOUBLE */ - .short L_case_d - 0b /* FFI_TYPE_LONGDOUBLE */ -#else - .short L_case_i - 0b /* FFI_TYPE_FLOAT */ - .short L_case_ll - 0b /* FFI_TYPE_DOUBLE */ - .short L_case_ll - 0b /* FFI_TYPE_LONGDOUBLE */ -#endif - .short L_case_uq - 0b /* FFI_TYPE_UINT8 */ - .short L_case_q - 0b /* FFI_TYPE_SINT8 */ - .short L_case_uh - 0b /* FFI_TYPE_UINT16 */ - .short L_case_h - 0b /* FFI_TYPE_SINT16 */ - .short L_case_i - 0b /* FFI_TYPE_UINT32 */ - .short L_case_i - 0b /* FFI_TYPE_SINT32 */ - .short L_case_ll - 0b /* FFI_TYPE_UINT64 */ - .short L_case_ll - 0b /* FFI_TYPE_SINT64 */ - .short L_case_v - 0b /* FFI_TYPE_STRUCT */ - .short L_case_i - 0b /* FFI_TYPE_POINTER */ - -#if defined(__SH4__) -L_case_d: -#ifdef __LITTLE_ENDIAN__ - fmov.s @r2+,fr1 - bra L_case_v - fmov.s @r2,fr0 -#else - fmov.s @r2+,fr0 - bra L_case_v - fmov.s @r2,fr1 -#endif - -L_case_f: - bra L_case_v - fmov.s @r2,fr0 -#endif - -L_case_ll: - mov.l @r2+,r0 - bra L_case_v - mov.l @r2,r1 - -L_case_i: - bra L_case_v - mov.l @r2,r0 - -L_case_q: -#ifdef __LITTLE_ENDIAN__ -#else - add #3,r2 -#endif - bra L_case_v - mov.b @r2,r0 - -L_case_uq: -#ifdef __LITTLE_ENDIAN__ -#else - add #3,r2 -#endif - mov.b @r2,r0 - bra L_case_v - extu.b r0,r0 - -L_case_h: -#ifdef __LITTLE_ENDIAN__ -#else - add #2,r2 -#endif - bra L_case_v - mov.w @r2,r0 - -L_case_uh: -#ifdef __LITTLE_ENDIAN__ -#else - add #2,r2 -#endif - mov.w @r2,r0 - extu.w r0,r0 - /* fall through */ - -L_case_v: -#if defined(__SH4__) - add #48,r15 -#else - add #16,r15 -#endif - lds.l @r15+,pr - mov.l @r15+,r14 - rts - add #16,r15 -.LFE2: -.ffi_closure_SYSV_end: - .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif - - .section ".eh_frame","aw",@progbits -__FRAME_BEGIN__: - .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ -.LSCIE1: - .4byte 0x0 /* CIE Identifier Tag */ - .byte 0x1 /* CIE Version */ -#ifdef PIC - .ascii "zR\0" /* CIE Augmentation */ -#else - .byte 0x0 /* CIE Augmentation */ -#endif - .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ - .byte 0x7c /* sleb128 -4; CIE Data Alignment Factor */ - .byte 0x11 /* CIE RA Column */ -#ifdef PIC - .uleb128 0x1 /* Augmentation size */ - .byte 0x10 /* FDE Encoding (pcrel) */ -#endif - .byte 0xc /* DW_CFA_def_cfa */ - .byte 0xf /* uleb128 0xf */ - .byte 0x0 /* uleb128 0x0 */ - .align 2 -.LECIE1: -.LSFDE1: - .4byte .LEFDE1-.LASFDE1 /* FDE Length */ -.LASFDE1: - .4byte .LASFDE1-__FRAME_BEGIN__ /* FDE CIE offset */ -#ifdef PIC - .4byte .LFB1-. /* FDE initial location */ -#else - .4byte .LFB1 /* FDE initial location */ -#endif - .4byte .LFE1-.LFB1 /* FDE address range */ -#ifdef PIC - .uleb128 0x0 /* Augmentation size */ -#endif - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI0-.LFB1 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x4 /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI1-.LCFI0 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x8 /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI2-.LCFI1 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0xc /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI3-.LCFI2 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x10 /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI4-.LCFI3 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x14 /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI5-.LCFI4 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x18 /* uleb128 0x4 */ - .byte 0x91 /* DW_CFA_offset, column 0x11 */ - .byte 0x6 /* uleb128 0x6 */ - .byte 0x8e /* DW_CFA_offset, column 0xe */ - .byte 0x5 /* uleb128 0x5 */ - .byte 0x8c /* DW_CFA_offset, column 0xc */ - .byte 0x4 /* uleb128 0x4 */ - .byte 0x8a /* DW_CFA_offset, column 0xa */ - .byte 0x3 /* uleb128 0x3 */ - .byte 0x89 /* DW_CFA_offset, column 0x9 */ - .byte 0x2 /* uleb128 0x2 */ - .byte 0x88 /* DW_CFA_offset, column 0x8 */ - .byte 0x1 /* uleb128 0x1 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI6-.LCFI5 - .byte 0xd /* DW_CFA_def_cfa_register */ - .byte 0xe /* uleb128 0xe */ - .align 2 -.LEFDE1: - -.LSFDE3: - .4byte .LEFDE3-.LASFDE3 /* FDE Length */ -.LASFDE3: - .4byte .LASFDE3-__FRAME_BEGIN__ /* FDE CIE offset */ -#ifdef PIC - .4byte .LFB2-. /* FDE initial location */ -#else - .4byte .LFB2 /* FDE initial location */ -#endif - .4byte .LFE2-.LFB2 /* FDE address range */ -#ifdef PIC - .uleb128 0x0 /* Augmentation size */ -#endif - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI7-.LFB2 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x4 /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI8-.LCFI7 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x8 /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFI9-.LCFI8 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0xc /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFIA-.LCFI9 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x10 /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFIB-.LCFIA - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x14 /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFIC-.LCFIB - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x18 /* uleb128 0x4 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFID-.LCFIC - .byte 0xe /* DW_CFA_def_cfa_offset */ -#if defined(__SH4__) - .byte 24+48 /* uleb128 24+48 */ -#else - .byte 24+16 /* uleb128 24+16 */ -#endif - .byte 0x91 /* DW_CFA_offset, column 0x11 */ - .byte 0x6 /* uleb128 0x6 */ - .byte 0x8e /* DW_CFA_offset, column 0xe */ - .byte 0x5 /* uleb128 0x5 */ - .byte 0x84 /* DW_CFA_offset, column 0x4 */ - .byte 0x4 /* uleb128 0x4 */ - .byte 0x85 /* DW_CFA_offset, column 0x5 */ - .byte 0x3 /* uleb128 0x3 */ - .byte 0x86 /* DW_CFA_offset, column 0x6 */ - .byte 0x2 /* uleb128 0x2 */ - .byte 0x87 /* DW_CFA_offset, column 0x7 */ - .byte 0x1 /* uleb128 0x1 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte .LCFIE-.LCFID - .byte 0xd /* DW_CFA_def_cfa_register */ - .byte 0xe /* uleb128 0xe */ - .align 2 -.LEFDE3: diff --git a/deps/libffi/src/sh64/ffi.c b/deps/libffi/src/sh64/ffi.c deleted file mode 100644 index 123b87ace92f45..00000000000000 --- a/deps/libffi/src/sh64/ffi.c +++ /dev/null @@ -1,469 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2003, 2004, 2006, 2007, 2012 Kaz Kojima - Copyright (c) 2008 Anthony Green - - SuperH SHmedia Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include - -#define NGREGARG 8 -#define NFREGARG 12 - -static int -return_type (ffi_type *arg) -{ - - if (arg->type != FFI_TYPE_STRUCT) - return arg->type; - - /* gcc uses r2 if the result can be packed in on register. */ - if (arg->size <= sizeof (UINT8)) - return FFI_TYPE_UINT8; - else if (arg->size <= sizeof (UINT16)) - return FFI_TYPE_UINT16; - else if (arg->size <= sizeof (UINT32)) - return FFI_TYPE_UINT32; - else if (arg->size <= sizeof (UINT64)) - return FFI_TYPE_UINT64; - - return FFI_TYPE_STRUCT; -} - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - -void ffi_prep_args(char *stack, extended_cif *ecif) -{ - register unsigned int i; - register unsigned int avn; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - - argp = stack; - - if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) - { - *(void **) argp = ecif->rvalue; - argp += sizeof (UINT64); - } - - avn = ecif->cif->nargs; - p_argv = ecif->avalue; - - for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) - { - size_t z; - int align; - - z = (*p_arg)->size; - align = (*p_arg)->alignment; - if (z < sizeof (UINT32)) - { - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(SINT64 *) argp = (SINT64) *(SINT8 *)(*p_argv); - break; - - case FFI_TYPE_UINT8: - *(UINT64 *) argp = (UINT64) *(UINT8 *)(*p_argv); - break; - - case FFI_TYPE_SINT16: - *(SINT64 *) argp = (SINT64) *(SINT16 *)(*p_argv); - break; - - case FFI_TYPE_UINT16: - *(UINT64 *) argp = (UINT64) *(UINT16 *)(*p_argv); - break; - - case FFI_TYPE_STRUCT: - memcpy (argp, *p_argv, z); - break; - - default: - FFI_ASSERT(0); - } - argp += sizeof (UINT64); - } - else if (z == sizeof (UINT32) && align == sizeof (UINT32)) - { - switch ((*p_arg)->type) - { - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - *(SINT64 *) argp = (SINT64) *(SINT32 *) (*p_argv); - break; - - case FFI_TYPE_FLOAT: - case FFI_TYPE_POINTER: - case FFI_TYPE_UINT32: - case FFI_TYPE_STRUCT: - *(UINT64 *) argp = (UINT64) *(UINT32 *) (*p_argv); - break; - - default: - FFI_ASSERT(0); - break; - } - argp += sizeof (UINT64); - } - else if (z == sizeof (UINT64) - && align == sizeof (UINT64) - && ((int) *p_argv & (sizeof (UINT64) - 1)) == 0) - { - *(UINT64 *) argp = *(UINT64 *) (*p_argv); - argp += sizeof (UINT64); - } - else - { - int n = (z + sizeof (UINT64) - 1) / sizeof (UINT64); - - memcpy (argp, *p_argv, z); - argp += n * sizeof (UINT64); - } - } - - return; -} - -/* Perform machine dependent cif processing */ -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - int i, j; - int size, type; - int n, m; - int greg; - int freg; - int fpair = -1; - - greg = (return_type (cif->rtype) == FFI_TYPE_STRUCT ? 1 : 0); - freg = 0; - cif->flags2 = 0; - - for (i = j = 0; i < cif->nargs; i++) - { - type = (cif->arg_types)[i]->type; - switch (type) - { - case FFI_TYPE_FLOAT: - greg++; - cif->bytes += sizeof (UINT64) - sizeof (float); - if (freg >= NFREGARG - 1) - continue; - if (fpair < 0) - { - fpair = freg; - freg += 2; - } - else - fpair = -1; - cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++); - break; - - case FFI_TYPE_DOUBLE: - if (greg++ >= NGREGARG && (freg + 1) >= NFREGARG) - continue; - if ((freg + 1) < NFREGARG) - { - freg += 2; - cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++); - } - else - cif->flags2 += FFI_TYPE_INT << (2 * j++); - break; - - default: - size = (cif->arg_types)[i]->size; - if (size < sizeof (UINT64)) - cif->bytes += sizeof (UINT64) - size; - n = (size + sizeof (UINT64) - 1) / sizeof (UINT64); - if (greg >= NGREGARG) - continue; - else if (greg + n - 1 >= NGREGARG) - greg = NGREGARG; - else - greg += n; - for (m = 0; m < n; m++) - cif->flags2 += FFI_TYPE_INT << (2 * j++); - break; - } - } - - /* Set the return type flag */ - switch (cif->rtype->type) - { - case FFI_TYPE_STRUCT: - cif->flags = return_type (cif->rtype); - break; - - case FFI_TYPE_VOID: - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - cif->flags = cif->rtype->type; - break; - - default: - cif->flags = FFI_TYPE_INT; - break; - } - - return FFI_OK; -} - -/*@-declundef@*/ -/*@-exportheader@*/ -extern void ffi_call_SYSV(void (*)(char *, extended_cif *), - /*@out@*/ extended_cif *, - unsigned, unsigned, long long, - /*@out@*/ unsigned *, - void (*fn)(void)); -/*@=declundef@*/ -/*@=exportheader@*/ - -void ffi_call(/*@dependent@*/ ffi_cif *cif, - void (*fn)(void), - /*@out@*/ void *rvalue, - /*@dependent@*/ void **avalue) -{ - extended_cif ecif; - UINT64 trvalue; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return */ - /* value address then we need to make one */ - - if (cif->rtype->type == FFI_TYPE_STRUCT - && return_type (cif->rtype) != FFI_TYPE_STRUCT) - ecif.rvalue = &trvalue; - else if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) - { - ecif.rvalue = alloca(cif->rtype->size); - } - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_SYSV: - ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, cif->flags2, - ecif.rvalue, fn); - break; - default: - FFI_ASSERT(0); - break; - } - - if (rvalue - && cif->rtype->type == FFI_TYPE_STRUCT - && return_type (cif->rtype) != FFI_TYPE_STRUCT) - memcpy (rvalue, &trvalue, cif->rtype->size); -} - -extern void ffi_closure_SYSV (void); -extern void __ic_invalidate (void *line); - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, - ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - unsigned int *tramp; - - if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - tramp = (unsigned int *) &closure->tramp[0]; - /* Since ffi_closure is an aligned object, the ffi trampoline is - called as an SHcompact code. Sigh. - SHcompact part: - mova @(1,pc),r0; add #1,r0; jmp @r0; nop; - SHmedia part: - movi fnaddr >> 16,r1; shori fnaddr,r1; ptabs/l r1,tr0 - movi cxt >> 16,r1; shori cxt,r1; blink tr0,r63 */ -#ifdef __LITTLE_ENDIAN__ - tramp[0] = 0x7001c701; - tramp[1] = 0x0009402b; -#else - tramp[0] = 0xc7017001; - tramp[1] = 0x402b0009; -#endif - tramp[2] = 0xcc000010 | (((UINT32) ffi_closure_SYSV) >> 16) << 10; - tramp[3] = 0xc8000010 | (((UINT32) ffi_closure_SYSV) & 0xffff) << 10; - tramp[4] = 0x6bf10600; - tramp[5] = 0xcc000010 | (((UINT32) codeloc) >> 16) << 10; - tramp[6] = 0xc8000010 | (((UINT32) codeloc) & 0xffff) << 10; - tramp[7] = 0x4401fff0; - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - /* Flush the icache. */ - asm volatile ("ocbwb %0,0; synco; icbi %1,0; synci" : : "r" (tramp), - "r"(codeloc)); - - return FFI_OK; -} - -/* Basically the trampoline invokes ffi_closure_SYSV, and on - * entry, r3 holds the address of the closure. - * After storing the registers that could possibly contain - * parameters to be passed into the stack frame and setting - * up space for a return value, ffi_closure_SYSV invokes the - * following helper function to do most of the work. - */ - -int -ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue, - UINT64 *pgr, UINT64 *pfr, UINT64 *pst) -{ - void **avalue; - ffi_type **p_arg; - int i, avn; - int greg, freg; - ffi_cif *cif; - int fpair = -1; - - cif = closure->cif; - avalue = alloca (cif->nargs * sizeof (void *)); - - /* Copy the caller's structure return value address so that the closure - returns the data directly to the caller. */ - if (return_type (cif->rtype) == FFI_TYPE_STRUCT) - { - rvalue = (UINT64 *) *pgr; - greg = 1; - } - else - greg = 0; - - freg = 0; - cif = closure->cif; - avn = cif->nargs; - - /* Grab the addresses of the arguments from the stack frame. */ - for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) - { - size_t z; - void *p; - - z = (*p_arg)->size; - if (z < sizeof (UINT32)) - { - p = pgr + greg++; - - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - case FFI_TYPE_STRUCT: -#ifdef __LITTLE_ENDIAN__ - avalue[i] = p; -#else - avalue[i] = ((char *) p) + sizeof (UINT32) - z; -#endif - break; - - default: - FFI_ASSERT(0); - } - } - else if (z == sizeof (UINT32)) - { - if ((*p_arg)->type == FFI_TYPE_FLOAT) - { - if (freg < NFREGARG - 1) - { - if (fpair >= 0) - { - avalue[i] = (UINT32 *) pfr + fpair; - fpair = -1; - } - else - { -#ifdef __LITTLE_ENDIAN__ - fpair = freg; - avalue[i] = (UINT32 *) pfr + (1 ^ freg); -#else - fpair = 1 ^ freg; - avalue[i] = (UINT32 *) pfr + freg; -#endif - freg += 2; - } - } - else -#ifdef __LITTLE_ENDIAN__ - avalue[i] = pgr + greg; -#else - avalue[i] = (UINT32 *) (pgr + greg) + 1; -#endif - } - else -#ifdef __LITTLE_ENDIAN__ - avalue[i] = pgr + greg; -#else - avalue[i] = (UINT32 *) (pgr + greg) + 1; -#endif - greg++; - } - else if ((*p_arg)->type == FFI_TYPE_DOUBLE) - { - if (freg + 1 >= NFREGARG) - avalue[i] = pgr + greg; - else - { - avalue[i] = pfr + (freg >> 1); - freg += 2; - } - greg++; - } - else - { - int n = (z + sizeof (UINT64) - 1) / sizeof (UINT64); - - avalue[i] = pgr + greg; - greg += n; - } - } - - (closure->fun) (cif, rvalue, avalue, closure->user_data); - - /* Tell ffi_closure_SYSV how to perform return type promotions. */ - return return_type (cif->rtype); -} - diff --git a/deps/libffi/src/sh64/ffitarget.h b/deps/libffi/src/sh64/ffitarget.h deleted file mode 100644 index 08a6fe96cc71d7..00000000000000 --- a/deps/libffi/src/sh64/ffitarget.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for SuperH - SHmedia. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- Generic type definitions ----------------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; - -#define FFI_EXTRA_CIF_FIELDS long long flags2 -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 32 -#define FFI_NATIVE_RAW_API 0 - -#endif - diff --git a/deps/libffi/src/sh64/sysv.S b/deps/libffi/src/sh64/sysv.S deleted file mode 100644 index c4587d5f3e732b..00000000000000 --- a/deps/libffi/src/sh64/sysv.S +++ /dev/null @@ -1,539 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2003, 2004, 2006, 2008 Kaz Kojima - - SuperH SHmedia Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#ifdef HAVE_MACHINE_ASM_H -#include -#else -/* XXX these lose for some platforms, I'm sure. */ -#define CNAME(x) x -#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): -#endif - -#ifdef __LITTLE_ENDIAN__ -#define OFS_FLT 0 -#else -#define OFS_FLT 4 -#endif - - .section .text..SHmedia32,"ax" - - # r2: ffi_prep_args - # r3: &ecif - # r4: bytes - # r5: flags - # r6: flags2 - # r7: rvalue - # r8: fn - - # This assumes we are using gas. - .align 5 -ENTRY(ffi_call_SYSV) - # Save registers -.LFB1: - addi.l r15, -48, r15 -.LCFI0: - st.q r15, 40, r32 - st.q r15, 32, r31 - st.q r15, 24, r30 - st.q r15, 16, r29 - st.q r15, 8, r28 - st.l r15, 4, r18 - st.l r15, 0, r14 -.LCFI1: - add.l r15, r63, r14 -.LCFI2: -# add r4, r63, r28 - add r5, r63, r29 - add r6, r63, r30 - add r7, r63, r31 - add r8, r63, r32 - - addi r4, (64 + 7), r4 - andi r4, ~7, r4 - sub.l r15, r4, r15 - - ptabs/l r2, tr0 - add r15, r63, r2 - blink tr0, r18 - - addi r15, 64, r22 - movi 0, r0 - movi 0, r1 - movi -1, r23 - - pt/l 1f, tr1 - bnei/l r29, FFI_TYPE_STRUCT, tr1 - ld.l r15, 0, r19 - addi r15, 8, r15 - addi r0, 1, r0 -1: - -.L_pass: - andi r30, 3, r20 - shlri r30, 2, r30 - - pt/l .L_call_it, tr0 - pt/l .L_pass_i, tr1 - pt/l .L_pass_f, tr2 - - beqi/l r20, FFI_TYPE_VOID, tr0 - beqi/l r20, FFI_TYPE_INT, tr1 - beqi/l r20, FFI_TYPE_FLOAT, tr2 - -.L_pass_d: - addi r0, 1, r0 - pt/l 3f, tr0 - movi 12, r20 - bge/l r1, r20, tr0 - - pt/l .L_pop_d, tr1 - pt/l 2f, tr0 - blink tr1, r63 -2: - addi.l r15, 8, r15 -3: - pt/l .L_pass, tr0 - addi r1, 2, r1 - blink tr0, r63 - -.L_pop_d: - pt/l .L_pop_d_tbl, tr1 - gettr tr1, r20 - shlli r1, 2, r21 - add r20, r21, r20 - ptabs/l r20, tr1 - blink tr1, r63 - -.L_pop_d_tbl: - fld.d r15, 0, dr0 - blink tr0, r63 - fld.d r15, 0, dr2 - blink tr0, r63 - fld.d r15, 0, dr4 - blink tr0, r63 - fld.d r15, 0, dr6 - blink tr0, r63 - fld.d r15, 0, dr8 - blink tr0, r63 - fld.d r15, 0, dr10 - blink tr0, r63 - -.L_pass_f: - addi r0, 1, r0 - pt/l 3f, tr0 - movi 12, r20 - bge/l r1, r20, tr0 - - pt/l .L_pop_f, tr1 - pt/l 2f, tr0 - blink tr1, r63 -2: - addi.l r15, 8, r15 -3: - pt/l .L_pass, tr0 - blink tr0, r63 - -.L_pop_f: - pt/l .L_pop_f_tbl, tr1 - pt/l 5f, tr2 - gettr tr1, r20 - bge/l r23, r63, tr2 - add r1, r63, r23 - shlli r1, 3, r21 - addi r1, 2, r1 - add r20, r21, r20 - ptabs/l r20, tr1 - blink tr1, r63 -5: - addi r23, 1, r21 - movi -1, r23 - shlli r21, 3, r21 - add r20, r21, r20 - ptabs/l r20, tr1 - blink tr1, r63 - -.L_pop_f_tbl: - fld.s r15, OFS_FLT, fr0 - blink tr0, r63 - fld.s r15, OFS_FLT, fr1 - blink tr0, r63 - fld.s r15, OFS_FLT, fr2 - blink tr0, r63 - fld.s r15, OFS_FLT, fr3 - blink tr0, r63 - fld.s r15, OFS_FLT, fr4 - blink tr0, r63 - fld.s r15, OFS_FLT, fr5 - blink tr0, r63 - fld.s r15, OFS_FLT, fr6 - blink tr0, r63 - fld.s r15, OFS_FLT, fr7 - blink tr0, r63 - fld.s r15, OFS_FLT, fr8 - blink tr0, r63 - fld.s r15, OFS_FLT, fr9 - blink tr0, r63 - fld.s r15, OFS_FLT, fr10 - blink tr0, r63 - fld.s r15, OFS_FLT, fr11 - blink tr0, r63 - -.L_pass_i: - pt/l 3f, tr0 - movi 8, r20 - bge/l r0, r20, tr0 - - pt/l .L_pop_i, tr1 - pt/l 2f, tr0 - blink tr1, r63 -2: - addi.l r15, 8, r15 -3: - pt/l .L_pass, tr0 - addi r0, 1, r0 - blink tr0, r63 - -.L_pop_i: - pt/l .L_pop_i_tbl, tr1 - gettr tr1, r20 - shlli r0, 3, r21 - add r20, r21, r20 - ptabs/l r20, tr1 - blink tr1, r63 - -.L_pop_i_tbl: - ld.q r15, 0, r2 - blink tr0, r63 - ld.q r15, 0, r3 - blink tr0, r63 - ld.q r15, 0, r4 - blink tr0, r63 - ld.q r15, 0, r5 - blink tr0, r63 - ld.q r15, 0, r6 - blink tr0, r63 - ld.q r15, 0, r7 - blink tr0, r63 - ld.q r15, 0, r8 - blink tr0, r63 - ld.q r15, 0, r9 - blink tr0, r63 - -.L_call_it: - # call function - pt/l 1f, tr1 - bnei/l r29, FFI_TYPE_STRUCT, tr1 - add r19, r63, r2 -1: - add r22, r63, r15 - ptabs/l r32, tr0 - blink tr0, r18 - - pt/l .L_ret_i, tr0 - pt/l .L_ret_ll, tr1 - pt/l .L_ret_d, tr2 - pt/l .L_ret_f, tr3 - pt/l .L_epilogue, tr4 - - beqi/l r29, FFI_TYPE_INT, tr0 - beqi/l r29, FFI_TYPE_UINT32, tr0 - beqi/l r29, FFI_TYPE_SINT64, tr1 - beqi/l r29, FFI_TYPE_UINT64, tr1 - beqi/l r29, FFI_TYPE_DOUBLE, tr2 - beqi/l r29, FFI_TYPE_FLOAT, tr3 - - pt/l .L_ret_q, tr0 - pt/l .L_ret_h, tr1 - - beqi/l r29, FFI_TYPE_UINT8, tr0 - beqi/l r29, FFI_TYPE_UINT16, tr1 - blink tr4, r63 - -.L_ret_d: - fst.d r31, 0, dr0 - blink tr4, r63 - -.L_ret_ll: - st.q r31, 0, r2 - blink tr4, r63 - -.L_ret_f: - fst.s r31, OFS_FLT, fr0 - blink tr4, r63 - -.L_ret_q: - st.b r31, 0, r2 - blink tr4, r63 - -.L_ret_h: - st.w r31, 0, r2 - blink tr4, r63 - -.L_ret_i: - st.l r31, 0, r2 - # Fall - -.L_epilogue: - # Remove the space we pushed for the args - add r14, r63, r15 - - ld.l r15, 0, r14 - ld.l r15, 4, r18 - ld.q r15, 8, r28 - ld.q r15, 16, r29 - ld.q r15, 24, r30 - ld.q r15, 32, r31 - ld.q r15, 40, r32 - addi.l r15, 48, r15 - ptabs r18, tr0 - blink tr0, r63 - -.LFE1: -.ffi_call_SYSV_end: - .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) - - .align 5 -ENTRY(ffi_closure_SYSV) -.LFB2: - addi.l r15, -136, r15 -.LCFI3: - st.l r15, 12, r18 - st.l r15, 8, r14 - st.l r15, 4, r12 -.LCFI4: - add r15, r63, r14 -.LCFI5: - /* Stack layout: - ... - 64 bytes (register parameters) - 48 bytes (floating register parameters) - 8 bytes (result) - 4 bytes (r18) - 4 bytes (r14) - 4 bytes (r12) - 4 bytes (for align) - <- new stack pointer - */ - fst.d r14, 24, dr0 - fst.d r14, 32, dr2 - fst.d r14, 40, dr4 - fst.d r14, 48, dr6 - fst.d r14, 56, dr8 - fst.d r14, 64, dr10 - st.q r14, 72, r2 - st.q r14, 80, r3 - st.q r14, 88, r4 - st.q r14, 96, r5 - st.q r14, 104, r6 - st.q r14, 112, r7 - st.q r14, 120, r8 - st.q r14, 128, r9 - - add r1, r63, r2 - addi r14, 16, r3 - addi r14, 72, r4 - addi r14, 24, r5 - addi r14, 136, r6 -#ifdef PIC - movi (((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) >> 16) & 65535), r12 - shori ((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) & 65535), r12 -.LPCS0: ptrel/u r12, tr0 - movi ((ffi_closure_helper_SYSV@GOTPLT) & 65535), r1 - gettr tr0, r12 - ldx.l r1, r12, r1 - ptabs r1, tr0 -#else - pt/l ffi_closure_helper_SYSV, tr0 -#endif - blink tr0, r18 - - shlli r2, 1, r1 - movi (((datalabel .L_table) >> 16) & 65535), r2 - shori ((datalabel .L_table) & 65535), r2 - ldx.w r2, r1, r1 - add r1, r2, r1 - pt/l .L_case_v, tr1 - ptabs r1, tr0 - blink tr0, r63 - - .align 2 -.L_table: - .word .L_case_v - datalabel .L_table /* FFI_TYPE_VOID */ - .word .L_case_i - datalabel .L_table /* FFI_TYPE_INT */ - .word .L_case_f - datalabel .L_table /* FFI_TYPE_FLOAT */ - .word .L_case_d - datalabel .L_table /* FFI_TYPE_DOUBLE */ - .word .L_case_d - datalabel .L_table /* FFI_TYPE_LONGDOUBLE */ - .word .L_case_uq - datalabel .L_table /* FFI_TYPE_UINT8 */ - .word .L_case_q - datalabel .L_table /* FFI_TYPE_SINT8 */ - .word .L_case_uh - datalabel .L_table /* FFI_TYPE_UINT16 */ - .word .L_case_h - datalabel .L_table /* FFI_TYPE_SINT16 */ - .word .L_case_i - datalabel .L_table /* FFI_TYPE_UINT32 */ - .word .L_case_i - datalabel .L_table /* FFI_TYPE_SINT32 */ - .word .L_case_ll - datalabel .L_table /* FFI_TYPE_UINT64 */ - .word .L_case_ll - datalabel .L_table /* FFI_TYPE_SINT64 */ - .word .L_case_v - datalabel .L_table /* FFI_TYPE_STRUCT */ - .word .L_case_i - datalabel .L_table /* FFI_TYPE_POINTER */ - - .align 2 -.L_case_d: - fld.d r14, 16, dr0 - blink tr1, r63 -.L_case_f: - fld.s r14, 16, fr0 - blink tr1, r63 -.L_case_ll: - ld.q r14, 16, r2 - blink tr1, r63 -.L_case_i: - ld.l r14, 16, r2 - blink tr1, r63 -.L_case_q: - ld.b r14, 16, r2 - blink tr1, r63 -.L_case_uq: - ld.ub r14, 16, r2 - blink tr1, r63 -.L_case_h: - ld.w r14, 16, r2 - blink tr1, r63 -.L_case_uh: - ld.uw r14, 16, r2 - blink tr1, r63 -.L_case_v: - add.l r14, r63, r15 - ld.l r15, 4, r12 - ld.l r15, 8, r14 - ld.l r15, 12, r18 - addi.l r15, 136, r15 - ptabs r18, tr0 - blink tr0, r63 - -.LFE2: -.ffi_closure_SYSV_end: - .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif - - .section ".eh_frame","aw",@progbits -__FRAME_BEGIN__: - .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ -.LSCIE1: - .4byte 0x0 /* CIE Identifier Tag */ - .byte 0x1 /* CIE Version */ -#ifdef PIC - .ascii "zR\0" /* CIE Augmentation */ -#else - .byte 0x0 /* CIE Augmentation */ -#endif - .uleb128 0x1 /* CIE Code Alignment Factor */ - .sleb128 -4 /* CIE Data Alignment Factor */ - .byte 0x12 /* CIE RA Column */ -#ifdef PIC - .uleb128 0x1 /* Augmentation size */ - .byte 0x10 /* FDE Encoding (pcrel) */ -#endif - .byte 0xc /* DW_CFA_def_cfa */ - .uleb128 0xf - .uleb128 0x0 - .align 2 -.LECIE1: -.LSFDE1: - .4byte datalabel .LEFDE1-datalabel .LASFDE1 /* FDE Length */ -.LASFDE1: - .4byte datalabel .LASFDE1-datalabel __FRAME_BEGIN__ -#ifdef PIC - .4byte .LFB1-. /* FDE initial location */ -#else - .4byte .LFB1 /* FDE initial location */ -#endif - .4byte datalabel .LFE1-datalabel .LFB1 /* FDE address range */ -#ifdef PIC - .uleb128 0x0 /* Augmentation size */ -#endif - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte datalabel .LCFI0-datalabel .LFB1 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .uleb128 0x30 - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte datalabel .LCFI1-datalabel .LCFI0 - .byte 0x8e /* DW_CFA_offset, column 0xe */ - .uleb128 0xc - .byte 0x92 /* DW_CFA_offset, column 0x12 */ - .uleb128 0xb - .byte 0x9c /* DW_CFA_offset, column 0x1c */ - .uleb128 0xa - .byte 0x9d /* DW_CFA_offset, column 0x1d */ - .uleb128 0x8 - .byte 0x9e /* DW_CFA_offset, column 0x1e */ - .uleb128 0x6 - .byte 0x9f /* DW_CFA_offset, column 0x1f */ - .uleb128 0x4 - .byte 0xa0 /* DW_CFA_offset, column 0x20 */ - .uleb128 0x2 - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte datalabel .LCFI2-datalabel .LCFI1 - .byte 0xd /* DW_CFA_def_cfa_register */ - .uleb128 0xe - .align 2 -.LEFDE1: - -.LSFDE3: - .4byte datalabel .LEFDE3-datalabel .LASFDE3 /* FDE Length */ -.LASFDE3: - .4byte datalabel .LASFDE3-datalabel __FRAME_BEGIN__ -#ifdef PIC - .4byte .LFB2-. /* FDE initial location */ -#else - .4byte .LFB2 /* FDE initial location */ -#endif - .4byte datalabel .LFE2-datalabel .LFB2 /* FDE address range */ -#ifdef PIC - .uleb128 0x0 /* Augmentation size */ -#endif - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte datalabel .LCFI3-datalabel .LFB2 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .uleb128 0x88 - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte datalabel .LCFI4-datalabel .LCFI3 - .byte 0x8c /* DW_CFA_offset, column 0xc */ - .uleb128 0x21 - .byte 0x8e /* DW_CFA_offset, column 0xe */ - .uleb128 0x20 - .byte 0x92 /* DW_CFA_offset, column 0x12 */ - .uleb128 0x1f - .byte 0x4 /* DW_CFA_advance_loc4 */ - .4byte datalabel .LCFI5-datalabel .LCFI4 - .byte 0xd /* DW_CFA_def_cfa_register */ - .uleb128 0xe - .align 2 -.LEFDE3: diff --git a/deps/libffi/src/sparc/ffi.c b/deps/libffi/src/sparc/ffi.c deleted file mode 100644 index cf819ee673889d..00000000000000 --- a/deps/libffi/src/sparc/ffi.c +++ /dev/null @@ -1,484 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2011, 2013 Anthony Green - Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc. - - SPARC Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include -#include -#include "internal.h" - -#ifndef SPARC64 - -/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; - all further uses in this file will refer to the 128-bit type. */ -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE -# if FFI_TYPE_LONGDOUBLE != 4 -# error FFI_TYPE_LONGDOUBLE out of date -# endif -#else -# undef FFI_TYPE_LONGDOUBLE -# define FFI_TYPE_LONGDOUBLE 4 -#endif - -/* Perform machine dependent cif processing */ -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep(ffi_cif *cif) -{ - ffi_type *rtype = cif->rtype; - int rtt = rtype->type; - size_t bytes; - int i, n, flags; - - /* Set the return type flag */ - switch (rtt) - { - case FFI_TYPE_VOID: - flags = SPARC_RET_VOID; - break; - case FFI_TYPE_FLOAT: - flags = SPARC_RET_F_1; - break; - case FFI_TYPE_DOUBLE: - flags = SPARC_RET_F_2; - break; - case FFI_TYPE_LONGDOUBLE: - case FFI_TYPE_STRUCT: - flags = (rtype->size & 0xfff) << SPARC_SIZEMASK_SHIFT; - flags |= SPARC_RET_STRUCT; - break; - case FFI_TYPE_SINT8: - flags = SPARC_RET_SINT8; - break; - case FFI_TYPE_UINT8: - flags = SPARC_RET_UINT8; - break; - case FFI_TYPE_SINT16: - flags = SPARC_RET_SINT16; - break; - case FFI_TYPE_UINT16: - flags = SPARC_RET_UINT16; - break; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_POINTER: - flags = SPARC_RET_UINT32; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - flags = SPARC_RET_INT64; - break; - case FFI_TYPE_COMPLEX: - rtt = rtype->elements[0]->type; - switch (rtt) - { - case FFI_TYPE_FLOAT: - flags = SPARC_RET_F_2; - break; - case FFI_TYPE_DOUBLE: - flags = SPARC_RET_F_4; - break; - case FFI_TYPE_LONGDOUBLE: - flags = SPARC_RET_F_8; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - flags = SPARC_RET_INT128; - break; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - flags = SPARC_RET_INT64; - break; - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - flags = SP_V8_RET_CPLX16; - break; - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - flags = SP_V8_RET_CPLX8; - break; - default: - abort(); - } - break; - default: - abort(); - } - cif->flags = flags; - - bytes = 0; - for (i = 0, n = cif->nargs; i < n; ++i) - { - ffi_type *ty = cif->arg_types[i]; - size_t z = ty->size; - int tt = ty->type; - - switch (tt) - { - case FFI_TYPE_STRUCT: - case FFI_TYPE_LONGDOUBLE: - by_reference: - /* Passed by reference. */ - z = 4; - break; - - case FFI_TYPE_COMPLEX: - tt = ty->elements[0]->type; - if (tt == FFI_TYPE_FLOAT || z > 8) - goto by_reference; - /* FALLTHRU */ - - default: - z = FFI_ALIGN(z, 4); - } - bytes += z; - } - - /* Sparc call frames require that space is allocated for 6 args, - even if they aren't used. Make that space if necessary. */ - if (bytes < 6 * 4) - bytes = 6 * 4; - - /* The ABI always requires space for the struct return pointer. */ - bytes += 4; - - /* The stack must be 2 word aligned, so round bytes up appropriately. */ - bytes = FFI_ALIGN(bytes, 2 * 4); - - /* Include the call frame to prep_args. */ - bytes += 4*16 + 4*8; - cif->bytes = bytes; - - return FFI_OK; -} - -extern void ffi_call_v8(ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, size_t bytes, void *closure) FFI_HIDDEN; - -int FFI_HIDDEN -ffi_prep_args_v8(ffi_cif *cif, unsigned long *argp, void *rvalue, void **avalue) -{ - ffi_type **p_arg; - int flags = cif->flags; - int i, nargs; - - if (rvalue == NULL) - { - if ((flags & SPARC_FLAG_RET_MASK) == SPARC_RET_STRUCT) - { - /* Since we pass the pointer to the callee, we need a value. - We allowed for this space in ffi_call, before ffi_call_v8 - alloca'd the space. */ - rvalue = (char *)argp + cif->bytes; - } - else - { - /* Otherwise, we can ignore the return value. */ - flags = SPARC_RET_VOID; - } - } - - /* This could only really be done when we are returning a structure. - However, the space is reserved so we can do it unconditionally. */ - *argp++ = (unsigned long)rvalue; - -#ifdef USING_PURIFY - /* Purify will probably complain in our assembly routine, - unless we zero out this memory. */ - memset(argp, 0, 6*4); -#endif - - p_arg = cif->arg_types; - for (i = 0, nargs = cif->nargs; i < nargs; i++) - { - ffi_type *ty = p_arg[i]; - void *a = avalue[i]; - int tt = ty->type; - size_t z; - - switch (tt) - { - case FFI_TYPE_STRUCT: - case FFI_TYPE_LONGDOUBLE: - by_reference: - *argp++ = (unsigned long)a; - break; - - case FFI_TYPE_DOUBLE: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - memcpy(argp, a, 8); - argp += 2; - break; - - case FFI_TYPE_INT: - case FFI_TYPE_FLOAT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_POINTER: - *argp++ = *(unsigned *)a; - break; - - case FFI_TYPE_UINT8: - *argp++ = *(UINT8 *)a; - break; - case FFI_TYPE_SINT8: - *argp++ = *(SINT8 *)a; - break; - case FFI_TYPE_UINT16: - *argp++ = *(UINT16 *)a; - break; - case FFI_TYPE_SINT16: - *argp++ = *(SINT16 *)a; - break; - - case FFI_TYPE_COMPLEX: - tt = ty->elements[0]->type; - z = ty->size; - if (tt == FFI_TYPE_FLOAT || z > 8) - goto by_reference; - if (z < 4) - { - memcpy((char *)argp + 4 - z, a, z); - argp++; - } - else - { - memcpy(argp, a, z); - argp += z / 4; - } - break; - - default: - abort(); - } - } - - return flags; -} - -static void -ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - size_t bytes = cif->bytes; - size_t i, nargs = cif->nargs; - ffi_type **arg_types = cif->arg_types; - - FFI_ASSERT (cif->abi == FFI_V8); - - /* If we've not got a return value, we need to create one if we've - got to pass the return value to the callee. Otherwise ignore it. */ - if (rvalue == NULL - && (cif->flags & SPARC_FLAG_RET_MASK) == SPARC_RET_STRUCT) - bytes += FFI_ALIGN (cif->rtype->size, 8); - - /* If we have any structure arguments, make a copy so we are passing - by value. */ - for (i = 0; i < nargs; i++) - { - ffi_type *at = arg_types[i]; - int size = at->size; - if (at->type == FFI_TYPE_STRUCT) - { - char *argcopy = alloca (size); - memcpy (argcopy, avalue[i], size); - avalue[i] = argcopy; - } - } - - ffi_call_v8(cif, fn, rvalue, avalue, -bytes, closure); -} - -void -ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - ffi_call_int (cif, fn, rvalue, avalue, NULL); -} - -void -ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int (cif, fn, rvalue, avalue, closure); -} - -#ifdef __GNUC__ -static inline void -ffi_flush_icache (void *p) -{ - /* SPARC v8 requires 5 instructions for flush to be visible */ - asm volatile ("iflush %0; iflush %0+8; nop; nop; nop; nop; nop" - : : "r" (p) : "memory"); -} -#else -extern void ffi_flush_icache (void *) FFI_HIDDEN; -#endif - -extern void ffi_closure_v8(void) FFI_HIDDEN; -extern void ffi_go_closure_v8(void) FFI_HIDDEN; - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, - ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - unsigned int *tramp = (unsigned int *) &closure->tramp[0]; - unsigned long ctx = (unsigned long) closure; - unsigned long fn = (unsigned long) ffi_closure_v8; - - if (cif->abi != FFI_V8) - return FFI_BAD_ABI; - - tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */ - tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */ - tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */ - tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */ - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - ffi_flush_icache (closure); - - return FFI_OK; -} - -ffi_status -ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*)) -{ - if (cif->abi != FFI_V8) - return FFI_BAD_ABI; - - closure->tramp = ffi_go_closure_v8; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} - -int FFI_HIDDEN -ffi_closure_sparc_inner_v8(ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, void *rvalue, - unsigned long *argp) -{ - ffi_type **arg_types; - void **avalue; - int i, nargs, flags; - - arg_types = cif->arg_types; - nargs = cif->nargs; - flags = cif->flags; - avalue = alloca(nargs * sizeof(void *)); - - /* Copy the caller's structure return address so that the closure - returns the data directly to the caller. Also install it so we - can return the address in %o0. */ - if ((flags & SPARC_FLAG_RET_MASK) == SPARC_RET_STRUCT) - { - void *new_rvalue = (void *)*argp; - *(void **)rvalue = new_rvalue; - rvalue = new_rvalue; - } - - /* Always skip the structure return address. */ - argp++; - - /* Grab the addresses of the arguments from the stack frame. */ - for (i = 0; i < nargs; i++) - { - ffi_type *ty = arg_types[i]; - int tt = ty->type; - void *a = argp; - size_t z; - - switch (tt) - { - case FFI_TYPE_STRUCT: - case FFI_TYPE_LONGDOUBLE: - by_reference: - /* Straight copy of invisible reference. */ - a = (void *)*argp; - break; - - case FFI_TYPE_DOUBLE: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - if ((unsigned long)a & 7) - { - /* Align on a 8-byte boundary. */ - UINT64 *tmp = alloca(8); - *tmp = ((UINT64)argp[0] << 32) | argp[1]; - a = tmp; - } - argp++; - break; - - case FFI_TYPE_INT: - case FFI_TYPE_FLOAT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_POINTER: - break; - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - a += 2; - break; - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - a += 3; - break; - - case FFI_TYPE_COMPLEX: - tt = ty->elements[0]->type; - z = ty->size; - if (tt == FFI_TYPE_FLOAT || z > 8) - goto by_reference; - if (z < 4) - a += 4 - z; - else if (z > 4) - argp++; - break; - - default: - abort(); - } - argp++; - avalue[i] = a; - } - - /* Invoke the closure. */ - fun (cif, rvalue, avalue, user_data); - - /* Tell ffi_closure_sparc how to perform return type promotions. */ - return flags; -} -#endif /* !SPARC64 */ diff --git a/deps/libffi/src/sparc/ffi64.c b/deps/libffi/src/sparc/ffi64.c deleted file mode 100644 index 7a9dc3283b5717..00000000000000 --- a/deps/libffi/src/sparc/ffi64.c +++ /dev/null @@ -1,630 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2011, 2013 Anthony Green - Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc. - - SPARC Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include -#include -#include "internal.h" - -/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; - all further uses in this file will refer to the 128-bit type. */ -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE -# if FFI_TYPE_LONGDOUBLE != 4 -# error FFI_TYPE_LONGDOUBLE out of date -# endif -#else -# undef FFI_TYPE_LONGDOUBLE -# define FFI_TYPE_LONGDOUBLE 4 -#endif - -#ifdef SPARC64 - -/* Flatten the contents of a structure to the parts that are passed in - floating point registers. The return is a bit mask wherein bit N - set means bytes [4*n, 4*n+3] are passed in %fN. - - We encode both the (running) size (maximum 32) and mask (maxumum 255) - into one integer. The size is placed in the low byte, so that align - and addition work correctly. The mask is placed in the second byte. */ - -static int -ffi_struct_float_mask (ffi_type *outer_type, int size_mask) -{ - ffi_type **elts; - ffi_type *t; - - if (outer_type->type == FFI_TYPE_COMPLEX) - { - int m = 0, tt = outer_type->elements[0]->type; - size_t z = outer_type->size; - - if (tt == FFI_TYPE_FLOAT - || tt == FFI_TYPE_DOUBLE - || tt == FFI_TYPE_LONGDOUBLE) - m = (1 << (z / 4)) - 1; - return (m << 8) | z; - } - FFI_ASSERT (outer_type->type == FFI_TYPE_STRUCT); - - for (elts = outer_type->elements; (t = *elts) != NULL; elts++) - { - size_t z = t->size; - int o, m, tt; - - size_mask = FFI_ALIGN(size_mask, t->alignment); - switch (t->type) - { - case FFI_TYPE_STRUCT: - size_mask = ffi_struct_float_mask (t, size_mask); - continue; - case FFI_TYPE_COMPLEX: - tt = t->elements[0]->type; - if (tt != FFI_TYPE_FLOAT - && tt != FFI_TYPE_DOUBLE - && tt != FFI_TYPE_LONGDOUBLE) - break; - /* FALLTHRU */ - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_LONGDOUBLE: - m = (1 << (z / 4)) - 1; /* compute mask for type */ - o = (size_mask >> 2) & 0x3f; /* extract word offset */ - size_mask |= m << (o + 8); /* insert mask into place */ - break; - } - size_mask += z; - } - - size_mask = FFI_ALIGN(size_mask, outer_type->alignment); - FFI_ASSERT ((size_mask & 0xff) == outer_type->size); - - return size_mask; -} - -/* Merge floating point data into integer data. If the structure is - entirely floating point, simply return a pointer to the fp data. */ - -static void * -ffi_struct_float_merge (int size_mask, void *vi, void *vf) -{ - int size = size_mask & 0xff; - int mask = size_mask >> 8; - int n = size >> 2; - - if (mask == 0) - return vi; - else if (mask == (1 << n) - 1) - return vf; - else - { - unsigned int *wi = vi, *wf = vf; - int i; - - for (i = 0; i < n; ++i) - if ((mask >> i) & 1) - wi[i] = wf[i]; - - return vi; - } -} - -/* Similar, but place the data into VD in the end. */ - -void FFI_HIDDEN -ffi_struct_float_copy (int size_mask, void *vd, void *vi, void *vf) -{ - int size = size_mask & 0xff; - int mask = size_mask >> 8; - int n = size >> 2; - - if (mask == 0) - ; - else if (mask == (1 << n) - 1) - vi = vf; - else - { - unsigned int *wd = vd, *wi = vi, *wf = vf; - int i; - - for (i = 0; i < n; ++i) - wd[i] = ((mask >> i) & 1 ? wf : wi)[i]; - return; - } - memcpy (vd, vi, size); -} - -/* Perform machine dependent cif processing */ - -static ffi_status -ffi_prep_cif_machdep_core(ffi_cif *cif) -{ - ffi_type *rtype = cif->rtype; - int rtt = rtype->type; - size_t bytes = 0; - int i, n, flags; - - /* Set the return type flag */ - switch (rtt) - { - case FFI_TYPE_VOID: - flags = SPARC_RET_VOID; - break; - case FFI_TYPE_FLOAT: - flags = SPARC_RET_F_1; - break; - case FFI_TYPE_DOUBLE: - flags = SPARC_RET_F_2; - break; - case FFI_TYPE_LONGDOUBLE: - flags = SPARC_RET_F_4; - break; - - case FFI_TYPE_COMPLEX: - case FFI_TYPE_STRUCT: - if (rtype->size > 32) - { - flags = SPARC_RET_VOID | SPARC_FLAG_RET_IN_MEM; - bytes = 8; - } - else - { - int size_mask = ffi_struct_float_mask (rtype, 0); - int word_size = (size_mask >> 2) & 0x3f; - int all_mask = (1 << word_size) - 1; - int fp_mask = size_mask >> 8; - - flags = (size_mask << SPARC_SIZEMASK_SHIFT) | SPARC_RET_STRUCT; - - /* For special cases of all-int or all-fp, we can return - the value directly without popping through a struct copy. */ - if (fp_mask == 0) - { - if (rtype->alignment >= 8) - { - if (rtype->size == 8) - flags = SPARC_RET_INT64; - else if (rtype->size == 16) - flags = SPARC_RET_INT128; - } - } - else if (fp_mask == all_mask) - switch (word_size) - { - case 1: flags = SPARC_RET_F_1; break; - case 2: flags = SPARC_RET_F_2; break; - case 3: flags = SP_V9_RET_F_3; break; - case 4: flags = SPARC_RET_F_4; break; - /* 5 word structures skipped; handled via RET_STRUCT. */ - case 6: flags = SPARC_RET_F_6; break; - /* 7 word structures skipped; handled via RET_STRUCT. */ - case 8: flags = SPARC_RET_F_8; break; - } - } - break; - - case FFI_TYPE_SINT8: - flags = SPARC_RET_SINT8; - break; - case FFI_TYPE_UINT8: - flags = SPARC_RET_UINT8; - break; - case FFI_TYPE_SINT16: - flags = SPARC_RET_SINT16; - break; - case FFI_TYPE_UINT16: - flags = SPARC_RET_UINT16; - break; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - flags = SP_V9_RET_SINT32; - break; - case FFI_TYPE_UINT32: - flags = SPARC_RET_UINT32; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_POINTER: - flags = SPARC_RET_INT64; - break; - - default: - abort(); - } - - bytes = 0; - for (i = 0, n = cif->nargs; i < n; ++i) - { - ffi_type *ty = cif->arg_types[i]; - size_t z = ty->size; - size_t a = ty->alignment; - - switch (ty->type) - { - case FFI_TYPE_COMPLEX: - case FFI_TYPE_STRUCT: - /* Large structs passed by reference. */ - if (z > 16) - { - a = z = 8; - break; - } - /* Small structs may be passed in integer or fp regs or both. */ - if (bytes >= 16*8) - break; - if ((ffi_struct_float_mask (ty, 0) & 0xff00) == 0) - break; - /* FALLTHRU */ - case FFI_TYPE_FLOAT: - case FFI_TYPE_DOUBLE: - case FFI_TYPE_LONGDOUBLE: - flags |= SPARC_FLAG_FP_ARGS; - break; - } - bytes = FFI_ALIGN(bytes, a); - bytes += FFI_ALIGN(z, 8); - } - - /* Sparc call frames require that space is allocated for 6 args, - even if they aren't used. Make that space if necessary. */ - if (bytes < 6 * 8) - bytes = 6 * 8; - - /* The stack must be 2 word aligned, so round bytes up appropriately. */ - bytes = FFI_ALIGN(bytes, 16); - - /* Include the call frame to prep_args. */ - bytes += 8*16 + 8*8; - - cif->bytes = bytes; - cif->flags = flags; - return FFI_OK; -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep(ffi_cif *cif) -{ - cif->nfixedargs = cif->nargs; - return ffi_prep_cif_machdep_core(cif); -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned nfixedargs, unsigned ntotalargs) -{ - cif->nfixedargs = nfixedargs; - return ffi_prep_cif_machdep_core(cif); -} - -extern void ffi_call_v9(ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, size_t bytes, void *closure) FFI_HIDDEN; - -/* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - -int FFI_HIDDEN -ffi_prep_args_v9(ffi_cif *cif, unsigned long *argp, void *rvalue, void **avalue) -{ - ffi_type **p_arg; - int flags = cif->flags; - int i, nargs; - - if (rvalue == NULL) - { - if (flags & SPARC_FLAG_RET_IN_MEM) - { - /* Since we pass the pointer to the callee, we need a value. - We allowed for this space in ffi_call, before ffi_call_v8 - alloca'd the space. */ - rvalue = (char *)argp + cif->bytes; - } - else - { - /* Otherwise, we can ignore the return value. */ - flags = SPARC_RET_VOID; - } - } - -#ifdef USING_PURIFY - /* Purify will probably complain in our assembly routine, - unless we zero out this memory. */ - memset(argp, 0, 6*8); -#endif - - if (flags & SPARC_FLAG_RET_IN_MEM) - *argp++ = (unsigned long)rvalue; - - p_arg = cif->arg_types; - for (i = 0, nargs = cif->nargs; i < nargs; i++) - { - ffi_type *ty = p_arg[i]; - void *a = avalue[i]; - size_t z; - - switch (ty->type) - { - case FFI_TYPE_SINT8: - *argp++ = *(SINT8 *)a; - break; - case FFI_TYPE_UINT8: - *argp++ = *(UINT8 *)a; - break; - case FFI_TYPE_SINT16: - *argp++ = *(SINT16 *)a; - break; - case FFI_TYPE_UINT16: - *argp++ = *(UINT16 *)a; - break; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - *argp++ = *(SINT32 *)a; - break; - case FFI_TYPE_UINT32: - *argp++ = *(UINT32 *)a; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_POINTER: - *argp++ = *(UINT64 *)a; - break; - case FFI_TYPE_FLOAT: - flags |= SPARC_FLAG_FP_ARGS; - *argp++ = *(UINT32 *)a; - break; - case FFI_TYPE_DOUBLE: - flags |= SPARC_FLAG_FP_ARGS; - *argp++ = *(UINT64 *)a; - break; - - case FFI_TYPE_LONGDOUBLE: - case FFI_TYPE_COMPLEX: - case FFI_TYPE_STRUCT: - z = ty->size; - if (z > 16) - { - /* For structures larger than 16 bytes we pass reference. */ - *argp++ = (unsigned long)a; - break; - } - if (((unsigned long)argp & 15) && ty->alignment > 8) - argp++; - memcpy(argp, a, z); - argp += FFI_ALIGN(z, 8) / 8; - break; - - default: - abort(); - } - } - - return flags; -} - -static void -ffi_call_int(ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - size_t bytes = cif->bytes; - size_t i, nargs = cif->nargs; - ffi_type **arg_types = cif->arg_types; - - FFI_ASSERT (cif->abi == FFI_V9); - - if (rvalue == NULL && (cif->flags & SPARC_FLAG_RET_IN_MEM)) - bytes += FFI_ALIGN (cif->rtype->size, 16); - - /* If we have any large structure arguments, make a copy so we are passing - by value. */ - for (i = 0; i < nargs; i++) - { - ffi_type *at = arg_types[i]; - int size = at->size; - if (at->type == FFI_TYPE_STRUCT && size > 4) - { - char *argcopy = alloca (size); - memcpy (argcopy, avalue[i], size); - avalue[i] = argcopy; - } - } - - ffi_call_v9(cif, fn, rvalue, avalue, -bytes, closure); -} - -void -ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - ffi_call_int(cif, fn, rvalue, avalue, NULL); -} - -void -ffi_call_go(ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int(cif, fn, rvalue, avalue, closure); -} - -#ifdef __GNUC__ -static inline void -ffi_flush_icache (void *p) -{ - asm volatile ("flush %0; flush %0+8" : : "r" (p) : "memory"); -} -#else -extern void ffi_flush_icache (void *) FFI_HIDDEN; -#endif - -extern void ffi_closure_v9(void) FFI_HIDDEN; -extern void ffi_go_closure_v9(void) FFI_HIDDEN; - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - unsigned int *tramp = (unsigned int *) &closure->tramp[0]; - unsigned long fn; - - if (cif->abi != FFI_V9) - return FFI_BAD_ABI; - - /* Trampoline address is equal to the closure address. We take advantage - of that to reduce the trampoline size by 8 bytes. */ - fn = (unsigned long) ffi_closure_v9; - tramp[0] = 0x83414000; /* rd %pc, %g1 */ - tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */ - tramp[2] = 0x81c14000; /* jmp %g5 */ - tramp[3] = 0x01000000; /* nop */ - *((unsigned long *) &tramp[4]) = fn; - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - ffi_flush_icache (closure); - - return FFI_OK; -} - -ffi_status -ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*)) -{ - if (cif->abi != FFI_V9) - return FFI_BAD_ABI; - - closure->tramp = ffi_go_closure_v9; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} - -int FFI_HIDDEN -ffi_closure_sparc_inner_v9(ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, void *rvalue, - unsigned long *gpr, unsigned long *fpr) -{ - ffi_type **arg_types; - void **avalue; - int i, argn, argx, nargs, flags, nfixedargs; - - arg_types = cif->arg_types; - nargs = cif->nargs; - flags = cif->flags; - nfixedargs = cif->nfixedargs; - - avalue = alloca(nargs * sizeof(void *)); - - /* Copy the caller's structure return address so that the closure - returns the data directly to the caller. */ - if (flags & SPARC_FLAG_RET_IN_MEM) - { - rvalue = (void *) gpr[0]; - /* Skip the structure return address. */ - argn = 1; - } - else - argn = 0; - - /* Grab the addresses of the arguments from the stack frame. */ - for (i = 0; i < nargs; i++, argn = argx) - { - int named = i < nfixedargs; - ffi_type *ty = arg_types[i]; - void *a = &gpr[argn]; - size_t z; - - argx = argn + 1; - switch (ty->type) - { - case FFI_TYPE_COMPLEX: - case FFI_TYPE_STRUCT: - z = ty->size; - if (z > 16) - a = *(void **)a; - else - { - argx = argn + FFI_ALIGN (z, 8) / 8; - if (named && argn < 16) - { - int size_mask = ffi_struct_float_mask (ty, 0); - int argn_mask = (0xffff00 >> argn) & 0xff00; - - /* Eliminate fp registers off the end. */ - size_mask = (size_mask & 0xff) | (size_mask & argn_mask); - a = ffi_struct_float_merge (size_mask, gpr+argn, fpr+argn); - } - } - break; - - case FFI_TYPE_LONGDOUBLE: - argn = FFI_ALIGN (argn, 2); - a = (named && argn < 16 ? fpr : gpr) + argn; - argx = argn + 2; - break; - case FFI_TYPE_DOUBLE: - if (named && argn < 16) - a = fpr + argn; - break; - case FFI_TYPE_FLOAT: - if (named && argn < 16) - a = fpr + argn; - a += 4; - break; - - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_POINTER: - break; - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - a += 4; - break; - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - a += 6; - break; - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - a += 7; - break; - - default: - abort(); - } - avalue[i] = a; - } - - /* Invoke the closure. */ - fun (cif, rvalue, avalue, user_data); - - /* Tell ffi_closure_sparc how to perform return type promotions. */ - return flags; -} -#endif /* SPARC64 */ diff --git a/deps/libffi/src/sparc/ffitarget.h b/deps/libffi/src/sparc/ffitarget.h deleted file mode 100644 index 2f4cd9a7a93369..00000000000000 --- a/deps/libffi/src/sparc/ffitarget.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 1996-2003 Red Hat, Inc. - Target configuration macros for SPARC. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- System specific configurations ----------------------------------- */ - -#if defined(__arch64__) || defined(__sparcv9) -#ifndef SPARC64 -#define SPARC64 -#endif -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, -#ifdef SPARC64 - FFI_V9, - FFI_DEFAULT_ABI = FFI_V9, -#else - FFI_V8, - FFI_DEFAULT_ABI = FFI_V8, -#endif - FFI_LAST_ABI -} ffi_abi; -#endif - -#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION 1 -#define FFI_TARGET_HAS_COMPLEX_TYPE 1 - -#ifdef SPARC64 -# define FFI_TARGET_SPECIFIC_VARIADIC 1 -# define FFI_EXTRA_CIF_FIELDS unsigned int nfixedargs -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 - -#ifdef SPARC64 -#define FFI_TRAMPOLINE_SIZE 24 -#else -#define FFI_TRAMPOLINE_SIZE 16 -#endif - -#endif - diff --git a/deps/libffi/src/sparc/internal.h b/deps/libffi/src/sparc/internal.h deleted file mode 100644 index 0a66472bade87c..00000000000000 --- a/deps/libffi/src/sparc/internal.h +++ /dev/null @@ -1,26 +0,0 @@ -#define SPARC_RET_VOID 0 -#define SPARC_RET_STRUCT 1 -#define SPARC_RET_UINT8 2 -#define SPARC_RET_SINT8 3 -#define SPARC_RET_UINT16 4 -#define SPARC_RET_SINT16 5 -#define SPARC_RET_UINT32 6 -#define SP_V9_RET_SINT32 7 /* v9 only */ -#define SP_V8_RET_CPLX16 7 /* v8 only */ -#define SPARC_RET_INT64 8 -#define SPARC_RET_INT128 9 - -/* Note that F_7 is missing, and is handled by SPARC_RET_STRUCT. */ -#define SPARC_RET_F_8 10 -#define SPARC_RET_F_6 11 -#define SPARC_RET_F_4 12 -#define SPARC_RET_F_2 13 -#define SP_V9_RET_F_3 14 /* v9 only */ -#define SP_V8_RET_CPLX8 14 /* v8 only */ -#define SPARC_RET_F_1 15 - -#define SPARC_FLAG_RET_MASK 15 -#define SPARC_FLAG_RET_IN_MEM 32 -#define SPARC_FLAG_FP_ARGS 64 - -#define SPARC_SIZEMASK_SHIFT 8 diff --git a/deps/libffi/src/sparc/v8.S b/deps/libffi/src/sparc/v8.S deleted file mode 100644 index a2e4908fd417a7..00000000000000 --- a/deps/libffi/src/sparc/v8.S +++ /dev/null @@ -1,443 +0,0 @@ -/* ----------------------------------------------------------------------- - v8.S - Copyright (c) 2013 The Written Word, Inc. - Copyright (c) 1996, 1997, 2003, 2004, 2008 Red Hat, Inc. - - SPARC Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#include "internal.h" - -#ifndef SPARC64 - -#define C2(X, Y) X ## Y -#define C1(X, Y) C2(X, Y) - -#ifdef __USER_LABEL_PREFIX__ -# define C(Y) C1(__USER_LABEL_PREFIX__, Y) -#else -# define C(Y) Y -#endif -#define L(Y) C1(.L, Y) - - .text - -#ifndef __GNUC__ - .align 8 - .globl C(ffi_flush_icache) - .type C(ffi_flush_icache),#function - FFI_HIDDEN(C(ffi_flush_icache)) - -C(ffi_flush_icache): -1: iflush %o0 - iflush %o+8 - nop - nop - nop - nop - nop - retl - nop - .size C(ffi_flush_icache), . - C(ffi_flush_icache) -#endif - -#if defined(__sun__) && defined(__svr4__) -# define E(INDEX) .align 16 -#else -# define E(INDEX) .align 16; .org 2b + INDEX * 16 -#endif - - .align 8 - .globl C(ffi_call_v8) - .type C(ffi_call_v8),#function - FFI_HIDDEN(C(ffi_call_v8)) - -C(ffi_call_v8): -.LUW0: - ! Allocate a stack frame sized by ffi_call. - save %sp, %o4, %sp -.LUW1: - mov %i0, %o0 ! copy cif - add %sp, 64+32, %o1 ! load args area - mov %i2, %o2 ! copy rvalue - call C(ffi_prep_args_v8) - mov %i3, %o3 ! copy avalue - - add %sp, 32, %sp ! deallocate prep frame - and %o0, SPARC_FLAG_RET_MASK, %l0 ! save return type - srl %o0, SPARC_SIZEMASK_SHIFT, %l1 ! save return size - ld [%sp+64+4], %o0 ! load all argument registers - ld [%sp+64+8], %o1 - ld [%sp+64+12], %o2 - ld [%sp+64+16], %o3 - cmp %l0, SPARC_RET_STRUCT ! struct return needs an unimp 4 - ld [%sp+64+20], %o4 - be 8f - ld [%sp+64+24], %o5 - - ! Call foreign function - call %i1 - mov %i5, %g2 ! load static chain - -0: call 1f ! load pc in %o7 - sll %l0, 4, %l0 -1: add %o7, %l0, %o7 ! o7 = 0b + ret_type*16 - jmp %o7+(2f-0b) - nop - - ! Note that each entry is 4 insns, enforced by the E macro. - .align 16 -2: -E(SPARC_RET_VOID) - ret - restore -E(SPARC_RET_STRUCT) - unimp -E(SPARC_RET_UINT8) - and %o0, 0xff, %o0 - st %o0, [%i2] - ret - restore -E(SPARC_RET_SINT8) - sll %o0, 24, %o0 - b 7f - sra %o0, 24, %o0 -E(SPARC_RET_UINT16) - sll %o0, 16, %o0 - b 7f - srl %o0, 16, %o0 -E(SPARC_RET_SINT16) - sll %o0, 16, %o0 - b 7f - sra %o0, 16, %o0 -E(SPARC_RET_UINT32) -7: st %o0, [%i2] - ret - restore -E(SP_V8_RET_CPLX16) - sth %o0, [%i2+2] - b 9f - srl %o0, 16, %o0 -E(SPARC_RET_INT64) - st %o0, [%i2] - st %o1, [%i2+4] - ret - restore -E(SPARC_RET_INT128) - std %o0, [%i2] - std %o2, [%i2+8] - ret - restore -E(SPARC_RET_F_8) - st %f7, [%i2+7*4] - nop - st %f6, [%i2+6*4] - nop -E(SPARC_RET_F_6) - st %f5, [%i2+5*4] - nop - st %f4, [%i2+4*4] - nop -E(SPARC_RET_F_4) - st %f3, [%i2+3*4] - nop - st %f2, [%i2+2*4] - nop -E(SPARC_RET_F_2) - st %f1, [%i2+4] - st %f0, [%i2] - ret - restore -E(SP_V8_RET_CPLX8) - stb %o0, [%i2+1] - b 0f - srl %o0, 8, %o0 -E(SPARC_RET_F_1) - st %f0, [%i2] - ret - restore - - .align 8 -9: sth %o0, [%i2] - ret - restore - .align 8 -0: stb %o0, [%i2] - ret - restore - - ! Struct returning functions expect and skip the unimp here. - ! To make it worse, conforming callees examine the unimp and - ! make sure the low 12 bits of the unimp match the size of - ! the struct being returned. - .align 8 -8: call 1f ! load pc in %o7 - sll %l1, 2, %l0 ! size * 4 -1: sll %l1, 4, %l1 ! size * 16 - add %l0, %l1, %l0 ! size * 20 - add %o7, %l0, %o7 ! o7 = 8b + size*20 - jmp %o7+(2f-8b) - mov %i5, %g2 ! load static chain -2: - -/* The Sun assembler doesn't understand .rept 0x1000. */ -#define rept1 \ - call %i1; \ - nop; \ - unimp (. - 2b) / 20; \ - ret; \ - restore - -#define rept16 \ - rept1; rept1; rept1; rept1; \ - rept1; rept1; rept1; rept1; \ - rept1; rept1; rept1; rept1; \ - rept1; rept1; rept1; rept1 - -#define rept256 \ - rept16; rept16; rept16; rept16; \ - rept16; rept16; rept16; rept16; \ - rept16; rept16; rept16; rept16; \ - rept16; rept16; rept16; rept16 - - rept256; rept256; rept256; rept256 - rept256; rept256; rept256; rept256 - rept256; rept256; rept256; rept256 - rept256; rept256; rept256; rept256 - -.LUW2: - .size C(ffi_call_v8),. - C(ffi_call_v8) - - -/* 16*4 register window + 1*4 struct return + 6*4 args backing store - + 8*4 return storage + 1*4 alignment. */ -#define STACKFRAME (16*4 + 4 + 6*4 + 8*4 + 4) - -/* ffi_closure_v8(...) - - Receives the closure argument in %g2. */ - -#ifdef HAVE_AS_REGISTER_PSEUDO_OP - .register %g2, #scratch -#endif - - .align 8 - .globl C(ffi_go_closure_v8) - .type C(ffi_go_closure_v8),#function - FFI_HIDDEN(C(ffi_go_closure_v8)) - -C(ffi_go_closure_v8): -.LUW3: - save %sp, -STACKFRAME, %sp -.LUW4: - ld [%g2+4], %o0 ! load cif - ld [%g2+8], %o1 ! load fun - b 0f - mov %g2, %o2 ! load user_data -.LUW5: - .size C(ffi_go_closure_v8), . - C(ffi_go_closure_v8) - - .align 8 - .globl C(ffi_closure_v8) - .type C(ffi_closure_v8),#function - FFI_HIDDEN(C(ffi_closure_v8)) - -C(ffi_closure_v8): -.LUW6: - save %sp, -STACKFRAME, %sp -.LUW7: - ld [%g2+FFI_TRAMPOLINE_SIZE], %o0 ! load cif - ld [%g2+FFI_TRAMPOLINE_SIZE+4], %o1 ! load fun - ld [%g2+FFI_TRAMPOLINE_SIZE+8], %o2 ! load user_data -0: - ! Store all of the potential argument registers in va_list format. - st %i0, [%fp+68+0] - st %i1, [%fp+68+4] - st %i2, [%fp+68+8] - st %i3, [%fp+68+12] - st %i4, [%fp+68+16] - st %i5, [%fp+68+20] - - ! Call ffi_closure_sparc_inner to do the bulk of the work. - add %fp, -8*4, %o3 - call ffi_closure_sparc_inner_v8 - add %fp, 64, %o4 - -0: call 1f - and %o0, SPARC_FLAG_RET_MASK, %o0 -1: sll %o0, 4, %o0 ! o0 = o0 * 16 - add %o7, %o0, %o7 ! o7 = 0b + o0*16 - jmp %o7+(2f-0b) - add %fp, -8*4, %i2 - - ! Note that each entry is 4 insns, enforced by the E macro. - .align 16 -2: -E(SPARC_RET_VOID) - ret - restore -E(SPARC_RET_STRUCT) - ld [%i2], %i0 - jmp %i7+12 - restore -E(SPARC_RET_UINT8) - ldub [%i2+3], %i0 - ret - restore -E(SPARC_RET_SINT8) - ldsb [%i2+3], %i0 - ret - restore -E(SPARC_RET_UINT16) - lduh [%i2+2], %i0 - ret - restore -E(SPARC_RET_SINT16) - ldsh [%i2+2], %i0 - ret - restore -E(SPARC_RET_UINT32) - ld [%i2], %i0 - ret - restore -E(SP_V8_RET_CPLX16) - ld [%i2], %i0 - ret - restore -E(SPARC_RET_INT64) - ldd [%i2], %i0 - ret - restore -E(SPARC_RET_INT128) - ldd [%i2], %i0 - ldd [%i2+8], %i2 - ret - restore -E(SPARC_RET_F_8) - ld [%i2+7*4], %f7 - nop - ld [%i2+6*4], %f6 - nop -E(SPARC_RET_F_6) - ld [%i2+5*4], %f5 - nop - ld [%i2+4*4], %f4 - nop -E(SPARC_RET_F_4) - ld [%i2+3*4], %f3 - nop - ld [%i2+2*4], %f2 - nop -E(SPARC_RET_F_2) - ldd [%i2], %f0 - ret - restore -E(SP_V8_RET_CPLX8) - lduh [%i2], %i0 - ret - restore -E(SPARC_RET_F_1) - ld [%i2], %f0 - ret - restore - -.LUW8: - .size C(ffi_closure_v8), . - C(ffi_closure_v8) - -#ifdef HAVE_RO_EH_FRAME - .section ".eh_frame",#alloc -#else - .section ".eh_frame",#alloc,#write -#endif - -#ifdef HAVE_AS_SPARC_UA_PCREL -# define FDE_ADDR(X) %r_disp32(X) -#else -# define FDE_ADDR(X) X -#endif - - .align 4 -.LCIE: - .long .LECIE - .LSCIE ! CIE Length -.LSCIE: - .long 0 ! CIE Identifier Tag - .byte 1 ! CIE Version - .ascii "zR\0" ! CIE Augmentation - .byte 4 ! CIE Code Alignment Factor - .byte 0x7c ! CIE Data Alignment Factor - .byte 15 ! CIE RA Column - .byte 1 ! Augmentation size -#ifdef HAVE_AS_SPARC_UA_PCREL - .byte 0x1b ! FDE Encoding (pcrel sdata4) -#else - .byte 0x50 ! FDE Encoding (aligned absolute) -#endif - .byte 0xc, 14, 0 ! DW_CFA_def_cfa, %o6, offset 0 - .align 4 -.LECIE: - - .long .LEFDE1 - .LSFDE1 ! FDE Length -.LSFDE1: - .long .LSFDE1 - .LCIE ! FDE CIE offset - .long FDE_ADDR(.LUW0) ! Initial location - .long .LUW2 - .LUW0 ! Address range - .byte 0 ! Augmentation size - .byte 0x40+1 ! DW_CFA_advance_loc 4 - .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 - .byte 0x2d ! DW_CFA_GNU_window_save - .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 - .align 4 -.LEFDE1: - - .long .LEFDE2 - .LSFDE2 ! FDE Length -.LSFDE2: - .long .LSFDE2 - .LCIE ! FDE CIE offset - .long FDE_ADDR(.LUW3) ! Initial location - .long .LUW5 - .LUW3 ! Address range - .byte 0 ! Augmentation size - .byte 0x40+1 ! DW_CFA_advance_loc 4 - .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 - .byte 0x2d ! DW_CFA_GNU_window_save - .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 - .align 4 -.LEFDE2: - - .long .LEFDE3 - .LSFDE3 ! FDE Length -.LSFDE3: - .long .LSFDE3 - .LCIE ! FDE CIE offset - .long FDE_ADDR(.LUW6) ! Initial location - .long .LUW8 - .LUW6 ! Address range - .byte 0 ! Augmentation size - .byte 0x40+1 ! DW_CFA_advance_loc 4 - .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 - .byte 0x2d ! DW_CFA_GNU_window_save - .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 - .align 4 -.LEFDE3: - -#endif /* !SPARC64 */ -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/sparc/v9.S b/deps/libffi/src/sparc/v9.S deleted file mode 100644 index 55f8f4324cfeba..00000000000000 --- a/deps/libffi/src/sparc/v9.S +++ /dev/null @@ -1,440 +0,0 @@ -/* ----------------------------------------------------------------------- - v9.S - Copyright (c) 2000, 2003, 2004, 2008 Red Hat, Inc. - - SPARC 64-bit Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include -#include "internal.h" - -#ifdef SPARC64 - -#define C2(X, Y) X ## Y -#define C1(X, Y) C2(X, Y) - -#ifdef __USER_LABEL_PREFIX__ -# define C(Y) C1(__USER_LABEL_PREFIX__, Y) -#else -# define C(Y) Y -#endif -#define L(Y) C1(.L, Y) - -#if defined(__sun__) && defined(__svr4__) -# define E(INDEX) .align 16 -#else -# define E(INDEX) .align 16; .org 2b + INDEX * 16 -#endif - -#define STACK_BIAS 2047 - - .text - .align 8 - .globl C(ffi_call_v9) - .type C(ffi_call_v9),#function - FFI_HIDDEN(C(ffi_call_v9)) - -C(ffi_call_v9): -.LUW0: - save %sp, %o4, %sp -.LUW1: - mov %i0, %o0 ! copy cif - add %sp, STACK_BIAS+128+48, %o1 ! load args area - mov %i2, %o2 ! copy rvalue - call C(ffi_prep_args_v9) - mov %i3, %o3 ! copy avalue - - andcc %o0, SPARC_FLAG_FP_ARGS, %g0 ! need fp regs? - add %sp, 48, %sp ! deallocate prep frame - be,pt %xcc, 1f - mov %o0, %l0 ! save flags - - ldd [%sp+STACK_BIAS+128], %f0 ! load all fp arg regs - ldd [%sp+STACK_BIAS+128+8], %f2 - ldd [%sp+STACK_BIAS+128+16], %f4 - ldd [%sp+STACK_BIAS+128+24], %f6 - ldd [%sp+STACK_BIAS+128+32], %f8 - ldd [%sp+STACK_BIAS+128+40], %f10 - ldd [%sp+STACK_BIAS+128+48], %f12 - ldd [%sp+STACK_BIAS+128+56], %f14 - ldd [%sp+STACK_BIAS+128+64], %f16 - ldd [%sp+STACK_BIAS+128+72], %f18 - ldd [%sp+STACK_BIAS+128+80], %f20 - ldd [%sp+STACK_BIAS+128+88], %f22 - ldd [%sp+STACK_BIAS+128+96], %f24 - ldd [%sp+STACK_BIAS+128+104], %f26 - ldd [%sp+STACK_BIAS+128+112], %f28 - ldd [%sp+STACK_BIAS+128+120], %f30 - -1: ldx [%sp+STACK_BIAS+128], %o0 ! load all int arg regs - ldx [%sp+STACK_BIAS+128+8], %o1 - ldx [%sp+STACK_BIAS+128+16], %o2 - ldx [%sp+STACK_BIAS+128+24], %o3 - ldx [%sp+STACK_BIAS+128+32], %o4 - ldx [%sp+STACK_BIAS+128+40], %o5 - call %i1 - mov %i5, %g5 ! load static chain - -0: call 1f ! load pc in %o7 - and %l0, SPARC_FLAG_RET_MASK, %l1 -1: sll %l1, 4, %l1 - add %o7, %l1, %o7 ! o7 = 0b + ret_type*16 - jmp %o7+(2f-0b) - nop - - .align 16 -2: -E(SPARC_RET_VOID) - return %i7+8 - nop -E(SPARC_RET_STRUCT) - add %sp, STACK_BIAS-64+128+48, %l2 - sub %sp, 64, %sp - b 8f - stx %o0, [%l2] -E(SPARC_RET_UINT8) - and %o0, 0xff, %i0 - return %i7+8 - stx %o0, [%o2] -E(SPARC_RET_SINT8) - sll %o0, 24, %o0 - sra %o0, 24, %i0 - return %i7+8 - stx %o0, [%o2] -E(SPARC_RET_UINT16) - sll %o0, 16, %o0 - srl %o0, 16, %i0 - return %i7+8 - stx %o0, [%o2] -E(SPARC_RET_SINT16) - sll %o0, 16, %o0 - sra %o0, 16, %i0 - return %i7+8 - stx %o0, [%o2] -E(SPARC_RET_UINT32) - srl %o0, 0, %i0 - return %i7+8 - stx %o0, [%o2] -E(SP_V9_RET_SINT32) - sra %o0, 0, %i0 - return %i7+8 - stx %o0, [%o2] -E(SPARC_RET_INT64) - stx %o0, [%i2] - return %i7+8 - nop -E(SPARC_RET_INT128) - stx %o0, [%i2] - stx %o1, [%i2+8] - return %i7+8 - nop -E(SPARC_RET_F_8) - st %f7, [%i2+7*4] - nop - st %f6, [%i2+6*4] - nop -E(SPARC_RET_F_6) - st %f5, [%i2+5*4] - nop - st %f4, [%i2+4*4] - nop -E(SPARC_RET_F_4) - std %f2, [%i2+2*4] - return %i7+8 - std %f0, [%o2] -E(SPARC_RET_F_2) - return %i7+8 - std %f0, [%o2] -E(SP_V9_RET_F_3) - st %f2, [%i2+2*4] - nop - st %f1, [%i2+1*4] - nop -E(SPARC_RET_F_1) - return %i7+8 - st %f0, [%o2] - - ! Finish the SPARC_RET_STRUCT sequence. - .align 8 -8: stx %o1, [%l2+8] - stx %o2, [%l2+16] - stx %o3, [%l2+24] - std %f0, [%l2+32] - std %f2, [%l2+40] - std %f4, [%l2+48] - std %f6, [%l2+56] - - ! Copy the structure into place. - srl %l0, SPARC_SIZEMASK_SHIFT, %o0 ! load size_mask - mov %i2, %o1 ! load dst - mov %l2, %o2 ! load src_gp - call C(ffi_struct_float_copy) - add %l2, 32, %o3 ! load src_fp - - return %i7+8 - nop - -.LUW2: - .size C(ffi_call_v9), . - C(ffi_call_v9) - - -#undef STACKFRAME -#define STACKFRAME 336 /* 16*8 register window + - 6*8 args backing store + - 20*8 locals */ -#define FP %fp+STACK_BIAS - -/* ffi_closure_v9(...) - - Receives the closure argument in %g1. */ - - .align 8 - .globl C(ffi_go_closure_v9) - .type C(ffi_go_closure_v9),#function - FFI_HIDDEN(C(ffi_go_closure_v9)) - -C(ffi_go_closure_v9): -.LUW3: - save %sp, -STACKFRAME, %sp -.LUW4: - ldx [%g5+8], %o0 - ldx [%g5+16], %o1 - b 0f - mov %g5, %o2 - -.LUW5: - .size C(ffi_go_closure_v9), . - C(ffi_go_closure_v9) - - .align 8 - .globl C(ffi_closure_v9) - .type C(ffi_closure_v9),#function - FFI_HIDDEN(C(ffi_closure_v9)) - -C(ffi_closure_v9): -.LUW6: - save %sp, -STACKFRAME, %sp -.LUW7: - ldx [%g1+FFI_TRAMPOLINE_SIZE], %o0 - ldx [%g1+FFI_TRAMPOLINE_SIZE+8], %o1 - ldx [%g1+FFI_TRAMPOLINE_SIZE+16], %o2 -0: - ! Store all of the potential argument registers in va_list format. - stx %i0, [FP+128+0] - stx %i1, [FP+128+8] - stx %i2, [FP+128+16] - stx %i3, [FP+128+24] - stx %i4, [FP+128+32] - stx %i5, [FP+128+40] - - ! Store possible floating point argument registers too. - std %f0, [FP-128] - std %f2, [FP-120] - std %f4, [FP-112] - std %f6, [FP-104] - std %f8, [FP-96] - std %f10, [FP-88] - std %f12, [FP-80] - std %f14, [FP-72] - std %f16, [FP-64] - std %f18, [FP-56] - std %f20, [FP-48] - std %f22, [FP-40] - std %f24, [FP-32] - std %f26, [FP-24] - std %f28, [FP-16] - std %f30, [FP-8] - - ! Call ffi_closure_sparc_inner to do the bulk of the work. - add %fp, STACK_BIAS-160, %o3 - add %fp, STACK_BIAS+128, %o4 - call C(ffi_closure_sparc_inner_v9) - add %fp, STACK_BIAS-128, %o5 - -0: call 1f ! load pc in %o7 - and %o0, SPARC_FLAG_RET_MASK, %o0 -1: sll %o0, 4, %o0 ! o2 = i2 * 16 - add %o7, %o0, %o7 ! o7 = 0b + i2*16 - jmp %o7+(2f-0b) - nop - - ! Note that we cannot load the data in the delay slot of - ! the return insn because the data is in the stack frame - ! that is deallocated by the return. - .align 16 -2: -E(SPARC_RET_VOID) - return %i7+8 - nop -E(SPARC_RET_STRUCT) - ldx [FP-160], %i0 - ldd [FP-160], %f0 - b 8f - ldx [FP-152], %i1 -E(SPARC_RET_UINT8) - ldub [FP-160+7], %i0 - return %i7+8 - nop -E(SPARC_RET_SINT8) - ldsb [FP-160+7], %i0 - return %i7+8 - nop -E(SPARC_RET_UINT16) - lduh [FP-160+6], %i0 - return %i7+8 - nop -E(SPARC_RET_SINT16) - ldsh [FP-160+6], %i0 - return %i7+8 - nop -E(SPARC_RET_UINT32) - lduw [FP-160+4], %i0 - return %i7+8 - nop -E(SP_V9_RET_SINT32) - ldsw [FP-160+4], %i0 - return %i7+8 - nop -E(SPARC_RET_INT64) - ldx [FP-160], %i0 - return %i7+8 - nop -E(SPARC_RET_INT128) - ldx [FP-160], %i0 - ldx [FP-160+8], %i1 - return %i7+8 - nop -E(SPARC_RET_F_8) - ld [FP-160+7*4], %f7 - nop - ld [FP-160+6*4], %f6 - nop -E(SPARC_RET_F_6) - ld [FP-160+5*4], %f5 - nop - ld [FP-160+4*4], %f4 - nop -E(SPARC_RET_F_4) - ldd [FP-160], %f0 - ldd [FP-160+8], %f2 - return %i7+8 - nop -E(SPARC_RET_F_2) - ldd [FP-160], %f0 - return %i7+8 - nop -E(SP_V9_RET_F_3) - ld [FP-160+2*4], %f2 - nop - ld [FP-160+1*4], %f1 - nop -E(SPARC_RET_F_1) - ld [FP-160], %f0 - return %i7+8 - nop - - ! Finish the SPARC_RET_STRUCT sequence. - .align 8 -8: ldd [FP-152], %f2 - ldx [FP-144], %i2 - ldd [FP-144], %f4 - ldx [FP-136], %i3 - ldd [FP-136], %f6 - return %i7+8 - nop - -.LUW8: - .size C(ffi_closure_v9), . - C(ffi_closure_v9) - -#ifdef HAVE_RO_EH_FRAME - .section ".eh_frame",#alloc -#else - .section ".eh_frame",#alloc,#write -#endif - -#ifdef HAVE_AS_SPARC_UA_PCREL -# define FDE_RANGE(B, E) .long %r_disp32(B), E - B -#else -# define FDE_RANGE(B, E) .align 8; .xword B, E - B -#endif - - .align 8 -.LCIE: - .long .LECIE - .LSCIE ! CIE Length -.LSCIE: - .long 0 ! CIE Identifier Tag - .byte 1 ! CIE Version - .ascii "zR\0" ! CIE Augmentation - .byte 4 ! CIE Code Alignment Factor - .byte 0x78 ! CIE Data Alignment Factor - .byte 15 ! CIE RA Column - .byte 1 ! Augmentation size -#ifdef HAVE_AS_SPARC_UA_PCREL - .byte 0x1b ! FDE Encoding (pcrel sdata4) -#else - .byte 0x50 ! FDE Encoding (aligned absolute) -#endif - .byte 0xc, 14, 0xff, 0xf ! DW_CFA_def_cfa, %o6, offset 0x7ff - .align 8 -.LECIE: - - .long .LEFDE1 - .LSFDE1 ! FDE Length -.LSFDE1: - .long .LSFDE1 - .LCIE ! FDE CIE offset - FDE_RANGE(.LUW0, .LUW2) - .byte 0 ! Augmentation size - .byte 0x40+1 ! DW_CFA_advance_loc 4 - .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 - .byte 0x2d ! DW_CFA_GNU_window_save - .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 - .align 8 -.LEFDE1: - - .long .LEFDE2 - .LSFDE2 ! FDE Length -.LSFDE2: - .long .LSFDE2 - .LCIE ! FDE CIE offset - FDE_RANGE(.LUW3, .LUW5) - .byte 0 ! Augmentation size - .byte 0x40+1 ! DW_CFA_advance_loc 4 - .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 - .byte 0x2d ! DW_CFA_GNU_window_save - .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 - .align 8 -.LEFDE2: - - .long .LEFDE3 - .LSFDE3 ! FDE Length -.LSFDE3: - .long .LSFDE3 - .LCIE ! FDE CIE offset - FDE_RANGE(.LUW6, .LUW8) - .byte 0 ! Augmentation size - .byte 0x40+1 ! DW_CFA_advance_loc 4 - .byte 0xd, 30 ! DW_CFA_def_cfa_register, %i6 - .byte 0x2d ! DW_CFA_GNU_window_save - .byte 0x9, 15, 31 ! DW_CFA_register, %o7, %i7 - .align 8 -.LEFDE3: - -#endif /* SPARC64 */ -#ifdef __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/tile/ffi.c b/deps/libffi/src/tile/ffi.c deleted file mode 100644 index 3a94469c7fafd9..00000000000000 --- a/deps/libffi/src/tile/ffi.c +++ /dev/null @@ -1,355 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2012 Tilera Corp. - - TILE Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include -#include -#include -#include -#include -#include -#include - - -/* The first 10 registers are used to pass arguments and return values. */ -#define NUM_ARG_REGS 10 - -/* Performs a raw function call with the given NUM_ARG_REGS register arguments - and the specified additional stack arguments (if any). */ -extern void ffi_call_tile(ffi_sarg reg_args[NUM_ARG_REGS], - const ffi_sarg *stack_args, - size_t stack_args_bytes, - void (*fnaddr)(void)) - FFI_HIDDEN; - -/* This handles the raw call from the closure stub, cleaning up the - parameters and delegating to ffi_closure_tile_inner. */ -extern void ffi_closure_tile(void) FFI_HIDDEN; - - -ffi_status -ffi_prep_cif_machdep(ffi_cif *cif) -{ - /* We always allocate room for all registers. Even if we don't - use them as parameters, they get returned in the same array - as struct return values so we need to make room. */ - if (cif->bytes < NUM_ARG_REGS * FFI_SIZEOF_ARG) - cif->bytes = NUM_ARG_REGS * FFI_SIZEOF_ARG; - - if (cif->rtype->size > NUM_ARG_REGS * FFI_SIZEOF_ARG) - cif->flags = FFI_TYPE_STRUCT; - else - cif->flags = FFI_TYPE_INT; - - /* Nothing to do. */ - return FFI_OK; -} - - -static long -assign_to_ffi_arg(ffi_sarg *out, void *in, const ffi_type *type, - int write_to_reg) -{ - switch (type->type) - { - case FFI_TYPE_SINT8: - *out = *(SINT8 *)in; - return 1; - - case FFI_TYPE_UINT8: - *out = *(UINT8 *)in; - return 1; - - case FFI_TYPE_SINT16: - *out = *(SINT16 *)in; - return 1; - - case FFI_TYPE_UINT16: - *out = *(UINT16 *)in; - return 1; - - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: -#ifndef __LP64__ - case FFI_TYPE_POINTER: -#endif - /* Note that even unsigned 32-bit quantities are sign extended - on tilegx when stored in a register. */ - *out = *(SINT32 *)in; - return 1; - - case FFI_TYPE_FLOAT: -#ifdef __tilegx__ - if (write_to_reg) - { - /* Properly sign extend the value. */ - union { float f; SINT32 s32; } val; - val.f = *(float *)in; - *out = val.s32; - } - else -#endif - { - *(float *)out = *(float *)in; - } - return 1; - - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - case FFI_TYPE_DOUBLE: -#ifdef __LP64__ - case FFI_TYPE_POINTER: -#endif - *(UINT64 *)out = *(UINT64 *)in; - return sizeof(UINT64) / FFI_SIZEOF_ARG; - - case FFI_TYPE_STRUCT: - memcpy(out, in, type->size); - return (type->size + FFI_SIZEOF_ARG - 1) / FFI_SIZEOF_ARG; - - case FFI_TYPE_VOID: - /* Must be a return type. Nothing to do. */ - return 0; - - default: - FFI_ASSERT(0); - return -1; - } -} - - -void -ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - ffi_sarg * const arg_mem = alloca(cif->bytes); - ffi_sarg * const reg_args = arg_mem; - ffi_sarg * const stack_args = ®_args[NUM_ARG_REGS]; - ffi_sarg *argp = arg_mem; - ffi_type ** const arg_types = cif->arg_types; - const long num_args = cif->nargs; - long i; - - if (cif->flags == FFI_TYPE_STRUCT) - { - /* Pass a hidden pointer to the return value. We make sure there - is scratch space for the callee to store the return value even if - our caller doesn't care about it. */ - *argp++ = (intptr_t)(rvalue ? rvalue : alloca(cif->rtype->size)); - - /* No more work needed to return anything. */ - rvalue = NULL; - } - - for (i = 0; i < num_args; i++) - { - ffi_type *type = arg_types[i]; - void * const arg_in = avalue[i]; - ptrdiff_t arg_word = argp - arg_mem; - -#ifndef __tilegx__ - /* Doubleword-aligned values are always in an even-number register - pair, or doubleword-aligned stack slot if out of registers. */ - long align = arg_word & (type->alignment > FFI_SIZEOF_ARG); - argp += align; - arg_word += align; -#endif - - if (type->type == FFI_TYPE_STRUCT) - { - const size_t arg_size_in_words = - (type->size + FFI_SIZEOF_ARG - 1) / FFI_SIZEOF_ARG; - - if (arg_word < NUM_ARG_REGS && - arg_word + arg_size_in_words > NUM_ARG_REGS) - { - /* Args are not allowed to span registers and the stack. */ - argp = stack_args; - } - - memcpy(argp, arg_in, type->size); - argp += arg_size_in_words; - } - else - { - argp += assign_to_ffi_arg(argp, arg_in, arg_types[i], 1); - } - } - - /* Actually do the call. */ - ffi_call_tile(reg_args, stack_args, - cif->bytes - (NUM_ARG_REGS * FFI_SIZEOF_ARG), fn); - - if (rvalue != NULL) - assign_to_ffi_arg(rvalue, reg_args, cif->rtype, 0); -} - - -/* Template code for closure. */ -extern const UINT64 ffi_template_tramp_tile[] FFI_HIDDEN; - - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, - ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ -#ifdef __tilegx__ - /* TILE-Gx */ - SINT64 c; - SINT64 h; - int s; - UINT64 *out; - - if (cif->abi != FFI_UNIX) - return FFI_BAD_ABI; - - out = (UINT64 *)closure->tramp; - - c = (intptr_t)closure; - h = (intptr_t)ffi_closure_tile; - s = 0; - - /* Find the smallest shift count that doesn't lose information - (i.e. no need to explicitly insert high bits of the address that - are just the sign extension of the low bits). */ - while ((c >> s) != (SINT16)(c >> s) || (h >> s) != (SINT16)(h >> s)) - s += 16; - -#define OPS(a, b, shift) \ - (create_Imm16_X0((a) >> (shift)) | create_Imm16_X1((b) >> (shift))) - - /* Emit the moveli. */ - *out++ = ffi_template_tramp_tile[0] | OPS(c, h, s); - for (s -= 16; s >= 0; s -= 16) - *out++ = ffi_template_tramp_tile[1] | OPS(c, h, s); - -#undef OPS - - *out++ = ffi_template_tramp_tile[2]; - -#else - /* TILEPro */ - UINT64 *out; - intptr_t delta; - - if (cif->abi != FFI_UNIX) - return FFI_BAD_ABI; - - out = (UINT64 *)closure->tramp; - delta = (intptr_t)ffi_closure_tile - (intptr_t)codeloc; - - *out++ = ffi_template_tramp_tile[0] | create_JOffLong_X1(delta >> 3); -#endif - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - invalidate_icache(closure->tramp, (char *)out - closure->tramp, - getpagesize()); - - return FFI_OK; -} - - -/* This is called by the assembly wrapper for closures. This does - all of the work. On entry reg_args[0] holds the values the registers - had when the closure was invoked. On return reg_args[1] holds the register - values to be returned to the caller (many of which may be garbage). */ -void FFI_HIDDEN -ffi_closure_tile_inner(ffi_closure *closure, - ffi_sarg reg_args[2][NUM_ARG_REGS], - ffi_sarg *stack_args) -{ - ffi_cif * const cif = closure->cif; - void ** const avalue = alloca(cif->nargs * sizeof(void *)); - void *rvalue; - ffi_type ** const arg_types = cif->arg_types; - ffi_sarg * const reg_args_in = reg_args[0]; - ffi_sarg * const reg_args_out = reg_args[1]; - ffi_sarg * argp; - long i, arg_word, nargs = cif->nargs; - /* Use a union to guarantee proper alignment for double. */ - union { ffi_sarg arg[NUM_ARG_REGS]; double d; UINT64 u64; } closure_ret; - - /* Start out reading register arguments. */ - argp = reg_args_in; - - /* Copy the caller's structure return address to that the closure - returns the data directly to the caller. */ - if (cif->flags == FFI_TYPE_STRUCT) - { - /* Return by reference via hidden pointer. */ - rvalue = (void *)(intptr_t)*argp++; - arg_word = 1; - } - else - { - /* Return the value in registers. */ - rvalue = &closure_ret; - arg_word = 0; - } - - /* Grab the addresses of the arguments. */ - for (i = 0; i < nargs; i++) - { - ffi_type * const type = arg_types[i]; - const size_t arg_size_in_words = - (type->size + FFI_SIZEOF_ARG - 1) / FFI_SIZEOF_ARG; - -#ifndef __tilegx__ - /* Doubleword-aligned values are always in an even-number register - pair, or doubleword-aligned stack slot if out of registers. */ - long align = arg_word & (type->alignment > FFI_SIZEOF_ARG); - argp += align; - arg_word += align; -#endif - - if (arg_word == NUM_ARG_REGS || - (arg_word < NUM_ARG_REGS && - arg_word + arg_size_in_words > NUM_ARG_REGS)) - { - /* Switch to reading arguments from the stack. */ - argp = stack_args; - arg_word = NUM_ARG_REGS; - } - - avalue[i] = argp; - argp += arg_size_in_words; - arg_word += arg_size_in_words; - } - - /* Invoke the closure. */ - closure->fun(cif, rvalue, avalue, closure->user_data); - - if (cif->flags != FFI_TYPE_STRUCT) - { - /* Canonicalize for register representation. */ - assign_to_ffi_arg(reg_args_out, &closure_ret, cif->rtype, 1); - } -} diff --git a/deps/libffi/src/tile/ffitarget.h b/deps/libffi/src/tile/ffitarget.h deleted file mode 100644 index 679fb5d904b4a1..00000000000000 --- a/deps/libffi/src/tile/ffitarget.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Tilera Corp. - Target configuration macros for TILE. - - 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. - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM - -#include - -typedef uint_reg_t ffi_arg; -typedef int_reg_t ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_UNIX, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_UNIX -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ -#define FFI_CLOSURES 1 - -#ifdef __tilegx__ -/* We always pass 8-byte values, even in -m32 mode. */ -# define FFI_SIZEOF_ARG 8 -# ifdef __LP64__ -# define FFI_TRAMPOLINE_SIZE (8 * 5) /* 5 bundles */ -# else -# define FFI_TRAMPOLINE_SIZE (8 * 3) /* 3 bundles */ -# endif -#else -# define FFI_SIZEOF_ARG 4 -# define FFI_TRAMPOLINE_SIZE 8 /* 1 bundle */ -#endif -#define FFI_NATIVE_RAW_API 0 - -#endif diff --git a/deps/libffi/src/tile/tile.S b/deps/libffi/src/tile/tile.S deleted file mode 100644 index d1f82cb3dbfa85..00000000000000 --- a/deps/libffi/src/tile/tile.S +++ /dev/null @@ -1,360 +0,0 @@ -/* ----------------------------------------------------------------------- - tile.S - Copyright (c) 2011 Tilera Corp. - - Tilera TILEPro and TILE-Gx Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -/* Number of bytes in a register. */ -#define REG_SIZE FFI_SIZEOF_ARG - -/* Number of bytes in stack linkage area for backtracing. - - A note about the ABI: on entry to a procedure, sp points to a stack - slot where it must spill the return address if it's not a leaf. - REG_SIZE bytes beyond that is a slot owned by the caller which - contains the sp value that the caller had when it was originally - entered (i.e. the caller's frame pointer). */ -#define LINKAGE_SIZE (2 * REG_SIZE) - -/* The first 10 registers are used to pass arguments and return values. */ -#define NUM_ARG_REGS 10 - -#ifdef __tilegx__ -#define SW st -#define LW ld -#define BGZT bgtzt -#else -#define SW sw -#define LW lw -#define BGZT bgzt -#endif - - -/* void ffi_call_tile (int_reg_t reg_args[NUM_ARG_REGS], - const int_reg_t *stack_args, - unsigned long stack_args_bytes, - void (*fnaddr)(void)); - - On entry, REG_ARGS contain the outgoing register values, - and STACK_ARGS contains STACK_ARG_BYTES of additional values - to be passed on the stack. If STACK_ARG_BYTES is zero, then - STACK_ARGS is ignored. - - When the invoked function returns, the values of r0-r9 are - blindly stored back into REG_ARGS for the caller to examine. */ - - .section .text.ffi_call_tile, "ax", @progbits - .align 8 - .globl ffi_call_tile - FFI_HIDDEN(ffi_call_tile) -ffi_call_tile: - -/* Incoming arguments. */ -#define REG_ARGS r0 -#define INCOMING_STACK_ARGS r1 -#define STACK_ARG_BYTES r2 -#define ORIG_FNADDR r3 - -/* Temporary values. */ -#define FRAME_SIZE r10 -#define TMP r11 -#define TMP2 r12 -#define OUTGOING_STACK_ARGS r13 -#define REG_ADDR_PTR r14 -#define RETURN_REG_ADDR r15 -#define FNADDR r16 - - .cfi_startproc - { - /* Save return address. */ - SW sp, lr - .cfi_offset lr, 0 - /* Prepare to spill incoming r52. */ - addi TMP, sp, -REG_SIZE - /* Increase frame size to have room to spill r52 and REG_ARGS. - The +7 is to round up mod 8. */ - addi FRAME_SIZE, STACK_ARG_BYTES, \ - REG_SIZE + REG_SIZE + LINKAGE_SIZE + 7 - } - { - /* Round stack frame size to a multiple of 8 to satisfy ABI. */ - andi FRAME_SIZE, FRAME_SIZE, -8 - /* Compute where to spill REG_ARGS value. */ - addi TMP2, sp, -(REG_SIZE * 2) - } - { - /* Spill incoming r52. */ - SW TMP, r52 - .cfi_offset r52, -REG_SIZE - /* Set up our frame pointer. */ - move r52, sp - .cfi_def_cfa_register r52 - /* Push stack frame. */ - sub sp, sp, FRAME_SIZE - } - { - /* Prepare to set up stack linkage. */ - addi TMP, sp, REG_SIZE - /* Prepare to memcpy stack args. */ - addi OUTGOING_STACK_ARGS, sp, LINKAGE_SIZE - /* Save REG_ARGS which we will need after we call the subroutine. */ - SW TMP2, REG_ARGS - } - { - /* Set up linkage info to hold incoming stack pointer. */ - SW TMP, r52 - } - { - /* Skip stack args memcpy if we don't have any stack args (common). */ - blezt STACK_ARG_BYTES, .Ldone_stack_args_memcpy - } - -.Lmemcpy_stack_args: - { - /* Load incoming argument from stack_args. */ - LW TMP, INCOMING_STACK_ARGS - addi INCOMING_STACK_ARGS, INCOMING_STACK_ARGS, REG_SIZE - } - { - /* Store stack argument into outgoing stack argument area. */ - SW OUTGOING_STACK_ARGS, TMP - addi OUTGOING_STACK_ARGS, OUTGOING_STACK_ARGS, REG_SIZE - addi STACK_ARG_BYTES, STACK_ARG_BYTES, -REG_SIZE - } - { - BGZT STACK_ARG_BYTES, .Lmemcpy_stack_args - } -.Ldone_stack_args_memcpy: - - { - /* Copy aside ORIG_FNADDR so we can overwrite its register. */ - move FNADDR, ORIG_FNADDR - /* Prepare to load argument registers. */ - addi REG_ADDR_PTR, r0, REG_SIZE - /* Load outgoing r0. */ - LW r0, r0 - } - - /* Load up argument registers from the REG_ARGS array. */ -#define LOAD_REG(REG, PTR) \ - { \ - LW REG, PTR ; \ - addi PTR, PTR, REG_SIZE \ - } - - LOAD_REG(r1, REG_ADDR_PTR) - LOAD_REG(r2, REG_ADDR_PTR) - LOAD_REG(r3, REG_ADDR_PTR) - LOAD_REG(r4, REG_ADDR_PTR) - LOAD_REG(r5, REG_ADDR_PTR) - LOAD_REG(r6, REG_ADDR_PTR) - LOAD_REG(r7, REG_ADDR_PTR) - LOAD_REG(r8, REG_ADDR_PTR) - LOAD_REG(r9, REG_ADDR_PTR) - - { - /* Call the subroutine. */ - jalr FNADDR - } - - { - /* Restore original lr. */ - LW lr, r52 - /* Prepare to recover ARGS, which we spilled earlier. */ - addi TMP, r52, -(2 * REG_SIZE) - } - { - /* Restore ARGS, so we can fill it in with the return regs r0-r9. */ - LW RETURN_REG_ADDR, TMP - /* Prepare to restore original r52. */ - addi TMP, r52, -REG_SIZE - } - - { - /* Pop stack frame. */ - move sp, r52 - /* Restore original r52. */ - LW r52, TMP - } - -#define STORE_REG(REG, PTR) \ - { \ - SW PTR, REG ; \ - addi PTR, PTR, REG_SIZE \ - } - - /* Return all register values by reference. */ - STORE_REG(r0, RETURN_REG_ADDR) - STORE_REG(r1, RETURN_REG_ADDR) - STORE_REG(r2, RETURN_REG_ADDR) - STORE_REG(r3, RETURN_REG_ADDR) - STORE_REG(r4, RETURN_REG_ADDR) - STORE_REG(r5, RETURN_REG_ADDR) - STORE_REG(r6, RETURN_REG_ADDR) - STORE_REG(r7, RETURN_REG_ADDR) - STORE_REG(r8, RETURN_REG_ADDR) - STORE_REG(r9, RETURN_REG_ADDR) - - { - jrp lr - } - - .cfi_endproc - .size ffi_call_tile, .-ffi_call_tile - -/* ffi_closure_tile(...) - - On entry, lr points to the closure plus 8 bytes, and r10 - contains the actual return address. - - This function simply dumps all register parameters into a stack array - and passes the closure, the registers array, and the stack arguments - to C code that does all of the actual closure processing. */ - - .section .text.ffi_closure_tile, "ax", @progbits - .align 8 - .globl ffi_closure_tile - FFI_HIDDEN(ffi_closure_tile) - - .cfi_startproc -/* Room to spill all NUM_ARG_REGS incoming registers, plus frame linkage. */ -#define CLOSURE_FRAME_SIZE (((NUM_ARG_REGS * REG_SIZE * 2 + LINKAGE_SIZE) + 7) & -8) -ffi_closure_tile: - { -#ifdef __tilegx__ - st sp, lr - .cfi_offset lr, 0 -#else - /* Save return address (in r10 due to closure stub wrapper). */ - SW sp, r10 - .cfi_return_column r10 - .cfi_offset r10, 0 -#endif - /* Compute address for stack frame linkage. */ - addli r10, sp, -(CLOSURE_FRAME_SIZE - REG_SIZE) - } - { - /* Save incoming stack pointer in linkage area. */ - SW r10, sp - .cfi_offset sp, -(CLOSURE_FRAME_SIZE - REG_SIZE) - /* Push a new stack frame. */ - addli sp, sp, -CLOSURE_FRAME_SIZE - .cfi_adjust_cfa_offset CLOSURE_FRAME_SIZE - } - - { - /* Create pointer to where to start spilling registers. */ - addi r10, sp, LINKAGE_SIZE - } - - /* Spill all the incoming registers. */ - STORE_REG(r0, r10) - STORE_REG(r1, r10) - STORE_REG(r2, r10) - STORE_REG(r3, r10) - STORE_REG(r4, r10) - STORE_REG(r5, r10) - STORE_REG(r6, r10) - STORE_REG(r7, r10) - STORE_REG(r8, r10) - { - /* Save r9. */ - SW r10, r9 -#ifdef __tilegx__ - /* Pointer to closure is passed in r11. */ - move r0, r11 -#else - /* Compute pointer to the closure object. Because the closure - starts with a "jal ffi_closure_tile", we can just take the - value of lr (a phony return address pointing into the closure) - and subtract 8. */ - addi r0, lr, -8 -#endif - /* Compute a pointer to the register arguments we just spilled. */ - addi r1, sp, LINKAGE_SIZE - } - { - /* Compute a pointer to the extra stack arguments (if any). */ - addli r2, sp, CLOSURE_FRAME_SIZE + LINKAGE_SIZE - /* Call C code to deal with all of the grotty details. */ - jal ffi_closure_tile_inner - } - { - addli r10, sp, CLOSURE_FRAME_SIZE - } - { - /* Restore the return address. */ - LW lr, r10 - /* Compute pointer to registers array. */ - addli r10, sp, LINKAGE_SIZE + (NUM_ARG_REGS * REG_SIZE) - } - /* Return all the register values, which C code may have set. */ - LOAD_REG(r0, r10) - LOAD_REG(r1, r10) - LOAD_REG(r2, r10) - LOAD_REG(r3, r10) - LOAD_REG(r4, r10) - LOAD_REG(r5, r10) - LOAD_REG(r6, r10) - LOAD_REG(r7, r10) - LOAD_REG(r8, r10) - LOAD_REG(r9, r10) - { - /* Pop the frame. */ - addli sp, sp, CLOSURE_FRAME_SIZE - jrp lr - } - - .cfi_endproc - .size ffi_closure_tile, . - ffi_closure_tile - - -/* What follows are code template instructions that get copied to the - closure trampoline by ffi_prep_closure_loc. The zeroed operands - get replaced by their proper values at runtime. */ - - .section .text.ffi_template_tramp_tile, "ax", @progbits - .align 8 - .globl ffi_template_tramp_tile - FFI_HIDDEN(ffi_template_tramp_tile) -ffi_template_tramp_tile: -#ifdef __tilegx__ - { - moveli r11, 0 /* backpatched to address of containing closure. */ - moveli r10, 0 /* backpatched to ffi_closure_tile. */ - } - /* Note: the following bundle gets generated multiple times - depending on the pointer value (esp. useful for -m32 mode). */ - { shl16insli r11, r11, 0 ; shl16insli r10, r10, 0 } - { info 2+8 /* for backtracer: -> pc in lr, frame size 0 */ ; jr r10 } -#else - /* 'jal .' yields a PC-relative offset of zero so we can OR in the - right offset at runtime. */ - { move r10, lr ; jal . /* ffi_closure_tile */ } -#endif - - .size ffi_template_tramp_tile, . - ffi_template_tramp_tile diff --git a/deps/libffi/src/tramp.c b/deps/libffi/src/tramp.c deleted file mode 100644 index 76a9dfe75c2c3b..00000000000000 --- a/deps/libffi/src/tramp.c +++ /dev/null @@ -1,721 +0,0 @@ -/* ----------------------------------------------------------------------- - tramp.c - Copyright (c) 2020 Madhavan T. Venkataraman - Copyright (c) 2022 Anthony Green - - API and support functions for managing statically defined closure - trampolines. - - 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. - ----------------------------------------------------------------------- */ - -#include - -#ifdef FFI_EXEC_STATIC_TRAMP - -/* -------------------------- Headers and Definitions ---------------------*/ -/* - * Add support for other OSes later. For now, it is just Linux and Cygwin. - */ - -#if defined (__linux__) || defined (__CYGWIN__) -#ifdef __linux__ -#define _GNU_SOURCE 1 -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef __linux__ -#include -#include -#endif -#ifdef __CYGWIN__ -#include -#endif -#endif - -/* - * Each architecture defines static code for a trampoline code table. The - * trampoline code table is mapped into the address space of a process. - * - * The following architecture specific function returns: - * - * - the address of the trampoline code table in the text segment - * - the size of each trampoline in the trampoline code table - * - the size of the mapping for the whole trampoline code table - */ -void __attribute__((weak)) *ffi_tramp_arch (size_t *tramp_size, - size_t *map_size); - -/* ------------------------- Trampoline Data Structures --------------------*/ - -struct tramp; - -/* - * Trampoline table. Manages one trampoline code table and one trampoline - * parameter table. - * - * prev, next Links in the global trampoline table list. - * code_table Trampoline code table mapping. - * parm_table Trampoline parameter table mapping. - * array Array of trampolines malloced. - * free List of free trampolines. - * nfree Number of free trampolines. - */ -struct tramp_table -{ - struct tramp_table *prev; - struct tramp_table *next; - void *code_table; - void *parm_table; - struct tramp *array; - struct tramp *free; - int nfree; -}; - -/* - * Parameters for each trampoline. - * - * data - * Data for the target code that the trampoline jumps to. - * target - * Target code that the trampoline jumps to. - */ -struct tramp_parm -{ - void *data; - void *target; -}; - -/* - * Trampoline structure for each trampoline. - * - * prev, next Links in the trampoline free list of a trampoline table. - * table Trampoline table to which this trampoline belongs. - * code Address of this trampoline in the code table mapping. - * parm Address of this trampoline's parameters in the parameter - * table mapping. - */ -struct tramp -{ - struct tramp *prev; - struct tramp *next; - struct tramp_table *table; - void *code; - struct tramp_parm *parm; -}; - -enum tramp_globals_status { - TRAMP_GLOBALS_UNINITIALIZED = 0, - TRAMP_GLOBALS_PASSED, - TRAMP_GLOBALS_FAILED, -}; - -/* - * Trampoline globals. - * - * fd - * File descriptor of binary file that contains the trampoline code table. - * offset - * Offset of the trampoline code table in that file. - * text - * Address of the trampoline code table in the text segment. - * map_size - * Size of the trampoline code table mapping. - * size - * Size of one trampoline in the trampoline code table. - * ntramp - * Total number of trampolines in the trampoline code table. - * free_tables - * List of trampoline tables that contain free trampolines. - * nfree_tables - * Number of trampoline tables that contain free trampolines. - * status - * Initialization status. - */ -struct tramp_globals -{ - int fd; - off_t offset; - void *text; - size_t map_size; - size_t size; - int ntramp; - struct tramp_table *free_tables; - int nfree_tables; - enum tramp_globals_status status; -}; - -static struct tramp_globals tramp_globals; - -/* --------------------- Trampoline File Initialization --------------------*/ - -/* - * The trampoline file is the file used to map the trampoline code table into - * the address space of a process. There are two ways to get this file: - * - * - From the OS. E.g., on Linux, /proc//maps lists all the memory - * mappings for . For file-backed mappings, maps supplies the file name - * and the file offset. Using this, we can locate the mapping that maps - * libffi and get the path to the libffi binary. And, we can compute the - * offset of the trampoline code table within that binary. - * - * - Else, if we can create a temporary file, we can write the trampoline code - * table from the text segment into the temporary file. - * - * The first method is the preferred one. If the OS security subsystem - * disallows mapping unsigned files with PROT_EXEC, then the second method - * will fail. - * - * If an OS allows the trampoline code table in the text segment to be - * directly remapped (e.g., MACH vm_remap ()), then we don't need the - * trampoline file. - */ -static int tramp_table_alloc (void); - -#if defined (__linux__) || defined (__CYGWIN__) - -static int -ffi_tramp_get_libffi (void) -{ - FILE *fp; - char file[PATH_MAX], line[PATH_MAX+100], perm[10], dev[10]; - unsigned long start, end, offset, inode; - uintptr_t addr = (uintptr_t) tramp_globals.text; - int nfields, found; - int open_flags = O_RDONLY; - -#ifdef O_CLOEXEC - open_flags |= O_CLOEXEC; -#endif - - snprintf (file, PATH_MAX, "/proc/%d/maps", getpid()); - fp = fopen (file, "r"); - if (fp == NULL) - return 0; - - found = 0; - while (feof (fp) == 0) { - if (fgets (line, sizeof (line), fp) == 0) - break; - - nfields = sscanf (line, "%lx-%lx %9s %lx %9s %ld %s", - &start, &end, perm, &offset, dev, &inode, file); - if (nfields != 7) - continue; - - if (addr >= start && addr < end) { - tramp_globals.offset = offset + (addr - start); - found = 1; - break; - } - } - fclose (fp); - - if (!found) - return 0; - - tramp_globals.fd = open (file, open_flags); - if (tramp_globals.fd == -1) - return 0; - - /* - * Allocate a trampoline table just to make sure that the trampoline code - * table can be mapped. - */ - if (!tramp_table_alloc ()) - { - close (tramp_globals.fd); - tramp_globals.fd = -1; - return 0; - } - return 1; -} - -#endif /* defined (__linux__) || defined (__CYGWIN__) */ - -#if defined (__linux__) || defined (__CYGWIN__) - -static int -ffi_tramp_get_temp_file (void) -{ - ssize_t count; - - tramp_globals.offset = 0; - tramp_globals.fd = open_temp_exec_file (); - - /* - * Write the trampoline code table into the temporary file and allocate a - * trampoline table to make sure that the temporary file can be mapped. - */ - count = write(tramp_globals.fd, tramp_globals.text, tramp_globals.map_size); - if (count >=0 && (size_t)count == tramp_globals.map_size && tramp_table_alloc ()) - return 1; - - close (tramp_globals.fd); - tramp_globals.fd = -1; - return 0; -} - -#endif /* defined (__linux__) || defined (__CYGWIN__) */ - -/* ------------------------ OS-specific Initialization ----------------------*/ - -#if defined (__linux__) || defined (__CYGWIN__) - -static int -ffi_tramp_init_os (void) -{ - if (ffi_tramp_get_libffi ()) - return 1; - return ffi_tramp_get_temp_file (); -} - -#endif /* defined (__linux__) || defined (__CYGWIN__) */ - -/* --------------------------- OS-specific Locking -------------------------*/ - -#if defined (__linux__) || defined (__CYGWIN__) - -static pthread_mutex_t tramp_globals_mutex = PTHREAD_MUTEX_INITIALIZER; - -static void -ffi_tramp_lock(void) -{ - pthread_mutex_lock (&tramp_globals_mutex); -} - -static void -ffi_tramp_unlock(void) -{ - pthread_mutex_unlock (&tramp_globals_mutex); -} - -#endif /* defined (__linux__) || defined (__CYGWIN__) */ - -/* ------------------------ OS-specific Memory Mapping ----------------------*/ - -/* - * Create a trampoline code table mapping and a trampoline parameter table - * mapping. The two mappings must be adjacent to each other for PC-relative - * access. - * - * For each trampoline in the code table, there is a corresponding parameter - * block in the parameter table. The size of the parameter block is the same - * as the size of the trampoline. This means that the parameter block is at - * a fixed offset from its trampoline making it easy for a trampoline to find - * its parameters using PC-relative access. - * - * The parameter block will contain a struct tramp_parm. This means that - * sizeof (struct tramp_parm) cannot exceed the size of a parameter block. - */ - -#if defined (__linux__) || defined (__CYGWIN__) - -static int -tramp_table_map (struct tramp_table *table) -{ - char *addr; - - /* - * Create an anonymous mapping twice the map size. The top half will be used - * for the code table. The bottom half will be used for the parameter table. - */ - addr = mmap (NULL, tramp_globals.map_size * 2, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - if (addr == MAP_FAILED) - return 0; - - /* - * Replace the top half of the anonymous mapping with the code table mapping. - */ - table->code_table = mmap (addr, tramp_globals.map_size, PROT_READ | PROT_EXEC, - MAP_PRIVATE | MAP_FIXED, tramp_globals.fd, tramp_globals.offset); - if (table->code_table == MAP_FAILED) - { - (void) munmap (addr, tramp_globals.map_size * 2); - return 0; - } - table->parm_table = table->code_table + tramp_globals.map_size; - return 1; -} - -static void -tramp_table_unmap (struct tramp_table *table) -{ - (void) munmap (table->code_table, tramp_globals.map_size); - (void) munmap (table->parm_table, tramp_globals.map_size); -} - -#endif /* defined (__linux__) || defined (__CYGWIN__) */ - -/* ------------------------ Trampoline Initialization ----------------------*/ - -/* - * Initialize the static trampoline feature. - */ -static int -ffi_tramp_init (void) -{ - long page_size; - - if (tramp_globals.status == TRAMP_GLOBALS_PASSED) - return 1; - - if (tramp_globals.status == TRAMP_GLOBALS_FAILED) - return 0; - - if (ffi_tramp_arch == NULL) - { - tramp_globals.status = TRAMP_GLOBALS_FAILED; - return 0; - } - - tramp_globals.free_tables = NULL; - tramp_globals.nfree_tables = 0; - - /* - * Get trampoline code table information from the architecture. - */ - tramp_globals.text = ffi_tramp_arch (&tramp_globals.size, - &tramp_globals.map_size); - tramp_globals.ntramp = tramp_globals.map_size / tramp_globals.size; - - page_size = sysconf (_SC_PAGESIZE); - if (page_size >= 0 && (size_t)page_size > tramp_globals.map_size) - return 0; - - if (ffi_tramp_init_os ()) - { - tramp_globals.status = TRAMP_GLOBALS_PASSED; - return 1; - } - - tramp_globals.status = TRAMP_GLOBALS_FAILED; - return 0; -} - -/* ---------------------- Trampoline Table functions ---------------------- */ - -/* This code assumes that malloc () is available on all OSes. */ - -static void tramp_add (struct tramp *tramp); - -/* - * Allocate and initialize a trampoline table. - */ -static int -tramp_table_alloc (void) -{ - struct tramp_table *table; - struct tramp *tramp_array, *tramp; - size_t size; - char *code, *parm; - int i; - - /* - * If we already have tables with free trampolines, there is no need to - * allocate a new table. - */ - if (tramp_globals.nfree_tables > 0) - return 1; - - /* - * Allocate a new trampoline table structure. - */ - table = malloc (sizeof (*table)); - if (table == NULL) - return 0; - - /* - * Allocate new trampoline structures. - */ - tramp_array = malloc (sizeof (*tramp) * tramp_globals.ntramp); - if (tramp_array == NULL) - goto free_table; - - /* - * Map a code table and a parameter table into the caller's address space. - */ - if (!tramp_table_map (table)) - { - /* - * Failed to map the code and parameter tables. - */ - goto free_tramp_array; - } - - /* - * Initialize the trampoline table. - */ - table->array = tramp_array; - table->free = NULL; - table->nfree = 0; - - /* - * Populate the trampoline table free list. This will also add the trampoline - * table to the global list of trampoline tables. - */ - size = tramp_globals.size; - code = table->code_table; - parm = table->parm_table; - for (i = 0; i < tramp_globals.ntramp; i++) - { - tramp = &tramp_array[i]; - tramp->table = table; - tramp->code = code; - tramp->parm = (struct tramp_parm *) parm; - tramp_add (tramp); - - code += size; - parm += size; - } - /* Success */ - return 1; - -/* Failure */ -free_tramp_array: - free (tramp_array); -free_table: - free (table); - return 0; -} - -/* - * Free a trampoline table. - */ -static void -tramp_table_free (struct tramp_table *table) -{ - tramp_table_unmap (table); - free (table->array); - free (table); -} - -/* - * Add a new trampoline table to the global table list. - */ -static void -tramp_table_add (struct tramp_table *table) -{ - table->next = tramp_globals.free_tables; - table->prev = NULL; - if (tramp_globals.free_tables != NULL) - tramp_globals.free_tables->prev = table; - tramp_globals.free_tables = table; - tramp_globals.nfree_tables++; -} - -/* - * Delete a trampoline table from the global table list. - */ -static void -tramp_table_del (struct tramp_table *table) -{ - tramp_globals.nfree_tables--; - if (table->prev != NULL) - table->prev->next = table->next; - if (table->next != NULL) - table->next->prev = table->prev; - if (tramp_globals.free_tables == table) - tramp_globals.free_tables = table->next; -} - -/* ------------------------- Trampoline functions ------------------------- */ - -/* - * Add a trampoline to its trampoline table. - */ -static void -tramp_add (struct tramp *tramp) -{ - struct tramp_table *table = tramp->table; - - tramp->next = table->free; - tramp->prev = NULL; - if (table->free != NULL) - table->free->prev = tramp; - table->free = tramp; - table->nfree++; - - if (table->nfree == 1) - tramp_table_add (table); - - /* - * We don't want to keep too many free trampoline tables lying around. - */ - if (table->nfree == tramp_globals.ntramp && - tramp_globals.nfree_tables > 1) - { - tramp_table_del (table); - tramp_table_free (table); - } -} - -/* - * Remove a trampoline from its trampoline table. - */ -static void -tramp_del (struct tramp *tramp) -{ - struct tramp_table *table = tramp->table; - - table->nfree--; - if (tramp->prev != NULL) - tramp->prev->next = tramp->next; - if (tramp->next != NULL) - tramp->next->prev = tramp->prev; - if (table->free == tramp) - table->free = tramp->next; - - if (table->nfree == 0) - tramp_table_del (table); -} - -/* ------------------------ Trampoline API functions ------------------------ */ - -int -ffi_tramp_is_supported(void) -{ - int ret; - - ffi_tramp_lock(); - ret = ffi_tramp_init (); - ffi_tramp_unlock(); - return ret; -} - -/* - * Allocate a trampoline and return its opaque address. - */ -void * -ffi_tramp_alloc (int flags) -{ - struct tramp *tramp; - - ffi_tramp_lock(); - - if (!ffi_tramp_init () || flags != 0) - { - ffi_tramp_unlock(); - return NULL; - } - - if (!tramp_table_alloc ()) - { - ffi_tramp_unlock(); - return NULL; - } - - tramp = tramp_globals.free_tables->free; - tramp_del (tramp); - - ffi_tramp_unlock(); - - return tramp; -} - -/* - * Set the parameters for a trampoline. - */ -void -ffi_tramp_set_parms (void *arg, void *target, void *data) -{ - struct tramp *tramp = arg; - - ffi_tramp_lock(); - tramp->parm->target = target; - tramp->parm->data = data; - ffi_tramp_unlock(); -} - -/* - * Get the invocation address of a trampoline. - */ -void * -ffi_tramp_get_addr (void *arg) -{ - struct tramp *tramp = arg; - void *addr; - - ffi_tramp_lock(); - addr = tramp->code; - ffi_tramp_unlock(); - - return addr; -} - -/* - * Free a trampoline. - */ -void -ffi_tramp_free (void *arg) -{ - struct tramp *tramp = arg; - - ffi_tramp_lock(); - tramp_add (tramp); - ffi_tramp_unlock(); -} - -/* ------------------------------------------------------------------------- */ - -#else /* !FFI_EXEC_STATIC_TRAMP */ - -#include - -int -ffi_tramp_is_supported(void) -{ - return 0; -} - -void * -ffi_tramp_alloc (int flags) -{ - return NULL; -} - -void -ffi_tramp_set_parms (void *arg, void *target, void *data) -{ -} - -void * -ffi_tramp_get_addr (void *arg) -{ - return NULL; -} - -void -ffi_tramp_free (void *arg) -{ -} - -#endif /* FFI_EXEC_STATIC_TRAMP */ diff --git a/deps/libffi/src/types.c b/deps/libffi/src/types.c deleted file mode 100644 index 8b2dec98eafafb..00000000000000 --- a/deps/libffi/src/types.c +++ /dev/null @@ -1,128 +0,0 @@ -/* ----------------------------------------------------------------------- - types.c - Copyright (c) 1996, 1998, 2024, 2025 Red Hat, Inc. - - Predefined ffi_types needed by libffi. - - 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. - ----------------------------------------------------------------------- */ - -/* Hide the basic type definitions from the header file, so that we - can redefine them here as "const". */ -#define LIBFFI_HIDE_BASIC_TYPES - -#include -#include - -/* Return a version string. */ -const char *ffi_get_version (void) -{ - return FFI_VERSION_STRING; -} - -/* Return the version as an unsigned long value: (x * 10000 + y * 100 + z) */ -unsigned long ffi_get_version_number (void) -{ - return FFI_VERSION_NUMBER; -} - -unsigned int ffi_get_default_abi (void) -{ - return FFI_DEFAULT_ABI; -} - -size_t ffi_get_closure_size (void) -{ - return sizeof(ffi_closure); -} - -/* Type definitions */ - -#define FFI_TYPEDEF(name, type, id, maybe_const)\ -struct struct_align_##name { \ - char c; \ - type x; \ -}; \ -FFI_EXTERN \ -maybe_const ffi_type ffi_type_##name = { \ - sizeof(type), \ - offsetof(struct struct_align_##name, x), \ - id, NULL \ -} - -#define FFI_COMPLEX_TYPEDEF(name, type, maybe_const) \ -static ffi_type *ffi_elements_complex_##name [2] = { \ - (ffi_type *)(&ffi_type_##name), NULL \ -}; \ -struct struct_align_complex_##name { \ - char c; \ - _Complex type x; \ -}; \ -FFI_EXTERN \ -maybe_const ffi_type ffi_type_complex_##name = { \ - sizeof(_Complex type), \ - offsetof(struct struct_align_complex_##name, x), \ - FFI_TYPE_COMPLEX, \ - (ffi_type **)ffi_elements_complex_##name \ -} - -/* Size and alignment are fake here. They must not be 0. */ -FFI_EXTERN const ffi_type ffi_type_void = { - 1, 1, FFI_TYPE_VOID, NULL -}; - -FFI_TYPEDEF(uint8, UINT8, FFI_TYPE_UINT8, const); -FFI_TYPEDEF(sint8, SINT8, FFI_TYPE_SINT8, const); -FFI_TYPEDEF(uint16, UINT16, FFI_TYPE_UINT16, const); -FFI_TYPEDEF(sint16, SINT16, FFI_TYPE_SINT16, const); -FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32, const); -FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32, const); -FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64, const); -FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64, const); - -FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER, const); - -FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT, const); -FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE, const); - -#if !defined HAVE_LONG_DOUBLE_VARIANT || defined __alpha__ -#define FFI_LDBL_CONST const -#else -#define FFI_LDBL_CONST -#endif - -#ifdef __alpha__ -/* Even if we're not configured to default to 128-bit long double, - maintain binary compatibility, as -mlong-double-128 can be used - at any time. */ -/* Validate the hard-coded number below. */ -# if defined(__LONG_DOUBLE_128__) && FFI_TYPE_LONGDOUBLE != 4 -# error FFI_TYPE_LONGDOUBLE out of date -# endif -const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL }; -#else -FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE, FFI_LDBL_CONST); -#endif - -#ifdef FFI_TARGET_HAS_COMPLEX_TYPE -FFI_COMPLEX_TYPEDEF(float, float, const); -FFI_COMPLEX_TYPEDEF(double, double, const); -FFI_COMPLEX_TYPEDEF(longdouble, long double, FFI_LDBL_CONST); -#endif diff --git a/deps/libffi/src/vax/elfbsd.S b/deps/libffi/src/vax/elfbsd.S deleted file mode 100644 index 01ca313402b20e..00000000000000 --- a/deps/libffi/src/vax/elfbsd.S +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2013 Miodrag Vallat. - * - * 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. - */ - -/* - * vax Foreign Function Interface - */ - -#define LIBFFI_ASM -#include -#include - - .text - -/* - * void * %r0 - * ffi_call_elfbsd(extended_cif *ecif, 4(%ap) - * unsigned bytes, 8(%ap) - * unsigned flags, 12(%ap) - * void *rvalue, 16(%ap) - * void (*fn)()); 20(%ap) - */ - .globl ffi_call_elfbsd - .type ffi_call_elfbsd,@function - .align 2 -ffi_call_elfbsd: - .word 0x00c # save R2 and R3 - - # Allocate stack space for the args - subl2 8(%ap), %sp - - # Call ffi_prep_args - pushl %sp - pushl 4(%ap) - calls $2, ffi_prep_args - - # Get function pointer - movl 20(%ap), %r1 - - # Build a CALLS frame - ashl $-2, 8(%ap), %r0 - pushl %r0 # argument stack usage - movl %sp, %r0 # future %ap - # saved registers - bbc $11, 0(%r1), 1f - pushl %r11 -1: bbc $10, 0(%r1), 1f - pushl %r10 -1: bbc $9, 0(%r1), 1f - pushl %r9 -1: bbc $8, 0(%r1), 1f - pushl %r8 -1: bbc $7, 0(%r1), 1f - pushl %r7 -1: bbc $6, 0(%r1), 1f - pushl %r6 -1: bbc $5, 0(%r1), 1f - pushl %r5 -1: bbc $4, 0(%r1), 1f - pushl %r4 -1: bbc $3, 0(%r1), 1f - pushl %r3 -1: bbc $2, 0(%r1), 1f - pushl %r2 -1: - pushal 9f - pushl %fp - pushl %ap - movl 16(%ap), %r3 # struct return address, if needed - movl %r0, %ap - movzwl 4(%fp), %r0 # previous PSW, without the saved registers mask - bisl2 $0x20000000, %r0 # calls frame - movzwl 0(%r1), %r2 - bicw2 $0xf003, %r2 # only keep R11-R2 - ashl $16, %r2, %r2 - bisl2 %r2, %r0 # saved register mask of the called function - pushl %r0 - pushl $0 - movl %sp, %fp - - # Invoke the function - pushal 2(%r1) # skip procedure entry mask - movl %r3, %r1 - bicpsw $0x000f - rsb - -9: - # Copy return value if necessary - tstl 16(%ap) - jeql 9f - movl 16(%ap), %r2 - - bbc $0, 12(%ap), 1f # CIF_FLAGS_CHAR - movb %r0, 0(%r2) - brb 9f -1: - bbc $1, 12(%ap), 1f # CIF_FLAGS_SHORT - movw %r0, 0(%r2) - brb 9f -1: - bbc $2, 12(%ap), 1f # CIF_FLAGS_INT - movl %r0, 0(%r2) - brb 9f -1: - bbc $3, 12(%ap), 1f # CIF_FLAGS_DINT - movq %r0, 0(%r2) - brb 9f -1: - movl %r1, %r0 # might have been a struct - #brb 9f - -9: - ret - -/* - * ffi_closure_elfbsd(void); - * invoked with %r0: ffi_closure *closure - */ - .globl ffi_closure_elfbsd - .type ffi_closure_elfbsd, @function - .align 2 -ffi_closure_elfbsd: - .word 0 - - # Allocate room on stack for return value - subl2 $8, %sp - - # Invoke the closure function - pushal 4(%ap) # calling stack - pushal 4(%sp) # return value - pushl %r0 # closure - calls $3, ffi_closure_elfbsd_inner - - # Copy return value if necessary - bitb $1, %r0 # CIF_FLAGS_CHAR - beql 1f - movb 0(%sp), %r0 - brb 9f -1: - bitb $2, %r0 # CIF_FLAGS_SHORT - beql 1f - movw 0(%sp), %r0 - brb 9f -1: - bitb $4, %r0 # CIF_FLAGS_INT - beql 1f - movl 0(%sp), %r0 - brb 9f -1: - bitb $8, %r0 # CIF_FLAGS_DINT - beql 1f - movq 0(%sp), %r0 - #brb 9f -1: - -9: - ret - -/* - * ffi_closure_struct_elfbsd(void); - * invoked with %r0: ffi_closure *closure - * %r1: struct return address - */ - .globl ffi_closure_struct_elfbsd - .type ffi_closure_struct_elfbsd, @function - .align 2 -ffi_closure_struct_elfbsd: - .word 0 - - # Invoke the closure function - pushal 4(%ap) # calling stack - pushl %r1 # return value - pushl %r0 # closure - calls $3, ffi_closure_elfbsd_inner - - ret diff --git a/deps/libffi/src/vax/ffi.c b/deps/libffi/src/vax/ffi.c deleted file mode 100644 index e52caec86da2e8..00000000000000 --- a/deps/libffi/src/vax/ffi.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2013 Miodrag Vallat. - * - * 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. - */ - -/* - * vax Foreign Function Interface - * - * This file attempts to provide all the FFI entry points which can reliably - * be implemented in C. - */ - -#include -#include - -#include -#include - -#define CIF_FLAGS_CHAR 1 /* for struct only */ -#define CIF_FLAGS_SHORT 2 /* for struct only */ -#define CIF_FLAGS_INT 4 -#define CIF_FLAGS_DINT 8 - -/* - * Foreign Function Interface API - */ - -void ffi_call_elfbsd (extended_cif *, unsigned, unsigned, void *, - void (*) ()); -void *ffi_prep_args (extended_cif *ecif, void *stack); - -void * -ffi_prep_args (extended_cif *ecif, void *stack) -{ - unsigned int i; - void **p_argv; - char *argp; - ffi_type **p_arg; - void *struct_value_ptr; - - argp = stack; - - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT - && !ecif->cif->flags) - struct_value_ptr = ecif->rvalue; - else - struct_value_ptr = NULL; - - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; - i != 0; - i--, p_arg++) - { - size_t z; - - z = (*p_arg)->size; - if (z < sizeof (int)) - { - switch ((*p_arg)->type) - { - case FFI_TYPE_SINT8: - *(signed int *) argp = (signed int) *(SINT8 *) *p_argv; - break; - - case FFI_TYPE_UINT8: - *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv; - break; - - case FFI_TYPE_SINT16: - *(signed int *) argp = (signed int) *(SINT16 *) *p_argv; - break; - - case FFI_TYPE_UINT16: - *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv; - break; - - case FFI_TYPE_STRUCT: - memcpy (argp, *p_argv, z); - break; - - default: - FFI_ASSERT (0); - } - z = sizeof (int); - } - else - { - memcpy (argp, *p_argv, z); - - /* Align if necessary. */ - if ((sizeof(int) - 1) & z) - z = FFI_ALIGN(z, sizeof(int)); - } - - p_argv++; - argp += z; - } - - return struct_value_ptr; -} - -ffi_status -ffi_prep_cif_machdep (ffi_cif *cif) -{ - /* Set the return type flag */ - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - cif->flags = 0; - break; - - case FFI_TYPE_STRUCT: - if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT && - cif->rtype->elements[1]) - { - cif->flags = 0; - break; - } - - if (cif->rtype->size == sizeof (char)) - cif->flags = CIF_FLAGS_CHAR; - else if (cif->rtype->size == sizeof (short)) - cif->flags = CIF_FLAGS_SHORT; - else if (cif->rtype->size == sizeof (int)) - cif->flags = CIF_FLAGS_INT; - else if (cif->rtype->size == 2 * sizeof (int)) - cif->flags = CIF_FLAGS_DINT; - else - cif->flags = 0; - break; - - default: - if (cif->rtype->size <= sizeof (int)) - cif->flags = CIF_FLAGS_INT; - else - cif->flags = CIF_FLAGS_DINT; - break; - } - - return FFI_OK; -} - -void -ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue) -{ - extended_cif ecif; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return value - address then we need to make one. */ - - if (rvalue == NULL - && cif->rtype->type == FFI_TYPE_STRUCT - && cif->flags == 0) - ecif.rvalue = alloca (cif->rtype->size); - else - ecif.rvalue = rvalue; - - switch (cif->abi) - { - case FFI_ELFBSD: - ffi_call_elfbsd (&ecif, cif->bytes, cif->flags, ecif.rvalue, fn); - break; - - default: - FFI_ASSERT (0); - break; - } -} - -/* - * Closure API - */ - -void ffi_closure_elfbsd (void); -void ffi_closure_struct_elfbsd (void); -unsigned int ffi_closure_elfbsd_inner (ffi_closure *, void *, char *); - -static void -ffi_prep_closure_elfbsd (ffi_cif *cif, void **avalue, char *stackp) -{ - unsigned int i; - void **p_argv; - ffi_type **p_arg; - - p_argv = avalue; - - for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) - { - size_t z; - - z = (*p_arg)->size; - *p_argv = stackp; - - /* Align if necessary */ - if ((sizeof (int) - 1) & z) - z = FFI_ALIGN(z, sizeof (int)); - - p_argv++; - stackp += z; - } -} - -unsigned int -ffi_closure_elfbsd_inner (ffi_closure *closure, void *resp, char *stack) -{ - ffi_cif *cif; - void **arg_area; - - cif = closure->cif; - arg_area = (void **) alloca (cif->nargs * sizeof (void *)); - - ffi_prep_closure_elfbsd (cif, arg_area, stack); - - (closure->fun) (cif, resp, arg_area, closure->user_data); - - return cif->flags; -} - -ffi_status -ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif, - void (*fun)(ffi_cif *, void *, void **, void *), - void *user_data, void *codeloc) -{ - char *tramp = (char *) codeloc; - void *fn; - - FFI_ASSERT (cif->abi == FFI_ELFBSD); - - /* entry mask */ - *(unsigned short *)(tramp + 0) = 0x0000; - /* movl #closure, r0 */ - tramp[2] = 0xd0; - tramp[3] = 0x8f; - *(unsigned int *)(tramp + 4) = (unsigned int) closure; - tramp[8] = 0x50; - - if (cif->rtype->type == FFI_TYPE_STRUCT - && !cif->flags) - fn = &ffi_closure_struct_elfbsd; - else - fn = &ffi_closure_elfbsd; - - /* jmpl #fn */ - tramp[9] = 0x17; - tramp[10] = 0xef; - *(unsigned int *)(tramp + 11) = (unsigned int)fn + 2 - - (unsigned int)tramp - 9 - 6; - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; -} diff --git a/deps/libffi/src/vax/ffitarget.h b/deps/libffi/src/vax/ffitarget.h deleted file mode 100644 index 2fc94881abbc35..00000000000000 --- a/deps/libffi/src/vax/ffitarget.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2013 Miodrag Vallat. - * - * 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. - */ - -/* - * vax Foreign Function Interface - */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_ELFBSD, - FFI_DEFAULT_ABI = FFI_ELFBSD, - FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_TRAMPOLINE_SIZE 15 -#define FFI_NATIVE_RAW_API 0 - -#endif diff --git a/deps/libffi/src/wasm/ffi.c b/deps/libffi/src/wasm/ffi.c deleted file mode 100644 index 486ffa7856aa82..00000000000000 --- a/deps/libffi/src/wasm/ffi.c +++ /dev/null @@ -1,798 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2018-2023 Hood Chatham, Brion Vibber, Kleis Auke Wolthuizen, and others. - - wasm32/emscripten Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include - -#include - -#ifdef DEBUG_F -#define LOG_DEBUG(args...) \ - console.warn(`====LIBFFI(line __LINE__)`, args) -#else -#define LOG_DEBUG(args...) 0 -#endif - -#define EM_JS_MACROS(ret, name, args, body...) EM_JS(ret, name, args, body) - -EM_JS_DEPS(libffi, "$getWasmTableEntry,$setWasmTableEntry,$getEmptyTableSlot,$convertJsFunctionToWasm"); - -#define DEREF_U8(addr, offset) HEAPU8[addr + offset] -#define DEREF_S8(addr, offset) HEAP8[addr + offset] -#define DEREF_U16(addr, offset) HEAPU16[(addr >> 1) + offset] -#define DEREF_S16(addr, offset) HEAP16[(addr >> 1) + offset] -#define DEREF_U32(addr, offset) HEAPU32[(addr >> 2) + offset] -#define DEREF_S32(addr, offset) HEAP32[(addr >> 2) + offset] - -#define DEREF_F32(addr, offset) HEAPF32[(addr >> 2) + offset] -#define DEREF_F64(addr, offset) HEAPF64[(addr >> 3) + offset] -#define DEREF_U64(addr, offset) HEAPU64[(addr >> 3) + offset] - -#define CHECK_FIELD_OFFSET(struct, field, offset) \ - _Static_assert( \ - offsetof(struct, field) == offset, \ - "Memory layout of '" #struct "' has changed: '" #field "' is in an unexpected location"); - -#if __SIZEOF_POINTER__ == 4 - -#define FFI_EMSCRIPTEN_ABI FFI_WASM32_EMSCRIPTEN -#define PTR_SIG 'i' - -#define DEC_PTR(p) p -#define ENC_PTR(p) p - -#define DEREF_PTR(addr, offset) DEREF_U32(addr, offset) -#define DEREF_PTR_NUMBER(addr, offset) DEREF_PTR(addr, offset) - -CHECK_FIELD_OFFSET(ffi_cif, abi, 4*0); -CHECK_FIELD_OFFSET(ffi_cif, nargs, 4*1); -CHECK_FIELD_OFFSET(ffi_cif, arg_types, 4*2); -CHECK_FIELD_OFFSET(ffi_cif, rtype, 4*3); -CHECK_FIELD_OFFSET(ffi_cif, flags, 4*5); -CHECK_FIELD_OFFSET(ffi_cif, nfixedargs, 4*6); - -#define CIF__ABI(addr) DEREF_U32(addr, 0) -#define CIF__NARGS(addr) DEREF_U32(addr, 1) -#define CIF__ARGTYPES(addr) DEREF_U32(addr, 2) -#define CIF__RTYPE(addr) DEREF_U32(addr, 3) -#define CIF__FLAGS(addr) DEREF_U32(addr, 5) -#define CIF__NFIXEDARGS(addr) DEREF_U32(addr, 6) - -CHECK_FIELD_OFFSET(ffi_type, size, 0); -CHECK_FIELD_OFFSET(ffi_type, alignment, 4); -CHECK_FIELD_OFFSET(ffi_type, type, 6); -CHECK_FIELD_OFFSET(ffi_type, elements, 8); - -#define FFI_TYPE__SIZE(addr) DEREF_U32(addr, 0) -#define FFI_TYPE__ALIGN(addr) DEREF_U16(addr + 4, 0) -#define FFI_TYPE__TYPEID(addr) DEREF_U16(addr + 6, 0) -#define FFI_TYPE__ELEMENTS(addr) DEREF_U32(addr + 8, 0) - -#elif __SIZEOF_POINTER__ == 8 - -#define FFI_EMSCRIPTEN_ABI FFI_WASM64_EMSCRIPTEN -#define PTR_SIG 'j' - -// DEC_PTR casts a pointer value (comming from Wasm) represented as BigInt (i64) to Number (i53). -// This should be used for a pointer that is expected to be within the i53 range. If the pointer -// value is outside the Number's range, the value will become NaN. -#define DEC_PTR(p) bigintToI53Checked(p) -// ENC_PTR casts a pointer value represented as Number to BigInt (i64) -#define ENC_PTR(p) BigInt(p) - -#define DEREF_PTR(addr, offset) DEREF_U64(addr, offset) -#define DEREF_PTR_NUMBER(addr, offset) DEC_PTR(DEREF_PTR(addr, offset)) - -CHECK_FIELD_OFFSET(ffi_cif, abi, 0); -CHECK_FIELD_OFFSET(ffi_cif, nargs, 4); -CHECK_FIELD_OFFSET(ffi_cif, arg_types, 8); -CHECK_FIELD_OFFSET(ffi_cif, rtype, 16); -CHECK_FIELD_OFFSET(ffi_cif, flags, 28); -CHECK_FIELD_OFFSET(ffi_cif, nfixedargs, 32); - -#define CIF__ABI(addr) DEREF_U32(addr, 0) -#define CIF__NARGS(addr) DEREF_U32(addr + 4, 0) -#define CIF__ARGTYPES(addr) DEREF_U64(addr + 8, 0) -#define CIF__RTYPE(addr) DEREF_U64(addr + 16, 0) -#define CIF__FLAGS(addr) DEREF_U32(addr + 28, 0) -#define CIF__NFIXEDARGS(addr) DEREF_U32(addr + 32, 0) - -CHECK_FIELD_OFFSET(ffi_type, size, 0); -CHECK_FIELD_OFFSET(ffi_type, alignment, 8); -CHECK_FIELD_OFFSET(ffi_type, type, 10); -CHECK_FIELD_OFFSET(ffi_type, elements, 16); - -#define FFI_TYPE__SIZE(addr) DEREF_U64(addr, 0) -#define FFI_TYPE__ALIGN(addr) DEREF_U16(addr + 8, 0) -#define FFI_TYPE__TYPEID(addr) DEREF_U16(addr + 10, 0) -#define FFI_TYPE__ELEMENTS(addr) DEREF_U64(addr + 16, 0) - -#else -#error "Unknown pointer size" -#endif - -#define ALIGN_ADDRESS(addr, align) (addr &= (~((align) - 1))) -#define STACK_ALLOC(stack, size, align) ((stack -= (size)), ALIGN_ADDRESS(stack, align)) - -// Most wasm runtimes support at most 1000 Js trampoline args. -#define MAX_ARGS 1000 - -#include - -#define VARARGS_FLAG 1 - -#define FFI_OK_MACRO 0 -_Static_assert(FFI_OK_MACRO == FFI_OK, "FFI_OK must be 0"); - -#define FFI_BAD_TYPEDEF_MACRO 1 -_Static_assert(FFI_BAD_TYPEDEF_MACRO == FFI_BAD_TYPEDEF, "FFI_BAD_TYPEDEF must be 1"); - -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep(ffi_cif *cif) -{ - if (cif->abi != FFI_EMSCRIPTEN_ABI) - return FFI_BAD_ABI; - // This is called after ffi_prep_cif_machdep_var so we need to avoid - // overwriting cif->nfixedargs. - if (!(cif->flags & VARARGS_FLAG)) - cif->nfixedargs = cif->nargs; - if (cif->nargs > MAX_ARGS) - return FFI_BAD_TYPEDEF; - if (cif->rtype->type == FFI_TYPE_COMPLEX) - return FFI_BAD_TYPEDEF; - // If they put the COMPLEX type into a struct we won't notice, but whatever. - for (int i = 0; i < cif->nargs; i++) - if (cif->arg_types[i]->type == FFI_TYPE_COMPLEX) - return FFI_BAD_TYPEDEF; - return FFI_OK; -} - -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned nfixedargs, unsigned ntotalargs) -{ - cif->flags |= VARARGS_FLAG; - cif->nfixedargs = nfixedargs; - // The varargs takes up one extra argument - if (cif->nfixedargs + 1 > MAX_ARGS) - return FFI_BAD_TYPEDEF; - return FFI_OK; -} - -/** - * A Javascript helper function. This takes an argument typ which is a wasm - * pointer to an ffi_type object. It returns a pair a type and a type id. - * - * - If it is not a struct, return its type and its typeid field. - * - If it is a struct of size >= 2, return the type and its typeid (which - * will be FFI_TYPE_STRUCT) - * - If it is a struct of size 0, return FFI_TYPE_VOID (????? this is broken) - * - If it is a struct of size 1, replace it with the single field and apply - * the same logic again to that. - * - * By always unboxing structs up front, we can avoid messy casework later. - */ -EM_JS_MACROS( -void, -unbox_small_structs, (ffi_type type_ptr), { - type_ptr = DEC_PTR(type_ptr); - var type_id = FFI_TYPE__TYPEID(type_ptr); - while (type_id === FFI_TYPE_STRUCT) { - // Don't unbox single element structs if they are bigger than 16 bytes. This - // is a work around for the fact that Python will give incorrect values for - // the size of the field in these cases: it says that the struct has pointer - // size and alignment and are of type pointer, even though it is more - // accurately a struct and has a larger size. Keeping it as a struct here - // will let us get the ABI right (which is in fact that the true argument is - // a pointer to the stack... so maybe Python issn't so wrong??) - // - // See the Python comment here: - // https://github.com/python/cpython/blob/a16a9f978f42b8a09297c1efbf33877f6388c403/Modules/_ctypes/stgdict.c#L718-L779 - if (DEC_PTR(FFI_TYPE__SIZE(type_ptr)) > 16) { - break; - } - var elements = DEC_PTR(FFI_TYPE__ELEMENTS(type_ptr)); - var first_element = DEREF_PTR_NUMBER(elements, 0); - if (first_element === 0) { - type_id = FFI_TYPE_VOID; - break; - } else if (DEREF_PTR_NUMBER(elements, 1) === 0) { - type_ptr = first_element; - type_id = FFI_TYPE__TYPEID(first_element); - } else { - break; - } - } - return [type_ptr, type_id]; -}) - -EM_JS_MACROS( -void, -ffi_call_js, (ffi_cif *cif, ffi_fp fn, void *rvalue, void **avalue), -{ - cif = DEC_PTR(cif); - fn = DEC_PTR(fn); - rvalue = DEC_PTR(rvalue); - avalue = DEC_PTR(avalue); - var abi = CIF__ABI(cif); - var nargs = CIF__NARGS(cif); - var nfixedargs = CIF__NFIXEDARGS(cif); - var arg_types_ptr = DEC_PTR(CIF__ARGTYPES(cif)); - var flags = CIF__FLAGS(cif); - var rtype_unboxed = unbox_small_structs(CIF__RTYPE(cif)); - var rtype_ptr = rtype_unboxed[0]; - var rtype_id = rtype_unboxed[1]; - var orig_stack_ptr = stackSave(); - var cur_stack_ptr = orig_stack_ptr; - - var args = []; - // Does our onwards call return by argument or normally? We return by argument - // no matter what. - var ret_by_arg = false; - - if (rtype_id === FFI_TYPE_COMPLEX) { - throw new Error('complex ret marshalling nyi'); - } - if (rtype_id < 0 || rtype_id > FFI_TYPE_LAST) { - throw new Error('Unexpected rtype ' + rtype_id); - } - // If the return type is a struct with multiple entries or a long double, the - // function takes an extra first argument which is a pointer to return value. - // Conveniently, we've already received a pointer to return value, so we can - // just use this. We also mark a flag that we don't need to convert the return - // value of the dynamic call back to C. - if (rtype_id === FFI_TYPE_LONGDOUBLE || rtype_id === FFI_TYPE_STRUCT) { - args.push(ENC_PTR(rvalue)); - ret_by_arg = true; - } - - // Accumulate a Javascript list of arguments for the Javascript wrapper for - // the wasm function. The Javascript wrapper does a type conversion from - // Javascript to C automatically, here we manually do the inverse conversion - // from C to Javascript. - for (var i = 0; i < nfixedargs; i++) { - var arg_ptr = DEREF_PTR_NUMBER(avalue, i); - var arg_unboxed = unbox_small_structs(DEREF_PTR(arg_types_ptr, i)); - var arg_type_ptr = arg_unboxed[0]; - var arg_type_id = arg_unboxed[1]; - - // It's okay here to always use unsigned integers as long as the size is 32 - // or 64 bits. Smaller sizes get extended to 32 bits differently according - // to whether they are signed or unsigned. - switch (arg_type_id) { - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - args.push(DEREF_U32(arg_ptr, 0)); - break; - case FFI_TYPE_FLOAT: - args.push(DEREF_F32(arg_ptr, 0)); - break; - case FFI_TYPE_DOUBLE: - args.push(DEREF_F64(arg_ptr, 0)); - break; - case FFI_TYPE_UINT8: - args.push(DEREF_U8(arg_ptr, 0)); - break; - case FFI_TYPE_SINT8: - args.push(DEREF_S8(arg_ptr, 0)); - break; - case FFI_TYPE_UINT16: - args.push(DEREF_U16(arg_ptr, 0)); - break; - case FFI_TYPE_SINT16: - args.push(DEREF_S16(arg_ptr, 0)); - break; - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - args.push(DEREF_U64(arg_ptr, 0)); - break; - case FFI_TYPE_LONGDOUBLE: - // long double is passed as a pair of BigInts. - args.push(DEREF_U64(arg_ptr, 0)); - args.push(DEREF_U64(arg_ptr, 1)); - break; - case FFI_TYPE_STRUCT: - // Nontrivial structs are passed by pointer. - // Have to copy the struct onto the stack though because C ABI says it's - // call by value. - var size = DEC_PTR(FFI_TYPE__SIZE(arg_type_ptr)); - var align = FFI_TYPE__ALIGN(arg_type_ptr); - STACK_ALLOC(cur_stack_ptr, size, align); - HEAP8.subarray(cur_stack_ptr, cur_stack_ptr+size).set(HEAP8.subarray(arg_ptr, arg_ptr + size)); - args.push(ENC_PTR(cur_stack_ptr)); - break; - case FFI_TYPE_POINTER: - args.push(DEREF_PTR(arg_ptr, 0)); - break; - case FFI_TYPE_COMPLEX: - throw new Error('complex marshalling nyi'); - default: - throw new Error('Unexpected type ' + arg_type_id); - } - } - - // Wasm functions can't directly manipulate the callstack, so varargs - // arguments have to go on a separate stack. A varags function takes one extra - // argument which is a pointer to where on the separate stack the args are - // located. Because stacks are allocated backwards, we have to loop over the - // varargs backwards. - // - // We don't have any way of knowing how many args were actually passed, so we - // just always copy extra nonsense past the end. The ownwards call will know - // not to look at it. - if (flags & VARARGS_FLAG) { - var struct_arg_info = []; - for (var i = nargs - 1; i >= nfixedargs; i--) { - var arg_ptr = DEREF_PTR_NUMBER(avalue, i); - var arg_unboxed = unbox_small_structs(DEREF_PTR(arg_types_ptr, i)); - var arg_type_ptr = arg_unboxed[0]; - var arg_type_id = arg_unboxed[1]; - switch (arg_type_id) { - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - STACK_ALLOC(cur_stack_ptr, 1, 1); - DEREF_U8(cur_stack_ptr, 0) = DEREF_U8(arg_ptr, 0); - break; - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - STACK_ALLOC(cur_stack_ptr, 2, 2); - DEREF_U16(cur_stack_ptr, 0) = DEREF_U16(arg_ptr, 0); - break; - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_FLOAT: - STACK_ALLOC(cur_stack_ptr, 4, 4); - DEREF_U32(cur_stack_ptr, 0) = DEREF_U32(arg_ptr, 0); - break; - case FFI_TYPE_DOUBLE: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - STACK_ALLOC(cur_stack_ptr, 8, 8); - DEREF_U32(cur_stack_ptr, 0) = DEREF_U32(arg_ptr, 0); - DEREF_U32(cur_stack_ptr, 1) = DEREF_U32(arg_ptr, 1); - break; - case FFI_TYPE_LONGDOUBLE: - STACK_ALLOC(cur_stack_ptr, 16, 8); - DEREF_U32(cur_stack_ptr, 0) = DEREF_U32(arg_ptr, 0); - DEREF_U32(cur_stack_ptr, 1) = DEREF_U32(arg_ptr, 1); - DEREF_U32(cur_stack_ptr, 2) = DEREF_U32(arg_ptr, 2); - DEREF_U32(cur_stack_ptr, 3) = DEREF_U32(arg_ptr, 3); - break; - case FFI_TYPE_STRUCT: - // Again, struct must be passed by pointer. - // But ABI is by value, so have to copy struct onto stack. - // Currently arguments are going onto stack so we can't put it there now. Come back for this. - STACK_ALLOC(cur_stack_ptr, __SIZEOF_POINTER__, __SIZEOF_POINTER__); - struct_arg_info.push([cur_stack_ptr, arg_ptr, DEC_PTR(FFI_TYPE__SIZE(arg_type_ptr)), FFI_TYPE__ALIGN(arg_type_ptr)]); - break; - case FFI_TYPE_POINTER: - STACK_ALLOC(cur_stack_ptr, __SIZEOF_POINTER__, __SIZEOF_POINTER__); - DEREF_PTR(cur_stack_ptr, 0) = DEREF_PTR(arg_ptr, 0); - break; - case FFI_TYPE_COMPLEX: - throw new Error('complex arg marshalling nyi'); - default: - throw new Error('Unexpected argtype ' + arg_type_id); - } - } - // extra normal argument which is the pointer to the varargs. - args.push(ENC_PTR(cur_stack_ptr)); - // Now allocate variable struct args on stack too. - for (var i = 0; i < struct_arg_info.length; i++) { - var struct_info = struct_arg_info[i]; - var arg_target = struct_info[0]; - var arg_ptr = struct_info[1]; - var size = struct_info[2]; - var align = struct_info[3]; - STACK_ALLOC(cur_stack_ptr, size, align); - HEAP8.subarray(cur_stack_ptr, cur_stack_ptr+size).set(HEAP8.subarray(arg_ptr, arg_ptr + size)); - DEREF_PTR(arg_target, 0) = ENC_PTR(cur_stack_ptr); - } - } - stackRestore(cur_stack_ptr); - stackAlloc(0); // stackAlloc enforces alignment invariants on the stack pointer - LOG_DEBUG("CALL_FUNC_PTR", "fn:", fn, "args:", args); - var result = getWasmTableEntry(fn).apply(null, args); - // Put the stack pointer back (we moved it if there were any struct args or we - // made a varargs call) - stackRestore(orig_stack_ptr); - - // We need to return by argument. If return value was a nontrivial struct or - // long double, the onwards call already put the return value in rvalue - if (ret_by_arg) { - return; - } - - // Otherwise the result was automatically converted from C into Javascript and - // we need to manually convert it back to C. - switch (rtype_id) { - case FFI_TYPE_VOID: - break; - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - DEREF_U32(rvalue, 0) = result; - break; - case FFI_TYPE_FLOAT: - DEREF_F32(rvalue, 0) = result; - break; - case FFI_TYPE_DOUBLE: - DEREF_F64(rvalue, 0) = result; - break; - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - DEREF_U8(rvalue, 0) = result; - break; - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - DEREF_U16(rvalue, 0) = result; - break; - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - DEREF_U64(rvalue, 0) = result; - break; - case FFI_TYPE_POINTER: - DEREF_PTR(rvalue, 0) = result; - break; - case FFI_TYPE_COMPLEX: - throw new Error('complex ret marshalling nyi'); - default: - throw new Error('Unexpected rtype ' + rtype_id); - } -}); - -void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { - ffi_call_js(cif, fn, rvalue, avalue); -} - -#if __SIZEOF_POINTER__ == 4 - -CHECK_FIELD_OFFSET(ffi_closure, ftramp, 4*0); -CHECK_FIELD_OFFSET(ffi_closure, cif, 4*1); -CHECK_FIELD_OFFSET(ffi_closure, fun, 4*2); -CHECK_FIELD_OFFSET(ffi_closure, user_data, 4*3); - -#define CLOSURE__wrapper(addr) DEREF_U32(addr, 0) -#define CLOSURE__cif(addr) DEREF_U32(addr, 1) -#define CLOSURE__fun(addr) DEREF_U32(addr, 2) -#define CLOSURE__user_data(addr) DEREF_U32(addr, 3) - -#elif __SIZEOF_POINTER__ == 8 - -CHECK_FIELD_OFFSET(ffi_closure, ftramp, 0); -CHECK_FIELD_OFFSET(ffi_closure, cif, 8); -CHECK_FIELD_OFFSET(ffi_closure, fun, 16); -CHECK_FIELD_OFFSET(ffi_closure, user_data, 24); - -#define CLOSURE__wrapper(addr) DEREF_U64(addr, 0) -#define CLOSURE__cif(addr) DEREF_U64(addr, 1) -#define CLOSURE__fun(addr) DEREF_U64(addr, 2) -#define CLOSURE__user_data(addr) DEREF_U64(addr, 3) - -#else -#error "Unknown pointer size" -#endif - -EM_JS_MACROS(void *, ffi_closure_alloc_js, (size_t size, void **code), { - size = DEC_PTR(size); - code = DEC_PTR(code); - var closure = _malloc(size); - var index = getEmptyTableSlot(); - DEREF_PTR(code, 0) = ENC_PTR(index); - CLOSURE__wrapper(closure) = ENC_PTR(index); - return ENC_PTR(closure); -}) - -void * __attribute__ ((visibility ("default"))) -ffi_closure_alloc(size_t size, void **code) { - return ffi_closure_alloc_js(size, code); -} - -EM_JS_MACROS(void, ffi_closure_free_js, (void *closure), { - closure = DEC_PTR(closure); - var index = DEC_PTR(CLOSURE__wrapper(closure)); - freeTableIndexes.push(index); - _free(closure); -}) - -void __attribute__ ((visibility ("default"))) -ffi_closure_free(void *closure) { - return ffi_closure_free_js(closure); -} - -EM_JS_MACROS( -ffi_status, -ffi_prep_closure_loc_js, -(ffi_closure *closure, ffi_cif *cif, void *fun, void *user_data, void *codeloc), -{ - closure = DEC_PTR(closure); - cif = DEC_PTR(cif); - fun = DEC_PTR(fun); - user_data = DEC_PTR(user_data); - codeloc = DEC_PTR(codeloc); - var abi = CIF__ABI(cif); - var nargs = CIF__NARGS(cif); - var nfixedargs = CIF__NFIXEDARGS(cif); - var arg_types_ptr = DEC_PTR(CIF__ARGTYPES(cif)); - var rtype_unboxed = unbox_small_structs(CIF__RTYPE(cif)); - var rtype_ptr = rtype_unboxed[0]; - var rtype_id = rtype_unboxed[1]; - - // First construct the signature of the javascript trampoline we are going to create. - // Important: this is the signature for calling us, the onward call always has sig viiii. - var sig; - var ret_by_arg = false; - switch (rtype_id) { - case FFI_TYPE_VOID: - sig = 'v'; - break; - case FFI_TYPE_STRUCT: - case FFI_TYPE_LONGDOUBLE: - // Return via a first pointer argument. - sig = 'v' + PTR_SIG; - ret_by_arg = true; - break; - case FFI_TYPE_INT: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - sig = 'i'; - break; - case FFI_TYPE_FLOAT: - sig = 'f'; - break; - case FFI_TYPE_DOUBLE: - sig = 'd'; - break; - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - sig = 'j'; - break; - case FFI_TYPE_POINTER: - sig = PTR_SIG; - break; - case FFI_TYPE_COMPLEX: - throw new Error('complex ret marshalling nyi'); - default: - throw new Error('Unexpected rtype ' + rtype_id); - } - var unboxed_arg_type_id_list = []; - var unboxed_arg_type_info_list = []; - for (var i = 0; i < nargs; i++) { - var arg_unboxed = unbox_small_structs(DEREF_PTR(arg_types_ptr, i)); - var arg_type_ptr = arg_unboxed[0]; - var arg_type_id = arg_unboxed[1]; - unboxed_arg_type_id_list.push(arg_type_id); - unboxed_arg_type_info_list.push([DEC_PTR(FFI_TYPE__SIZE(arg_type_ptr)), FFI_TYPE__ALIGN(arg_type_ptr)]); - } - for (var i = 0; i < nfixedargs; i++) { - switch (unboxed_arg_type_id_list[i]) { - case FFI_TYPE_INT: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - sig += 'i'; - break; - case FFI_TYPE_FLOAT: - sig += 'f'; - break; - case FFI_TYPE_DOUBLE: - sig += 'd'; - break; - case FFI_TYPE_LONGDOUBLE: - sig += 'jj'; - break; - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - sig += 'j'; - break; - case FFI_TYPE_STRUCT: - case FFI_TYPE_POINTER: - sig += PTR_SIG; - break; - case FFI_TYPE_COMPLEX: - throw new Error('complex marshalling nyi'); - default: - throw new Error('Unexpected argtype ' + arg_type_id); - } - } - if (nfixedargs < nargs) { - // extra pointer to varargs stack - sig += PTR_SIG; - } - LOG_DEBUG("CREATE_CLOSURE", "sig:", sig); - function trampoline() { - var args = Array.prototype.slice.call(arguments); - var size = 0; - var orig_stack_ptr = stackSave(); - var cur_ptr = orig_stack_ptr; - var ret_ptr; - var jsarg_idx = 0; - // Should we return by argument or not? The onwards call returns by argument - // no matter what. (Warning: ret_by_arg means the opposite in ffi_call) - if (ret_by_arg) { - ret_ptr = args[jsarg_idx++]; - } else { - // We might return 4 bytes or 8 bytes, allocate 8 just in case. - STACK_ALLOC(cur_ptr, 8, 8); - ret_ptr = cur_ptr; - } - cur_ptr -= __SIZEOF_POINTER__ * nargs; - var args_ptr = cur_ptr; - var carg_idx = 0; - // Here we either have the actual argument, or a pair of BigInts for long - // double, or a pointer to struct. We have to store into args_ptr[i] a - // pointer to the ith argument. If the argument is a struct, just store the - // pointer. Otherwise allocate stack space and copy the js argument onto the - // stack. - for (; carg_idx < nfixedargs; carg_idx++) { - // jsarg_idx might start out as 0 or 1 depending on ret_by_arg - // it advances an extra time for long double - var cur_arg = args[jsarg_idx++]; - var arg_type_info = unboxed_arg_type_info_list[carg_idx]; - var arg_size = arg_type_info[0]; - var arg_align = arg_type_info[1]; - var arg_type_id = unboxed_arg_type_id_list[carg_idx]; - switch (arg_type_id) { - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - // Bad things happen if we don't align to 4 here - STACK_ALLOC(cur_ptr, 1, 4); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - DEREF_U8(cur_ptr, 0) = cur_arg; - break; - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - // Bad things happen if we don't align to 4 here - STACK_ALLOC(cur_ptr, 2, 4); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - DEREF_U16(cur_ptr, 0) = cur_arg; - break; - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - STACK_ALLOC(cur_ptr, 4, 4); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - DEREF_U32(cur_ptr, 0) = cur_arg; - break; - case FFI_TYPE_STRUCT: - // cur_arg is already a pointer to struct - // copy it onto stack to pass by value - STACK_ALLOC(cur_ptr, arg_size, arg_align); - HEAP8.subarray(cur_ptr, cur_ptr + arg_size).set(HEAP8.subarray(DEC_PTR(cur_arg), DEC_PTR(cur_arg) + arg_size)); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - break; - case FFI_TYPE_FLOAT: - STACK_ALLOC(cur_ptr, 4, 4); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - DEREF_F32(cur_ptr, 0) = cur_arg; - break; - case FFI_TYPE_DOUBLE: - STACK_ALLOC(cur_ptr, 8, 8); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - DEREF_F64(cur_ptr, 0) = cur_arg; - break; - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - STACK_ALLOC(cur_ptr, 8, 8); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - DEREF_U64(cur_ptr, 0) = cur_arg; - break; - case FFI_TYPE_LONGDOUBLE: - STACK_ALLOC(cur_ptr, 16, 8); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - DEREF_U64(cur_ptr, 0) = cur_arg; - cur_arg = args[jsarg_idx++]; - DEREF_U64(cur_ptr, 1) = cur_arg; - break; - case FFI_TYPE_POINTER: - STACK_ALLOC(cur_ptr, __SIZEOF_POINTER__, __SIZEOF_POINTER__); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - DEREF_PTR(cur_ptr, 0) = cur_arg; - break; - } - } - // If its a varargs call, last js argument is a pointer to the varargs. - var varargs = DEC_PTR(args[args.length - 1]); - // We have no way of knowing how many varargs were actually provided, this - // fills the rest of the stack space allocated with nonsense. The onward - // call will know to ignore the nonsense. - - // We either have a pointer to the argument if the argument is not a struct - // or a pointer to pointer to struct. We need to store a pointer to the - // argument into args_ptr[i] - for (; carg_idx < nargs; carg_idx++) { - var arg_type_id = unboxed_arg_type_id_list[carg_idx]; - var arg_type_info = unboxed_arg_type_info_list[carg_idx]; - var arg_size = arg_type_info[0]; - var arg_align = arg_type_info[1]; - if (arg_type_id === FFI_TYPE_STRUCT) { - // In this case varargs is a pointer to pointer to struct so we need to - // deref once - var struct_ptr = DEREF_PTR_NUMBER(varargs, 0); - STACK_ALLOC(cur_ptr, arg_size, arg_align); - HEAP8.subarray(cur_ptr, cur_ptr + arg_size).set(HEAP8.subarray(struct_ptr, struct_ptr + arg_size)); - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(cur_ptr); - } else { - DEREF_PTR(args_ptr, carg_idx) = ENC_PTR(varargs); - } - varargs += __SIZEOF_POINTER__; - } - stackRestore(cur_ptr); - stackAlloc(0); // stackAlloc enforces alignment invariants on the stack pointer - LOG_DEBUG("CALL_CLOSURE", "closure:", closure, "fptr", CLOSURE__fun(closure), "cif", CLOSURE__cif(closure)); - getWasmTableEntry(CLOSURE__fun(closure))( - CLOSURE__cif(closure), ENC_PTR(ret_ptr), ENC_PTR(args_ptr), - CLOSURE__user_data(closure) - ); - stackRestore(orig_stack_ptr); - - // If we aren't supposed to return by argument, figure out what to return. - if (!ret_by_arg) { - switch (sig[0]) { - case 'i': - return DEREF_U32(ret_ptr, 0); - case 'j': - return DEREF_U64(ret_ptr, 0); - case 'd': - return DEREF_F64(ret_ptr, 0); - case 'f': - return DEREF_F32(ret_ptr, 0); - } - } - } - try { - var wasm_trampoline = convertJsFunctionToWasm(trampoline, sig); - } catch(e) { - return FFI_BAD_TYPEDEF_MACRO; - } - setWasmTableEntry(codeloc, wasm_trampoline); - CLOSURE__cif(closure) = ENC_PTR(cif); - CLOSURE__fun(closure) = ENC_PTR(fun); - CLOSURE__user_data(closure) = ENC_PTR(user_data); - return FFI_OK_MACRO; -}) - -// EM_JS does not correctly handle function pointer arguments, so we need a -// helper -ffi_status ffi_prep_closure_loc(ffi_closure *closure, ffi_cif *cif, - void (*fun)(ffi_cif *, void *, void **, void *), - void *user_data, void *codeloc) { - if (cif->abi != FFI_EMSCRIPTEN_ABI) - return FFI_BAD_ABI; - return ffi_prep_closure_loc_js(closure, cif, (void *)fun, user_data, - codeloc); -} diff --git a/deps/libffi/src/wasm/ffitarget.h b/deps/libffi/src/wasm/ffitarget.h deleted file mode 100644 index 10041c00d74f66..00000000000000 --- a/deps/libffi/src/wasm/ffitarget.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2018-2023 Hood Chatham, Brion Vibber, Kleis Auke Wolthuizen, and others. - - Target configuration macros for wasm32. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- Generic type definitions ----------------------------------------- */ - -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -// TODO: https://github.com/emscripten-core/emscripten/issues/9868 -typedef void (*ffi_fp)(void); - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, -#if __SIZEOF_POINTER__ == 4 - FFI_WASM32, // "raw", no structures, varargs, or closures (not implemented!) - FFI_WASM32_EMSCRIPTEN, // structures, varargs, and split 64-bit params -#elif __SIZEOF_POINTER__ == 8 - FFI_WASM64, - FFI_WASM64_EMSCRIPTEN, -#else -#error "Unknown pointer size" -#endif - FFI_LAST_ABI, -#if __SIZEOF_POINTER__ == 4 -#ifdef __EMSCRIPTEN__ - FFI_DEFAULT_ABI = FFI_WASM32_EMSCRIPTEN -#else - FFI_DEFAULT_ABI = FFI_WASM32 -#endif -#elif __SIZEOF_POINTER__ == 8 -#ifdef __EMSCRIPTEN__ - FFI_DEFAULT_ABI = FFI_WASM64_EMSCRIPTEN -#else - FFI_DEFAULT_ABI = FFI_WASM64 -#endif -#else -#error "Unknown pointer size" -#endif -} ffi_abi; - -#define FFI_CLOSURES 1 -// #define FFI_GO_CLOSURES 0 -#define FFI_TRAMPOLINE_SIZE 4 -// #define FFI_NATIVE_RAW_API 0 -#define FFI_TARGET_SPECIFIC_VARIADIC 1 -#define FFI_EXTRA_CIF_FIELDS unsigned int nfixedargs - -#endif diff --git a/deps/libffi/src/x86/asmnames.h b/deps/libffi/src/x86/asmnames.h deleted file mode 100644 index 7551021e17ebab..00000000000000 --- a/deps/libffi/src/x86/asmnames.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ASMNAMES_H -#define ASMNAMES_H - -#define C2(X, Y) X ## Y -#define C1(X, Y) C2(X, Y) -#ifdef __USER_LABEL_PREFIX__ -# define C(X) C1(__USER_LABEL_PREFIX__, X) -#else -# define C(X) X -#endif - -#ifdef __APPLE__ -# define L(X) C1(L, X) -#else -# define L(X) C1(.L, X) -#endif - -#if defined(__ELF__) && defined(__PIC__) -# define PLT(X) X@PLT -#else -# define PLT(X) X -#endif - -#ifdef __ELF__ -# define ENDF(X) .type X,@function; .size X, . - X -#else -# define ENDF(X) -#endif - -#endif /* ASMNAMES_H */ diff --git a/deps/libffi/src/x86/ffi.c b/deps/libffi/src/x86/ffi.c deleted file mode 100644 index 6862533f282a29..00000000000000 --- a/deps/libffi/src/x86/ffi.c +++ /dev/null @@ -1,835 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2017, 2022 Anthony Green - Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc. - Copyright (c) 2002 Ranjit Mathew - Copyright (c) 2002 Bo Thorsen - Copyright (c) 2002 Roger Sayle - Copyright (C) 2008, 2010 Free Software Foundation, Inc. - - x86 Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#if defined(__i386__) || defined(_M_IX86) -#include -#include -#include -#include -#include -#include "internal.h" - -/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; - all further uses in this file will refer to the 80-bit type. */ -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE -# if FFI_TYPE_LONGDOUBLE != 4 -# error FFI_TYPE_LONGDOUBLE out of date -# endif -#else -# undef FFI_TYPE_LONGDOUBLE -# define FFI_TYPE_LONGDOUBLE 4 -#endif - -#if defined(__GNUC__) && !defined(__declspec) -# define __declspec(x) __attribute__((x)) -#endif - -#if defined(_MSC_VER) && defined(_M_IX86) -/* Stack is not 16-byte aligned on Windows. */ -#define STACK_ALIGN(bytes) (bytes) -#else -#define STACK_ALIGN(bytes) FFI_ALIGN (bytes, 16) -#endif - -/* Perform machine dependent cif processing. */ -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep(ffi_cif *cif) -{ - size_t bytes = 0; - int i, n, flags, cabi = cif->abi; - - switch (cabi) - { - case FFI_SYSV: - case FFI_STDCALL: - case FFI_THISCALL: - case FFI_FASTCALL: - case FFI_MS_CDECL: - case FFI_PASCAL: - case FFI_REGISTER: - break; - default: - return FFI_BAD_ABI; - } - - switch (cif->rtype->type) - { - case FFI_TYPE_VOID: - flags = X86_RET_VOID; - break; - case FFI_TYPE_FLOAT: - flags = X86_RET_FLOAT; - break; - case FFI_TYPE_DOUBLE: - flags = X86_RET_DOUBLE; - break; - case FFI_TYPE_LONGDOUBLE: - flags = X86_RET_LDOUBLE; - break; - case FFI_TYPE_UINT8: - flags = X86_RET_UINT8; - break; - case FFI_TYPE_UINT16: - flags = X86_RET_UINT16; - break; - case FFI_TYPE_SINT8: - flags = X86_RET_SINT8; - break; - case FFI_TYPE_SINT16: - flags = X86_RET_SINT16; - break; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_POINTER: - flags = X86_RET_INT32; - break; - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - flags = X86_RET_INT64; - break; - case FFI_TYPE_STRUCT: - { -#if defined(X86_WIN32) || defined(X86_DARWIN) - size_t size = cif->rtype->size; - if (size == 1) - flags = X86_RET_STRUCT_1B; - else if (size == 2) - flags = X86_RET_STRUCT_2B; - else if (size == 4) - flags = X86_RET_INT32; - else if (size == 8) - flags = X86_RET_INT64; - else -#endif - { - do_struct: - switch (cabi) - { - case FFI_THISCALL: - case FFI_FASTCALL: - case FFI_STDCALL: - case FFI_MS_CDECL: - flags = X86_RET_STRUCTARG; - break; - default: - flags = X86_RET_STRUCTPOP; - break; - } - /* Allocate space for return value pointer. */ - bytes += FFI_ALIGN (sizeof(void*), FFI_SIZEOF_ARG); - } - } - break; - case FFI_TYPE_COMPLEX: - switch (cif->rtype->elements[0]->type) - { - case FFI_TYPE_DOUBLE: - case FFI_TYPE_LONGDOUBLE: - case FFI_TYPE_SINT64: - case FFI_TYPE_UINT64: - goto do_struct; - case FFI_TYPE_FLOAT: - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - flags = X86_RET_INT64; - break; - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - flags = X86_RET_INT32; - break; - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - flags = X86_RET_STRUCT_2B; - break; - default: - return FFI_BAD_TYPEDEF; - } - break; - default: - return FFI_BAD_TYPEDEF; - } - cif->flags = flags; - - for (i = 0, n = cif->nargs; i < n; i++) - { - ffi_type *t = cif->arg_types[i]; - -#if defined(X86_WIN32) - if (cabi == FFI_STDCALL) - bytes = FFI_ALIGN (bytes, FFI_SIZEOF_ARG); - else -#endif - bytes = FFI_ALIGN (bytes, t->alignment); - bytes += FFI_ALIGN (t->size, FFI_SIZEOF_ARG); - } - cif->bytes = bytes; - - return FFI_OK; -} - -static ffi_arg -extend_basic_type(void *arg, int type) -{ - switch (type) - { - case FFI_TYPE_SINT8: - return *(SINT8 *)arg; - case FFI_TYPE_UINT8: - return *(UINT8 *)arg; - case FFI_TYPE_SINT16: - return *(SINT16 *)arg; - case FFI_TYPE_UINT16: - return *(UINT16 *)arg; - - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT32: - case FFI_TYPE_POINTER: - case FFI_TYPE_FLOAT: - return *(UINT32 *)arg; - - default: - abort(); - } -} - -struct call_frame -{ - void *ebp; /* 0 */ - void *retaddr; /* 4 */ - void (*fn)(void); /* 8 */ - int flags; /* 12 */ - void *rvalue; /* 16 */ - unsigned regs[3]; /* 20-28 */ -}; - -struct abi_params -{ - int dir; /* parameter growth direction */ - int static_chain; /* the static chain register used by gcc */ - int nregs; /* number of register parameters */ - int regs[3]; -}; - -static const struct abi_params abi_params[FFI_LAST_ABI] = { - [FFI_SYSV] = { 1, R_ECX, 0 }, - [FFI_THISCALL] = { 1, R_EAX, 1, { R_ECX } }, - [FFI_FASTCALL] = { 1, R_EAX, 2, { R_ECX, R_EDX } }, - [FFI_STDCALL] = { 1, R_ECX, 0 }, - [FFI_PASCAL] = { -1, R_ECX, 0 }, - /* ??? No defined static chain; gcc does not support REGISTER. */ - [FFI_REGISTER] = { -1, R_ECX, 3, { R_EAX, R_EDX, R_ECX } }, - [FFI_MS_CDECL] = { 1, R_ECX, 0 } -}; - -#ifdef HAVE_FASTCALL - #ifdef _MSC_VER - #define FFI_DECLARE_FASTCALL __fastcall - #else - #define FFI_DECLARE_FASTCALL __declspec(fastcall) - #endif -#else - #define FFI_DECLARE_FASTCALL -#endif - -extern void FFI_DECLARE_FASTCALL ffi_call_i386(struct call_frame *, char *) FFI_HIDDEN; - -/* We perform some black magic here to use some of the parent's stack frame in - * ffi_call_i386() that breaks with the MSVC compiler with the /RTCs or /GZ - * flags. Disable the 'Stack frame run time error checking' for this function - * so we don't hit weird exceptions in debug builds. */ -#if defined(_MSC_VER) -#pragma runtime_checks("s", off) -#endif -/* n.b. ffi_call_unix64 will steal the alloca'd `stack` variable here for use - _as its own stack_ - so we need to compile this function without ASAN */ -FFI_ASAN_NO_SANITIZE -static void -ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - size_t rsize, bytes; - struct call_frame *frame; - char *stack, *argp; - ffi_type **arg_types; - int flags, cabi, i, n, dir, narg_reg; - const struct abi_params *pabi; - - flags = cif->flags; - cabi = cif->abi; - pabi = &abi_params[cabi]; - dir = pabi->dir; - - rsize = 0; - if (rvalue == NULL) - { - switch (flags) - { - case X86_RET_FLOAT: - case X86_RET_DOUBLE: - case X86_RET_LDOUBLE: - case X86_RET_STRUCTPOP: - case X86_RET_STRUCTARG: - /* The float cases need to pop the 387 stack. - The struct cases need to pass a valid pointer to the callee. */ - rsize = cif->rtype->size; - break; - default: - /* We can pretend that the callee returns nothing. */ - flags = X86_RET_VOID; - break; - } - } - - bytes = STACK_ALIGN (cif->bytes); - stack = alloca(bytes + sizeof(*frame) + rsize); - argp = (dir < 0 ? stack + bytes : stack); - frame = (struct call_frame *)(stack + bytes); - if (rsize) - rvalue = frame + 1; - - frame->fn = fn; - frame->flags = flags; - frame->rvalue = rvalue; - frame->regs[pabi->static_chain] = (unsigned)closure; - - narg_reg = 0; - switch (flags) - { - case X86_RET_STRUCTARG: - /* The pointer is passed as the first argument. */ - if (pabi->nregs > 0) - { - frame->regs[pabi->regs[0]] = (unsigned)rvalue; - narg_reg = 1; - break; - } - /* fallthru */ - case X86_RET_STRUCTPOP: - *(void **)argp = rvalue; - argp += sizeof(void *); - break; - } - - arg_types = cif->arg_types; - for (i = 0, n = cif->nargs; i < n; i++) - { - ffi_type *ty = arg_types[i]; - void *valp = avalue[i]; - size_t z = ty->size; - int t = ty->type; - - if (z <= FFI_SIZEOF_ARG && t != FFI_TYPE_STRUCT) - { - ffi_arg val = extend_basic_type (valp, t); - - if (t != FFI_TYPE_FLOAT && narg_reg < pabi->nregs) - frame->regs[pabi->regs[narg_reg++]] = val; - else if (dir < 0) - { - argp -= 4; - *(ffi_arg *)argp = val; - } - else - { - *(ffi_arg *)argp = val; - argp += 4; - } - } - else - { - size_t za = FFI_ALIGN (z, FFI_SIZEOF_ARG); - size_t align = FFI_SIZEOF_ARG; - - /* Issue 434: For thiscall and fastcall, if the paramter passed - as 64-bit integer or struct, all following integer parameters - will be passed on stack. */ - if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL) - && (t == FFI_TYPE_SINT64 - || t == FFI_TYPE_UINT64 - || t == FFI_TYPE_STRUCT)) - narg_reg = 2; - - /* Alignment rules for arguments are quite complex. Vectors and - structures with 16 byte alignment get it. Note that long double - on Darwin does have 16 byte alignment, and does not get this - alignment if passed directly; a structure with a long double - inside, however, would get 16 byte alignment. Since libffi does - not support vectors, we need non concern ourselves with other - cases. */ - if (t == FFI_TYPE_STRUCT && ty->alignment >= 16) - align = 16; - - if (dir < 0) - { - /* ??? These reverse argument ABIs are probably too old - to have cared about alignment. Someone should check. */ - argp -= za; - memcpy (argp, valp, z); - } - else - { - argp = (char *)FFI_ALIGN (argp, align); - memcpy (argp, valp, z); - argp += za; - } - } - } - FFI_ASSERT (dir > 0 || argp == stack); - - ffi_call_i386 (frame, stack); -} -#if defined(_MSC_VER) -#pragma runtime_checks("s", restore) -#endif - -void -ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - ffi_call_int (cif, fn, rvalue, avalue, NULL); -} - -#ifdef FFI_GO_CLOSURES -void -ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int (cif, fn, rvalue, avalue, closure); -} -#endif - -/** private members **/ - -void FFI_HIDDEN ffi_closure_i386(void); -void FFI_HIDDEN ffi_closure_STDCALL(void); -void FFI_HIDDEN ffi_closure_REGISTER(void); -#if defined(FFI_EXEC_STATIC_TRAMP) -void FFI_HIDDEN ffi_closure_i386_alt(void); -void FFI_HIDDEN ffi_closure_STDCALL_alt(void); -void FFI_HIDDEN ffi_closure_REGISTER_alt(void); -#endif - -struct closure_frame -{ - unsigned rettemp[4]; /* 0 */ - unsigned regs[3]; /* 16-24 */ - ffi_cif *cif; /* 28 */ - void (*fun)(ffi_cif*,void*,void**,void*); /* 32 */ - void *user_data; /* 36 */ -}; - -int FFI_HIDDEN FFI_DECLARE_FASTCALL -ffi_closure_inner (struct closure_frame *frame, char *stack) -{ - ffi_cif *cif = frame->cif; - int cabi, i, n, flags, dir, narg_reg; - const struct abi_params *pabi; - ffi_type **arg_types; - char *argp; - void *rvalue; - void **avalue; - - cabi = cif->abi; - flags = cif->flags; - narg_reg = 0; - rvalue = frame->rettemp; - pabi = &abi_params[cabi]; - dir = pabi->dir; - argp = (dir < 0 ? stack + STACK_ALIGN (cif->bytes) : stack); - - switch (flags) - { - case X86_RET_STRUCTARG: - if (pabi->nregs > 0) - { - rvalue = (void *)frame->regs[pabi->regs[0]]; - narg_reg = 1; - frame->rettemp[0] = (unsigned)rvalue; - break; - } - /* fallthru */ - case X86_RET_STRUCTPOP: - rvalue = *(void **)argp; - argp += sizeof(void *); - frame->rettemp[0] = (unsigned)rvalue; - break; - } - - n = cif->nargs; - avalue = alloca(sizeof(void *) * n); - - arg_types = cif->arg_types; - for (i = 0; i < n; ++i) - { - ffi_type *ty = arg_types[i]; - size_t z = ty->size; - int t = ty->type; - void *valp; - - if (z <= FFI_SIZEOF_ARG && t != FFI_TYPE_STRUCT) - { - if (t != FFI_TYPE_FLOAT && narg_reg < pabi->nregs) - valp = &frame->regs[pabi->regs[narg_reg++]]; - else if (dir < 0) - { - argp -= 4; - valp = argp; - } - else - { - valp = argp; - argp += 4; - } - } - else - { - size_t za = FFI_ALIGN (z, FFI_SIZEOF_ARG); - size_t align = FFI_SIZEOF_ARG; - - /* See the comment in ffi_call_int. */ - if (t == FFI_TYPE_STRUCT && ty->alignment >= 16) - align = 16; - - /* Issue 434: For thiscall and fastcall, if the paramter passed - as 64-bit integer or struct, all following integer parameters - will be passed on stack. */ - if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL) - && (t == FFI_TYPE_SINT64 - || t == FFI_TYPE_UINT64 - || t == FFI_TYPE_STRUCT)) - narg_reg = 2; - - if (dir < 0) - { - /* ??? These reverse argument ABIs are probably too old - to have cared about alignment. Someone should check. */ - argp -= za; - valp = argp; - } - else - { - argp = (char *)FFI_ALIGN (argp, align); - valp = argp; - argp += za; - } - } - - avalue[i] = valp; - } - - frame->fun (cif, rvalue, avalue, frame->user_data); - - switch (cabi) - { - case FFI_STDCALL: - return flags | (cif->bytes << X86_RET_POP_SHIFT); - case FFI_THISCALL: - case FFI_FASTCALL: - return flags | ((cif->bytes - (narg_reg * FFI_SIZEOF_ARG)) - << X86_RET_POP_SHIFT); - default: - return flags; - } -} - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc) -{ - char *tramp = closure->tramp; - void (*dest)(void); - int op = 0xb8; /* movl imm, %eax */ - - switch (cif->abi) - { - case FFI_SYSV: - case FFI_MS_CDECL: - dest = ffi_closure_i386; - break; - case FFI_STDCALL: - case FFI_THISCALL: - case FFI_FASTCALL: - case FFI_PASCAL: - dest = ffi_closure_STDCALL; - break; - case FFI_REGISTER: - dest = ffi_closure_REGISTER; - op = 0x68; /* pushl imm */ - break; - default: - return FFI_BAD_ABI; - } - -#if defined(FFI_EXEC_STATIC_TRAMP) - if (ffi_tramp_is_present(closure)) - { - /* Initialize the static trampoline's parameters. */ - if (dest == ffi_closure_i386) - dest = ffi_closure_i386_alt; - else if (dest == ffi_closure_STDCALL) - dest = ffi_closure_STDCALL_alt; - else - dest = ffi_closure_REGISTER_alt; - ffi_tramp_set_parms (closure->ftramp, dest, closure); - goto out; - } -#endif - - /* Initialize the dynamic trampoline. */ - /* endbr32. */ - *(UINT32 *) tramp = 0xfb1e0ff3; - - /* movl or pushl immediate. */ - tramp[4] = op; - *(void **)(tramp + 5) = codeloc; - - /* jmp dest */ - tramp[9] = 0xe9; - *(unsigned *)(tramp + 10) = (unsigned)dest - ((unsigned)codeloc + 14); - -#if defined(FFI_EXEC_STATIC_TRAMP) -out: -#endif - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - -#ifdef FFI_GO_CLOSURES - -void FFI_HIDDEN ffi_go_closure_EAX(void); -void FFI_HIDDEN ffi_go_closure_ECX(void); -void FFI_HIDDEN ffi_go_closure_STDCALL(void); - -ffi_status -ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, - void (*fun)(ffi_cif*,void*,void**,void*)) -{ - void (*dest)(void); - - switch (cif->abi) - { - case FFI_SYSV: - case FFI_MS_CDECL: - dest = ffi_go_closure_ECX; - break; - case FFI_THISCALL: - case FFI_FASTCALL: - dest = ffi_go_closure_EAX; - break; - case FFI_STDCALL: - case FFI_PASCAL: - dest = ffi_go_closure_STDCALL; - break; - case FFI_REGISTER: - default: - return FFI_BAD_ABI; - } - - closure->tramp = dest; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} - -#endif /* FFI_GO_CLOSURES */ - -/* ------- Native raw API support -------------------------------- */ - -#if !FFI_NO_RAW_API - -void FFI_HIDDEN ffi_closure_raw_SYSV(void); -void FFI_HIDDEN ffi_closure_raw_THISCALL(void); - -ffi_status -ffi_prep_raw_closure_loc (ffi_raw_closure *closure, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data, - void *codeloc) -{ - char *tramp = closure->tramp; - void (*dest)(void); - int i; - - /* We currently don't support certain kinds of arguments for raw - closures. This should be implemented by a separate assembly - language routine, since it would require argument processing, - something we don't do now for performance. */ - for (i = cif->nargs-1; i >= 0; i--) - switch (cif->arg_types[i]->type) - { - case FFI_TYPE_STRUCT: - case FFI_TYPE_LONGDOUBLE: - return FFI_BAD_TYPEDEF; - } - - switch (cif->abi) - { - case FFI_THISCALL: - dest = ffi_closure_raw_THISCALL; - break; - case FFI_SYSV: - dest = ffi_closure_raw_SYSV; - break; - default: - return FFI_BAD_ABI; - } - - /* movl imm, %eax. */ - tramp[0] = 0xb8; - *(void **)(tramp + 1) = codeloc; - - /* jmp dest */ - tramp[5] = 0xe9; - *(unsigned *)(tramp + 6) = (unsigned)dest - ((unsigned)codeloc + 10); - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - -void -ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *avalue) -{ - size_t rsize, bytes; - struct call_frame *frame; - char *stack, *argp; - ffi_type **arg_types; - int flags, cabi, i, n, narg_reg; - const struct abi_params *pabi; - - flags = cif->flags; - cabi = cif->abi; - pabi = &abi_params[cabi]; - - rsize = 0; - if (rvalue == NULL) - { - switch (flags) - { - case X86_RET_FLOAT: - case X86_RET_DOUBLE: - case X86_RET_LDOUBLE: - case X86_RET_STRUCTPOP: - case X86_RET_STRUCTARG: - /* The float cases need to pop the 387 stack. - The struct cases need to pass a valid pointer to the callee. */ - rsize = cif->rtype->size; - break; - default: - /* We can pretend that the callee returns nothing. */ - flags = X86_RET_VOID; - break; - } - } - - bytes = STACK_ALIGN (cif->bytes); - argp = stack = - (void *)((uintptr_t)alloca(bytes + sizeof(*frame) + rsize + 15) & ~16); - frame = (struct call_frame *)(stack + bytes); - if (rsize) - rvalue = frame + 1; - - frame->fn = fn; - frame->flags = flags; - frame->rvalue = rvalue; - - narg_reg = 0; - switch (flags) - { - case X86_RET_STRUCTARG: - /* The pointer is passed as the first argument. */ - if (pabi->nregs > 0) - { - frame->regs[pabi->regs[0]] = (unsigned)rvalue; - narg_reg = 1; - break; - } - /* fallthru */ - case X86_RET_STRUCTPOP: - *(void **)argp = rvalue; - argp += sizeof(void *); - bytes -= sizeof(void *); - break; - } - - arg_types = cif->arg_types; - for (i = 0, n = cif->nargs; narg_reg < pabi->nregs && i < n; i++) - { - ffi_type *ty = arg_types[i]; - size_t z = ty->size; - int t = ty->type; - - if (z <= FFI_SIZEOF_ARG && t != FFI_TYPE_STRUCT && t != FFI_TYPE_FLOAT) - { - ffi_arg val = extend_basic_type (avalue, t); - frame->regs[pabi->regs[narg_reg++]] = val; - z = FFI_SIZEOF_ARG; - } - else - { - memcpy (argp, avalue, z); - z = FFI_ALIGN (z, FFI_SIZEOF_ARG); - argp += z; - } - avalue += z; - bytes -= z; - } - if (i < n) - memcpy (argp, avalue, bytes); - - ffi_call_i386 (frame, stack); -} -#endif /* !FFI_NO_RAW_API */ - -#if defined(FFI_EXEC_STATIC_TRAMP) -void * -ffi_tramp_arch (size_t *tramp_size, size_t *map_size) -{ - extern void *trampoline_code_table; - - *map_size = X86_TRAMP_MAP_SIZE; - *tramp_size = X86_TRAMP_SIZE; - return &trampoline_code_table; -} -#endif - -#endif /* __i386__ */ diff --git a/deps/libffi/src/x86/ffi64.c b/deps/libffi/src/x86/ffi64.c deleted file mode 100644 index 1d1b88e049d5e6..00000000000000 --- a/deps/libffi/src/x86/ffi64.c +++ /dev/null @@ -1,953 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi64.c - Copyright (c) 2011, 2018, 2022 Anthony Green - Copyright (c) 2013 The Written Word, Inc. - Copyright (c) 2008, 2010 Red Hat, Inc. - Copyright (c) 2002, 2007 Bo Thorsen - - x86-64 Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -#include -#include -#include -#include -#include "internal64.h" - -#ifdef __x86_64__ - -#define MAX_GPR_REGS 6 -#define MAX_SSE_REGS 8 - -#if defined(__INTEL_COMPILER) -#include "xmmintrin.h" -#define UINT128 __m128 -#else -#if defined(__SUNPRO_C) -#include -#define UINT128 __m128i -#else -#define UINT128 __int128_t -#endif -#endif - -union big_int_union -{ - UINT32 i32; - UINT64 i64; - UINT128 i128; -}; - -struct register_args -{ - /* Registers for argument passing. */ - UINT64 gpr[MAX_GPR_REGS]; - union big_int_union sse[MAX_SSE_REGS]; - UINT64 rax; /* ssecount */ - UINT64 r10; /* static chain */ -}; - -extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)(void)) FFI_HIDDEN; - -/* All reference to register classes here is identical to the code in - gcc/config/i386/i386.c. Do *not* change one without the other. */ - -/* Register class used for passing given 64bit part of the argument. - These represent classes as documented by the PS ABI, with the - exception of SSESF, SSEDF classes, that are basically SSE class, - just gcc will use SF or DFmode move instead of DImode to avoid - reformatting penalties. - - Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves - whenever possible (upper half does contain padding). */ -enum x86_64_reg_class - { - X86_64_NO_CLASS, - X86_64_INTEGER_CLASS, - X86_64_INTEGERSI_CLASS, - X86_64_SSE_CLASS, - X86_64_SSESF_CLASS, - X86_64_SSEDF_CLASS, - X86_64_SSEUP_CLASS, - X86_64_X87_CLASS, - X86_64_X87UP_CLASS, - X86_64_COMPLEX_X87_CLASS, - X86_64_MEMORY_CLASS - }; - -#define MAX_CLASSES 4 - -#define SSE_CLASS_P(X) ((X) >= X86_64_SSE_CLASS && X <= X86_64_SSEUP_CLASS) - -/* x86-64 register passing implementation. See x86-64 ABI for details. Goal - of this code is to classify each 8bytes of incoming argument by the register - class and assign registers accordingly. */ - -/* Return the union class of CLASS1 and CLASS2. - See the x86-64 PS ABI for details. */ - -static enum x86_64_reg_class -merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) -{ - /* Rule #1: If both classes are equal, this is the resulting class. */ - if (class1 == class2) - return class1; - - /* Rule #2: If one of the classes is NO_CLASS, the resulting class is - the other class. */ - if (class1 == X86_64_NO_CLASS) - return class2; - if (class2 == X86_64_NO_CLASS) - return class1; - - /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ - if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) - return X86_64_MEMORY_CLASS; - - /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ - if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) - || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) - return X86_64_INTEGERSI_CLASS; - if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS - || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) - return X86_64_INTEGER_CLASS; - - /* Rule #5: If one of the classes is X87, X87UP, or COMPLEX_X87 class, - MEMORY is used. */ - if (class1 == X86_64_X87_CLASS - || class1 == X86_64_X87UP_CLASS - || class1 == X86_64_COMPLEX_X87_CLASS - || class2 == X86_64_X87_CLASS - || class2 == X86_64_X87UP_CLASS - || class2 == X86_64_COMPLEX_X87_CLASS) - return X86_64_MEMORY_CLASS; - - /* Rule #6: Otherwise class SSE is used. */ - return X86_64_SSE_CLASS; -} - -/* Classify the argument of type TYPE and mode MODE. - CLASSES will be filled by the register class used to pass each word - of the operand. The number of words is returned. In case the parameter - should be passed in memory, 0 is returned. As a special case for zero - sized containers, classes[0] will be NO_CLASS and 1 is returned. - - See the x86-64 PS ABI for details. -*/ -static size_t -classify_argument (ffi_type *type, enum x86_64_reg_class classes[], - size_t byte_offset) -{ - switch (type->type) - { - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - case FFI_TYPE_POINTER: - do_integer: - { - size_t size = byte_offset + type->size; - - if (size <= 4) - { - classes[0] = X86_64_INTEGERSI_CLASS; - return 1; - } - else if (size <= 8) - { - classes[0] = X86_64_INTEGER_CLASS; - return 1; - } - else if (size <= 12) - { - classes[0] = X86_64_INTEGER_CLASS; - classes[1] = X86_64_INTEGERSI_CLASS; - return 2; - } - else if (size <= 16) - { - classes[0] = classes[1] = X86_64_INTEGER_CLASS; - return 2; - } - else - FFI_ASSERT (0); - } - case FFI_TYPE_FLOAT: - if (!(byte_offset % 8)) - classes[0] = X86_64_SSESF_CLASS; - else - classes[0] = X86_64_SSE_CLASS; - return 1; - case FFI_TYPE_DOUBLE: - classes[0] = X86_64_SSEDF_CLASS; - return 1; -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - classes[0] = X86_64_X87_CLASS; - classes[1] = X86_64_X87UP_CLASS; - return 2; -#endif - case FFI_TYPE_STRUCT: - { - const size_t UNITS_PER_WORD = 8; - size_t words = (type->size + byte_offset + UNITS_PER_WORD - 1) - / UNITS_PER_WORD; - ffi_type **ptr; - unsigned int i; - enum x86_64_reg_class subclasses[MAX_CLASSES]; - - /* If the struct is larger than 32 bytes, pass it on the stack. */ - if (type->size > 32) - return 0; - - for (i = 0; i < words; i++) - classes[i] = X86_64_NO_CLASS; - - /* Zero sized arrays or structures are NO_CLASS. We return 0 to - signalize memory class, so handle it as special case. */ - if (!words) - { - case FFI_TYPE_VOID: - classes[0] = X86_64_NO_CLASS; - return 1; - } - - /* Merge the fields of structure. */ - for (ptr = type->elements; *ptr != NULL; ptr++) - { - size_t num, pos; - - byte_offset = FFI_ALIGN (byte_offset, (*ptr)->alignment); - - num = classify_argument (*ptr, subclasses, byte_offset % 8); - if (num == 0) - return 0; - pos = byte_offset / 8; - for (i = 0; i < num && (i + pos) < words; i++) - { - size_t pos = byte_offset / 8; - classes[i + pos] = - merge_classes (subclasses[i], classes[i + pos]); - } - - byte_offset += (*ptr)->size; - } - - if (words > 2) - { - /* When size > 16 bytes, if the first one isn't - X86_64_SSE_CLASS or any other ones aren't - X86_64_SSEUP_CLASS, everything should be passed in - memory. */ - if (classes[0] != X86_64_SSE_CLASS) - return 0; - - for (i = 1; i < words; i++) - if (classes[i] != X86_64_SSEUP_CLASS) - return 0; - } - - /* Final merger cleanup. */ - for (i = 0; i < words; i++) - { - /* If one class is MEMORY, everything should be passed in - memory. */ - if (classes[i] == X86_64_MEMORY_CLASS) - return 0; - - /* The X86_64_SSEUP_CLASS should be always preceded by - X86_64_SSE_CLASS or X86_64_SSEUP_CLASS. */ - if (i > 1 && classes[i] == X86_64_SSEUP_CLASS - && classes[i - 1] != X86_64_SSE_CLASS - && classes[i - 1] != X86_64_SSEUP_CLASS) - { - /* The first one should never be X86_64_SSEUP_CLASS. */ - FFI_ASSERT (i != 0); - classes[i] = X86_64_SSE_CLASS; - } - - /* If X86_64_X87UP_CLASS isn't preceded by X86_64_X87_CLASS, - everything should be passed in memory. */ - if (i > 1 && classes[i] == X86_64_X87UP_CLASS - && (classes[i - 1] != X86_64_X87_CLASS)) - { - /* The first one should never be X86_64_X87UP_CLASS. */ - FFI_ASSERT (i != 0); - return 0; - } - } - return words; - } - case FFI_TYPE_COMPLEX: - { - ffi_type *inner = type->elements[0]; - switch (inner->type) - { - case FFI_TYPE_INT: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - goto do_integer; - - case FFI_TYPE_FLOAT: - classes[0] = X86_64_SSE_CLASS; - if (byte_offset % 8) - { - classes[1] = X86_64_SSESF_CLASS; - return 2; - } - return 1; - case FFI_TYPE_DOUBLE: - classes[0] = classes[1] = X86_64_SSEDF_CLASS; - return 2; -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - classes[0] = X86_64_COMPLEX_X87_CLASS; - return 1; -#endif - } - } - } - abort(); -} - -/* Examine the argument and return set number of register required in each - class. Return zero iff parameter should be passed in memory, otherwise - the number of registers. */ - -static size_t -examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES], - _Bool in_return, int *pngpr, int *pnsse) -{ - size_t n; - unsigned int i; - int ngpr, nsse; - - n = classify_argument (type, classes, 0); - if (n == 0) - return 0; - - ngpr = nsse = 0; - for (i = 0; i < n; ++i) - switch (classes[i]) - { - case X86_64_INTEGER_CLASS: - case X86_64_INTEGERSI_CLASS: - ngpr++; - break; - case X86_64_SSE_CLASS: - case X86_64_SSESF_CLASS: - case X86_64_SSEDF_CLASS: - nsse++; - break; - case X86_64_NO_CLASS: - case X86_64_SSEUP_CLASS: - break; - case X86_64_X87_CLASS: - case X86_64_X87UP_CLASS: - case X86_64_COMPLEX_X87_CLASS: - return in_return != 0; - default: - abort (); - } - - *pngpr = ngpr; - *pnsse = nsse; - - return n; -} - -/* Perform machine dependent cif processing. */ - -#ifndef __ILP32__ -extern ffi_status -ffi_prep_cif_machdep_efi64(ffi_cif *cif); -#endif - -ffi_status FFI_HIDDEN -ffi_prep_cif_machdep (ffi_cif *cif) -{ - int gprcount, ssecount, i, avn, ngpr, nsse; - unsigned flags; - enum x86_64_reg_class classes[MAX_CLASSES]; - size_t bytes, n, rtype_size; - ffi_type *rtype; - -#ifndef __ILP32__ - if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) - return ffi_prep_cif_machdep_efi64(cif); -#endif - if (cif->abi != FFI_UNIX64) - return FFI_BAD_ABI; - - gprcount = ssecount = 0; - - rtype = cif->rtype; - rtype_size = rtype->size; - switch (rtype->type) - { - case FFI_TYPE_VOID: - flags = UNIX64_RET_VOID; - break; - case FFI_TYPE_UINT8: - flags = UNIX64_RET_UINT8; - break; - case FFI_TYPE_SINT8: - flags = UNIX64_RET_SINT8; - break; - case FFI_TYPE_UINT16: - flags = UNIX64_RET_UINT16; - break; - case FFI_TYPE_SINT16: - flags = UNIX64_RET_SINT16; - break; - case FFI_TYPE_UINT32: - flags = UNIX64_RET_UINT32; - break; - case FFI_TYPE_INT: - case FFI_TYPE_SINT32: - flags = UNIX64_RET_SINT32; - break; - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - flags = UNIX64_RET_INT64; - break; - case FFI_TYPE_POINTER: - flags = (sizeof(void *) == 4 ? UNIX64_RET_UINT32 : UNIX64_RET_INT64); - break; - case FFI_TYPE_FLOAT: - flags = UNIX64_RET_XMM32; - break; - case FFI_TYPE_DOUBLE: - flags = UNIX64_RET_XMM64; - break; -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - flags = UNIX64_RET_X87; - break; -#endif - case FFI_TYPE_STRUCT: - n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse); - if (n == 0) - { - /* The return value is passed in memory. A pointer to that - memory is the first argument. Allocate a register for it. */ - gprcount++; - /* We don't have to do anything in asm for the return. */ - flags = UNIX64_RET_VOID | UNIX64_FLAG_RET_IN_MEM; - } - else - { - _Bool sse0 = SSE_CLASS_P (classes[0]); - - if (rtype_size == 4 && sse0) - flags = UNIX64_RET_XMM32; - else if (rtype_size == 8) - flags = sse0 ? UNIX64_RET_XMM64 : UNIX64_RET_INT64; - else - { - _Bool sse1 = n == 2 && SSE_CLASS_P (classes[1]); - if (sse0 && sse1) - flags = UNIX64_RET_ST_XMM0_XMM1; - else if (sse0) - flags = UNIX64_RET_ST_XMM0_RAX; - else if (sse1) - flags = UNIX64_RET_ST_RAX_XMM0; - else - flags = UNIX64_RET_ST_RAX_RDX; - flags |= rtype_size << UNIX64_SIZE_SHIFT; - } - } - break; - case FFI_TYPE_COMPLEX: - switch (rtype->elements[0]->type) - { - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - flags = UNIX64_RET_ST_RAX_RDX | ((unsigned) rtype_size << UNIX64_SIZE_SHIFT); - break; - case FFI_TYPE_FLOAT: - flags = UNIX64_RET_XMM64; - break; - case FFI_TYPE_DOUBLE: - flags = UNIX64_RET_ST_XMM0_XMM1 | (16 << UNIX64_SIZE_SHIFT); - break; -#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - case FFI_TYPE_LONGDOUBLE: - flags = UNIX64_RET_X87_2; - break; -#endif - default: - return FFI_BAD_TYPEDEF; - } - break; - default: - return FFI_BAD_TYPEDEF; - } - - /* Go over all arguments and determine the way they should be passed. - If it's in a register and there is space for it, let that be so. If - not, add it's size to the stack byte count. */ - for (bytes = 0, i = 0, avn = cif->nargs; i < avn; i++) - { - if (examine_argument (cif->arg_types[i], classes, 0, &ngpr, &nsse) == 0 - || gprcount + ngpr > MAX_GPR_REGS - || ssecount + nsse > MAX_SSE_REGS) - { - long align = cif->arg_types[i]->alignment; - - if (align < 8) - align = 8; - - bytes = FFI_ALIGN (bytes, align); - bytes += cif->arg_types[i]->size; - } - else - { - gprcount += ngpr; - ssecount += nsse; - } - } - if (ssecount) - flags |= UNIX64_FLAG_XMM_ARGS; - - cif->flags = flags; - cif->bytes = (unsigned) FFI_ALIGN (bytes, 8); - - return FFI_OK; -} - -/* n.b. ffi_call_unix64 will steal the alloca'd `stack` variable here for use - _as its own stack_ - so we need to compile this function without ASAN */ -FFI_ASAN_NO_SANITIZE -static void -ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - enum x86_64_reg_class classes[MAX_CLASSES]; - char *stack, *argp; - ffi_type **arg_types; - int gprcount, ssecount, ngpr, nsse, i, avn, flags; - struct register_args *reg_args; - - /* Can't call 32-bit mode from 64-bit mode. */ - FFI_ASSERT (cif->abi == FFI_UNIX64); - - /* If the return value is a struct and we don't have a return value - address then we need to make one. Otherwise we can ignore it. */ - flags = cif->flags; - if (rvalue == NULL) - { - if (flags & UNIX64_FLAG_RET_IN_MEM) - rvalue = alloca (cif->rtype->size); - else - flags = UNIX64_RET_VOID; - } - - arg_types = cif->arg_types; - avn = cif->nargs; - - /* Allocate the space for the arguments, plus 4 words of temp space. */ - stack = alloca (sizeof (struct register_args) + cif->bytes + 4*8); - reg_args = (struct register_args *) stack; - argp = stack + sizeof (struct register_args); - - reg_args->r10 = (uintptr_t) closure; - - gprcount = ssecount = 0; - - /* If the return value is passed in memory, add the pointer as the - first integer argument. */ - if (flags & UNIX64_FLAG_RET_IN_MEM) - reg_args->gpr[gprcount++] = (unsigned long) rvalue; - - for (i = 0; i < avn; ++i) - { - size_t n, size = arg_types[i]->size; - - n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); - if (n == 0 - || gprcount + ngpr > MAX_GPR_REGS - || ssecount + nsse > MAX_SSE_REGS) - { - long align = arg_types[i]->alignment; - - /* Stack arguments are *always* at least 8 byte aligned. */ - if (align < 8) - align = 8; - - /* Pass this argument in memory. */ - argp = (void *) FFI_ALIGN (argp, align); - memcpy (argp, avalue[i], size); - - argp += size; - } - else - { - /* The argument is passed entirely in registers. */ - char *a = (char *) avalue[i]; - unsigned int j; - - for (j = 0; j < n; j++, a += 8, size -= 8) - { - switch (classes[j]) - { - case X86_64_NO_CLASS: - case X86_64_SSEUP_CLASS: - break; - case X86_64_INTEGER_CLASS: - case X86_64_INTEGERSI_CLASS: - /* Sign-extend integer arguments passed in general - purpose registers, to cope with the fact that - LLVM incorrectly assumes that this will be done - (the x86-64 PS ABI does not specify this). */ - switch (arg_types[i]->type) - { - case FFI_TYPE_SINT8: - reg_args->gpr[gprcount] = (SINT64) *((SINT8 *) a); - break; - case FFI_TYPE_SINT16: - reg_args->gpr[gprcount] = (SINT64) *((SINT16 *) a); - break; - case FFI_TYPE_SINT32: - reg_args->gpr[gprcount] = (SINT64) *((SINT32 *) a); - break; - default: - reg_args->gpr[gprcount] = 0; - memcpy (®_args->gpr[gprcount], a, size <= 8 ? size : 8); - } - gprcount++; - break; - case X86_64_SSE_CLASS: - case X86_64_SSEDF_CLASS: - memcpy (®_args->sse[ssecount++].i64, a, sizeof(UINT64)); - break; - case X86_64_SSESF_CLASS: - memcpy (®_args->sse[ssecount++].i32, a, sizeof(UINT32)); - break; - default: - abort(); - } - } - } - } - reg_args->rax = ssecount; - - ffi_call_unix64 (stack, cif->bytes + sizeof (struct register_args), - flags, rvalue, fn); -} - -#ifndef __ILP32__ -extern void -ffi_call_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue); -#endif - -void -ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - ffi_type **arg_types = cif->arg_types; - int i, nargs = cif->nargs; - const int max_reg_struct_size = cif->abi == FFI_GNUW64 ? 8 : 16; - - /* If we have any large structure arguments, make a copy so we are passing - by value. */ - for (i = 0; i < nargs; i++) - { - ffi_type *at = arg_types[i]; - int size = at->size; - if (at->type == FFI_TYPE_STRUCT && size > max_reg_struct_size) - { - char *argcopy = alloca (size); - memcpy (argcopy, avalue[i], size); - avalue[i] = argcopy; - } - } - -#ifndef __ILP32__ - if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) - { - ffi_call_efi64(cif, fn, rvalue, avalue); - return; - } -#endif - ffi_call_int (cif, fn, rvalue, avalue, NULL); -} - -#ifdef FFI_GO_CLOSURES - -#ifndef __ILP32__ -extern void -ffi_call_go_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure); -#endif - -void -ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ -#ifndef __ILP32__ - if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) - { - ffi_call_go_efi64(cif, fn, rvalue, avalue, closure); - return; - } -#endif - ffi_call_int (cif, fn, rvalue, avalue, closure); -} - -#endif /* FFI_GO_CLOSURES */ - -extern void ffi_closure_unix64(void) FFI_HIDDEN; -extern void ffi_closure_unix64_sse(void) FFI_HIDDEN; -#if defined(FFI_EXEC_STATIC_TRAMP) -extern void ffi_closure_unix64_alt(void) FFI_HIDDEN; -extern void ffi_closure_unix64_sse_alt(void) FFI_HIDDEN; -#endif - -#ifndef __ILP32__ -extern ffi_status -ffi_prep_closure_loc_efi64(ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc); -#endif - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - static const unsigned char trampoline[24] = { - /* endbr64 */ - 0xf3, 0x0f, 0x1e, 0xfa, - /* leaq -0xb(%rip),%r10 # 0x0 */ - 0x4c, 0x8d, 0x15, 0xf5, 0xff, 0xff, 0xff, - /* jmpq *0x7(%rip) # 0x18 */ - 0xff, 0x25, 0x07, 0x00, 0x00, 0x00, - /* nopl 0(%rax) */ - 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 - }; - void (*dest)(void); - char *tramp = closure->tramp; - -#ifndef __ILP32__ - if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) - return ffi_prep_closure_loc_efi64(closure, cif, fun, user_data, codeloc); -#endif - if (cif->abi != FFI_UNIX64) - return FFI_BAD_ABI; - - if (cif->flags & UNIX64_FLAG_XMM_ARGS) - dest = ffi_closure_unix64_sse; - else - dest = ffi_closure_unix64; - -#if defined(FFI_EXEC_STATIC_TRAMP) - if (ffi_tramp_is_present(closure)) - { - /* Initialize the static trampoline's parameters. */ - if (dest == ffi_closure_unix64_sse) - dest = ffi_closure_unix64_sse_alt; - else - dest = ffi_closure_unix64_alt; - ffi_tramp_set_parms (closure->ftramp, dest, closure); - goto out; - } -#endif - - /* Initialize the dynamic trampoline. */ - memcpy (tramp, trampoline, sizeof(trampoline)); - *(UINT64 *)(tramp + sizeof (trampoline)) = (uintptr_t)dest; - -#if defined(FFI_EXEC_STATIC_TRAMP) -out: -#endif - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - -int FFI_HIDDEN -ffi_closure_unix64_inner(ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *rvalue, - struct register_args *reg_args, - char *argp) -{ - void **avalue; - ffi_type **arg_types; - long i, avn; - int gprcount, ssecount, ngpr, nsse; - int flags; - - avn = cif->nargs; - flags = cif->flags; - avalue = alloca(avn * sizeof(void *)); - gprcount = ssecount = 0; - - if (flags & UNIX64_FLAG_RET_IN_MEM) - { - /* On return, %rax will contain the address that was passed - by the caller in %rdi. */ - void *r = (void *)(uintptr_t)reg_args->gpr[gprcount++]; - *(void **)rvalue = r; - rvalue = r; - flags = (sizeof(void *) == 4 ? UNIX64_RET_UINT32 : UNIX64_RET_INT64); - } - - arg_types = cif->arg_types; - for (i = 0; i < avn; ++i) - { - enum x86_64_reg_class classes[MAX_CLASSES]; - size_t n; - - n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); - if (n == 0 - || gprcount + ngpr > MAX_GPR_REGS - || ssecount + nsse > MAX_SSE_REGS) - { - long align = arg_types[i]->alignment; - - /* Stack arguments are *always* at least 8 byte aligned. */ - if (align < 8) - align = 8; - - /* Pass this argument in memory. */ - argp = (void *) FFI_ALIGN (argp, align); - avalue[i] = argp; - argp += arg_types[i]->size; - } - /* If the argument is in a single register, or two consecutive - integer registers, then we can use that address directly. */ - else if (n == 1 - || (n == 2 && !(SSE_CLASS_P (classes[0]) - || SSE_CLASS_P (classes[1])))) - { - /* The argument is in a single register. */ - if (SSE_CLASS_P (classes[0])) - { - avalue[i] = ®_args->sse[ssecount]; - ssecount += n; - } - else - { - avalue[i] = ®_args->gpr[gprcount]; - gprcount += n; - } - } - /* Otherwise, allocate space to make them consecutive. */ - else - { - char *a = alloca (16); - unsigned int j; - - avalue[i] = a; - for (j = 0; j < n; j++, a += 8) - { - if (SSE_CLASS_P (classes[j])) - memcpy (a, ®_args->sse[ssecount++], 8); - else - memcpy (a, ®_args->gpr[gprcount++], 8); - } - } - } - - /* Invoke the closure. */ - fun (cif, rvalue, avalue, user_data); - - /* Tell assembly how to perform return type promotions. */ - return flags; -} - -#ifdef FFI_GO_CLOSURES - -extern void ffi_go_closure_unix64(void) FFI_HIDDEN; -extern void ffi_go_closure_unix64_sse(void) FFI_HIDDEN; - -#ifndef __ILP32__ -extern ffi_status -ffi_prep_go_closure_efi64(ffi_go_closure* closure, ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*)); -#endif - -ffi_status -ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*)) -{ -#ifndef __ILP32__ - if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) - return ffi_prep_go_closure_efi64(closure, cif, fun); -#endif - if (cif->abi != FFI_UNIX64) - return FFI_BAD_ABI; - - closure->tramp = (cif->flags & UNIX64_FLAG_XMM_ARGS - ? ffi_go_closure_unix64_sse - : ffi_go_closure_unix64); - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} - -#endif /* FFI_GO_CLOSURES */ - -#if defined(FFI_EXEC_STATIC_TRAMP) -void * -ffi_tramp_arch (size_t *tramp_size, size_t *map_size) -{ - extern void *trampoline_code_table; - - *map_size = UNIX64_TRAMP_MAP_SIZE; - *tramp_size = UNIX64_TRAMP_SIZE; - return &trampoline_code_table; -} -#endif - -#endif /* __x86_64__ */ diff --git a/deps/libffi/src/x86/ffitarget.h b/deps/libffi/src/x86/ffitarget.h deleted file mode 100644 index 5a3399d80982b1..00000000000000 --- a/deps/libffi/src/x86/ffitarget.h +++ /dev/null @@ -1,164 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012, 2014, 2018 Anthony Green - Copyright (c) 1996-2003, 2010 Red Hat, Inc. - Copyright (C) 2008 Free Software Foundation, Inc. - - Target configuration macros for x86 and x86-64. - - 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. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- System specific configurations ----------------------------------- */ - -/* For code common to all platforms on x86 and x86_64. */ -#define X86_ANY - -#if defined (X86_64) && defined (__i386__) -#undef X86_64 -#warning ****************************************************** -#warning ********** X86 IS DEFINED **************************** -#warning ****************************************************** -#define X86 -#endif - -#ifdef X86_WIN64 -#define FFI_SIZEOF_ARG 8 -#define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */ -#endif - -#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION -#ifndef _MSC_VER -#define FFI_TARGET_HAS_COMPLEX_TYPE -#endif - -/* ---- Generic type definitions ----------------------------------------- */ - -#ifndef LIBFFI_ASM -#ifdef X86_WIN64 -#ifdef _MSC_VER -typedef unsigned __int64 ffi_arg; -typedef __int64 ffi_sarg; -#else -typedef unsigned long long ffi_arg; -typedef long long ffi_sarg; -#endif -#else -#if defined __x86_64__ && defined __ILP32__ -#define FFI_SIZEOF_ARG 8 -#define FFI_SIZEOF_JAVA_RAW 4 -typedef unsigned long long ffi_arg; -typedef long long ffi_sarg; -#else -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; -#endif -#endif - -typedef enum ffi_abi { -#if defined(X86_WIN64) - FFI_FIRST_ABI = 0, - FFI_WIN64, /* sizeof(long double) == 8 - microsoft compilers */ - FFI_GNUW64, /* sizeof(long double) == 16 - GNU compilers */ - FFI_LAST_ABI, -#ifdef __GNUC__ - FFI_DEFAULT_ABI = FFI_GNUW64 -#else - FFI_DEFAULT_ABI = FFI_WIN64 -#endif - -#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN)) - FFI_FIRST_ABI = 1, - FFI_UNIX64, - FFI_WIN64, - FFI_EFI64 = FFI_WIN64, - FFI_GNUW64, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_UNIX64 - -#elif defined(X86_WIN32) - FFI_FIRST_ABI = 0, - FFI_SYSV = 1, - FFI_STDCALL = 2, - FFI_THISCALL = 3, - FFI_FASTCALL = 4, - FFI_MS_CDECL = 5, - FFI_PASCAL = 6, - FFI_REGISTER = 7, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_MS_CDECL -#else - FFI_FIRST_ABI = 0, - FFI_SYSV = 1, - FFI_THISCALL = 3, - FFI_FASTCALL = 4, - FFI_STDCALL = 5, - FFI_PASCAL = 6, - FFI_REGISTER = 7, - FFI_MS_CDECL = 8, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -#endif -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 - -#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1) -#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2) -#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3) -#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4) - -#if defined (X86_64) || defined(X86_WIN64) \ - || (defined (__x86_64__) && defined (X86_DARWIN)) -/* 4 bytes of ENDBR64 + 7 bytes of LEA + 6 bytes of JMP + 7 bytes of NOP - + 8 bytes of pointer. */ -# define FFI_TRAMPOLINE_SIZE 32 -# define FFI_NATIVE_RAW_API 0 -#else -/* 4 bytes of ENDBR32 + 5 bytes of MOV + 5 bytes of JMP + 2 unused - bytes. */ -# define FFI_TRAMPOLINE_SIZE 16 -# define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */ -#endif - -#if !defined(GENERATE_LIBFFI_MAP) && defined(__CET__) -# include -# if (__CET__ & 1) != 0 -# define ENDBR_PRESENT -# endif -# define _CET_NOTRACK notrack -#else -# define _CET_ENDBR -# define _CET_NOTRACK -#endif - -#endif diff --git a/deps/libffi/src/x86/ffiw64.c b/deps/libffi/src/x86/ffiw64.c deleted file mode 100644 index 2be8b99279ab8e..00000000000000 --- a/deps/libffi/src/x86/ffiw64.c +++ /dev/null @@ -1,361 +0,0 @@ -/* ----------------------------------------------------------------------- - ffiw64.c - Copyright (c) 2018 Anthony Green - Copyright (c) 2014 Red Hat, Inc. - - x86 win64 Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#if defined(__x86_64__) || defined(_M_AMD64) -#include -#include -#include -#include -#include - -#ifdef X86_WIN64 -#define EFI64(name) name -#else -#define EFI64(name) FFI_HIDDEN name##_efi64 -#endif - -struct win64_call_frame -{ - UINT64 rbp; /* 0 */ - UINT64 retaddr; /* 8 */ - UINT64 fn; /* 16 */ - UINT64 flags; /* 24 */ - UINT64 rvalue; /* 32 */ -}; - -extern void ffi_call_win64 (void *stack, struct win64_call_frame *, - void *closure) FFI_HIDDEN; - -ffi_status FFI_HIDDEN -EFI64(ffi_prep_cif_machdep)(ffi_cif *cif) -{ - int flags, n; - - switch (cif->abi) - { - case FFI_WIN64: - case FFI_GNUW64: - break; - default: - return FFI_BAD_ABI; - } - - flags = cif->rtype->type; - switch (flags) - { - default: - break; - case FFI_TYPE_LONGDOUBLE: - /* GCC returns long double values by reference, like a struct */ - if (cif->abi == FFI_GNUW64) - flags = FFI_TYPE_STRUCT; - break; - case FFI_TYPE_COMPLEX: - flags = FFI_TYPE_STRUCT; - /* FALLTHRU */ - case FFI_TYPE_STRUCT: - switch (cif->rtype->size) - { - case 8: - flags = FFI_TYPE_UINT64; - break; - case 4: - flags = FFI_TYPE_SMALL_STRUCT_4B; - break; - case 2: - flags = FFI_TYPE_SMALL_STRUCT_2B; - break; - case 1: - flags = FFI_TYPE_SMALL_STRUCT_1B; - break; - } - break; - } - cif->flags = flags; - - /* Each argument either fits in a register, an 8 byte slot, or is - passed by reference with the pointer in the 8 byte slot. */ - n = cif->nargs; - n += (flags == FFI_TYPE_STRUCT); - if (n < 4) - n = 4; - cif->bytes = n * 8; - - return FFI_OK; -} - -/* We perform some black magic here to use some of the parent's stack frame in - * ffi_call_win64() that breaks with the MSVC compiler with the /RTCs or /GZ - * flags. Disable the 'Stack frame run time error checking' for this function - * so we don't hit weird exceptions in debug builds. */ -#if defined(_MSC_VER) -#pragma runtime_checks("s", off) -#endif -static void -ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - int i, j, n, flags; - UINT64 *stack; - size_t rsize; - struct win64_call_frame *frame; - ffi_type **arg_types = cif->arg_types; - int nargs = cif->nargs; - - FFI_ASSERT(cif->abi == FFI_GNUW64 || cif->abi == FFI_WIN64); - - /* If we have any large structure arguments, make a copy so we are passing - by value. */ - for (i = 0; i < nargs; i++) - { - ffi_type *at = arg_types[i]; - int size = at->size; - if (at->type == FFI_TYPE_STRUCT && size > 8) - { - char *argcopy = alloca (size); - memcpy (argcopy, avalue[i], size); - avalue[i] = argcopy; - } - } - - flags = cif->flags; - rsize = 0; - - /* If we have no return value for a structure, we need to create one. - Otherwise we can ignore the return type entirely. */ - if (rvalue == NULL) - { - if (flags == FFI_TYPE_STRUCT) - rsize = cif->rtype->size; - else - flags = FFI_TYPE_VOID; - } - - stack = alloca(cif->bytes + sizeof(struct win64_call_frame) + rsize); - frame = (struct win64_call_frame *)((char *)stack + cif->bytes); - if (rsize) - rvalue = frame + 1; - - frame->fn = (uintptr_t)fn; - frame->flags = flags; - frame->rvalue = (uintptr_t)rvalue; - - j = 0; - if (flags == FFI_TYPE_STRUCT) - { - stack[0] = (uintptr_t)rvalue; - j = 1; - } - - for (i = 0, n = cif->nargs; i < n; ++i, ++j) - { - switch (cif->arg_types[i]->size) - { - case 8: - stack[j] = *(UINT64 *)avalue[i]; - break; - case 4: - stack[j] = *(UINT32 *)avalue[i]; - break; - case 2: - stack[j] = *(UINT16 *)avalue[i]; - break; - case 1: - stack[j] = *(UINT8 *)avalue[i]; - break; - default: - stack[j] = (uintptr_t)avalue[i]; - break; - } - } - - ffi_call_win64 (stack, frame, closure); -} -#if defined(_MSC_VER) -#pragma runtime_checks("s", restore) -#endif - -void -EFI64(ffi_call)(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) -{ - ffi_call_int (cif, fn, rvalue, avalue, NULL); -} - -void -EFI64(ffi_call_go)(ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure) -{ - ffi_call_int (cif, fn, rvalue, avalue, closure); -} - - -extern void ffi_closure_win64(void) FFI_HIDDEN; -#if defined(FFI_EXEC_STATIC_TRAMP) -extern void ffi_closure_win64_alt(void) FFI_HIDDEN; -#endif - -#ifdef FFI_GO_CLOSURES -extern void ffi_go_closure_win64(void) FFI_HIDDEN; -#endif - -ffi_status -EFI64(ffi_prep_closure_loc)(ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc MAYBE_UNUSED) -{ - static const unsigned char trampoline[FFI_TRAMPOLINE_SIZE - 8] = { - /* endbr64 */ - 0xf3, 0x0f, 0x1e, 0xfa, - /* leaq -0xb(%rip),%r10 # 0x0 */ - 0x4c, 0x8d, 0x15, 0xf5, 0xff, 0xff, 0xff, - /* jmpq *0x7(%rip) # 0x18 */ - 0xff, 0x25, 0x07, 0x00, 0x00, 0x00, - /* nopl 0(%rax) */ - 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 - }; - char *tramp = closure->tramp; - - switch (cif->abi) - { - case FFI_WIN64: - case FFI_GNUW64: - break; - default: - return FFI_BAD_ABI; - } - -#if defined(FFI_EXEC_STATIC_TRAMP) - if (ffi_tramp_is_present(closure)) - { - /* Initialize the static trampoline's parameters. */ - ffi_tramp_set_parms (closure->ftramp, ffi_closure_win64_alt, closure); - goto out; - } -#endif - - /* Initialize the dynamic trampoline. */ - memcpy (tramp, trampoline, sizeof(trampoline)); - *(UINT64 *)(tramp + sizeof (trampoline)) = (uintptr_t)ffi_closure_win64; - -#if defined(FFI_EXEC_STATIC_TRAMP) -out: -#endif - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - - return FFI_OK; -} - -#ifdef FFI_GO_CLOSURES -ffi_status -EFI64(ffi_prep_go_closure)(ffi_go_closure* closure, ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*)) -{ - switch (cif->abi) - { - case FFI_WIN64: - case FFI_GNUW64: - break; - default: - return FFI_BAD_ABI; - } - - closure->tramp = ffi_go_closure_win64; - closure->cif = cif; - closure->fun = fun; - - return FFI_OK; -} -#endif - -struct win64_closure_frame -{ - UINT64 rvalue[2]; - UINT64 fargs[4]; - UINT64 retaddr; - UINT64 args[]; -}; - -/* Force the inner function to use the MS ABI. When compiling on win64 - this is a nop. When compiling on unix, this simplifies the assembly, - and places the burden of saving the extra call-saved registers on - the compiler. */ -int FFI_HIDDEN __attribute__((ms_abi)) -ffi_closure_win64_inner(ffi_cif *cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - struct win64_closure_frame *frame) -{ - void **avalue; - void *rvalue; - int i, n, nreg, flags; - - avalue = alloca(cif->nargs * sizeof(void *)); - rvalue = frame->rvalue; - nreg = 0; - - /* When returning a structure, the address is in the first argument. - We must also be prepared to return the same address in eax, so - install that address in the frame and pretend we return a pointer. */ - flags = cif->flags; - if (flags == FFI_TYPE_STRUCT) - { - rvalue = (void *)(uintptr_t)frame->args[0]; - frame->rvalue[0] = frame->args[0]; - nreg = 1; - } - - for (i = 0, n = cif->nargs; i < n; ++i, ++nreg) - { - size_t size = cif->arg_types[i]->size; - size_t type = cif->arg_types[i]->type; - void *a; - - if (type == FFI_TYPE_DOUBLE || type == FFI_TYPE_FLOAT) - { - if (nreg < 4) - a = &frame->fargs[nreg]; - else - a = &frame->args[nreg]; - } - else if (size == 1 || size == 2 || size == 4 || size == 8) - a = &frame->args[nreg]; - else - a = (void *)(uintptr_t)frame->args[nreg]; - - avalue[i] = a; - } - - /* Invoke the closure. */ - fun (cif, rvalue, avalue, user_data); - return flags; -} - -#endif /* __x86_64__ */ diff --git a/deps/libffi/src/x86/internal.h b/deps/libffi/src/x86/internal.h deleted file mode 100644 index 23be7a2232692d..00000000000000 --- a/deps/libffi/src/x86/internal.h +++ /dev/null @@ -1,43 +0,0 @@ -#define X86_RET_FLOAT 0 -#define X86_RET_DOUBLE 1 -#define X86_RET_LDOUBLE 2 -#define X86_RET_SINT8 3 -#define X86_RET_SINT16 4 -#define X86_RET_UINT8 5 -#define X86_RET_UINT16 6 -#define X86_RET_INT64 7 -#define X86_RET_INT32 8 -#define X86_RET_VOID 9 -#define X86_RET_STRUCTPOP 10 -#define X86_RET_STRUCTARG 11 -#define X86_RET_STRUCT_1B 12 -#define X86_RET_STRUCT_2B 13 -#define X86_RET_UNUSED14 14 -#define X86_RET_UNUSED15 15 - -#define X86_RET_TYPE_MASK 15 -#define X86_RET_POP_SHIFT 4 - -#define R_EAX 0 -#define R_EDX 1 -#define R_ECX 2 - -#ifdef __PCC__ -# define HAVE_FASTCALL 0 -#else -# define HAVE_FASTCALL 1 -#endif - -#if defined(FFI_EXEC_STATIC_TRAMP) -/* - * For the trampoline code table mapping, a mapping size of 4K (base page size) - * is chosen. - */ -#define X86_TRAMP_MAP_SHIFT 12 -#define X86_TRAMP_MAP_SIZE (1 << X86_TRAMP_MAP_SHIFT) -#ifdef ENDBR_PRESENT -#define X86_TRAMP_SIZE 44 -#else -#define X86_TRAMP_SIZE 40 -#endif -#endif diff --git a/deps/libffi/src/x86/internal64.h b/deps/libffi/src/x86/internal64.h deleted file mode 100644 index 282b408027444e..00000000000000 --- a/deps/libffi/src/x86/internal64.h +++ /dev/null @@ -1,36 +0,0 @@ -#define UNIX64_RET_VOID 0 -#define UNIX64_RET_UINT8 1 -#define UNIX64_RET_UINT16 2 -#define UNIX64_RET_UINT32 3 -#define UNIX64_RET_SINT8 4 -#define UNIX64_RET_SINT16 5 -#define UNIX64_RET_SINT32 6 -#define UNIX64_RET_INT64 7 -#define UNIX64_RET_XMM32 8 -#define UNIX64_RET_XMM64 9 -#define UNIX64_RET_X87 10 -#define UNIX64_RET_X87_2 11 -#define UNIX64_RET_ST_XMM0_RAX 12 -#define UNIX64_RET_ST_RAX_XMM0 13 -#define UNIX64_RET_ST_XMM0_XMM1 14 -#define UNIX64_RET_ST_RAX_RDX 15 - -#define UNIX64_RET_LAST 15 - -#define UNIX64_FLAG_RET_IN_MEM (1 << 10) -#define UNIX64_FLAG_XMM_ARGS (1 << 11) -#define UNIX64_SIZE_SHIFT 12 - -#if defined(FFI_EXEC_STATIC_TRAMP) -/* - * For the trampoline code table mapping, a mapping size of 4K (base page size) - * is chosen. - */ -#define UNIX64_TRAMP_MAP_SHIFT 12 -#define UNIX64_TRAMP_MAP_SIZE (1 << UNIX64_TRAMP_MAP_SHIFT) -#ifdef ENDBR_PRESENT -#define UNIX64_TRAMP_SIZE 40 -#else -#define UNIX64_TRAMP_SIZE 32 -#endif -#endif diff --git a/deps/libffi/src/x86/sysv.S b/deps/libffi/src/x86/sysv.S deleted file mode 100644 index c7a0fb51b48cd9..00000000000000 --- a/deps/libffi/src/x86/sysv.S +++ /dev/null @@ -1,1272 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2017 Anthony Green - - Copyright (c) 2013 The Written Word, Inc. - - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc. - - X86 Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#ifdef __i386__ -#ifndef _MSC_VER - -#define LIBFFI_ASM -#include -#include -#include "internal.h" - -#define C2(X, Y) X ## Y -#define C1(X, Y) C2(X, Y) -#ifdef __USER_LABEL_PREFIX__ -# define C(X) C1(__USER_LABEL_PREFIX__, X) -#else -# define C(X) X -#endif - -#ifdef X86_DARWIN -# define L(X) C1(L, X) -#else -# define L(X) C1(.L, X) -#endif - -#ifdef __ELF__ -# define ENDF(X) .type X,@function; .size X, . - X -#else -# define ENDF(X) -#endif - -/* Handle win32 fastcall name mangling. */ -#ifdef X86_WIN32 -# define ffi_call_i386 "@ffi_call_i386@8" -# define ffi_closure_inner "@ffi_closure_inner@8" -#else -# define ffi_call_i386 C(ffi_call_i386) -# define ffi_closure_inner C(ffi_closure_inner) -#endif - -/* This macro allows the safe creation of jump tables without an - actual table. The entry points into the table are all 8 bytes. - The use of ORG asserts that we're at the correct location. */ -/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ -#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) -# define E(BASE, X) .balign 8 -#else -# define E(BASE, X) .balign 8; .org BASE + X * 8 -#endif - - .text - .balign 16 - .globl ffi_call_i386 - FFI_HIDDEN(ffi_call_i386) - -/* This is declared as - - void ffi_call_i386(struct call_frame *frame, char *argp) - __attribute__((fastcall)); - - Thus the arguments are present in - - ecx: frame - edx: argp -*/ - -ffi_call_i386: -L(UW0): - # cfi_startproc - _CET_ENDBR -#if !HAVE_FASTCALL - movl 4(%esp), %ecx - movl 8(%esp), %edx -#endif - movl (%esp), %eax /* move the return address */ - movl %ebp, (%ecx) /* store %ebp into local frame */ - movl %eax, 4(%ecx) /* store retaddr into local frame */ - - /* New stack frame based off ebp. This is a itty bit of unwind - trickery in that the CFA *has* changed. There is no easy way - to describe it correctly on entry to the function. Fortunately, - it doesn't matter too much since at all points we can correctly - unwind back to ffi_call. Note that the location to which we - moved the return address is (the new) CFA-4, so from the - perspective of the unwind info, it hasn't moved. */ - movl %ecx, %ebp -L(UW1): - # cfi_def_cfa(%ebp, 8) - # cfi_rel_offset(%ebp, 0) - - movl %edx, %esp /* set outgoing argument stack */ - movl 20+R_EAX*4(%ebp), %eax /* set register arguments */ - movl 20+R_EDX*4(%ebp), %edx - movl 20+R_ECX*4(%ebp), %ecx - - call *8(%ebp) - - movl 12(%ebp), %ecx /* load return type code */ - movl %ebx, 8(%ebp) /* preserve %ebx */ -L(UW2): - # cfi_rel_offset(%ebx, 8) - - andl $X86_RET_TYPE_MASK, %ecx -#ifdef __PIC__ - call C(__x86.get_pc_thunk.bx) -L(pc1): - leal L(store_table)-L(pc1)(%ebx, %ecx, 8), %ebx -#else - leal L(store_table)(,%ecx, 8), %ebx -#endif - movl 16(%ebp), %ecx /* load result address */ - _CET_NOTRACK jmp *%ebx - - .balign 8 -L(store_table): -E(L(store_table), X86_RET_FLOAT) - fstps (%ecx) - jmp L(e1) -E(L(store_table), X86_RET_DOUBLE) - fstpl (%ecx) - jmp L(e1) -E(L(store_table), X86_RET_LDOUBLE) - fstpt (%ecx) - jmp L(e1) -E(L(store_table), X86_RET_SINT8) - movsbl %al, %eax - mov %eax, (%ecx) - jmp L(e1) -E(L(store_table), X86_RET_SINT16) - movswl %ax, %eax - mov %eax, (%ecx) - jmp L(e1) -E(L(store_table), X86_RET_UINT8) - movzbl %al, %eax - mov %eax, (%ecx) - jmp L(e1) -E(L(store_table), X86_RET_UINT16) - movzwl %ax, %eax - mov %eax, (%ecx) - jmp L(e1) -E(L(store_table), X86_RET_INT64) - movl %edx, 4(%ecx) - /* fallthru */ -E(L(store_table), X86_RET_INT32) - movl %eax, (%ecx) - /* fallthru */ -E(L(store_table), X86_RET_VOID) -L(e1): - movl 8(%ebp), %ebx - movl %ebp, %esp - popl %ebp -L(UW3): - # cfi_remember_state - # cfi_def_cfa(%esp, 4) - # cfi_restore(%ebx) - # cfi_restore(%ebp) - ret -L(UW4): - # cfi_restore_state - -E(L(store_table), X86_RET_STRUCTPOP) - jmp L(e1) -E(L(store_table), X86_RET_STRUCTARG) - jmp L(e1) -E(L(store_table), X86_RET_STRUCT_1B) - movb %al, (%ecx) - jmp L(e1) -E(L(store_table), X86_RET_STRUCT_2B) - movw %ax, (%ecx) - jmp L(e1) - - /* Fill out the table so that bad values are predictable. */ -E(L(store_table), X86_RET_UNUSED14) - ud2 -E(L(store_table), X86_RET_UNUSED15) - ud2 - -L(UW5): - # cfi_endproc -ENDF(ffi_call_i386) - -/* The inner helper is declared as - - void ffi_closure_inner(struct closure_frame *frame, char *argp) - __attribute_((fastcall)) - - Thus the arguments are placed in - - ecx: frame - edx: argp -*/ - -/* Macros to help setting up the closure_data structure. */ - -#if HAVE_FASTCALL -# define closure_FS (40 + 4) -# define closure_CF 0 -#else -# define closure_FS (8 + 40 + 12) -# define closure_CF 8 -#endif - -#define FFI_CLOSURE_SAVE_REGS \ - movl %eax, closure_CF+16+R_EAX*4(%esp); \ - movl %edx, closure_CF+16+R_EDX*4(%esp); \ - movl %ecx, closure_CF+16+R_ECX*4(%esp) - -#define FFI_CLOSURE_COPY_TRAMP_DATA \ - movl FFI_TRAMPOLINE_SIZE(%eax), %edx; /* copy cif */ \ - movl FFI_TRAMPOLINE_SIZE+4(%eax), %ecx; /* copy fun */ \ - movl FFI_TRAMPOLINE_SIZE+8(%eax), %eax; /* copy user_data */ \ - movl %edx, closure_CF+28(%esp); \ - movl %ecx, closure_CF+32(%esp); \ - movl %eax, closure_CF+36(%esp) - -#if HAVE_FASTCALL -# define FFI_CLOSURE_PREP_CALL \ - movl %esp, %ecx; /* load closure_data */ \ - leal closure_FS+4(%esp), %edx; /* load incoming stack */ -#else -# define FFI_CLOSURE_PREP_CALL \ - leal closure_CF(%esp), %ecx; /* load closure_data */ \ - leal closure_FS+4(%esp), %edx; /* load incoming stack */ \ - movl %ecx, (%esp); \ - movl %edx, 4(%esp) -#endif - -#define FFI_CLOSURE_CALL_INNER(UWN) \ - call ffi_closure_inner - -#define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \ - andl $X86_RET_TYPE_MASK, %eax; \ - leal L(C1(load_table,N))(, %eax, 8), %edx; \ - movl closure_CF(%esp), %eax; /* optimiztic load */ \ - _CET_NOTRACK jmp *%edx - -#ifdef __PIC__ -# if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE -# undef FFI_CLOSURE_MASK_AND_JUMP -# define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \ - andl $X86_RET_TYPE_MASK, %eax; \ - call C(__x86.get_pc_thunk.dx); \ -L(C1(pc,N)): \ - leal L(C1(load_table,N))-L(C1(pc,N))(%edx, %eax, 8), %edx; \ - movl closure_CF(%esp), %eax; /* optimiztic load */ \ - _CET_NOTRACK jmp *%edx -# else -# define FFI_CLOSURE_CALL_INNER_SAVE_EBX -# undef FFI_CLOSURE_CALL_INNER -# define FFI_CLOSURE_CALL_INNER(UWN) \ - movl %ebx, 40(%esp); /* save ebx */ \ -L(C1(UW,UWN)): \ - /* cfi_rel_offset(%ebx, 40); */ \ - call C(__x86.get_pc_thunk.bx); /* load got register */ \ - addl $C(_GLOBAL_OFFSET_TABLE_), %ebx; \ - call ffi_closure_inner@PLT -# undef FFI_CLOSURE_MASK_AND_JUMP -# define FFI_CLOSURE_MASK_AND_JUMP(N, UWN) \ - andl $X86_RET_TYPE_MASK, %eax; \ - leal L(C1(load_table,N))@GOTOFF(%ebx, %eax, 8), %edx; \ - movl 40(%esp), %ebx; /* restore ebx */ \ -L(C1(UW,UWN)): \ - /* cfi_restore(%ebx); */ \ - movl closure_CF(%esp), %eax; /* optimiztic load */ \ - _CET_NOTRACK jmp *%edx -# endif /* DARWIN || HIDDEN */ -#endif /* __PIC__ */ - - .balign 16 - .globl C(ffi_go_closure_EAX) - FFI_HIDDEN(C(ffi_go_closure_EAX)) -C(ffi_go_closure_EAX): -L(UW6): - # cfi_startproc - _CET_ENDBR - subl $closure_FS, %esp -L(UW7): - # cfi_def_cfa_offset(closure_FS + 4) - FFI_CLOSURE_SAVE_REGS - movl 4(%eax), %edx /* copy cif */ - movl 8(%eax), %ecx /* copy fun */ - movl %edx, closure_CF+28(%esp) - movl %ecx, closure_CF+32(%esp) - movl %eax, closure_CF+36(%esp) /* closure is user_data */ - jmp L(do_closure_i386) -L(UW8): - # cfi_endproc -ENDF(C(ffi_go_closure_EAX)) - - .balign 16 - .globl C(ffi_go_closure_ECX) - FFI_HIDDEN(C(ffi_go_closure_ECX)) -C(ffi_go_closure_ECX): -L(UW9): - # cfi_startproc - _CET_ENDBR - subl $closure_FS, %esp -L(UW10): - # cfi_def_cfa_offset(closure_FS + 4) - FFI_CLOSURE_SAVE_REGS - movl 4(%ecx), %edx /* copy cif */ - movl 8(%ecx), %eax /* copy fun */ - movl %edx, closure_CF+28(%esp) - movl %eax, closure_CF+32(%esp) - movl %ecx, closure_CF+36(%esp) /* closure is user_data */ - jmp L(do_closure_i386) -L(UW11): - # cfi_endproc -ENDF(C(ffi_go_closure_ECX)) - -/* The closure entry points are reached from the ffi_closure trampoline. - On entry, %eax contains the address of the ffi_closure. */ - - .balign 16 - .globl C(ffi_closure_i386) - FFI_HIDDEN(C(ffi_closure_i386)) - -C(ffi_closure_i386): -L(UW12): - # cfi_startproc - _CET_ENDBR - subl $closure_FS, %esp -L(UW13): - # cfi_def_cfa_offset(closure_FS + 4) - - FFI_CLOSURE_SAVE_REGS - FFI_CLOSURE_COPY_TRAMP_DATA - - /* Entry point from preceeding Go closures. */ -L(do_closure_i386): - - FFI_CLOSURE_PREP_CALL - FFI_CLOSURE_CALL_INNER(14) - FFI_CLOSURE_MASK_AND_JUMP(2, 15) - - .balign 8 -L(load_table2): -E(L(load_table2), X86_RET_FLOAT) - flds closure_CF(%esp) - jmp L(e2) -E(L(load_table2), X86_RET_DOUBLE) - fldl closure_CF(%esp) - jmp L(e2) -E(L(load_table2), X86_RET_LDOUBLE) - fldt closure_CF(%esp) - jmp L(e2) -E(L(load_table2), X86_RET_SINT8) - movsbl %al, %eax - jmp L(e2) -E(L(load_table2), X86_RET_SINT16) - movswl %ax, %eax - jmp L(e2) -E(L(load_table2), X86_RET_UINT8) - movzbl %al, %eax - jmp L(e2) -E(L(load_table2), X86_RET_UINT16) - movzwl %ax, %eax - jmp L(e2) -E(L(load_table2), X86_RET_INT64) - movl closure_CF+4(%esp), %edx - jmp L(e2) -E(L(load_table2), X86_RET_INT32) - nop - /* fallthru */ -E(L(load_table2), X86_RET_VOID) -L(e2): - addl $closure_FS, %esp -L(UW16): - # cfi_adjust_cfa_offset(-closure_FS) - ret -L(UW17): - # cfi_adjust_cfa_offset(closure_FS) -E(L(load_table2), X86_RET_STRUCTPOP) - addl $closure_FS, %esp -L(UW18): - # cfi_adjust_cfa_offset(-closure_FS) - ret $4 -L(UW19): - # cfi_adjust_cfa_offset(closure_FS) -E(L(load_table2), X86_RET_STRUCTARG) - jmp L(e2) -E(L(load_table2), X86_RET_STRUCT_1B) - movzbl %al, %eax - jmp L(e2) -E(L(load_table2), X86_RET_STRUCT_2B) - movzwl %ax, %eax - jmp L(e2) - - /* Fill out the table so that bad values are predictable. */ -E(L(load_table2), X86_RET_UNUSED14) - ud2 -E(L(load_table2), X86_RET_UNUSED15) - ud2 - -L(UW20): - # cfi_endproc -ENDF(C(ffi_closure_i386)) - - .balign 16 - .globl C(ffi_go_closure_STDCALL) - FFI_HIDDEN(C(ffi_go_closure_STDCALL)) -C(ffi_go_closure_STDCALL): -L(UW21): - # cfi_startproc - _CET_ENDBR - subl $closure_FS, %esp -L(UW22): - # cfi_def_cfa_offset(closure_FS + 4) - FFI_CLOSURE_SAVE_REGS - movl 4(%ecx), %edx /* copy cif */ - movl 8(%ecx), %eax /* copy fun */ - movl %edx, closure_CF+28(%esp) - movl %eax, closure_CF+32(%esp) - movl %ecx, closure_CF+36(%esp) /* closure is user_data */ - jmp L(do_closure_STDCALL) -L(UW23): - # cfi_endproc -ENDF(C(ffi_go_closure_STDCALL)) - -/* For REGISTER, we have no available parameter registers, and so we - enter here having pushed the closure onto the stack. */ - - .balign 16 - .globl C(ffi_closure_REGISTER) - FFI_HIDDEN(C(ffi_closure_REGISTER)) -C(ffi_closure_REGISTER): -L(UW24): - # cfi_startproc - # cfi_def_cfa(%esp, 8) - # cfi_offset(%eip, -8) - _CET_ENDBR - subl $closure_FS-4, %esp -L(UW25): - # cfi_def_cfa_offset(closure_FS + 4) - FFI_CLOSURE_SAVE_REGS - movl closure_FS-4(%esp), %ecx /* load retaddr */ - movl closure_FS(%esp), %eax /* load closure */ - movl %ecx, closure_FS(%esp) /* move retaddr */ - jmp L(do_closure_REGISTER) -L(UW26): - # cfi_endproc -ENDF(C(ffi_closure_REGISTER)) - -/* For STDCALL (and others), we need to pop N bytes of arguments off - the stack following the closure. The amount needing to be popped - is returned to us from ffi_closure_inner. */ - - .balign 16 - .globl C(ffi_closure_STDCALL) - FFI_HIDDEN(C(ffi_closure_STDCALL)) -C(ffi_closure_STDCALL): -L(UW27): - # cfi_startproc - _CET_ENDBR - subl $closure_FS, %esp -L(UW28): - # cfi_def_cfa_offset(closure_FS + 4) - - FFI_CLOSURE_SAVE_REGS - - /* Entry point from ffi_closure_REGISTER. */ -L(do_closure_REGISTER): - - FFI_CLOSURE_COPY_TRAMP_DATA - - /* Entry point from preceeding Go closure. */ -L(do_closure_STDCALL): - - FFI_CLOSURE_PREP_CALL - FFI_CLOSURE_CALL_INNER(29) - - movl %eax, %ecx - shrl $X86_RET_POP_SHIFT, %ecx /* isolate pop count */ - leal closure_FS(%esp, %ecx), %ecx /* compute popped esp */ - movl closure_FS(%esp), %edx /* move return address */ - movl %edx, (%ecx) - - /* From this point on, the value of %esp upon return is %ecx+4, - and we've copied the return address to %ecx to make return easy. - There's no point in representing this in the unwind info, as - there is always a window between the mov and the ret which - will be wrong from one point of view or another. */ - - FFI_CLOSURE_MASK_AND_JUMP(3, 30) - - .balign 8 -L(load_table3): -E(L(load_table3), X86_RET_FLOAT) - flds closure_CF(%esp) - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_DOUBLE) - fldl closure_CF(%esp) - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_LDOUBLE) - fldt closure_CF(%esp) - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_SINT8) - movsbl %al, %eax - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_SINT16) - movswl %ax, %eax - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_UINT8) - movzbl %al, %eax - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_UINT16) - movzwl %ax, %eax - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_INT64) - movl closure_CF+4(%esp), %edx - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_INT32) - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_VOID) - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_STRUCTPOP) - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_STRUCTARG) - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_STRUCT_1B) - movzbl %al, %eax - movl %ecx, %esp - ret -E(L(load_table3), X86_RET_STRUCT_2B) - movzwl %ax, %eax - movl %ecx, %esp - ret - - /* Fill out the table so that bad values are predictable. */ -E(L(load_table3), X86_RET_UNUSED14) - ud2 -E(L(load_table3), X86_RET_UNUSED15) - ud2 - -L(UW31): - # cfi_endproc -ENDF(C(ffi_closure_STDCALL)) - -#if defined(FFI_EXEC_STATIC_TRAMP) - .balign 16 - .globl C(ffi_closure_i386_alt) - FFI_HIDDEN(C(ffi_closure_i386_alt)) -C(ffi_closure_i386_alt): - /* See the comments above trampoline_code_table. */ - _CET_ENDBR - movl 4(%esp), %eax /* Load closure in eax */ - add $8, %esp /* Restore the stack */ - jmp C(ffi_closure_i386) -ENDF(C(ffi_closure_i386_alt)) - - .balign 16 - .globl C(ffi_closure_REGISTER_alt) - FFI_HIDDEN(C(ffi_closure_REGISTER_alt)) -C(ffi_closure_REGISTER_alt): - /* See the comments above trampoline_code_table. */ - _CET_ENDBR - movl (%esp), %eax /* Restore eax */ - add $4, %esp /* Leave closure on stack */ - jmp C(ffi_closure_REGISTER) -ENDF(C(ffi_closure_REGISTER_alt)) - - .balign 16 - .globl C(ffi_closure_STDCALL_alt) - FFI_HIDDEN(C(ffi_closure_STDCALL_alt)) -C(ffi_closure_STDCALL_alt): - /* See the comments above trampoline_code_table. */ - _CET_ENDBR - movl 4(%esp), %eax /* Load closure in eax */ - add $8, %esp /* Restore the stack */ - jmp C(ffi_closure_STDCALL) -ENDF(C(ffi_closure_STDCALL_alt)) - -/* - * Below is the definition of the trampoline code table. Each element in - * the code table is a trampoline. - * - * Because we jump to the trampoline, we place a _CET_ENDBR at the - * beginning of the trampoline to mark it as a valid branch target. This is - * part of the the Intel CET (Control Flow Enforcement Technology). - */ -/* - * The trampoline uses register eax. It saves the original value of eax on - * the stack. - * - * The trampoline has two parameters - target code to jump to and data for - * the target code. The trampoline extracts the parameters from its parameter - * block (see tramp_table_map()). The trampoline saves the data address on - * the stack. Finally, it jumps to the target code. - * - * The target code can choose to: - * - * - restore the value of eax - * - load the data address in a register - * - restore the stack pointer to what it was when the trampoline was invoked. - */ -#ifdef ENDBR_PRESENT -#define X86_DATA_OFFSET 4081 -#define X86_CODE_OFFSET 4070 -#else -#define X86_DATA_OFFSET 4085 -#define X86_CODE_OFFSET 4074 -#endif - - .align X86_TRAMP_MAP_SIZE - .globl C(trampoline_code_table) - FFI_HIDDEN(C(trampoline_code_table)) -C(trampoline_code_table): - .rept X86_TRAMP_MAP_SIZE / X86_TRAMP_SIZE - _CET_ENDBR - sub $8, %esp - movl %eax, (%esp) /* Save %eax on stack */ - call 1f /* Get next PC into %eax */ - movl X86_DATA_OFFSET(%eax), %eax /* Copy data into %eax */ - movl %eax, 4(%esp) /* Save data on stack */ - call 1f /* Get next PC into %eax */ - movl X86_CODE_OFFSET(%eax), %eax /* Copy code into %eax */ - jmp *%eax /* Jump to code */ -1: - mov (%esp), %eax - ret - .align 4 - .endr -ENDF(C(trampoline_code_table)) - .align X86_TRAMP_MAP_SIZE -#endif /* FFI_EXEC_STATIC_TRAMP */ - -#if !FFI_NO_RAW_API - -#define raw_closure_S_FS (16+16+12) - - .balign 16 - .globl C(ffi_closure_raw_SYSV) - FFI_HIDDEN(C(ffi_closure_raw_SYSV)) -C(ffi_closure_raw_SYSV): -L(UW32): - # cfi_startproc - _CET_ENDBR - subl $raw_closure_S_FS, %esp -L(UW33): - # cfi_def_cfa_offset(raw_closure_S_FS + 4) - movl %ebx, raw_closure_S_FS-4(%esp) -L(UW34): - # cfi_rel_offset(%ebx, raw_closure_S_FS-4) - - movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */ - movl %edx, 12(%esp) - leal raw_closure_S_FS+4(%esp), %edx /* load raw_args */ - movl %edx, 8(%esp) - leal 16(%esp), %edx /* load &res */ - movl %edx, 4(%esp) - movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */ - movl %ebx, (%esp) - call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */ - - movl 20(%ebx), %eax /* load cif->flags */ - andl $X86_RET_TYPE_MASK, %eax -#ifdef __PIC__ - call C(__x86.get_pc_thunk.bx) -L(pc4): - leal L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx -#else - leal L(load_table4)(,%eax, 8), %ecx -#endif - movl raw_closure_S_FS-4(%esp), %ebx -L(UW35): - # cfi_restore(%ebx) - movl 16(%esp), %eax /* Optimistic load */ - jmp *%ecx - - .balign 8 -L(load_table4): -E(L(load_table4), X86_RET_FLOAT) - flds 16(%esp) - jmp L(e4) -E(L(load_table4), X86_RET_DOUBLE) - fldl 16(%esp) - jmp L(e4) -E(L(load_table4), X86_RET_LDOUBLE) - fldt 16(%esp) - jmp L(e4) -E(L(load_table4), X86_RET_SINT8) - movsbl %al, %eax - jmp L(e4) -E(L(load_table4), X86_RET_SINT16) - movswl %ax, %eax - jmp L(e4) -E(L(load_table4), X86_RET_UINT8) - movzbl %al, %eax - jmp L(e4) -E(L(load_table4), X86_RET_UINT16) - movzwl %ax, %eax - jmp L(e4) -E(L(load_table4), X86_RET_INT64) - movl 16+4(%esp), %edx - jmp L(e4) -E(L(load_table4), X86_RET_INT32) - nop - /* fallthru */ -E(L(load_table4), X86_RET_VOID) -L(e4): - addl $raw_closure_S_FS, %esp -L(UW36): - # cfi_adjust_cfa_offset(-raw_closure_S_FS) - ret -L(UW37): - # cfi_adjust_cfa_offset(raw_closure_S_FS) -E(L(load_table4), X86_RET_STRUCTPOP) - addl $raw_closure_S_FS, %esp -L(UW38): - # cfi_adjust_cfa_offset(-raw_closure_S_FS) - ret $4 -L(UW39): - # cfi_adjust_cfa_offset(raw_closure_S_FS) -E(L(load_table4), X86_RET_STRUCTARG) - jmp L(e4) -E(L(load_table4), X86_RET_STRUCT_1B) - movzbl %al, %eax - jmp L(e4) -E(L(load_table4), X86_RET_STRUCT_2B) - movzwl %ax, %eax - jmp L(e4) - - /* Fill out the table so that bad values are predictable. */ -E(L(load_table4), X86_RET_UNUSED14) - ud2 -E(L(load_table4), X86_RET_UNUSED15) - ud2 - -L(UW40): - # cfi_endproc -ENDF(C(ffi_closure_raw_SYSV)) - -#define raw_closure_T_FS (16+16+8) - - .balign 16 - .globl C(ffi_closure_raw_THISCALL) - FFI_HIDDEN(C(ffi_closure_raw_THISCALL)) -C(ffi_closure_raw_THISCALL): -L(UW41): - # cfi_startproc - _CET_ENDBR - /* Rearrange the stack such that %ecx is the first argument. - This means moving the return address. */ - popl %edx -L(UW42): - # cfi_def_cfa_offset(0) - # cfi_register(%eip, %edx) - pushl %ecx -L(UW43): - # cfi_adjust_cfa_offset(4) - pushl %edx -L(UW44): - # cfi_adjust_cfa_offset(4) - # cfi_rel_offset(%eip, 0) - subl $raw_closure_T_FS, %esp -L(UW45): - # cfi_adjust_cfa_offset(raw_closure_T_FS) - movl %ebx, raw_closure_T_FS-4(%esp) -L(UW46): - # cfi_rel_offset(%ebx, raw_closure_T_FS-4) - - movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */ - movl %edx, 12(%esp) - leal raw_closure_T_FS+4(%esp), %edx /* load raw_args */ - movl %edx, 8(%esp) - leal 16(%esp), %edx /* load &res */ - movl %edx, 4(%esp) - movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */ - movl %ebx, (%esp) - call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */ - - movl 20(%ebx), %eax /* load cif->flags */ - andl $X86_RET_TYPE_MASK, %eax -#ifdef __PIC__ - call C(__x86.get_pc_thunk.bx) -L(pc5): - leal L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx -#else - leal L(load_table5)(,%eax, 8), %ecx -#endif - movl raw_closure_T_FS-4(%esp), %ebx -L(UW47): - # cfi_restore(%ebx) - movl 16(%esp), %eax /* Optimistic load */ - jmp *%ecx - - .balign 8 -L(load_table5): -E(L(load_table5), X86_RET_FLOAT) - flds 16(%esp) - jmp L(e5) -E(L(load_table5), X86_RET_DOUBLE) - fldl 16(%esp) - jmp L(e5) -E(L(load_table5), X86_RET_LDOUBLE) - fldt 16(%esp) - jmp L(e5) -E(L(load_table5), X86_RET_SINT8) - movsbl %al, %eax - jmp L(e5) -E(L(load_table5), X86_RET_SINT16) - movswl %ax, %eax - jmp L(e5) -E(L(load_table5), X86_RET_UINT8) - movzbl %al, %eax - jmp L(e5) -E(L(load_table5), X86_RET_UINT16) - movzwl %ax, %eax - jmp L(e5) -E(L(load_table5), X86_RET_INT64) - movl 16+4(%esp), %edx - jmp L(e5) -E(L(load_table5), X86_RET_INT32) - nop - /* fallthru */ -E(L(load_table5), X86_RET_VOID) -L(e5): - addl $raw_closure_T_FS, %esp -L(UW48): - # cfi_adjust_cfa_offset(-raw_closure_T_FS) - /* Remove the extra %ecx argument we pushed. */ - ret $4 -L(UW49): - # cfi_adjust_cfa_offset(raw_closure_T_FS) -E(L(load_table5), X86_RET_STRUCTPOP) - addl $raw_closure_T_FS, %esp -L(UW50): - # cfi_adjust_cfa_offset(-raw_closure_T_FS) - ret $8 -L(UW51): - # cfi_adjust_cfa_offset(raw_closure_T_FS) -E(L(load_table5), X86_RET_STRUCTARG) - jmp L(e5) -E(L(load_table5), X86_RET_STRUCT_1B) - movzbl %al, %eax - jmp L(e5) -E(L(load_table5), X86_RET_STRUCT_2B) - movzwl %ax, %eax - jmp L(e5) - - /* Fill out the table so that bad values are predictable. */ -E(L(load_table5), X86_RET_UNUSED14) - ud2 -E(L(load_table5), X86_RET_UNUSED15) - ud2 - -L(UW52): - # cfi_endproc -ENDF(C(ffi_closure_raw_THISCALL)) - -#endif /* !FFI_NO_RAW_API */ - -#ifdef X86_DARWIN -/* The linker in use on earlier Darwin needs weak definitions to be - placed in a coalesced section. That section should not be called - __TEXT,__text since that would be re-defining the attributes of the - .text section (which is an error for earlier tools). Here we use - '__textcoal_nt' which is what GCC emits for this. - Later linker versions are happy to use a normal section and, after - Darwin12 / OSX 10.8, the tools warn that using coalesced sections - for this is deprecated so we must switch to avoid build fails and/or - deprecation warnings. */ -# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \ - __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1080 -# define COMDAT(X) \ - .section __TEXT,__textcoal_nt,coalesced,pure_instructions; \ - .weak_definition X; \ - FFI_HIDDEN(X) -# else -# define COMDAT(X) \ - .text; \ - .weak_definition X; \ - FFI_HIDDEN(X) -# endif -#elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__)) -# define COMDAT(X) \ - .section .text.X,"axG",@progbits,X,comdat; \ - .globl X; \ - FFI_HIDDEN(X) -#else -# define COMDAT(X) -#endif - -#if defined(__PIC__) - COMDAT(C(__x86.get_pc_thunk.bx)) -C(__x86.get_pc_thunk.bx): - movl (%esp), %ebx - ret -ENDF(C(__x86.get_pc_thunk.bx)) -# if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE - COMDAT(C(__x86.get_pc_thunk.dx)) -C(__x86.get_pc_thunk.dx): - movl (%esp), %edx - ret -ENDF(C(__x86.get_pc_thunk.dx)) -#endif /* DARWIN || HIDDEN */ -#endif /* __PIC__ */ - -/* Sadly, OSX cctools-as does not understand .cfi directives at all so - we build an eh frame by hand. */ - -#ifdef __APPLE__ -/* The cctools assembler will try to make a difference between two local - symbols into a relocation against, which will not work in the eh (produces - link-time fails). - To avoid this, we compute the symbol difference with a .set directive and - then substitute this value. */ -# define LEN(N, P) .set Llen$N$P,L(N)-L(P); .long Llen$N$P -/* Note, this assume DW_CFA_advance_loc1 fits into 7 bits. */ -# define ADV(N, P) .set Ladv$N$P,L(N)-L(P); .byte 2, Ladv$N$P -/* For historical reasons, the EH reg numbers for SP and FP are swapped from - the DWARF ones for 32b Darwin. */ -# define SP 5 -# define FP 4 -# define ENC 0x10 -#else -# define LEN(N, P) .long L(N)-L(P) -/* Assume DW_CFA_advance_loc1 fits. */ -# define ADV(N, P) .byte 2, L(N)-L(P) -# define SP 4 -# define FP 5 -# define ENC 0x1b -#endif - -#ifdef HAVE_AS_X86_PCREL -# define PCREL(X) X-. -#else -# define PCREL(X) X@rel -#endif - -#ifdef __APPLE__ -.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support -EHFrame0: -#elif defined(X86_WIN32) -.section .eh_frame,"r" -#elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE) -.section .eh_frame,EH_FRAME_FLAGS,@unwind -#else -.section .eh_frame,EH_FRAME_FLAGS,@progbits -#endif -#ifndef __APPLE__ -/* EH sections are already suitably aligned on Darwin. */ - .balign 4 -#endif - -L(CIE): - .set L(set0),L(ECIE)-L(SCIE) - .long L(set0) /* CIE Length */ -L(SCIE): - .long 0 /* CIE Identifier Tag */ - .byte 1 /* CIE Version */ - .ascii "zR\0" /* CIE Augmentation */ - .byte 1 /* CIE Code Alignment Factor */ - .byte 0x7c /* CIE Data Alignment Factor */ - .byte 0x8 /* CIE RA Column */ - .byte 1 /* Augmentation size */ - .byte ENC /* FDE Encoding (pcrel abs/4byte) */ - .byte 0xc, SP, 4 /* DW_CFA_def_cfa, %esp offset 4 */ - .byte 0x80+8, 1 /* DW_CFA_offset, %eip offset 1*-4 */ - .balign 4 -L(ECIE): - - .set L(set1),L(EFDE1)-L(SFDE1) - .long L(set1) /* FDE Length */ -L(SFDE1): - LEN(SFDE1, CIE) /* FDE CIE offset */ - .long PCREL(L(UW0)) /* Initial location */ - LEN(UW5, UW0) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW1, UW0) - .byte 0xc, FP, 8 /* DW_CFA_def_cfa, %ebp 8 */ - .byte 0x80+FP, 2 /* DW_CFA_offset, %ebp 2*-4 */ - ADV(UW2, UW1) - .byte 0x80+3, 0 /* DW_CFA_offset, %ebx 0*-4 */ - ADV(UW3, UW2) - .byte 0xa /* DW_CFA_remember_state */ - .byte 0xc, SP, 4 /* DW_CFA_def_cfa, %esp 4 */ - .byte 0xc0+3 /* DW_CFA_restore, %ebx */ - .byte 0xc0+FP /* DW_CFA_restore, %ebp */ - ADV(UW4, UW3) - .byte 0xb /* DW_CFA_restore_state */ - .balign 4 -L(EFDE1): - - .set L(set2),L(EFDE2)-L(SFDE2) - .long L(set2) /* FDE Length */ -L(SFDE2): - LEN(SFDE2, CIE) /* FDE CIE offset */ - .long PCREL(L(UW6)) /* Initial location */ - LEN(UW8,UW6) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW7, UW6) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE2): - - .set L(set3),L(EFDE3)-L(SFDE3) - .long L(set3) /* FDE Length */ -L(SFDE3): - LEN(SFDE3, CIE) /* FDE CIE offset */ - .long PCREL(L(UW9)) /* Initial location */ - LEN(UW11, UW9) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW10, UW9) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE3): - - .set L(set4),L(EFDE4)-L(SFDE4) - .long L(set4) /* FDE Length */ -L(SFDE4): - LEN(SFDE4, CIE) /* FDE CIE offset */ - .long PCREL(L(UW12)) /* Initial location */ - LEN(UW20, UW12) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW13, UW12) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ -#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX - ADV(UW14, UW13) - .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */ - ADV(UW15, UW14) - .byte 0xc0+3 /* DW_CFA_restore %ebx */ - ADV(UW16, UW15) -#else - ADV(UW16, UW13) -#endif - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW17, UW16) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - ADV(UW18, UW17) - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW19, UW18) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE4): - - .set L(set5),L(EFDE5)-L(SFDE5) - .long L(set5) /* FDE Length */ -L(SFDE5): - LEN(SFDE5, CIE) /* FDE CIE offset */ - .long PCREL(L(UW21)) /* Initial location */ - LEN(UW23, UW21) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW22, UW21) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE5): - - .set L(set6),L(EFDE6)-L(SFDE6) - .long L(set6) /* FDE Length */ -L(SFDE6): - LEN(SFDE6, CIE) /* FDE CIE offset */ - .long PCREL(L(UW24)) /* Initial location */ - LEN(UW26, UW24) /* Address range */ - .byte 0 /* Augmentation size */ - .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ - .byte 0x80+8, 2 /* DW_CFA_offset %eip, 2*-4 */ - ADV(UW25, UW24) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE6): - - .set L(set7),L(EFDE7)-L(SFDE7) - .long L(set7) /* FDE Length */ -L(SFDE7): - LEN(SFDE7, CIE) /* FDE CIE offset */ - .long PCREL(L(UW27)) /* Initial location */ - LEN(UW31, UW27) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW28, UW27) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ -#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX - ADV(UW29, UW28) - .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */ - ADV(UW30, UW29) - .byte 0xc0+3 /* DW_CFA_restore %ebx */ -#endif - .balign 4 -L(EFDE7): -#if !FFI_NO_RAW_API - .set L(set8),L(EFDE8)-L(SFDE8) - .long L(set8) /* FDE Length */ -L(SFDE8): - LEN(SFDE8, CIE) /* FDE CIE offset */ - .long PCREL(L(UW32)) /* Initial location */ - LEN(UW40, UW32) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW33, UW32) - .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ - ADV(UW34, UW33) - .byte 0x80+3, 2 /* DW_CFA_offset %ebx 2*-4 */ - ADV(UW35, UW34) - .byte 0xc0+3 /* DW_CFA_restore %ebx */ - ADV(UW36, UW35) - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW37, UW36) - .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ - ADV(UW38, UW37) - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW39, UW38) - .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE8): - - .set L(set9),L(EFDE9)-L(SFDE9) - .long L(set9) /* FDE Length */ -L(SFDE9): - LEN(SFDE9, CIE) /* FDE CIE offset */ - .long PCREL(L(UW41)) /* Initial location */ - LEN(UW52, UW41) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW42, UW41) - .byte 0xe, 0 /* DW_CFA_def_cfa_offset */ - .byte 0x9, 8, 2 /* DW_CFA_register %eip, %edx */ - ADV(UW43, UW42) - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW44, UW43) - .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ - .byte 0x80+8, 2 /* DW_CFA_offset %eip 2*-4 */ - ADV(UW45, UW44) - .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ - ADV(UW46, UW45) - .byte 0x80+3, 3 /* DW_CFA_offset %ebx 3*-4 */ - ADV(UW47, UW46) - .byte 0xc0+3 /* DW_CFA_restore %ebx */ - ADV(UW48, UW47) - .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ - ADV(UW49, UW48) - .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ - ADV(UW50, UW49) - .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ - ADV(UW51, UW50) - .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE9): -#endif /* !FFI_NO_RAW_API */ - -#ifdef _WIN32 - .def @feat.00; - .scl 3; - .type 0; - .endef - .globl @feat.00 -@feat.00 = 1 -#endif - -#if defined(__APPLE__) - .subsections_via_symbols -# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \ - __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1070 && __clang__ -/* compact unwind is not used with GCC at present, was not present before 10.6 - but has some bugs there, so do not emit until 10.7. */ - .section __LD,__compact_unwind,regular,debug - - /* compact unwind for ffi_call_i386 */ - .long C(ffi_call_i386) - .set L1,L(UW5)-L(UW0) - .long L1 - .long 0x04000000 /* use dwarf unwind info */ - .long 0 - .long 0 - - /* compact unwind for ffi_go_closure_EAX */ - .long C(ffi_go_closure_EAX) - .set L2,L(UW8)-L(UW6) - .long L2 - .long 0x04000000 /* use dwarf unwind info */ - .long 0 - .long 0 - - /* compact unwind for ffi_go_closure_ECX */ - .long C(ffi_go_closure_ECX) - .set L3,L(UW11)-L(UW9) - .long L3 - .long 0x04000000 /* use dwarf unwind info */ - .long 0 - .long 0 - - /* compact unwind for ffi_closure_i386 */ - .long C(ffi_closure_i386) - .set L4,L(UW20)-L(UW12) - .long L4 - .long 0x04000000 /* use dwarf unwind info */ - .long 0 - .long 0 - - /* compact unwind for ffi_go_closure_STDCALL */ - .long C(ffi_go_closure_STDCALL) - .set L5,L(UW23)-L(UW21) - .long L5 - .long 0x04000000 /* use dwarf unwind info */ - .long 0 - .long 0 - - /* compact unwind for ffi_closure_REGISTER */ - .long C(ffi_closure_REGISTER) - .set L6,L(UW26)-L(UW24) - .long L6 - .long 0x04000000 /* use dwarf unwind info */ - .long 0 - .long 0 - - /* compact unwind for ffi_closure_STDCALL */ - .long C(ffi_closure_STDCALL) - .set L7,L(UW31)-L(UW27) - .long L7 - .long 0x04000000 /* use dwarf unwind info */ - .long 0 - .long 0 - - /* compact unwind for ffi_closure_raw_SYSV */ - .long C(ffi_closure_raw_SYSV) - .set L8,L(UW40)-L(UW32) - .long L8 - .long 0x04000000 /* use dwarf unwind info */ - .long 0 - .long 0 - - /* compact unwind for ffi_closure_raw_THISCALL */ - .long C(ffi_closure_raw_THISCALL) - .set L9,L(UW52)-L(UW41) - .long L9 - .long 0x04000000 /* use dwarf unwind info */ - .long 0 - .long 0 -#endif /* use compact unwind */ -#endif /* __APPLE__ */ - -#endif /* ifndef _MSC_VER */ - -#endif /* ifdef __i386__ */ - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/x86/sysv_intel.S b/deps/libffi/src/x86/sysv_intel.S deleted file mode 100644 index cccdf7d7683f07..00000000000000 --- a/deps/libffi/src/x86/sysv_intel.S +++ /dev/null @@ -1,998 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2017, 2022 Anthony Green - - Copyright (c) 2013 The Written Word, Inc. - - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc. - - X86 Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#ifndef __x86_64__ -#ifdef _MSC_VER - -#define LIBFFI_ASM -#include -#include -#include -#include "internal.h" - -#define C2(X, Y) X ## Y -#define C1(X, Y) C2(X, Y) -#define L(X) C1(L, X) -# define ENDF(X) X ENDP - -/* This macro allows the safe creation of jump tables without an - actual table. The entry points into the table are all 8 bytes. - The use of ORG asserts that we're at the correct location. */ -/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ -#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) -# define E(BASE, X) ALIGN 8 -#else -# define E(BASE, X) ALIGN 8; ORG BASE + X * 8 -#endif - - .686P - .MODEL FLAT - -EXTRN @ffi_closure_inner@8:PROC -_TEXT SEGMENT - -/* This is declared as - - void ffi_call_i386(struct call_frame *frame, char *argp) - __attribute__((fastcall)); - - Thus the arguments are present in - - ecx: frame - edx: argp -*/ - -ALIGN 16 -PUBLIC @ffi_call_i386@8 -@ffi_call_i386@8 PROC -L(UW0): - cfi_startproc - #if !HAVE_FASTCALL - mov ecx, [esp+4] - mov edx, [esp+8] - #endif - mov eax, [esp] /* move the return address */ - mov [ecx], ebp /* store ebp into local frame */ - mov [ecx+4], eax /* store retaddr into local frame */ - - /* New stack frame based off ebp. This is a itty bit of unwind - trickery in that the CFA *has* changed. There is no easy way - to describe it correctly on entry to the function. Fortunately, - it doesn't matter too much since at all points we can correctly - unwind back to ffi_call. Note that the location to which we - moved the return address is (the new) CFA-4, so from the - perspective of the unwind info, it hasn't moved. */ - mov ebp, ecx -L(UW1): - /* cfi_def_cfa(%ebp, 8) */ - /* cfi_rel_offset(%ebp, 0) */ - - mov esp, edx /* set outgoing argument stack */ - mov eax, [20+R_EAX*4+ebp] /* set register arguments */ - mov edx, [20+R_EDX*4+ebp] - mov ecx, [20+R_ECX*4+ebp] - - call dword ptr [ebp+8] - - mov ecx, [12+ebp] /* load return type code */ - mov [ebp+8], ebx /* preserve %ebx */ -L(UW2): - /* cfi_rel_offset(%ebx, 8) */ - - and ecx, X86_RET_TYPE_MASK - lea ebx, [L(store_table) + ecx * 8] - mov ecx, [ebp+16] /* load result address */ - jmp ebx - - ALIGN 8 -L(store_table): -E(L(store_table), X86_RET_FLOAT) - fstp DWORD PTR [ecx] - jmp L(e1) -E(L(store_table), X86_RET_DOUBLE) - fstp QWORD PTR [ecx] - jmp L(e1) -E(L(store_table), X86_RET_LDOUBLE) - fstp QWORD PTR [ecx] - jmp L(e1) -E(L(store_table), X86_RET_SINT8) - movsx eax, al - mov [ecx], eax - jmp L(e1) -E(L(store_table), X86_RET_SINT16) - movsx eax, ax - mov [ecx], eax - jmp L(e1) -E(L(store_table), X86_RET_UINT8) - movzx eax, al - mov [ecx], eax - jmp L(e1) -E(L(store_table), X86_RET_UINT16) - movzx eax, ax - mov [ecx], eax - jmp L(e1) -E(L(store_table), X86_RET_INT64) - mov [ecx+4], edx - /* fallthru */ -E(L(store_table), X86_RET_int 32) - mov [ecx], eax - /* fallthru */ -E(L(store_table), X86_RET_VOID) -L(e1): - mov ebx, [ebp+8] - mov esp, ebp - pop ebp -L(UW3): - /* cfi_remember_state */ - /* cfi_def_cfa(%esp, 4) */ - /* cfi_restore(%ebx) */ - /* cfi_restore(%ebp) */ - ret -L(UW4): - /* cfi_restore_state */ - -E(L(store_table), X86_RET_STRUCTPOP) - jmp L(e1) -E(L(store_table), X86_RET_STRUCTARG) - jmp L(e1) -E(L(store_table), X86_RET_STRUCT_1B) - mov [ecx], al - jmp L(e1) -E(L(store_table), X86_RET_STRUCT_2B) - mov [ecx], ax - jmp L(e1) - - /* Fill out the table so that bad values are predictable. */ -E(L(store_table), X86_RET_UNUSED14) - int 3 -E(L(store_table), X86_RET_UNUSED15) - int 3 - -L(UW5): - /* cfi_endproc */ -ENDF(@ffi_call_i386@8) - -/* The inner helper is declared as - - void ffi_closure_inner(struct closure_frame *frame, char *argp) - __attribute_((fastcall)) - - Thus the arguments are placed in - - ecx: frame - edx: argp -*/ - -/* Macros to help setting up the closure_data structure. */ - -#if HAVE_FASTCALL -# define closure_FS (40 + 4) -# define closure_CF 0 -#else -# define closure_FS (8 + 40 + 12) -# define closure_CF 8 -#endif - -FFI_CLOSURE_SAVE_REGS MACRO - mov [esp + closure_CF+16+R_EAX*4], eax - mov [esp + closure_CF+16+R_EDX*4], edx - mov [esp + closure_CF+16+R_ECX*4], ecx -ENDM - -FFI_CLOSURE_COPY_TRAMP_DATA MACRO - mov edx, [eax+FFI_TRAMPOLINE_SIZE] /* copy cif */ - mov ecx, [eax+FFI_TRAMPOLINE_SIZE+4] /* copy fun */ - mov eax, [eax+FFI_TRAMPOLINE_SIZE+8]; /* copy user_data */ - mov [esp+closure_CF+28], edx - mov [esp+closure_CF+32], ecx - mov [esp+closure_CF+36], eax -ENDM - -#if HAVE_FASTCALL -FFI_CLOSURE_PREP_CALL MACRO - mov ecx, esp /* load closure_data */ - lea edx, [esp+closure_FS+4] /* load incoming stack */ -ENDM -#else -FFI_CLOSURE_PREP_CALL MACRO - lea ecx, [esp+closure_CF] /* load closure_data */ - lea edx, [esp+closure_FS+4] /* load incoming stack */ - mov [esp], ecx - mov [esp+4], edx -ENDM -#endif - -FFI_CLOSURE_CALL_INNER MACRO UWN - call @ffi_closure_inner@8 -ENDM - -FFI_CLOSURE_MASK_AND_JUMP MACRO LABEL - and eax, X86_RET_TYPE_MASK - lea edx, [LABEL+eax*8] - mov eax, [esp+closure_CF] /* optimiztic load */ - jmp edx -ENDM - -ALIGN 16 -PUBLIC ffi_go_closure_EAX -ffi_go_closure_EAX PROC C -L(UW6): - /* cfi_startproc */ - sub esp, closure_FS -L(UW7): - /* cfi_def_cfa_offset(closure_FS + 4) */ - FFI_CLOSURE_SAVE_REGS - mov edx, [eax+4] /* copy cif */ - mov ecx, [eax +8] /* copy fun */ - mov [esp+closure_CF+28], edx - mov [esp+closure_CF+32], ecx - mov [esp+closure_CF+36], eax /* closure is user_data */ - jmp L(do_closure_i386) -L(UW8): - /* cfi_endproc */ -ENDF(ffi_go_closure_EAX) - -ALIGN 16 -PUBLIC ffi_go_closure_ECX -ffi_go_closure_ECX PROC C -L(UW9): - /* cfi_startproc */ - sub esp, closure_FS -L(UW10): - /* cfi_def_cfa_offset(closure_FS + 4) */ - FFI_CLOSURE_SAVE_REGS - mov edx, [ecx+4] /* copy cif */ - mov eax, [ecx+8] /* copy fun */ - mov [esp+closure_CF+28], edx - mov [esp+closure_CF+32], eax - mov [esp+closure_CF+36], ecx /* closure is user_data */ - jmp L(do_closure_i386) -L(UW11): - /* cfi_endproc */ -ENDF(ffi_go_closure_ECX) - -/* The closure entry points are reached from the ffi_closure trampoline. - On entry, %eax contains the address of the ffi_closure. */ - -ALIGN 16 -PUBLIC ffi_closure_i386 -ffi_closure_i386 PROC C -L(UW12): - /* cfi_startproc */ - sub esp, closure_FS -L(UW13): - /* cfi_def_cfa_offset(closure_FS + 4) */ - - FFI_CLOSURE_SAVE_REGS - FFI_CLOSURE_COPY_TRAMP_DATA - - /* Entry point from preceeding Go closures. */ -L(do_closure_i386):: - - FFI_CLOSURE_PREP_CALL - FFI_CLOSURE_CALL_INNER(14) - FFI_CLOSURE_MASK_AND_JUMP L(C1(load_table,2)) - - ALIGN 8 -L(load_table2): -E(L(load_table2), X86_RET_FLOAT) - fld dword ptr [esp+closure_CF] - jmp L(e2) -E(L(load_table2), X86_RET_DOUBLE) - fld qword ptr [esp+closure_CF] - jmp L(e2) -E(L(load_table2), X86_RET_LDOUBLE) - fld qword ptr [esp+closure_CF] - jmp L(e2) -E(L(load_table2), X86_RET_SINT8) - movsx eax, al - jmp L(e2) -E(L(load_table2), X86_RET_SINT16) - movsx eax, ax - jmp L(e2) -E(L(load_table2), X86_RET_UINT8) - movzx eax, al - jmp L(e2) -E(L(load_table2), X86_RET_UINT16) - movzx eax, ax - jmp L(e2) -E(L(load_table2), X86_RET_INT64) - mov edx, [esp+closure_CF+4] - jmp L(e2) -E(L(load_table2), X86_RET_INT32) - nop - /* fallthru */ -E(L(load_table2), X86_RET_VOID) -L(e2): - add esp, closure_FS -L(UW16): - /* cfi_adjust_cfa_offset(-closure_FS) */ - ret -L(UW17): - /* cfi_adjust_cfa_offset(closure_FS) */ -E(L(load_table2), X86_RET_STRUCTPOP) - add esp, closure_FS -L(UW18): - /* cfi_adjust_cfa_offset(-closure_FS) */ - ret 4 -L(UW19): - /* cfi_adjust_cfa_offset(closure_FS) */ -E(L(load_table2), X86_RET_STRUCTARG) - jmp L(e2) -E(L(load_table2), X86_RET_STRUCT_1B) - movzx eax, al - jmp L(e2) -E(L(load_table2), X86_RET_STRUCT_2B) - movzx eax, ax - jmp L(e2) - - /* Fill out the table so that bad values are predictable. */ -E(L(load_table2), X86_RET_UNUSED14) - int 3 -E(L(load_table2), X86_RET_UNUSED15) - int 3 - -L(UW20): - /* cfi_endproc */ -ENDF(ffi_closure_i386) - -ALIGN 16 -PUBLIC ffi_go_closure_STDCALL -ffi_go_closure_STDCALL PROC C -L(UW21): - /* cfi_startproc */ - sub esp, closure_FS -L(UW22): - /* cfi_def_cfa_offset(closure_FS + 4) */ - FFI_CLOSURE_SAVE_REGS - mov edx, [ecx+4] /* copy cif */ - mov eax, [ecx+8] /* copy fun */ - mov [esp+closure_CF+28], edx - mov [esp+closure_CF+32], eax - mov [esp+closure_CF+36], ecx /* closure is user_data */ - jmp L(do_closure_STDCALL) -L(UW23): - /* cfi_endproc */ -ENDF(ffi_go_closure_STDCALL) - -/* For REGISTER, we have no available parameter registers, and so we - enter here having pushed the closure onto the stack. */ - -ALIGN 16 -PUBLIC ffi_closure_REGISTER -ffi_closure_REGISTER PROC C -L(UW24): - /* cfi_startproc */ - /* cfi_def_cfa(%esp, 8) */ - /* cfi_offset(%eip, -8) */ - sub esp, closure_FS-4 -L(UW25): - /* cfi_def_cfa_offset(closure_FS + 4) */ - FFI_CLOSURE_SAVE_REGS - mov ecx, [esp+closure_FS-4] /* load retaddr */ - mov eax, [esp+closure_FS] /* load closure */ - mov [esp+closure_FS], ecx /* move retaddr */ - jmp L(do_closure_REGISTER) -L(UW26): - /* cfi_endproc */ -ENDF(ffi_closure_REGISTER) - -/* For STDCALL (and others), we need to pop N bytes of arguments off - the stack following the closure. The amount needing to be popped - is returned to us from ffi_closure_inner. */ - -ALIGN 16 -PUBLIC ffi_closure_STDCALL -ffi_closure_STDCALL PROC C -L(UW27): - /* cfi_startproc */ - sub esp, closure_FS -L(UW28): - /* cfi_def_cfa_offset(closure_FS + 4) */ - - FFI_CLOSURE_SAVE_REGS - - /* Entry point from ffi_closure_REGISTER. */ -L(do_closure_REGISTER):: - - FFI_CLOSURE_COPY_TRAMP_DATA - - /* Entry point from preceeding Go closure. */ -L(do_closure_STDCALL):: - - FFI_CLOSURE_PREP_CALL - FFI_CLOSURE_CALL_INNER(29) - - mov ecx, eax - shr ecx, X86_RET_POP_SHIFT /* isolate pop count */ - lea ecx, [esp+closure_FS+ecx] /* compute popped esp */ - mov edx, [esp+closure_FS] /* move return address */ - mov [ecx], edx - - /* From this point on, the value of %esp upon return is %ecx+4, - and we've copied the return address to %ecx to make return easy. - There's no point in representing this in the unwind info, as - there is always a window between the mov and the ret which - will be wrong from one point of view or another. */ - - FFI_CLOSURE_MASK_AND_JUMP L(C1(load_table,3)) - - ALIGN 8 -L(load_table3): -E(L(load_table3), X86_RET_FLOAT) - fld DWORD PTR [esp+closure_CF] - mov esp, ecx - ret -E(L(load_table3), X86_RET_DOUBLE) - fld QWORD PTR [esp+closure_CF] - mov esp, ecx - ret -E(L(load_table3), X86_RET_LDOUBLE) - fld QWORD PTR [esp+closure_CF] - mov esp, ecx - ret -E(L(load_table3), X86_RET_SINT8) - movsx eax, al - mov esp, ecx - ret -E(L(load_table3), X86_RET_SINT16) - movsx eax, ax - mov esp, ecx - ret -E(L(load_table3), X86_RET_UINT8) - movzx eax, al - mov esp, ecx - ret -E(L(load_table3), X86_RET_UINT16) - movzx eax, ax - mov esp, ecx - ret -E(L(load_table3), X86_RET_INT64) - mov edx, [esp+closure_CF+4] - mov esp, ecx - ret -E(L(load_table3), X86_RET_int 32) - mov esp, ecx - ret -E(L(load_table3), X86_RET_VOID) - mov esp, ecx - ret -E(L(load_table3), X86_RET_STRUCTPOP) - mov esp, ecx - ret -E(L(load_table3), X86_RET_STRUCTARG) - mov esp, ecx - ret -E(L(load_table3), X86_RET_STRUCT_1B) - movzx eax, al - mov esp, ecx - ret -E(L(load_table3), X86_RET_STRUCT_2B) - movzx eax, ax - mov esp, ecx - ret - - /* Fill out the table so that bad values are predictable. */ -E(L(load_table3), X86_RET_UNUSED14) - int 3 -E(L(load_table3), X86_RET_UNUSED15) - int 3 - -L(UW31): - /* cfi_endproc */ -ENDF(ffi_closure_STDCALL) - -#if !FFI_NO_RAW_API - -#define raw_closure_S_FS (16+16+12) - -ALIGN 16 -PUBLIC ffi_closure_raw_SYSV -ffi_closure_raw_SYSV PROC C -L(UW32): - /* cfi_startproc */ - sub esp, raw_closure_S_FS -L(UW33): - /* cfi_def_cfa_offset(raw_closure_S_FS + 4) */ - mov [esp+raw_closure_S_FS-4], ebx -L(UW34): - /* cfi_rel_offset(%ebx, raw_closure_S_FS-4) */ - - mov edx, [eax+FFI_TRAMPOLINE_SIZE+8] /* load cl->user_data */ - mov [esp+12], edx - lea edx, [esp+raw_closure_S_FS+4] /* load raw_args */ - mov [esp+8], edx - lea edx, [esp+16] /* load &res */ - mov [esp+4], edx - mov ebx, [eax+FFI_TRAMPOLINE_SIZE] /* load cl->cif */ - mov [esp], ebx - call DWORD PTR [eax+FFI_TRAMPOLINE_SIZE+4] /* call cl->fun */ - - mov eax, [ebx+20] /* load cif->flags */ - and eax, X86_RET_TYPE_MASK -/* #ifdef __PIC__ */ -/* call __x86.get_pc_thunk.bx */ -/* L(pc4): */ -/* lea ecx, L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx */ -/* #else */ - lea ecx, [L(load_table4)+eax+8] -/* #endif */ - mov ebx, [esp+raw_closure_S_FS-4] -L(UW35): - /* cfi_restore(%ebx) */ - mov eax, [esp+16] /* Optimistic load */ - jmp dword ptr [ecx] - - ALIGN 8 -L(load_table4): -E(L(load_table4), X86_RET_FLOAT) - fld DWORD PTR [esp +16] - jmp L(e4) -E(L(load_table4), X86_RET_DOUBLE) - fld QWORD PTR [esp +16] - jmp L(e4) -E(L(load_table4), X86_RET_LDOUBLE) - fld QWORD PTR [esp +16] - jmp L(e4) -E(L(load_table4), X86_RET_SINT8) - movsx eax, al - jmp L(e4) -E(L(load_table4), X86_RET_SINT16) - movsx eax, ax - jmp L(e4) -E(L(load_table4), X86_RET_UINT8) - movzx eax, al - jmp L(e4) -E(L(load_table4), X86_RET_UINT16) - movzx eax, ax - jmp L(e4) -E(L(load_table4), X86_RET_INT64) - mov edx, [esp+16+4] - jmp L(e4) -E(L(load_table4), X86_RET_int 32) - nop - /* fallthru */ -E(L(load_table4), X86_RET_VOID) -L(e4): - add esp, raw_closure_S_FS -L(UW36): - /* cfi_adjust_cfa_offset(-raw_closure_S_FS) */ - ret -L(UW37): - /* cfi_adjust_cfa_offset(raw_closure_S_FS) */ -E(L(load_table4), X86_RET_STRUCTPOP) - add esp, raw_closure_S_FS -L(UW38): - /* cfi_adjust_cfa_offset(-raw_closure_S_FS) */ - ret 4 -L(UW39): - /* cfi_adjust_cfa_offset(raw_closure_S_FS) */ -E(L(load_table4), X86_RET_STRUCTARG) - jmp L(e4) -E(L(load_table4), X86_RET_STRUCT_1B) - movzx eax, al - jmp L(e4) -E(L(load_table4), X86_RET_STRUCT_2B) - movzx eax, ax - jmp L(e4) - - /* Fill out the table so that bad values are predictable. */ -E(L(load_table4), X86_RET_UNUSED14) - int 3 -E(L(load_table4), X86_RET_UNUSED15) - int 3 - -L(UW40): - /* cfi_endproc */ -ENDF(ffi_closure_raw_SYSV) - -#define raw_closure_T_FS (16+16+8) - -ALIGN 16 -PUBLIC ffi_closure_raw_THISCALL -ffi_closure_raw_THISCALL PROC C -L(UW41): - /* cfi_startproc */ - /* Rearrange the stack such that %ecx is the first argument. - This means moving the return address. */ - pop edx -L(UW42): - /* cfi_def_cfa_offset(0) */ - /* cfi_register(%eip, %edx) */ - push ecx -L(UW43): - /* cfi_adjust_cfa_offset(4) */ - push edx -L(UW44): - /* cfi_adjust_cfa_offset(4) */ - /* cfi_rel_offset(%eip, 0) */ - sub esp, raw_closure_T_FS -L(UW45): - /* cfi_adjust_cfa_offset(raw_closure_T_FS) */ - mov [esp+raw_closure_T_FS-4], ebx -L(UW46): - /* cfi_rel_offset(%ebx, raw_closure_T_FS-4) */ - - mov edx, [eax+FFI_TRAMPOLINE_SIZE+8] /* load cl->user_data */ - mov [esp+12], edx - lea edx, [esp+raw_closure_T_FS+4] /* load raw_args */ - mov [esp+8], edx - lea edx, [esp+16] /* load &res */ - mov [esp+4], edx - mov ebx, [eax+FFI_TRAMPOLINE_SIZE] /* load cl->cif */ - mov [esp], ebx - call DWORD PTR [eax+FFI_TRAMPOLINE_SIZE+4] /* call cl->fun */ - - mov eax, [ebx+20] /* load cif->flags */ - and eax, X86_RET_TYPE_MASK -/* #ifdef __PIC__ */ -/* call __x86.get_pc_thunk.bx */ -/* L(pc5): */ -/* leal L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx */ -/* #else */ - lea ecx, [L(load_table5)+eax*8] -/*#endif */ - mov ebx, [esp+raw_closure_T_FS-4] -L(UW47): - /* cfi_restore(%ebx) */ - mov eax, [esp+16] /* Optimistic load */ - jmp DWORD PTR [ecx] - - AlIGN 4 -L(load_table5): -E(L(load_table5), X86_RET_FLOAT) - fld DWORD PTR [esp +16] - jmp L(e5) -E(L(load_table5), X86_RET_DOUBLE) - fld QWORD PTR [esp +16] - jmp L(e5) -E(L(load_table5), X86_RET_LDOUBLE) - fld QWORD PTR [esp+16] - jmp L(e5) -E(L(load_table5), X86_RET_SINT8) - movsx eax, al - jmp L(e5) -E(L(load_table5), X86_RET_SINT16) - movsx eax, ax - jmp L(e5) -E(L(load_table5), X86_RET_UINT8) - movzx eax, al - jmp L(e5) -E(L(load_table5), X86_RET_UINT16) - movzx eax, ax - jmp L(e5) -E(L(load_table5), X86_RET_INT64) - mov edx, [esp+16+4] - jmp L(e5) -E(L(load_table5), X86_RET_int 32) - nop - /* fallthru */ -E(L(load_table5), X86_RET_VOID) -L(e5): - add esp, raw_closure_T_FS -L(UW48): - /* cfi_adjust_cfa_offset(-raw_closure_T_FS) */ - /* Remove the extra %ecx argument we pushed. */ - ret 4 -L(UW49): - /* cfi_adjust_cfa_offset(raw_closure_T_FS) */ -E(L(load_table5), X86_RET_STRUCTPOP) - add esp, raw_closure_T_FS -L(UW50): - /* cfi_adjust_cfa_offset(-raw_closure_T_FS) */ - ret 8 -L(UW51): - /* cfi_adjust_cfa_offset(raw_closure_T_FS) */ -E(L(load_table5), X86_RET_STRUCTARG) - jmp L(e5) -E(L(load_table5), X86_RET_STRUCT_1B) - movzx eax, al - jmp L(e5) -E(L(load_table5), X86_RET_STRUCT_2B) - movzx eax, ax - jmp L(e5) - - /* Fill out the table so that bad values are predictable. */ -E(L(load_table5), X86_RET_UNUSED14) - int 3 -E(L(load_table5), X86_RET_UNUSED15) - int 3 - -L(UW52): - /* cfi_endproc */ -ENDF(ffi_closure_raw_THISCALL) - -#endif /* !FFI_NO_RAW_API */ - -#ifdef X86_DARWIN -# define COMDAT(X) \ - .section __TEXT,__text,coalesced,pure_instructions; \ - .weak_definition X; \ - FFI_HIDDEN(X) -#elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__)) -# define COMDAT(X) \ - .section .text.X,"axG",@progbits,X,comdat; \ - PUBLIC X; \ - FFI_HIDDEN(X) -#else -# define COMDAT(X) -#endif - -#if 0 -#if defined(__PIC__) - COMDAT(C(__x86.get_pc_thunk.bx)) -C(__x86.get_pc_thunk.bx): - movl (%esp), %ebx - ret -ENDF(C(__x86.get_pc_thunk.bx)) -# if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE - COMDAT(C(__x86.get_pc_thunk.dx)) -C(__x86.get_pc_thunk.dx): - movl (%esp), %edx - ret -ENDF(C(__x86.get_pc_thunk.dx)) -#endif /* DARWIN || HIDDEN */ -#endif /* __PIC__ */ -#endif - - -#if 0 -/* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */ - -#ifdef __APPLE__ -.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support -EHFrame0: -#elif defined(X86_WIN32) -.section .eh_frame,"r" -#elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE) -.section .eh_frame,EH_FRAME_FLAGS,@unwind -#else -.section .eh_frame,EH_FRAME_FLAGS,@progbits -#endif - -#ifdef HAVE_AS_X86_PCREL -# define PCREL(X) X - . -#else -# define PCREL(X) X@rel -#endif - -/* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */ -#define ADV(N, P) .byte 2, L(N)-L(P) - - .balign 4 -L(CIE): - .set L(set0),L(ECIE)-L(SCIE) - .long L(set0) /* CIE Length */ -L(SCIE): - .long 0 /* CIE Identifier Tag */ - .byte 1 /* CIE Version */ - .ascii "zR\0" /* CIE Augmentation */ - .byte 1 /* CIE Code Alignment Factor */ - .byte 0x7c /* CIE Data Alignment Factor */ - .byte 0x8 /* CIE RA Column */ - .byte 1 /* Augmentation size */ - .byte 0x1b /* FDE Encoding (pcrel sdata4) */ - .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp offset 4 */ - .byte 0x80+8, 1 /* DW_CFA_offset, %eip offset 1*-4 */ - .balign 4 -L(ECIE): - - .set L(set1),L(EFDE1)-L(SFDE1) - .long L(set1) /* FDE Length */ -L(SFDE1): - .long L(SFDE1)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW0)) /* Initial location */ - .long L(UW5)-L(UW0) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW1, UW0) - .byte 0xc, 5, 8 /* DW_CFA_def_cfa, %ebp 8 */ - .byte 0x80+5, 2 /* DW_CFA_offset, %ebp 2*-4 */ - ADV(UW2, UW1) - .byte 0x80+3, 0 /* DW_CFA_offset, %ebx 0*-4 */ - ADV(UW3, UW2) - .byte 0xa /* DW_CFA_remember_state */ - .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp 4 */ - .byte 0xc0+3 /* DW_CFA_restore, %ebx */ - .byte 0xc0+5 /* DW_CFA_restore, %ebp */ - ADV(UW4, UW3) - .byte 0xb /* DW_CFA_restore_state */ - .balign 4 -L(EFDE1): - - .set L(set2),L(EFDE2)-L(SFDE2) - .long L(set2) /* FDE Length */ -L(SFDE2): - .long L(SFDE2)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW6)) /* Initial location */ - .long L(UW8)-L(UW6) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW7, UW6) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE2): - - .set L(set3),L(EFDE3)-L(SFDE3) - .long L(set3) /* FDE Length */ -L(SFDE3): - .long L(SFDE3)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW9)) /* Initial location */ - .long L(UW11)-L(UW9) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW10, UW9) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE3): - - .set L(set4),L(EFDE4)-L(SFDE4) - .long L(set4) /* FDE Length */ -L(SFDE4): - .long L(SFDE4)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW12)) /* Initial location */ - .long L(UW20)-L(UW12) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW13, UW12) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ -#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX - ADV(UW14, UW13) - .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */ - ADV(UW15, UW14) - .byte 0xc0+3 /* DW_CFA_restore %ebx */ - ADV(UW16, UW15) -#else - ADV(UW16, UW13) -#endif - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW17, UW16) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - ADV(UW18, UW17) - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW19, UW18) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE4): - - .set L(set5),L(EFDE5)-L(SFDE5) - .long L(set5) /* FDE Length */ -L(SFDE5): - .long L(SFDE5)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW21)) /* Initial location */ - .long L(UW23)-L(UW21) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW22, UW21) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE5): - - .set L(set6),L(EFDE6)-L(SFDE6) - .long L(set6) /* FDE Length */ -L(SFDE6): - .long L(SFDE6)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW24)) /* Initial location */ - .long L(UW26)-L(UW24) /* Address range */ - .byte 0 /* Augmentation size */ - .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ - .byte 0x80+8, 2 /* DW_CFA_offset %eip, 2*-4 */ - ADV(UW25, UW24) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE6): - - .set L(set7),L(EFDE7)-L(SFDE7) - .long L(set7) /* FDE Length */ -L(SFDE7): - .long L(SFDE7)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW27)) /* Initial location */ - .long L(UW31)-L(UW27) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW28, UW27) - .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */ -#ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX - ADV(UW29, UW28) - .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */ - ADV(UW30, UW29) - .byte 0xc0+3 /* DW_CFA_restore %ebx */ -#endif - .balign 4 -L(EFDE7): - -#if !FFI_NO_RAW_API - .set L(set8),L(EFDE8)-L(SFDE8) - .long L(set8) /* FDE Length */ -L(SFDE8): - .long L(SFDE8)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW32)) /* Initial location */ - .long L(UW40)-L(UW32) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW33, UW32) - .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ - ADV(UW34, UW33) - .byte 0x80+3, 2 /* DW_CFA_offset %ebx 2*-4 */ - ADV(UW35, UW34) - .byte 0xc0+3 /* DW_CFA_restore %ebx */ - ADV(UW36, UW35) - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW37, UW36) - .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ - ADV(UW38, UW37) - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW39, UW38) - .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE8): - - .set L(set9),L(EFDE9)-L(SFDE9) - .long L(set9) /* FDE Length */ -L(SFDE9): - .long L(SFDE9)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW41)) /* Initial location */ - .long L(UW52)-L(UW41) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW42, UW41) - .byte 0xe, 0 /* DW_CFA_def_cfa_offset */ - .byte 0x9, 8, 2 /* DW_CFA_register %eip, %edx */ - ADV(UW43, UW42) - .byte 0xe, 4 /* DW_CFA_def_cfa_offset */ - ADV(UW44, UW43) - .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ - .byte 0x80+8, 2 /* DW_CFA_offset %eip 2*-4 */ - ADV(UW45, UW44) - .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ - ADV(UW46, UW45) - .byte 0x80+3, 3 /* DW_CFA_offset %ebx 3*-4 */ - ADV(UW47, UW46) - .byte 0xc0+3 /* DW_CFA_restore %ebx */ - ADV(UW48, UW47) - .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ - ADV(UW49, UW48) - .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ - ADV(UW50, UW49) - .byte 0xe, 8 /* DW_CFA_def_cfa_offset */ - ADV(UW51, UW50) - .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */ - .balign 4 -L(EFDE9): -#endif /* !FFI_NO_RAW_API */ - -#ifdef _WIN32 - .def @feat.00; - .scl 3; - .type 0; - .endef - PUBLIC @feat.00 -@feat.00 = 1 -#endif - -#endif /* ifndef _MSC_VER */ -#endif /* ifndef __x86_64__ */ - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif -#endif - -END diff --git a/deps/libffi/src/x86/unix64.S b/deps/libffi/src/x86/unix64.S deleted file mode 100644 index d9c5bd4c720db1..00000000000000 --- a/deps/libffi/src/x86/unix64.S +++ /dev/null @@ -1,711 +0,0 @@ -/* ----------------------------------------------------------------------- - unix64.S - Copyright (c) 2013 The Written Word, Inc. - - Copyright (c) 2008 Red Hat, Inc - - Copyright (c) 2002 Bo Thorsen - - x86-64 Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#ifdef __x86_64__ -#define LIBFFI_ASM -#include -#include -#include "internal64.h" -#include "asmnames.h" - - .text - -/* This macro allows the safe creation of jump tables without an - actual table. The entry points into the table are all 8 bytes. - The use of ORG asserts that we're at the correct location. */ -/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ -#ifdef __CET__ -/* Double slot size to 16 byte to add 4 bytes of ENDBR64. */ -# define E(BASE, X) .balign 8; .org BASE + X * 16 -#elif defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) -# define E(BASE, X) .balign 8 -#else -# define E(BASE, X) .balign 8; .org BASE + X * 8 -#endif - -/* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, - void *raddr, void (*fnaddr)(void)); - - Bit o trickiness here -- ARGS+BYTES is the base of the stack frame - for this function. This has been allocated by ffi_call. We also - deallocate some of the stack that has been alloca'd. */ - - .balign 8 - .globl C(ffi_call_unix64) - FFI_HIDDEN(C(ffi_call_unix64)) - -C(ffi_call_unix64): -L(UW0): - _CET_ENDBR - movq (%rsp), %r10 /* Load return address. */ - leaq (%rdi, %rsi), %rax /* Find local stack base. */ - movq %rdx, (%rax) /* Save flags. */ - movq %rcx, 8(%rax) /* Save raddr. */ - movq %rbp, 16(%rax) /* Save old frame pointer. */ - movq %r10, 24(%rax) /* Relocate return address. */ - movq %rax, %rbp /* Finalize local stack frame. */ - - /* New stack frame based off rbp. This is a itty bit of unwind - trickery in that the CFA *has* changed. There is no easy way - to describe it correctly on entry to the function. Fortunately, - it doesn't matter too much since at all points we can correctly - unwind back to ffi_call. Note that the location to which we - moved the return address is (the new) CFA-8, so from the - perspective of the unwind info, it hasn't moved. */ -L(UW1): - /* cfi_def_cfa(%rbp, 32) */ - /* cfi_rel_offset(%rbp, 16) */ - - movq %rdi, %r10 /* Save a copy of the register area. */ - movq %r8, %r11 /* Save a copy of the target fn. */ - - /* Load up all argument registers. */ - movq (%r10), %rdi - movq 0x08(%r10), %rsi - movq 0x10(%r10), %rdx - movq 0x18(%r10), %rcx - movq 0x20(%r10), %r8 - movq 0x28(%r10), %r9 - movl 0xb0(%r10), %eax /* Set number of SSE registers. */ - testl %eax, %eax - jnz L(load_sse) -L(ret_from_load_sse): - - /* Deallocate the reg arg area, except for r10, then load via pop. */ - leaq 0xb8(%r10), %rsp - popq %r10 - - /* Call the user function. */ - call *%r11 - - /* Deallocate stack arg area; local stack frame in redzone. */ - leaq 24(%rbp), %rsp - - movq 0(%rbp), %rcx /* Reload flags. */ - movq 8(%rbp), %rdi /* Reload raddr. */ - movq 16(%rbp), %rbp /* Reload old frame pointer. */ -L(UW2): - /* cfi_remember_state */ - /* cfi_def_cfa(%rsp, 8) */ - /* cfi_restore(%rbp) */ - - /* The first byte of the flags contains the FFI_TYPE. */ - cmpb $UNIX64_RET_LAST, %cl - movzbl %cl, %r10d - leaq L(store_table)(%rip), %r11 - ja L(sa) -#ifdef __CET__ - /* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 + - 4 bytes NOP padding double slot size to 16 bytes. */ - addl %r10d, %r10d -#endif - leaq (%r11, %r10, 8), %r10 - - /* Prep for the structure cases: scratch area in redzone. */ - leaq -20(%rsp), %rsi - jmp *%r10 - - .balign 8 -L(store_table): -E(L(store_table), UNIX64_RET_VOID) - _CET_ENDBR - ret -E(L(store_table), UNIX64_RET_UINT8) - _CET_ENDBR - movzbl %al, %eax - movq %rax, (%rdi) - ret -E(L(store_table), UNIX64_RET_UINT16) - _CET_ENDBR - movzwl %ax, %eax - movq %rax, (%rdi) - ret -E(L(store_table), UNIX64_RET_UINT32) - _CET_ENDBR - movl %eax, %eax - movq %rax, (%rdi) - ret -E(L(store_table), UNIX64_RET_SINT8) - _CET_ENDBR - movsbq %al, %rax - movq %rax, (%rdi) - ret -E(L(store_table), UNIX64_RET_SINT16) - _CET_ENDBR - movswq %ax, %rax - movq %rax, (%rdi) - ret -E(L(store_table), UNIX64_RET_SINT32) - _CET_ENDBR - cltq - movq %rax, (%rdi) - ret -E(L(store_table), UNIX64_RET_INT64) - _CET_ENDBR - movq %rax, (%rdi) - ret -E(L(store_table), UNIX64_RET_XMM32) - _CET_ENDBR - movd %xmm0, (%rdi) - ret -E(L(store_table), UNIX64_RET_XMM64) - _CET_ENDBR - movq %xmm0, (%rdi) - ret -E(L(store_table), UNIX64_RET_X87) - _CET_ENDBR - fstpt (%rdi) - ret -E(L(store_table), UNIX64_RET_X87_2) - _CET_ENDBR - fstpt (%rdi) - fstpt 16(%rdi) - ret -E(L(store_table), UNIX64_RET_ST_XMM0_RAX) - _CET_ENDBR - movq %rax, 8(%rsi) - jmp L(s3) -E(L(store_table), UNIX64_RET_ST_RAX_XMM0) - _CET_ENDBR - movq %xmm0, 8(%rsi) - jmp L(s2) -E(L(store_table), UNIX64_RET_ST_XMM0_XMM1) - _CET_ENDBR - movq %xmm1, 8(%rsi) - jmp L(s3) -E(L(store_table), UNIX64_RET_ST_RAX_RDX) - _CET_ENDBR - movq %rdx, 8(%rsi) -L(s2): - movq %rax, (%rsi) - shrl $UNIX64_SIZE_SHIFT, %ecx - rep movsb - ret - .balign 8 -L(s3): - movq %xmm0, (%rsi) - shrl $UNIX64_SIZE_SHIFT, %ecx - rep movsb - ret - -L(sa): call PLT(C(abort)) - - /* Many times we can avoid loading any SSE registers at all. - It's not worth an indirect jump to load the exact set of - SSE registers needed; zero or all is a good compromise. */ - .balign 2 -L(UW3): - /* cfi_restore_state */ -L(load_sse): - movdqa 0x30(%r10), %xmm0 - movdqa 0x40(%r10), %xmm1 - movdqa 0x50(%r10), %xmm2 - movdqa 0x60(%r10), %xmm3 - movdqa 0x70(%r10), %xmm4 - movdqa 0x80(%r10), %xmm5 - movdqa 0x90(%r10), %xmm6 - movdqa 0xa0(%r10), %xmm7 - jmp L(ret_from_load_sse) - -L(UW4): -ENDF(C(ffi_call_unix64)) - -/* 6 general registers, 8 vector registers, - 32 bytes of rvalue, 8 bytes of alignment. */ -#define ffi_closure_OFS_G 0 -#define ffi_closure_OFS_V (6*8) -#define ffi_closure_OFS_RVALUE (ffi_closure_OFS_V + 8*16) -#define ffi_closure_FS (ffi_closure_OFS_RVALUE + 32 + 8) - -/* The location of rvalue within the red zone after deallocating the frame. */ -#define ffi_closure_RED_RVALUE (ffi_closure_OFS_RVALUE - ffi_closure_FS) - - .balign 2 - .globl C(ffi_closure_unix64_sse) - FFI_HIDDEN(C(ffi_closure_unix64_sse)) - -C(ffi_closure_unix64_sse): -L(UW5): - _CET_ENDBR - subq $ffi_closure_FS, %rsp -L(UW6): - /* cfi_adjust_cfa_offset(ffi_closure_FS) */ - - movdqa %xmm0, ffi_closure_OFS_V+0x00(%rsp) - movdqa %xmm1, ffi_closure_OFS_V+0x10(%rsp) - movdqa %xmm2, ffi_closure_OFS_V+0x20(%rsp) - movdqa %xmm3, ffi_closure_OFS_V+0x30(%rsp) - movdqa %xmm4, ffi_closure_OFS_V+0x40(%rsp) - movdqa %xmm5, ffi_closure_OFS_V+0x50(%rsp) - movdqa %xmm6, ffi_closure_OFS_V+0x60(%rsp) - movdqa %xmm7, ffi_closure_OFS_V+0x70(%rsp) - jmp L(sse_entry1) - -L(UW7): -ENDF(C(ffi_closure_unix64_sse)) - - .balign 2 - .globl C(ffi_closure_unix64) - FFI_HIDDEN(C(ffi_closure_unix64)) - -C(ffi_closure_unix64): -L(UW8): - _CET_ENDBR - subq $ffi_closure_FS, %rsp -L(UW9): - /* cfi_adjust_cfa_offset(ffi_closure_FS) */ -L(sse_entry1): - movq %rdi, ffi_closure_OFS_G+0x00(%rsp) - movq %rsi, ffi_closure_OFS_G+0x08(%rsp) - movq %rdx, ffi_closure_OFS_G+0x10(%rsp) - movq %rcx, ffi_closure_OFS_G+0x18(%rsp) - movq %r8, ffi_closure_OFS_G+0x20(%rsp) - movq %r9, ffi_closure_OFS_G+0x28(%rsp) - -#ifdef __ILP32__ - movl FFI_TRAMPOLINE_SIZE(%r10), %edi /* Load cif */ - movl FFI_TRAMPOLINE_SIZE+4(%r10), %esi /* Load fun */ - movl FFI_TRAMPOLINE_SIZE+8(%r10), %edx /* Load user_data */ -#else - movq FFI_TRAMPOLINE_SIZE(%r10), %rdi /* Load cif */ - movq FFI_TRAMPOLINE_SIZE+8(%r10), %rsi /* Load fun */ - movq FFI_TRAMPOLINE_SIZE+16(%r10), %rdx /* Load user_data */ -#endif -L(do_closure): - leaq ffi_closure_OFS_RVALUE(%rsp), %rcx /* Load rvalue */ - movq %rsp, %r8 /* Load reg_args */ - leaq ffi_closure_FS+8(%rsp), %r9 /* Load argp */ - call PLT(C(ffi_closure_unix64_inner)) - - /* Deallocate stack frame early; return value is now in redzone. */ - addq $ffi_closure_FS, %rsp -L(UW10): - /* cfi_adjust_cfa_offset(-ffi_closure_FS) */ - - /* The first byte of the return value contains the FFI_TYPE. */ - cmpb $UNIX64_RET_LAST, %al - movzbl %al, %r10d - leaq L(load_table)(%rip), %r11 - ja L(la) -#ifdef __CET__ - /* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 + - 4 bytes NOP padding double slot size to 16 bytes. */ - addl %r10d, %r10d -#endif - leaq (%r11, %r10, 8), %r10 - leaq ffi_closure_RED_RVALUE(%rsp), %rsi - jmp *%r10 - - .balign 8 -L(load_table): -E(L(load_table), UNIX64_RET_VOID) - _CET_ENDBR - ret -E(L(load_table), UNIX64_RET_UINT8) - _CET_ENDBR - movzbl (%rsi), %eax - ret -E(L(load_table), UNIX64_RET_UINT16) - _CET_ENDBR - movzwl (%rsi), %eax - ret -E(L(load_table), UNIX64_RET_UINT32) - _CET_ENDBR - movl (%rsi), %eax - ret -E(L(load_table), UNIX64_RET_SINT8) - _CET_ENDBR - movsbl (%rsi), %eax - ret -E(L(load_table), UNIX64_RET_SINT16) - _CET_ENDBR - movswl (%rsi), %eax - ret -E(L(load_table), UNIX64_RET_SINT32) - _CET_ENDBR - movl (%rsi), %eax - ret -E(L(load_table), UNIX64_RET_INT64) - _CET_ENDBR - movq (%rsi), %rax - ret -E(L(load_table), UNIX64_RET_XMM32) - _CET_ENDBR - movd (%rsi), %xmm0 - ret -E(L(load_table), UNIX64_RET_XMM64) - _CET_ENDBR - movq (%rsi), %xmm0 - ret -E(L(load_table), UNIX64_RET_X87) - _CET_ENDBR - fldt (%rsi) - ret -E(L(load_table), UNIX64_RET_X87_2) - _CET_ENDBR - fldt 16(%rsi) - fldt (%rsi) - ret -E(L(load_table), UNIX64_RET_ST_XMM0_RAX) - _CET_ENDBR - movq 8(%rsi), %rax - jmp L(l3) -E(L(load_table), UNIX64_RET_ST_RAX_XMM0) - _CET_ENDBR - movq 8(%rsi), %xmm0 - jmp L(l2) -E(L(load_table), UNIX64_RET_ST_XMM0_XMM1) - _CET_ENDBR - movq 8(%rsi), %xmm1 - jmp L(l3) -E(L(load_table), UNIX64_RET_ST_RAX_RDX) - _CET_ENDBR - movq 8(%rsi), %rdx -L(l2): - movq (%rsi), %rax - ret - .balign 8 -L(l3): - movq (%rsi), %xmm0 - ret - -L(la): call PLT(C(abort)) - -L(UW11): -ENDF(C(ffi_closure_unix64)) - - .balign 2 - .globl C(ffi_go_closure_unix64_sse) - FFI_HIDDEN(C(ffi_go_closure_unix64_sse)) - -C(ffi_go_closure_unix64_sse): -L(UW12): - _CET_ENDBR - subq $ffi_closure_FS, %rsp -L(UW13): - /* cfi_adjust_cfa_offset(ffi_closure_FS) */ - - movdqa %xmm0, ffi_closure_OFS_V+0x00(%rsp) - movdqa %xmm1, ffi_closure_OFS_V+0x10(%rsp) - movdqa %xmm2, ffi_closure_OFS_V+0x20(%rsp) - movdqa %xmm3, ffi_closure_OFS_V+0x30(%rsp) - movdqa %xmm4, ffi_closure_OFS_V+0x40(%rsp) - movdqa %xmm5, ffi_closure_OFS_V+0x50(%rsp) - movdqa %xmm6, ffi_closure_OFS_V+0x60(%rsp) - movdqa %xmm7, ffi_closure_OFS_V+0x70(%rsp) - jmp L(sse_entry2) - -L(UW14): -ENDF(C(ffi_go_closure_unix64_sse)) - - .balign 2 - .globl C(ffi_go_closure_unix64) - FFI_HIDDEN(C(ffi_go_closure_unix64)) - -C(ffi_go_closure_unix64): -L(UW15): - _CET_ENDBR - subq $ffi_closure_FS, %rsp -L(UW16): - /* cfi_adjust_cfa_offset(ffi_closure_FS) */ -L(sse_entry2): - movq %rdi, ffi_closure_OFS_G+0x00(%rsp) - movq %rsi, ffi_closure_OFS_G+0x08(%rsp) - movq %rdx, ffi_closure_OFS_G+0x10(%rsp) - movq %rcx, ffi_closure_OFS_G+0x18(%rsp) - movq %r8, ffi_closure_OFS_G+0x20(%rsp) - movq %r9, ffi_closure_OFS_G+0x28(%rsp) - -#ifdef __ILP32__ - movl 4(%r10), %edi /* Load cif */ - movl 8(%r10), %esi /* Load fun */ - movl %r10d, %edx /* Load closure (user_data) */ -#else - movq 8(%r10), %rdi /* Load cif */ - movq 16(%r10), %rsi /* Load fun */ - movq %r10, %rdx /* Load closure (user_data) */ -#endif - jmp L(do_closure) - -L(UW17): -ENDF(C(ffi_go_closure_unix64)) - -#if defined(FFI_EXEC_STATIC_TRAMP) - .balign 8 - .globl C(ffi_closure_unix64_sse_alt) - FFI_HIDDEN(C(ffi_closure_unix64_sse_alt)) - -C(ffi_closure_unix64_sse_alt): - /* See the comments above trampoline_code_table. */ - _CET_ENDBR - movq 8(%rsp), %r10 /* Load closure in r10 */ - addq $16, %rsp /* Restore the stack */ - jmp C(ffi_closure_unix64_sse) -ENDF(C(ffi_closure_unix64_sse_alt)) - - .balign 8 - .globl C(ffi_closure_unix64_alt) - FFI_HIDDEN(C(ffi_closure_unix64_alt)) - -C(ffi_closure_unix64_alt): - /* See the comments above trampoline_code_table. */ - _CET_ENDBR - movq 8(%rsp), %r10 /* Load closure in r10 */ - addq $16, %rsp /* Restore the stack */ - jmp C(ffi_closure_unix64) - ENDF(C(ffi_closure_unix64_alt)) - -/* - * Below is the definition of the trampoline code table. Each element in - * the code table is a trampoline. - * - * Because we jump to the trampoline, we place a _CET_ENDBR at the - * beginning of the trampoline to mark it as a valid branch target. This is - * part of the the Intel CET (Control Flow Enforcement Technology). - */ -/* - * The trampoline uses register r10. It saves the original value of r10 on - * the stack. - * - * The trampoline has two parameters - target code to jump to and data for - * the target code. The trampoline extracts the parameters from its parameter - * block (see tramp_table_map()). The trampoline saves the data address on - * the stack. Finally, it jumps to the target code. - * - * The target code can choose to: - * - * - restore the value of r10 - * - load the data address in a register - * - restore the stack pointer to what it was when the trampoline was invoked. - */ -#ifdef ENDBR_PRESENT -# define X86_DATA_OFFSET 4077 -# ifdef __ILP32__ -# define X86_CODE_OFFSET 4069 -# else -# define X86_CODE_OFFSET 4073 -# endif -#else -# define X86_DATA_OFFSET 4081 -# ifdef __ILP32__ -# define X86_CODE_OFFSET 4073 -# else -# define X86_CODE_OFFSET 4077 -# endif -#endif - - .align UNIX64_TRAMP_MAP_SIZE - .globl trampoline_code_table - FFI_HIDDEN(C(trampoline_code_table)) - -C(trampoline_code_table): - .rept UNIX64_TRAMP_MAP_SIZE / UNIX64_TRAMP_SIZE - _CET_ENDBR - subq $16, %rsp /* Make space on the stack */ - movq %r10, (%rsp) /* Save %r10 on stack */ -#ifdef __ILP32__ - movl X86_DATA_OFFSET(%rip), %r10d /* Copy data into %r10 */ -#else - movq X86_DATA_OFFSET(%rip), %r10 /* Copy data into %r10 */ -#endif - movq %r10, 8(%rsp) /* Save data on stack */ -#ifdef __ILP32__ - movl X86_CODE_OFFSET(%rip), %r10d /* Copy code into %r10 */ -#else - movq X86_CODE_OFFSET(%rip), %r10 /* Copy code into %r10 */ -#endif - jmp *%r10 /* Jump to code */ - .align 8 - .endr -ENDF(C(trampoline_code_table)) - .align UNIX64_TRAMP_MAP_SIZE -#endif /* FFI_EXEC_STATIC_TRAMP */ - -/* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */ - -#ifdef __APPLE__ -.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support -EHFrame0: -#elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE) -.section .eh_frame,"a",@unwind -#else -.section .eh_frame,"a",@progbits -#endif - -#ifdef HAVE_AS_X86_PCREL -# define PCREL(X) X - . -#else -# define PCREL(X) X@rel -#endif - -/* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */ -#ifdef __CET__ -/* Use DW_CFA_advance_loc2 when IBT is enabled. */ -# define ADV(N, P) .byte 3; .2byte L(N)-L(P) -#else -# define ADV(N, P) .byte 2, L(N)-L(P) -#endif - - .balign 8 -L(CIE): - .set L(set0),L(ECIE)-L(SCIE) - .long L(set0) /* CIE Length */ -L(SCIE): - .long 0 /* CIE Identifier Tag */ - .byte 1 /* CIE Version */ - .ascii "zR\0" /* CIE Augmentation */ - .byte 1 /* CIE Code Alignment Factor */ - .byte 0x78 /* CIE Data Alignment Factor */ - .byte 0x10 /* CIE RA Column */ - .byte 1 /* Augmentation size */ - .byte 0x1b /* FDE Encoding (pcrel sdata4) */ - .byte 0xc, 7, 8 /* DW_CFA_def_cfa, %rsp offset 8 */ - .byte 0x80+16, 1 /* DW_CFA_offset, %rip offset 1*-8 */ - .balign 8 -L(ECIE): - - .set L(set1),L(EFDE1)-L(SFDE1) - .long L(set1) /* FDE Length */ -L(SFDE1): - .long L(SFDE1)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW0)) /* Initial location */ - .long L(UW4)-L(UW0) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW1, UW0) - .byte 0xc, 6, 32 /* DW_CFA_def_cfa, %rbp 32 */ - .byte 0x80+6, 2 /* DW_CFA_offset, %rbp 2*-8 */ - ADV(UW2, UW1) - .byte 0xa /* DW_CFA_remember_state */ - .byte 0xc, 7, 8 /* DW_CFA_def_cfa, %rsp 8 */ - .byte 0xc0+6 /* DW_CFA_restore, %rbp */ - ADV(UW3, UW2) - .byte 0xb /* DW_CFA_restore_state */ - .balign 8 -L(EFDE1): - - .set L(set2),L(EFDE2)-L(SFDE2) - .long L(set2) /* FDE Length */ -L(SFDE2): - .long L(SFDE2)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW5)) /* Initial location */ - .long L(UW7)-L(UW5) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW6, UW5) - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */ - .balign 8 -L(EFDE2): - - .set L(set3),L(EFDE3)-L(SFDE3) - .long L(set3) /* FDE Length */ -L(SFDE3): - .long L(SFDE3)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW8)) /* Initial location */ - .long L(UW11)-L(UW8) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW9, UW8) - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */ - ADV(UW10, UW9) - .byte 0xe, 8 /* DW_CFA_def_cfa_offset 8 */ -L(EFDE3): - - .set L(set4),L(EFDE4)-L(SFDE4) - .long L(set4) /* FDE Length */ -L(SFDE4): - .long L(SFDE4)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW12)) /* Initial location */ - .long L(UW14)-L(UW12) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW13, UW12) - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */ - .balign 8 -L(EFDE4): - - .set L(set5),L(EFDE5)-L(SFDE5) - .long L(set5) /* FDE Length */ -L(SFDE5): - .long L(SFDE5)-L(CIE) /* FDE CIE offset */ - .long PCREL(L(UW15)) /* Initial location */ - .long L(UW17)-L(UW15) /* Address range */ - .byte 0 /* Augmentation size */ - ADV(UW16, UW15) - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */ - .balign 8 -L(EFDE5): -#ifdef __APPLE__ - .subsections_via_symbols - .section __LD,__compact_unwind,regular,debug - - /* compact unwind for ffi_call_unix64 */ - .quad C(ffi_call_unix64) - .set L1,L(UW4)-L(UW0) - .long L1 - .long 0x04000000 /* use dwarf unwind info */ - .quad 0 - .quad 0 - - /* compact unwind for ffi_closure_unix64_sse */ - .quad C(ffi_closure_unix64_sse) - .set L2,L(UW7)-L(UW5) - .long L2 - .long 0x04000000 /* use dwarf unwind info */ - .quad 0 - .quad 0 - - /* compact unwind for ffi_closure_unix64 */ - .quad C(ffi_closure_unix64) - .set L3,L(UW11)-L(UW8) - .long L3 - .long 0x04000000 /* use dwarf unwind info */ - .quad 0 - .quad 0 - - /* compact unwind for ffi_go_closure_unix64_sse */ - .quad C(ffi_go_closure_unix64_sse) - .set L4,L(UW14)-L(UW12) - .long L4 - .long 0x04000000 /* use dwarf unwind info */ - .quad 0 - .quad 0 - - /* compact unwind for ffi_go_closure_unix64 */ - .quad C(ffi_go_closure_unix64) - .set L5,L(UW17)-L(UW15) - .long L5 - .long 0x04000000 /* use dwarf unwind info */ - .quad 0 - .quad 0 -#endif - -#endif /* __x86_64__ */ -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/x86/win64.S b/deps/libffi/src/x86/win64.S deleted file mode 100644 index 58ec6a155e3d07..00000000000000 --- a/deps/libffi/src/x86/win64.S +++ /dev/null @@ -1,254 +0,0 @@ -#ifdef __x86_64__ -#define LIBFFI_ASM -#include -#include -#include -#include "asmnames.h" - -#if defined(HAVE_AS_CFI_PSEUDO_OP) - .cfi_sections .debug_frame -#endif - -#ifdef X86_WIN64 -#define SEH(...) __VA_ARGS__ -#define arg0 %rcx -#define arg1 %rdx -#define arg2 %r8 -#define arg3 %r9 -#else -#define SEH(...) -#define arg0 %rdi -#define arg1 %rsi -#define arg2 %rdx -#define arg3 %rcx -#endif - -/* This macro allows the safe creation of jump tables without an - actual table. The entry points into the table are all 8 bytes. - The use of ORG asserts that we're at the correct location. */ -/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ -#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) -# define E(BASE, X) .balign 8 -#else -# define E(BASE, X) .balign 8; .org BASE + (X) * 8 -#endif - - .text - -/* ffi_call_win64 (void *stack, struct win64_call_frame *frame, void *r10) - - Bit o trickiness here -- FRAME is the base of the stack frame - for this function. This has been allocated by ffi_call. We also - deallocate some of the stack that has been alloca'd. */ - - .align 8 - .globl C(ffi_call_win64) - FFI_HIDDEN(C(ffi_call_win64)) - - SEH(.seh_proc ffi_call_win64) -C(ffi_call_win64): - cfi_startproc - _CET_ENDBR - /* Set up the local stack frame and install it in rbp/rsp. */ - movq (%rsp), %rax - movq %rbp, (arg1) - movq %rax, 8(arg1) - movq arg1, %rbp - cfi_def_cfa(%rbp, 16) - cfi_rel_offset(%rbp, 0) - SEH(.seh_pushreg %rbp) - SEH(.seh_setframe %rbp, 0) - SEH(.seh_endprologue) - movq arg0, %rsp - - movq arg2, %r10 - - /* Load all slots into both general and xmm registers. */ - movq (%rsp), %rcx - movsd (%rsp), %xmm0 - movq 8(%rsp), %rdx - movsd 8(%rsp), %xmm1 - movq 16(%rsp), %r8 - movsd 16(%rsp), %xmm2 - movq 24(%rsp), %r9 - movsd 24(%rsp), %xmm3 - - call *16(%rbp) - - movl 24(%rbp), %ecx - movq 32(%rbp), %r8 - leaq 0f(%rip), %r10 - cmpl $FFI_TYPE_SMALL_STRUCT_4B, %ecx - leaq (%r10, %rcx, 8), %r10 - ja 99f - _CET_NOTRACK jmp *%r10 - -/* Below, we're space constrained most of the time. Thus we eschew the - modern "mov, pop, ret" sequence (5 bytes) for "leave, ret" (2 bytes). */ -#define epilogue \ - leaveq; \ - cfi_remember_state; \ - cfi_def_cfa(%rsp, 8); \ - cfi_restore(%rbp); \ - ret; \ - cfi_restore_state - - .align 8 -0: -E(0b, FFI_TYPE_VOID) - epilogue -E(0b, FFI_TYPE_INT) - movslq %eax, %rax - movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_FLOAT) - movss %xmm0, (%r8) - epilogue -E(0b, FFI_TYPE_DOUBLE) - movsd %xmm0, (%r8) - epilogue -// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here. -E(0b, FFI_TYPE_DOUBLE + 1) - call PLT(C(abort)) -E(0b, FFI_TYPE_UINT8) - movzbl %al, %eax - movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_SINT8) - movsbq %al, %rax - jmp 98f -E(0b, FFI_TYPE_UINT16) - movzwl %ax, %eax - movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_SINT16) - movswq %ax, %rax - jmp 98f -E(0b, FFI_TYPE_UINT32) - movl %eax, %eax - movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_SINT32) - movslq %eax, %rax - movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_UINT64) -98: movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_SINT64) - movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_STRUCT) - epilogue -E(0b, FFI_TYPE_POINTER) - movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_COMPLEX) - call PLT(C(abort)) -E(0b, FFI_TYPE_SMALL_STRUCT_1B) - movb %al, (%r8) - epilogue -E(0b, FFI_TYPE_SMALL_STRUCT_2B) - movw %ax, (%r8) - epilogue -E(0b, FFI_TYPE_SMALL_STRUCT_4B) - movl %eax, (%r8) - epilogue - - .align 8 -99: call PLT(C(abort)) - - epilogue - - cfi_endproc - SEH(.seh_endproc) - - -/* 32 bytes of outgoing register stack space, 8 bytes of alignment, - 16 bytes of result, 32 bytes of xmm registers. */ -#define ffi_clo_FS (32+8+16+32) -#define ffi_clo_OFF_R (32+8) -#define ffi_clo_OFF_X (32+8+16) - - .align 8 - .globl C(ffi_go_closure_win64) - FFI_HIDDEN(C(ffi_go_closure_win64)) - - SEH(.seh_proc ffi_go_closure_win64) -C(ffi_go_closure_win64): - cfi_startproc - _CET_ENDBR - /* Save all integer arguments into the incoming reg stack space. */ - movq %rcx, 8(%rsp) - movq %rdx, 16(%rsp) - movq %r8, 24(%rsp) - movq %r9, 32(%rsp) - - movq 8(%r10), %rcx /* load cif */ - movq 16(%r10), %rdx /* load fun */ - movq %r10, %r8 /* closure is user_data */ - jmp 0f - cfi_endproc - SEH(.seh_endproc) - - .align 8 - .globl C(ffi_closure_win64) - FFI_HIDDEN(C(ffi_closure_win64)) - - SEH(.seh_proc ffi_closure_win64) -C(ffi_closure_win64): - cfi_startproc - _CET_ENDBR - /* Save all integer arguments into the incoming reg stack space. */ - movq %rcx, 8(%rsp) - movq %rdx, 16(%rsp) - movq %r8, 24(%rsp) - movq %r9, 32(%rsp) - - movq FFI_TRAMPOLINE_SIZE(%r10), %rcx /* load cif */ - movq FFI_TRAMPOLINE_SIZE+8(%r10), %rdx /* load fun */ - movq FFI_TRAMPOLINE_SIZE+16(%r10), %r8 /* load user_data */ -0: - subq $ffi_clo_FS, %rsp - cfi_adjust_cfa_offset(ffi_clo_FS) - SEH(.seh_stackalloc ffi_clo_FS) - SEH(.seh_endprologue) - - /* Save all sse arguments into the stack frame. */ - movsd %xmm0, ffi_clo_OFF_X(%rsp) - movsd %xmm1, ffi_clo_OFF_X+8(%rsp) - movsd %xmm2, ffi_clo_OFF_X+16(%rsp) - movsd %xmm3, ffi_clo_OFF_X+24(%rsp) - - leaq ffi_clo_OFF_R(%rsp), %r9 - call PLT(C(ffi_closure_win64_inner)) - - /* Load the result into both possible result registers. */ - movq ffi_clo_OFF_R(%rsp), %rax - movsd ffi_clo_OFF_R(%rsp), %xmm0 - - addq $ffi_clo_FS, %rsp - cfi_adjust_cfa_offset(-ffi_clo_FS) - ret - - cfi_endproc - SEH(.seh_endproc) - -#if defined(FFI_EXEC_STATIC_TRAMP) - .align 8 - .globl C(ffi_closure_win64_alt) - FFI_HIDDEN(C(ffi_closure_win64_alt)) - - SEH(.seh_proc ffi_closure_win64_alt) -C(ffi_closure_win64_alt): - _CET_ENDBR - movq 8(%rsp), %r10 - addq $16, %rsp - jmp C(ffi_closure_win64) - SEH(.seh_endproc) -#endif -#endif /* __x86_64__ */ - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif diff --git a/deps/libffi/src/x86/win64_intel.S b/deps/libffi/src/x86/win64_intel.S deleted file mode 100644 index 970a4f997a9811..00000000000000 --- a/deps/libffi/src/x86/win64_intel.S +++ /dev/null @@ -1,238 +0,0 @@ -#define LIBFFI_ASM -#include -#include -#include -#include "asmnames.h" - -#if defined(HAVE_AS_CFI_PSEUDO_OP) - .cfi_sections .debug_frame -#endif - -#ifdef X86_WIN64 -#define SEH(...) __VA_ARGS__ -#define arg0 rcx -#define arg1 rdx -#define arg2 r8 -#define arg3 r9 -#else -#define SEH(...) -#define arg0 rdi -#define arg1 rsi -#define arg2 rdx -#define arg3 rcx -#endif - -/* This macro allows the safe creation of jump tables without an - actual table. The entry points into the table are all 8 bytes. - The use of ORG asserts that we're at the correct location. */ -/* ??? The clang assembler doesn't handle .org with symbolic expressions. */ -#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) -# define E(BASE, X) ALIGN 8 -#else -# define E(BASE, X) ALIGN 8; ORG BASE + (X) * 8 -#endif - - .CODE - extern PLT(C(abort)):near - extern C(ffi_closure_win64_inner):near - -/* ffi_call_win64 (void *stack, struct win64_call_frame *frame, void *r10) - - Bit o trickiness here -- FRAME is the base of the stack frame - for this function. This has been allocated by ffi_call. We also - deallocate some of the stack that has been alloca'd. */ - - ALIGN 8 - PUBLIC C(ffi_call_win64) - - ; SEH(.safesh ffi_call_win64) -C(ffi_call_win64) proc SEH(frame) - cfi_startproc - /* Set up the local stack frame and install it in rbp/rsp. */ - mov RAX, [RSP] ; movq (%rsp), %rax - mov [arg1], RBP ; movq %rbp, (arg1) - mov [arg1 + 8], RAX; movq %rax, 8(arg1) - mov RBP, arg1; movq arg1, %rbp - cfi_def_cfa(rbp, 16) - cfi_rel_offset(rbp, 0) - SEH(.pushreg rbp) - SEH(.setframe rbp, 0) - SEH(.endprolog) - mov RSP, arg0 ; movq arg0, %rsp - - mov R10, arg2 ; movq arg2, %r10 - - /* Load all slots into both general and xmm registers. */ - mov RCX, [RSP] ; movq (%rsp), %rcx - movsd XMM0, qword ptr [RSP] ; movsd (%rsp), %xmm0 - mov RDX, [RSP + 8] ;movq 8(%rsp), %rdx - movsd XMM1, qword ptr [RSP + 8]; movsd 8(%rsp), %xmm1 - mov R8, [RSP + 16] ; movq 16(%rsp), %r8 - movsd XMM2, qword ptr [RSP + 16] ; movsd 16(%rsp), %xmm2 - mov R9, [RSP + 24] ; movq 24(%rsp), %r9 - movsd XMM3, qword ptr [RSP + 24] ;movsd 24(%rsp), %xmm3 - - CALL qword ptr [RBP + 16] ; call *16(%rbp) - - mov ECX, [RBP + 24] ; movl 24(%rbp), %ecx - mov R8, [RBP + 32] ; movq 32(%rbp), %r8 - LEA R10, ffi_call_win64_tab ; leaq 0f(%rip), %r10 - CMP ECX, FFI_TYPE_SMALL_STRUCT_4B ; cmpl $FFI_TYPE_SMALL_STRUCT_4B, %ecx - LEA R10, [R10 + RCX*8] ; leaq (%r10, %rcx, 8), %r10 - JA L99 ; ja 99f - JMP R10 ; jmp *%r10 - -/* Below, we're space constrained most of the time. Thus we eschew the - modern "mov, pop, ret" sequence (5 bytes) for "leave, ret" (2 bytes). */ -epilogue macro - LEAVE - cfi_remember_state - cfi_def_cfa(rsp, 8) - cfi_restore(rbp) - RET - cfi_restore_state -endm - - ALIGN 8 -ffi_call_win64_tab LABEL NEAR -E(0b, FFI_TYPE_VOID) - epilogue -E(0b, FFI_TYPE_INT) - movsxd rax, eax ; movslq %eax, %rax - mov qword ptr [r8], rax; movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_FLOAT) - movss dword ptr [r8], xmm0 ; movss %xmm0, (%r8) - epilogue -E(0b, FFI_TYPE_DOUBLE) - movsd qword ptr[r8], xmm0; movsd %xmm0, (%r8) - epilogue -// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here. -E(0b, FFI_TYPE_DOUBLE + 1) - call PLT(C(abort)) -E(0b, FFI_TYPE_UINT8) - movzx eax, al ;movzbl %al, %eax - mov qword ptr[r8], rax; movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_SINT8) - movsx rax, al ; movsbq %al, %rax - jmp L98 -E(0b, FFI_TYPE_UINT16) - movzx eax, ax ; movzwl %ax, %eax - mov qword ptr[r8], rax; movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_SINT16) - movsx rax, ax; movswq %ax, %rax - jmp L98 -E(0b, FFI_TYPE_UINT32) - mov eax, eax; movl %eax, %eax - mov qword ptr[r8], rax ; movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_SINT32) - movsxd rax, eax; movslq %eax, %rax - mov qword ptr [r8], rax; movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_UINT64) -L98 LABEL near - mov qword ptr [r8], rax ; movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_SINT64) - mov qword ptr [r8], rax;movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_STRUCT) - epilogue -E(0b, FFI_TYPE_POINTER) - mov qword ptr [r8], rax ;movq %rax, (%r8) - epilogue -E(0b, FFI_TYPE_COMPLEX) - call PLT(C(abort)) -E(0b, FFI_TYPE_SMALL_STRUCT_1B) - mov byte ptr [r8], al ; movb %al, (%r8) - epilogue -E(0b, FFI_TYPE_SMALL_STRUCT_2B) - mov word ptr [r8], ax ; movw %ax, (%r8) - epilogue -E(0b, FFI_TYPE_SMALL_STRUCT_4B) - mov dword ptr [r8], eax ; movl %eax, (%r8) - epilogue - - align 8 -L99 LABEL near - call PLT(C(abort)) - - epilogue - - cfi_endproc - C(ffi_call_win64) endp - - -/* 32 bytes of outgoing register stack space, 8 bytes of alignment, - 16 bytes of result, 32 bytes of xmm registers. */ -#define ffi_clo_FS (32+8+16+32) -#define ffi_clo_OFF_R (32+8) -#define ffi_clo_OFF_X (32+8+16) - - align 8 - PUBLIC C(ffi_go_closure_win64) - -C(ffi_go_closure_win64) proc - cfi_startproc - /* Save all integer arguments into the incoming reg stack space. */ - mov qword ptr [rsp + 8], rcx; movq %rcx, 8(%rsp) - mov qword ptr [rsp + 16], rdx; movq %rdx, 16(%rsp) - mov qword ptr [rsp + 24], r8; movq %r8, 24(%rsp) - mov qword ptr [rsp + 32], r9 ;movq %r9, 32(%rsp) - - mov rcx, qword ptr [r10 + 8]; movq 8(%r10), %rcx /* load cif */ - mov rdx, qword ptr [r10 + 16]; movq 16(%r10), %rdx /* load fun */ - mov r8, r10 ; movq %r10, %r8 /* closure is user_data */ - jmp ffi_closure_win64_2 - cfi_endproc - C(ffi_go_closure_win64) endp - - align 8 - -PUBLIC C(ffi_closure_win64) -C(ffi_closure_win64) PROC FRAME - cfi_startproc - /* Save all integer arguments into the incoming reg stack space. */ - mov qword ptr [rsp + 8], rcx; movq %rcx, 8(%rsp) - mov qword ptr [rsp + 16], rdx; movq %rdx, 16(%rsp) - mov qword ptr [rsp + 24], r8; movq %r8, 24(%rsp) - mov qword ptr [rsp + 32], r9; movq %r9, 32(%rsp) - - mov rcx, qword ptr [FFI_TRAMPOLINE_SIZE + r10] ;movq FFI_TRAMPOLINE_SIZE(%r10), %rcx /* load cif */ - mov rdx, qword ptr [FFI_TRAMPOLINE_SIZE + 8 + r10] ; movq FFI_TRAMPOLINE_SIZE+8(%r10), %rdx /* load fun */ - mov r8, qword ptr [FFI_TRAMPOLINE_SIZE+16+r10] ;movq FFI_TRAMPOLINE_SIZE+16(%r10), %r8 /* load user_data */ -ffi_closure_win64_2 LABEL near - sub rsp, ffi_clo_FS ;subq $ffi_clo_FS, %rsp - cfi_adjust_cfa_offset(ffi_clo_FS) - SEH(.allocstack ffi_clo_FS) - SEH(.endprolog) - - /* Save all sse arguments into the stack frame. */ - movsd qword ptr [ffi_clo_OFF_X + rsp], xmm0 ; movsd %xmm0, ffi_clo_OFF_X(%rsp) - movsd qword ptr [ffi_clo_OFF_X+8+rsp], xmm1 ; movsd %xmm1, ffi_clo_OFF_X+8(%rsp) - movsd qword ptr [ffi_clo_OFF_X+16+rsp], xmm2 ; movsd %xmm2, ffi_clo_OFF_X+16(%rsp) - movsd qword ptr [ffi_clo_OFF_X+24+rsp], xmm3 ; movsd %xmm3, ffi_clo_OFF_X+24(%rsp) - - lea r9, [ffi_clo_OFF_R + rsp] ; leaq ffi_clo_OFF_R(%rsp), %r9 - call C(ffi_closure_win64_inner) - - /* Load the result into both possible result registers. */ - - mov rax, qword ptr [ffi_clo_OFF_R + rsp] ;movq ffi_clo_OFF_R(%rsp), %rax - movsd xmm0, qword ptr [rsp + ffi_clo_OFF_R] ;movsd ffi_clo_OFF_R(%rsp), %xmm0 - - add rsp, ffi_clo_FS ;addq $ffi_clo_FS, %rsp - cfi_adjust_cfa_offset(-ffi_clo_FS) - ret - - cfi_endproc - C(ffi_closure_win64) endp - -#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits -#endif -_text ends -end \ No newline at end of file diff --git a/deps/libffi/src/xtensa/ffi.c b/deps/libffi/src/xtensa/ffi.c deleted file mode 100644 index 82b42a16d25307..00000000000000 --- a/deps/libffi/src/xtensa/ffi.c +++ /dev/null @@ -1,306 +0,0 @@ -/* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2013 Tensilica, Inc. - - XTENSA Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#include -#include - -/* - |----------------------------------------| - | | - on entry to ffi_call ----> |----------------------------------------| - | caller stack frame for registers a0-a3 | - |----------------------------------------| - | | - | additional arguments | - entry of the function ---> |----------------------------------------| - | copy of function arguments a2-a7 | - | - - - - - - - - - - - - - | - | | - - The area below the entry line becomes the new stack frame for the function. - -*/ - - -#define FFI_TYPE_STRUCT_REGS FFI_TYPE_LAST - - -extern void ffi_call_SYSV(void *rvalue, unsigned rsize, unsigned flags, - void(*fn)(void), unsigned nbytes, extended_cif*); -extern void ffi_closure_SYSV(void) FFI_HIDDEN; - -ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -{ - switch(cif->rtype->type) { - case FFI_TYPE_SINT8: - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT16: - case FFI_TYPE_UINT16: - cif->flags = cif->rtype->type; - break; - case FFI_TYPE_VOID: - case FFI_TYPE_FLOAT: - cif->flags = FFI_TYPE_UINT32; - break; - case FFI_TYPE_DOUBLE: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - cif->flags = FFI_TYPE_UINT64; // cif->rtype->type; - break; - case FFI_TYPE_STRUCT: - cif->flags = FFI_TYPE_STRUCT; //_REGS; - /* Up to 16 bytes are returned in registers */ - if (cif->rtype->size > 4 * 4) { - /* returned structure is referenced by a register; use 8 bytes - (including 4 bytes for potential additional alignment) */ - cif->flags = FFI_TYPE_STRUCT; - cif->bytes += 8; - } - break; - - default: - cif->flags = FFI_TYPE_UINT32; - break; - } - - /* Round up stack size needed for arguments. - Allocate FFI_REGISTER_ARGS_SPACE bytes when there are only arguments - passed in registers, round space reserved for arguments passed on stack - up to ABI-specified alignment. */ - if (cif->bytes < FFI_REGISTER_NARGS * 4) - cif->bytes = FFI_REGISTER_ARGS_SPACE; - else - cif->bytes = FFI_REGISTER_ARGS_SPACE + - FFI_ALIGN(cif->bytes - FFI_REGISTER_NARGS * 4, - XTENSA_STACK_ALIGNMENT); - return FFI_OK; -} - -void ffi_prep_args(extended_cif *ecif, unsigned char* stack) -{ - unsigned int i; - unsigned long *addr; - ffi_type **ptr; - - union { - void **v; - char **c; - signed char **sc; - unsigned char **uc; - signed short **ss; - unsigned short **us; - unsigned int **i; - long long **ll; - float **f; - double **d; - } p_argv; - - /* Verify that everything is aligned up properly */ - FFI_ASSERT (((unsigned long) stack & 0x7) == 0); - - p_argv.v = ecif->avalue; - addr = (unsigned long*)stack; - - /* structures with a size greater than 16 bytes are passed in memory */ - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 16) - { - *addr++ = (unsigned long)ecif->rvalue; - } - - for (i = ecif->cif->nargs, ptr = ecif->cif->arg_types; - i > 0; - i--, ptr++, p_argv.v++) - { - switch ((*ptr)->type) - { - case FFI_TYPE_SINT8: - *addr++ = **p_argv.sc; - break; - case FFI_TYPE_UINT8: - *addr++ = **p_argv.uc; - break; - case FFI_TYPE_SINT16: - *addr++ = **p_argv.ss; - break; - case FFI_TYPE_UINT16: - *addr++ = **p_argv.us; - break; - case FFI_TYPE_FLOAT: - case FFI_TYPE_INT: - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - case FFI_TYPE_POINTER: - *addr++ = **p_argv.i; - break; - case FFI_TYPE_DOUBLE: - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: - if (((unsigned long)addr & 4) != 0) - addr++; - *(unsigned long long*)addr = **p_argv.ll; - addr += sizeof(unsigned long long) / sizeof (addr); - break; - - case FFI_TYPE_STRUCT: - { - unsigned long offs; - unsigned long size; - - if (((unsigned long)addr & 4) != 0 && (*ptr)->alignment > 4) - addr++; - - offs = (unsigned long) addr - (unsigned long) stack; - size = (*ptr)->size; - - /* Entire structure must fit the argument registers or referenced */ - if (offs < FFI_REGISTER_NARGS * 4 - && offs + size > FFI_REGISTER_NARGS * 4) - addr = (unsigned long*) (stack + FFI_REGISTER_NARGS * 4); - - memcpy((char*) addr, *p_argv.c, size); - addr += (size + 3) / 4; - break; - } - - default: - FFI_ASSERT(0); - } - } -} - - -void ffi_call(ffi_cif* cif, void(*fn)(void), void *rvalue, void **avalue) -{ - extended_cif ecif; - unsigned long rsize = cif->rtype->size; - int flags = cif->flags; - void *alloc = NULL; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* Note that for structures that are returned in registers (size <= 16 bytes) - we allocate a temporary buffer and use memcpy to copy it to the final - destination. The reason is that the target address might be misaligned or - the length not a multiple of 4 bytes. Handling all those cases would be - very complex. */ - - if (flags == FFI_TYPE_STRUCT && (rsize <= 16 || rvalue == NULL)) - { - alloc = alloca(FFI_ALIGN(rsize, 4)); - ecif.rvalue = alloc; - } - else - { - ecif.rvalue = rvalue; - } - - if (cif->abi != FFI_SYSV) - FFI_ASSERT(0); - - ffi_call_SYSV (ecif.rvalue, rsize, cif->flags, fn, cif->bytes, &ecif); - - if (alloc != NULL && rvalue != NULL) - memcpy(rvalue, alloc, rsize); -} - -extern void ffi_trampoline(); -extern void ffi_cacheflush(void* start, void* end); - -ffi_status -ffi_prep_closure_loc (ffi_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*, void*, void**, void*), - void *user_data, - void *codeloc) -{ - if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - /* copye trampoline to stack and patch 'ffi_closure_SYSV' pointer */ - memcpy(closure->tramp, ffi_trampoline, FFI_TRAMPOLINE_SIZE); - *(unsigned int*)(&closure->tramp[8]) = (unsigned int)ffi_closure_SYSV; - - // Do we have this function? - // __builtin___clear_cache(closer->tramp, closer->tramp + FFI_TRAMPOLINE_SIZE) - ffi_cacheflush(closure->tramp, closure->tramp + FFI_TRAMPOLINE_SIZE); - - closure->cif = cif; - closure->fun = fun; - closure->user_data = user_data; - return FFI_OK; -} - - -long FFI_HIDDEN -ffi_closure_SYSV_inner(ffi_closure *closure, void **values, void *rvalue) -{ - ffi_cif *cif; - ffi_type **arg_types; - void **avalue; - int i, areg; - - cif = closure->cif; - if (cif->abi != FFI_SYSV) - return FFI_BAD_ABI; - - areg = 0; - - int rtype = cif->rtype->type; - if (rtype == FFI_TYPE_STRUCT && cif->rtype->size > 4 * 4) - { - rvalue = *values; - areg++; - } - - cif = closure->cif; - arg_types = cif->arg_types; - avalue = alloca(cif->nargs * sizeof(void *)); - - for (i = 0; i < cif->nargs; i++) - { - if (arg_types[i]->alignment == 8 && (areg & 1) != 0) - areg++; - - // skip the entry a1, * framework, see ffi_trampoline - if (areg == FFI_REGISTER_NARGS) - areg = (FFI_REGISTER_ARGS_SPACE + 32) / 4; - - if (arg_types[i]->type == FFI_TYPE_STRUCT) - { - int numregs = ((arg_types[i]->size + 3) & ~3) / 4; - if (areg < FFI_REGISTER_NARGS && areg + numregs > FFI_REGISTER_NARGS) - areg = (FFI_REGISTER_ARGS_SPACE + 32) / 4; - } - - avalue[i] = &values[areg]; - areg += (arg_types[i]->size + 3) / 4; - } - - (closure->fun)(cif, rvalue, avalue, closure->user_data); - - return rtype; -} diff --git a/deps/libffi/src/xtensa/ffitarget.h b/deps/libffi/src/xtensa/ffitarget.h deleted file mode 100644 index 4231ed374ebe47..00000000000000 --- a/deps/libffi/src/xtensa/ffitarget.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2013 Tensilica, Inc. - Target configuration macros for XTENSA. - - 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. - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV -} ffi_abi; -#endif - -#define FFI_REGISTER_NARGS 6 -#define XTENSA_STACK_ALIGNMENT 16 -#define FFI_REGISTER_ARGS_SPACE ((FFI_REGISTER_NARGS * 4 + \ - XTENSA_STACK_ALIGNMENT - 1) & \ - -XTENSA_STACK_ALIGNMENT) - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 -#define FFI_TRAMPOLINE_SIZE 24 - -#endif diff --git a/deps/libffi/src/xtensa/sysv.S b/deps/libffi/src/xtensa/sysv.S deleted file mode 100644 index 70e83ac2283e2e..00000000000000 --- a/deps/libffi/src/xtensa/sysv.S +++ /dev/null @@ -1,268 +0,0 @@ -/* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2013 Tensilica, Inc. - - XTENSA Foreign Function Interface - - 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. - ----------------------------------------------------------------------- */ - -#define LIBFFI_ASM -#include -#include - -#define ENTRY(name) .text; .globl name; .type name,@function; .align 4; name: -#define END(name) .size name , . - name - -/* Assert that the table below is in sync with ffi.h. */ - -#if FFI_TYPE_UINT8 != 5 \ - || FFI_TYPE_SINT8 != 6 \ - || FFI_TYPE_UINT16 != 7 \ - || FFI_TYPE_SINT16 != 8 \ - || FFI_TYPE_UINT32 != 9 \ - || FFI_TYPE_SINT32 != 10 \ - || FFI_TYPE_UINT64 != 11 -#error "xtensa/sysv.S out of sync with ffi.h" -#endif - -#define FFI_REGISTER_ARGS_OFFSET ((XTENSA_STACK_ALIGNMENT - \ - FFI_REGISTER_NARGS * 4) & \ - (XTENSA_STACK_ALIGNMENT - 1)) - -/* ffi_call_SYSV (rvalue, rbytes, flags, (*fnaddr)(), bytes, ecif) - void *rvalue; a2 - unsigned long rbytes; a3 - unsigned flags; a4 - void (*fnaddr)(); a5 - unsigned long bytes; a6 - extended_cif* ecif) a7 -*/ - -ENTRY(ffi_call_SYSV) - - entry a1, 32 # 32 byte frame for using call8 below - - mov a10, a7 # a10(->arg0): ecif - sub a11, a1, a6 # a11(->arg1): stack pointer - mov a7, a1 # fp - movsp a1, a11 # set new sp = old_sp - bytes - - # align ffi_prep_args stack argument so that arguments - # passed on stack if any start on 16-byte aligned boundary - - addi a11, a11, FFI_REGISTER_ARGS_OFFSET - - movi a8, ffi_prep_args - callx8 a8 # ffi_prep_args(ecif, stack) - - # prepare to move stack pointer back - # to point to arguments passed on stack - - addi a6, a1, FFI_REGISTER_ARGS_SPACE - - # we can pass up to 6 arguments in registers - # for simplicity, just load 6 arguments - - l32i a10, a1, FFI_REGISTER_ARGS_OFFSET + 0 - l32i a11, a1, FFI_REGISTER_ARGS_OFFSET + 4 - l32i a12, a1, FFI_REGISTER_ARGS_OFFSET + 8 - l32i a13, a1, FFI_REGISTER_ARGS_OFFSET + 12 - l32i a14, a1, FFI_REGISTER_ARGS_OFFSET + 16 - l32i a15, a1, FFI_REGISTER_ARGS_OFFSET + 20 - - # move stack pointer - - movsp a1, a6 - - callx8 a5 # (*fn)(args...) - - # Handle return value(s) - - beqz a2, .Lexit - - movi a5, FFI_TYPE_STRUCT - bne a4, a5, .Lstore - movi a5, 16 - blt a5, a3, .Lexit - - s32i a10, a2, 0 - blti a3, 5, .Lexit - addi a3, a3, -1 - s32i a11, a2, 4 - blti a3, 8, .Lexit - s32i a12, a2, 8 - blti a3, 12, .Lexit - s32i a13, a2, 12 - -.Lexit: retw - -.Lstore: - addi a4, a4, -FFI_TYPE_UINT8 - bgei a4, 7, .Lexit # should never happen - movi a6, store_calls - add a4, a4, a4 - addx4 a6, a4, a6 # store_table + idx * 8 - jx a6 - - .align 8 -store_calls: - # UINT8 - s8i a10, a2, 0 - retw - - # SINT8 - .align 8 - s8i a10, a2, 0 - retw - - # UINT16 - .align 8 - s16i a10, a2, 0 - retw - - # SINT16 - .align 8 - s16i a10, a2, 0 - retw - - # UINT32 - .align 8 - s32i a10, a2, 0 - retw - - # SINT32 - .align 8 - s32i a10, a2, 0 - retw - - # UINT64 - .align 8 - s32i a10, a2, 0 - s32i a11, a2, 4 - retw - -END(ffi_call_SYSV) - - -/* - * void ffi_cacheflush (unsigned long start, unsigned long end) - */ - -#define EXTRA_ARGS_SIZE 24 - -ENTRY(ffi_cacheflush) - - entry a1, 32 - -1: -#if XCHAL_DCACHE_SIZE - dhwbi a2, 0 -#endif -#if XCHAL_ICACHE_SIZE - ihi a2, 0 -#endif - addi a2, a2, 4 - blt a2, a3, 1b - - retw - -END(ffi_cacheflush) - -/* ffi_trampoline is copied to the stack */ - -ENTRY(ffi_trampoline) - - /* 32 bytes for spill + spill overflow area of a frame that uses - call8, - FFI_REGISTER_NARGS * 4 bytes for arguments passed in registers, - aligned up to 4 to maintain 16 byte stack alignment, - 4 * 4 bytes for the result. - This size must be in sync with ffi_closure_SYSV_inner logic. - */ - entry a1, 32 + FFI_REGISTER_ARGS_SPACE + (4 * 4) # [ 0] - j 2f # [ 3] - .align 4 # [ 6] -1: .long 0 # [ 8] -2: l32r a15, 1b # [12] - _mov a14, a0 # [15] - callx0 a15 # [18] - # [21] -END(ffi_trampoline) - -/* - * ffi_closure() - * - * a0: closure + 21 - * a14: return address (a0) - */ - -ENTRY(ffi_closure_SYSV) - - /* intentionally omitting entry here */ - - # restore return address (a0) and move pointer to closure to a10 - addi a10, a0, -21 - mov a0, a14 - - # allow up to 4 arguments as return values - addi a11, a1, 4 * 4 - - # save up to 6 arguments to stack (allocated by entry below) - s32i a2, a11, 0 - s32i a3, a11, 4 - s32i a4, a11, 8 - s32i a5, a11, 12 - s32i a6, a11, 16 - s32i a7, a11, 20 - - movi a8, ffi_closure_SYSV_inner - mov a12, a1 - callx8 a8 # .._inner(*closure, **avalue, *rvalue) - - # load up to four return arguments - l32i a2, a1, 0 - l32i a3, a1, 4 - l32i a4, a1, 8 - l32i a5, a1, 12 - - # (sign-)extend return value - movi a11, FFI_TYPE_UINT8 - bne a10, a11, 1f - extui a2, a2, 0, 8 - retw - -1: movi a11, FFI_TYPE_SINT8 - bne a10, a11, 1f - sext a2, a2, 7 - retw - -1: movi a11, FFI_TYPE_UINT16 - bne a10, a11, 1f - extui a2, a2, 0, 16 - retw - -1: movi a11, FFI_TYPE_SINT16 - bne a10, a11, 1f - sext a2, a2, 15 - -1: retw - -END(ffi_closure_SYSV) diff --git a/deps/libffi/stamp-h.in b/deps/libffi/stamp-h.in deleted file mode 100644 index 9788f70238c918..00000000000000 --- a/deps/libffi/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/deps/nbytes/.release-please-manifest.json b/deps/nbytes/.release-please-manifest.json index 88f7c73eadc71b..c05df9b5541987 100644 --- a/deps/nbytes/.release-please-manifest.json +++ b/deps/nbytes/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.4" + ".": "0.1.3" } diff --git a/deps/nbytes/CHANGELOG.md b/deps/nbytes/CHANGELOG.md index 5a740eb2350667..067a946eb30cbd 100644 --- a/deps/nbytes/CHANGELOG.md +++ b/deps/nbytes/CHANGELOG.md @@ -1,12 +1,5 @@ # Changelog -## [0.1.4](https://github.com/nodejs/nbytes/compare/v0.1.3...v0.1.4) (2026-04-09) - - -### Bug Fixes - -* **build:** add `NBYTES_ENABLE_TESTING` CMake option ([#15](https://github.com/nodejs/nbytes/issues/15)) ([e1c6be3](https://github.com/nodejs/nbytes/commit/e1c6be3ed112f2375207c7626e10961e92d3f69f)) - ## [0.1.3](https://github.com/nodejs/nbytes/compare/v0.1.2...v0.1.3) (2026-02-18) diff --git a/deps/nbytes/CMakeLists.txt b/deps/nbytes/CMakeLists.txt index b3d7c897b91ed4..5ac0e31aaa4fce 100644 --- a/deps/nbytes/CMakeLists.txt +++ b/deps/nbytes/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.28) -project(nbytes VERSION 0.1.4) # x-release-please-version +project(nbytes VERSION 0.1.3) # x-release-please-version set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) @@ -12,26 +12,18 @@ option(NBYTES_DEVELOPMENT_CHECKS "Enable development checks" OFF) include(GNUInstallDirs) include(FetchContent) -include(CTest) - -option(NBYTES_ENABLE_TESTING "Enable testing" ${BUILD_TESTING}) +FetchContent_Declare( + googletest + URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip +) +# For Windows: Prevent overriding the parent project's compiler/linker settings +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(googletest) add_subdirectory(src) - -if (NBYTES_ENABLE_TESTING) - FetchContent_Declare( - googletest - URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip - URL_HASH SHA256=edd885a1ab32b6999515a880f669efadb80b3f880215f315985fa3f6eca7c4d3 - FIND_PACKAGE_ARGS NAMES GTest - ) - # For Windows: Prevent overriding the parent project's compiler/linker settings - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - FetchContent_MakeAvailable(googletest) - - add_subdirectory(tests) -endif() +enable_testing() +add_subdirectory(tests) install( FILES include/nbytes.h diff --git a/deps/nbytes/include/nbytes.h b/deps/nbytes/include/nbytes.h index 27f1449c620124..3a2bcc605bfa58 100644 --- a/deps/nbytes/include/nbytes.h +++ b/deps/nbytes/include/nbytes.h @@ -836,12 +836,12 @@ size_t SearchString(const char *haystack, size_t haystack_length, // ============================================================================ // Version metadata -#define NBYTES_VERSION "0.1.4" // x-release-please-version +#define NBYTES_VERSION "0.1.3" // x-release-please-version enum { NBYTES_VERSION_MAJOR = 0, // x-release-please-major NBYTES_VERSION_MINOR = 1, // x-release-please-minor - NBYTES_VERSION_REVISION = 4, // x-release-please-patch + NBYTES_VERSION_REVISION = 3, // x-release-please-patch }; } // namespace nbytes diff --git a/deps/openssl/config/archs/BSD-x86/asm/configdata.pm b/deps/openssl/config/archs/BSD-x86/asm/configdata.pm index ebcc78c024f28c..07cc9e9cbf3872 100644 --- a/deps/openssl/config/archs/BSD-x86/asm/configdata.pm +++ b/deps/openssl/config/archs/BSD-x86/asm/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -233,7 +233,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -286,11 +286,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "BSD-x86", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4327,9 +4327,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7021,9 +7018,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12263,22 +12257,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14974,9 +14952,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17668,9 +17643,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19712,7 +19684,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23344,7 +23315,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/BSD-x86/asm/crypto/buildinf.h b/deps/openssl/config/archs/BSD-x86/asm/crypto/buildinf.h index 99d3f77c501a7e..05ad16c7cc7f0a 100644 --- a/deps/openssl/config/archs/BSD-x86/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/BSD-x86/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86" -#define DATE "built on: Tue Apr 7 19:05:06 2026 UTC" +#define DATE "built on: Tue Jan 27 17:25:31 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/BSD-x86/asm/include/openssl/cmp.h b/deps/openssl/config/archs/BSD-x86/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/BSD-x86/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/BSD-x86/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/BSD-x86/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/BSD-x86/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/BSD-x86/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/BSD-x86/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/BSD-x86/asm_avx2/configdata.pm b/deps/openssl/config/archs/BSD-x86/asm_avx2/configdata.pm index 887af11925a074..16cbc1eba9a7bf 100644 --- a/deps/openssl/config/archs/BSD-x86/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/BSD-x86/asm_avx2/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -233,7 +233,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -286,11 +286,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "BSD-x86", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4327,9 +4327,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7021,9 +7018,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12263,22 +12257,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14974,9 +14952,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17668,9 +17643,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19712,7 +19684,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23344,7 +23315,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/BSD-x86/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/BSD-x86/asm_avx2/crypto/buildinf.h index e86d72158d72ae..bbc0f092862b9c 100644 --- a/deps/openssl/config/archs/BSD-x86/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/BSD-x86/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86" -#define DATE "built on: Tue Apr 7 19:05:23 2026 UTC" +#define DATE "built on: Tue Jan 27 17:25:49 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/BSD-x86/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/BSD-x86/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/BSD-x86/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/BSD-x86/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/BSD-x86/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/BSD-x86/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/BSD-x86/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/BSD-x86/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/BSD-x86/no-asm/configdata.pm b/deps/openssl/config/archs/BSD-x86/no-asm/configdata.pm index 1a536897cfb686..50be625354db51 100644 --- a/deps/openssl/config/archs/BSD-x86/no-asm/configdata.pm +++ b/deps/openssl/config/archs/BSD-x86/no-asm/configdata.pm @@ -169,7 +169,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -232,7 +232,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -286,11 +286,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "BSD-x86", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4269,9 +4269,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6963,9 +6960,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12183,22 +12177,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14894,9 +14872,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17588,9 +17563,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19632,7 +19604,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23261,7 +23232,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/BSD-x86/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/BSD-x86/no-asm/crypto/buildinf.h index 4a478e9d240c50..898e10558fbee7 100644 --- a/deps/openssl/config/archs/BSD-x86/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/BSD-x86/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86" -#define DATE "built on: Tue Apr 7 19:05:40 2026 UTC" +#define DATE "built on: Tue Jan 27 17:26:06 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/BSD-x86/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/BSD-x86/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/BSD-x86/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/BSD-x86/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/BSD-x86/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/BSD-x86/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/BSD-x86/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/BSD-x86/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/configdata.pm b/deps/openssl/config/archs/BSD-x86_64/asm/configdata.pm index f5c6dd504e6cd0..dce49bb95f9a4c 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/configdata.pm +++ b/deps/openssl/config/archs/BSD-x86_64/asm/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -233,7 +233,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -286,11 +286,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "BSD-x86_64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4334,9 +4334,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7028,9 +7025,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12320,22 +12314,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15031,9 +15009,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17725,9 +17700,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19769,7 +19741,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23401,7 +23372,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/buildinf.h b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/buildinf.h index fe7cab5b3a016f..874c5ef38eb7c0 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/BSD-x86_64/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86_64" -#define DATE "built on: Tue Apr 7 19:05:56 2026 UTC" +#define DATE "built on: Tue Jan 27 17:26:21 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/cmp.h b/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/BSD-x86_64/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/BSD-x86_64/asm_avx2/configdata.pm b/deps/openssl/config/archs/BSD-x86_64/asm_avx2/configdata.pm index 478035f0b82b57..767a367eefd07c 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/BSD-x86_64/asm_avx2/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -233,7 +233,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -286,11 +286,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "BSD-x86_64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4334,9 +4334,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7028,9 +7025,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12320,22 +12314,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15031,9 +15009,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17725,9 +17700,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19769,7 +19741,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23401,7 +23372,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h index aebef2827610b2..62b37842141c4f 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86_64" -#define DATE "built on: Tue Apr 7 19:06:20 2026 UTC" +#define DATE "built on: Tue Jan 27 17:26:46 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/BSD-x86_64/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/BSD-x86_64/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/BSD-x86_64/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/BSD-x86_64/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/BSD-x86_64/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/BSD-x86_64/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/BSD-x86_64/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/BSD-x86_64/no-asm/configdata.pm b/deps/openssl/config/archs/BSD-x86_64/no-asm/configdata.pm index 334ad17fa2349b..9556fffc9896b6 100644 --- a/deps/openssl/config/archs/BSD-x86_64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/BSD-x86_64/no-asm/configdata.pm @@ -169,7 +169,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -232,7 +232,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -286,11 +286,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "BSD-x86_64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4270,9 +4270,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6964,9 +6961,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12184,22 +12178,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14895,9 +14873,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17589,9 +17564,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19633,7 +19605,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23262,7 +23233,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/BSD-x86_64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/BSD-x86_64/no-asm/crypto/buildinf.h index 5f424e6b046144..f2723e8e33b750 100644 --- a/deps/openssl/config/archs/BSD-x86_64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/BSD-x86_64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: BSD-x86_64" -#define DATE "built on: Tue Apr 7 19:06:40 2026 UTC" +#define DATE "built on: Tue Jan 27 17:27:07 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/BSD-x86_64/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/VC-WIN32/asm/configdata.pm b/deps/openssl/config/archs/VC-WIN32/asm/configdata.pm index e60dc8712c15f1..59d9d37cad68a4 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN32/asm/configdata.pm @@ -179,7 +179,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -244,7 +244,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -297,11 +297,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "VC-WIN32", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "lib", @@ -316,7 +316,7 @@ our %target = ( "LDFLAGS" => "/nologo /debug", "MT" => "mt", "MTFLAGS" => "-nologo", - "RANLIB" => "CODE(0x55f511b27e00)", + "RANLIB" => "CODE(0x55bb5bcbbe30)", "RC" => "rc", "_conf_fname_int" => [ "Configurations/00-base-templates.conf", @@ -4369,9 +4369,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7063,9 +7060,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12316,22 +12310,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15027,9 +15005,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17721,9 +17696,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19781,7 +19753,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23419,7 +23390,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/VC-WIN32/asm/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN32/asm/crypto/buildinf.h index ff9a3575364f9a..7b4d4fdd28ded0 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN32/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 7 19:19:01 2026 UTC" +#define DATE "built on: Tue Jan 27 17:39:36 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/cmp.h b/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/cmp.h index 5db0024167c334..8f3825a2402e6e 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/opensslv.h index f55a17e73bb202..d99943f3e9a9bf 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/VC-WIN32/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/VC-WIN32/asm_avx2/configdata.pm b/deps/openssl/config/archs/VC-WIN32/asm_avx2/configdata.pm index 3b583a1604fdef..a4016be69e646a 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN32/asm_avx2/configdata.pm @@ -179,7 +179,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -244,7 +244,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -297,11 +297,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "VC-WIN32", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "lib", @@ -316,7 +316,7 @@ our %target = ( "LDFLAGS" => "/nologo /debug", "MT" => "mt", "MTFLAGS" => "-nologo", - "RANLIB" => "CODE(0x55d87aeabb20)", + "RANLIB" => "CODE(0x56558750c810)", "RC" => "rc", "_conf_fname_int" => [ "Configurations/00-base-templates.conf", @@ -4369,9 +4369,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7063,9 +7060,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12316,22 +12310,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15027,9 +15005,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17721,9 +17696,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19781,7 +19753,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23419,7 +23390,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/VC-WIN32/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN32/asm_avx2/crypto/buildinf.h index b2f63d36318912..ac3f33df3c0a86 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN32/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 7 19:19:16 2026 UTC" +#define DATE "built on: Tue Jan 27 17:39:51 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/VC-WIN32/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/VC-WIN32/asm_avx2/include/openssl/cmp.h index 5db0024167c334..8f3825a2402e6e 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/VC-WIN32/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/VC-WIN32/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/VC-WIN32/asm_avx2/include/openssl/opensslv.h index f55a17e73bb202..d99943f3e9a9bf 100644 --- a/deps/openssl/config/archs/VC-WIN32/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/VC-WIN32/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/VC-WIN32/no-asm/configdata.pm b/deps/openssl/config/archs/VC-WIN32/no-asm/configdata.pm index 1a6e3cf8c2946c..d7d59ee06e3f22 100644 --- a/deps/openssl/config/archs/VC-WIN32/no-asm/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN32/no-asm/configdata.pm @@ -177,7 +177,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -243,7 +243,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -297,11 +297,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "VC-WIN32", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "lib", @@ -316,7 +316,7 @@ our %target = ( "LDFLAGS" => "/nologo /debug", "MT" => "mt", "MTFLAGS" => "-nologo", - "RANLIB" => "CODE(0x55edcbaf5480)", + "RANLIB" => "CODE(0x5592ffbf0880)", "RC" => "rc", "_conf_fname_int" => [ "Configurations/00-base-templates.conf", @@ -4311,9 +4311,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7005,9 +7002,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12236,22 +12230,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14947,9 +14925,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17641,9 +17616,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19701,7 +19673,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23336,7 +23307,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/VC-WIN32/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN32/no-asm/crypto/buildinf.h index ff9ca9189277d6..1fb6ab1a1a46ed 100644 --- a/deps/openssl/config/archs/VC-WIN32/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN32/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 7 19:19:30 2026 UTC" +#define DATE "built on: Tue Jan 27 17:40:06 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/cmp.h index 5db0024167c334..8f3825a2402e6e 100644 --- a/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/opensslv.h index f55a17e73bb202..d99943f3e9a9bf 100644 --- a/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/VC-WIN32/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/configdata.pm b/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/configdata.pm index adb06078140fb2..2e30b8f26a6e7d 100644 --- a/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/configdata.pm @@ -177,7 +177,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -241,7 +241,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -295,11 +295,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "VC-WIN64-ARM", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "lib", @@ -312,7 +312,7 @@ our %target = ( "LDFLAGS" => "/nologo /debug", "MT" => "mt", "MTFLAGS" => "-nologo", - "RANLIB" => "CODE(0x561c37957ce0)", + "RANLIB" => "CODE(0x55999cb2b9a0)", "RC" => "rc", "_conf_fname_int" => [ "Configurations/00-base-templates.conf", @@ -4303,9 +4303,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6997,9 +6994,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12228,22 +12222,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14939,9 +14917,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17633,9 +17608,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19693,7 +19665,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23328,7 +23299,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h index b6a6162def622a..5ba5c0abed2166 100644 --- a/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: VC-WIN64-ARM" -#define DATE "built on: Tue Apr 7 19:19:44 2026 UTC" +#define DATE "built on: Tue Jan 27 17:40:20 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/include/openssl/cmp.h index 5db0024167c334..8f3825a2402e6e 100644 --- a/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslv.h index f55a17e73bb202..d99943f3e9a9bf 100644 --- a/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/configdata.pm b/deps/openssl/config/archs/VC-WIN64A/asm/configdata.pm index 98c8ba4d9af990..8d8b179464192f 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN64A/asm/configdata.pm @@ -181,7 +181,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -246,7 +246,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -299,11 +299,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "VC-WIN64A", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "lib", @@ -318,7 +318,7 @@ our %target = ( "LDFLAGS" => "/nologo /debug", "MT" => "mt", "MTFLAGS" => "-nologo", - "RANLIB" => "CODE(0x556ba0b03270)", + "RANLIB" => "CODE(0x55b7c154fd80)", "RC" => "rc", "_conf_fname_int" => [ "Configurations/00-base-templates.conf", @@ -4378,9 +4378,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7072,9 +7069,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12365,22 +12359,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15076,9 +15054,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17770,9 +17745,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19830,7 +19802,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23468,7 +23439,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/buildinf.h index 5cfa6f62379bc6..b4f1193cd628b9 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN64A/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 7 19:18:02 2026 UTC" +#define DATE "built on: Tue Jan 27 17:38:37 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/cmp.h b/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/cmp.h index 5db0024167c334..8f3825a2402e6e 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/opensslv.h index f55a17e73bb202..d99943f3e9a9bf 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/VC-WIN64A/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/VC-WIN64A/asm_avx2/configdata.pm b/deps/openssl/config/archs/VC-WIN64A/asm_avx2/configdata.pm index 3d067b6fdbac26..0df1592755c740 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN64A/asm_avx2/configdata.pm @@ -181,7 +181,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -246,7 +246,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -299,11 +299,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "VC-WIN64A", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "lib", @@ -318,7 +318,7 @@ our %target = ( "LDFLAGS" => "/nologo /debug", "MT" => "mt", "MTFLAGS" => "-nologo", - "RANLIB" => "CODE(0x558ad9c80070)", + "RANLIB" => "CODE(0x55db31fd7f80)", "RC" => "rc", "_conf_fname_int" => [ "Configurations/00-base-templates.conf", @@ -4378,9 +4378,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7072,9 +7069,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12365,22 +12359,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15076,9 +15054,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17770,9 +17745,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19830,7 +19802,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23468,7 +23439,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h index 886119aa21e00c..6278671a045897 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 7 19:18:25 2026 UTC" +#define DATE "built on: Tue Jan 27 17:39:00 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/VC-WIN64A/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/VC-WIN64A/asm_avx2/include/openssl/cmp.h index 5db0024167c334..8f3825a2402e6e 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/VC-WIN64A/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/VC-WIN64A/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/VC-WIN64A/asm_avx2/include/openssl/opensslv.h index f55a17e73bb202..d99943f3e9a9bf 100644 --- a/deps/openssl/config/archs/VC-WIN64A/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/VC-WIN64A/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/VC-WIN64A/no-asm/configdata.pm b/deps/openssl/config/archs/VC-WIN64A/no-asm/configdata.pm index c82d9c98a1557a..b5c4c040647e0a 100644 --- a/deps/openssl/config/archs/VC-WIN64A/no-asm/configdata.pm +++ b/deps/openssl/config/archs/VC-WIN64A/no-asm/configdata.pm @@ -179,7 +179,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -245,7 +245,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -299,11 +299,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "VC-WIN64A", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "lib", @@ -318,7 +318,7 @@ our %target = ( "LDFLAGS" => "/nologo /debug", "MT" => "mt", "MTFLAGS" => "-nologo", - "RANLIB" => "CODE(0x55ae81cdc6d0)", + "RANLIB" => "CODE(0x55c0d782bbd0)", "RC" => "rc", "_conf_fname_int" => [ "Configurations/00-base-templates.conf", @@ -4314,9 +4314,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7008,9 +7005,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12239,22 +12233,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14950,9 +14928,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17644,9 +17619,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19704,7 +19676,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23339,7 +23310,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/VC-WIN64A/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/VC-WIN64A/no-asm/crypto/buildinf.h index 4381a47b97f43a..96dee6a28bea61 100644 --- a/deps/openssl/config/archs/VC-WIN64A/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/VC-WIN64A/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: " -#define DATE "built on: Tue Apr 7 19:18:47 2026 UTC" +#define DATE "built on: Tue Jan 27 17:39:22 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/cmp.h index 5db0024167c334..8f3825a2402e6e 100644 --- a/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/opensslv.h index f55a17e73bb202..d99943f3e9a9bf 100644 --- a/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/VC-WIN64A/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/aix64-gcc-as/asm/configdata.pm b/deps/openssl/config/archs/aix64-gcc-as/asm/configdata.pm index b28acdc98d8d93..d2888ae4fba76d 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/asm/configdata.pm +++ b/deps/openssl/config/archs/aix64-gcc-as/asm/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "aix64-gcc-as", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar -X64", @@ -4310,9 +4310,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7004,9 +7001,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12263,22 +12257,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14974,9 +14952,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17668,9 +17643,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19712,7 +19684,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23344,7 +23315,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/aix64-gcc-as/asm/crypto/buildinf.h b/deps/openssl/config/archs/aix64-gcc-as/asm/crypto/buildinf.h index 2ca2d52d9c77f1..6a69ea5fecf4fc 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/aix64-gcc-as/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: aix64-gcc-as" -#define DATE "built on: Tue Apr 7 19:04:17 2026 UTC" +#define DATE "built on: Tue Jan 27 17:24:42 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/aix64-gcc-as/asm/include/openssl/cmp.h b/deps/openssl/config/archs/aix64-gcc-as/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/aix64-gcc-as/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/aix64-gcc-as/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/aix64-gcc-as/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/aix64-gcc-as/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/configdata.pm b/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/configdata.pm index 3df7335fbc3a7f..2c4bb3fab9c880 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "aix64-gcc-as", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar -X64", @@ -4310,9 +4310,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7004,9 +7001,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12263,22 +12257,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14974,9 +14952,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17668,9 +17643,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19712,7 +19684,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23344,7 +23315,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/crypto/buildinf.h index f2a8312f30e05b..732b1fe844d1b0 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: aix64-gcc-as" -#define DATE "built on: Tue Apr 7 19:04:33 2026 UTC" +#define DATE "built on: Tue Jan 27 17:24:59 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/aix64-gcc-as/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/aix64-gcc-as/no-asm/configdata.pm b/deps/openssl/config/archs/aix64-gcc-as/no-asm/configdata.pm index ff833db0fd8680..e5347ae269c32d 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/no-asm/configdata.pm +++ b/deps/openssl/config/archs/aix64-gcc-as/no-asm/configdata.pm @@ -169,7 +169,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -235,7 +235,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "aix64-gcc-as", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar -X64", @@ -4273,9 +4273,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6967,9 +6964,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12186,22 +12180,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14897,9 +14875,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17591,9 +17566,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19635,7 +19607,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23264,7 +23235,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/aix64-gcc-as/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/aix64-gcc-as/no-asm/crypto/buildinf.h index 991de4416541d1..fc29be8278bcf0 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/aix64-gcc-as/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: aix64-gcc-as" -#define DATE "built on: Tue Apr 7 19:04:50 2026 UTC" +#define DATE "built on: Tue Jan 27 17:25:15 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/aix64-gcc-as/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/aix64-gcc-as/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/aix64-gcc-as/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/aix64-gcc-as/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/aix64-gcc-as/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/aix64-gcc-as/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/aix64-gcc-as/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/configdata.pm b/deps/openssl/config/archs/darwin-i386-cc/asm/configdata.pm index d703d0ebfdd8ae..065a48272d1b33 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/configdata.pm +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "darwin-i386-cc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4330,9 +4330,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7024,9 +7021,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12256,22 +12250,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14967,9 +14945,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17661,9 +17636,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19685,7 +19657,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23309,7 +23280,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/buildinf.h index 8ac5a1b3f5103b..03bcb7da85a93b 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin-i386-cc" -#define DATE "built on: Tue Apr 7 19:07:55 2026 UTC" +#define DATE "built on: Tue Jan 27 17:28:25 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/cmp.h b/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/darwin-i386-cc/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/configdata.pm b/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/configdata.pm index 1b8ef6c2a9931e..60224210b8b73d 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "darwin-i386-cc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4330,9 +4330,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7024,9 +7021,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12256,22 +12250,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14967,9 +14945,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17661,9 +17636,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19685,7 +19657,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23309,7 +23280,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h index 16f692200e0af8..b83b1cd54b62e9 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin-i386-cc" -#define DATE "built on: Tue Apr 7 19:08:12 2026 UTC" +#define DATE "built on: Tue Jan 27 17:28:42 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/darwin-i386-cc/no-asm/configdata.pm b/deps/openssl/config/archs/darwin-i386-cc/no-asm/configdata.pm index 854c9aa62ea965..73231b28932e34 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/darwin-i386-cc/no-asm/configdata.pm @@ -169,7 +169,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -235,7 +235,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "darwin-i386-cc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4272,9 +4272,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6966,9 +6963,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12176,22 +12170,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14887,9 +14865,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17581,9 +17556,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19605,7 +19577,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23226,7 +23197,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/darwin-i386-cc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin-i386-cc/no-asm/crypto/buildinf.h index 013907ee15de5b..b9a7699af252cd 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin-i386-cc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin-i386-cc" -#define DATE "built on: Tue Apr 7 19:08:28 2026 UTC" +#define DATE "built on: Tue Jan 27 17:28:59 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/darwin-i386-cc/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm/configdata.pm b/deps/openssl/config/archs/darwin64-arm64-cc/asm/configdata.pm index 00d1fba6f036fd..c9bdc194c16688 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm/configdata.pm +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "darwin64-arm64-cc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4320,9 +4320,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7014,9 +7011,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12263,22 +12257,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14974,9 +14952,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17668,9 +17643,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19692,7 +19664,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23418,7 +23389,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin64-arm64-cc/asm/crypto/buildinf.h index 7d0987ff1e6ff4..c1735da364a496 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-arm64-cc" -#define DATE "built on: Tue Apr 7 19:08:44 2026 UTC" +#define DATE "built on: Tue Jan 27 17:29:14 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm/crypto/sm4/vpsm4_ex-armv8.S b/deps/openssl/config/archs/darwin64-arm64-cc/asm/crypto/sm4/vpsm4_ex-armv8.S index 180bfac7984a7b..6d85197fb635c7 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm/crypto/sm4/vpsm4_ex-armv8.S +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm/crypto/sm4/vpsm4_ex-armv8.S @@ -62,13 +62,12 @@ _vpsm4_ex_set_key: AARCH64_VALID_CALL_TARGET ld1 {v5.4s},[x0] adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v5.16b,v5.16b #endif @@ -640,13 +639,12 @@ _vpsm4_ex_encrypt: AARCH64_VALID_CALL_TARGET ld1 {v4.4s},[x0] adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v4.16b,v4.16b #endif @@ -783,13 +781,12 @@ _vpsm4_ex_decrypt: AARCH64_VALID_CALL_TARGET ld1 {v4.4s},[x0] adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v4.16b,v4.16b #endif @@ -932,13 +929,12 @@ _vpsm4_ex_ecb_encrypt: stp d14,d15,[sp,#48] stp x29,x30,[sp,#64] adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] Lecb_8_blocks_process: cmp w2,#8 b.lt Lecb_4_blocks_process @@ -1181,13 +1177,12 @@ _vpsm4_ex_cbc_encrypt: AARCH64_VALID_CALL_TARGET lsr x2,x2,4 adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] cbz w5,Ldec ld1 {v3.4s},[x4] Lcbc_4_blocks_enc: @@ -2174,13 +2169,12 @@ _vpsm4_ex_ctr32_encrypt_blocks: rev32 v3.16b,v3.16b #endif adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] cmp w2,#1 b.ne 1f // fast processing for one single block without @@ -2575,13 +2569,12 @@ _vpsm4_ex_xts_encrypt_gb: ld1 {v16.4s}, [x5] mov x3,x27 adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v16.16b,v16.16b #endif @@ -3580,13 +3573,12 @@ _vpsm4_ex_xts_encrypt: ld1 {v16.4s}, [x5] mov x3,x27 adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v16.16b,v16.16b #endif diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm/include/openssl/cmp.h b/deps/openssl/config/archs/darwin64-arm64-cc/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/configdata.pm b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/configdata.pm index c363099c884798..62bce20835c4af 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "darwin64-arm64-cc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4320,9 +4320,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7014,9 +7011,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12263,22 +12257,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14974,9 +14952,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17668,9 +17643,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19692,7 +19664,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23418,7 +23389,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h index 69cf1be7d69f39..fe5b798f400a4a 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-arm64-cc" -#define DATE "built on: Tue Apr 7 19:09:01 2026 UTC" +#define DATE "built on: Tue Jan 27 17:29:31 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/sm4/vpsm4_ex-armv8.S b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/sm4/vpsm4_ex-armv8.S index 180bfac7984a7b..6d85197fb635c7 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/sm4/vpsm4_ex-armv8.S +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/crypto/sm4/vpsm4_ex-armv8.S @@ -62,13 +62,12 @@ _vpsm4_ex_set_key: AARCH64_VALID_CALL_TARGET ld1 {v5.4s},[x0] adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v5.16b,v5.16b #endif @@ -640,13 +639,12 @@ _vpsm4_ex_encrypt: AARCH64_VALID_CALL_TARGET ld1 {v4.4s},[x0] adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v4.16b,v4.16b #endif @@ -783,13 +781,12 @@ _vpsm4_ex_decrypt: AARCH64_VALID_CALL_TARGET ld1 {v4.4s},[x0] adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v4.16b,v4.16b #endif @@ -932,13 +929,12 @@ _vpsm4_ex_ecb_encrypt: stp d14,d15,[sp,#48] stp x29,x30,[sp,#64] adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] Lecb_8_blocks_process: cmp w2,#8 b.lt Lecb_4_blocks_process @@ -1181,13 +1177,12 @@ _vpsm4_ex_cbc_encrypt: AARCH64_VALID_CALL_TARGET lsr x2,x2,4 adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] cbz w5,Ldec ld1 {v3.4s},[x4] Lcbc_4_blocks_enc: @@ -2174,13 +2169,12 @@ _vpsm4_ex_ctr32_encrypt_blocks: rev32 v3.16b,v3.16b #endif adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] cmp w2,#1 b.ne 1f // fast processing for one single block without @@ -2575,13 +2569,12 @@ _vpsm4_ex_xts_encrypt_gb: ld1 {v16.4s}, [x5] mov x3,x27 adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v16.16b,v16.16b #endif @@ -3580,13 +3573,12 @@ _vpsm4_ex_xts_encrypt: ld1 {v16.4s}, [x5] mov x3,x27 adrp x9, Lsbox_magic@PAGE - add x9, x9, Lsbox_magic@PAGEOFF - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, Lsbox_magic@PAGEOFF] + ldr q27, [x9, Lsbox_magic@PAGEOFF+16] + ldr q28, [x9, Lsbox_magic@PAGEOFF+32] + ldr q29, [x9, Lsbox_magic@PAGEOFF+48] + ldr q30, [x9, Lsbox_magic@PAGEOFF+64] + ldr q31, [x9, Lsbox_magic@PAGEOFF+80] #ifndef __AARCH64EB__ rev32 v16.16b,v16.16b #endif diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/configdata.pm b/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/configdata.pm index 36936786584dd5..4223dbfc9e2e17 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/configdata.pm @@ -169,7 +169,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -235,7 +235,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "darwin64-arm64-cc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4272,9 +4272,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6966,9 +6963,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12176,22 +12170,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14887,9 +14865,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17581,9 +17556,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19605,7 +19577,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23226,7 +23197,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h index 04be5237ab34d9..99c2e287d6b0b6 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-arm64-cc" -#define DATE "built on: Tue Apr 7 19:09:18 2026 UTC" +#define DATE "built on: Tue Jan 27 17:29:48 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/configdata.pm b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/configdata.pm index 33e55bc9e96b7d..1c91ad90488d68 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/configdata.pm +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "darwin64-x86_64-cc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4336,9 +4336,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7030,9 +7027,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12312,22 +12306,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15023,9 +15001,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17717,9 +17692,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19741,7 +19713,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23365,7 +23336,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h index 49ec3dc29ac3f7..9e25e370f1ca07 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-x86_64-cc" -#define DATE "built on: Tue Apr 7 19:06:56 2026 UTC" +#define DATE "built on: Tue Jan 27 17:27:23 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/cmp.h b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/configdata.pm b/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/configdata.pm index 0f0ed82ad1fb23..bfb76101a6d0e3 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "darwin64-x86_64-cc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4336,9 +4336,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7030,9 +7027,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12312,22 +12306,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15023,9 +15001,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17717,9 +17692,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19741,7 +19713,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23365,7 +23336,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h index 59934514dafd96..8b2ad2a1136895 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-x86_64-cc" -#define DATE "built on: Tue Apr 7 19:07:20 2026 UTC" +#define DATE "built on: Tue Jan 27 17:27:50 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/configdata.pm b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/configdata.pm index 1c61457805073d..b7899dd4f09380 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/configdata.pm @@ -169,7 +169,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -235,7 +235,7 @@ our %config = ( ], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -289,11 +289,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "darwin64-x86_64-cc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4272,9 +4272,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6966,9 +6963,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12176,22 +12170,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14887,9 +14865,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17581,9 +17556,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19605,7 +19577,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23226,7 +23197,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h index d0a6ef3027ce8c..b715619fa10376 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: darwin64-x86_64-cc" -#define DATE "built on: Tue Apr 7 19:07:40 2026 UTC" +#define DATE "built on: Tue Jan 27 17:28:10 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-aarch64/asm/configdata.pm b/deps/openssl/config/archs/linux-aarch64/asm/configdata.pm index ad05893bc0b47d..d845b337ee2fba 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-aarch64/asm/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-aarch64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4326,9 +4326,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7020,9 +7017,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12278,22 +12272,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14989,9 +14967,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17683,9 +17658,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19727,7 +19699,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23461,7 +23432,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-aarch64/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-aarch64/asm/crypto/buildinf.h index ed7cb59ade0a35..b4cffed5bc81e7 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-aarch64/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-aarch64" -#define DATE "built on: Tue Apr 7 19:09:33 2026 UTC" +#define DATE "built on: Tue Jan 27 17:30:04 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-aarch64/asm/crypto/sm4/vpsm4_ex-armv8.S b/deps/openssl/config/archs/linux-aarch64/asm/crypto/sm4/vpsm4_ex-armv8.S index 009c6e71d1b62c..68bb5d54d5fbfb 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/crypto/sm4/vpsm4_ex-armv8.S +++ b/deps/openssl/config/archs/linux-aarch64/asm/crypto/sm4/vpsm4_ex-armv8.S @@ -62,13 +62,12 @@ _vpsm4_ex_set_key: AARCH64_VALID_CALL_TARGET ld1 {v5.4s},[x0] adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v5.16b,v5.16b #endif @@ -640,13 +639,12 @@ vpsm4_ex_encrypt: AARCH64_VALID_CALL_TARGET ld1 {v4.4s},[x0] adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v4.16b,v4.16b #endif @@ -783,13 +781,12 @@ vpsm4_ex_decrypt: AARCH64_VALID_CALL_TARGET ld1 {v4.4s},[x0] adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v4.16b,v4.16b #endif @@ -932,13 +929,12 @@ vpsm4_ex_ecb_encrypt: stp d14,d15,[sp,#48] stp x29,x30,[sp,#64] adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] .Lecb_8_blocks_process: cmp w2,#8 b.lt .Lecb_4_blocks_process @@ -1181,13 +1177,12 @@ vpsm4_ex_cbc_encrypt: AARCH64_VALID_CALL_TARGET lsr x2,x2,4 adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] cbz w5,.Ldec ld1 {v3.4s},[x4] .Lcbc_4_blocks_enc: @@ -2174,13 +2169,12 @@ vpsm4_ex_ctr32_encrypt_blocks: rev32 v3.16b,v3.16b #endif adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] cmp w2,#1 b.ne 1f // fast processing for one single block without @@ -2575,13 +2569,12 @@ vpsm4_ex_xts_encrypt_gb: ld1 {v16.4s}, [x5] mov x3,x27 adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v16.16b,v16.16b #endif @@ -3580,13 +3573,12 @@ vpsm4_ex_xts_encrypt: ld1 {v16.4s}, [x5] mov x3,x27 adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v16.16b,v16.16b #endif diff --git a/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-aarch64/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-aarch64/asm_avx2/configdata.pm b/deps/openssl/config/archs/linux-aarch64/asm_avx2/configdata.pm index f66045efd18d31..66c967c249ff9a 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/linux-aarch64/asm_avx2/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-aarch64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4326,9 +4326,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7020,9 +7017,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12278,22 +12272,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14989,9 +14967,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17683,9 +17658,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19727,7 +19699,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23461,7 +23432,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-aarch64/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/linux-aarch64/asm_avx2/crypto/buildinf.h index 6704a8202dca0a..9ed5b2ce877ce4 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-aarch64/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-aarch64" -#define DATE "built on: Tue Apr 7 19:09:51 2026 UTC" +#define DATE "built on: Tue Jan 27 17:30:21 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-aarch64/asm_avx2/crypto/sm4/vpsm4_ex-armv8.S b/deps/openssl/config/archs/linux-aarch64/asm_avx2/crypto/sm4/vpsm4_ex-armv8.S index 009c6e71d1b62c..68bb5d54d5fbfb 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm_avx2/crypto/sm4/vpsm4_ex-armv8.S +++ b/deps/openssl/config/archs/linux-aarch64/asm_avx2/crypto/sm4/vpsm4_ex-armv8.S @@ -62,13 +62,12 @@ _vpsm4_ex_set_key: AARCH64_VALID_CALL_TARGET ld1 {v5.4s},[x0] adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v5.16b,v5.16b #endif @@ -640,13 +639,12 @@ vpsm4_ex_encrypt: AARCH64_VALID_CALL_TARGET ld1 {v4.4s},[x0] adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v4.16b,v4.16b #endif @@ -783,13 +781,12 @@ vpsm4_ex_decrypt: AARCH64_VALID_CALL_TARGET ld1 {v4.4s},[x0] adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v4.16b,v4.16b #endif @@ -932,13 +929,12 @@ vpsm4_ex_ecb_encrypt: stp d14,d15,[sp,#48] stp x29,x30,[sp,#64] adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] .Lecb_8_blocks_process: cmp w2,#8 b.lt .Lecb_4_blocks_process @@ -1181,13 +1177,12 @@ vpsm4_ex_cbc_encrypt: AARCH64_VALID_CALL_TARGET lsr x2,x2,4 adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] cbz w5,.Ldec ld1 {v3.4s},[x4] .Lcbc_4_blocks_enc: @@ -2174,13 +2169,12 @@ vpsm4_ex_ctr32_encrypt_blocks: rev32 v3.16b,v3.16b #endif adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] cmp w2,#1 b.ne 1f // fast processing for one single block without @@ -2575,13 +2569,12 @@ vpsm4_ex_xts_encrypt_gb: ld1 {v16.4s}, [x5] mov x3,x27 adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v16.16b,v16.16b #endif @@ -3580,13 +3573,12 @@ vpsm4_ex_xts_encrypt: ld1 {v16.4s}, [x5] mov x3,x27 adrp x9, .Lsbox_magic - add x9, x9, #:lo12:.Lsbox_magic - ldr q26, [x9] - ldr q27, [x9, 16] - ldr q28, [x9, 32] - ldr q29, [x9, 48] - ldr q30, [x9, 64] - ldr q31, [x9, 80] + ldr q26, [x9, #:lo12:.Lsbox_magic] + ldr q27, [x9, #:lo12:.Lsbox_magic+16] + ldr q28, [x9, #:lo12:.Lsbox_magic+32] + ldr q29, [x9, #:lo12:.Lsbox_magic+48] + ldr q30, [x9, #:lo12:.Lsbox_magic+64] + ldr q31, [x9, #:lo12:.Lsbox_magic+80] #ifndef __AARCH64EB__ rev32 v16.16b,v16.16b #endif diff --git a/deps/openssl/config/archs/linux-aarch64/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/linux-aarch64/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-aarch64/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-aarch64/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-aarch64/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-aarch64/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-aarch64/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-aarch64/no-asm/configdata.pm b/deps/openssl/config/archs/linux-aarch64/no-asm/configdata.pm index bc5e6efdca38c0..c85339b03a0ca2 100644 --- a/deps/openssl/config/archs/linux-aarch64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-aarch64/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-aarch64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4278,9 +4278,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6972,9 +6969,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12191,22 +12185,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14902,9 +14880,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17596,9 +17571,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19640,7 +19612,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23269,7 +23240,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-aarch64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-aarch64/no-asm/crypto/buildinf.h index d0c32d9ef1c5ae..2bb20f876c4177 100644 --- a/deps/openssl/config/archs/linux-aarch64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-aarch64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-aarch64" -#define DATE "built on: Tue Apr 7 19:10:08 2026 UTC" +#define DATE "built on: Tue Jan 27 17:30:38 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-aarch64/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-armv4/asm/configdata.pm b/deps/openssl/config/archs/linux-armv4/asm/configdata.pm index cc72c7448efdc9..223cceec571793 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-armv4/asm/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-armv4", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4318,9 +4318,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7012,9 +7009,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12256,22 +12250,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14967,9 +14945,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17661,9 +17636,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19705,7 +19677,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23421,7 +23392,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-armv4/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-armv4/asm/crypto/buildinf.h index 8d75df033ba2dd..c3eb6402fbe4a9 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-armv4/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-armv4" -#define DATE "built on: Tue Apr 7 19:10:23 2026 UTC" +#define DATE "built on: Tue Jan 27 17:30:54 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-armv4/asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-armv4/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-armv4/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-armv4/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-armv4/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-armv4/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-armv4/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-armv4/asm_avx2/configdata.pm b/deps/openssl/config/archs/linux-armv4/asm_avx2/configdata.pm index 4ec442fe263ca2..85b110f31e9aa6 100644 --- a/deps/openssl/config/archs/linux-armv4/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/linux-armv4/asm_avx2/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-armv4", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4318,9 +4318,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7012,9 +7009,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12256,22 +12250,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14967,9 +14945,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17661,9 +17636,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19705,7 +19677,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23421,7 +23392,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-armv4/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/linux-armv4/asm_avx2/crypto/buildinf.h index 32be2e735c238d..90d9c773b9f67a 100644 --- a/deps/openssl/config/archs/linux-armv4/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-armv4/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-armv4" -#define DATE "built on: Tue Apr 7 19:10:40 2026 UTC" +#define DATE "built on: Tue Jan 27 17:31:10 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-armv4/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/linux-armv4/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-armv4/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-armv4/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-armv4/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-armv4/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-armv4/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-armv4/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-armv4/no-asm/configdata.pm b/deps/openssl/config/archs/linux-armv4/no-asm/configdata.pm index 1bb6e5264afef6..61afcf2f942ec9 100644 --- a/deps/openssl/config/archs/linux-armv4/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-armv4/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-armv4", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4278,9 +4278,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6972,9 +6969,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12191,22 +12185,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14902,9 +14880,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17596,9 +17571,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19640,7 +19612,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23269,7 +23240,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-armv4/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-armv4/no-asm/crypto/buildinf.h index c018dd20913f3c..15aea0559d9f30 100644 --- a/deps/openssl/config/archs/linux-armv4/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-armv4/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-armv4" -#define DATE "built on: Tue Apr 7 19:10:56 2026 UTC" +#define DATE "built on: Tue Jan 27 17:31:27 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-armv4/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-elf/asm/configdata.pm b/deps/openssl/config/archs/linux-elf/asm/configdata.pm index 13574e29c8c56f..206fe8984058cf 100644 --- a/deps/openssl/config/archs/linux-elf/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-elf/asm/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-elf", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4335,9 +4335,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7029,9 +7026,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12270,22 +12264,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14981,9 +14959,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17675,9 +17650,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19719,7 +19691,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23351,7 +23322,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-elf/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-elf/asm/crypto/buildinf.h index bbe4358843853b..124c1e5ee396c4 100644 --- a/deps/openssl/config/archs/linux-elf/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-elf/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-elf" -#define DATE "built on: Tue Apr 7 19:11:12 2026 UTC" +#define DATE "built on: Tue Jan 27 17:31:42 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-elf/asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-elf/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-elf/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-elf/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-elf/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-elf/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-elf/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-elf/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-elf/asm_avx2/configdata.pm b/deps/openssl/config/archs/linux-elf/asm_avx2/configdata.pm index 8c4b6db944851c..646acc4ae1318e 100644 --- a/deps/openssl/config/archs/linux-elf/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/linux-elf/asm_avx2/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-elf", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4335,9 +4335,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7029,9 +7026,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12270,22 +12264,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14981,9 +14959,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17675,9 +17650,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19719,7 +19691,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23351,7 +23322,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-elf/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/linux-elf/asm_avx2/crypto/buildinf.h index bef00a47824d29..58146a1131842d 100644 --- a/deps/openssl/config/archs/linux-elf/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-elf/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-elf" -#define DATE "built on: Tue Apr 7 19:11:29 2026 UTC" +#define DATE "built on: Tue Jan 27 17:32:00 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-elf/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/linux-elf/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-elf/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-elf/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-elf/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-elf/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-elf/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-elf/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-elf/no-asm/configdata.pm b/deps/openssl/config/archs/linux-elf/no-asm/configdata.pm index 421a6bdf43bf60..bec6a2c5c780da 100644 --- a/deps/openssl/config/archs/linux-elf/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-elf/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-elf", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4277,9 +4277,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6971,9 +6968,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12190,22 +12184,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14901,9 +14879,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17595,9 +17570,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19639,7 +19611,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23268,7 +23239,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-elf/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-elf/no-asm/crypto/buildinf.h index 88ded8dd83be85..16d317d328f465 100644 --- a/deps/openssl/config/archs/linux-elf/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-elf/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-elf" -#define DATE "built on: Tue Apr 7 19:11:45 2026 UTC" +#define DATE "built on: Tue Jan 27 17:32:16 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-elf/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/configdata.pm b/deps/openssl/config/archs/linux-ppc64le/asm/configdata.pm index 2315a51465a2b5..e30041bb7dc374 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-ppc64le/asm/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-ppc64le", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4315,9 +4315,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7009,9 +7006,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12271,22 +12265,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14982,9 +14960,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17676,9 +17651,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19720,7 +19692,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23352,7 +23323,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/buildinf.h index 849e97f9b89560..98640a95514a37 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc64le" -#define DATE "built on: Tue Apr 7 19:13:01 2026 UTC" +#define DATE "built on: Tue Jan 27 17:33:32 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/modes/aes-gcm-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/modes/aes-gcm-ppc.s index a7fbc302b74584..75a0ad3471084f 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/crypto/modes/aes-gcm-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm/crypto/modes/aes-gcm-ppc.s @@ -354,6 +354,7 @@ ################################################################################ .align 4 aes_gcm_crypt_1x: +.localentry aes_gcm_crypt_1x,0 cmpdi 5, 16 bge __More_1x @@ -436,6 +437,7 @@ __Encrypt_1x: ################################################################################ .align 4 __Process_partial: +.localentry __Process_partial,0 # create partial mask vspltisb 16, -1 @@ -507,6 +509,7 @@ __Encrypt_partial: .global ppc_aes_gcm_encrypt .align 5 ppc_aes_gcm_encrypt: +.localentry ppc_aes_gcm_encrypt,0 SAVE_REGS LOAD_HASH_TABLE @@ -694,6 +697,7 @@ __Process_more_enc: .global ppc_aes_gcm_decrypt .align 5 ppc_aes_gcm_decrypt: +.localentry ppc_aes_gcm_decrypt, 0 SAVE_REGS LOAD_HASH_TABLE @@ -973,6 +977,7 @@ __Process_more_dec: .size ppc_aes_gcm_decrypt,.-ppc_aes_gcm_decrypt aes_gcm_out: +.localentry aes_gcm_out,0 mr 3, 11 # return count diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-ppc64le/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/configdata.pm b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/configdata.pm index 2c4f33a5a738ee..4dbe3704cbf55d 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-ppc64le", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4315,9 +4315,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7009,9 +7006,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12271,22 +12265,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14982,9 +14960,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17676,9 +17651,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19720,7 +19692,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23352,7 +23323,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h index 7aacaefda5bda3..b08cdc7d0de775 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc64le" -#define DATE "built on: Tue Apr 7 19:13:18 2026 UTC" +#define DATE "built on: Tue Jan 27 17:33:48 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/crypto/modes/aes-gcm-ppc.s b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/crypto/modes/aes-gcm-ppc.s index a7fbc302b74584..75a0ad3471084f 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/crypto/modes/aes-gcm-ppc.s +++ b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/crypto/modes/aes-gcm-ppc.s @@ -354,6 +354,7 @@ ################################################################################ .align 4 aes_gcm_crypt_1x: +.localentry aes_gcm_crypt_1x,0 cmpdi 5, 16 bge __More_1x @@ -436,6 +437,7 @@ __Encrypt_1x: ################################################################################ .align 4 __Process_partial: +.localentry __Process_partial,0 # create partial mask vspltisb 16, -1 @@ -507,6 +509,7 @@ __Encrypt_partial: .global ppc_aes_gcm_encrypt .align 5 ppc_aes_gcm_encrypt: +.localentry ppc_aes_gcm_encrypt,0 SAVE_REGS LOAD_HASH_TABLE @@ -694,6 +697,7 @@ __Process_more_enc: .global ppc_aes_gcm_decrypt .align 5 ppc_aes_gcm_decrypt: +.localentry ppc_aes_gcm_decrypt, 0 SAVE_REGS LOAD_HASH_TABLE @@ -973,6 +977,7 @@ __Process_more_dec: .size ppc_aes_gcm_decrypt,.-ppc_aes_gcm_decrypt aes_gcm_out: +.localentry aes_gcm_out,0 mr 3, 11 # return count diff --git a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-ppc64le/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-ppc64le/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-ppc64le/no-asm/configdata.pm b/deps/openssl/config/archs/linux-ppc64le/no-asm/configdata.pm index 738b1aee30c50d..94e94cb3138cf8 100644 --- a/deps/openssl/config/archs/linux-ppc64le/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-ppc64le/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-ppc64le", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4278,9 +4278,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6972,9 +6969,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12191,22 +12185,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14902,9 +14880,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17596,9 +17571,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19640,7 +19612,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23269,7 +23240,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-ppc64le/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-ppc64le/no-asm/crypto/buildinf.h index 4a97d7b9307115..2c9b95b29285c2 100644 --- a/deps/openssl/config/archs/linux-ppc64le/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-ppc64le/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-ppc64le" -#define DATE "built on: Tue Apr 7 19:13:35 2026 UTC" +#define DATE "built on: Tue Jan 27 17:34:05 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-ppc64le/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-x86_64/asm/configdata.pm b/deps/openssl/config/archs/linux-x86_64/asm/configdata.pm index 30a197bb9b3207..85274e2d27fce8 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/configdata.pm +++ b/deps/openssl/config/archs/linux-x86_64/asm/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-x86_64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4343,9 +4343,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7037,9 +7034,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12328,22 +12322,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15039,9 +15017,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17733,9 +17708,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19777,7 +19749,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23409,7 +23380,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-x86_64/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-x86_64/asm/crypto/buildinf.h index 1152ba3b6caa40..fc4e10a034e732 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-x86_64/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-x86_64" -#define DATE "built on: Tue Apr 7 19:12:01 2026 UTC" +#define DATE "built on: Tue Jan 27 17:32:32 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-x86_64/asm_avx2/configdata.pm b/deps/openssl/config/archs/linux-x86_64/asm_avx2/configdata.pm index dfca30ea1d045c..fccadf2e3cbd82 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/linux-x86_64/asm_avx2/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-x86_64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4343,9 +4343,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7037,9 +7034,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12328,22 +12322,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15039,9 +15017,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17733,9 +17708,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19777,7 +19749,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23409,7 +23380,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-x86_64/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/linux-x86_64/asm_avx2/crypto/buildinf.h index eae5790f199fdb..f4e0d457d0d6be 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-x86_64/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-x86_64" -#define DATE "built on: Tue Apr 7 19:12:25 2026 UTC" +#define DATE "built on: Tue Jan 27 17:32:56 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-x86_64/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/linux-x86_64/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-x86_64/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-x86_64/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-x86_64/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-x86_64/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-x86_64/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux-x86_64/no-asm/configdata.pm b/deps/openssl/config/archs/linux-x86_64/no-asm/configdata.pm index 161cd9cce0e082..baf6a56920ace0 100644 --- a/deps/openssl/config/archs/linux-x86_64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux-x86_64/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux-x86_64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4279,9 +4279,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6973,9 +6970,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12192,22 +12186,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14903,9 +14881,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17597,9 +17572,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19641,7 +19613,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23270,7 +23241,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux-x86_64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux-x86_64/no-asm/crypto/buildinf.h index bda8e7b06883fd..2d933921f9f9a8 100644 --- a/deps/openssl/config/archs/linux-x86_64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux-x86_64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux-x86_64" -#define DATE "built on: Tue Apr 7 19:12:45 2026 UTC" +#define DATE "built on: Tue Jan 27 17:33:16 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux-x86_64/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux32-s390x/asm/configdata.pm b/deps/openssl/config/archs/linux32-s390x/asm/configdata.pm index 8c5575cac107e8..7de859892b7645 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/configdata.pm +++ b/deps/openssl/config/archs/linux32-s390x/asm/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux32-s390x", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4325,9 +4325,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7019,9 +7016,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12254,22 +12248,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14965,9 +14943,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17659,9 +17634,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19703,7 +19675,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23389,7 +23360,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux32-s390x/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux32-s390x/asm/crypto/buildinf.h index 6e95e0608cf62a..3470be7b84152f 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux32-s390x/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux32-s390x" -#define DATE "built on: Tue Apr 7 19:13:50 2026 UTC" +#define DATE "built on: Tue Jan 27 17:34:21 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/keccak1600-s390x.S b/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/keccak1600-s390x.S index bd945c5b788b05..7be19ad92c8149 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/keccak1600-s390x.S +++ b/deps/openssl/config/archs/linux32-s390x/asm/crypto/sha/keccak1600-s390x.S @@ -1,5 +1,4 @@ .text -.machine "z10" .type __KeccakF1600,@function .align 32 diff --git a/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux32-s390x/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux32-s390x/asm_avx2/configdata.pm b/deps/openssl/config/archs/linux32-s390x/asm_avx2/configdata.pm index ca37890f34b167..5f40976d40f264 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/linux32-s390x/asm_avx2/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux32-s390x", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4325,9 +4325,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7019,9 +7016,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12254,22 +12248,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14965,9 +14943,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17659,9 +17634,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19703,7 +19675,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23389,7 +23360,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux32-s390x/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/linux32-s390x/asm_avx2/crypto/buildinf.h index 2c916502dc85be..28edaa10ca1bca 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux32-s390x/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux32-s390x" -#define DATE "built on: Tue Apr 7 19:14:07 2026 UTC" +#define DATE "built on: Tue Jan 27 17:34:38 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux32-s390x/asm_avx2/crypto/sha/keccak1600-s390x.S b/deps/openssl/config/archs/linux32-s390x/asm_avx2/crypto/sha/keccak1600-s390x.S index bd945c5b788b05..7be19ad92c8149 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm_avx2/crypto/sha/keccak1600-s390x.S +++ b/deps/openssl/config/archs/linux32-s390x/asm_avx2/crypto/sha/keccak1600-s390x.S @@ -1,5 +1,4 @@ .text -.machine "z10" .type __KeccakF1600,@function .align 32 diff --git a/deps/openssl/config/archs/linux32-s390x/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/linux32-s390x/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux32-s390x/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux32-s390x/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/linux32-s390x/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux32-s390x/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux32-s390x/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux32-s390x/no-asm/configdata.pm b/deps/openssl/config/archs/linux32-s390x/no-asm/configdata.pm index b876da23737970..abf158780b3cbc 100644 --- a/deps/openssl/config/archs/linux32-s390x/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux32-s390x/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux32-s390x", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4278,9 +4278,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6972,9 +6969,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12191,22 +12185,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14902,9 +14880,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17596,9 +17571,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19640,7 +19612,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23269,7 +23240,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux32-s390x/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux32-s390x/no-asm/crypto/buildinf.h index aef67784a3ef28..600638f1c588c9 100644 --- a/deps/openssl/config/archs/linux32-s390x/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux32-s390x/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux32-s390x" -#define DATE "built on: Tue Apr 7 19:14:23 2026 UTC" +#define DATE "built on: Tue Jan 27 17:34:55 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux32-s390x/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux64-loongarch64/no-asm/configdata.pm b/deps/openssl/config/archs/linux64-loongarch64/no-asm/configdata.pm index fe5d525e19019a..2481e514a5a791 100644 --- a/deps/openssl/config/archs/linux64-loongarch64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux64-loongarch64/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux64-loongarch64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4278,9 +4278,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6972,9 +6969,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12191,22 +12185,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14902,9 +14880,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17596,9 +17571,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19640,7 +19612,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23269,7 +23240,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux64-loongarch64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux64-loongarch64/no-asm/crypto/buildinf.h index 3db64da9d0caf9..52b30a10aeb920 100644 --- a/deps/openssl/config/archs/linux64-loongarch64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-loongarch64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-loongarch64" -#define DATE "built on: Tue Apr 7 19:20:14 2026 UTC" +#define DATE "built on: Tue Jan 27 17:40:49 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux64-loongarch64/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux64-loongarch64/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux64-loongarch64/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux64-loongarch64/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux64-loongarch64/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux64-loongarch64/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux64-loongarch64/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux64-loongarch64/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux64-mips64/asm/configdata.pm b/deps/openssl/config/archs/linux64-mips64/asm/configdata.pm index 4b790af3772d23..122ac1ff7ca7a1 100644 --- a/deps/openssl/config/archs/linux64-mips64/asm/configdata.pm +++ b/deps/openssl/config/archs/linux64-mips64/asm/configdata.pm @@ -177,7 +177,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -240,7 +240,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -293,11 +293,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux64-mips64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4303,9 +4303,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6997,9 +6994,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12225,22 +12219,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14936,9 +14914,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17630,9 +17605,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19674,7 +19646,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23345,7 +23316,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux64-mips64/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux64-mips64/asm/crypto/buildinf.h index d54d57c2f715dc..4b723329e359a7 100644 --- a/deps/openssl/config/archs/linux64-mips64/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-mips64/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-mips64" -#define DATE "built on: Tue Apr 7 19:15:27 2026 UTC" +#define DATE "built on: Tue Jan 27 17:35:59 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux64-mips64/asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux64-mips64/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux64-mips64/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux64-mips64/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux64-mips64/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux64-mips64/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux64-mips64/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux64-mips64/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux64-mips64/asm_avx2/configdata.pm b/deps/openssl/config/archs/linux64-mips64/asm_avx2/configdata.pm index 3b4b2b857bfe16..b55a7bc5230475 100644 --- a/deps/openssl/config/archs/linux64-mips64/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/linux64-mips64/asm_avx2/configdata.pm @@ -177,7 +177,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -240,7 +240,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -293,11 +293,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux64-mips64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4303,9 +4303,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6997,9 +6994,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12225,22 +12219,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14936,9 +14914,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17630,9 +17605,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19674,7 +19646,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23345,7 +23316,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux64-mips64/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/linux64-mips64/asm_avx2/crypto/buildinf.h index 9779ee7a814ff1..adb2f7a5aa7113 100644 --- a/deps/openssl/config/archs/linux64-mips64/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-mips64/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-mips64" -#define DATE "built on: Tue Apr 7 19:15:43 2026 UTC" +#define DATE "built on: Tue Jan 27 17:36:15 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux64-mips64/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/linux64-mips64/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux64-mips64/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux64-mips64/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux64-mips64/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/linux64-mips64/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux64-mips64/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux64-mips64/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux64-mips64/no-asm/configdata.pm b/deps/openssl/config/archs/linux64-mips64/no-asm/configdata.pm index d5b7b30c41aac1..ef05948ef5a386 100644 --- a/deps/openssl/config/archs/linux64-mips64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux64-mips64/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux64-mips64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4279,9 +4279,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6973,9 +6970,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12192,22 +12186,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14903,9 +14881,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17597,9 +17572,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19641,7 +19613,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23270,7 +23241,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux64-mips64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux64-mips64/no-asm/crypto/buildinf.h index c4c71d7b32d9e3..35e8b35d52d496 100644 --- a/deps/openssl/config/archs/linux64-mips64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-mips64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-mips64" -#define DATE "built on: Tue Apr 7 19:15:58 2026 UTC" +#define DATE "built on: Tue Jan 27 17:36:31 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux64-mips64/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux64-mips64/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux64-mips64/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux64-mips64/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux64-mips64/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux64-mips64/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux64-mips64/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux64-mips64/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux64-riscv64/no-asm/configdata.pm b/deps/openssl/config/archs/linux64-riscv64/no-asm/configdata.pm index af3f3bcea8034d..a2910ad5f3983a 100644 --- a/deps/openssl/config/archs/linux64-riscv64/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux64-riscv64/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux64-riscv64", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4278,9 +4278,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6972,9 +6969,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12191,22 +12185,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14902,9 +14880,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17596,9 +17571,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19640,7 +19612,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23269,7 +23240,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux64-riscv64/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux64-riscv64/no-asm/crypto/buildinf.h index 2c36ef23b4cde0..fbbfef9128b564 100644 --- a/deps/openssl/config/archs/linux64-riscv64/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-riscv64/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-riscv64" -#define DATE "built on: Tue Apr 7 19:19:58 2026 UTC" +#define DATE "built on: Tue Jan 27 17:40:34 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux64-riscv64/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux64-riscv64/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux64-riscv64/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux64-riscv64/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux64-riscv64/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux64-riscv64/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux64-riscv64/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux64-riscv64/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux64-s390x/asm/configdata.pm b/deps/openssl/config/archs/linux64-s390x/asm/configdata.pm index 06e8c7652995e3..25f15f1bd57f18 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/configdata.pm +++ b/deps/openssl/config/archs/linux64-s390x/asm/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux64-s390x", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4330,9 +4330,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7024,9 +7021,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12273,22 +12267,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14984,9 +14962,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17678,9 +17653,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19722,7 +19694,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23408,7 +23379,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux64-s390x/asm/crypto/buildinf.h b/deps/openssl/config/archs/linux64-s390x/asm/crypto/buildinf.h index f81422913ea933..efc8b6fe70f6b8 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-s390x/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-s390x" -#define DATE "built on: Tue Apr 7 19:14:39 2026 UTC" +#define DATE "built on: Tue Jan 27 17:35:10 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/keccak1600-s390x.S b/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/keccak1600-s390x.S index 0d18559814a32f..9f254bcf300eea 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/keccak1600-s390x.S +++ b/deps/openssl/config/archs/linux64-s390x/asm/crypto/sha/keccak1600-s390x.S @@ -1,5 +1,4 @@ .text -.machine "z10" .type __KeccakF1600,@function .align 32 diff --git a/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux64-s390x/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux64-s390x/asm_avx2/configdata.pm b/deps/openssl/config/archs/linux64-s390x/asm_avx2/configdata.pm index 3cfdb76ad1e5cd..b7b1db5b5f69be 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/linux64-s390x/asm_avx2/configdata.pm @@ -174,7 +174,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -237,7 +237,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux64-s390x", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4330,9 +4330,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7024,9 +7021,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12273,22 +12267,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14984,9 +14962,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17678,9 +17653,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19722,7 +19694,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23408,7 +23379,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux64-s390x/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/linux64-s390x/asm_avx2/crypto/buildinf.h index 6794cfbc32a791..6e4794f5b7dff4 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-s390x/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-s390x" -#define DATE "built on: Tue Apr 7 19:14:55 2026 UTC" +#define DATE "built on: Tue Jan 27 17:35:27 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux64-s390x/asm_avx2/crypto/sha/keccak1600-s390x.S b/deps/openssl/config/archs/linux64-s390x/asm_avx2/crypto/sha/keccak1600-s390x.S index 0d18559814a32f..9f254bcf300eea 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm_avx2/crypto/sha/keccak1600-s390x.S +++ b/deps/openssl/config/archs/linux64-s390x/asm_avx2/crypto/sha/keccak1600-s390x.S @@ -1,5 +1,4 @@ .text -.machine "z10" .type __KeccakF1600,@function .align 32 diff --git a/deps/openssl/config/archs/linux64-s390x/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/linux64-s390x/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux64-s390x/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux64-s390x/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/linux64-s390x/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux64-s390x/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux64-s390x/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/linux64-s390x/no-asm/configdata.pm b/deps/openssl/config/archs/linux64-s390x/no-asm/configdata.pm index 9bae12b922d18c..56adf229251f92 100644 --- a/deps/openssl/config/archs/linux64-s390x/no-asm/configdata.pm +++ b/deps/openssl/config/archs/linux64-s390x/no-asm/configdata.pm @@ -172,7 +172,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -236,7 +236,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -290,11 +290,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned char", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "linux64-s390x", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4279,9 +4279,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6973,9 +6970,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12192,22 +12186,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14903,9 +14881,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17597,9 +17572,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19641,7 +19613,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23270,7 +23241,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/linux64-s390x/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/linux64-s390x/no-asm/crypto/buildinf.h index 0723b8ef27b849..8727d3480a87fb 100644 --- a/deps/openssl/config/archs/linux64-s390x/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/linux64-s390x/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: linux64-s390x" -#define DATE "built on: Tue Apr 7 19:15:12 2026 UTC" +#define DATE "built on: Tue Jan 27 17:35:43 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/linux64-s390x/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/configdata.pm b/deps/openssl/config/archs/solaris-x86-gcc/asm/configdata.pm index 32a4356bfb7f23..cd0615821bb151 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/configdata.pm +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -234,7 +234,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -287,11 +287,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "solaris-x86-gcc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4328,9 +4328,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7022,9 +7019,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12263,22 +12257,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14974,9 +14952,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17668,9 +17643,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19712,7 +19684,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23344,7 +23315,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/buildinf.h b/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/buildinf.h index 671cf388f22c4b..7e76ec6fb8f79c 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris-x86-gcc" -#define DATE "built on: Tue Apr 7 19:16:14 2026 UTC" +#define DATE "built on: Tue Jan 27 17:36:47 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/cmp.h b/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/configdata.pm b/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/configdata.pm index 13ef5f37c44d47..97deb65cb60908 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -234,7 +234,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -287,11 +287,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "solaris-x86-gcc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4328,9 +4328,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7022,9 +7019,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12263,22 +12257,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14974,9 +14952,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17668,9 +17643,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19712,7 +19684,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23344,7 +23315,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h index 149b97bb1898c1..230afaed4114ad 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris-x86-gcc" -#define DATE "built on: Tue Apr 7 19:16:31 2026 UTC" +#define DATE "built on: Tue Jan 27 17:37:04 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/configdata.pm b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/configdata.pm index f4a38e5189efe2..3c2ed0242488d2 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/configdata.pm @@ -169,7 +169,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -233,7 +233,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -287,11 +287,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "solaris-x86-gcc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4270,9 +4270,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6964,9 +6961,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12183,22 +12177,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14894,9 +14872,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17588,9 +17563,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19632,7 +19604,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23261,7 +23232,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h index 8603f5bcac88d4..ecac83bd33e217 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris-x86-gcc" -#define DATE "built on: Tue Apr 7 19:16:47 2026 UTC" +#define DATE "built on: Tue Jan 27 17:37:21 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/configdata.pm b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/configdata.pm index be12619c8df772..4fc49bc1b055c2 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/configdata.pm +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -234,7 +234,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -287,11 +287,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "solaris64-x86_64-gcc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4335,9 +4335,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7029,9 +7026,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12320,22 +12314,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15031,9 +15009,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17725,9 +17700,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19769,7 +19741,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23401,7 +23372,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h index e6240eb6ac4a61..d9ade2f1ea032e 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris64-x86_64-gcc" -#define DATE "built on: Tue Apr 7 19:17:03 2026 UTC" +#define DATE "built on: Tue Jan 27 17:37:37 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/cmp.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/configdata.pm b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/configdata.pm index c6adc6a40a55e7..2e968665976899 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/configdata.pm +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/configdata.pm @@ -171,7 +171,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -234,7 +234,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -287,11 +287,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "solaris64-x86_64-gcc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4335,9 +4335,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -7029,9 +7026,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12320,22 +12314,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -15031,9 +15009,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17725,9 +17700,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19769,7 +19741,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23401,7 +23372,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h index 4c5673adf73e2b..9ad5a2b7fbd5fc 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris64-x86_64-gcc" -#define DATE "built on: Tue Apr 7 19:17:27 2026 UTC" +#define DATE "built on: Tue Jan 27 17:38:01 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/cmp.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/cmp.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslv.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/configdata.pm b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/configdata.pm index 6f8d2b4595ae81..5e38b637ee7d60 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/configdata.pm +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/configdata.pm @@ -169,7 +169,7 @@ our %config = ( ], "dynamic_engines" => "0", "ex_libs" => [], - "full_version" => "3.5.6", + "full_version" => "3.5.5", "includes" => [], "lflags" => [], "lib_defines" => [ @@ -233,7 +233,7 @@ our %config = ( "openssl_sys_defines" => [], "openssldir" => "", "options" => "enable-ssl-trace enable-fips no-afalgeng no-asan no-asm no-brotli no-brotli-dynamic no-buildtest-c++ no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-demos no-devcryptoeng no-dynamic-engine no-ec_nistp_64_gcc_128 no-egd no-external-tests no-fips-jitter no-fuzz-afl no-fuzz-libfuzzer no-h3demo no-hqinterop no-jitter no-ktls no-loadereng no-md2 no-msan no-pie no-rc5 no-sctp no-shared no-ssl3 no-ssl3-method no-sslkeylog no-tfo no-trace no-ubsan no-unit-test no-uplink no-weak-ssl-ciphers no-winstore no-zlib no-zlib-dynamic no-zstd no-zstd-dynamic", - "patch" => "6", + "patch" => "5", "perl_archname" => "x86_64-linux-gnu-thread-multi", "perl_cmd" => "/usr/bin/perl", "perl_version" => "5.34.0", @@ -287,11 +287,11 @@ our %config = ( "prerelease" => "", "processor" => "", "rc4_int" => "unsigned int", - "release_date" => "7 Apr 2026", + "release_date" => "27 Jan 2026", "shlib_version" => "3", "sourcedir" => ".", "target" => "solaris64-x86_64-gcc", - "version" => "3.5.6" + "version" => "3.5.5" ); our %target = ( "AR" => "ar", @@ -4271,9 +4271,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -6965,9 +6962,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -12184,22 +12178,6 @@ our %unified_info = ( ], "builddata.pm" => [ "util/mkinstallvars.pl", - "COMMENT=\"This", - "file", - "should", - "be", - "used", - "when", - "building", - "against", - "this", - "OpenSSL", - "build,", - "and", - "should", - "never", - "be", - "installed\"", "PREFIX=.", "BINDIR=apps", "APPLINKDIR=ms", @@ -14895,9 +14873,6 @@ our %unified_info = ( "doc/html/man3/UI_new.html" => [ "doc/man3/UI_new.pod" ], - "doc/html/man3/X509V3_EXT_print.html" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/html/man3/X509V3_get_d2i.html" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -17589,9 +17564,6 @@ our %unified_info = ( "doc/man/man3/UI_new.3" => [ "doc/man3/UI_new.pod" ], - "doc/man/man3/X509V3_EXT_print.3" => [ - "doc/man3/X509V3_EXT_print.pod" - ], "doc/man/man3/X509V3_get_d2i.3" => [ "doc/man3/X509V3_get_d2i.pod" ], @@ -19633,7 +19605,6 @@ our %unified_info = ( "doc/html/man3/UI_UTIL_read_pw.html", "doc/html/man3/UI_create_method.html", "doc/html/man3/UI_new.html", - "doc/html/man3/X509V3_EXT_print.html", "doc/html/man3/X509V3_get_d2i.html", "doc/html/man3/X509V3_set_ctx.html", "doc/html/man3/X509_ACERT_add1_attr.html", @@ -23262,7 +23233,6 @@ our %unified_info = ( "doc/man/man3/UI_UTIL_read_pw.3", "doc/man/man3/UI_create_method.3", "doc/man/man3/UI_new.3", - "doc/man/man3/X509V3_EXT_print.3", "doc/man/man3/X509V3_get_d2i.3", "doc/man/man3/X509V3_set_ctx.3", "doc/man/man3/X509_ACERT_add1_attr.3", diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h index 354518243e2786..85ab5399f9d3b5 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h @@ -11,7 +11,7 @@ */ #define PLATFORM "platform: solaris64-x86_64-gcc" -#define DATE "built on: Tue Apr 7 19:17:47 2026 UTC" +#define DATE "built on: Tue Jan 27 17:38:22 2026 UTC" /* * Generate compiler_flags as an array of individual characters. This is a diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/cmp.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/cmp.h index af844ec8ed103c..d46192c7172c9a 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/cmp.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/cmp.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/cmp.h.in * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -196,8 +196,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslv.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslv.h index 299ba102298f07..371ddef5c2bf2a 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslv.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslv.h @@ -34,7 +34,7 @@ extern "C" { # define OPENSSL_VERSION_MINOR 5 /* clang-format on */ /* clang-format off */ -# define OPENSSL_VERSION_PATCH 6 +# define OPENSSL_VERSION_PATCH 5 /* clang-format on */ /* @@ -87,10 +87,10 @@ extern "C" { * OPENSSL_VERSION_BUILD_METADATA_STR appended. */ /* clang-format off */ -# define OPENSSL_VERSION_STR "3.5.6" +# define OPENSSL_VERSION_STR "3.5.5" /* clang-format on */ /* clang-format off */ -# define OPENSSL_FULL_VERSION_STR "3.5.6" +# define OPENSSL_FULL_VERSION_STR "3.5.5" /* clang-format on */ /* @@ -99,7 +99,7 @@ extern "C" { * These strings are defined separately to allow them to be parsable. */ /* clang-format off */ -# define OPENSSL_RELEASE_DATE "7 Apr 2026" +# define OPENSSL_RELEASE_DATE "27 Jan 2026" /* clang-format on */ /* @@ -107,7 +107,7 @@ extern "C" { */ /* clang-format off */ -# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.6 7 Apr 2026" +# define OPENSSL_VERSION_TEXT "OpenSSL 3.5.5 27 Jan 2026" /* clang-format on */ /* clang-format off */ diff --git a/deps/openssl/openssl/CHANGES.md b/deps/openssl/openssl/CHANGES.md index 380840deb71220..1a65b72b29655b 100644 --- a/deps/openssl/openssl/CHANGES.md +++ b/deps/openssl/openssl/CHANGES.md @@ -28,150 +28,6 @@ OpenSSL Releases OpenSSL 3.5 ----------- -### Changes between 3.5.5 and 3.5.6 [7 Apr 2026] - - * Fixed incorrect failure handling in RSA KEM RSASVE encapsulation. - - Severity: Moderate - - Issue summary: Applications using RSASVE key encapsulation to establish - a secret encryption key can send contents of an uninitialized memory buffer - to a malicious peer. - - Impact summary: The uninitialized buffer might contain sensitive data - from the previous execution of the application process which leads - to sensitive data leakage to an attacker. - - Reported by: Simo Sorce (Red Hat). - - ([CVE-2026-31790]) - - *Nikola Pajkovsky* - - * Fixed loss of key agreement group tuple structure when the `DEFAULT` keyword - is used in the server-side configuration of the key-agreement group list. - - Severity: Low - - Issue summary: An OpenSSL TLS 1.3 server may fail to negotiate the expected - preferred key exchange group when its key exchange group configuration - includes the default by using the 'DEFAULT' keyword. - - Impact summary: A less preferred key exchange may be used even when a more - preferred group is supported by both client and server, if the group - was not included among the client's initial predicated keyshares. - This will sometimes be the case with the new hybrid post-quantum groups, - if the client chooses to defer their use until specifically requested by - the server. - - - ([CVE-2026-2673]) - - *Viktor Dukhovni* - - * Fixed potential use-after-free in DANE client code. - - Severity: Low - - Issue summary: An uncommon configuration of clients performing DANE - TLSA-based server authentication, when paired with uncommon server DANE TLSA - records, may result in a use-after-free and/or double-free on the client - side. - - Impact summary: A use after free can have a range of potential consequences - such as the corruption of valid data, crashes, or execution of arbitrary - code. - - Reported by: Igor Morgenstern (Aisle Research). - - ([CVE-2026-28387]) - - *Viktor Dukhovni* - - * Fixed NULL pointer dereference when processing a delta CRL. - - Severity: Low - - Issue summary: When a delta CRL that contains a Delta CRL Indicator extension - is processed, a NULL pointer dereference might happen if the required CRL - Number extension is missing. - - Impact summary: A NULL pointer dereference can trigger a crash which - leads to a Denial of Service for an application. - - Reported by: Igor Morgenstern (Aisle Research). - - ([CVE-2026-28388]) - - *Igor Morgenstern* - - * Fixed possible NULL dereference when processing CMS KeyAgreeRecipientInfo. - - Severity: Low - - Issue summary: During processing of a crafted CMS EnvelopedData message - with KeyAgreeRecipientInfo a NULL pointer dereference can happen. - - Impact summary: Applications that process attacker-controlled CMS data may - crash before authentication or cryptographic operations occur resulting in - Denial of Service. - - Reported by: Nathan Sportsman (Praetorian), Daniel Rhea, - Jaeho Nam (Seoul National University), Muhammad Daffa, - Zhanpeng Liu (Tencent Xuanwu Lab), Guannan Wang (Tencent Xuanwu Lab), - Guancheng Li (Tencent Xuanwu Lab), and Joshua Rogers. - - ([CVE-2026-28389]) - - *Neil Horman* - - * Fixed possible NULL dereference when processing CMS - KeyTransportRecipientInfo. - - Severity: Low - - Issue summary: During processing of a crafted CMS EnvelopedData message - with KeyTransportRecipientInfo a NULL pointer dereference can happen. - - Impact summary: Applications that process attacker-controlled CMS data may - crash before authentication or cryptographic operations occur resulting in - Denial of Service. - - Reported by: Muhammad Daffa, Zhanpeng Liu (Tencent Xuanwu Lab), - Guannan Wang (Tencent Xuanwu Lab), Guancheng Li (Tencent Xuanwu Lab), - Joshua Rogers, and Chanho Kim. - - ([CVE-2026-28390]) - - *Neil Horman* - - * Fixed heap buffer overflow in hexadecimal conversion. - - Severity: Low - - Issue summary: Converting an excessively large OCTET STRING value to - a hexadecimal string leads to a heap buffer overflow on 32 bit platforms. - - Impact summary: A heap buffer overflow may lead to a crash or possibly - an attacker controlled code execution or other undefined behavior. - - Reported by: Quoc Tran (Xint.io - US Team). - - ([CVE-2026-31789]) - - *Igor Ustinov* - - * Fixed usage of `openssl s_client -connect HOST -proxy PROXY` with `HOST` - containing a raw IPv6 address. - - - *Peter Zhang* - - * Fixed broken detection of plantext HTTP over TLS. - - - *Matt Caswell* - ### Changes between 3.5.4 and 3.5.5 [27 Jan 2026] * Fixed Improper validation of PBMAC1 parameters in PKCS#12 MAC verification. @@ -3605,7 +3461,7 @@ breaking changes, and mappings for the large list of deprecated functions. *Richard Levitte* - * Fixed an overflow bug in the x86_64 Montgomery squaring procedure + * Fixed an overflow bug in the x64_64 Montgomery squaring procedure used in exponentiation with 512-bit moduli. No EC algorithms are affected. Analysis suggests that attacks against 2-prime RSA1024, 3-prime RSA1536, and DSA1024 as a result of this defect would be very @@ -21751,223 +21607,216 @@ ndif +[CVE-2026-22796]: https://www.openssl.org/news/vulnerabilities.html#CVE-2026-22796 +[CVE-2026-22795]: https://www.openssl.org/news/vulnerabilities.html#CVE-2026-22795 +[CVE-2025-69421]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-69421 +[CVE-2025-69420]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-69420 +[CVE-2025-69419]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-69419 +[CVE-2025-69418]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-69418 +[CVE-2025-68160]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-68160 +[CVE-2025-66199]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-66199 +[CVE-2025-15469]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-15469 +[CVE-2025-15468]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-15468 +[CVE-2025-15467]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-15467 +[CVE-2025-11187]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-11187 +[CVE-2025-9232]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9232 +[CVE-2025-9231]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9231 +[CVE-2025-9230]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9230 +[CVE-2025-4575]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-4575 +[CVE-2024-13176]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-13176 +[CVE-2024-9143]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-9143 +[CVE-2024-6119]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-6119 +[CVE-2024-5535]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-5535 +[CVE-2024-4741]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-4741 +[CVE-2024-4603]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-4603 +[CVE-2024-2511]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-2511 +[CVE-2024-0727]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-0727 +[CVE-2023-6237]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-6237 +[CVE-2023-6129]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-6129 +[CVE-2023-5678]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-5678 +[CVE-2023-5363]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-5363 +[CVE-2023-4807]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-4807 +[CVE-2023-3817]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3817 +[CVE-2023-3446]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3446 +[CVE-2023-2975]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2975 +[RFC 2578 (STD 58), section 3.5]: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5 +[CVE-2023-2650]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2650 +[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255 +[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466 +[CVE-2023-0465]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0465 +[CVE-2023-0464]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0464 +[CVE-2023-0401]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0401 +[CVE-2023-0286]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0286 +[CVE-2023-0217]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0217 +[CVE-2023-0216]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0216 +[CVE-2023-0215]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0215 +[CVE-2022-4450]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-4450 +[CVE-2022-4304]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-4304 +[CVE-2022-4203]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-4203 +[CVE-2022-3996]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-3996 +[CVE-2022-2274]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2274 +[CVE-2022-2097]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2097 +[CVE-2020-1971]: https://www.openssl.org/news/vulnerabilities.html#CVE-2020-1971 +[CVE-2020-1967]: https://www.openssl.org/news/vulnerabilities.html#CVE-2020-1967 +[CVE-2019-1563]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1563 +[CVE-2019-1559]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1559 +[CVE-2019-1552]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1552 +[CVE-2019-1551]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1551 +[CVE-2019-1549]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1549 +[CVE-2019-1547]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1547 +[CVE-2019-1543]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1543 +[CVE-2018-5407]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-5407 +[CVE-2018-0739]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0739 +[CVE-2018-0737]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0737 +[CVE-2018-0735]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0735 +[CVE-2018-0734]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0734 +[CVE-2018-0733]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0733 +[CVE-2018-0732]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0732 +[CVE-2017-3738]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3738 +[CVE-2017-3737]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3737 +[CVE-2017-3736]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3736 +[CVE-2017-3735]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3735 +[CVE-2017-3733]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3733 +[CVE-2017-3732]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3732 +[CVE-2017-3731]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3731 +[CVE-2017-3730]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3730 +[CVE-2016-7055]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-7055 +[CVE-2016-7054]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-7054 +[CVE-2016-7053]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-7053 +[CVE-2016-7052]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-7052 +[CVE-2016-6309]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6309 +[CVE-2016-6308]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6308 +[CVE-2016-6307]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6307 +[CVE-2016-6306]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6306 +[CVE-2016-6305]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6305 +[CVE-2016-6304]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6304 +[CVE-2016-6303]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6303 +[CVE-2016-6302]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6302 +[CVE-2016-2183]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2183 +[CVE-2016-2182]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2182 +[CVE-2016-2181]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2181 +[CVE-2016-2180]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2180 +[CVE-2016-2179]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2179 +[CVE-2016-2178]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2178 +[CVE-2016-2177]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2177 +[CVE-2016-2176]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2176 +[CVE-2016-2109]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2109 +[CVE-2016-2107]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2107 +[CVE-2016-2106]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2106 +[CVE-2016-2105]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2105 +[CVE-2016-0800]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0800 +[CVE-2016-0799]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0799 +[CVE-2016-0798]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0798 +[CVE-2016-0797]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0797 +[CVE-2016-0705]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0705 +[CVE-2016-0702]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0702 +[CVE-2016-0701]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0701 +[CVE-2015-3197]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3197 +[CVE-2015-3196]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3196 +[CVE-2015-3195]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3195 +[CVE-2015-3194]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3194 +[CVE-2015-3193]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3193 +[CVE-2015-1793]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1793 +[CVE-2015-1792]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1792 +[CVE-2015-1791]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1791 +[CVE-2015-1790]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1790 +[CVE-2015-1789]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1789 +[CVE-2015-1788]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1788 +[CVE-2015-1787]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1787 +[CVE-2015-0293]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0293 +[CVE-2015-0291]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0291 +[CVE-2015-0290]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0290 +[CVE-2015-0289]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0289 +[CVE-2015-0288]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0288 +[CVE-2015-0287]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0287 +[CVE-2015-0286]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0286 +[CVE-2015-0285]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0285 +[CVE-2015-0209]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0209 +[CVE-2015-0208]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0208 +[CVE-2015-0207]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0207 +[CVE-2015-0206]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0206 +[CVE-2015-0205]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0205 +[CVE-2015-0204]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0204 +[CVE-2014-8275]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-8275 +[CVE-2014-5139]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-5139 +[CVE-2014-3572]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3572 +[CVE-2014-3571]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3571 +[CVE-2014-3570]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3570 +[CVE-2014-3569]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3569 +[CVE-2014-3568]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3568 +[CVE-2014-3567]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3567 +[CVE-2014-3566]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3566 +[CVE-2014-3513]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3513 +[CVE-2014-3512]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3512 +[CVE-2014-3511]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3511 +[CVE-2014-3510]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3510 +[CVE-2014-3509]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3509 +[CVE-2014-3508]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3508 +[CVE-2014-3507]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3507 +[CVE-2014-3506]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3506 +[CVE-2014-3505]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3505 +[CVE-2014-3470]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3470 +[CVE-2014-0224]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0224 +[CVE-2014-0221]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0221 +[CVE-2014-0195]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0195 +[CVE-2014-0160]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0160 +[CVE-2014-0076]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0076 +[CVE-2013-6450]: https://www.openssl.org/news/vulnerabilities.html#CVE-2013-6450 +[CVE-2013-4353]: https://www.openssl.org/news/vulnerabilities.html#CVE-2013-4353 +[CVE-2013-0169]: https://www.openssl.org/news/vulnerabilities.html#CVE-2013-0169 +[CVE-2013-0166]: https://www.openssl.org/news/vulnerabilities.html#CVE-2013-0166 +[CVE-2012-2686]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-2686 +[CVE-2012-2333]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-2333 +[CVE-2012-2110]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-2110 +[CVE-2012-0884]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-0884 +[CVE-2012-0050]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-0050 +[CVE-2012-0027]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-0027 +[CVE-2011-4619]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-4619 +[CVE-2011-4577]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-4577 +[CVE-2011-4576]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-4576 +[CVE-2011-4109]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-4109 +[CVE-2011-4108]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-4108 +[CVE-2011-3210]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-3210 +[CVE-2011-3207]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-3207 +[CVE-2011-0014]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-0014 +[CVE-2010-4252]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-4252 +[CVE-2010-4180]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-4180 +[CVE-2010-3864]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-3864 +[CVE-2010-1633]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-1633 +[CVE-2010-0740]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-0740 +[CVE-2010-0433]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-0433 +[CVE-2009-4355]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-4355 +[CVE-2009-3555]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-3555 +[CVE-2009-3245]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-3245 +[CVE-2009-1386]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-1386 +[CVE-2009-1379]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-1379 +[CVE-2009-1378]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-1378 +[CVE-2009-1377]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-1377 +[CVE-2009-0789]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-0789 +[CVE-2009-0591]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-0591 +[CVE-2009-0590]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-0590 +[CVE-2008-5077]: https://www.openssl.org/news/vulnerabilities.html#CVE-2008-5077 +[CVE-2008-1678]: https://www.openssl.org/news/vulnerabilities.html#CVE-2008-1678 +[CVE-2008-1672]: https://www.openssl.org/news/vulnerabilities.html#CVE-2008-1672 +[CVE-2008-0891]: https://www.openssl.org/news/vulnerabilities.html#CVE-2008-0891 +[CVE-2007-5135]: https://www.openssl.org/news/vulnerabilities.html#CVE-2007-5135 +[CVE-2007-4995]: https://www.openssl.org/news/vulnerabilities.html#CVE-2007-4995 +[CVE-2006-4343]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-4343 +[CVE-2006-4339]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-4339 +[CVE-2006-3738]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-3738 +[CVE-2006-2940]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-2940 +[CVE-2006-2937]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-2937 +[CVE-2005-2969]: https://www.openssl.org/news/vulnerabilities.html#CVE-2005-2969 +[CVE-2004-0112]: https://www.openssl.org/news/vulnerabilities.html#CVE-2004-0112 +[CVE-2004-0079]: https://www.openssl.org/news/vulnerabilities.html#CVE-2004-0079 +[CVE-2003-0851]: https://www.openssl.org/news/vulnerabilities.html#CVE-2003-0851 +[CVE-2003-0545]: https://www.openssl.org/news/vulnerabilities.html#CVE-2003-0545 +[CVE-2003-0544]: https://www.openssl.org/news/vulnerabilities.html#CVE-2003-0544 +[CVE-2003-0543]: https://www.openssl.org/news/vulnerabilities.html#CVE-2003-0543 +[CVE-2003-0078]: https://www.openssl.org/news/vulnerabilities.html#CVE-2003-0078 +[CVE-2002-0659]: https://www.openssl.org/news/vulnerabilities.html#CVE-2002-0659 +[CVE-2002-0657]: https://www.openssl.org/news/vulnerabilities.html#CVE-2002-0657 +[CVE-2002-0656]: https://www.openssl.org/news/vulnerabilities.html#CVE-2002-0656 +[CVE-2002-0655]: https://www.openssl.org/news/vulnerabilities.html#CVE-2002-0655 [CMVP]: https://csrc.nist.gov/projects/cryptographic-module-validation-program -[CVE-2002-0655]: https://openssl-library.org/news/vulnerabilities/#CVE-2002-0655 -[CVE-2002-0656]: https://openssl-library.org/news/vulnerabilities/#CVE-2002-0656 -[CVE-2002-0657]: https://openssl-library.org/news/vulnerabilities/#CVE-2002-0657 -[CVE-2002-0659]: https://openssl-library.org/news/vulnerabilities/#CVE-2002-0659 -[CVE-2003-0078]: https://openssl-library.org/news/vulnerabilities/#CVE-2003-0078 -[CVE-2003-0543]: https://openssl-library.org/news/vulnerabilities/#CVE-2003-0543 -[CVE-2003-0544]: https://openssl-library.org/news/vulnerabilities/#CVE-2003-0544 -[CVE-2003-0545]: https://openssl-library.org/news/vulnerabilities/#CVE-2003-0545 -[CVE-2003-0851]: https://openssl-library.org/news/vulnerabilities/#CVE-2003-0851 -[CVE-2004-0079]: https://openssl-library.org/news/vulnerabilities/#CVE-2004-0079 -[CVE-2004-0112]: https://openssl-library.org/news/vulnerabilities/#CVE-2004-0112 -[CVE-2005-2969]: https://openssl-library.org/news/vulnerabilities/#CVE-2005-2969 -[CVE-2006-2937]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-2937 -[CVE-2006-2940]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-2940 -[CVE-2006-3738]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-3738 -[CVE-2006-4339]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-4339 -[CVE-2006-4343]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-4343 -[CVE-2007-4995]: https://openssl-library.org/news/vulnerabilities/#CVE-2007-4995 -[CVE-2007-5135]: https://openssl-library.org/news/vulnerabilities/#CVE-2007-5135 -[CVE-2008-0891]: https://openssl-library.org/news/vulnerabilities/#CVE-2008-0891 -[CVE-2008-1672]: https://openssl-library.org/news/vulnerabilities/#CVE-2008-1672 -[CVE-2008-1678]: https://openssl-library.org/news/vulnerabilities/#CVE-2008-1678 -[CVE-2008-5077]: https://openssl-library.org/news/vulnerabilities/#CVE-2008-5077 -[CVE-2009-0590]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-0590 -[CVE-2009-0591]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-0591 -[CVE-2009-0789]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-0789 -[CVE-2009-1377]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-1377 -[CVE-2009-1378]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-1378 -[CVE-2009-1379]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-1379 -[CVE-2009-1386]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-1386 -[CVE-2009-3245]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-3245 -[CVE-2009-3555]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-3555 -[CVE-2009-4355]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-4355 -[CVE-2010-0433]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-0433 -[CVE-2010-0740]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-0740 -[CVE-2010-1633]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-1633 -[CVE-2010-3864]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-3864 -[CVE-2010-4180]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-4180 -[CVE-2010-4252]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-4252 -[CVE-2011-0014]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-0014 -[CVE-2011-3207]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-3207 -[CVE-2011-3210]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-3210 -[CVE-2011-4108]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-4108 -[CVE-2011-4109]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-4109 -[CVE-2011-4576]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-4576 -[CVE-2011-4577]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-4577 -[CVE-2011-4619]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-4619 -[CVE-2012-0027]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-0027 -[CVE-2012-0050]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-0050 -[CVE-2012-0884]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-0884 -[CVE-2012-2110]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-2110 -[CVE-2012-2333]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-2333 -[CVE-2012-2686]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-2686 -[CVE-2013-0166]: https://openssl-library.org/news/vulnerabilities/#CVE-2013-0166 -[CVE-2013-0169]: https://openssl-library.org/news/vulnerabilities/#CVE-2013-0169 -[CVE-2013-4353]: https://openssl-library.org/news/vulnerabilities/#CVE-2013-4353 -[CVE-2013-6450]: https://openssl-library.org/news/vulnerabilities/#CVE-2013-6450 -[CVE-2014-0076]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0076 -[CVE-2014-0160]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0160 -[CVE-2014-0195]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0195 -[CVE-2014-0221]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0221 -[CVE-2014-0224]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0224 -[CVE-2014-3470]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3470 -[CVE-2014-3505]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3505 -[CVE-2014-3506]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3506 -[CVE-2014-3507]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3507 -[CVE-2014-3508]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3508 -[CVE-2014-3509]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3509 -[CVE-2014-3510]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3510 -[CVE-2014-3511]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3511 -[CVE-2014-3512]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3512 -[CVE-2014-3513]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3513 -[CVE-2014-3566]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3566 -[CVE-2014-3567]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3567 -[CVE-2014-3568]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3568 -[CVE-2014-3569]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3569 -[CVE-2014-3570]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3570 -[CVE-2014-3571]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3571 -[CVE-2014-3572]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3572 -[CVE-2014-5139]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-5139 -[CVE-2014-8275]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-8275 -[CVE-2015-0204]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0204 -[CVE-2015-0205]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0205 -[CVE-2015-0206]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0206 -[CVE-2015-0207]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0207 -[CVE-2015-0208]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0208 -[CVE-2015-0209]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0209 -[CVE-2015-0285]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0285 -[CVE-2015-0286]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0286 -[CVE-2015-0287]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0287 -[CVE-2015-0288]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0288 -[CVE-2015-0289]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0289 -[CVE-2015-0290]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0290 -[CVE-2015-0291]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0291 -[CVE-2015-0293]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0293 -[CVE-2015-1787]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1787 -[CVE-2015-1788]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1788 -[CVE-2015-1789]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1789 -[CVE-2015-1790]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1790 -[CVE-2015-1791]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1791 -[CVE-2015-1792]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1792 -[CVE-2015-1793]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1793 -[CVE-2015-3193]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3193 -[CVE-2015-3194]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3194 -[CVE-2015-3195]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3195 -[CVE-2015-3196]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3196 -[CVE-2015-3197]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3197 -[CVE-2016-0701]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0701 -[CVE-2016-0702]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0702 -[CVE-2016-0705]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0705 -[CVE-2016-0797]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0797 -[CVE-2016-0798]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0798 -[CVE-2016-0799]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0799 -[CVE-2016-0800]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0800 -[CVE-2016-2105]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2105 -[CVE-2016-2106]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2106 -[CVE-2016-2107]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2107 -[CVE-2016-2109]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2109 -[CVE-2016-2176]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2176 -[CVE-2016-2177]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2177 -[CVE-2016-2178]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2178 -[CVE-2016-2179]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2179 -[CVE-2016-2180]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2180 -[CVE-2016-2181]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2181 -[CVE-2016-2182]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2182 -[CVE-2016-2183]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2183 -[CVE-2016-6302]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6302 -[CVE-2016-6303]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6303 -[CVE-2016-6304]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6304 -[CVE-2016-6305]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6305 -[CVE-2016-6306]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6306 -[CVE-2016-6307]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6307 -[CVE-2016-6308]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6308 -[CVE-2016-6309]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6309 -[CVE-2016-7052]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-7052 -[CVE-2016-7053]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-7053 -[CVE-2016-7054]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-7054 -[CVE-2016-7055]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-7055 -[CVE-2017-3730]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3730 -[CVE-2017-3731]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3731 -[CVE-2017-3732]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3732 -[CVE-2017-3733]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3733 -[CVE-2017-3735]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3735 -[CVE-2017-3736]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3736 -[CVE-2017-3737]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3737 -[CVE-2017-3738]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3738 -[CVE-2018-0732]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0732 -[CVE-2018-0733]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0733 -[CVE-2018-0734]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0734 -[CVE-2018-0735]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0735 -[CVE-2018-0737]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0737 -[CVE-2018-0739]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0739 -[CVE-2018-5407]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-5407 -[CVE-2019-1543]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1543 -[CVE-2019-1547]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1547 -[CVE-2019-1549]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1549 -[CVE-2019-1551]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1551 -[CVE-2019-1552]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1552 -[CVE-2019-1559]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1559 -[CVE-2019-1563]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1563 -[CVE-2020-1967]: https://openssl-library.org/news/vulnerabilities/#CVE-2020-1967 -[CVE-2020-1971]: https://openssl-library.org/news/vulnerabilities/#CVE-2020-1971 -[CVE-2022-2097]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-2097 -[CVE-2022-2274]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-2274 -[CVE-2022-3996]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-3996 -[CVE-2022-4203]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-4203 -[CVE-2022-4304]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-4304 -[CVE-2022-4450]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-4450 -[CVE-2023-0215]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0215 -[CVE-2023-0216]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0216 -[CVE-2023-0217]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0217 -[CVE-2023-0286]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0286 -[CVE-2023-0401]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0401 -[CVE-2023-0464]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0464 -[CVE-2023-0465]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0465 -[CVE-2023-0466]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0466 -[CVE-2023-1255]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-1255 -[CVE-2023-2650]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-2650 -[CVE-2023-2975]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-2975 -[CVE-2023-3446]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-3446 -[CVE-2023-3817]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-3817 -[CVE-2023-4807]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-4807 -[CVE-2023-5363]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-5363 -[CVE-2023-5678]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-5678 -[CVE-2023-6129]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-6129 -[CVE-2023-6237]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-6237 -[CVE-2024-0727]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-0727 -[CVE-2024-2511]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-2511 -[CVE-2024-4603]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-4603 -[CVE-2024-4741]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-4741 -[CVE-2024-5535]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-5535 -[CVE-2024-6119]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-6119 -[CVE-2024-9143]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-9143 -[CVE-2024-13176]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-13176 -[CVE-2025-4575]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-4575 -[CVE-2025-9230]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-9230 -[CVE-2025-9231]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-9231 -[CVE-2025-9232]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-9232 -[CVE-2025-11187]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-11187 -[CVE-2025-15467]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-15467 -[CVE-2025-15468]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-15468 -[CVE-2025-15469]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-15469 -[CVE-2025-66199]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-66199 -[CVE-2025-68160]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-68160 -[CVE-2025-69418]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-69418 -[CVE-2025-69419]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-69419 -[CVE-2025-69420]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-69420 -[CVE-2025-69421]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-69421 -[CVE-2026-2673]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-2673 -[CVE-2026-22795]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-22795 -[CVE-2026-22796]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-22796 -[CVE-2026-28387]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28387 -[CVE-2026-28388]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28388 -[CVE-2026-28389]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28389 -[CVE-2026-28390]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28390 -[CVE-2026-31789]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-31789 -[CVE-2026-31790]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-31790 [ESV]: https://csrc.nist.gov/Projects/cryptographic-module-validation-program/entropy-validations -[RFC 2578 (STD 58), section 3.5]: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5 diff --git a/deps/openssl/openssl/CONTRIBUTING.md b/deps/openssl/openssl/CONTRIBUTING.md index 06dfbaeff1fecf..09416095e64d04 100644 --- a/deps/openssl/openssl/CONTRIBUTING.md +++ b/deps/openssl/openssl/CONTRIBUTING.md @@ -27,18 +27,6 @@ communication before submitting many pull requests. In addition, contributors should personally evaluate potential patches generated by automated tools. -Provide a clear description of the issue or feature being addressed, -including any relevant implementation details and, for performance -improvements, benchmark results. - -Pull requests and commits should be self-contained, enabling readers to -understand what changed and why without needing to reference related -issues or having prior knowledge. Commit messages should include all -relevant details to help future contributors follow the git history, -with clear explanations of what is changing and why. Long descriptions -are encouraged if they aid understanding. Commit message titles (their -first line) should be kept to 50-70 characters if possible. - To make it easier to review and accept your pull request, please follow these guidelines: diff --git a/deps/openssl/openssl/Configurations/10-main.conf b/deps/openssl/openssl/Configurations/10-main.conf index 692eccbfa1dcbf..cba57b41273f80 100644 --- a/deps/openssl/openssl/Configurations/10-main.conf +++ b/deps/openssl/openssl/Configurations/10-main.conf @@ -5,8 +5,7 @@ my $vc_win64a_info = {}; sub vc_win64a_info { unless (%$vc_win64a_info) { - # Minimum NASM version is 2.09 otherwise SHA3 might be miscompiled - if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+)\.([0-9]+)/ && ($1 > 2 || ($1 == 2 && $2 >= 9))) { + if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) { $vc_win64a_info = { AS => "nasm", ASFLAGS => "-g", asflags => "-Ox -f win64 -DNEAR", diff --git a/deps/openssl/openssl/Configurations/unix-Makefile.tmpl b/deps/openssl/openssl/Configurations/unix-Makefile.tmpl index 5bf397eba021d7..78be4a319964cf 100644 --- a/deps/openssl/openssl/Configurations/unix-Makefile.tmpl +++ b/deps/openssl/openssl/Configurations/unix-Makefile.tmpl @@ -72,7 +72,6 @@ OPTIONS={- $config{options} -} CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -}) SRCDIR={- $config{sourcedir} -} BLDDIR={- $config{builddir} -} -RESULT_D=$(BLDDIR)/test-runs FIPSKEY={- $config{FIPSKEY} -} VERSION={- "$config{full_version}" -} @@ -643,7 +642,7 @@ clean: libclean ## Clean the workspace, keep the configuration -find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -exec $(RM) {} \; $(RM) core $(RM) tags TAGS doc-nits md-nits - $(RM) -r $(RESULT_D) + $(RM) -r test/test-runs $(RM) providers/fips*.new -find . -type l \! -name '.*' -exec $(RM) {} \; diff --git a/deps/openssl/openssl/Configurations/windows-makefile.tmpl b/deps/openssl/openssl/Configurations/windows-makefile.tmpl index e553e8f9fec32a..894834cfb7efd0 100644 --- a/deps/openssl/openssl/Configurations/windows-makefile.tmpl +++ b/deps/openssl/openssl/Configurations/windows-makefile.tmpl @@ -38,7 +38,6 @@ PLATFORM={- $config{target} -} SRCDIR={- $config{sourcedir} -} BLDDIR={- $config{builddir} -} -RESULT_D=$(BLDDIR)\test-runs FIPSKEY={- $config{FIPSKEY} -} VERSION={- "$config{full_version}" -} @@ -223,7 +222,7 @@ OPENSSLDIR_dir={- canonpath($openssldir_dir) -} LIBDIR={- our $libdir = $config{libdir} || "lib"; file_name_is_absolute($libdir) ? "" : $libdir -} MODULESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath catpath); - our $modulesprefix = file_name_is_absolute($libdir) ? $libdir : catdir($prefix,$libdir); + our $modulesprefix = catdir($prefix,$libdir); our ($modulesprefix_dev, $modulesprefix_dir, $modulesprefix_file) = splitpath($modulesprefix, 1); @@ -485,7 +484,7 @@ clean: libclean -del /Q /S /F engines\*.lib engines\*.exp -del /Q /S /F apps\*.lib apps\*.rc apps\*.res apps\*.exp -del /Q /S /F test\*.exp - -@if exist "$(RESULT_D)" rd /Q /S "$(RESULT_D)" + -rd /Q /S test\test-runs distclean: clean -del /Q /F include\openssl\configuration.h diff --git a/deps/openssl/openssl/NEWS.md b/deps/openssl/openssl/NEWS.md index 07f78ae2af179b..f4ec14718d717f 100644 --- a/deps/openssl/openssl/NEWS.md +++ b/deps/openssl/openssl/NEWS.md @@ -23,36 +23,6 @@ OpenSSL Releases OpenSSL 3.5 ----------- -### Major changes between OpenSSL 3.5.5 and OpenSSL 3.5.6 [7 Apr 2026] - -OpenSSL 3.5.6 is a security patch release. The most severe CVE fixed in this -release is Medium. - -This release incorporates the following bug fixes and mitigations: - - * Fixed incorrect failure handling in RSA KEM RSASVE encapsulation. - ([CVE-2026-31790]) - - * Fixed loss of key agreement group tuple structure when the `DEFAULT` keyword - is used in the server-side configuration of the key-agreement group list. - ([CVE-2026-2673]) - - * Fixed potential use-after-free in DANE client code. - ([CVE-2026-28387]) - - * Fixed NULL pointer dereference when processing a delta CRL. - ([CVE-2026-28388]) - - * Fixed possible NULL dereference when processing CMS KeyAgreeRecipientInfo. - ([CVE-2026-28389]) - - * Fixed possible NULL dereference when processing CMS - KeyTransportRecipientInfo. - ([CVE-2026-28390]) - - * Fixed heap buffer overflow in hexadecimal conversion. - ([CVE-2026-31789]) - ### Major changes between OpenSSL 3.5.4 and OpenSSL 3.5.5 [27 Jan 2026] OpenSSL 3.5.5 is a security patch release. The most severe CVE fixed in this @@ -788,7 +758,7 @@ OpenSSL 1.1.1 ### Major changes between OpenSSL 1.1.1d and OpenSSL 1.1.1e [17 Mar 2020] - * Fixed an overflow bug in the x86_64 Montgomery squaring procedure + * Fixed an overflow bug in the x64_64 Montgomery squaring procedure used in exponentiation with 512-bit moduli ([CVE-2019-1551]) ### Major changes between OpenSSL 1.1.1c and OpenSSL 1.1.1d [10 Sep 2019] @@ -2018,208 +1988,201 @@ OpenSSL 0.9.x * Support for various new platforms -[CHANGES.md]: ./CHANGES.md -[CMVP]: https://csrc.nist.gov/projects/cryptographic-module-validation-program -[CVE-2005-2969]: https://openssl-library.org/news/vulnerabilities/#CVE-2005-2969 -[CVE-2006-2937]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-2937 -[CVE-2006-2940]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-2940 -[CVE-2006-3737]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-3737 -[CVE-2006-4339]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-4339 -[CVE-2006-4343]: https://openssl-library.org/news/vulnerabilities/#CVE-2006-4343 -[CVE-2008-5077]: https://openssl-library.org/news/vulnerabilities/#CVE-2008-5077 -[CVE-2009-0590]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-0590 -[CVE-2009-0591]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-0591 -[CVE-2009-0789]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-0789 -[CVE-2009-3555]: https://openssl-library.org/news/vulnerabilities/#CVE-2009-3555 -[CVE-2010-0433]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-0433 -[CVE-2010-0740]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-0740 -[CVE-2010-1633]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-1633 -[CVE-2010-2939]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-2939 -[CVE-2010-3864]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-3864 -[CVE-2010-4180]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-4180 -[CVE-2010-4252]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-4252 -[CVE-2010-5298]: https://openssl-library.org/news/vulnerabilities/#CVE-2010-5298 -[CVE-2011-0014]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-0014 -[CVE-2011-3207]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-3207 -[CVE-2011-3210]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-3210 -[CVE-2011-4108]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-4108 -[CVE-2011-4576]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-4576 -[CVE-2011-4577]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-4577 -[CVE-2011-4619]: https://openssl-library.org/news/vulnerabilities/#CVE-2011-4619 -[CVE-2012-0027]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-0027 -[CVE-2012-0050]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-0050 -[CVE-2012-0884]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-0884 -[CVE-2012-2110]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-2110 -[CVE-2012-2333]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-2333 -[CVE-2012-2686]: https://openssl-library.org/news/vulnerabilities/#CVE-2012-2686 -[CVE-2013-0166]: https://openssl-library.org/news/vulnerabilities/#CVE-2013-0166 -[CVE-2013-0169]: https://openssl-library.org/news/vulnerabilities/#CVE-2013-0169 -[CVE-2013-4353]: https://openssl-library.org/news/vulnerabilities/#CVE-2013-4353 -[CVE-2013-6449]: https://openssl-library.org/news/vulnerabilities/#CVE-2013-6449 -[CVE-2013-6450]: https://openssl-library.org/news/vulnerabilities/#CVE-2013-6450 -[CVE-2014-0076]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0076 -[CVE-2014-0160]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0160 -[CVE-2014-0195]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0195 -[CVE-2014-0198]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0198 -[CVE-2014-0221]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0221 -[CVE-2014-0224]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-0224 -[CVE-2014-3470]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3470 -[CVE-2014-3505]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3505 -[CVE-2014-3506]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3506 -[CVE-2014-3507]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3507 -[CVE-2014-3508]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3508 -[CVE-2014-3509]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3509 -[CVE-2014-3510]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3510 -[CVE-2014-3511]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3511 -[CVE-2014-3512]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3512 -[CVE-2014-3513]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3513 -[CVE-2014-3566]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3566 -[CVE-2014-3567]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3567 -[CVE-2014-3568]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3568 -[CVE-2014-3569]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3569 -[CVE-2014-3570]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3570 -[CVE-2014-3571]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3571 -[CVE-2014-3572]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-3572 -[CVE-2014-5139]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-5139 -[CVE-2014-8275]: https://openssl-library.org/news/vulnerabilities/#CVE-2014-8275 -[CVE-2015-0204]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0204 -[CVE-2015-0205]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0205 -[CVE-2015-0206]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0206 -[CVE-2015-0207]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0207 -[CVE-2015-0208]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0208 -[CVE-2015-0209]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0209 -[CVE-2015-0285]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0285 -[CVE-2015-0286]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0286 -[CVE-2015-0287]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0287 -[CVE-2015-0288]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0288 -[CVE-2015-0289]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0289 -[CVE-2015-0290]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0290 -[CVE-2015-0291]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0291 -[CVE-2015-0293]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-0293 -[CVE-2015-1787]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1787 -[CVE-2015-1788]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1788 -[CVE-2015-1789]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1789 -[CVE-2015-1790]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1790 -[CVE-2015-1791]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1791 -[CVE-2015-1792]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1792 -[CVE-2015-1793]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-1793 -[CVE-2015-3193]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3193 -[CVE-2015-3194]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3194 -[CVE-2015-3195]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3195 -[CVE-2015-3196]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3196 -[CVE-2015-3197]: https://openssl-library.org/news/vulnerabilities/#CVE-2015-3197 -[CVE-2016-0701]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0701 -[CVE-2016-0702]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0702 -[CVE-2016-0705]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0705 -[CVE-2016-0797]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0797 -[CVE-2016-0798]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0798 -[CVE-2016-0799]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0799 -[CVE-2016-0800]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-0800 -[CVE-2016-2105]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2105 -[CVE-2016-2106]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2106 -[CVE-2016-2107]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2107 -[CVE-2016-2109]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2109 -[CVE-2016-2176]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2176 -[CVE-2016-2177]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2177 -[CVE-2016-2178]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2178 -[CVE-2016-2179]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2179 -[CVE-2016-2180]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2180 -[CVE-2016-2181]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2181 -[CVE-2016-2182]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2182 -[CVE-2016-2183]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-2183 -[CVE-2016-6302]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6302 -[CVE-2016-6303]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6303 -[CVE-2016-6304]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6304 -[CVE-2016-6305]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6305 -[CVE-2016-6306]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6306 -[CVE-2016-6307]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6307 -[CVE-2016-6308]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6308 -[CVE-2016-6309]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-6309 -[CVE-2016-7052]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-7052 -[CVE-2016-7053]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-7053 -[CVE-2016-7054]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-7054 -[CVE-2016-7055]: https://openssl-library.org/news/vulnerabilities/#CVE-2016-7055 -[CVE-2017-3730]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3730 -[CVE-2017-3731]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3731 -[CVE-2017-3732]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3732 -[CVE-2017-3733]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3733 -[CVE-2017-3735]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3735 -[CVE-2017-3736]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3736 -[CVE-2017-3737]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3737 -[CVE-2017-3738]: https://openssl-library.org/news/vulnerabilities/#CVE-2017-3738 -[CVE-2018-0732]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0732 -[CVE-2018-0733]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0733 -[CVE-2018-0734]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0734 -[CVE-2018-0735]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0735 -[CVE-2018-0737]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0737 -[CVE-2018-0739]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-0739 -[CVE-2018-5407]: https://openssl-library.org/news/vulnerabilities/#CVE-2018-5407 -[CVE-2019-1543]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1543 -[CVE-2019-1547]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1547 -[CVE-2019-1549]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1549 -[CVE-2019-1551]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1551 -[CVE-2019-1552]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1552 -[CVE-2019-1559]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1559 -[CVE-2019-1563]: https://openssl-library.org/news/vulnerabilities/#CVE-2019-1563 -[CVE-2020-1967]: https://openssl-library.org/news/vulnerabilities/#CVE-2020-1967 -[CVE-2020-1971]: https://openssl-library.org/news/vulnerabilities/#CVE-2020-1971 -[CVE-2022-2097]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-2097 -[CVE-2022-2274]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-2274 -[CVE-2022-3996]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-3996 -[CVE-2022-4203]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-4203 -[CVE-2022-4304]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-4304 -[CVE-2022-4450]: https://openssl-library.org/news/vulnerabilities/#CVE-2022-4450 -[CVE-2023-0215]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0215 -[CVE-2023-0216]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0216 -[CVE-2023-0217]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0217 -[CVE-2023-0286]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0286 -[CVE-2023-0401]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0401 -[CVE-2023-0464]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0464 -[CVE-2023-0465]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0465 -[CVE-2023-0466]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-0466 -[CVE-2023-1255]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-1255 -[CVE-2023-2650]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-2650 -[CVE-2023-2975]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-2975 -[CVE-2023-3446]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-3446 -[CVE-2023-3817]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-3817 -[CVE-2023-4807]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-4807 -[CVE-2023-5363]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-5363 -[CVE-2023-5678]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-5678 -[CVE-2023-6129]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-6129 -[CVE-2023-6237]: https://openssl-library.org/news/vulnerabilities/#CVE-2023-6237 -[CVE-2024-0727]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-0727 -[CVE-2024-2511]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-2511 -[CVE-2024-4603]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-4603 -[CVE-2024-4741]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-4741 -[CVE-2024-5535]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-5535 -[CVE-2024-6119]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-6119 -[CVE-2024-9143]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-9143 -[CVE-2024-13176]: https://openssl-library.org/news/vulnerabilities/#CVE-2024-13176 -[CVE-2025-4575]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-4575 -[CVE-2025-9230]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-9230 -[CVE-2025-9231]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-9231 -[CVE-2025-9232]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-9232 -[CVE-2025-11187]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-11187 -[CVE-2025-15467]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-15467 -[CVE-2025-15468]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-15468 -[CVE-2025-15469]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-15469 -[CVE-2025-66199]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-66199 -[CVE-2025-68160]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-68160 -[CVE-2025-69418]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-69418 -[CVE-2025-69419]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-69419 -[CVE-2025-69420]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-69420 -[CVE-2025-69421]: https://openssl-library.org/news/vulnerabilities/#CVE-2025-69421 -[CVE-2026-2673]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-2673 -[CVE-2026-22795]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-22795 -[CVE-2026-22796]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-22796 -[CVE-2026-28387]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28387 -[CVE-2026-28388]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28388 -[CVE-2026-28389]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28389 -[CVE-2026-28390]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-28390 -[CVE-2026-31789]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-31789 -[CVE-2026-31790]: https://openssl-library.org/news/vulnerabilities/#CVE-2026-31790 -[ESV]: https://csrc.nist.gov/Projects/cryptographic-module-validation-program/entropy-validations +[CVE-2026-22796]: https://www.openssl.org/news/vulnerabilities.html#CVE-2026-22796 +[CVE-2026-22795]: https://www.openssl.org/news/vulnerabilities.html#CVE-2026-22795 +[CVE-2025-69421]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-69421 +[CVE-2025-69420]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-69420 +[CVE-2025-69419]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-69419 +[CVE-2025-69418]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-69418 +[CVE-2025-68160]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-68160 +[CVE-2025-66199]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-66199 +[CVE-2025-15469]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-15469 +[CVE-2025-15468]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-15468 +[CVE-2025-15467]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-15467 +[CVE-2025-11187]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-11187 +[CVE-2025-9232]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9232 +[CVE-2025-9231]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9231 +[CVE-2025-9230]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-9230 +[CVE-2025-4575]: https://www.openssl.org/news/vulnerabilities.html#CVE-2025-4575 +[CVE-2024-13176]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-13176 +[CVE-2024-9143]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-9143 +[CVE-2024-6119]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-6119 +[CVE-2024-5535]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-5535 +[CVE-2024-4741]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-4741 +[CVE-2024-4603]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-4603 +[CVE-2024-2511]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-2511 +[CVE-2024-0727]: https://www.openssl.org/news/vulnerabilities.html#CVE-2024-0727 +[CVE-2023-6237]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-6237 +[CVE-2023-6129]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-6129 +[CVE-2023-5678]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-5678 +[CVE-2023-5363]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-5363 +[CVE-2023-4807]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-4807 +[CVE-2023-3817]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3817 +[CVE-2023-3446]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3446 +[CVE-2023-2975]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2975 +[CVE-2023-2650]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2650 +[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255 +[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466 +[CVE-2023-0465]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0465 +[CVE-2023-0464]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0464 +[CVE-2023-0401]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0401 +[CVE-2023-0286]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0286 +[CVE-2023-0217]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0217 +[CVE-2023-0216]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0216 +[CVE-2023-0215]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0215 +[CVE-2022-4450]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-4450 +[CVE-2022-4304]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-4304 +[CVE-2022-4203]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-4203 +[CVE-2022-3996]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-3996 +[CVE-2022-2274]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2274 +[CVE-2022-2097]: https://www.openssl.org/news/vulnerabilities.html#CVE-2022-2097 +[CVE-2020-1971]: https://www.openssl.org/news/vulnerabilities.html#CVE-2020-1971 +[CVE-2020-1967]: https://www.openssl.org/news/vulnerabilities.html#CVE-2020-1967 +[CVE-2019-1563]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1563 +[CVE-2019-1559]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1559 +[CVE-2019-1552]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1552 +[CVE-2019-1551]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1551 +[CVE-2019-1549]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1549 +[CVE-2019-1547]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1547 +[CVE-2019-1543]: https://www.openssl.org/news/vulnerabilities.html#CVE-2019-1543 +[CVE-2018-5407]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-5407 +[CVE-2018-0739]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0739 +[CVE-2018-0737]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0737 +[CVE-2018-0735]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0735 +[CVE-2018-0734]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0734 +[CVE-2018-0733]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0733 +[CVE-2018-0732]: https://www.openssl.org/news/vulnerabilities.html#CVE-2018-0732 +[CVE-2017-3738]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3738 +[CVE-2017-3737]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3737 +[CVE-2017-3736]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3736 +[CVE-2017-3735]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3735 +[CVE-2017-3733]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3733 +[CVE-2017-3732]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3732 +[CVE-2017-3731]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3731 +[CVE-2017-3730]: https://www.openssl.org/news/vulnerabilities.html#CVE-2017-3730 +[CVE-2016-7055]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-7055 +[CVE-2016-7054]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-7054 +[CVE-2016-7053]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-7053 +[CVE-2016-7052]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-7052 +[CVE-2016-6309]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6309 +[CVE-2016-6308]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6308 +[CVE-2016-6307]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6307 +[CVE-2016-6306]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6306 +[CVE-2016-6305]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6305 +[CVE-2016-6304]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6304 +[CVE-2016-6303]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6303 +[CVE-2016-6302]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-6302 +[CVE-2016-2183]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2183 +[CVE-2016-2182]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2182 +[CVE-2016-2181]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2181 +[CVE-2016-2180]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2180 +[CVE-2016-2179]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2179 +[CVE-2016-2178]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2178 +[CVE-2016-2177]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2177 +[CVE-2016-2176]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2176 +[CVE-2016-2109]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2109 +[CVE-2016-2107]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2107 +[CVE-2016-2106]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2106 +[CVE-2016-2105]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-2105 +[CVE-2016-0800]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0800 +[CVE-2016-0799]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0799 +[CVE-2016-0798]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0798 +[CVE-2016-0797]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0797 +[CVE-2016-0705]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0705 +[CVE-2016-0702]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0702 +[CVE-2016-0701]: https://www.openssl.org/news/vulnerabilities.html#CVE-2016-0701 +[CVE-2015-3197]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3197 +[CVE-2015-3196]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3196 +[CVE-2015-3195]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3195 +[CVE-2015-3194]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3194 +[CVE-2015-3193]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-3193 +[CVE-2015-1793]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1793 +[CVE-2015-1792]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1792 +[CVE-2015-1791]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1791 +[CVE-2015-1790]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1790 +[CVE-2015-1789]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1789 +[CVE-2015-1788]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1788 +[CVE-2015-1787]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-1787 +[CVE-2015-0293]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0293 +[CVE-2015-0291]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0291 +[CVE-2015-0290]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0290 +[CVE-2015-0289]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0289 +[CVE-2015-0288]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0288 +[CVE-2015-0287]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0287 +[CVE-2015-0286]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0286 +[CVE-2015-0285]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0285 +[CVE-2015-0209]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0209 +[CVE-2015-0208]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0208 +[CVE-2015-0207]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0207 +[CVE-2015-0206]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0206 +[CVE-2015-0205]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0205 +[CVE-2015-0204]: https://www.openssl.org/news/vulnerabilities.html#CVE-2015-0204 +[CVE-2014-8275]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-8275 +[CVE-2014-5139]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-5139 +[CVE-2014-3572]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3572 +[CVE-2014-3571]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3571 +[CVE-2014-3570]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3570 +[CVE-2014-3569]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3569 +[CVE-2014-3568]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3568 +[CVE-2014-3567]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3567 +[CVE-2014-3566]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3566 +[CVE-2014-3513]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3513 +[CVE-2014-3512]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3512 +[CVE-2014-3511]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3511 +[CVE-2014-3510]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3510 +[CVE-2014-3509]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3509 +[CVE-2014-3508]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3508 +[CVE-2014-3507]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3507 +[CVE-2014-3506]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3506 +[CVE-2014-3505]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3505 +[CVE-2014-3470]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-3470 +[CVE-2014-0224]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0224 +[CVE-2014-0221]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0221 +[CVE-2014-0198]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0198 +[CVE-2014-0195]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0195 +[CVE-2014-0160]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0160 +[CVE-2014-0076]: https://www.openssl.org/news/vulnerabilities.html#CVE-2014-0076 +[CVE-2013-6450]: https://www.openssl.org/news/vulnerabilities.html#CVE-2013-6450 +[CVE-2013-6449]: https://www.openssl.org/news/vulnerabilities.html#CVE-2013-6449 +[CVE-2013-4353]: https://www.openssl.org/news/vulnerabilities.html#CVE-2013-4353 +[CVE-2013-0169]: https://www.openssl.org/news/vulnerabilities.html#CVE-2013-0169 +[CVE-2013-0166]: https://www.openssl.org/news/vulnerabilities.html#CVE-2013-0166 +[CVE-2012-2686]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-2686 +[CVE-2012-2333]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-2333 +[CVE-2012-2110]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-2110 +[CVE-2012-0884]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-0884 +[CVE-2012-0050]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-0050 +[CVE-2012-0027]: https://www.openssl.org/news/vulnerabilities.html#CVE-2012-0027 +[CVE-2011-4619]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-4619 +[CVE-2011-4577]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-4577 +[CVE-2011-4576]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-4576 +[CVE-2011-4108]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-4108 +[CVE-2011-3210]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-3210 +[CVE-2011-3207]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-3207 +[CVE-2011-0014]: https://www.openssl.org/news/vulnerabilities.html#CVE-2011-0014 +[CVE-2010-5298]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-5298 +[CVE-2010-4252]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-4252 +[CVE-2010-4180]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-4180 +[CVE-2010-3864]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-3864 +[CVE-2010-2939]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-2939 +[CVE-2010-1633]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-1633 +[CVE-2010-0740]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-0740 +[CVE-2010-0433]: https://www.openssl.org/news/vulnerabilities.html#CVE-2010-0433 +[CVE-2009-3555]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-3555 +[CVE-2009-0789]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-0789 +[CVE-2009-0591]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-0591 +[CVE-2009-0590]: https://www.openssl.org/news/vulnerabilities.html#CVE-2009-0590 +[CVE-2008-5077]: https://www.openssl.org/news/vulnerabilities.html#CVE-2008-5077 +[CVE-2006-4343]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-4343 +[CVE-2006-4339]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-4339 +[CVE-2006-3737]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-3737 +[CVE-2006-2940]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-2940 +[CVE-2006-2937]: https://www.openssl.org/news/vulnerabilities.html#CVE-2006-2937 +[CVE-2005-2969]: https://www.openssl.org/news/vulnerabilities.html#CVE-2005-2969 [OpenSSL Guide]: https://www.openssl.org/docs/manmaster/man7/ossl-guide-introduction.html +[CHANGES.md]: ./CHANGES.md [README-QUIC.md]: ./README-QUIC.md [issue tracker]: https://github.com/openssl/openssl/issues +[CMVP]: https://csrc.nist.gov/projects/cryptographic-module-validation-program +[ESV]: https://csrc.nist.gov/Projects/cryptographic-module-validation-program/entropy-validations [jitterentropy-library]: https://github.com/smuellerDD/jitterentropy-library diff --git a/deps/openssl/openssl/VERSION.dat b/deps/openssl/openssl/VERSION.dat index d3c75677c466d6..3a61c8e4e30a86 100644 --- a/deps/openssl/openssl/VERSION.dat +++ b/deps/openssl/openssl/VERSION.dat @@ -1,7 +1,7 @@ MAJOR=3 MINOR=5 -PATCH=6 +PATCH=5 PRE_RELEASE_TAG= BUILD_METADATA= -RELEASE_DATE="7 Apr 2026" +RELEASE_DATE="27 Jan 2026" SHLIB_VERSION=3 diff --git a/deps/openssl/openssl/apps/cmp.c b/deps/openssl/openssl/apps/cmp.c index 2fe7c18669bda1..f1af0b6c2b42ef 100644 --- a/deps/openssl/openssl/apps/cmp.c +++ b/deps/openssl/openssl/apps/cmp.c @@ -1,5 +1,5 @@ /* - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -1421,10 +1421,7 @@ static int setup_verification_ctx(OSSL_CMP_CTX *ctx) out_vpm = X509_STORE_get0_param(out_trusted); X509_VERIFY_PARAM_clear_flags(out_vpm, X509_V_FLAG_USE_CHECK_TIME); - if (!OSSL_CMP_CTX_set_certConf_cb_arg(ctx, out_trusted)) { - X509_STORE_free(out_trusted); - return 0; - } + (void)OSSL_CMP_CTX_set_certConf_cb_arg(ctx, out_trusted); } if (opt_disable_confirm) @@ -3393,12 +3390,6 @@ static void print_keyspec(OSSL_CMP_ATAVS *keySpec) int paramtype; const void *param; - /* NULL check to prevent dereferencing a NULL pointer when print_keyspec is called */ - if (alg == NULL) { - BIO_puts(mem, "Key algorithm: \n"); - break; - } - X509_ALGOR_get0(&oid, ¶mtype, ¶m, alg); BIO_printf(mem, "Key algorithm: "); i2a_ASN1_OBJECT(mem, oid); @@ -3798,7 +3789,8 @@ int cmp_main(int argc, char **argv) if (opt_ignore_keyusage) (void)OSSL_CMP_CTX_set_option(cmp_ctx, OSSL_CMP_OPT_IGNORE_KEYUSAGE, 1); if (opt_no_cache_extracerts) - (void)OSSL_CMP_CTX_set_option(cmp_ctx, OSSL_CMP_OPT_NO_CACHE_EXTRACERTS, 1); + (void)OSSL_CMP_CTX_set_option(cmp_ctx, OSSL_CMP_OPT_NO_CACHE_EXTRACERTS, + 1); if (opt_reqout_only == NULL && (opt_use_mock_srv #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP) @@ -3814,7 +3806,7 @@ int cmp_main(int argc, char **argv) srv_cmp_ctx = OSSL_CMP_SRV_CTX_get0_cmp_ctx(srv_ctx); if (!OSSL_CMP_CTX_set_log_cb(srv_cmp_ctx, print_to_bio_err)) { - CMP_err1("cannot set up server-side error reporting and logging for %s", prog); + CMP_err1("cannot set up error reporting and logging for %s", prog); goto err; } OSSL_CMP_CTX_set_log_verbosity(srv_cmp_ctx, opt_verbosity); diff --git a/deps/openssl/openssl/apps/include/cmp_mock_srv.h b/deps/openssl/openssl/apps/include/cmp_mock_srv.h index a6220cdea21a3b..215b95b744aa71 100644 --- a/deps/openssl/openssl/apps/include/cmp_mock_srv.h +++ b/deps/openssl/openssl/apps/include/cmp_mock_srv.h @@ -1,5 +1,5 @@ /* - * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved. * Copyright Siemens AG 2018-2020 * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -19,8 +19,6 @@ OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx, const char *propq); void ossl_cmp_mock_srv_free(OSSL_CMP_SRV_CTX *srv_ctx); -OSSL_CMP_MSG *ossl_cmp_mock_server_perform(OSSL_CMP_CTX *ctx, - const OSSL_CMP_MSG *req); int ossl_cmp_mock_srv_set1_refCert(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert); int ossl_cmp_mock_srv_set1_certOut(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert); @@ -36,7 +34,6 @@ int ossl_cmp_mock_srv_set1_oldWithNew(OSSL_CMP_SRV_CTX *srv_ctx, X509 *cert); int ossl_cmp_mock_srv_set_statusInfo(OSSL_CMP_SRV_CTX *srv_ctx, int status, int fail_info, const char *text); int ossl_cmp_mock_srv_set_sendError(OSSL_CMP_SRV_CTX *srv_ctx, int bodytype); -int ossl_cmp_mock_srv_set_useBadProtection(OSSL_CMP_SRV_CTX *srv_ctx, int bodytype); int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count); int ossl_cmp_mock_srv_set_checkAfterTime(OSSL_CMP_SRV_CTX *srv_ctx, int sec); diff --git a/deps/openssl/openssl/apps/lib/app_provider.c b/deps/openssl/openssl/apps/lib/app_provider.c index 3b66d048ea993e..6986ab4c10735f 100644 --- a/deps/openssl/openssl/apps/lib/app_provider.c +++ b/deps/openssl/openssl/apps/lib/app_provider.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -47,7 +47,6 @@ int app_provider_load(OSSL_LIB_CTX *libctx, const char *provider_name) app_providers = sk_OSSL_PROVIDER_new_null(); if (app_providers == NULL || !sk_OSSL_PROVIDER_push(app_providers, prov)) { - OSSL_PROVIDER_unload(prov); app_providers_cleanup(); return 0; } diff --git a/deps/openssl/openssl/apps/lib/apps.c b/deps/openssl/openssl/apps/lib/apps.c index bc2e1c123a755a..74644157e5caee 100644 --- a/deps/openssl/openssl/apps/lib/apps.c +++ b/deps/openssl/openssl/apps/lib/apps.c @@ -191,13 +191,8 @@ int app_passwd(const char *arg1, const char *arg2, char **pass1, char **pass2) } if (arg2 != NULL) { *pass2 = app_get_pass(arg2, same ? 2 : 0); - if (*pass2 == NULL) { - if (pass1 != NULL) { - clear_free(*pass1); - *pass1 = NULL; - } + if (*pass2 == NULL) return 0; - } } else if (pass2 != NULL) { *pass2 = NULL; } @@ -268,15 +263,15 @@ static char *app_get_pass(const char *arg, int keepbio) } } else { /* argument syntax error; do not reveal too much about arg */ - const char *arg_ptr = strchr(arg, ':'); - if (arg_ptr == NULL || arg_ptr - arg > PASS_SOURCE_SIZE_MAX) + tmp = strchr(arg, ':'); + if (tmp == NULL || tmp - arg > PASS_SOURCE_SIZE_MAX) BIO_printf(bio_err, "Invalid password argument, missing ':' within the first %d chars\n", PASS_SOURCE_SIZE_MAX + 1); else BIO_printf(bio_err, "Invalid password argument, starting with \"%.*s\"\n", - (int)(arg_ptr - arg + 1), arg); + (int)(tmp - arg + 1), arg); return NULL; } } @@ -2499,7 +2494,7 @@ static STACK_OF(X509_CRL) *crls_http_cb(const X509_STORE_CTX *ctx, error: X509_CRL_free(crl); - sk_X509_CRL_pop_free(crls, X509_CRL_free); + sk_X509_CRL_free(crls); return NULL; } diff --git a/deps/openssl/openssl/apps/lib/cmp_mock_srv.c b/deps/openssl/openssl/apps/lib/cmp_mock_srv.c index cf21e827788753..bf8b06c390bd78 100644 --- a/deps/openssl/openssl/apps/lib/cmp_mock_srv.c +++ b/deps/openssl/openssl/apps/lib/cmp_mock_srv.c @@ -1,5 +1,5 @@ /* - * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2018-2025 The OpenSSL Project Authors. All Rights Reserved. * Copyright Siemens AG 2018-2020 * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -10,7 +10,6 @@ #include "apps.h" #include "cmp_mock_srv.h" -#include "../../crypto/cmp/cmp_local.h" /* for access to msg->protection */ #include #include @@ -29,7 +28,6 @@ typedef struct { X509 *oldWithNew; /* to return in oldWithNew of rootKeyUpdate */ OSSL_CMP_PKISI *statusOut; /* status for ip/cp/kup/rp msg unless polling */ int sendError; /* send error response on given request type */ - int useBadProtection; /* use bad protection on given response type */ OSSL_CMP_MSG *req; /* original request message during polling */ int pollCount; /* number of polls before actual cert response */ int curr_pollCount; /* number of polls so far for current request */ @@ -61,7 +59,6 @@ static mock_srv_ctx *mock_srv_ctx_new(void) goto err; ctx->sendError = -1; - ctx->useBadProtection = -1; /* all other elements are initialized to 0 or NULL, respectively */ return ctx; @@ -190,19 +187,6 @@ int ossl_cmp_mock_srv_set_sendError(OSSL_CMP_SRV_CTX *srv_ctx, int bodytype) return 1; } -int ossl_cmp_mock_srv_set_useBadProtection(OSSL_CMP_SRV_CTX *srv_ctx, int bodytype) -{ - mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); - - if (ctx == NULL) { - ERR_raise(ERR_LIB_CMP, CMP_R_NULL_ARGUMENT); - return 0; - } - /* might check bodytype, but this would require exporting all body types */ - ctx->useBadProtection = bodytype; - return 1; -} - int ossl_cmp_mock_srv_set_pollCount(OSSL_CMP_SRV_CTX *srv_ctx, int count) { mock_srv_ctx *ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); @@ -607,7 +591,6 @@ static int process_genm(OSSL_CMP_SRV_CTX *srv_ctx, if (rsp != NULL && sk_OSSL_CMP_ITAV_push(*out, rsp)) return 1; sk_OSSL_CMP_ITAV_free(*out); - OSSL_CMP_ITAV_free(rsp); return 0; } @@ -729,25 +712,6 @@ static int process_pollReq(OSSL_CMP_SRV_CTX *srv_ctx, return 1; } -OSSL_CMP_MSG *ossl_cmp_mock_server_perform(OSSL_CMP_CTX *ctx, - const OSSL_CMP_MSG *req) -{ - OSSL_CMP_SRV_CTX *srv_ctx = OSSL_CMP_CTX_get_transfer_cb_arg(ctx); - OSSL_CMP_MSG *rsp = OSSL_CMP_CTX_server_perform(ctx, req); - - if (srv_ctx != NULL && rsp != NULL) { - mock_srv_ctx *mock_ctx = OSSL_CMP_SRV_CTX_get0_custom_ctx(srv_ctx); - - if (mock_ctx != NULL && OSSL_CMP_MSG_get_bodytype(rsp) == mock_ctx->useBadProtection) { - ASN1_BIT_STRING *prot = rsp->protection; - - if (prot != NULL && prot->length != 0 && prot->data != NULL) - prot->data[0] ^= 0x80; /* flip most significant bit of the first byte */ - } - } - return rsp; -} - OSSL_CMP_SRV_CTX *ossl_cmp_mock_srv_new(OSSL_LIB_CTX *libctx, const char *propq) { OSSL_CMP_SRV_CTX *srv_ctx = OSSL_CMP_SRV_CTX_new(libctx, propq); diff --git a/deps/openssl/openssl/apps/lib/win32_init.c b/deps/openssl/openssl/apps/lib/win32_init.c index 0ea2048283cbcd..824eb676310e8c 100644 --- a/deps/openssl/openssl/apps/lib/win32_init.c +++ b/deps/openssl/openssl/apps/lib/win32_init.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,6 +10,7 @@ #include #include #include +#include #if defined(CP_UTF8) diff --git a/deps/openssl/openssl/apps/ocsp.c b/deps/openssl/openssl/apps/ocsp.c index e2c147ef097ca6..a9b248d3a19826 100644 --- a/deps/openssl/openssl/apps/ocsp.c +++ b/deps/openssl/openssl/apps/ocsp.c @@ -876,7 +876,7 @@ int ocsp_main(int argc, char **argv) i = OCSP_basic_verify(bs, verify_other, store, verify_flags); if (i <= 0 && issuers) { - i = OCSP_basic_verify(bs, issuers, store, verify_flags); + i = OCSP_basic_verify(bs, issuers, store, OCSP_TRUSTOTHER); if (i > 0) ERR_clear_error(); } diff --git a/deps/openssl/openssl/apps/s_client.c b/deps/openssl/openssl/apps/s_client.c index d356359a97efbd..3625f8fcdc99d1 100644 --- a/deps/openssl/openssl/apps/s_client.c +++ b/deps/openssl/openssl/apps/s_client.c @@ -3892,11 +3892,7 @@ static void user_data_init(struct user_data_st *user_data, SSL *con, char *buf, static int user_data_add(struct user_data_st *user_data, size_t i) { - /* - * We must allow one byte for a NUL terminator so i must be less than - * bufmax - */ - if (user_data->buflen != 0 || i >= user_data->bufmax) + if (user_data->buflen != 0 || i > user_data->bufmax) return 0; user_data->buflen = i; diff --git a/deps/openssl/openssl/apps/ts.c b/deps/openssl/openssl/apps/ts.c index af355bfc05e87a..bd800bfaa32276 100644 --- a/deps/openssl/openssl/apps/ts.c +++ b/deps/openssl/openssl/apps/ts.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -348,7 +348,7 @@ int ts_main(int argc, char **argv) if ((in != NULL) && (queryfile != NULL)) goto opthelp; if (in == NULL) { - if (conf == NULL || token_in != 0 || queryfile == NULL) + if ((conf == NULL) || (token_in != 0)) goto opthelp; } ret = !reply_command(conf, section, engine, queryfile, diff --git a/deps/openssl/openssl/build.info b/deps/openssl/openssl/build.info index 144efbbe20f578..22c7c8a94b1f96 100644 --- a/deps/openssl/openssl/build.info +++ b/deps/openssl/openssl/build.info @@ -108,10 +108,12 @@ IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-|BC-)/ -}] SHARED_SOURCE[libssl]=libssl.rc ENDIF -# These files set the build directory up for CMake inclusion. -# To achieve this, their variables are taken from builddata.pm. -# These files are not installed; you will find the installable -# versions in the 'exporters' directory. +# This file sets the build directory up for CMake inclusion +# Note: This generation of OpenSSLConfig[Version].cmake is used +# for building openssl locally, and so the build variables are +# taken from builddata.pm rather than installdata.pm. For exportable +# versions of these generated files, you'll find them in the exporters +# directory GENERATE[OpenSSLConfig.cmake]=exporters/cmake/OpenSSLConfig.cmake.in DEPEND[OpenSSLConfig.cmake]=builddata.pm GENERATE[OpenSSLConfigVersion.cmake]=exporters/cmake/OpenSSLConfigVersion.cmake.in @@ -119,10 +121,7 @@ DEPEND[OpenSSLConfigVersion.cmake]=builddata.pm DEPEND[OpenSSLConfigVersion.cmake]=OpenSSLConfig.cmake DEPEND[""]=OpenSSLConfigVersion.cmake -# These files set the build directory up for pkg-config use. -# To achieve this, their variables are taken from builddata.pm. -# These files are not installed; you will find the installable -# versions in the 'exporters' directory. +# This file sets the build directory up for pkg-config GENERATE[libcrypto.pc]=exporters/pkg-config/libcrypto.pc.in DEPEND[libcrypto.pc]=builddata.pm GENERATE[libssl.pc]=exporters/pkg-config/libssl.pc.in @@ -132,7 +131,6 @@ DEPEND[openssl.pc]=builddata.pm DEPEND[openssl.pc]=libcrypto.pc libssl.pc GENERATE[builddata.pm]=util/mkinstallvars.pl \ - COMMENT="This file should be used when building against this OpenSSL build, and should never be installed" \ PREFIX=. BINDIR=apps APPLINKDIR=ms \ LIBDIR= INCLUDEDIR=include "INCLUDEDIR=$(SRCDIR)/include" \ ENGINESDIR=engines MODULESDIR=providers \ diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-riscv32-zkn.pl b/deps/openssl/openssl/crypto/aes/asm/aes-riscv32-zkn.pl index ed8f4a7f83aa4c..6fac45184620f3 100644 --- a/deps/openssl/openssl/crypto/aes/asm/aes-riscv32-zkn.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aes-riscv32-zkn.pl @@ -2,7 +2,7 @@ # This file is dual-licensed, meaning that you can use it under your # choice of either of the following two licenses: # -# Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You can obtain # a copy in the file LICENSE in the source distribution or at @@ -704,6 +704,11 @@ sub AES_set_common { my ($ke128, $ke192, $ke256) = @_; my $ret = ''; $ret .= <<___; + bnez $UKEY,1f # if (!userKey || !key) return -1; + bnez $KEYP,1f + li a0,-1 + ret +1: # Determine number of rounds from key size in bits li $T0,128 bne $BITS,$T0,1f diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zkn.pl b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zkn.pl index 68c213e43e349e..0e8a1540c43824 100644 --- a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zkn.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zkn.pl @@ -2,7 +2,7 @@ # This file is dual-licensed, meaning that you can use it under your # choice of either of the following two licenses: # -# Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You can obtain # a copy in the file LICENSE in the source distribution or at @@ -392,6 +392,11 @@ sub AES_set_common { my ($ke128, $ke192, $ke256) = @_; my $ret = ''; $ret .= <<___; + bnez $UKEY,1f # if (!userKey || !key) return -1; + bnez $KEYP,1f + li a0,-1 + ret +1: # Determine number of rounds from key size in bits li $T0,128 bne $BITS,$T0,1f diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvkned.pl b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvkned.pl index 014fa6807d33cb..4c0292781d9f8e 100644 --- a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvkned.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64-zvkned.pl @@ -2,7 +2,7 @@ # This file is dual-licensed, meaning that you can use it under your # choice of either of the following two licenses: # -# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2023 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You can obtain # a copy in the file LICENSE in the source distribution or at @@ -828,6 +828,9 @@ sub aes_256_decrypt { .globl rv64i_zvkned_set_encrypt_key .type rv64i_zvkned_set_encrypt_key,\@function rv64i_zvkned_set_encrypt_key: + beqz $UKEY, L_fail_m1 + beqz $KEYP, L_fail_m1 + # Get proper routine for key size li $T0, 256 beq $BITS, $T0, L_set_key_256 @@ -844,6 +847,9 @@ sub aes_256_decrypt { .globl rv64i_zvkned_set_decrypt_key .type rv64i_zvkned_set_decrypt_key,\@function rv64i_zvkned_set_decrypt_key: + beqz $UKEY, L_fail_m1 + beqz $KEYP, L_fail_m1 + # Get proper routine for key size li $T0, 256 beq $BITS, $T0, L_set_key_256 @@ -1350,6 +1356,11 @@ sub aes_256_decrypt { } $code .= <<___; +L_fail_m1: + li a0, -1 + ret +.size L_fail_m1,.-L_fail_m1 + L_fail_m2: li a0, -2 ret diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64.pl b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64.pl index 4bf9edae6858f4..525eba4b463802 100644 --- a/deps/openssl/openssl/crypto/aes/asm/aes-riscv64.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aes-riscv64.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2022 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -773,13 +773,11 @@ sub do_enc_lookup { ___ $code .= save_regs(); $code .= <<___; - beqz $UKEY,1f # if (!userKey || !key) return -1; - beqz $KEYP,1f - j 2f -1: + bnez $UKEY,1f # if (!userKey || !key) return -1; + bnez $KEYP,1f li a0,-1 ret -2: +1: la $RCON,AES_rcon la $TBL,AES_Te0 li $T8,128 diff --git a/deps/openssl/openssl/crypto/asn1/evp_asn1.c b/deps/openssl/openssl/crypto/asn1/evp_asn1.c index 2d50dc657baca6..caa079fad0ec81 100644 --- a/deps/openssl/openssl/crypto/asn1/evp_asn1.c +++ b/deps/openssl/openssl/crypto/asn1/evp_asn1.c @@ -95,7 +95,7 @@ ASN1_SEQUENCE(asn1_int_oct) = { ASN1_SIMPLE(asn1_int_oct, oct, ASN1_OCTET_STRING) } static_ASN1_SEQUENCE_END(asn1_int_oct) -DECLARE_ASN1_ITEM(asn1_int_oct) + DECLARE_ASN1_ITEM(asn1_int_oct) int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, int len) @@ -158,7 +158,7 @@ ASN1_SEQUENCE(asn1_oct_int) = { ASN1_EMBED(asn1_oct_int, num, INT32) } static_ASN1_SEQUENCE_END(asn1_oct_int) -DECLARE_ASN1_ITEM(asn1_oct_int) + DECLARE_ASN1_ITEM(asn1_oct_int) int ossl_asn1_type_set_octetstring_int(ASN1_TYPE *a, long num, unsigned char *data, int len) diff --git a/deps/openssl/openssl/crypto/asn1/n_pkey.c b/deps/openssl/openssl/crypto/asn1/n_pkey.c index 47f3a9802f8275..7b70d6c7a0cf03 100644 --- a/deps/openssl/openssl/crypto/asn1/n_pkey.c +++ b/deps/openssl/openssl/crypto/asn1/n_pkey.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -52,6 +52,6 @@ ASN1_SEQUENCE(NETSCAPE_PKEY) = { ASN1_SIMPLE(NETSCAPE_PKEY, private_key, ASN1_OCTET_STRING) } static_ASN1_SEQUENCE_END(NETSCAPE_PKEY) -DECLARE_ASN1_FUNCTIONS(NETSCAPE_PKEY) + DECLARE_ASN1_FUNCTIONS(NETSCAPE_PKEY) DECLARE_ASN1_ENCODE_FUNCTIONS_name(NETSCAPE_PKEY, NETSCAPE_PKEY) IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_PKEY) diff --git a/deps/openssl/openssl/crypto/asn1/p5_scrypt.c b/deps/openssl/openssl/crypto/asn1/p5_scrypt.c index 532740aab8a3c2..b6d7eee3c95e8d 100644 --- a/deps/openssl/openssl/crypto/asn1/p5_scrypt.c +++ b/deps/openssl/openssl/crypto/asn1/p5_scrypt.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -44,7 +44,7 @@ X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher, uint64_t p) { X509_ALGOR *scheme = NULL, *ret = NULL; - int alg_nid, ivlen; + int alg_nid; size_t keylen = 0; EVP_CIPHER_CTX *ctx = NULL; unsigned char iv[EVP_MAX_IV_LENGTH]; @@ -83,11 +83,10 @@ X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher, } /* Create random IV */ - ivlen = EVP_CIPHER_get_iv_length(cipher); - if (ivlen > 0) { + if (EVP_CIPHER_get_iv_length(cipher)) { if (aiv) - memcpy(iv, aiv, ivlen); - else if (RAND_bytes(iv, ivlen) <= 0) + memcpy(iv, aiv, EVP_CIPHER_get_iv_length(cipher)); + else if (RAND_bytes(iv, EVP_CIPHER_get_iv_length(cipher)) <= 0) goto err; } diff --git a/deps/openssl/openssl/crypto/bf/bf_cfb64.c b/deps/openssl/openssl/crypto/bf/bf_cfb64.c index f2d42eefba8024..e380972dbdc9f3 100644 --- a/deps/openssl/openssl/crypto/bf/bf_cfb64.c +++ b/deps/openssl/openssl/crypto/bf/bf_cfb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -27,7 +27,7 @@ void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, int *num, int encrypt) { register BF_LONG v0, v1, t; - register int n = *num & 0x07; + register int n = *num; register long l = length; BF_LONG ti[2]; unsigned char *iv, c, cc; diff --git a/deps/openssl/openssl/crypto/bf/bf_ofb64.c b/deps/openssl/openssl/crypto/bf/bf_ofb64.c index 2cd339dd27eb64..5c9193add17e91 100644 --- a/deps/openssl/openssl/crypto/bf/bf_ofb64.c +++ b/deps/openssl/openssl/crypto/bf/bf_ofb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,7 @@ void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, int *num) { register BF_LONG v0, v1, t; - register int n = *num & 0x07; + register int n = *num; register long l = length; unsigned char d[8]; register char *dp; diff --git a/deps/openssl/openssl/crypto/bio/bss_dgram.c b/deps/openssl/openssl/crypto/bio/bss_dgram.c index c16ec00e9e2f6d..dd14c393d7370f 100644 --- a/deps/openssl/openssl/crypto/bio/bss_dgram.c +++ b/deps/openssl/openssl/crypto/bio/bss_dgram.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -68,8 +68,8 @@ #undef NO_RECVMMSG #define NO_RECVMMSG #endif -#if defined(_AIX) -/* Force fallback to sndmsg and recvmsg */ +#if defined(_AIX) && !defined(_AIX72) +/* AIX >= 7.2 provides sendmmsg() and recvmmsg(). */ #undef NO_RECVMMSG #define NO_RECVMMSG #endif @@ -961,7 +961,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ERR_raise_data(ERR_LIB_SYS, get_last_socket_error(), "calling setsockopt()"); -#elif defined(OPENSSL_SYS_LINUX) && defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_PROBE) +#elif defined(OPENSSL_SYS_LINUX) && defined(IPV6_MTU_DISCOVER) sockopt_val = num ? IPV6_PMTUDISC_PROBE : IPV6_PMTUDISC_DONT; if ((ret = setsockopt(b->num, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &sockopt_val, sizeof(sockopt_val))) diff --git a/deps/openssl/openssl/crypto/bio/bss_file.c b/deps/openssl/openssl/crypto/bio/bss_file.c index 6b8daeb95f9054..c5bdda498bd0e2 100644 --- a/deps/openssl/openssl/crypto/bio/bss_file.c +++ b/deps/openssl/openssl/crypto/bio/bss_file.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -202,19 +202,8 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_CTRL_INFO: if (b->flags & BIO_FLAGS_UPLINK_INTERNAL) ret = UP_ftell(b->ptr); - else { -#if defined(OPENSSL_SYS_WINDOWS) - /* - * On Windows, for non-seekable files (stdin), ftell() is undefined. - */ - if (GetFileType((HANDLE)_get_osfhandle(_fileno(fp))) != FILE_TYPE_DISK) - ret = -1; - else - ret = ftell(fp); -#else + else ret = ftell(fp); -#endif - } break; case BIO_C_SET_FILE_PTR: file_free(b); diff --git a/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl index 923e6d4464d2f0..5733a0174660ae 100644 --- a/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl +++ b/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2011-2023 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -37,7 +37,7 @@ # Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software # Polynomial Multiplication on ARM Processors using the NEON Engine. # -# https://conradoplg.modp.net/files/2010/12/mocrysen13.pdf +# http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf # $output is the last argument if it looks like a file (it has an extension) # $flavour is the first argument if it doesn't look like a file diff --git a/deps/openssl/openssl/crypto/bn/asm/rsaz-2k-avxifma.pl b/deps/openssl/openssl/crypto/bn/asm/rsaz-2k-avxifma.pl index b84a3e4f1954a2..ea45d2051a70ca 100644 --- a/deps/openssl/openssl/crypto/bn/asm/rsaz-2k-avxifma.pl +++ b/deps/openssl/openssl/crypto/bn/asm/rsaz-2k-avxifma.pl @@ -1,4 +1,4 @@ -# Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved. # Copyright (c) 2024, Intel Corporation. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use @@ -362,23 +362,6 @@ sub amm52x20_x1_norm { .cfi_push %r14 push %r15 .cfi_push %r15 -___ -$code.=<<___ if ($win64); - push %rsi # save non-volatile registers - push %rdi - lea -168(%rsp), %rsp # 16*10 + (8 bytes to get correct 16-byte SIMD alignment) - vmovapd %xmm6, `16*0`(%rsp) - vmovapd %xmm7, `16*1`(%rsp) - vmovapd %xmm8, `16*2`(%rsp) - vmovapd %xmm9, `16*3`(%rsp) - vmovapd %xmm10, `16*4`(%rsp) - vmovapd %xmm11, `16*5`(%rsp) - vmovapd %xmm12, `16*6`(%rsp) - vmovapd %xmm13, `16*7`(%rsp) - vmovapd %xmm14, `16*8`(%rsp) - vmovapd %xmm15, `16*9`(%rsp) -___ -$code.=<<___; .Lossl_rsaz_amm52x20_x1_avxifma256_body: # Zeroing accumulators @@ -418,23 +401,6 @@ sub amm52x20_x1_norm { vmovdqu $R2_0, `4*32`($res) vzeroupper -___ -$code.=<<___ if ($win64); - vmovapd `16*0`(%rsp), %xmm6 - vmovapd `16*1`(%rsp), %xmm7 - vmovapd `16*2`(%rsp), %xmm8 - vmovapd `16*3`(%rsp), %xmm9 - vmovapd `16*4`(%rsp), %xmm10 - vmovapd `16*5`(%rsp), %xmm11 - vmovapd `16*6`(%rsp), %xmm12 - vmovapd `16*7`(%rsp), %xmm13 - vmovapd `16*8`(%rsp), %xmm14 - vmovapd `16*9`(%rsp), %xmm15 - lea 168(%rsp), %rsp - pop %rdi - pop %rsi -___ -$code.=<<___; mov 0(%rsp),%r15 .cfi_restore %r15 mov 8(%rsp),%r14 @@ -587,23 +553,6 @@ sub amm52x20_x1_norm { .cfi_push %r14 push %r15 .cfi_push %r15 -___ -$code.=<<___ if ($win64); - push %rsi # save non-volatile registers - push %rdi - lea -168(%rsp), %rsp # 16*10 + (8 bytes to get correct 16-byte SIMD alignment) - vmovapd %xmm6, `16*0`(%rsp) - vmovapd %xmm7, `16*1`(%rsp) - vmovapd %xmm8, `16*2`(%rsp) - vmovapd %xmm9, `16*3`(%rsp) - vmovapd %xmm10, `16*4`(%rsp) - vmovapd %xmm11, `16*5`(%rsp) - vmovapd %xmm12, `16*6`(%rsp) - vmovapd %xmm13, `16*7`(%rsp) - vmovapd %xmm14, `16*8`(%rsp) - vmovapd %xmm15, `16*9`(%rsp) -___ -$code.=<<___; .Lossl_rsaz_amm52x20_x2_avxifma256_body: # Zeroing accumulators @@ -655,23 +604,6 @@ sub amm52x20_x1_norm { vmovdqu $R2_1, `9*32`($res) vzeroupper -___ -$code.=<<___ if ($win64); - vmovapd `16*0`(%rsp), %xmm6 - vmovapd `16*1`(%rsp), %xmm7 - vmovapd `16*2`(%rsp), %xmm8 - vmovapd `16*3`(%rsp), %xmm9 - vmovapd `16*4`(%rsp), %xmm10 - vmovapd `16*5`(%rsp), %xmm11 - vmovapd `16*6`(%rsp), %xmm12 - vmovapd `16*7`(%rsp), %xmm13 - vmovapd `16*8`(%rsp), %xmm14 - vmovapd `16*9`(%rsp), %xmm15 - lea 168(%rsp), %rsp - pop %rdi - pop %rsi -___ -$code.=<<___; mov 0(%rsp),%r15 .cfi_restore %r15 mov 8(%rsp),%r14 @@ -731,23 +663,6 @@ sub amm52x20_x1_norm { ossl_extract_multiplier_2x20_win5_avx: .cfi_startproc endbranch -___ -$code.=<<___ if ($win64); - push %rsi # save non-volatile registers - push %rdi - lea -168(%rsp), %rsp # 16*10 + (8 bytes to get correct 16-byte SIMD alignment) - vmovapd %xmm6, `16*0`(%rsp) - vmovapd %xmm7, `16*1`(%rsp) - vmovapd %xmm8, `16*2`(%rsp) - vmovapd %xmm9, `16*3`(%rsp) - vmovapd %xmm10, `16*4`(%rsp) - vmovapd %xmm11, `16*5`(%rsp) - vmovapd %xmm12, `16*6`(%rsp) - vmovapd %xmm13, `16*7`(%rsp) - vmovapd %xmm14, `16*8`(%rsp) - vmovapd %xmm15, `16*9`(%rsp) -___ -$code.=<<___; vmovapd .Lones(%rip), $ones # broadcast ones vmovq $red_tbl_idx1, $tmp_xmm vpbroadcastq $tmp_xmm, $idx1 @@ -793,24 +708,6 @@ sub amm52x20_x1_norm { foreach (0..9) { $code.="vmovdqu $t[$_], `${_}*32`($out) \n"; } -$code.=<<___; - vzeroupper -___ -$code.=<<___ if ($win64); - vmovapd `16*0`(%rsp), %xmm6 - vmovapd `16*1`(%rsp), %xmm7 - vmovapd `16*2`(%rsp), %xmm8 - vmovapd `16*3`(%rsp), %xmm9 - vmovapd `16*4`(%rsp), %xmm10 - vmovapd `16*5`(%rsp), %xmm11 - vmovapd `16*6`(%rsp), %xmm12 - vmovapd `16*7`(%rsp), %xmm13 - vmovapd `16*8`(%rsp), %xmm14 - vmovapd `16*9`(%rsp), %xmm15 - lea 168(%rsp), %rsp - pop %rdi - pop %rsi -___ $code.=<<___; ret .cfi_endproc diff --git a/deps/openssl/openssl/crypto/bn/asm/rsaz-3k-avxifma.pl b/deps/openssl/openssl/crypto/bn/asm/rsaz-3k-avxifma.pl index 1948d726b38b43..a19cb5aaa30927 100644 --- a/deps/openssl/openssl/crypto/bn/asm/rsaz-3k-avxifma.pl +++ b/deps/openssl/openssl/crypto/bn/asm/rsaz-3k-avxifma.pl @@ -1,4 +1,4 @@ -# Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved. # Copyright (c) 2024, Intel Corporation. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use @@ -87,6 +87,8 @@ my $mask52 = "%rax"; my $acc0_0 = "%r9"; my $acc0_0_low = "%r9d"; +my $acc0_1 = "%r15"; +my $acc0_1_low = "%r15d"; my $b_ptr = "%r11"; my $iter = "%ebx"; @@ -739,7 +741,7 @@ sub amm52x30_x1_norm { vmovdqu $R3_0, `6*32`($res) vmovdqu $R3_0h, `7*32`($res) - xorl $acc0_0_low, $acc0_0_low + xorl $acc0_1_low, $acc0_1_low lea 16($b_ptr), $b_ptr movq \$0xfffffffffffff, $mask52 # 52-bit mask @@ -855,23 +857,6 @@ sub amm52x30_x1_norm { ossl_extract_multiplier_2x30_win5_avx: .cfi_startproc endbranch -___ -$code.=<<___ if ($win64); - push %rsi # save non-volatile registers - push %rdi - lea -168(%rsp), %rsp # 16*10 + (8 bytes to get correct 16-byte SIMD alignment) - vmovapd %xmm6, `16*0`(%rsp) - vmovapd %xmm7, `16*1`(%rsp) - vmovapd %xmm8, `16*2`(%rsp) - vmovapd %xmm9, `16*3`(%rsp) - vmovapd %xmm10, `16*4`(%rsp) - vmovapd %xmm11, `16*5`(%rsp) - vmovapd %xmm12, `16*6`(%rsp) - vmovapd %xmm13, `16*7`(%rsp) - vmovapd %xmm14, `16*8`(%rsp) - vmovapd %xmm15, `16*9`(%rsp) -___ -$code.=<<___; vmovapd .Lones(%rip), $ones # broadcast ones vmovq $red_tbl_idx1, $tmp_xmm vpbroadcastq $tmp_xmm, $idx1 @@ -945,24 +930,6 @@ sub amm52x30_x1_norm { $code.="vmovdqu $t[$_], `${_}*32`($out) \n"; } -$code.=<<___; - vzeroupper -___ -$code.=<<___ if ($win64); - vmovapd `16*0`(%rsp), %xmm6 - vmovapd `16*1`(%rsp), %xmm7 - vmovapd `16*2`(%rsp), %xmm8 - vmovapd `16*3`(%rsp), %xmm9 - vmovapd `16*4`(%rsp), %xmm10 - vmovapd `16*5`(%rsp), %xmm11 - vmovapd `16*6`(%rsp), %xmm12 - vmovapd `16*7`(%rsp), %xmm13 - vmovapd `16*8`(%rsp), %xmm14 - vmovapd `16*9`(%rsp), %xmm15 - lea 168(%rsp), %rsp - pop %rdi - pop %rsi -___ $code.=<<___; diff --git a/deps/openssl/openssl/crypto/bn/asm/rsaz-4k-avxifma.pl b/deps/openssl/openssl/crypto/bn/asm/rsaz-4k-avxifma.pl index 9f299430cefcd2..f15e2d74118cb0 100644 --- a/deps/openssl/openssl/crypto/bn/asm/rsaz-4k-avxifma.pl +++ b/deps/openssl/openssl/crypto/bn/asm/rsaz-4k-avxifma.pl @@ -1,4 +1,4 @@ -# Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved. # Copyright (c) 2024, Intel Corporation. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use @@ -84,6 +84,8 @@ my $mask52 = "%rax"; my $acc0_0 = "%r9"; my $acc0_0_low = "%r9d"; +my $acc0_1 = "%r15"; +my $acc0_1_low = "%r15d"; my $b_ptr = "%r11"; my $iter = "%ebx"; @@ -832,7 +834,7 @@ sub amm52x40_x1_norm { vmovdqu $R4_0, `8*32`($res) vmovdqu $R4_0h, `9*32`($res) - xorl $acc0_0_low, $acc0_0_low + xorl $acc0_1_low, $acc0_1_low movq \$0xfffffffffffff, $mask52 @@ -973,23 +975,6 @@ () ossl_extract_multiplier_2x40_win5_avx: .cfi_startproc endbranch -___ -$code.=<<___ if ($win64); - push %rsi # save non-volatile registers - push %rdi - lea -168(%rsp), %rsp # 16*10 + (8 bytes to get correct 16-byte SIMD alignment) - vmovapd %xmm6, `16*0`(%rsp) - vmovapd %xmm7, `16*1`(%rsp) - vmovapd %xmm8, `16*2`(%rsp) - vmovapd %xmm9, `16*3`(%rsp) - vmovapd %xmm10, `16*4`(%rsp) - vmovapd %xmm11, `16*5`(%rsp) - vmovapd %xmm12, `16*6`(%rsp) - vmovapd %xmm13, `16*7`(%rsp) - vmovapd %xmm14, `16*8`(%rsp) - vmovapd %xmm15, `16*9`(%rsp) -___ -$code.=<<___; vmovapd .Lones(%rip), $ones # broadcast ones vmovq $red_tbl_idx1, $tmp_xmm vpbroadcastq $tmp_xmm, $idx1 @@ -1016,24 +1001,6 @@ () foreach (0..9) { $code.="vmovdqu $t[$_], `(10+$_)*32`($out) \n"; } -$code.=<<___; - vzeroupper -___ -$code.=<<___ if ($win64); - vmovapd `16*0`(%rsp), %xmm6 - vmovapd `16*1`(%rsp), %xmm7 - vmovapd `16*2`(%rsp), %xmm8 - vmovapd `16*3`(%rsp), %xmm9 - vmovapd `16*4`(%rsp), %xmm10 - vmovapd `16*5`(%rsp), %xmm11 - vmovapd `16*6`(%rsp), %xmm12 - vmovapd `16*7`(%rsp), %xmm13 - vmovapd `16*8`(%rsp), %xmm14 - vmovapd `16*9`(%rsp), %xmm15 - lea 168(%rsp), %rsp - pop %rdi - pop %rsi -___ $code.=<<___; ret diff --git a/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl b/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl index d438af5626489d..fe51fcaf81c75e 100644 --- a/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/sparcv9-mont.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -394,11 +394,11 @@ mulx $car1,$mul1,$car1 mulx $npj,$mul1,$acc1 - add $tmp1,$car0,$car0 add $tmp0,$car1,$car1 and $car0,$mask,$acc0 ld [$np+8],$npj ! np[2] srlx $car1,32,$car1 + add $tmp1,$car1,$car1 srlx $car0,32,$car0 add $acc0,$car1,$car1 and $car0,1,$sbit diff --git a/deps/openssl/openssl/crypto/bn/bn_dh.c b/deps/openssl/openssl/crypto/bn/bn_dh.c index d069481e981b95..542c33d6a8d7a7 100644 --- a/deps/openssl/openssl/crypto/bn/bn_dh.c +++ b/deps/openssl/openssl/crypto/bn/bn_dh.c @@ -1,5 +1,5 @@ /* - * Copyright 2014-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2014-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -14,7 +14,7 @@ #include "crypto/bn_dh.h" #if BN_BITS2 == 64 -#define BN_DEF(lo, hi) (BN_ULONG)hi << 32 | lo +#define BN_DEF(lo, hi) (BN_ULONG) hi << 32 | lo #else #define BN_DEF(lo, hi) lo, hi #endif @@ -1387,37 +1387,37 @@ const BIGNUM ossl_bignum_const_2 = { }; make_dh_bn(dh1024_160_p) -make_dh_bn(dh1024_160_q) -make_dh_bn(dh1024_160_g) -make_dh_bn(dh2048_224_p) -make_dh_bn(dh2048_224_q) -make_dh_bn(dh2048_224_g) -make_dh_bn(dh2048_256_p) -make_dh_bn(dh2048_256_q) -make_dh_bn(dh2048_256_g) + make_dh_bn(dh1024_160_q) + make_dh_bn(dh1024_160_g) + make_dh_bn(dh2048_224_p) + make_dh_bn(dh2048_224_q) + make_dh_bn(dh2048_224_g) + make_dh_bn(dh2048_256_p) + make_dh_bn(dh2048_256_q) + make_dh_bn(dh2048_256_g) -make_dh_bn(ffdhe2048_p) -make_dh_bn(ffdhe2048_q) -make_dh_bn(ffdhe3072_p) -make_dh_bn(ffdhe3072_q) -make_dh_bn(ffdhe4096_p) -make_dh_bn(ffdhe4096_q) -make_dh_bn(ffdhe6144_p) -make_dh_bn(ffdhe6144_q) -make_dh_bn(ffdhe8192_p) -make_dh_bn(ffdhe8192_q) + make_dh_bn(ffdhe2048_p) + make_dh_bn(ffdhe2048_q) + make_dh_bn(ffdhe3072_p) + make_dh_bn(ffdhe3072_q) + make_dh_bn(ffdhe4096_p) + make_dh_bn(ffdhe4096_q) + make_dh_bn(ffdhe6144_p) + make_dh_bn(ffdhe6144_q) + make_dh_bn(ffdhe8192_p) + make_dh_bn(ffdhe8192_q) #ifndef FIPS_MODULE -make_dh_bn(modp_1536_p) -make_dh_bn(modp_1536_q) + make_dh_bn(modp_1536_p) + make_dh_bn(modp_1536_q) #endif -make_dh_bn(modp_2048_p) -make_dh_bn(modp_2048_q) -make_dh_bn(modp_3072_p) -make_dh_bn(modp_3072_q) -make_dh_bn(modp_4096_p) -make_dh_bn(modp_4096_q) -make_dh_bn(modp_6144_p) -make_dh_bn(modp_6144_q) -make_dh_bn(modp_8192_p) -make_dh_bn(modp_8192_q) + make_dh_bn(modp_2048_p) + make_dh_bn(modp_2048_q) + make_dh_bn(modp_3072_p) + make_dh_bn(modp_3072_q) + make_dh_bn(modp_4096_p) + make_dh_bn(modp_4096_q) + make_dh_bn(modp_6144_p) + make_dh_bn(modp_6144_q) + make_dh_bn(modp_8192_p) + make_dh_bn(modp_8192_q) diff --git a/deps/openssl/openssl/crypto/bn/bn_exp.c b/deps/openssl/openssl/crypto/bn/bn_exp.c index 44931f803802c4..58d38b9ebd2a80 100644 --- a/deps/openssl/openssl/crypto/bn/bn_exp.c +++ b/deps/openssl/openssl/crypto/bn/bn_exp.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -771,16 +771,16 @@ int bn_mod_exp_mont_fixed_top(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, typedef int (*bn_pwr5_mont_f)(BN_ULONG *tp, const BN_ULONG *np, const BN_ULONG *n0, const void *table, int power, int bits); - int bn_pwr5_mont_t4_8(BN_ULONG *tp, const BN_ULONG *np, + int bn_pwr5_mont_t4_8(BN_ULONG * tp, const BN_ULONG *np, const BN_ULONG *n0, const void *table, int power, int bits); - int bn_pwr5_mont_t4_16(BN_ULONG *tp, const BN_ULONG *np, + int bn_pwr5_mont_t4_16(BN_ULONG * tp, const BN_ULONG *np, const BN_ULONG *n0, const void *table, int power, int bits); - int bn_pwr5_mont_t4_24(BN_ULONG *tp, const BN_ULONG *np, + int bn_pwr5_mont_t4_24(BN_ULONG * tp, const BN_ULONG *np, const BN_ULONG *n0, const void *table, int power, int bits); - int bn_pwr5_mont_t4_32(BN_ULONG *tp, const BN_ULONG *np, + int bn_pwr5_mont_t4_32(BN_ULONG * tp, const BN_ULONG *np, const BN_ULONG *n0, const void *table, int power, int bits); static const bn_pwr5_mont_f pwr5_funcs[4] = { @@ -792,15 +792,15 @@ int bn_mod_exp_mont_fixed_top(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, typedef int (*bn_mul_mont_f)(BN_ULONG *rp, const BN_ULONG *ap, const void *bp, const BN_ULONG *np, const BN_ULONG *n0); - int bn_mul_mont_t4_8(BN_ULONG *rp, const BN_ULONG *ap, const void *bp, + int bn_mul_mont_t4_8(BN_ULONG * rp, const BN_ULONG *ap, const void *bp, const BN_ULONG *np, const BN_ULONG *n0); - int bn_mul_mont_t4_16(BN_ULONG *rp, const BN_ULONG *ap, + int bn_mul_mont_t4_16(BN_ULONG * rp, const BN_ULONG *ap, const void *bp, const BN_ULONG *np, const BN_ULONG *n0); - int bn_mul_mont_t4_24(BN_ULONG *rp, const BN_ULONG *ap, + int bn_mul_mont_t4_24(BN_ULONG * rp, const BN_ULONG *ap, const void *bp, const BN_ULONG *np, const BN_ULONG *n0); - int bn_mul_mont_t4_32(BN_ULONG *rp, const BN_ULONG *ap, + int bn_mul_mont_t4_32(BN_ULONG * rp, const BN_ULONG *ap, const void *bp, const BN_ULONG *np, const BN_ULONG *n0); static const bn_mul_mont_f mul_funcs[4] = { @@ -809,20 +809,20 @@ int bn_mod_exp_mont_fixed_top(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, }; bn_mul_mont_f mul_worker = mul_funcs[top / 16 - 1]; - void bn_mul_mont_vis3(BN_ULONG *rp, const BN_ULONG *ap, + void bn_mul_mont_vis3(BN_ULONG * rp, const BN_ULONG *ap, const void *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); - void bn_mul_mont_t4(BN_ULONG *rp, const BN_ULONG *ap, + void bn_mul_mont_t4(BN_ULONG * rp, const BN_ULONG *ap, const void *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); - void bn_mul_mont_gather5_t4(BN_ULONG *rp, const BN_ULONG *ap, + void bn_mul_mont_gather5_t4(BN_ULONG * rp, const BN_ULONG *ap, const void *table, const BN_ULONG *np, const BN_ULONG *n0, int num, int power); void bn_flip_n_scatter5_t4(const BN_ULONG *inp, size_t num, void *table, size_t power); - void bn_gather5_t4(BN_ULONG *out, size_t num, + void bn_gather5_t4(BN_ULONG * out, size_t num, void *table, size_t power); - void bn_flip_t4(BN_ULONG *dst, BN_ULONG *src, size_t num); + void bn_flip_t4(BN_ULONG * dst, BN_ULONG * src, size_t num); BN_ULONG *np = mont->N.d, *n0 = mont->n0; int stride = 5 * (6 - (top / 16 - 1)); /* multiple of 5, but less @@ -922,13 +922,13 @@ int bn_mod_exp_mont_fixed_top(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, * Given those inputs, |bn_mul_mont| may not give reduced * output, but it will still produce "almost" reduced output. */ - void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap, + void bn_mul_mont_gather5(BN_ULONG * rp, const BN_ULONG *ap, const void *table, const BN_ULONG *np, const BN_ULONG *n0, int num, int power); void bn_scatter5(const BN_ULONG *inp, size_t num, void *table, size_t power); - void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power); - void bn_power5(BN_ULONG *rp, const BN_ULONG *ap, + void bn_gather5(BN_ULONG * out, size_t num, void *table, size_t power); + void bn_power5(BN_ULONG * rp, const BN_ULONG *ap, const void *table, const BN_ULONG *np, const BN_ULONG *n0, int num, int power); int bn_get_bits5(const BN_ULONG *ap, int off); diff --git a/deps/openssl/openssl/crypto/bn/bn_local.h b/deps/openssl/openssl/crypto/bn/bn_local.h index 9ebadfd76e79f7..45b545bce3dd60 100644 --- a/deps/openssl/openssl/crypto/bn/bn_local.h +++ b/deps/openssl/openssl/crypto/bn/bn_local.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -387,7 +387,7 @@ struct bn_gencb_st { #elif defined(__alpha) && (defined(SIXTY_FOUR_BIT_LONG) || defined(SIXTY_FOUR_BIT)) #if defined(__DECC) #include -#define BN_UMULT_HIGH(a, b) (BN_ULONG)asm("umulh %a0,%a1,%v0", (a), (b)) +#define BN_UMULT_HIGH(a, b) (BN_ULONG) asm("umulh %a0,%a1,%v0", (a), (b)) #elif defined(__GNUC__) && __GNUC__ >= 2 #define BN_UMULT_HIGH(a, b) ({ \ register BN_ULONG ret; \ diff --git a/deps/openssl/openssl/crypto/bn/bn_mont.c b/deps/openssl/openssl/crypto/bn/bn_mont.c index 72e935c52fb9eb..1527ac10fb1b11 100644 --- a/deps/openssl/openssl/crypto/bn/bn_mont.c +++ b/deps/openssl/openssl/crypto/bn/bn_mont.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -8,9 +8,10 @@ */ /* - * Details about Montgomery multiplication algorithms can be found in - * https://www.microsoft.com/en-us/research/wp-content/uploads/1996/01/j37acmon.pdf - * and https://cetinkayakoc.net/docs/r01.pdf + * Details about Montgomery multiplication algorithms can be found at + * http://security.ece.orst.edu/publications.html, e.g. + * http://security.ece.orst.edu/koc/papers/j37acmon.pdf and + * sections 3.8 and 4.2 in http://security.ece.orst.edu/koc/papers/r01rsasw.pdf */ #include "internal/cryptlib.h" diff --git a/deps/openssl/openssl/crypto/bn/bn_ppc.c b/deps/openssl/openssl/crypto/bn/bn_ppc.c index 8ef52a30c1a434..049ffa50da981c 100644 --- a/deps/openssl/openssl/crypto/bn/bn_ppc.c +++ b/deps/openssl/openssl/crypto/bn/bn_ppc.c @@ -1,5 +1,5 @@ /* - * Copyright 2009-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2009-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -15,14 +15,14 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num) { - int bn_mul_mont_int(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + int bn_mul_mont_int(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); - int bn_mul4x_mont_int(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + int bn_mul4x_mont_int(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); - int bn_mul_mont_fixed_n6(BN_ULONG *rp, const BN_ULONG *ap, + int bn_mul_mont_fixed_n6(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); - int bn_mul_mont_300_fixed_n6(BN_ULONG *rp, const BN_ULONG *ap, + int bn_mul_mont_300_fixed_n6(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); diff --git a/deps/openssl/openssl/crypto/bn/bn_prime.c b/deps/openssl/openssl/crypto/bn/bn_prime.c index 08f889e5979982..0c38e2ccd2073f 100644 --- a/deps/openssl/openssl/crypto/bn/bn_prime.c +++ b/deps/openssl/openssl/crypto/bn/bn_prime.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -30,7 +30,7 @@ static int bn_is_prime_int(const BIGNUM *w, int checks, BN_CTX *ctx, #define square(x) ((BN_ULONG)(x) * (BN_ULONG)(x)) #if BN_BITS2 == 64 -#define BN_DEF(lo, hi) (BN_ULONG)hi << 32 | lo +#define BN_DEF(lo, hi) (BN_ULONG) hi << 32 | lo #else #define BN_DEF(lo, hi) lo, hi #endif diff --git a/deps/openssl/openssl/crypto/bn/bn_rsa_fips186_4.c b/deps/openssl/openssl/crypto/bn/bn_rsa_fips186_4.c index 08def7f13c98ad..c2574167d06dfb 100644 --- a/deps/openssl/openssl/crypto/bn/bn_rsa_fips186_4.c +++ b/deps/openssl/openssl/crypto/bn/bn_rsa_fips186_4.c @@ -1,5 +1,5 @@ /* - * Copyright 2018-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2018-2023 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2018-2019, Oracle and/or its affiliates. All rights reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -29,7 +29,7 @@ #include "internal/nelem.h" #if BN_BITS2 == 64 -#define BN_DEF(lo, hi) (BN_ULONG)hi << 32 | lo +#define BN_DEF(lo, hi) (BN_ULONG) hi << 32 | lo #else #define BN_DEF(lo, hi) lo, hi #endif diff --git a/deps/openssl/openssl/crypto/bn/bn_sparc.c b/deps/openssl/openssl/crypto/bn/bn_sparc.c index 7c902191d77323..a236e42dfae93a 100644 --- a/deps/openssl/openssl/crypto/bn/bn_sparc.c +++ b/deps/openssl/openssl/crypto/bn/bn_sparc.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -16,11 +16,11 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num) { - int bn_mul_mont_vis3(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + int bn_mul_mont_vis3(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); - int bn_mul_mont_fpu(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + int bn_mul_mont_fpu(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); - int bn_mul_mont_int(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + int bn_mul_mont_int(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); if (!(num & 1) && num >= 6) { @@ -29,16 +29,16 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0); - int bn_mul_mont_t4_8(BN_ULONG *rp, const BN_ULONG *ap, + int bn_mul_mont_t4_8(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0); - int bn_mul_mont_t4_16(BN_ULONG *rp, const BN_ULONG *ap, + int bn_mul_mont_t4_16(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0); - int bn_mul_mont_t4_24(BN_ULONG *rp, const BN_ULONG *ap, + int bn_mul_mont_t4_24(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0); - int bn_mul_mont_t4_32(BN_ULONG *rp, const BN_ULONG *ap, + int bn_mul_mont_t4_32(BN_ULONG * rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0); static const bn_mul_mont_f funcs[4] = { diff --git a/deps/openssl/openssl/crypto/bsearch.c b/deps/openssl/openssl/crypto/bsearch.c index c2ab0b81259559..192ccbeb916f5e 100644 --- a/deps/openssl/openssl/crypto/bsearch.c +++ b/deps/openssl/openssl/crypto/bsearch.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -23,7 +23,7 @@ const void *ossl_bsearch(const void *key, const void *base, int num, l = 0; h = num; while (l < h) { - i = l + (h - l) / 2; + i = (l + h) / 2; p = &(base_[i * size]); c = (*cmp)(key, p); if (c < 0) diff --git a/deps/openssl/openssl/crypto/cast/c_cfb64.c b/deps/openssl/openssl/crypto/cast/c_cfb64.c index 3de52f56af466f..4170f77a78ebb9 100644 --- a/deps/openssl/openssl/crypto/cast/c_cfb64.c +++ b/deps/openssl/openssl/crypto/cast/c_cfb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -27,7 +27,7 @@ void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, int *num, int enc) { register CAST_LONG v0, v1, t; - register int n = *num & 0x07; + register int n = *num; register long l = length; CAST_LONG ti[2]; unsigned char *iv, c, cc; diff --git a/deps/openssl/openssl/crypto/cast/c_ofb64.c b/deps/openssl/openssl/crypto/cast/c_ofb64.c index dbd6e02729d293..431446ab5fb71a 100644 --- a/deps/openssl/openssl/crypto/cast/c_ofb64.c +++ b/deps/openssl/openssl/crypto/cast/c_ofb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,7 @@ void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, int *num) { register CAST_LONG v0, v1, t; - register int n = *num & 0x07; + register int n = *num; register long l = length; unsigned char d[8]; register char *dp; diff --git a/deps/openssl/openssl/crypto/cmp/cmp_client.c b/deps/openssl/openssl/crypto/cmp/cmp_client.c index d6a4230d243e16..ec865b24378949 100644 --- a/deps/openssl/openssl/crypto/cmp/cmp_client.c +++ b/deps/openssl/openssl/crypto/cmp/cmp_client.c @@ -1,5 +1,5 @@ /* - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -149,7 +149,6 @@ static int send_receive_check(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *req, int time_left; OSSL_CMP_transfer_cb_t transfer_cb = ctx->transfer_cb; - ctx->status = OSSL_CMP_PKISTATUS_trans; #ifndef OPENSSL_NO_HTTP if (transfer_cb == NULL) transfer_cb = OSSL_CMP_MSG_http_perform; @@ -176,7 +175,7 @@ static int send_receive_check(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *req, /* should print error queue since transfer_cb may call ERR_clear_error() */ OSSL_CMP_CTX_print_errors(ctx); - if (ctx->server != NULL || ctx->transfer_cb != NULL) + if (ctx->server != NULL) ossl_cmp_log1(INFO, ctx, "sending %s", req_type_str); *rep = (*transfer_cb)(ctx, req); @@ -190,7 +189,6 @@ static int send_receive_check(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *req, return 0; } - ctx->status = OSSL_CMP_PKISTATUS_checking_response; bt = OSSL_CMP_MSG_get_bodytype(*rep); /* * The body type in the 'bt' variable is not yet verified. @@ -286,15 +284,11 @@ static int poll_for_response(OSSL_CMP_CTX *ctx, int sleep, int rid, "received 'waiting' PKIStatus, starting to poll for response"); *rep = NULL; for (;;) { - int bak = ctx->status; - - ctx->status = OSSL_CMP_PKISTATUS_request; if ((preq = ossl_cmp_pollReq_new(ctx, rid)) == NULL) goto err; if (!send_receive_check(ctx, preq, &prep, OSSL_CMP_PKIBODY_POLLREP)) goto err; - ctx->status = bak; /* handle potential pollRep */ if (OSSL_CMP_MSG_get_bodytype(prep) == OSSL_CMP_PKIBODY_POLLREP) { @@ -350,7 +344,6 @@ static int poll_for_response(OSSL_CMP_CTX *ctx, int sleep, int rid, int64_t time_left = (int64_t)(ctx->end_time - exp - time(NULL)); if (time_left <= 0) { - ctx->status = OSSL_CMP_PKISTATUS_trans; ERR_raise(ERR_LIB_CMP, CMP_R_TOTAL_TIMEOUT); goto err; } @@ -462,9 +455,7 @@ int ossl_cmp_exchange_certConf(OSSL_CMP_CTX *ctx, int certReqId, OSSL_CMP_MSG *certConf; OSSL_CMP_MSG *PKIconf = NULL; int res = 0; - int bak = ctx->status; - ctx->status = OSSL_CMP_PKISTATUS_request; /* OSSL_CMP_certConf_new() also checks if all necessary options are set */ certConf = ossl_cmp_certConf_new(ctx, certReqId, fail_info, txt); if (certConf == NULL) @@ -473,9 +464,6 @@ int ossl_cmp_exchange_certConf(OSSL_CMP_CTX *ctx, int certReqId, res = send_receive_also_delayed(ctx, certConf, &PKIconf, OSSL_CMP_PKIBODY_PKICONF); - if (res) - ctx->status = bak; - err: OSSL_CMP_MSG_free(certConf); OSSL_CMP_MSG_free(PKIconf); @@ -491,7 +479,6 @@ int ossl_cmp_exchange_error(OSSL_CMP_CTX *ctx, int status, int fail_info, OSSL_CMP_MSG *PKIconf = NULL; int res = 0; - ctx->status = OSSL_CMP_PKISTATUS_request; /* not overwriting ctx->status on error exchange */ if ((si = OSSL_CMP_STATUSINFO_new(status, fail_info, txt)) == NULL) goto err; @@ -501,7 +488,6 @@ int ossl_cmp_exchange_error(OSSL_CMP_CTX *ctx, int status, int fail_info, res = send_receive_also_delayed(ctx, error, &PKIconf, OSSL_CMP_PKIBODY_PKICONF); - ctx->status = OSSL_CMP_PKISTATUS_rejected_by_client; err: OSSL_CMP_MSG_free(error); @@ -804,7 +790,7 @@ static int cert_response(OSSL_CMP_CTX *ctx, int sleep, int rid, ERR_raise_data(ERR_LIB_CMP, CMP_R_CERTIFICATE_NOT_ACCEPTED, "rejecting newly enrolled cert with subject: %s; %s", subj, txt); - ctx->status = OSSL_CMP_PKISTATUS_rejected_by_client; + ctx->status = OSSL_CMP_PKISTATUS_rejection; ret = 0; } OPENSSL_free(subj); @@ -826,6 +812,7 @@ static int initial_certreq(OSSL_CMP_CTX *ctx, if ((req = ossl_cmp_certreq_new(ctx, req_type, crm)) == NULL) return 0; + ctx->status = OSSL_CMP_PKISTATUS_trans; res = send_receive_check(ctx, req, p_rep, rep_type); OSSL_CMP_MSG_free(req); return res; @@ -931,6 +918,7 @@ int OSSL_CMP_exec_RR_ses(OSSL_CMP_CTX *ctx) if ((rr = ossl_cmp_rr_new(ctx)) == NULL) goto end; + ctx->status = OSSL_CMP_PKISTATUS_trans; if (!send_receive_also_delayed(ctx, rr, &rp, OSSL_CMP_PKIBODY_RP)) goto end; @@ -1050,6 +1038,7 @@ STACK_OF(OSSL_CMP_ITAV) *OSSL_CMP_exec_GENM_ses(OSSL_CMP_CTX *ctx) if ((genm = ossl_cmp_genm_new(ctx)) == NULL) goto err; + ctx->status = OSSL_CMP_PKISTATUS_trans; if (!send_receive_also_delayed(ctx, genm, &genp, OSSL_CMP_PKIBODY_GENP)) goto err; ctx->status = OSSL_CMP_PKISTATUS_accepted; diff --git a/deps/openssl/openssl/crypto/cmp/cmp_ctx.c b/deps/openssl/openssl/crypto/cmp/cmp_ctx.c index 7fdc478cf8f26f..947374d4ec2e7f 100644 --- a/deps/openssl/openssl/crypto/cmp/cmp_ctx.c +++ b/deps/openssl/openssl/crypto/cmp/cmp_ctx.c @@ -1,5 +1,5 @@ /* - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -742,7 +742,7 @@ DEFINE_OSSL_set1_up_ref(OSSL_CMP_CTX, oldCert, X509) */ DEFINE_OSSL_set0(ossl_cmp_ctx, newCert, X509) - /* Get successfully validated sender cert, if any, of current transaction */ + /* Get successfully validated server cert, if any, of current transaction */ DEFINE_OSSL_CMP_CTX_get0(validatedSrvCert, X509) /* diff --git a/deps/openssl/openssl/crypto/cmp/cmp_local.h b/deps/openssl/openssl/crypto/cmp/cmp_local.h index 3542256e0bca51..4b98b8cb78ff23 100644 --- a/deps/openssl/openssl/crypto/cmp/cmp_local.h +++ b/deps/openssl/openssl/crypto/cmp/cmp_local.h @@ -1,5 +1,5 @@ /* - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -66,7 +66,7 @@ struct ossl_cmp_ctx_st { int unprotectedErrors; int noCacheExtraCerts; X509 *srvCert; /* certificate used to identify the server */ - X509 *validatedSrvCert; /* caches any already validated sender cert */ + X509 *validatedSrvCert; /* caches any already validated server cert */ X509_NAME *expected_sender; /* expected sender in header of response */ X509_STORE *trusted; /* trust store maybe w CRLs and cert verify callback */ STACK_OF(X509) *untrusted; /* untrusted (intermediate CA) certs */ diff --git a/deps/openssl/openssl/crypto/cmp/cmp_vfy.c b/deps/openssl/openssl/crypto/cmp/cmp_vfy.c index eaa700d139d13c..873bee8b6ad379 100644 --- a/deps/openssl/openssl/crypto/cmp/cmp_vfy.c +++ b/deps/openssl/openssl/crypto/cmp/cmp_vfy.c @@ -1,5 +1,5 @@ /* - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2020 * Copyright Siemens AG 2015-2020 * @@ -363,12 +363,13 @@ static int check_cert_path_3gpp(const OSSL_CMP_CTX *ctx, return valid; } -/* checks protection of msg but not cert revocation nor cert chain */ static int check_msg_given_cert(const OSSL_CMP_CTX *ctx, X509 *cert, const OSSL_CMP_MSG *msg) { return cert_acceptable(ctx, "previously validated", "sender cert", - cert, NULL, NULL, msg); + cert, NULL, NULL, msg) + && (check_cert_path(ctx, ctx->trusted, cert) + || check_cert_path_3gpp(ctx, msg, cert)); } /*- @@ -478,26 +479,22 @@ static int check_msg_find_cert(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg) (void)ERR_set_mark(); ctx->log_cb = NULL; /* temporarily disable logging */ + /* + * try first cached scrt, used successfully earlier in same transaction, + * for validating this and any further msgs where extraCerts may be left out + */ if (scrt != NULL) { - /*- - * try first using cached message sender cert (in 'scrt' variable), - * which was used successfully earlier in the same transaction - * (assuming that the certificate itself was not revoked meanwhile and - * is a good guess for use in validating also the current message) - */ if (check_msg_given_cert(ctx, scrt, msg)) { ctx->log_cb = backup_log_cb; (void)ERR_pop_to_mark(); return 1; } /* cached sender cert has shown to be no more successfully usable */ + (void)ossl_cmp_ctx_set1_validatedSrvCert(ctx, NULL); /* re-do the above check (just) for adding diagnostic information */ ossl_cmp_info(ctx, "trying to verify msg signature with previously validated cert"); - ctx->log_cb = backup_log_cb; (void)check_msg_given_cert(ctx, scrt, msg); - ctx->log_cb = NULL; - (void)ossl_cmp_ctx_set1_validatedSrvCert(ctx, NULL); /* this invalidates scrt */ } res = check_msg_all_certs(ctx, msg, 0 /* using ctx->trusted */) @@ -631,7 +628,7 @@ int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg) scrt = ctx->srvCert; if (scrt == NULL) { if (ctx->trusted == NULL && ctx->secretValue != NULL) { - ossl_cmp_info(ctx, "no trust store nor pinned sender cert available for verifying signature-based CMP message protection"); + ossl_cmp_info(ctx, "no trust store nor pinned server cert available for verifying signature-based CMP message protection"); ERR_raise(ERR_LIB_CMP, CMP_R_MISSING_TRUST_ANCHOR); return 0; } @@ -645,7 +642,7 @@ int OSSL_CMP_validate_msg(OSSL_CMP_CTX *ctx, const OSSL_CMP_MSG *msg) /* use ctx->srvCert for signature check even if not acceptable */ if (verify_signature(ctx, msg, scrt)) { ossl_cmp_debug(ctx, - "successfully validated signature-based CMP message protection using pinned sender cert"); + "successfully validated signature-based CMP message protection using pinned server cert"); return ossl_cmp_ctx_set1_validatedSrvCert(ctx, scrt); } ossl_cmp_warn(ctx, "CMP message signature verification failed"); diff --git a/deps/openssl/openssl/crypto/cms/cms_asn1.c b/deps/openssl/openssl/crypto/cms/cms_asn1.c index fb87f6c6ad2730..580850bc939514 100644 --- a/deps/openssl/openssl/crypto/cms/cms_asn1.c +++ b/deps/openssl/openssl/crypto/cms/cms_asn1.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -23,7 +23,7 @@ ASN1_SEQUENCE(CMS_OtherCertificateFormat) = { ASN1_OPT(CMS_OtherCertificateFormat, otherCert, ASN1_ANY) } static_ASN1_SEQUENCE_END(CMS_OtherCertificateFormat) -ASN1_CHOICE(CMS_CertificateChoices) + ASN1_CHOICE(CMS_CertificateChoices) = { ASN1_SIMPLE(CMS_CertificateChoices, d.certificate, X509), ASN1_IMP(CMS_CertificateChoices, d.extendedCertificate, ASN1_SEQUENCE, 0), ASN1_IMP(CMS_CertificateChoices, d.v1AttrCert, ASN1_SEQUENCE, 1), ASN1_IMP(CMS_CertificateChoices, d.v2AttrCert, ASN1_SEQUENCE, 2), ASN1_IMP(CMS_CertificateChoices, d.other, CMS_OtherCertificateFormat, 3) } ASN1_CHOICE_END(CMS_CertificateChoices) ASN1_CHOICE(CMS_SignerIdentifier) = { @@ -31,11 +31,11 @@ ASN1_CHOICE(CMS_SignerIdentifier) = { ASN1_IMP(CMS_SignerIdentifier, d.subjectKeyIdentifier, ASN1_OCTET_STRING, 0) } static_ASN1_CHOICE_END(CMS_SignerIdentifier) -ASN1_NDEF_SEQUENCE(CMS_EncapsulatedContentInfo) + ASN1_NDEF_SEQUENCE(CMS_EncapsulatedContentInfo) = { ASN1_SIMPLE(CMS_EncapsulatedContentInfo, eContentType, ASN1_OBJECT), ASN1_NDEF_EXP_OPT(CMS_EncapsulatedContentInfo, eContent, ASN1_OCTET_STRING_NDEF, 0) } static_ASN1_NDEF_SEQUENCE_END(CMS_EncapsulatedContentInfo) -/* Minor tweak to operation: free up signer key, cert */ -static int cms_si_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) + /* Minor tweak to operation: free up signer key, cert */ + static int cms_si_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) { if (operation == ASN1_OP_FREE_POST) { CMS_SignerInfo *si = (CMS_SignerInfo *)*pval; @@ -62,7 +62,7 @@ ASN1_SEQUENCE(CMS_OtherRevocationInfoFormat) = { ASN1_OPT(CMS_OtherRevocationInfoFormat, otherRevInfo, ASN1_ANY) } static_ASN1_SEQUENCE_END(CMS_OtherRevocationInfoFormat) -ASN1_CHOICE(CMS_RevocationInfoChoice) + ASN1_CHOICE(CMS_RevocationInfoChoice) = { ASN1_SIMPLE(CMS_RevocationInfoChoice, d.crl, X509_CRL), ASN1_IMP(CMS_RevocationInfoChoice, d.other, CMS_OtherRevocationInfoFormat, 1) } ASN1_CHOICE_END(CMS_RevocationInfoChoice) ASN1_NDEF_SEQUENCE(CMS_SignedData) = { @@ -80,7 +80,7 @@ ASN1_SEQUENCE(CMS_OriginatorInfo) = { ASN1_IMP_SET_OF_OPT(CMS_OriginatorInfo, crls, CMS_RevocationInfoChoice, 1) } static_ASN1_SEQUENCE_END(CMS_OriginatorInfo) -static int cms_ec_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) + static int cms_ec_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) { CMS_EncryptedContentInfo *ec = (CMS_EncryptedContentInfo *)*pval; @@ -118,7 +118,7 @@ ASN1_CHOICE(CMS_KeyAgreeRecipientIdentifier) = { ASN1_IMP(CMS_KeyAgreeRecipientIdentifier, d.rKeyId, CMS_RecipientKeyIdentifier, 0) } static_ASN1_CHOICE_END(CMS_KeyAgreeRecipientIdentifier) -static int cms_rek_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) + static int cms_rek_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) { CMS_RecipientEncryptedKey *rek = (CMS_RecipientEncryptedKey *)*pval; if (operation == ASN1_OP_FREE_POST) { @@ -143,7 +143,7 @@ ASN1_CHOICE(CMS_OriginatorIdentifierOrKey) = { ASN1_IMP(CMS_OriginatorIdentifierOrKey, d.originatorKey, CMS_OriginatorPublicKey, 1) } static_ASN1_CHOICE_END(CMS_OriginatorIdentifierOrKey) -static int cms_kari_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) + static int cms_kari_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) { CMS_KeyAgreeRecipientInfo *kari = (CMS_KeyAgreeRecipientInfo *)*pval; if (operation == ASN1_OP_NEW_POST) { @@ -173,7 +173,7 @@ ASN1_SEQUENCE(CMS_KEKIdentifier) = { ASN1_OPT(CMS_KEKIdentifier, other, CMS_OtherKeyAttribute) } static_ASN1_SEQUENCE_END(CMS_KEKIdentifier) -ASN1_SEQUENCE(CMS_KEKRecipientInfo) + ASN1_SEQUENCE(CMS_KEKRecipientInfo) = { ASN1_EMBED(CMS_KEKRecipientInfo, version, INT32), ASN1_SIMPLE(CMS_KEKRecipientInfo, kekid, CMS_KEKIdentifier), ASN1_SIMPLE(CMS_KEKRecipientInfo, keyEncryptionAlgorithm, X509_ALGOR), ASN1_SIMPLE(CMS_KEKRecipientInfo, encryptedKey, ASN1_OCTET_STRING) } ASN1_SEQUENCE_END(CMS_KEKRecipientInfo) ASN1_SEQUENCE(CMS_PasswordRecipientInfo) = { @@ -188,8 +188,8 @@ ASN1_SEQUENCE(CMS_OtherRecipientInfo) = { ASN1_OPT(CMS_OtherRecipientInfo, oriValue, ASN1_ANY) } static_ASN1_SEQUENCE_END(CMS_OtherRecipientInfo) -/* Free up RecipientInfo additional data */ -static int cms_ri_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) + /* Free up RecipientInfo additional data */ + static int cms_ri_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) { if (operation == ASN1_OP_FREE_PRE) { CMS_RecipientInfo *ri = (CMS_RecipientInfo *)*pval; @@ -262,7 +262,7 @@ ASN1_NDEF_SEQUENCE(CMS_AuthenticatedData) = { ASN1_IMP_SET_OF_OPT(CMS_AuthenticatedData, unauthAttrs, X509_ALGOR, 3) } static_ASN1_NDEF_SEQUENCE_END(CMS_AuthenticatedData) -ASN1_NDEF_SEQUENCE(CMS_CompressedData) + ASN1_NDEF_SEQUENCE(CMS_CompressedData) = { ASN1_EMBED(CMS_CompressedData, version, INT32), ASN1_SIMPLE(CMS_CompressedData, compressionAlgorithm, X509_ALGOR), @@ -348,7 +348,7 @@ ASN1_CHOICE(CMS_ReceiptsFrom) = { ASN1_IMP_SEQUENCE_OF(CMS_ReceiptsFrom, d.receiptList, GENERAL_NAMES, 1) } static_ASN1_CHOICE_END(CMS_ReceiptsFrom) -ASN1_SEQUENCE(CMS_ReceiptRequest) + ASN1_SEQUENCE(CMS_ReceiptRequest) = { ASN1_SIMPLE(CMS_ReceiptRequest, signedContentIdentifier, ASN1_OCTET_STRING), ASN1_SIMPLE(CMS_ReceiptRequest, receiptsFrom, CMS_ReceiptsFrom), ASN1_SEQUENCE_OF(CMS_ReceiptRequest, receiptsTo, GENERAL_NAMES) } ASN1_SEQUENCE_END(CMS_ReceiptRequest) ASN1_SEQUENCE(CMS_Receipt) = { @@ -375,7 +375,7 @@ ASN1_SEQUENCE(CMS_SharedInfo) = { ASN1_EXP_OPT(CMS_SharedInfo, suppPubInfo, ASN1_OCTET_STRING, 2), } static_ASN1_SEQUENCE_END(CMS_SharedInfo) -int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg, ASN1_OCTET_STRING *ukm, int keylen) + int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg, ASN1_OCTET_STRING *ukm, int keylen) { union { CMS_SharedInfo *pecsi; diff --git a/deps/openssl/openssl/crypto/cms/cms_dh.c b/deps/openssl/openssl/crypto/cms/cms_dh.c index 9c0b3c85e173ef..ab3453d1c7c121 100644 --- a/deps/openssl/openssl/crypto/cms/cms_dh.c +++ b/deps/openssl/openssl/crypto/cms/cms_dh.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -89,21 +89,16 @@ static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) int keylen, plen; EVP_CIPHER *kekcipher = NULL; EVP_CIPHER_CTX *kekctx; - const ASN1_OBJECT *aoid; - const void *parameter = NULL; - int ptype = 0; char name[OSSL_MAX_NAME_SIZE]; if (!CMS_RecipientInfo_kari_get0_alg(ri, &alg, &ukm)) goto err; - X509_ALGOR_get0(&aoid, &ptype, ¶meter, alg); - /* * For DH we only have one OID permissible. If ever any more get defined * we will need something cleverer. */ - if (OBJ_obj2nid(aoid) != NID_id_smime_alg_ESDH) { + if (OBJ_obj2nid(alg->algorithm) != NID_id_smime_alg_ESDH) { ERR_raise(ERR_LIB_CMS, CMS_R_KDF_PARAMETER_ERROR); goto err; } @@ -112,11 +107,11 @@ static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) || EVP_PKEY_CTX_set_dh_kdf_md(pctx, EVP_sha1()) <= 0) goto err; - if (ptype != V_ASN1_SEQUENCE) + if (alg->parameter->type != V_ASN1_SEQUENCE) goto err; - p = ASN1_STRING_get0_data(parameter); - plen = ASN1_STRING_length(parameter); + p = alg->parameter->value.sequence->data; + plen = alg->parameter->value.sequence->length; kekalg = d2i_X509_ALGOR(NULL, &p, plen); if (kekalg == NULL) goto err; diff --git a/deps/openssl/openssl/crypto/cms/cms_ec.c b/deps/openssl/openssl/crypto/cms/cms_ec.c index 917bf784daebc9..ff8adad616686f 100644 --- a/deps/openssl/openssl/crypto/cms/cms_ec.c +++ b/deps/openssl/openssl/crypto/cms/cms_ec.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -166,27 +166,21 @@ static int ecdh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) int plen, keylen; EVP_CIPHER *kekcipher = NULL; EVP_CIPHER_CTX *kekctx; - const ASN1_OBJECT *aoid = NULL; - int ptype = 0; - const void *parameter = NULL; - char name[OSSL_MAX_NAME_SIZE]; if (!CMS_RecipientInfo_kari_get0_alg(ri, &alg, &ukm)) return 0; - X509_ALGOR_get0(&aoid, &ptype, ¶meter, alg); - - if (!ecdh_cms_set_kdf_param(pctx, OBJ_obj2nid(aoid))) { + if (!ecdh_cms_set_kdf_param(pctx, OBJ_obj2nid(alg->algorithm))) { ERR_raise(ERR_LIB_CMS, CMS_R_KDF_PARAMETER_ERROR); return 0; } - if (ptype != V_ASN1_SEQUENCE) + if (alg->parameter->type != V_ASN1_SEQUENCE) return 0; - p = ASN1_STRING_get0_data(parameter); - plen = ASN1_STRING_length(parameter); + p = alg->parameter->value.sequence->data; + plen = alg->parameter->value.sequence->length; kekalg = d2i_X509_ALGOR(NULL, &p, plen); if (kekalg == NULL) goto err; diff --git a/deps/openssl/openssl/crypto/cms/cms_local.h b/deps/openssl/openssl/crypto/cms/cms_local.h index 94496b3823ef09..b412a74c7773b5 100644 --- a/deps/openssl/openssl/crypto/cms/cms_local.h +++ b/deps/openssl/openssl/crypto/cms/cms_local.h @@ -1,5 +1,5 @@ /* - * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2008-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -35,7 +35,8 @@ typedef struct CMS_OriginatorPublicKey_st CMS_OriginatorPublicKey; typedef struct CMS_OriginatorIdentifierOrKey_st CMS_OriginatorIdentifierOrKey; typedef struct CMS_KeyAgreeRecipientInfo_st CMS_KeyAgreeRecipientInfo; typedef struct CMS_RecipientKeyIdentifier_st CMS_RecipientKeyIdentifier; -typedef struct CMS_KeyAgreeRecipientIdentifier_st CMS_KeyAgreeRecipientIdentifier; +typedef struct CMS_KeyAgreeRecipientIdentifier_st + CMS_KeyAgreeRecipientIdentifier; typedef struct CMS_KEKIdentifier_st CMS_KEKIdentifier; typedef struct CMS_KEKRecipientInfo_st CMS_KEKRecipientInfo; typedef struct CMS_PasswordRecipientInfo_st CMS_PasswordRecipientInfo; diff --git a/deps/openssl/openssl/crypto/cms/cms_rsa.c b/deps/openssl/openssl/crypto/cms/cms_rsa.c index 9bf8284a82722b..6b65842cc14ec5 100644 --- a/deps/openssl/openssl/crypto/cms/cms_rsa.c +++ b/deps/openssl/openssl/crypto/cms/cms_rsa.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -42,13 +42,10 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri) X509_ALGOR *cmsalg; int nid; int rv = -1; - const unsigned char *label = NULL; + unsigned char *label = NULL; int labellen = 0; const EVP_MD *mgf1md = NULL, *md = NULL; RSA_OAEP_PARAMS *oaep; - const ASN1_OBJECT *aoid; - const void *parameter = NULL; - int ptype = 0; pkctx = CMS_RecipientInfo_get0_pkey_ctx(ri); if (pkctx == NULL) @@ -78,19 +75,21 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri) goto err; if (oaep->pSourceFunc != NULL) { - X509_ALGOR_get0(&aoid, &ptype, ¶meter, oaep->pSourceFunc); + X509_ALGOR *plab = oaep->pSourceFunc; - if (OBJ_obj2nid(aoid) != NID_pSpecified) { + if (OBJ_obj2nid(plab->algorithm) != NID_pSpecified) { ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_LABEL_SOURCE); goto err; } - if (ptype != V_ASN1_OCTET_STRING) { + if (plab->parameter->type != V_ASN1_OCTET_STRING) { ERR_raise(ERR_LIB_CMS, CMS_R_INVALID_LABEL); goto err; } - label = ASN1_STRING_get0_data(parameter); - labellen = ASN1_STRING_length(parameter); + label = plab->parameter->value.octet_string->data; + /* Stop label being freed when OAEP parameters are freed */ + plab->parameter->value.octet_string->data = NULL; + labellen = plab->parameter->value.octet_string->length; } if (EVP_PKEY_CTX_set_rsa_padding(pkctx, RSA_PKCS1_OAEP_PADDING) <= 0) @@ -99,16 +98,10 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri) goto err; if (EVP_PKEY_CTX_set_rsa_mgf1_md(pkctx, mgf1md) <= 0) goto err; - if (label != NULL) { - unsigned char *dup_label = OPENSSL_memdup(label, labellen); - - if (dup_label == NULL) - goto err; - - if (EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, dup_label, labellen) <= 0) { - OPENSSL_free(dup_label); - goto err; - } + if (label != NULL + && EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, label, labellen) <= 0) { + OPENSSL_free(label); + goto err; } /* Carry on */ rv = 1; diff --git a/deps/openssl/openssl/crypto/cms/cms_smime.c b/deps/openssl/openssl/crypto/cms/cms_smime.c index 4b5009b9d5bf83..920464b3deec46 100644 --- a/deps/openssl/openssl/crypto/cms/cms_smime.c +++ b/deps/openssl/openssl/crypto/cms/cms_smime.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2008-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -474,10 +474,8 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, } else { if (dcont && (tmpin == dcont)) do_free_upto(cmsbio, dcont); - else if (cmsbio != NULL) - BIO_free_all(cmsbio); else - BIO_free(tmpin); + BIO_free_all(cmsbio); } if (out != tmpout) diff --git a/deps/openssl/openssl/crypto/conf/conf_lib.c b/deps/openssl/openssl/crypto/conf/conf_lib.c index 3bd750144cec22..6efd95283e9ed9 100644 --- a/deps/openssl/openssl/crypto/conf/conf_lib.c +++ b/deps/openssl/openssl/crypto/conf/conf_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -314,7 +314,7 @@ char *NCONF_get_string(const CONF *conf, const char *group, const char *name) return NULL; } ERR_raise_data(ERR_LIB_CONF, CONF_R_NO_VALUE, - "group=%s name=%s", group != NULL ? group : "", name); + "group=%s name=%s", group, name); return NULL; } diff --git a/deps/openssl/openssl/crypto/conf/conf_mod.c b/deps/openssl/openssl/crypto/conf/conf_mod.c index 4ed7d9fd76cfa6..adc0c5f369698f 100644 --- a/deps/openssl/openssl/crypto/conf/conf_mod.c +++ b/deps/openssl/openssl/crypto/conf/conf_mod.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -395,7 +395,7 @@ static CONF_MODULE *module_find(const char *name) { CONF_MODULE *tmod; int i, nchar; - const char *p; + char *p; STACK_OF(CONF_MODULE) *mods; p = strrchr(name, '.'); diff --git a/deps/openssl/openssl/crypto/des/cfb64ede.c b/deps/openssl/openssl/crypto/des/cfb64ede.c index b73c805f18108f..26613a05fe8a46 100644 --- a/deps/openssl/openssl/crypto/des/cfb64ede.c +++ b/deps/openssl/openssl/crypto/des/cfb64ede.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -28,7 +28,7 @@ void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out, { register DES_LONG v0, v1; register long l = length; - register int n = *num & 0x07; + register int n = *num; DES_LONG ti[2]; unsigned char *iv, c, cc; diff --git a/deps/openssl/openssl/crypto/des/cfb64enc.c b/deps/openssl/openssl/crypto/des/cfb64enc.c index c27400a9798785..3ddd6819e2ed8a 100644 --- a/deps/openssl/openssl/crypto/des/cfb64enc.c +++ b/deps/openssl/openssl/crypto/des/cfb64enc.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -27,7 +27,7 @@ void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out, { register DES_LONG v0, v1; register long l = length; - register int n = *num & 0x07; + register int n = *num; DES_LONG ti[2]; unsigned char *iv, c, cc; diff --git a/deps/openssl/openssl/crypto/des/ofb64ede.c b/deps/openssl/openssl/crypto/des/ofb64ede.c index c3bb7d7e1b36af..b0f9f0441cfb79 100644 --- a/deps/openssl/openssl/crypto/des/ofb64ede.c +++ b/deps/openssl/openssl/crypto/des/ofb64ede.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,7 @@ void DES_ede3_ofb64_encrypt(register const unsigned char *in, DES_key_schedule *k3, DES_cblock *ivec, int *num) { register DES_LONG v0, v1; - register int n = *num & 0x07; + register int n = *num; register long l = length; DES_cblock d; register char *dp; diff --git a/deps/openssl/openssl/crypto/des/ofb64enc.c b/deps/openssl/openssl/crypto/des/ofb64enc.c index 84b99d9d8ff70a..df4e2077e96cdc 100644 --- a/deps/openssl/openssl/crypto/des/ofb64enc.c +++ b/deps/openssl/openssl/crypto/des/ofb64enc.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -25,7 +25,7 @@ void DES_ofb64_encrypt(register const unsigned char *in, DES_key_schedule *schedule, DES_cblock *ivec, int *num) { register DES_LONG v0, v1, t; - register int n = *num & 0x07; + register int n = *num; register long l = length; DES_cblock d; register unsigned char *dp; diff --git a/deps/openssl/openssl/crypto/dh/dh_asn1.c b/deps/openssl/openssl/crypto/dh/dh_asn1.c index 10bcdd2253f3f0..af78e2e84bf88d 100644 --- a/deps/openssl/openssl/crypto/dh/dh_asn1.c +++ b/deps/openssl/openssl/crypto/dh/dh_asn1.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -76,7 +76,7 @@ ASN1_SEQUENCE(DHvparams) = { ASN1_SIMPLE(int_dhvparams, counter, BIGNUM) } static_ASN1_SEQUENCE_END_name(int_dhvparams, DHvparams) -ASN1_SEQUENCE(DHxparams) + ASN1_SEQUENCE(DHxparams) = { ASN1_SIMPLE(int_dhx942_dh, p, BIGNUM), ASN1_SIMPLE(int_dhx942_dh, g, BIGNUM), @@ -85,7 +85,8 @@ ASN1_SEQUENCE(DHxparams) ASN1_OPT(int_dhx942_dh, vparams, DHvparams), } static_ASN1_SEQUENCE_END_name(int_dhx942_dh, DHxparams) -int_dhx942_dh *d2i_int_dhx(int_dhx942_dh **a, const unsigned char **pp, long length); + int_dhx942_dh + * d2i_int_dhx(int_dhx942_dh * *a, const unsigned char **pp, long length); int i2d_int_dhx(const int_dhx942_dh *a, unsigned char **pp); IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(int_dhx942_dh, DHxparams, int_dhx) diff --git a/deps/openssl/openssl/crypto/dh/dh_rfc5114.c b/deps/openssl/openssl/crypto/dh/dh_rfc5114.c index 67a9198a7071cb..366776ce4ee377 100644 --- a/deps/openssl/openssl/crypto/dh/dh_rfc5114.c +++ b/deps/openssl/openssl/crypto/dh/dh_rfc5114.c @@ -1,5 +1,5 @@ /* - * Copyright 2011-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2011-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -43,5 +43,5 @@ } make_dh(1024_160) -make_dh(2048_224) -make_dh(2048_256) + make_dh(2048_224) + make_dh(2048_256) diff --git a/deps/openssl/openssl/crypto/dllmain.c b/deps/openssl/openssl/crypto/dllmain.c index f2b72df899412f..1525878705412f 100644 --- a/deps/openssl/openssl/crypto/dllmain.c +++ b/deps/openssl/openssl/crypto/dllmain.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -35,9 +35,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: -#ifndef __CYGWIN__ OPENSSL_thread_stop(); -#endif break; case DLL_PROCESS_DETACH: break; diff --git a/deps/openssl/openssl/crypto/dsa/dsa_asn1.c b/deps/openssl/openssl/crypto/dsa/dsa_asn1.c index 9ebc7cc2596d6e..3366610a9fdc8f 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_asn1.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_asn1.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -47,7 +47,7 @@ ASN1_SEQUENCE_cb(DSAPrivateKey, dsa_cb) = { ASN1_SIMPLE(DSA, priv_key, CBIGNUM) } static_ASN1_SEQUENCE_END_cb(DSA, DSAPrivateKey) -IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(DSA, DSAPrivateKey, DSAPrivateKey) + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(DSA, DSAPrivateKey, DSAPrivateKey) ASN1_SEQUENCE_cb(DSAparams, dsa_cb) = { ASN1_SIMPLE(DSA, params.p, BIGNUM), @@ -55,7 +55,7 @@ ASN1_SEQUENCE_cb(DSAparams, dsa_cb) = { ASN1_SIMPLE(DSA, params.g, BIGNUM), } static_ASN1_SEQUENCE_END_cb(DSA, DSAparams) -IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(DSA, DSAparams, DSAparams) + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(DSA, DSAparams, DSAparams) ASN1_SEQUENCE_cb(DSAPublicKey, dsa_cb) = { ASN1_SIMPLE(DSA, pub_key, BIGNUM), @@ -64,7 +64,7 @@ ASN1_SEQUENCE_cb(DSAPublicKey, dsa_cb) = { ASN1_SIMPLE(DSA, params.g, BIGNUM) } static_ASN1_SEQUENCE_END_cb(DSA, DSAPublicKey) -IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(DSA, DSAPublicKey, DSAPublicKey) + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(DSA, DSAPublicKey, DSAPublicKey) DSA *DSAparams_dup(const DSA *dsa) { diff --git a/deps/openssl/openssl/crypto/ec/ec_asn1.c b/deps/openssl/openssl/crypto/ec/ec_asn1.c index 6b44b8068f9ec3..bfd0242c6f56b3 100644 --- a/deps/openssl/openssl/crypto/ec/ec_asn1.c +++ b/deps/openssl/openssl/crypto/ec/ec_asn1.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -105,7 +105,7 @@ ASN1_SEQUENCE(X9_62_PENTANOMIAL) = { ASN1_EMBED(X9_62_PENTANOMIAL, k3, INT32) } static_ASN1_SEQUENCE_END(X9_62_PENTANOMIAL) -DECLARE_ASN1_ALLOC_FUNCTIONS(X9_62_PENTANOMIAL) + DECLARE_ASN1_ALLOC_FUNCTIONS(X9_62_PENTANOMIAL) IMPLEMENT_ASN1_ALLOC_FUNCTIONS(X9_62_PENTANOMIAL) ASN1_ADB_TEMPLATE(char_two_def) = ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, p.other, ASN1_ANY); @@ -122,7 +122,7 @@ ASN1_SEQUENCE(X9_62_CHARACTERISTIC_TWO) = { ASN1_ADB_OBJECT(X9_62_CHARACTERISTIC_TWO) } static_ASN1_SEQUENCE_END(X9_62_CHARACTERISTIC_TWO) -DECLARE_ASN1_ALLOC_FUNCTIONS(X9_62_CHARACTERISTIC_TWO) + DECLARE_ASN1_ALLOC_FUNCTIONS(X9_62_CHARACTERISTIC_TWO) IMPLEMENT_ASN1_ALLOC_FUNCTIONS(X9_62_CHARACTERISTIC_TWO) ASN1_ADB_TEMPLATE(fieldID_def) = ASN1_SIMPLE(X9_62_FIELDID, p.other, ASN1_ANY); @@ -137,10 +137,10 @@ ASN1_SEQUENCE(X9_62_FIELDID) = { ASN1_ADB_OBJECT(X9_62_FIELDID) } static_ASN1_SEQUENCE_END(X9_62_FIELDID) -ASN1_SEQUENCE(X9_62_CURVE) + ASN1_SEQUENCE(X9_62_CURVE) = { ASN1_SIMPLE(X9_62_CURVE, a, ASN1_OCTET_STRING), ASN1_SIMPLE(X9_62_CURVE, b, ASN1_OCTET_STRING), ASN1_OPT(X9_62_CURVE, seed, ASN1_BIT_STRING) } static_ASN1_SEQUENCE_END(X9_62_CURVE) -ASN1_SEQUENCE(ECPARAMETERS) + ASN1_SEQUENCE(ECPARAMETERS) = { ASN1_EMBED(ECPARAMETERS, version, INT32), ASN1_SIMPLE(ECPARAMETERS, fieldID, X9_62_FIELDID), ASN1_SIMPLE(ECPARAMETERS, curve, X9_62_CURVE), ASN1_SIMPLE(ECPARAMETERS, base, ASN1_OCTET_STRING), ASN1_SIMPLE(ECPARAMETERS, order, ASN1_INTEGER), ASN1_OPT(ECPARAMETERS, cofactor, ASN1_INTEGER) } ASN1_SEQUENCE_END(ECPARAMETERS) DECLARE_ASN1_ALLOC_FUNCTIONS(ECPARAMETERS) @@ -163,7 +163,7 @@ ASN1_SEQUENCE(EC_PRIVATEKEY) = { ASN1_EXP_OPT(EC_PRIVATEKEY, publicKey, ASN1_BIT_STRING, 1) } static_ASN1_SEQUENCE_END(EC_PRIVATEKEY) -DECLARE_ASN1_FUNCTIONS(EC_PRIVATEKEY) + DECLARE_ASN1_FUNCTIONS(EC_PRIVATEKEY) DECLARE_ASN1_ENCODE_FUNCTIONS_name(EC_PRIVATEKEY, EC_PRIVATEKEY) IMPLEMENT_ASN1_FUNCTIONS(EC_PRIVATEKEY) diff --git a/deps/openssl/openssl/crypto/ec/ec_check.c b/deps/openssl/openssl/crypto/ec/ec_check.c index 98cf12f36c0ef8..a112960021952e 100644 --- a/deps/openssl/openssl/crypto/ec/ec_check.c +++ b/deps/openssl/openssl/crypto/ec/ec_check.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -50,7 +50,7 @@ int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx) * ECC domain parameter validation. * See SP800-56A R3 5.5.2 "Assurances of Domain-Parameter Validity" Part 1b. */ - return EC_GROUP_check_named_curve(group, 1, ctx) > 0 ? 1 : 0; + return EC_GROUP_check_named_curve(group, 1, ctx) >= 0 ? 1 : 0; #else int ret = 0; const BIGNUM *order; diff --git a/deps/openssl/openssl/crypto/ec/ec_lib.c b/deps/openssl/openssl/crypto/ec/ec_lib.c index 2a5f93de1fdb1d..13dcd29b115cb7 100644 --- a/deps/openssl/openssl/crypto/ec/ec_lib.c +++ b/deps/openssl/openssl/crypto/ec/ec_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -175,8 +175,6 @@ int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src) dest->libctx = src->libctx; dest->curve_name = src->curve_name; - EC_pre_comp_free(dest); - /* Copy precomputed */ dest->pre_comp_type = src->pre_comp_type; switch (src->pre_comp_type) { diff --git a/deps/openssl/openssl/crypto/err/err_all.c b/deps/openssl/openssl/crypto/err/err_all.c index 76841f4ad3cfe9..789ba9b87a4f6a 100644 --- a/deps/openssl/openssl/crypto/err/err_all.c +++ b/deps/openssl/openssl/crypto/err/err_all.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -40,7 +40,6 @@ #include "crypto/cmperr.h" #include "crypto/cterr.h" #include "crypto/asyncerr.h" -#include "crypto/sm2err.h" #include "crypto/storeerr.h" #include "crypto/esserr.h" #include "internal/propertyerr.h" @@ -105,9 +104,6 @@ int ossl_err_load_crypto_strings(void) #endif || ossl_err_load_ESS_strings() == 0 || ossl_err_load_ASYNC_strings() == 0 -#ifndef OPENSSL_NO_SM2 - || ossl_err_load_SM2_strings() == 0 -#endif || ossl_err_load_OSSL_STORE_strings() == 0 || ossl_err_load_PROP_strings() == 0 || ossl_err_load_PROV_strings() == 0 diff --git a/deps/openssl/openssl/crypto/err/openssl.txt b/deps/openssl/openssl/crypto/err/openssl.txt index 5b2ea1c4a4e675..1c362d15f3c861 100644 --- a/deps/openssl/openssl/crypto/err/openssl.txt +++ b/deps/openssl/openssl/crypto/err/openssl.txt @@ -1,4 +1,4 @@ -# Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -848,7 +848,6 @@ EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE:191:xts data unit is too large EVP_R_XTS_DUPLICATED_KEYS:192:xts duplicated keys HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN:108:asn1 len exceeds max resp len HTTP_R_CONNECT_FAILURE:100:connect failure -HTTP_R_CONTENT_TYPE_MISMATCH:131:content type mismatch HTTP_R_ERROR_PARSING_ASN1_LENGTH:109:error parsing asn1 length HTTP_R_ERROR_PARSING_CONTENT_LENGTH:119:error parsing content length HTTP_R_ERROR_PARSING_URL:101:error parsing url diff --git a/deps/openssl/openssl/crypto/ess/ess_asn1.c b/deps/openssl/openssl/crypto/ess/ess_asn1.c index d02076fabc5aef..297f2cead02a10 100644 --- a/deps/openssl/openssl/crypto/ess/ess_asn1.c +++ b/deps/openssl/openssl/crypto/ess/ess_asn1.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -21,7 +21,7 @@ ASN1_SEQUENCE(ESS_ISSUER_SERIAL) = { ASN1_SIMPLE(ESS_ISSUER_SERIAL, serial, ASN1_INTEGER) } static_ASN1_SEQUENCE_END(ESS_ISSUER_SERIAL) -IMPLEMENT_ASN1_FUNCTIONS(ESS_ISSUER_SERIAL) + IMPLEMENT_ASN1_FUNCTIONS(ESS_ISSUER_SERIAL) IMPLEMENT_ASN1_DUP_FUNCTION(ESS_ISSUER_SERIAL) ASN1_SEQUENCE(ESS_CERT_ID) = { @@ -29,7 +29,7 @@ ASN1_SEQUENCE(ESS_CERT_ID) = { ASN1_OPT(ESS_CERT_ID, issuer_serial, ESS_ISSUER_SERIAL) } static_ASN1_SEQUENCE_END(ESS_CERT_ID) -IMPLEMENT_ASN1_FUNCTIONS(ESS_CERT_ID) + IMPLEMENT_ASN1_FUNCTIONS(ESS_CERT_ID) IMPLEMENT_ASN1_DUP_FUNCTION(ESS_CERT_ID) ASN1_SEQUENCE(ESS_SIGNING_CERT) = { @@ -46,7 +46,7 @@ ASN1_SEQUENCE(ESS_CERT_ID_V2) = { ASN1_OPT(ESS_CERT_ID_V2, issuer_serial, ESS_ISSUER_SERIAL) } static_ASN1_SEQUENCE_END(ESS_CERT_ID_V2) -IMPLEMENT_ASN1_FUNCTIONS(ESS_CERT_ID_V2) + IMPLEMENT_ASN1_FUNCTIONS(ESS_CERT_ID_V2) IMPLEMENT_ASN1_DUP_FUNCTION(ESS_CERT_ID_V2) ASN1_SEQUENCE(ESS_SIGNING_CERT_V2) = { diff --git a/deps/openssl/openssl/crypto/evp/digest.c b/deps/openssl/openssl/crypto/evp/digest.c index 224f3000ce0ad1..4b1c95c4abe3be 100644 --- a/deps/openssl/openssl/crypto/evp/digest.c +++ b/deps/openssl/openssl/crypto/evp/digest.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -872,9 +872,8 @@ const OSSL_PARAM *EVP_MD_CTX_gettable_params(EVP_MD_CTX *ctx) if (pctx != NULL && (pctx->operation == EVP_PKEY_OP_VERIFYCTX || pctx->operation == EVP_PKEY_OP_SIGNCTX) - && pctx->op.sig.signature != NULL - && pctx->op.sig.signature->gettable_ctx_md_params != NULL - && pctx->op.sig.algctx != NULL) + && pctx->op.sig.algctx != NULL + && pctx->op.sig.signature->gettable_ctx_md_params != NULL) return pctx->op.sig.signature->gettable_ctx_md_params( pctx->op.sig.algctx); diff --git a/deps/openssl/openssl/crypto/evp/e_aes.c b/deps/openssl/openssl/crypto/evp/e_aes.c index 5a99fe8d577e7b..5ce981958eb45b 100644 --- a/deps/openssl/openssl/crypto/evp/e_aes.c +++ b/deps/openssl/openssl/crypto/evp/e_aes.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -2403,14 +2403,14 @@ static int s390x_aes_ocb_ctrl(EVP_CIPHER_CTX *, int type, int arg, void *ptr); #endif -#define BLOCK_CIPHER_generic_pack(nid, keylen, flags) \ - BLOCK_CIPHER_generic(nid, keylen, 16, 16, cbc, cbc, CBC, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, keylen, 16, 0, ecb, ecb, ECB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, ofb128, ofb, OFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb128, cfb, CFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb1, cfb1, CFB, flags) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb8, cfb8, CFB, flags) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, ctr, ctr, CTR, flags) +#define BLOCK_CIPHER_generic_pack(nid, keylen, flags) \ + BLOCK_CIPHER_generic(nid, keylen, 16, 16, cbc, cbc, CBC, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, keylen, 16, 0, ecb, ecb, ECB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, ofb128, ofb, OFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb128, cfb, CFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb1, cfb1, CFB, flags) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb8, cfb8, CFB, flags) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, ctr, ctr, CTR, flags) static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) @@ -2641,10 +2641,10 @@ static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } BLOCK_CIPHER_generic_pack(NID_aes, 128, 0) -BLOCK_CIPHER_generic_pack(NID_aes, 192, 0) -BLOCK_CIPHER_generic_pack(NID_aes, 256, 0) + BLOCK_CIPHER_generic_pack(NID_aes, 192, 0) + BLOCK_CIPHER_generic_pack(NID_aes, 256, 0) -static int aes_gcm_cleanup(EVP_CIPHER_CTX *c) + static int aes_gcm_cleanup(EVP_CIPHER_CTX *c) { EVP_AES_GCM_CTX *gctx = EVP_C_DATA(EVP_AES_GCM_CTX, c); if (gctx == NULL) @@ -3189,12 +3189,12 @@ static int aes_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, BLOCK_CIPHER_custom(NID_aes, 128, 1, 12, gcm, GCM, EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) -BLOCK_CIPHER_custom(NID_aes, 192, 1, 12, gcm, GCM, - EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) -BLOCK_CIPHER_custom(NID_aes, 256, 1, 12, gcm, GCM, - EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) + BLOCK_CIPHER_custom(NID_aes, 192, 1, 12, gcm, GCM, + EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) + BLOCK_CIPHER_custom(NID_aes, 256, 1, 12, gcm, GCM, + EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) -static int aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) + static int aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) { EVP_AES_XTS_CTX *xctx = EVP_C_DATA(EVP_AES_XTS_CTX, c); @@ -3378,9 +3378,9 @@ static int aes_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | EVP_CIPH_CUSTOM_COPY) BLOCK_CIPHER_custom(NID_aes, 128, 1, 16, xts, XTS, XTS_FLAGS) -BLOCK_CIPHER_custom(NID_aes, 256, 1, 16, xts, XTS, XTS_FLAGS) + BLOCK_CIPHER_custom(NID_aes, 256, 1, 16, xts, XTS, XTS_FLAGS) -static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) + static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) { EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX, c); switch (type) { @@ -3654,12 +3654,12 @@ static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, BLOCK_CIPHER_custom(NID_aes, 128, 1, 12, ccm, CCM, EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) -BLOCK_CIPHER_custom(NID_aes, 192, 1, 12, ccm, CCM, - EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) -BLOCK_CIPHER_custom(NID_aes, 256, 1, 12, ccm, CCM, - EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) + BLOCK_CIPHER_custom(NID_aes, 192, 1, 12, ccm, CCM, + EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) + BLOCK_CIPHER_custom(NID_aes, 256, 1, 12, ccm, CCM, + EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) -typedef struct { + typedef struct { union { OSSL_UNION_ALIGN; AES_KEY ks; @@ -4146,8 +4146,8 @@ static int aes_ocb_cleanup(EVP_CIPHER_CTX *c) BLOCK_CIPHER_custom(NID_aes, 128, 16, 12, ocb, OCB, EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) -BLOCK_CIPHER_custom(NID_aes, 192, 16, 12, ocb, OCB, - EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) -BLOCK_CIPHER_custom(NID_aes, 256, 16, 12, ocb, OCB, - EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) + BLOCK_CIPHER_custom(NID_aes, 192, 16, 12, ocb, OCB, + EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) + BLOCK_CIPHER_custom(NID_aes, 256, 16, 12, ocb, OCB, + EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) #endif /* OPENSSL_NO_OCB */ diff --git a/deps/openssl/openssl/crypto/evp/e_aria.c b/deps/openssl/openssl/crypto/evp/e_aria.c index e35e3f5083a83c..eb3d98259e3a7a 100644 --- a/deps/openssl/openssl/crypto/evp/e_aria.c +++ b/deps/openssl/openssl/crypto/evp/e_aria.c @@ -1,5 +1,5 @@ /* - * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -194,13 +194,13 @@ static int aria_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } BLOCK_CIPHER_generic(NID_aria, 128, 1, 16, ctr, ctr, CTR, 0) -BLOCK_CIPHER_generic(NID_aria, 192, 1, 16, ctr, ctr, CTR, 0) -BLOCK_CIPHER_generic(NID_aria, 256, 1, 16, ctr, ctr, CTR, 0) + BLOCK_CIPHER_generic(NID_aria, 192, 1, 16, ctr, ctr, CTR, 0) + BLOCK_CIPHER_generic(NID_aria, 256, 1, 16, ctr, ctr, CTR, 0) -/* Authenticated cipher modes (GCM/CCM) */ + /* Authenticated cipher modes (GCM/CCM) */ -/* increment counter (64-bit int) by 1 */ -static void ctr64_inc(unsigned char *counter) + /* increment counter (64-bit int) by 1 */ + static void ctr64_inc(unsigned char *counter) { int n = 8; unsigned char c; @@ -778,11 +778,11 @@ static int aria_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } BLOCK_CIPHER_aead(128, gcm, GCM) -BLOCK_CIPHER_aead(192, gcm, GCM) -BLOCK_CIPHER_aead(256, gcm, GCM) + BLOCK_CIPHER_aead(192, gcm, GCM) + BLOCK_CIPHER_aead(256, gcm, GCM) -BLOCK_CIPHER_aead(128, ccm, CCM) -BLOCK_CIPHER_aead(192, ccm, CCM) -BLOCK_CIPHER_aead(256, ccm, CCM) + BLOCK_CIPHER_aead(128, ccm, CCM) + BLOCK_CIPHER_aead(192, ccm, CCM) + BLOCK_CIPHER_aead(256, ccm, CCM) #endif diff --git a/deps/openssl/openssl/crypto/evp/e_camellia.c b/deps/openssl/openssl/crypto/evp/e_camellia.c index babc4f18f3be06..c994bb395d8fd7 100644 --- a/deps/openssl/openssl/crypto/evp/e_camellia.c +++ b/deps/openssl/openssl/crypto/evp/e_camellia.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -183,14 +183,14 @@ static int cmll_t4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, #endif -#define BLOCK_CIPHER_generic_pack(nid, keylen, flags) \ - BLOCK_CIPHER_generic(nid, keylen, 16, 16, cbc, cbc, CBC, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, keylen, 16, 0, ecb, ecb, ECB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, ofb128, ofb, OFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb128, cfb, CFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb1, cfb1, CFB, flags) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb8, cfb8, CFB, flags) \ - BLOCK_CIPHER_generic(nid, keylen, 1, 16, ctr, ctr, CTR, flags) +#define BLOCK_CIPHER_generic_pack(nid, keylen, flags) \ + BLOCK_CIPHER_generic(nid, keylen, 16, 16, cbc, cbc, CBC, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, keylen, 16, 0, ecb, ecb, ECB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, ofb128, ofb, OFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb128, cfb, CFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb1, cfb1, CFB, flags) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, cfb8, cfb8, CFB, flags) \ + BLOCK_CIPHER_generic(nid, keylen, 1, 16, ctr, ctr, CTR, flags) /* The subkey for Camellia is generated. */ static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, @@ -347,5 +347,5 @@ static int camellia_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } BLOCK_CIPHER_generic_pack(NID_camellia, 128, 0) -BLOCK_CIPHER_generic_pack(NID_camellia, 192, 0) -BLOCK_CIPHER_generic_pack(NID_camellia, 256, 0) + BLOCK_CIPHER_generic_pack(NID_camellia, 192, 0) + BLOCK_CIPHER_generic_pack(NID_camellia, 256, 0) diff --git a/deps/openssl/openssl/crypto/evp/e_des.c b/deps/openssl/openssl/crypto/evp/e_des.c index 9c9080025c14f9..b8d10829c25773 100644 --- a/deps/openssl/openssl/crypto/evp/e_des.c +++ b/deps/openssl/openssl/crypto/evp/e_des.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -197,16 +197,16 @@ BLOCK_CIPHER_defs(des, EVP_DES_KEY, NID_des, 8, 8, 8, 64, EVP_CIPH_RAND_KEY, des_init_key, NULL, EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, des_ctrl) -BLOCK_CIPHER_def_cfb(des, EVP_DES_KEY, NID_des, 8, 8, 1, - EVP_CIPH_RAND_KEY, des_init_key, NULL, - EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, des_ctrl) + BLOCK_CIPHER_def_cfb(des, EVP_DES_KEY, NID_des, 8, 8, 1, + EVP_CIPH_RAND_KEY, des_init_key, NULL, + EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, des_ctrl) -BLOCK_CIPHER_def_cfb(des, EVP_DES_KEY, NID_des, 8, 8, 8, - EVP_CIPH_RAND_KEY, des_init_key, NULL, - EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, des_ctrl) + BLOCK_CIPHER_def_cfb(des, EVP_DES_KEY, NID_des, 8, 8, 8, + EVP_CIPH_RAND_KEY, des_init_key, NULL, + EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, des_ctrl) -static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, - const unsigned char *iv, int enc) + static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, + const unsigned char *iv, int enc) { DES_cblock *deskey = (DES_cblock *)key; EVP_DES_KEY *dat = (EVP_DES_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx); diff --git a/deps/openssl/openssl/crypto/evp/e_des3.c b/deps/openssl/openssl/crypto/evp/e_des3.c index 13abdda138f02c..ecb49a3f204e27 100644 --- a/deps/openssl/openssl/crypto/evp/e_des3.c +++ b/deps/openssl/openssl/crypto/evp/e_des3.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -210,20 +210,20 @@ BLOCK_CIPHER_defs(des_ede, DES_EDE_KEY, NID_des_ede, 8, 16, 8, 64, #define des_ede3_ofb_cipher des_ede_ofb_cipher #define des_ede3_cbc_cipher des_ede_cbc_cipher #define des_ede3_ecb_cipher des_ede_ecb_cipher -BLOCK_CIPHER_defs(des_ede3, DES_EDE_KEY, NID_des_ede3, 8, 24, 8, 64, - EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1, - des_ede3_init_key, NULL, NULL, NULL, des3_ctrl) + BLOCK_CIPHER_defs(des_ede3, DES_EDE_KEY, NID_des_ede3, 8, 24, 8, 64, + EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1, + des_ede3_init_key, NULL, NULL, NULL, des3_ctrl) -BLOCK_CIPHER_def_cfb(des_ede3, DES_EDE_KEY, NID_des_ede3, 24, 8, 1, - EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1, - des_ede3_init_key, NULL, NULL, NULL, des3_ctrl) + BLOCK_CIPHER_def_cfb(des_ede3, DES_EDE_KEY, NID_des_ede3, 24, 8, 1, + EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1, + des_ede3_init_key, NULL, NULL, NULL, des3_ctrl) -BLOCK_CIPHER_def_cfb(des_ede3, DES_EDE_KEY, NID_des_ede3, 24, 8, 8, - EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1, - des_ede3_init_key, NULL, NULL, NULL, des3_ctrl) + BLOCK_CIPHER_def_cfb(des_ede3, DES_EDE_KEY, NID_des_ede3, 24, 8, 8, + EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1, + des_ede3_init_key, NULL, NULL, NULL, des3_ctrl) -static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, - const unsigned char *iv, int enc) + static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, + const unsigned char *iv, int enc) { DES_cblock *deskey = (DES_cblock *)key; DES_EDE_KEY *dat = data(ctx); diff --git a/deps/openssl/openssl/crypto/evp/e_idea.c b/deps/openssl/openssl/crypto/evp/e_idea.c index 6f4f05842f87ea..0371094fe3bbf2 100644 --- a/deps/openssl/openssl/crypto/evp/e_idea.c +++ b/deps/openssl/openssl/crypto/evp/e_idea.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -54,8 +54,8 @@ BLOCK_CIPHER_func_cbc(idea, IDEA, EVP_IDEA_KEY, ks) 0, idea_init_key, NULL, EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL) -static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, - const unsigned char *iv, int enc) + static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, + const unsigned char *iv, int enc) { if (!enc) { if (EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_OFB_MODE) diff --git a/deps/openssl/openssl/crypto/evp/e_sm4.c b/deps/openssl/openssl/crypto/evp/e_sm4.c index 66b087c0201412..f833e755162d74 100644 --- a/deps/openssl/openssl/crypto/evp/e_sm4.c +++ b/deps/openssl/openssl/crypto/evp/e_sm4.c @@ -1,5 +1,5 @@ /* - * Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved. * Copyright 2017 Ribose Inc. All Rights Reserved. * Ported from Ribose contributions from Botan. * @@ -49,12 +49,12 @@ typedef struct { return &sm4_##mode; \ } -#define DEFINE_BLOCK_CIPHERS(nid, flags) \ - BLOCK_CIPHER_generic(nid, 16, 16, cbc, cbc, CBC, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, 16, 0, ecb, ecb, ECB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, 1, 16, ofb128, ofb, OFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, 1, 16, cfb128, cfb, CFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ - BLOCK_CIPHER_generic(nid, 1, 16, ctr, ctr, CTR, flags) +#define DEFINE_BLOCK_CIPHERS(nid, flags) \ + BLOCK_CIPHER_generic(nid, 16, 16, cbc, cbc, CBC, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, 16, 0, ecb, ecb, ECB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, 1, 16, ofb128, ofb, OFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, 1, 16, cfb128, cfb, CFB, flags | EVP_CIPH_FLAG_DEFAULT_ASN1) \ + BLOCK_CIPHER_generic(nid, 1, 16, ctr, ctr, CTR, flags) static int sm4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) diff --git a/deps/openssl/openssl/crypto/evp/encode.c b/deps/openssl/openssl/crypto/evp/encode.c index d554941e7cc497..ceeaea5f114516 100644 --- a/deps/openssl/openssl/crypto/evp/encode.c +++ b/deps/openssl/openssl/crypto/evp/encode.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -689,7 +689,7 @@ static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t, l = ((((unsigned long)a) << 18L) | (((unsigned long)b) << 12L) | (((unsigned long)c) << 6L) | (((unsigned long)d))); if (eof == -1) - eof = (c == '=') + (d == '='); + eof = (f[2] == '=') + (f[3] == '='); switch (eof) { case 2: diff --git a/deps/openssl/openssl/crypto/evp/evp_enc.c b/deps/openssl/openssl/crypto/evp/evp_enc.c index 109412b342b5f5..5584e06d7e38d7 100644 --- a/deps/openssl/openssl/crypto/evp/evp_enc.c +++ b/deps/openssl/openssl/crypto/evp/evp_enc.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -979,11 +979,6 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, size_t soutl, inl_ = (size_t)inl; int blocksize; - if (inl < 0) { - ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH); - return 0; - } - if (ossl_likely(outl != NULL)) { *outl = 0; } else { @@ -1133,11 +1128,6 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, size_t soutl, inl_ = (size_t)inl; int blocksize; - if (inl < 0) { - ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH); - return 0; - } - if (ossl_likely(outl != NULL)) { *outl = 0; } else { diff --git a/deps/openssl/openssl/crypto/evp/kem.c b/deps/openssl/openssl/crypto/evp/kem.c index d0cf696b322048..6c36164760e355 100644 --- a/deps/openssl/openssl/crypto/evp/kem.c +++ b/deps/openssl/openssl/crypto/evp/kem.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -181,7 +181,7 @@ static int evp_kem_init(EVP_PKEY_CTX *ctx, int operation, if (provauthkey != NULL && kem->auth_decapsulate_init != NULL) { ret = kem->auth_decapsulate_init(ctx->op.encap.algctx, provkey, provauthkey, params); - } else if (provauthkey == NULL && kem->decapsulate_init != NULL) { + } else if (provauthkey == NULL && kem->encapsulate_init != NULL) { ret = kem->decapsulate_init(ctx->op.encap.algctx, provkey, params); } else { ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); diff --git a/deps/openssl/openssl/crypto/hashtable/hashtable.c b/deps/openssl/openssl/crypto/hashtable/hashtable.c index 8b9f9cc0d9fd0b..dba05ebe25ced3 100644 --- a/deps/openssl/openssl/crypto/hashtable/hashtable.c +++ b/deps/openssl/openssl/crypto/hashtable/hashtable.c @@ -1,5 +1,5 @@ /* - * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -82,11 +82,9 @@ #if defined(__GNUC__) || defined(__CLANG__) #define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries) #define PREFETCH(x) __builtin_prefetch(x) -#define ALIGN __attribute__((aligned(8))) #else #define PREFETCH_NEIGHBORHOOD(x) #define PREFETCH(x) -#define ALIGN #endif /* @@ -114,7 +112,7 @@ struct ht_internal_value_st { struct ht_neighborhood_entry_st { uint64_t hash; struct ht_internal_value_st *value; -} ALIGN; +}; struct ht_neighborhood_st { struct ht_neighborhood_entry_st entries[NEIGHBORHOOD_LEN]; diff --git a/deps/openssl/openssl/crypto/http/http_client.c b/deps/openssl/openssl/crypto/http/http_client.c index 1e603d870c03df..cc12545fc447c7 100644 --- a/deps/openssl/openssl/crypto/http/http_client.c +++ b/deps/openssl/openssl/crypto/http/http_client.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved. * Copyright Siemens AG 2018-2020 * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -551,7 +551,6 @@ static int may_still_retry(time_t max_time, int *ptimeout) int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx) { int i, found_expected_ct = 0, found_keep_alive = 0; - int status_code = 0; int got_text = 1; long n; size_t resp_len = 0; @@ -752,8 +751,8 @@ int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx) /* First line in response header */ if (rctx->state == OHS_FIRSTLINE) { - status_code = parse_http_line1(buf, &found_keep_alive); - switch (status_code) { + i = parse_http_line1(buf, &found_keep_alive); + switch (i) { case HTTP_STATUS_CODE_OK: rctx->state = OHS_HEADERS; goto next_line; @@ -768,7 +767,7 @@ int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx) /* fall through */ default: /* must return content if status >= 400 */ - rctx->state = status_code < HTTP_STATUS_CODES_NONFATAL_ERROR + rctx->state = i < HTTP_STATUS_CODES_NONFATAL_ERROR ? OHS_HEADERS_ERROR : OHS_HEADERS; goto next_line; /* continue parsing, also on HTTP error */ @@ -798,17 +797,6 @@ int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx) } if (OPENSSL_strcasecmp(key, "Content-Type") == 0) { got_text = HAS_CASE_PREFIX(value, "text/"); - if (got_text - && rctx->state == OHS_HEADERS - && rctx->expect_asn1 - && (status_code >= HTTP_STATUS_CODES_NONFATAL_ERROR - || status_code == HTTP_STATUS_CODE_OK)) { - ERR_raise_data(ERR_LIB_HTTP, HTTP_R_CONTENT_TYPE_MISMATCH, - "expected ASN.1 content but got http code %d with Content-Type: %s", - status_code, value); - rctx->state = OHS_HEADERS_ERROR; - goto next_line; - } if (rctx->state == OHS_HEADERS && rctx->expected_ct != NULL) { const char *semicolon; @@ -1464,11 +1452,7 @@ int OSSL_HTTP_proxy_connect(BIO *bio, const char *server, const char *port, } BIO_push(fbio, bio); - /* Add square brackets around a naked IPv6 address */ - if (server[0] != '[' && strchr(server, ':') != NULL) - BIO_printf(fbio, "CONNECT [%s]:%s " HTTP_1_0 "\r\n", server, port); - else - BIO_printf(fbio, "CONNECT %s:%s " HTTP_1_0 "\r\n", server, port); + BIO_printf(fbio, "CONNECT %s:%s " HTTP_1_0 "\r\n", server, port); /* * Workaround for broken proxies which would otherwise close diff --git a/deps/openssl/openssl/crypto/http/http_err.c b/deps/openssl/openssl/crypto/http/http_err.c index 8598dd1ff48a11..947a403d6009ff 100644 --- a/deps/openssl/openssl/crypto/http/http_err.c +++ b/deps/openssl/openssl/crypto/http/http_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -20,8 +20,6 @@ static const ERR_STRING_DATA HTTP_str_reasons[] = { { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN), "asn1 len exceeds max resp len" }, { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_CONNECT_FAILURE), "connect failure" }, - { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_CONTENT_TYPE_MISMATCH), - "content type mismatch" }, { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_PARSING_ASN1_LENGTH), "error parsing asn1 length" }, { ERR_PACK(ERR_LIB_HTTP, 0, HTTP_R_ERROR_PARSING_CONTENT_LENGTH), diff --git a/deps/openssl/openssl/crypto/http/http_lib.c b/deps/openssl/openssl/crypto/http/http_lib.c index c8ffd87c0620f4..54c5c6ec1d8f3a 100644 --- a/deps/openssl/openssl/crypto/http/http_lib.c +++ b/deps/openssl/openssl/crypto/http/http_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -55,7 +55,6 @@ int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost, char **ppath, char **pquery, char **pfrag) { const char *p, *tmp; - const char *authority_end; const char *scheme, *scheme_end; const char *user, *user_end; const char *host, *host_end; @@ -93,10 +92,7 @@ int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost, /* parse optional "userinfo@" */ user = user_end = host = p; - authority_end = strpbrk(p, "/?#"); - if (authority_end == NULL) - authority_end = p + strlen(p); - host = memchr(p, '@', authority_end - p); + host = strchr(p, '@'); if (host != NULL) user_end = host++; else diff --git a/deps/openssl/openssl/crypto/idea/i_cfb64.c b/deps/openssl/openssl/crypto/idea/i_cfb64.c index 9e95ed7323fe65..c8ed3853285a6f 100644 --- a/deps/openssl/openssl/crypto/idea/i_cfb64.c +++ b/deps/openssl/openssl/crypto/idea/i_cfb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,7 +37,6 @@ void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out, *num = -1; return; } - n = n & 0x07; iv = (unsigned char *)ivec; if (encrypt) { diff --git a/deps/openssl/openssl/crypto/idea/i_ofb64.c b/deps/openssl/openssl/crypto/idea/i_ofb64.c index 64f8469abc607d..afa6a960d4ed9b 100644 --- a/deps/openssl/openssl/crypto/idea/i_ofb64.c +++ b/deps/openssl/openssl/crypto/idea/i_ofb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -39,7 +39,6 @@ void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out, *num = -1; return; } - n = n & 0x07; iv = (unsigned char *)ivec; n2l(iv, v0); diff --git a/deps/openssl/openssl/crypto/init.c b/deps/openssl/openssl/crypto/init.c index ea29645b648c3b..c309b27c5ddaa0 100644 --- a/deps/openssl/openssl/crypto/init.c +++ b/deps/openssl/openssl/crypto/init.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -275,24 +275,27 @@ DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_no_add_all_digests, } static CRYPTO_ONCE config = CRYPTO_ONCE_STATIC_INIT; +static int config_inited = 0; static const OPENSSL_INIT_SETTINGS *conf_settings = NULL; DEFINE_RUN_ONCE_STATIC(ossl_init_config) { int ret = ossl_config_int(NULL); + config_inited = 1; return ret; } DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_config_settings, ossl_init_config) { int ret = ossl_config_int(conf_settings); + config_inited = 1; return ret; } DEFINE_RUN_ONCE_STATIC_ALT(ossl_init_no_config, ossl_init_config) { OSSL_TRACE(INIT, "ossl_no_config_int()\n"); ossl_no_config_int(); - + config_inited = 1; return 1; } diff --git a/deps/openssl/openssl/crypto/initthread.c b/deps/openssl/openssl/crypto/initthread.c index 241fdf85362f6c..b03579d06c750c 100644 --- a/deps/openssl/openssl/crypto/initthread.c +++ b/deps/openssl/openssl/crypto/initthread.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -200,28 +200,16 @@ static void init_thread_destructor(void *hands) } static CRYPTO_ONCE ossl_init_thread_runonce = CRYPTO_ONCE_STATIC_INIT; -/* MSVC linker can use other segment for uninitialized (zeroed) variables */ -#if defined(OPENSSL_SYS_WINDOWS) static CRYPTO_THREAD_ID recursion_guard = (CRYPTO_THREAD_ID)-1; -#elif defined(OPENSSL_SYS_TANDEM) && (defined(_PUT_MODEL_) || defined(_KLT_MODEL_)) -static CRYPTO_THREAD_ID recursion_guard = { (void *)-1, (short)-1, (short)-1 }; -#else -static CRYPTO_THREAD_ID recursion_guard = (CRYPTO_THREAD_ID)0; -#endif DEFINE_RUN_ONCE_STATIC(ossl_init_thread_once) { - /* CRYPTO_THREAD_init_local() can call ossl_init_threads() again */ recursion_guard = CRYPTO_THREAD_get_current_id(); if (!CRYPTO_THREAD_init_local(&destructor_key.value, init_thread_destructor)) return 0; -#if defined(OPENSSL_SYS_TANDEM) - memset(&recursion_guard, 0, sizeof(recursion_guard)); -#else recursion_guard = (CRYPTO_THREAD_ID)0; -#endif return 1; } diff --git a/deps/openssl/openssl/crypto/modes/asm/aes-gcm-ppc.pl b/deps/openssl/openssl/crypto/modes/asm/aes-gcm-ppc.pl index 7355c31cc12970..970283c559f823 100644 --- a/deps/openssl/openssl/crypto/modes/asm/aes-gcm-ppc.pl +++ b/deps/openssl/openssl/crypto/modes/asm/aes-gcm-ppc.pl @@ -409,6 +409,7 @@ ################################################################################ .align 4 aes_gcm_crypt_1x: +.localentry aes_gcm_crypt_1x,0 cmpdi 5, 16 bge __More_1x @@ -491,6 +492,7 @@ ################################################################################ .align 4 __Process_partial: +.localentry __Process_partial,0 # create partial mask vspltisb 16, -1 @@ -562,6 +564,7 @@ .global ppc_aes_gcm_encrypt .align 5 ppc_aes_gcm_encrypt: +.localentry ppc_aes_gcm_encrypt,0 SAVE_REGS LOAD_HASH_TABLE @@ -749,6 +752,7 @@ .global ppc_aes_gcm_decrypt .align 5 ppc_aes_gcm_decrypt: +.localentry ppc_aes_gcm_decrypt, 0 SAVE_REGS LOAD_HASH_TABLE @@ -1028,6 +1032,7 @@ .size ppc_aes_gcm_decrypt,.-ppc_aes_gcm_decrypt aes_gcm_out: +.localentry aes_gcm_out,0 mr 3, 11 # return count diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl index 4ab6d8cb2b42c0..044f86f143f91d 100644 --- a/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2010-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -55,7 +55,7 @@ # Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software # Polynomial Multiplication on ARM Processors using the NEON Engine. # -# https://conradoplg.modp.net/files/2010/12/mocrysen13.pdf +# http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf # ==================================================================== # Note about "528B" variant. In ARM case it makes lesser sense to diff --git a/deps/openssl/openssl/crypto/modes/build.info b/deps/openssl/openssl/crypto/modes/build.info index 9fb2d503d8d6ca..52d2df19c6d9d3 100644 --- a/deps/openssl/openssl/crypto/modes/build.info +++ b/deps/openssl/openssl/crypto/modes/build.info @@ -35,7 +35,7 @@ IF[{- !$disabled{asm} -}] $MODESASM_ppc32=ghashp8-ppc.s $MODESDEF_ppc32= $MODESASM_ppc64=$MODESASM_ppc32 - IF[{- $target{perlasm_scheme} =~ /le$/ -}] + IF[{- $target{sys_id} ne "AIX" && $target{sys_id} ne "MACOSX" -}] $MODESASM_ppc64=$MODESASM_ppc32 aes-gcm-ppc.s ENDIF $MODESDEF_ppc64=$MODESDEF_ppc32 diff --git a/deps/openssl/openssl/crypto/o_str.c b/deps/openssl/openssl/crypto/o_str.c index 154393c7b3e7d0..35540630be25f9 100644 --- a/deps/openssl/openssl/crypto/o_str.c +++ b/deps/openssl/openssl/crypto/o_str.c @@ -1,5 +1,5 @@ /* - * Copyright 2003-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2003-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -296,11 +296,6 @@ static int buf2hexstr_sep(char *str, size_t str_n, size_t *strlength, int has_sep = (sep != CH_ZERO); size_t i, len = has_sep ? buflen * 3 : 1 + buflen * 2; - if (buflen > (has_sep ? SIZE_MAX / 3 : (SIZE_MAX - 1) / 2)) { - ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_BYTES); - return 0; - } - if (len == 0) ++len; if (strlength != NULL) @@ -344,13 +339,7 @@ char *ossl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep) if (buflen == 0) return OPENSSL_zalloc(1); - if ((sep != CH_ZERO && (size_t)buflen > SIZE_MAX / 3) - || (sep == CH_ZERO && (size_t)buflen > (SIZE_MAX - 1) / 2)) { - ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_BYTES); - return NULL; - } - - tmp_n = (sep != CH_ZERO) ? (size_t)buflen * 3 : 1 + (size_t)buflen * 2; + tmp_n = (sep != CH_ZERO) ? buflen * 3 : 1 + buflen * 2; if ((tmp = OPENSSL_malloc(tmp_n)) == NULL) return NULL; diff --git a/deps/openssl/openssl/crypto/param_build.c b/deps/openssl/openssl/crypto/param_build.c index 4e90c581a0eb0b..1eb36953ca5246 100644 --- a/deps/openssl/openssl/crypto/param_build.c +++ b/deps/openssl/openssl/crypto/param_build.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -121,22 +121,12 @@ void OSSL_PARAM_BLD_free(OSSL_PARAM_BLD *bld) int OSSL_PARAM_BLD_push_int(OSSL_PARAM_BLD *bld, const char *key, int num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_INTEGER); } int OSSL_PARAM_BLD_push_uint(OSSL_PARAM_BLD *bld, const char *key, unsigned int num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_UNSIGNED_INTEGER); } @@ -144,22 +134,12 @@ int OSSL_PARAM_BLD_push_uint(OSSL_PARAM_BLD *bld, const char *key, int OSSL_PARAM_BLD_push_long(OSSL_PARAM_BLD *bld, const char *key, long int num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_INTEGER); } int OSSL_PARAM_BLD_push_ulong(OSSL_PARAM_BLD *bld, const char *key, unsigned long int num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_UNSIGNED_INTEGER); } @@ -167,22 +147,12 @@ int OSSL_PARAM_BLD_push_ulong(OSSL_PARAM_BLD *bld, const char *key, int OSSL_PARAM_BLD_push_int32(OSSL_PARAM_BLD *bld, const char *key, int32_t num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_INTEGER); } int OSSL_PARAM_BLD_push_uint32(OSSL_PARAM_BLD *bld, const char *key, uint32_t num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_UNSIGNED_INTEGER); } @@ -190,22 +160,12 @@ int OSSL_PARAM_BLD_push_uint32(OSSL_PARAM_BLD *bld, const char *key, int OSSL_PARAM_BLD_push_int64(OSSL_PARAM_BLD *bld, const char *key, int64_t num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_INTEGER); } int OSSL_PARAM_BLD_push_uint64(OSSL_PARAM_BLD *bld, const char *key, uint64_t num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_UNSIGNED_INTEGER); } @@ -213,11 +173,6 @@ int OSSL_PARAM_BLD_push_uint64(OSSL_PARAM_BLD *bld, const char *key, int OSSL_PARAM_BLD_push_size_t(OSSL_PARAM_BLD *bld, const char *key, size_t num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_UNSIGNED_INTEGER); } @@ -225,11 +180,6 @@ int OSSL_PARAM_BLD_push_size_t(OSSL_PARAM_BLD *bld, const char *key, int OSSL_PARAM_BLD_push_time_t(OSSL_PARAM_BLD *bld, const char *key, time_t num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_INTEGER); } @@ -237,11 +187,6 @@ int OSSL_PARAM_BLD_push_time_t(OSSL_PARAM_BLD *bld, const char *key, int OSSL_PARAM_BLD_push_double(OSSL_PARAM_BLD *bld, const char *key, double num) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - return param_push_num(bld, key, &num, sizeof(num), OSSL_PARAM_REAL); } @@ -251,11 +196,6 @@ static int push_BN(OSSL_PARAM_BLD *bld, const char *key, int n, secure = 0; OSSL_PARAM_BLD_DEF *pd; - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - if (!ossl_assert(type == OSSL_PARAM_UNSIGNED_INTEGER || type == OSSL_PARAM_INTEGER)) return 0; @@ -293,11 +233,6 @@ static int push_BN(OSSL_PARAM_BLD *bld, const char *key, int OSSL_PARAM_BLD_push_BN(OSSL_PARAM_BLD *bld, const char *key, const BIGNUM *bn) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - if (bn != NULL && BN_is_negative(bn)) return push_BN(bld, key, bn, BN_num_bytes(bn) + 1, OSSL_PARAM_INTEGER); @@ -308,11 +243,6 @@ int OSSL_PARAM_BLD_push_BN(OSSL_PARAM_BLD *bld, const char *key, int OSSL_PARAM_BLD_push_BN_pad(OSSL_PARAM_BLD *bld, const char *key, const BIGNUM *bn, size_t sz) { - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - if (bn != NULL && BN_is_negative(bn)) return push_BN(bld, key, bn, BN_num_bytes(bn), OSSL_PARAM_INTEGER); @@ -325,11 +255,6 @@ int OSSL_PARAM_BLD_push_utf8_string(OSSL_PARAM_BLD *bld, const char *key, OSSL_PARAM_BLD_DEF *pd; int secure; - if (bld == NULL || key == NULL || buf == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - if (bsize == 0) bsize = strlen(buf); secure = CRYPTO_secure_allocated(buf); @@ -345,11 +270,6 @@ int OSSL_PARAM_BLD_push_utf8_ptr(OSSL_PARAM_BLD *bld, const char *key, { OSSL_PARAM_BLD_DEF *pd; - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - if (bsize == 0) bsize = strlen(buf); pd = param_push(bld, key, bsize, sizeof(buf), OSSL_PARAM_UTF8_PTR, 0); @@ -365,11 +285,6 @@ int OSSL_PARAM_BLD_push_octet_string(OSSL_PARAM_BLD *bld, const char *key, OSSL_PARAM_BLD_DEF *pd; int secure; - if (bld == NULL || key == NULL || buf == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - secure = CRYPTO_secure_allocated(buf); pd = param_push(bld, key, bsize, bsize, OSSL_PARAM_OCTET_STRING, secure); if (pd == NULL) @@ -383,11 +298,6 @@ int OSSL_PARAM_BLD_push_octet_ptr(OSSL_PARAM_BLD *bld, const char *key, { OSSL_PARAM_BLD_DEF *pd; - if (bld == NULL || key == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - pd = param_push(bld, key, bsize, sizeof(buf), OSSL_PARAM_OCTET_PTR, 0); if (pd == NULL) return 0; @@ -452,18 +362,10 @@ OSSL_PARAM *OSSL_PARAM_BLD_to_param(OSSL_PARAM_BLD *bld) { OSSL_PARAM_ALIGNED_BLOCK *blk, *s = NULL; OSSL_PARAM *params, *last; - int num; - size_t p_blks, total, ss; - - if (bld == NULL) { - ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - num = sk_OSSL_PARAM_BLD_DEF_num(bld->params); - p_blks = ossl_param_bytes_to_blocks((1 + num) * sizeof(*params)); - total = OSSL_PARAM_ALIGN_SIZE * (p_blks + bld->total_blocks); - ss = OSSL_PARAM_ALIGN_SIZE * bld->secure_blocks; + const int num = sk_OSSL_PARAM_BLD_DEF_num(bld->params); + const size_t p_blks = ossl_param_bytes_to_blocks((1 + num) * sizeof(*params)); + const size_t total = OSSL_PARAM_ALIGN_SIZE * (p_blks + bld->total_blocks); + const size_t ss = OSSL_PARAM_ALIGN_SIZE * bld->secure_blocks; if (ss > 0) { s = OPENSSL_secure_malloc(ss); diff --git a/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl b/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl index 94ba8ad759303c..d677963c6176be 100755 --- a/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl +++ b/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -663,7 +663,8 @@ ); # Following constants are defined in x86_64 ABI supplement, for - # example available at https://gitlab.com/x86-psABIs/x86-64-ABI. + # example available at https://www.uclibc.org/docs/psABI-x86_64.pdf, + # see section 3.7 "Stack Unwind Algorithm". my %DW_reg_idx = ( "%rax"=>0, "%rdx"=>1, "%rcx"=>2, "%rbx"=>3, "%rsi"=>4, "%rdi"=>5, "%rbp"=>6, "%rsp"=>7, diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c b/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c index 01956252df76c8..79ed41209c09c9 100644 --- a/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c +++ b/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c @@ -519,8 +519,6 @@ int PKCS12_set_pbmac1_pbkdf2(PKCS12 *p12, const char *pass, int passlen, X509_ALGOR_free(param->messageAuthScheme); param->keyDerivationFunc = alg; param->messageAuthScheme = hmac_alg; - alg = NULL; - hmac_alg = NULL; X509_SIG_getm(p12->mac->dinfo, &macalg, &macoct); if (!ASN1_TYPE_pack_sequence(ASN1_ITEM_rptr(PBMAC1PARAM), param, &macalg->parameter)) @@ -542,8 +540,6 @@ int PKCS12_set_pbmac1_pbkdf2(PKCS12 *p12, const char *pass, int passlen, ret = 1; err: - X509_ALGOR_free(alg); - X509_ALGOR_free(hmac_alg); PBMAC1PARAM_free(param); OPENSSL_free(known_salt); return ret; diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_utl.c b/deps/openssl/openssl/crypto/pkcs12/p12_utl.c index a6f3248c554c94..9360f9930713f5 100644 --- a/deps/openssl/openssl/crypto/pkcs12/p12_utl.c +++ b/deps/openssl/openssl/crypto/pkcs12/p12_utl.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -175,7 +175,7 @@ static int bmp_to_utf8(char *str, const unsigned char *utf16, int len) utf32chr += 0x10000; } - return UTF8_putc((unsigned char *)str, 4, utf32chr); + return UTF8_putc((unsigned char *)str, len > 4 ? 4 : len, utf32chr); } char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen) diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c b/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c index d6513cf3a37994..b180b584818513 100644 --- a/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c +++ b/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c @@ -831,10 +831,6 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) break; case NID_pkcs7_signed: si_sk = p7->d.sign->signer_info; - if (p7->d.sign->contents == NULL) { - ERR_raise(ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT); - goto err; - } os = PKCS7_get_octet_string(p7->d.sign->contents); /* If detached data then the content is excluded */ if (PKCS7_type_is_data(p7->d.sign->contents) && p7->detached) { @@ -845,10 +841,6 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) break; case NID_pkcs7_digest: - if (p7->d.digest->contents == NULL) { - ERR_raise(ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT); - goto err; - } os = PKCS7_get_octet_string(p7->d.digest->contents); /* If detached data then the content is excluded */ if (PKCS7_type_is_data(p7->d.digest->contents) && p7->detached) { diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_lib.c b/deps/openssl/openssl/crypto/pkcs7/pk7_lib.c index 6cd0c3f025c5ce..675c694e66cd67 100644 --- a/deps/openssl/openssl/crypto/pkcs7/pk7_lib.c +++ b/deps/openssl/openssl/crypto/pkcs7/pk7_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -48,8 +48,7 @@ long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg) break; case PKCS7_OP_GET_DETACHED_SIGNATURE: if (nid == NID_pkcs7_signed) { - if (p7->d.sign == NULL || p7->d.sign->contents == NULL - || p7->d.sign->contents->d.ptr == NULL) + if (p7->d.sign == NULL || p7->d.sign->contents->d.ptr == NULL) ret = 1; else ret = 0; @@ -743,10 +742,6 @@ int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7) break; case NID_pkcs7_signed: - if (p7->d.sign == NULL || p7->d.sign->contents == NULL) { - ERR_raise(ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT); - break; - } os = p7->d.sign->contents->d.data; break; diff --git a/deps/openssl/openssl/crypto/punycode.c b/deps/openssl/openssl/crypto/punycode.c index cb78c7f18f3684..18cbccf1ae7a29 100644 --- a/deps/openssl/openssl/crypto/punycode.c +++ b/deps/openssl/openssl/crypto/punycode.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -268,7 +268,7 @@ int ossl_a2ulabel(const char *in, char *out, size_t outlen) return -1; while (1) { - const char *tmpptr = strchr(inptr, '.'); + char *tmpptr = strchr(inptr, '.'); size_t delta = tmpptr != NULL ? (size_t)(tmpptr - inptr) : strlen(inptr); if (!HAS_PREFIX(inptr, "xn--")) { diff --git a/deps/openssl/openssl/crypto/rand/rand_egd.c b/deps/openssl/openssl/crypto/rand/rand_egd.c index aeb9bd0d2384d1..ba8aa34dc2047c 100644 --- a/deps/openssl/openssl/crypto/rand/rand_egd.c +++ b/deps/openssl/openssl/crypto/rand/rand_egd.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -108,13 +108,10 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) { FILE *fp = NULL; struct sockaddr_un addr; - int mybuffer, ret = -1, i, numbytes, fd = -1; + int mybuffer, ret = -1, i, numbytes, fd; unsigned char tempbuf[255]; -#if defined(OPENSSL_SYS_TANDEM) - int hpns_connect_attempt = 0; -#endif - if (bytes <= 0 || bytes > (int)sizeof(tempbuf)) + if (bytes > (int)sizeof(tempbuf)) return -1; /* Make socket. */ @@ -129,8 +126,9 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) #else fd = socket(AF_UNIX, SOCK_STREAM, 0); #endif - if (fd == -1) + if (fd == -1 || (fp = fdopen(fd, "r+")) == NULL) return -1; + setbuf(fp, NULL); /* Try to connect */ for (;;) { @@ -173,14 +171,6 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) } } - /* Create stream only after a successful connect to avoid stale FILE* on fd swap. */ - fp = fdopen(fd, "r+"); - if (fp == NULL) { - close(fd); - return -1; - } - setbuf(fp, NULL); - /* Make request, see how many bytes we can get back. */ tempbuf[0] = 1; tempbuf[1] = bytes; @@ -190,9 +180,6 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) goto err; numbytes = tempbuf[0]; - if (numbytes <= 0 || numbytes > bytes || numbytes > (int)sizeof(tempbuf)) - goto err; - /* Which buffer are we using? */ mybuffer = buf == NULL; if (mybuffer) @@ -209,8 +196,6 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes) err: if (fp != NULL) fclose(fp); - else if (fd != -1) - close(fd); return ret; } diff --git a/deps/openssl/openssl/crypto/rc2/rc2cfb64.c b/deps/openssl/openssl/crypto/rc2/rc2cfb64.c index 0ee6061486d2d0..ccc69fa6bf8daa 100644 --- a/deps/openssl/openssl/crypto/rc2/rc2cfb64.c +++ b/deps/openssl/openssl/crypto/rc2/rc2cfb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -27,7 +27,7 @@ void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, int *num, int encrypt) { register unsigned long v0, v1, t; - register int n = *num & 0x07; + register int n = *num; register long l = length; unsigned long ti[2]; unsigned char *iv, c, cc; diff --git a/deps/openssl/openssl/crypto/rc2/rc2ofb64.c b/deps/openssl/openssl/crypto/rc2/rc2ofb64.c index fdc025bbd8f176..b659b72a1005e9 100644 --- a/deps/openssl/openssl/crypto/rc2/rc2ofb64.c +++ b/deps/openssl/openssl/crypto/rc2/rc2ofb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,7 @@ void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, int *num) { register unsigned long v0, v1, t; - register int n = *num & 0x07; + register int n = *num; register long l = length; unsigned char d[8]; register char *dp; diff --git a/deps/openssl/openssl/crypto/rc5/rc5cfb64.c b/deps/openssl/openssl/crypto/rc5/rc5cfb64.c index a7c447f681d3b1..f2f4b9bdfb3bce 100644 --- a/deps/openssl/openssl/crypto/rc5/rc5cfb64.c +++ b/deps/openssl/openssl/crypto/rc5/rc5cfb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -27,7 +27,7 @@ void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, int *num, int encrypt) { register unsigned long v0, v1, t; - register int n = *num & 0x07; + register int n = *num; register long l = length; unsigned long ti[2]; unsigned char *iv, c, cc; diff --git a/deps/openssl/openssl/crypto/rc5/rc5ofb64.c b/deps/openssl/openssl/crypto/rc5/rc5ofb64.c index 5217303a28d236..30487521f22f42 100644 --- a/deps/openssl/openssl/crypto/rc5/rc5ofb64.c +++ b/deps/openssl/openssl/crypto/rc5/rc5ofb64.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,7 @@ void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, int *num) { register unsigned long v0, v1, t; - register int n = *num & 0x07; + register int n = *num; register long l = length; unsigned char d[8]; register char *dp; diff --git a/deps/openssl/openssl/crypto/riscvcap.c b/deps/openssl/openssl/crypto/riscvcap.c index 64a45d87cec4ed..f6db84bf16b670 100644 --- a/deps/openssl/openssl/crypto/riscvcap.c +++ b/deps/openssl/openssl/crypto/riscvcap.c @@ -1,5 +1,5 @@ /* - * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,6 +26,9 @@ extern size_t riscv_vlen_asm(void); +static void parse_env(const char *envstr); +static void strtoupper(char *str); + static size_t vlen = 0; #ifdef OSSL_RISCV_HWPROBE @@ -47,15 +50,10 @@ size_t OPENSSL_instrument_bus2(unsigned int *out, size_t cnt, size_t max) return 0; } -static void strtoupper(const char *str, char *dst, size_t dstlen) +static void strtoupper(char *str) { - for (size_t i = 0; i < dstlen; i++) { - if (i == dstlen - 1 || str[i] == '\0') { - dst[i] = '\0'; - break; - } - dst[i] = toupper((unsigned char)str[i]); - } + for (char *x = str; *x; ++x) + *x = toupper((unsigned char)*x); } /* parse_env() parses a RISC-V architecture string. An example of such a string @@ -70,24 +68,15 @@ static void parse_env(const char *envstr) char buf[BUFLEN]; /* Convert env str to all uppercase */ - strtoupper(envstr, envstrupper, sizeof(envstrupper)); + OPENSSL_strlcpy(envstrupper, envstr, sizeof(envstrupper)); + strtoupper(envstrupper); for (size_t i = 0; i < kRISCVNumCaps; ++i) { - size_t len = strlen(RISCV_capabilities[i].name); /* Prefix capability with underscore in preparation for search */ - /* - * Avoid using higher level library functions which may require - * library initialization (such as BIO_snprintf) as this may be called - * in a constructor before library initialization - */ - if (len < BUFLEN - 1) { - buf[0] = '_'; - memcpy(buf + 1, RISCV_capabilities[i].name, len); - buf[len + 1] = '\0'; - if (strstr(envstrupper, buf) != NULL) { - /* Match, set relevant bit in OPENSSL_riscvcap_P[] */ - OPENSSL_riscvcap_P[RISCV_capabilities[i].index] |= (1 << RISCV_capabilities[i].bit_offset); - } + BIO_snprintf(buf, BUFLEN, "_%s", RISCV_capabilities[i].name); + if (strstr(envstrupper, buf) != NULL) { + /* Match, set relevant bit in OPENSSL_riscvcap_P[] */ + OPENSSL_riscvcap_P[RISCV_capabilities[i].index] |= (1 << RISCV_capabilities[i].bit_offset); } } } diff --git a/deps/openssl/openssl/crypto/rsa/rsa_backend.c b/deps/openssl/openssl/crypto/rsa/rsa_backend.c index 3cfa4a18be5709..3315c50014fdc6 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_backend.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_backend.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -246,8 +246,6 @@ int ossl_rsa_fromdata(RSA *rsa, const OSSL_PARAM params[], int include_private) BN_free(n); BN_free(e); BN_free(d); - BN_clear_free(p); - BN_clear_free(q); sk_BIGNUM_pop_free(factors, BN_clear_free); sk_BIGNUM_pop_free(exps, BN_clear_free); sk_BIGNUM_pop_free(coeffs, BN_clear_free); diff --git a/deps/openssl/openssl/crypto/sha/asm/keccak1600-s390x.pl b/deps/openssl/openssl/crypto/sha/asm/keccak1600-s390x.pl index 6cf0214bb932f6..7d5ebde117190a 100755 --- a/deps/openssl/openssl/crypto/sha/asm/keccak1600-s390x.pl +++ b/deps/openssl/openssl/crypto/sha/asm/keccak1600-s390x.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright 2017-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -67,7 +67,6 @@ $code.=<<___; .text -.machine "z10" .type __KeccakF1600,\@function .align 32 diff --git a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa.c b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa.c index 41fc494048b4b5..77c20daceb34f8 100644 --- a/deps/openssl/openssl/crypto/slh_dsa/slh_dsa.c +++ b/deps/openssl/openssl/crypto/slh_dsa/slh_dsa.c @@ -1,5 +1,5 @@ /* - * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -119,11 +119,11 @@ static int slh_sign_internal(SLH_DSA_HASH_CTX *hctx, /* Generate ht signature and append to the SLH-DSA signature */ && ossl_slh_ht_sign(hctx, pk_fors, sk_seed, pk_seed, tree_id, leaf_id, wpkt); + *sig_len = sig_len_expected; + ret = 1; err: if (!WPACKET_finish(wpkt)) ret = 0; - if (ret) - *sig_len = sig_len_expected; return ret; } @@ -232,7 +232,6 @@ static uint8_t *msg_encode(const uint8_t *msg, size_t msg_len, const uint8_t *ctx, size_t ctx_len, int encode, uint8_t *tmp, size_t tmp_len, size_t *out_len) { - WPACKET pkt; uint8_t *encoded = NULL; size_t encoded_len; @@ -241,14 +240,11 @@ static uint8_t *msg_encode(const uint8_t *msg, size_t msg_len, *out_len = msg_len; return (uint8_t *)msg; } - if (ctx_len > SLH_DSA_MAX_CONTEXT_STRING_LEN) return NULL; /* Pure encoding */ encoded_len = 1 + 1 + ctx_len + msg_len; - if (encoded_len < msg_len) /* Check for overflow */ - return NULL; *out_len = encoded_len; if (encoded_len <= tmp_len) { encoded = tmp; @@ -257,17 +253,10 @@ static uint8_t *msg_encode(const uint8_t *msg, size_t msg_len, if (encoded == NULL) return NULL; } - if (!WPACKET_init_static_len(&pkt, encoded, encoded_len, 0) - || !WPACKET_put_bytes_u8(&pkt, 0) - || !WPACKET_put_bytes_u8(&pkt, (uint8_t)ctx_len) - || !WPACKET_memcpy(&pkt, ctx, ctx_len) - || !WPACKET_memcpy(&pkt, msg, msg_len) - || !WPACKET_finish(&pkt)) { - if (encoded != tmp) - OPENSSL_free(encoded); - encoded = NULL; - WPACKET_cleanup(&pkt); - } + encoded[0] = 0; + encoded[1] = (uint8_t)ctx_len; + memcpy(&encoded[2], ctx, ctx_len); + memcpy(&encoded[2 + ctx_len], msg, msg_len); return encoded; } diff --git a/deps/openssl/openssl/crypto/sm4/asm/vpsm4_ex-armv8.pl b/deps/openssl/openssl/crypto/sm4/asm/vpsm4_ex-armv8.pl index eac5a0f6a1d81a..e8e33735852ec7 100644 --- a/deps/openssl/openssl/crypto/sm4/asm/vpsm4_ex-armv8.pl +++ b/deps/openssl/openssl/crypto/sm4/asm/vpsm4_ex-armv8.pl @@ -476,13 +476,12 @@ () $code.=<<___; adrp $xtmp2, .Lsbox_magic - add $xtmp2, $xtmp2, #:lo12:.Lsbox_magic - ldr $MaskQ, [$xtmp2] - ldr $TAHMatQ, [$xtmp2, 16] - ldr $TALMatQ, [$xtmp2, 32] - ldr $ATAHMatQ, [$xtmp2, 48] - ldr $ATALMatQ, [$xtmp2, 64] - ldr $ANDMaskQ, [$xtmp2, 80] + ldr $MaskQ, [$xtmp2, #:lo12:.Lsbox_magic] + ldr $TAHMatQ, [$xtmp2, #:lo12:.Lsbox_magic+16] + ldr $TALMatQ, [$xtmp2, #:lo12:.Lsbox_magic+32] + ldr $ATAHMatQ, [$xtmp2, #:lo12:.Lsbox_magic+48] + ldr $ATALMatQ, [$xtmp2, #:lo12:.Lsbox_magic+64] + ldr $ANDMaskQ, [$xtmp2, #:lo12:.Lsbox_magic+80] ___ } diff --git a/deps/openssl/openssl/crypto/store/store_lib.c b/deps/openssl/openssl/crypto/store/store_lib.c index b7a9eaed8f7d56..7c111541388cae 100644 --- a/deps/openssl/openssl/crypto/store/store_lib.c +++ b/deps/openssl/openssl/crypto/store/store_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -498,10 +498,6 @@ int OSSL_STORE_delete(const char *uri, OSSL_LIB_CTX *libctx, const char *propq, int res = 0; struct ossl_passphrase_data_st pwdata = { 0 }; - if (uri == NULL) { - ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } OPENSSL_strlcpy(scheme, uri, sizeof(scheme)); if ((p = strchr(scheme, ':')) != NULL) *p++ = '\0'; diff --git a/deps/openssl/openssl/crypto/threads_none.c b/deps/openssl/openssl/crypto/threads_none.c index fd2ab38d8097d9..1a67d51f29f4e2 100644 --- a/deps/openssl/openssl/crypto/threads_none.c +++ b/deps/openssl/openssl/crypto/threads_none.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -217,7 +217,7 @@ int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key) CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void) { - return 1; + return 0; } int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b) diff --git a/deps/openssl/openssl/crypto/threads_pthread.c b/deps/openssl/openssl/crypto/threads_pthread.c index b4394f78fc1ff6..b1a4a63a2748d9 100644 --- a/deps/openssl/openssl/crypto/threads_pthread.c +++ b/deps/openssl/openssl/crypto/threads_pthread.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -534,9 +534,6 @@ void ossl_rcu_assign_uptr(void **p, void **v) CRYPTO_RCU_LOCK *ossl_rcu_lock_new(int num_writers, OSSL_LIB_CTX *ctx) { struct rcu_lock_st *new; - pthread_mutex_t *mutexes[3] = { NULL }; - pthread_cond_t *conds[2] = { NULL }; - int i; /* * We need a minimum of 2 qp's @@ -553,40 +550,19 @@ CRYPTO_RCU_LOCK *ossl_rcu_lock_new(int num_writers, OSSL_LIB_CTX *ctx) return NULL; new->ctx = ctx; - i = 0; - mutexes[i] = pthread_mutex_init(&new->write_lock, NULL) == 0 ? &new->write_lock : NULL; - if (mutexes[i++] == NULL) - goto err; - mutexes[i] = pthread_mutex_init(&new->prior_lock, NULL) == 0 ? &new->prior_lock : NULL; - if (mutexes[i++] == NULL) - goto err; - mutexes[i] = pthread_mutex_init(&new->alloc_lock, NULL) == 0 ? &new->alloc_lock : NULL; - if (mutexes[i++] == NULL) - goto err; - conds[i - 3] = pthread_cond_init(&new->prior_signal, NULL) == 0 ? &new->prior_signal : NULL; - if (conds[i - 3] == NULL) - goto err; - i++; - conds[i - 3] = pthread_cond_init(&new->alloc_signal, NULL) == 0 ? &new->alloc_signal : NULL; - if (conds[i - 3] == NULL) - goto err; - i++; + pthread_mutex_init(&new->write_lock, NULL); + pthread_mutex_init(&new->prior_lock, NULL); + pthread_mutex_init(&new->alloc_lock, NULL); + pthread_cond_init(&new->prior_signal, NULL); + pthread_cond_init(&new->alloc_signal, NULL); + new->qp_group = allocate_new_qp_group(new, num_writers); - if (new->qp_group == NULL) - goto err; + if (new->qp_group == NULL) { + OPENSSL_free(new); + new = NULL; + } return new; - -err: - for (i = 0; i < 3; i++) - if (mutexes[i] != NULL) - pthread_mutex_destroy(mutexes[i]); - for (i = 0; i < 2; i++) - if (conds[i] != NULL) - pthread_cond_destroy(conds[i]); - OPENSSL_free(new->qp_group); - OPENSSL_free(new); - return NULL; } void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock) @@ -600,17 +576,6 @@ void ossl_rcu_lock_free(CRYPTO_RCU_LOCK *lock) ossl_synchronize_rcu(rlock); OPENSSL_free(rlock->qp_group); - /* - * Some targets (BSD) allocate heap when initializing - * a mutex or condition, to prevent leaks, those need - * to be destroyed here - */ - pthread_mutex_destroy(&rlock->write_lock); - pthread_mutex_destroy(&rlock->prior_lock); - pthread_mutex_destroy(&rlock->alloc_lock); - pthread_cond_destroy(&rlock->prior_signal); - pthread_cond_destroy(&rlock->alloc_signal); - /* There should only be a single qp left now */ OPENSSL_free(rlock); } diff --git a/deps/openssl/openssl/crypto/threads_win.c b/deps/openssl/openssl/crypto/threads_win.c index 795d97a012eb3a..51d489cdf03b9f 100644 --- a/deps/openssl/openssl/crypto/threads_win.c +++ b/deps/openssl/openssl/crypto/threads_win.c @@ -1,5 +1,5 @@ /* - * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -50,7 +50,7 @@ typedef struct { * atomically updated */ struct rcu_qp { - uint64_t users; + volatile uint64_t users; }; struct thread_qp { diff --git a/deps/openssl/openssl/crypto/ts/ts_asn1.c b/deps/openssl/openssl/crypto/ts/ts_asn1.c index 494e4e69d71068..93a741d04d7498 100644 --- a/deps/openssl/openssl/crypto/ts/ts_asn1.c +++ b/deps/openssl/openssl/crypto/ts/ts_asn1.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -17,7 +17,7 @@ ASN1_SEQUENCE(TS_MSG_IMPRINT) = { ASN1_SIMPLE(TS_MSG_IMPRINT, hashed_msg, ASN1_OCTET_STRING) } static_ASN1_SEQUENCE_END(TS_MSG_IMPRINT) -IMPLEMENT_ASN1_FUNCTIONS(TS_MSG_IMPRINT) + IMPLEMENT_ASN1_FUNCTIONS(TS_MSG_IMPRINT) IMPLEMENT_ASN1_DUP_FUNCTION(TS_MSG_IMPRINT) TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *bp, TS_MSG_IMPRINT **a) { @@ -51,7 +51,7 @@ ASN1_SEQUENCE(TS_REQ) = { ASN1_IMP_SEQUENCE_OF_OPT(TS_REQ, extensions, X509_EXTENSION, 0) } static_ASN1_SEQUENCE_END(TS_REQ) -IMPLEMENT_ASN1_FUNCTIONS(TS_REQ) + IMPLEMENT_ASN1_FUNCTIONS(TS_REQ) IMPLEMENT_ASN1_DUP_FUNCTION(TS_REQ) TS_REQ *d2i_TS_REQ_bio(BIO *bp, TS_REQ **a) { @@ -80,7 +80,7 @@ ASN1_SEQUENCE(TS_ACCURACY) = { ASN1_IMP_OPT(TS_ACCURACY, micros, ASN1_INTEGER, 1) } static_ASN1_SEQUENCE_END(TS_ACCURACY) -IMPLEMENT_ASN1_FUNCTIONS(TS_ACCURACY) + IMPLEMENT_ASN1_FUNCTIONS(TS_ACCURACY) IMPLEMENT_ASN1_DUP_FUNCTION(TS_ACCURACY) ASN1_SEQUENCE(TS_TST_INFO) = { @@ -96,7 +96,7 @@ ASN1_SEQUENCE(TS_TST_INFO) = { ASN1_IMP_SEQUENCE_OF_OPT(TS_TST_INFO, extensions, X509_EXTENSION, 1) } static_ASN1_SEQUENCE_END(TS_TST_INFO) -IMPLEMENT_ASN1_FUNCTIONS(TS_TST_INFO) + IMPLEMENT_ASN1_FUNCTIONS(TS_TST_INFO) IMPLEMENT_ASN1_DUP_FUNCTION(TS_TST_INFO) TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *bp, TS_TST_INFO **a) { @@ -127,7 +127,7 @@ ASN1_SEQUENCE(TS_STATUS_INFO) = { ASN1_OPT(TS_STATUS_INFO, failure_info, ASN1_BIT_STRING) } static_ASN1_SEQUENCE_END(TS_STATUS_INFO) -IMPLEMENT_ASN1_FUNCTIONS(TS_STATUS_INFO) + IMPLEMENT_ASN1_FUNCTIONS(TS_STATUS_INFO) IMPLEMENT_ASN1_DUP_FUNCTION(TS_STATUS_INFO) static int ts_resp_set_tst_info(TS_RESP *a) @@ -175,7 +175,7 @@ ASN1_SEQUENCE_cb(TS_RESP, ts_resp_cb) = { ASN1_OPT(TS_RESP, token, PKCS7), } static_ASN1_SEQUENCE_END_cb(TS_RESP, TS_RESP) -IMPLEMENT_ASN1_FUNCTIONS(TS_RESP) + IMPLEMENT_ASN1_FUNCTIONS(TS_RESP) IMPLEMENT_ASN1_DUP_FUNCTION(TS_RESP) diff --git a/deps/openssl/openssl/crypto/x509/pcy_tree.c b/deps/openssl/openssl/crypto/x509/pcy_tree.c index f9d9990bd1d169..1d91e49cece136 100644 --- a/deps/openssl/openssl/crypto/x509/pcy_tree.c +++ b/deps/openssl/openssl/crypto/x509/pcy_tree.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2004-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -680,10 +680,8 @@ int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, } else { *pexplicit_policy = 1; /* Tree empty and requireExplicit True: Error */ - if (init_ret & X509_PCY_TREE_EMPTY) { - X509_policy_tree_free(tree); + if (init_ret & X509_PCY_TREE_EMPTY) return X509_PCY_TREE_FAILURE; - } } ret = tree_evaluate(tree); @@ -709,15 +707,13 @@ int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, if (!ret) goto error; + *ptree = tree; + if (init_ret & X509_PCY_TREE_EXPLICIT) { nodes = X509_policy_tree_get0_user_policies(tree); - if (sk_X509_POLICY_NODE_num(nodes) <= 0) { - X509_policy_tree_free(tree); + if (sk_X509_POLICY_NODE_num(nodes) <= 0) return X509_PCY_TREE_FAILURE; - } } - - *ptree = tree; return X509_PCY_TREE_VALID; error: diff --git a/deps/openssl/openssl/crypto/x509/t_acert.c b/deps/openssl/openssl/crypto/x509/t_acert.c index 1ef7fab682bbec..1ee6b9eacb05fe 100644 --- a/deps/openssl/openssl/crypto/x509/t_acert.c +++ b/deps/openssl/openssl/crypto/x509/t_acert.c @@ -1,5 +1,5 @@ /* - * Copyright 2021-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -62,10 +62,8 @@ static int print_attribute(BIO *bp, X509_ATTRIBUTE *a) case V_ASN1_SEQUENCE: if (BIO_puts(bp, "\n") <= 0) goto err; - if (ASN1_parse_dump(bp, at->value.sequence->data, - at->value.sequence->length, i, 1) - <= 0) - goto err; + ASN1_parse_dump(bp, at->value.sequence->data, + at->value.sequence->length, i, 1); break; default: if (BIO_printf(bp, "unable to print attribute of type 0x%X\n", diff --git a/deps/openssl/openssl/crypto/x509/v3_ac_tgt.c b/deps/openssl/openssl/crypto/x509/v3_ac_tgt.c index b819f7659551f8..4fe14070369a1e 100644 --- a/deps/openssl/openssl/crypto/x509/v3_ac_tgt.c +++ b/deps/openssl/openssl/crypto/x509/v3_ac_tgt.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -41,7 +41,7 @@ ASN1_SEQUENCE(OSSL_ISSUER_SERIAL) = { ASN1_OPT(OSSL_ISSUER_SERIAL, issuerUID, ASN1_BIT_STRING), } static_ASN1_SEQUENCE_END(OSSL_ISSUER_SERIAL) -ASN1_SEQUENCE(OSSL_OBJECT_DIGEST_INFO) + ASN1_SEQUENCE(OSSL_OBJECT_DIGEST_INFO) = { ASN1_EMBED(OSSL_OBJECT_DIGEST_INFO, digestedObjectType, ASN1_ENUMERATED), ASN1_OPT(OSSL_OBJECT_DIGEST_INFO, otherObjectTypeID, ASN1_OBJECT), @@ -49,14 +49,14 @@ ASN1_SEQUENCE(OSSL_OBJECT_DIGEST_INFO) ASN1_EMBED(OSSL_OBJECT_DIGEST_INFO, objectDigest, ASN1_BIT_STRING), } static_ASN1_SEQUENCE_END(OSSL_OBJECT_DIGEST_INFO) -ASN1_SEQUENCE(OSSL_TARGET_CERT) + ASN1_SEQUENCE(OSSL_TARGET_CERT) = { ASN1_SIMPLE(OSSL_TARGET_CERT, targetCertificate, OSSL_ISSUER_SERIAL), ASN1_OPT(OSSL_TARGET_CERT, targetName, GENERAL_NAME), ASN1_OPT(OSSL_TARGET_CERT, certDigestInfo, OSSL_OBJECT_DIGEST_INFO), } static_ASN1_SEQUENCE_END(OSSL_TARGET_CERT) -ASN1_CHOICE(OSSL_TARGET) + ASN1_CHOICE(OSSL_TARGET) = { ASN1_EXP(OSSL_TARGET, choice.targetName, GENERAL_NAME, 0), ASN1_EXP(OSSL_TARGET, choice.targetGroup, GENERAL_NAME, 1), diff --git a/deps/openssl/openssl/crypto/x509/v3_cpols.c b/deps/openssl/openssl/crypto/x509/v3_cpols.c index c5a638e8a39677..ab37f9dff62501 100644 --- a/deps/openssl/openssl/crypto/x509/v3_cpols.c +++ b/deps/openssl/openssl/crypto/x509/v3_cpols.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -256,7 +256,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx, static int displaytext_get_tag_len(const char *tagstr) { - const char *colon = strchr(tagstr, ':'); + char *colon = strchr(tagstr, ':'); return (colon == NULL) ? -1 : colon - tagstr; } diff --git a/deps/openssl/openssl/crypto/x509/v3_prn.c b/deps/openssl/openssl/crypto/x509/v3_prn.c index 1992344d85bebb..088cffed69f016 100644 --- a/deps/openssl/openssl/crypto/x509/v3_prn.c +++ b/deps/openssl/openssl/crypto/x509/v3_prn.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -191,9 +191,9 @@ static int unknown_ext_print(BIO *out, const unsigned char *ext, int extlen, return 1; case X509V3_EXT_PARSE_UNKNOWN: - return ASN1_parse_dump(out, ext, extlen, indent, -1) > 0; + return ASN1_parse_dump(out, ext, extlen, indent, -1); case X509V3_EXT_DUMP_UNKNOWN: - return BIO_dump_indent(out, (const char *)ext, extlen, indent) > 0; + return BIO_dump_indent(out, (const char *)ext, extlen, indent); default: return 1; diff --git a/deps/openssl/openssl/crypto/x509/v3_san.c b/deps/openssl/openssl/crypto/x509/v3_san.c index 2674b33cc56507..76170bcb95163d 100644 --- a/deps/openssl/openssl/crypto/x509/v3_san.c +++ b/deps/openssl/openssl/crypto/x509/v3_san.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -630,8 +630,7 @@ GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx) { - char *objtmp = NULL; - const char *p; + char *objtmp = NULL, *p; int objlen; if ((p = strchr(value, ';')) == NULL) diff --git a/deps/openssl/openssl/crypto/x509/v3_timespec.c b/deps/openssl/openssl/crypto/x509/v3_timespec.c index 4b7b07c3d0d0f1..c23b94ad085fe9 100644 --- a/deps/openssl/openssl/crypto/x509/v3_timespec.c +++ b/deps/openssl/openssl/crypto/x509/v3_timespec.c @@ -1,5 +1,5 @@ /* - * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -167,7 +167,7 @@ static int i2r_OSSL_DAY_TIME(X509V3_EXT_METHOD *method, return 0; if (dt->minute && !ASN1_INTEGER_get_int64(&m, dt->minute)) return 0; - if (dt->second && !ASN1_INTEGER_get_int64(&s, dt->second)) + if (dt->minute && !ASN1_INTEGER_get_int64(&s, dt->second)) return 0; return BIO_printf(out, "%02lld:%02lld:%02lld", (long long int)h, (long long int)m, (long long int)s) diff --git a/deps/openssl/openssl/crypto/x509/v3_utl.c b/deps/openssl/openssl/crypto/x509/v3_utl.c index 99780cf4a32b32..a3ee50e5cee79b 100644 --- a/deps/openssl/openssl/crypto/x509/v3_utl.c +++ b/deps/openssl/openssl/crypto/x509/v3_utl.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -1120,16 +1120,15 @@ ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc) ASN1_OCTET_STRING *ret = NULL; unsigned char ipout[32]; char *iptmp = NULL, *p; - const char *slash; int iplen1, iplen2; - slash = strchr(ipasc, '/'); - if (slash == NULL) + p = strchr(ipasc, '/'); + if (p == NULL) return NULL; iptmp = OPENSSL_strdup(ipasc); if (iptmp == NULL) return NULL; - p = iptmp + (slash - ipasc); + p = iptmp + (p - ipasc); *p++ = 0; iplen1 = ossl_a2i_ipadd(ipout, iptmp); diff --git a/deps/openssl/openssl/crypto/x509/x509_vfy.c b/deps/openssl/openssl/crypto/x509/x509_vfy.c index 0994c32ca53360..20c012def2f3ff 100644 --- a/deps/openssl/openssl/crypto/x509/x509_vfy.c +++ b/deps/openssl/openssl/crypto/x509/x509_vfy.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -1123,7 +1123,6 @@ static int check_cert(X509_STORE_CTX *ctx) goto done; } - ctx->current_crl = NULL; X509_CRL_free(crl); X509_CRL_free(dcrl); crl = NULL; @@ -1308,8 +1307,6 @@ static int check_delta_base(X509_CRL *delta, X509_CRL *base) if (ASN1_INTEGER_cmp(delta->base_crl_number, base->crl_number) > 0) return 0; /* Delta CRL number must exceed full CRL number */ - if (delta->crl_number == NULL) - return 0; return ASN1_INTEGER_cmp(delta->crl_number, base->crl_number) > 0; } @@ -3018,7 +3015,7 @@ static int dane_match_cert(X509_STORE_CTX *ctx, X509 *cert, int depth) break; } - X509_free(dane->mcert); + OPENSSL_free(dane->mcert); dane->mcert = cert; dane->mdpth = depth; dane->mtlsa = t; diff --git a/deps/openssl/openssl/crypto/x509/x_pubkey.c b/deps/openssl/openssl/crypto/x509/x_pubkey.c index 03f532ab9cb379..4c75560ef2489b 100644 --- a/deps/openssl/openssl/crypto/x509/x_pubkey.c +++ b/deps/openssl/openssl/crypto/x509/x_pubkey.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -65,8 +65,8 @@ ASN1_SEQUENCE(X509_PUBKEY_INTERNAL) = { ASN1_SIMPLE(X509_PUBKEY, public_key, ASN1_BIT_STRING) } static_ASN1_SEQUENCE_END_name(X509_PUBKEY, X509_PUBKEY_INTERNAL) -X509_PUBKEY -*ossl_d2i_X509_PUBKEY_INTERNAL(const unsigned char **pp, long len, OSSL_LIB_CTX *libctx, const char *propq) + X509_PUBKEY + * ossl_d2i_X509_PUBKEY_INTERNAL(const unsigned char **pp, long len, OSSL_LIB_CTX *libctx, const char *propq) { X509_PUBKEY *xpub = OPENSSL_zalloc(sizeof(*xpub)); diff --git a/deps/openssl/openssl/doc/build.info b/deps/openssl/openssl/doc/build.info index eb4492ba9c7530..bb1f00f49b762c 100644 --- a/deps/openssl/openssl/doc/build.info +++ b/deps/openssl/openssl/doc/build.info @@ -2903,10 +2903,6 @@ DEPEND[html/man3/UI_new.html]=man3/UI_new.pod GENERATE[html/man3/UI_new.html]=man3/UI_new.pod DEPEND[man/man3/UI_new.3]=man3/UI_new.pod GENERATE[man/man3/UI_new.3]=man3/UI_new.pod -DEPEND[html/man3/X509V3_EXT_print.html]=man3/X509V3_EXT_print.pod -GENERATE[html/man3/X509V3_EXT_print.html]=man3/X509V3_EXT_print.pod -DEPEND[man/man3/X509V3_EXT_print.3]=man3/X509V3_EXT_print.pod -GENERATE[man/man3/X509V3_EXT_print.3]=man3/X509V3_EXT_print.pod DEPEND[html/man3/X509V3_get_d2i.html]=man3/X509V3_get_d2i.pod GENERATE[html/man3/X509V3_get_d2i.html]=man3/X509V3_get_d2i.pod DEPEND[man/man3/X509V3_get_d2i.3]=man3/X509V3_get_d2i.pod @@ -3791,7 +3787,6 @@ html/man3/UI_STRING.html \ html/man3/UI_UTIL_read_pw.html \ html/man3/UI_create_method.html \ html/man3/UI_new.html \ -html/man3/X509V3_EXT_print.html \ html/man3/X509V3_get_d2i.html \ html/man3/X509V3_set_ctx.html \ html/man3/X509_ACERT_add1_attr.html \ @@ -4468,7 +4463,6 @@ man/man3/UI_STRING.3 \ man/man3/UI_UTIL_read_pw.3 \ man/man3/UI_create_method.3 \ man/man3/UI_new.3 \ -man/man3/X509V3_EXT_print.3 \ man/man3/X509V3_get_d2i.3 \ man/man3/X509V3_set_ctx.3 \ man/man3/X509_ACERT_add1_attr.3 \ diff --git a/deps/openssl/openssl/exporters/cmake/OpenSSLConfig.cmake.in b/deps/openssl/openssl/exporters/cmake/OpenSSLConfig.cmake.in index 125b94704a2be3..c023e78eafb932 100644 --- a/deps/openssl/openssl/exporters/cmake/OpenSSLConfig.cmake.in +++ b/deps/openssl/openssl/exporters/cmake/OpenSSLConfig.cmake.in @@ -1,5 +1,4 @@ # Generated by OpenSSL -# {- $OpenSSL::safe::installdata::COMMENT // "" -} {- use lib catdir($config{sourcedir}, 'Configurations'); use platform; diff --git a/deps/openssl/openssl/exporters/cmake/OpenSSLConfigVersion.cmake.in b/deps/openssl/openssl/exporters/cmake/OpenSSLConfigVersion.cmake.in index 15bae5697220d6..b1290a9eec76f0 100644 --- a/deps/openssl/openssl/exporters/cmake/OpenSSLConfigVersion.cmake.in +++ b/deps/openssl/openssl/exporters/cmake/OpenSSLConfigVersion.cmake.in @@ -1,5 +1,4 @@ # Generated by OpenSSL -# {- $OpenSSL::safe::installdata::COMMENT // "" -} set(PACKAGE_VERSION {- $config{version} -}) diff --git a/deps/openssl/openssl/exporters/pkg-config/libcrypto.pc.in b/deps/openssl/openssl/exporters/pkg-config/libcrypto.pc.in index eb6adffa911f4f..3d56e9741831ab 100644 --- a/deps/openssl/openssl/exporters/pkg-config/libcrypto.pc.in +++ b/deps/openssl/openssl/exporters/pkg-config/libcrypto.pc.in @@ -1,4 +1,3 @@ -# {- $OpenSSL::safe::installdata::COMMENT // "" -} prefix={- $OpenSSL::safe::installdata::PREFIX[0] -} exec_prefix=${prefix} libdir={- if (defined $OpenSSL::safe::installdata::LIBDIR_REL_PREFIX[0]) { diff --git a/deps/openssl/openssl/exporters/pkg-config/libssl.pc.in b/deps/openssl/openssl/exporters/pkg-config/libssl.pc.in index 53228dde4a08cd..162db65c99a2af 100644 --- a/deps/openssl/openssl/exporters/pkg-config/libssl.pc.in +++ b/deps/openssl/openssl/exporters/pkg-config/libssl.pc.in @@ -1,4 +1,3 @@ -# {- $OpenSSL::safe::installdata::COMMENT // "" -} prefix={- $OpenSSL::safe::installdata::PREFIX[0] -} exec_prefix=${prefix} libdir={- if (defined $OpenSSL::safe::installdata::LIBDIR_REL_PREFIX[0]) { diff --git a/deps/openssl/openssl/exporters/pkg-config/openssl.pc.in b/deps/openssl/openssl/exporters/pkg-config/openssl.pc.in index fd3bc9ac86c48d..73eb8e73c2d27d 100644 --- a/deps/openssl/openssl/exporters/pkg-config/openssl.pc.in +++ b/deps/openssl/openssl/exporters/pkg-config/openssl.pc.in @@ -1,4 +1,3 @@ -# {- $OpenSSL::safe::installdata::COMMENT // "" -} prefix={- $OpenSSL::safe::installdata::PREFIX[0] -} exec_prefix=${prefix} libdir={- if (defined $OpenSSL::safe::installdata::LIBDIR_REL_PREFIX[0]) { diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.56/lib/Text/Template.pm b/deps/openssl/openssl/external/perl/Text-Template-1.56/lib/Text/Template.pm index dec5b61419d15e..be38c73ce457f5 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.56/lib/Text/Template.pm +++ b/deps/openssl/openssl/external/perl/Text-Template-1.56/lib/Text/Template.pm @@ -2337,8 +2337,8 @@ There are not quite enough tests in the test suite. =head1 SOURCE -The development version is on github at L -and may be cloned from L +The development version is on github at L +and may be cloned from L =head1 BUGS diff --git a/deps/openssl/openssl/external/perl/Text-Template-1.56/lib/Text/Template/Preprocess.pm b/deps/openssl/openssl/external/perl/Text-Template-1.56/lib/Text/Template/Preprocess.pm index b4f7d53ebaad37..4fea67b383130d 100644 --- a/deps/openssl/openssl/external/perl/Text-Template-1.56/lib/Text/Template/Preprocess.pm +++ b/deps/openssl/openssl/external/perl/Text-Template-1.56/lib/Text/Template/Preprocess.pm @@ -122,8 +122,8 @@ L =head1 SOURCE -The development version is on github at L -and may be cloned from L +The development version is on github at L +and may be cloned from L =head1 BUGS diff --git a/deps/openssl/openssl/include/crypto/aes_platform.h b/deps/openssl/openssl/include/crypto/aes_platform.h index 28beba8efb98d9..a6765d20d8565d 100644 --- a/deps/openssl/openssl/include/crypto/aes_platform.h +++ b/deps/openssl/openssl/include/crypto/aes_platform.h @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -77,9 +77,7 @@ void AES_xts_decrypt(const unsigned char *inp, unsigned char *out, size_t len, #define HWAES_xts_decrypt aes_p8_xts_decrypt #endif /* OPENSSL_SYS_MACOSX */ #if !defined(OPENSSL_SYS_AIX) && !defined(OPENSSL_SYS_MACOSX) -#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #define PPC_AES_GCM_CAPABLE (OPENSSL_ppccap_P & PPC_MADD300) -#endif #define AES_GCM_ENC_BYTES 128 #define AES_GCM_DEC_BYTES 128 size_t ppc_aes_gcm_encrypt(const unsigned char *in, unsigned char *out, diff --git a/deps/openssl/openssl/include/crypto/evp.h b/deps/openssl/openssl/include/crypto/evp.h index 443bfe8141a3d6..456a64c943b1f6 100644 --- a/deps/openssl/openssl/include/crypto/evp.h +++ b/deps/openssl/openssl/include/crypto/evp.h @@ -1,5 +1,5 @@ /* - * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -488,17 +488,17 @@ struct evp_cipher_st { BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \ 0, flags, init_key, cleanup, set_asn1, get_asn1, ctrl) -#define BLOCK_CIPHER_defs(cname, kstruct, \ - nid, block_size, key_len, iv_len, cbits, flags, \ - init_key, cleanup, set_asn1, get_asn1, ctrl) \ - BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \ - init_key, cleanup, set_asn1, get_asn1, ctrl) \ - BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \ - flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \ - BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \ - flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \ - BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, \ - init_key, cleanup, set_asn1, get_asn1, ctrl) +#define BLOCK_CIPHER_defs(cname, kstruct, \ + nid, block_size, key_len, iv_len, cbits, flags, \ + init_key, cleanup, set_asn1, get_asn1, ctrl) \ + BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \ + init_key, cleanup, set_asn1, get_asn1, ctrl) \ + BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \ + flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \ + BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \ + flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \ + BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, \ + init_key, cleanup, set_asn1, get_asn1, ctrl) /*- #define BLOCK_CIPHER_defs(cname, kstruct, \ diff --git a/deps/openssl/openssl/include/crypto/httperr.h b/deps/openssl/openssl/include/crypto/httperr.h index 94d812295cd923..f5550aa167fa6a 100644 --- a/deps/openssl/openssl/include/crypto/httperr.h +++ b/deps/openssl/openssl/include/crypto/httperr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy diff --git a/deps/openssl/openssl/include/crypto/sparc_arch.h b/deps/openssl/openssl/include/crypto/sparc_arch.h index 6d47505ae96f75..8e72c3504f7a76 100644 --- a/deps/openssl/openssl/include/crypto/sparc_arch.h +++ b/deps/openssl/openssl/include/crypto/sparc_arch.h @@ -1,5 +1,5 @@ /* - * Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2012-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -79,14 +79,10 @@ #if defined(__arch64__) -/* clang-format off */ #define SPARC_LOAD_ADDRESS(SYM, reg) \ - setx SYM, %o7, reg; -/* clang-format on */ + setx SYM, % o7, reg; #define LDPTR ldx -/* clang-format off */ -#define SIZE_T_CC %xcc -/* clang-format on */ +#define SIZE_T_CC % xcc #define STACK_FRAME 192 #define STACK_BIAS 2047 #define STACK_7thARG (STACK_BIAS + 176) @@ -96,9 +92,7 @@ #define SPARC_LOAD_ADDRESS(SYM, reg) \ set SYM, reg; #define LDPTR ld -/* clang-format off */ -#define SIZE_T_CC %icc -/* clang-format on */ +#define SIZE_T_CC % icc #define STACK_FRAME 112 #define STACK_BIAS 0 #define STACK_7thARG 92 diff --git a/deps/openssl/openssl/include/crypto/sparse_array.h b/deps/openssl/openssl/include/crypto/sparse_array.h index 6529b4615132b4..d2629000eeafcd 100644 --- a/deps/openssl/openssl/include/crypto/sparse_array.h +++ b/deps/openssl/openssl/include/crypto/sparse_array.h @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -62,7 +62,7 @@ extern "C" { } \ static ossl_unused ossl_inline int \ ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) * sa, \ - ossl_uintmax_t n, ctype *val) \ + ossl_uintmax_t n, ctype * val) \ { \ return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \ } \ diff --git a/deps/openssl/openssl/include/internal/time.h b/deps/openssl/openssl/include/internal/time.h index db182484277267..2a54c491f16ff1 100644 --- a/deps/openssl/openssl/include/internal/time.h +++ b/deps/openssl/openssl/include/internal/time.h @@ -1,5 +1,5 @@ /* - * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -54,8 +54,9 @@ typedef struct { OSSL_SAFE_MATH_UNSIGNED(time, uint64_t) /* Convert a tick count into a time */ -static ossl_unused ossl_inline OSSL_TIME -ossl_ticks2time(uint64_t ticks) +static ossl_unused ossl_inline + OSSL_TIME + ossl_ticks2time(uint64_t ticks) { OSSL_TIME r; @@ -64,8 +65,9 @@ ossl_ticks2time(uint64_t ticks) } /* Convert a time to a tick count */ -static ossl_unused ossl_inline uint64_t -ossl_time2ticks(OSSL_TIME t) +static ossl_unused ossl_inline + uint64_t + ossl_time2ticks(OSSL_TIME t) { return t.t; } @@ -74,14 +76,16 @@ ossl_time2ticks(OSSL_TIME t) OSSL_TIME ossl_time_now(void); /* The beginning and end of the time range */ -static ossl_unused ossl_inline OSSL_TIME -ossl_time_zero(void) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_zero(void) { return ossl_ticks2time(0); } -static ossl_unused ossl_inline OSSL_TIME -ossl_time_infinite(void) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_infinite(void) { return ossl_ticks2time(~(uint64_t)0); } @@ -110,8 +114,9 @@ static ossl_unused ossl_inline struct timeval ossl_time_to_timeval(OSSL_TIME t) } /* Convert timeval to time */ -static ossl_unused ossl_inline OSSL_TIME -ossl_time_from_timeval(struct timeval tv) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_from_timeval(struct timeval tv) { OSSL_TIME t; @@ -132,8 +137,9 @@ static ossl_unused ossl_inline } /* Convert time_t to OSSL_TIME */ -static ossl_unused ossl_inline OSSL_TIME -ossl_time_from_time_t(time_t t) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_from_time_t(time_t t) { OSSL_TIME ot; @@ -164,8 +170,9 @@ static ossl_unused ossl_inline int ossl_time_is_infinite(OSSL_TIME t) return ossl_time_compare(t, ossl_time_infinite()) == 0; } -static ossl_unused ossl_inline OSSL_TIME -ossl_time_add(OSSL_TIME a, OSSL_TIME b) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_add(OSSL_TIME a, OSSL_TIME b) { OSSL_TIME r; int err = 0; @@ -174,8 +181,9 @@ ossl_time_add(OSSL_TIME a, OSSL_TIME b) return err ? ossl_time_infinite() : r; } -static ossl_unused ossl_inline OSSL_TIME -ossl_time_subtract(OSSL_TIME a, OSSL_TIME b) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_subtract(OSSL_TIME a, OSSL_TIME b) { OSSL_TIME r; int err = 0; @@ -185,15 +193,17 @@ ossl_time_subtract(OSSL_TIME a, OSSL_TIME b) } /* Returns |a - b|. */ -static ossl_unused ossl_inline OSSL_TIME -ossl_time_abs_difference(OSSL_TIME a, OSSL_TIME b) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_abs_difference(OSSL_TIME a, OSSL_TIME b) { return a.t > b.t ? ossl_time_subtract(a, b) : ossl_time_subtract(b, a); } -static ossl_unused ossl_inline OSSL_TIME -ossl_time_multiply(OSSL_TIME a, uint64_t b) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_multiply(OSSL_TIME a, uint64_t b) { OSSL_TIME r; int err = 0; @@ -202,8 +212,9 @@ ossl_time_multiply(OSSL_TIME a, uint64_t b) return err ? ossl_time_infinite() : r; } -static ossl_unused ossl_inline OSSL_TIME -ossl_time_divide(OSSL_TIME a, uint64_t b) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_divide(OSSL_TIME a, uint64_t b) { OSSL_TIME r; int err = 0; @@ -212,8 +223,9 @@ ossl_time_divide(OSSL_TIME a, uint64_t b) return err ? ossl_time_zero() : r; } -static ossl_unused ossl_inline OSSL_TIME -ossl_time_muldiv(OSSL_TIME a, uint64_t b, uint64_t c) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_muldiv(OSSL_TIME a, uint64_t b, uint64_t c) { OSSL_TIME r; int err = 0; @@ -223,15 +235,17 @@ ossl_time_muldiv(OSSL_TIME a, uint64_t b, uint64_t c) } /* Return higher of the two given time values. */ -static ossl_unused ossl_inline OSSL_TIME -ossl_time_max(OSSL_TIME a, OSSL_TIME b) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_max(OSSL_TIME a, OSSL_TIME b) { return a.t > b.t ? a : b; } /* Return the lower of the two given time values. */ -static ossl_unused ossl_inline OSSL_TIME -ossl_time_min(OSSL_TIME a, OSSL_TIME b) +static ossl_unused ossl_inline + OSSL_TIME + ossl_time_min(OSSL_TIME a, OSSL_TIME b) { return a.t < b.t ? a : b; } diff --git a/deps/openssl/openssl/include/openssl/cmp.h.in b/deps/openssl/openssl/include/openssl/cmp.h.in index 8f3a835462bed1..b600aa6bbdd38b 100644 --- a/deps/openssl/openssl/include/openssl/cmp.h.in +++ b/deps/openssl/openssl/include/openssl/cmp.h.in @@ -1,7 +1,7 @@ /* * {- join("\n * ", @autowarntext) -} * - * Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2007-2024 The OpenSSL Project Authors. All Rights Reserved. * Copyright Nokia 2007-2019 * Copyright Siemens AG 2015-2019 * @@ -197,8 +197,6 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO; * -- CertReqMsg * } */ -#define OSSL_CMP_PKISTATUS_rejected_by_client -5 -#define OSSL_CMP_PKISTATUS_checking_response -4 #define OSSL_CMP_PKISTATUS_request -3 #define OSSL_CMP_PKISTATUS_trans -2 #define OSSL_CMP_PKISTATUS_unspecified -1 diff --git a/deps/openssl/openssl/include/openssl/core_dispatch.h b/deps/openssl/openssl/include/openssl/core_dispatch.h index 2e87cd638b3ba0..65faa5f2cf1282 100644 --- a/deps/openssl/openssl/include/openssl/core_dispatch.h +++ b/deps/openssl/openssl/include/openssl/core_dispatch.h @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -162,16 +162,16 @@ OSSL_CORE_MAKE_FUNC(void, OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_file, (const char *filename, const char *mode)) OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_membuf, (const void *buf, int len)) -OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (OSSL_CORE_BIO *bio, void *data, size_t data_len, size_t *bytes_read)) -OSSL_CORE_MAKE_FUNC(int, BIO_write_ex, (OSSL_CORE_BIO *bio, const void *data, size_t data_len, size_t *written)) -OSSL_CORE_MAKE_FUNC(int, BIO_gets, (OSSL_CORE_BIO *bio, char *buf, int size)) -OSSL_CORE_MAKE_FUNC(int, BIO_puts, (OSSL_CORE_BIO *bio, const char *str)) -OSSL_CORE_MAKE_FUNC(int, BIO_up_ref, (OSSL_CORE_BIO *bio)) -OSSL_CORE_MAKE_FUNC(int, BIO_free, (OSSL_CORE_BIO *bio)) -OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (OSSL_CORE_BIO *bio, const char *format, va_list args)) +OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (OSSL_CORE_BIO * bio, void *data, size_t data_len, size_t *bytes_read)) +OSSL_CORE_MAKE_FUNC(int, BIO_write_ex, (OSSL_CORE_BIO * bio, const void *data, size_t data_len, size_t *written)) +OSSL_CORE_MAKE_FUNC(int, BIO_gets, (OSSL_CORE_BIO * bio, char *buf, int size)) +OSSL_CORE_MAKE_FUNC(int, BIO_puts, (OSSL_CORE_BIO * bio, const char *str)) +OSSL_CORE_MAKE_FUNC(int, BIO_up_ref, (OSSL_CORE_BIO * bio)) +OSSL_CORE_MAKE_FUNC(int, BIO_free, (OSSL_CORE_BIO * bio)) +OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (OSSL_CORE_BIO * bio, const char *format, va_list args)) OSSL_CORE_MAKE_FUNC(int, BIO_vsnprintf, (char *buf, size_t n, const char *fmt, va_list args)) -OSSL_CORE_MAKE_FUNC(int, BIO_ctrl, (OSSL_CORE_BIO *bio, int cmd, long num, void *ptr)) +OSSL_CORE_MAKE_FUNC(int, BIO_ctrl, (OSSL_CORE_BIO * bio, int cmd, long num, void *ptr)) /* New seeding functions prototypes with the 101-104 series */ #define OSSL_FUNC_CLEANUP_USER_ENTROPY 96 @@ -180,9 +180,9 @@ OSSL_CORE_MAKE_FUNC(int, BIO_ctrl, (OSSL_CORE_BIO *bio, int cmd, long num, void #define OSSL_FUNC_GET_USER_NONCE 99 #define OSSL_FUNC_INDICATOR_CB 95 -OSSL_CORE_MAKE_FUNC(void, indicator_cb, (OPENSSL_CORE_CTX *ctx, OSSL_INDICATOR_CALLBACK **cb)) +OSSL_CORE_MAKE_FUNC(void, indicator_cb, (OPENSSL_CORE_CTX * ctx, OSSL_INDICATOR_CALLBACK **cb)) #define OSSL_FUNC_SELF_TEST_CB 100 -OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CORE_CTX *ctx, OSSL_CALLBACK **cb, void **cbarg)) +OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CORE_CTX * ctx, OSSL_CALLBACK **cb, void **cbarg)) /* Functions to get seed material from the operating system */ #define OSSL_FUNC_GET_ENTROPY 101 @@ -257,26 +257,26 @@ OSSL_CORE_MAKE_FUNC(int, provider_random_bytes, (void *provctx, int which, void /* Libssl related functions */ #define OSSL_FUNC_SSL_QUIC_TLS_CRYPTO_SEND 2001 OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_crypto_send, - (SSL *s, const unsigned char *buf, size_t buf_len, + (SSL * s, const unsigned char *buf, size_t buf_len, size_t *consumed, void *arg)) #define OSSL_FUNC_SSL_QUIC_TLS_CRYPTO_RECV_RCD 2002 OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_crypto_recv_rcd, - (SSL *s, const unsigned char **buf, size_t *bytes_read, + (SSL * s, const unsigned char **buf, size_t *bytes_read, void *arg)) #define OSSL_FUNC_SSL_QUIC_TLS_CRYPTO_RELEASE_RCD 2003 OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_crypto_release_rcd, - (SSL *s, size_t bytes_read, void *arg)) + (SSL * s, size_t bytes_read, void *arg)) #define OSSL_FUNC_SSL_QUIC_TLS_YIELD_SECRET 2004 OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_yield_secret, - (SSL *s, uint32_t prot_level, int direction, + (SSL * s, uint32_t prot_level, int direction, const unsigned char *secret, size_t secret_len, void *arg)) #define OSSL_FUNC_SSL_QUIC_TLS_GOT_TRANSPORT_PARAMS 2005 OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_got_transport_params, - (SSL *s, const unsigned char *params, size_t params_len, + (SSL * s, const unsigned char *params, size_t params_len, void *arg)) #define OSSL_FUNC_SSL_QUIC_TLS_ALERT 2006 OSSL_CORE_MAKE_FUNC(int, SSL_QUIC_TLS_alert, - (SSL *s, unsigned char alert_code, void *arg)) + (SSL * s, unsigned char alert_code, void *arg)) /* Operations */ diff --git a/deps/openssl/openssl/include/openssl/httperr.h b/deps/openssl/openssl/include/openssl/httperr.h index 4c1cc6ad6bf770..adac95018691d7 100644 --- a/deps/openssl/openssl/include/openssl/httperr.h +++ b/deps/openssl/openssl/include/openssl/httperr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -21,7 +21,6 @@ */ #define HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN 108 #define HTTP_R_CONNECT_FAILURE 100 -#define HTTP_R_CONTENT_TYPE_MISMATCH 131 #define HTTP_R_ERROR_PARSING_ASN1_LENGTH 109 #define HTTP_R_ERROR_PARSING_CONTENT_LENGTH 119 #define HTTP_R_ERROR_PARSING_URL 101 diff --git a/deps/openssl/openssl/include/openssl/macros.h b/deps/openssl/openssl/include/openssl/macros.h index 315c1389c6ddba..de34b4640d490d 100644 --- a/deps/openssl/openssl/include/openssl/macros.h +++ b/deps/openssl/openssl/include/openssl/macros.h @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -168,7 +168,6 @@ * 'no-deprecated'. */ -#undef OPENSSL_NO_DEPRECATED_3_5 #undef OPENSSL_NO_DEPRECATED_3_4 #undef OPENSSL_NO_DEPRECATED_3_1 #undef OPENSSL_NO_DEPRECATED_3_0 diff --git a/deps/openssl/openssl/include/openssl/rsa.h b/deps/openssl/openssl/include/openssl/rsa.h index 08335e0750b62e..a06d4f0a027287 100644 --- a/deps/openssl/openssl/include/openssl/rsa.h +++ b/deps/openssl/openssl/include/openssl/rsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -334,13 +334,13 @@ struct rsa_pss_params_st { DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) DECLARE_ASN1_DUP_FUNCTION(RSA_PSS_PARAMS) -struct rsa_oaep_params_st { +typedef struct rsa_oaep_params_st { X509_ALGOR *hashFunc; X509_ALGOR *maskGenFunc; X509_ALGOR *pSourceFunc; /* Decoded hash algorithm from maskGenFunc */ X509_ALGOR *maskHash; -}; +} RSA_OAEP_PARAMS; DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS) diff --git a/deps/openssl/openssl/include/openssl/types.h b/deps/openssl/openssl/include/openssl/types.h index f9c43735676958..e4d105c991977f 100644 --- a/deps/openssl/openssl/include/openssl/types.h +++ b/deps/openssl/openssl/include/openssl/types.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -155,9 +155,7 @@ typedef struct dsa_method DSA_METHOD; typedef struct rsa_st RSA; typedef struct rsa_meth_st RSA_METHOD; #endif - typedef struct rsa_pss_params_st RSA_PSS_PARAMS; -typedef struct rsa_oaep_params_st RSA_OAEP_PARAMS; #ifndef OPENSSL_NO_DEPRECATED_3_0 typedef struct ec_key_st EC_KEY; diff --git a/deps/openssl/openssl/providers/fips-sources.checksums b/deps/openssl/openssl/providers/fips-sources.checksums index c0ee1bffe43ed3..7ce2f739bf5f3e 100644 --- a/deps/openssl/openssl/providers/fips-sources.checksums +++ b/deps/openssl/openssl/providers/fips-sources.checksums @@ -10,12 +10,12 @@ da4942231014063d9e4fe1db91b6eb1b8f233904d169f3f1b8be7c6a59728d2e crypto/aes/aes 88b6f8396cd9d86004743d5c3b0f72b7b8c3d5a2b00b0bbb761ba91ae5a7cdc8 crypto/aes/asm/aes-mips.pl 7ff9c96ef3d591d45d776fa4b244601ea0d9328e289aeab1e1b92436ce7d02ad crypto/aes/asm/aes-parisc.pl f1244cdeadcb4e48f35bc5df19d4cfaf07e0086ad951b84f07ff6966501faa5b crypto/aes/asm/aes-ppc.pl -f8cc2144b6cc9998d2c55ef446e451a31edde01eae624cb23de02b6b25b82420 crypto/aes/asm/aes-riscv32-zkn.pl -fe42d33e668beeadd43aa7e67cbe82d3ce3b92c3223c1cc0a34d5cac5b5d501d crypto/aes/asm/aes-riscv64-zkn.pl +538ce0e80698d773c9419a9ca8892d61bc5b3cd1b071c5fc5f315d7f5573e96d crypto/aes/asm/aes-riscv32-zkn.pl +b5cdd6858b1eff7d17b29b78ac8c4a7642c0a74710f8b50821a6265328845aaf crypto/aes/asm/aes-riscv64-zkn.pl e1f3805332eb811d9d0c9377b67fe0681063364f1af84d8598f7daa30da65b4d crypto/aes/asm/aes-riscv64-zvbb-zvkg-zvkned.pl ecd9bdfaf25cdd3d8ec0c50cb4306d98374da1c6056e27e0cf31a057dc5ee150 crypto/aes/asm/aes-riscv64-zvkb-zvkned.pl -972e037dc955511eff7a371462af483e23dba86afeef25031abe1005eee635f3 crypto/aes/asm/aes-riscv64-zvkned.pl -f1d8b7a3da1ec053d38be4fc776fef1e4fba328bfa2bfd928c2a2cd3b14f08ff crypto/aes/asm/aes-riscv64.pl +d372152dac004b96a89f8531256bd05597ca0b614b444bb02aee93238dcf83ab crypto/aes/asm/aes-riscv64-zvkned.pl +f0388e17ba4268ed0b562da60e0780072180a824a379b79fafb60e25b8da3b52 crypto/aes/asm/aes-riscv64.pl 290ae2a09826d24e83763415a021e328d41a163f41cff8c9e3b882e973677f33 crypto/aes/asm/aes-s390x.pl ee4e8cacef972942d2a89c1a83c984df9cad87c61a54383403c5c4864c403ba1 crypto/aes/asm/aes-sparcv9.pl 391497550eaca253f64b2aba7ba2e53c6bae7dff01583bc6bfc12e930bb7e217 crypto/aes/asm/aes-x86_64.pl @@ -59,11 +59,11 @@ b27ec5181e387e812925bb26823b830f49d7a6e4971b6d11ea583f5632a1504b crypto/bn/asm/ 0b3350f56d423a4df918a08e90c7c66227c4449a9f9c44096eacc254ebc65f9f crypto/bn/asm/ppc64-mont-fixed.pl a25be64867ab837d93855af232e2bfa71b85b2c6f00e35e620fdc5618187fb6f crypto/bn/asm/ppc64-mont.pl b3aad31ab658eceaa9c5e734e19f39c33991f4839ab55b0cec8018020b1a305e crypto/bn/asm/rsaz-2k-avx512.pl -03f6cc678f377c5cd953e8da135c5d76dc1cd011565118c99e25bff91e7271df crypto/bn/asm/rsaz-2k-avxifma.pl +760cc579b8b464991177a337487bb32e22317cb47f69927232da76171c973954 crypto/bn/asm/rsaz-2k-avxifma.pl e914311420ae4486ab6000cc6ab424f04d8a042bda40ab8f288348dc9f0eb595 crypto/bn/asm/rsaz-3k-avx512.pl -95b11e0b04c38bde06d152dfde5ab970dab27cccdfeac998e1bc293e01520474 crypto/bn/asm/rsaz-3k-avxifma.pl +b8424d830f41a038f3c98d8664c6cf7d2d3e1748cdce260db41fa3c74f1d88d9 crypto/bn/asm/rsaz-3k-avxifma.pl e13bd2df8c591052ddf16a839072f43353841f9f35e0ac95f836511838dbc771 crypto/bn/asm/rsaz-4k-avx512.pl -cf92b66c4032703b7ce03ff6aa36887d14e31a8861e7aa21c46a466ea4802851 crypto/bn/asm/rsaz-4k-avxifma.pl +afcf51a732c80eadae1650e22e4af34904112a8b95467087a16d9d2394934730 crypto/bn/asm/rsaz-4k-avxifma.pl 6e47bf041e51d8086c4933c2a5da3ce6d1b136592984754461d59aa81e4995a6 crypto/bn/asm/rsaz-avx2.pl b42f6cf0fbf9eae58343df9629e7a9e5b8814195ea0c9882d7b143a0841cc018 crypto/bn/asm/rsaz-x86_64.pl 30fedf48dfc5fec1c2044b6c226dd9fc42a92522cc589797a23a79d452bdd2cf crypto/bn/asm/s390x-gf2m.pl @@ -73,7 +73,7 @@ aa02597f3dc09cfbc190aedb75711859ba0f3efff87067ebfba1ec78ebee40d7 crypto/bn/asm/ ca21a9ccbc54e19fb7c2e6cdf286ce7cb08b0fba960c777c6edce5c57ccc2101 crypto/bn/asm/sparcv8.S fbc93c8dbbecefe66086f58fe9719ed87b13b2cdc61454a10e841228296fecef crypto/bn/asm/sparcv8plus.S 127832c1e3d298aad805236776488f5f8836b6a0fdbce3f6b42678163df3909f crypto/bn/asm/sparcv9-gf2m.pl -0ad54f0cdf6a52ee0b0aab03800cb2b6beb39b138378b93e151cfd6b1aa2f2d6 crypto/bn/asm/sparcv9-mont.pl +1622f04a8918724ac0e8804baf285fdafa0eeaaecc36c7facd459d0ff13a8cac crypto/bn/asm/sparcv9-mont.pl b69083f78b4b4f7097de4462d16649532fb82c453a82cdd9cc1393122661d6e2 crypto/bn/asm/sparcv9a-mont.pl d404375a21d33396824a3da212d6646d4f3150dd141ee4b4a250aefae3482efb crypto/bn/asm/via-mont.pl d24f3e97239c8eed5efc721521b025b7256c15e67a54ea6b5c4cf8f7cd0f89ea crypto/bn/asm/vis3-mont.pl @@ -89,26 +89,26 @@ feef3a84a40034291286882d483ac23ab55631c3c93f40ba0ea98944916ff3ec crypto/bn/bn_b d3b5f02a17ba1c71261f6dad0d4785846567c8a03368d41fc1a6ee7c45aaff78 crypto/bn/bn_const.c eee3d2710144b0e860c57e84f5adc6b2bf64fc27cbd202a8ca2630aefed3b84c crypto/bn/bn_conv.c 282f06fbdeb991d90337787c6407020e940b6d5e187a06866f1a7787c10a0c1b crypto/bn/bn_ctx.c -b1b1c5fb8a45fde5755dfd5da62b68100b94f8c492c950719c108c384ea7f3c4 crypto/bn/bn_dh.c +d84752b5835e9072cb93de0241f1f701933c61283a27679c1ba34e2bbd1bbf76 crypto/bn/bn_dh.c 4824f271f0ddc487b5991fbd92f7f7695aeeac234e076078f37da027999cdd88 crypto/bn/bn_div.c -d36b2be05469f144f52173616e413a7bdd836607fccf94cf543cc7f5a343b962 crypto/bn/bn_exp.c +306a4a4b671f299da0201719862a3ab4f76cd4a13d4d0baa214478603e5cf15d crypto/bn/bn_exp.c ce5219203bf869561297978d6d416357a441864cd801865503dfd455c481960c crypto/bn/bn_exp2.c 18ac3f6fe64225f72243689199839ea2ce2aa61d80b084bc4cd9efe1c7cc9d89 crypto/bn/bn_gcd.c b643fdcd91ad7dfcfa97a0bb235221b024b8a77faa7890f0bcb9681ea2c64c49 crypto/bn/bn_gf2m.c 73ee247467879d4ec984c9900dfe7761233c5b889b8762be37c7e8fdd6d1d210 crypto/bn/bn_intern.c ff147e5e032cc7c772b73a91fc6e24d8d9516e642d29354445d1f82d64b1d924 crypto/bn/bn_kron.c df9aebbdcca87fc5715dde430687fb516d8de0dac70c8910409fb73d6dd2305b crypto/bn/bn_lib.c -cd7bade0f2e223fe34f6e2f8cc87098ac8f0af96ec62ada5e67f6a2344d48ef0 crypto/bn/bn_local.h +830e1932da4e8b409250a9dca0275b853a8d12bd6575649148aee5331180bbcd crypto/bn/bn_local.h 364600145964d5154224fdda2c94ca6fdab2907837a385550b242350be7a1197 crypto/bn/bn_mod.c 39a8fe0bb625b4c11b74998ce6fd99b7655228aaa7d7ad3076f61741937ae14d crypto/bn/bn_mont.c c2a5230efbda6844b7b2eb10447b054496ae5029130d332536de6c3b12dc58a3 crypto/bn/bn_mpi.c 488dde761d25fb2eabd8acbea5b3b83520db7733480fab6499f60b8bf680b1ed crypto/bn/bn_mul.c e80177361897632ac9f013415dee8f6d2d942a8b51a4daf84fc7ba51d9d75270 crypto/bn/bn_nist.c -0aa8a381dc6ed47746ec90aa739aff1eece4474d92abdd3f9036e7dcb72ee891 crypto/bn/bn_prime.c +c7e1d12f14b20e0e34870060459581afcdd58d80097248de5187b9e72bbd7cf0 crypto/bn/bn_prime.c c56ad3073108a0de21c5820a48beae2bccdbf5aa8075ec21738878222eb9adc3 crypto/bn/bn_prime.h af5af7057643ee8d35e3a2d5f7b55e37647db46700f2818edc295d727450d521 crypto/bn/bn_rand.c b5cc902624b3af2149c9ea91f9d18bea56302144e87dfe49105ec6789b73764b crypto/bn/bn_recp.c -c4ef2dd742bcd76c40df08a3108a3cf2854d53e93ebf59bf549c3ebc3b0e47cc crypto/bn/bn_rsa_fips186_4.c +4ff6338c3d30ed029b3e4fe509e08d9abf2e84b61c14bf466f642f097a8b7036 crypto/bn/bn_rsa_fips186_4.c 6889866bca4673bccb8adf870859a867757ccd3c8ad4652675615afff710add3 crypto/bn/bn_shift.c 97559e9e071a06b8cffa37b7df27af638de84c51d5da190a879752f39e2b6368 crypto/bn/bn_sqr.c c748baddfec6734bb50facbadf151a1f22f8a885c677acfb08b4f814e96f0d52 crypto/bn/bn_sqrt.c @@ -116,7 +116,7 @@ f42996cdd94f18fe0858552be7123e75cb3ced0ebd7dcb90a0c73740090dcac9 crypto/bn/bn_w 2f048ca8e8ddc5e2b8b82775197f79334381dd90bab417b2855bfeee07b99db8 crypto/bn/rsaz_exp.c b89075a1c43de2e27a29db217c11c1fb4ec04f4270d0106c0679dd44f98eee58 crypto/bn/rsaz_exp.h 3c934b8abf163b95caf236647153d42d8d48f10f2f5f8b21c013362b1cb8aa8b crypto/bn/rsaz_exp_x2.c -f6c72754667c90e3466243f9d21ce6a799db8e58c8b78b2707129dcc540adc3c crypto/bsearch.c +21ddcc6948e81597c9b9e9823311cd1c315708819e85f29d5ff80dc72e14e562 crypto/bsearch.c 82117f6a7cfc31fc86ecd9629bd3bf614126b8e8b2c23717a03ff5c1db7c3c5c crypto/buffer/buffer.c 5f43844b5d8665de9ab895f93599150a327d73ec2674bbf7d7c512d30163022d crypto/c64xpluscpuid.pl 205f0be0317343b17003f261b427008aad1b31aacc6979c4557fc837e9548b92 crypto/cmac/cmac.c @@ -182,12 +182,12 @@ f4490c0b575b79e63a897b1e85a87ede2645a2c521e67db461b3192884450d9d crypto/ec/ec2_ 5d3567b3b6d3922fd82641acff29ed12b1028e83eb0c175132ce7f3470b9db6c crypto/ec/ec2_smpl.c a1f22814f501780591da20de5e724895438094824fce440fd026850c46ad8149 crypto/ec/ec_asn1.c dfbccf591879eecbd9ed75da1fbe6c7b1672d07648fd43b37755dfe248253bb2 crypto/ec/ec_backend.c -3a3c4f4767513b4fbbabdea2918d7c7d105eb573334a7fd893b866989463c4d2 crypto/ec/ec_check.c +7f19cebad4a94db291464b0d93006a87d15ccec93b94f725052a1037107a96be crypto/ec/ec_check.c f3991bfc65a7371b84afd0cc328e3cbd4736edf7267e4b731dd82677bfab047a crypto/ec/ec_curve.c 8cfd0dcfb5acbf6105691a2d5e2826dba1ff3906707bc9dd6ff9bffcc306468f crypto/ec/ec_cvt.c add58bcaf43a28e66b3a6ec1f70ed9b0b4a4a0d40230e903a26a1ff1129649e0 crypto/ec/ec_key.c 35515133fb3c33c5736a9f744e835b9fc0775193357ab2492f11d0f63503c65e crypto/ec/ec_kmeth.c -652a1544120bf0fecde46a8e18cc28fffcb7cd864be2e2b84c99d571ba320e64 crypto/ec/ec_lib.c +ad6f566595be1d72ef97be7322949092c4530da57793ef5b722025738882410d crypto/ec/ec_lib.c 0d113ac5dbdb420ba3d1c060f4fa3300fc0a81b571a919c2b176022fdca89878 crypto/ec/ec_local.h b545e4539ef2483982f35ee05866060478722e329cfbc4990293b46ccfe5c93c crypto/ec/ec_mult.c c2a81f5f56d304038183ba6b02fdcba8767833f61773ec483e73b330b67ae59b crypto/ec/ec_oct.c @@ -206,9 +206,9 @@ f38971ee893608f00d1ddd77d889aac9558509bda62d2e1b3eecd9bfa0c29095 crypto/ec/ecp_ 8e50fd1e60ad1ac824e704375096e41f4ae535e533a3334d78c481e34d9d0fb8 crypto/ec/ecx_key.c 3ba8412897cbf17881fbf23cec27a487b2c587348e1f859ec44e47f366877249 crypto/evp/asymcipher.c 1f64d4752074f954af4f290788e4332e3874ba3282bd03d3e1d1f5ce4b0888bc crypto/evp/dh_support.c -0e9e206dd4b179ad09e1475949ce9ddb5bce0e0d66072477d94b7788c57e70d9 crypto/evp/digest.c +da3140dbda8a35cfe4a0748892a3e381e3988a94ddb945c2371922bb3010d96d crypto/evp/digest.c 4ffc3fc5ee5f0dcadf1516f1cc29338f0f4d85c59881c06d5a777cf4e47a6d5f crypto/evp/ec_support.c -8bf5ddf1c8e352a9f9241c7275d3a8cbbd633fc0f93f609158d15aee7af5a9d0 crypto/evp/evp_enc.c +6f8a9bb4d8da878aab6bf5f4bef286a0045fee1b140a1f9151c830d03778f879 crypto/evp/evp_enc.c 8683c25d4bcb598375a04d4682399c9eef095225b49498afe819e5193e9cc117 crypto/evp/evp_fetch.c 75855fc64e44e5bbfb728d85014c65e8b0668faee26f0901aaa729c16679dee8 crypto/evp/evp_lib.c e997e921669076c51e230ccb2e36b1c6755fe408c61b1177d2aa67529cab15f3 crypto/evp/evp_local.h @@ -217,7 +217,7 @@ e997e921669076c51e230ccb2e36b1c6755fe408c61b1177d2aa67529cab15f3 crypto/evp/evp 8f4194bcc2e0de69236925aa7515bc31f36ed113dcd3cee5d71167ac770cdfdd crypto/evp/exchange.c 294284ad040fe4b74845f91b1903c961c757e1ef3fcc2ffa35f43f37f1655e64 crypto/evp/kdf_lib.c 532f0ff4ab32068f160016f39cd520fadfbd09b81b3b3b562bf543acafb38889 crypto/evp/kdf_meth.c -4e60c9e37106b9c28d646f7234d857e8520da953ed7d319531467d334b77a72e crypto/evp/kem.c +6669cf0969c6fcd4e3b240aad6335d159a8169aab891f1388822fe96c6ce0629 crypto/evp/kem.c 84cebe10a50c88d0db12a90ad751eae43c7ba2954bc9f42f0c1490d66eac5bb8 crypto/evp/keymgmt_lib.c 80a5e310a3c3f551ca8e1992793ffbddc525274f90dbf4f36217b57acbc8bd94 crypto/evp/keymgmt_meth.c 15654f58c113d6eb7100caacd00ceae68113edfd6a921f6af1bea4040fa58f5d crypto/evp/mac_lib.c @@ -238,7 +238,7 @@ e032f3d46830d31cd957e1f3917a6a663c5ad3b9d79fc3d661f025822318d0de crypto/ffc/ffc bb208ef3a2c7ebdc518bd38f2f07a17cff356040f1c5d68eea13bd9275897a52 crypto/ffc/ffc_params_generate.c e9a500ddbe96cb5b302fd2db74fac0924a6ac45732df5ee1c09e82b19d06ccfd crypto/ffc/ffc_params_validate.c f172c8c2112ee82716a7bc3a3e05d5cc26188c66b9d768ac1ff906845063d2cc crypto/hashtable/hashfunc.c -653d1f67e01ce0e9dca48cf513df9e8864a0985ce9bfb094fc3f09d591e6f062 crypto/hashtable/hashtable.c +16090065da6b94199e997c930d465c613633bf322e89e3e674993ec5a785580e crypto/hashtable/hashtable.c 7a9af0b14f1463b36de0689bc434a318adcb7990bb23862bf1d2a0adf510583a crypto/hmac/hmac.c 907dd44e0bf873eebefcb4d82975b72ecec9e0f3c348c79314450fdaa78d4073 crypto/hmac/hmac_local.h 0e2d6129504d15ffaf5baa63158ccec0e4b6193a8275333956d8f868ef35127e crypto/ia64cpuid.S @@ -267,7 +267,7 @@ c2652262227348b8bb053a239e8491b26f08d6fadc47ba3471302f5797ae1c62 crypto/ml_dsa/ 36e24eae5d38cc9666ae40e4e8a2dc12328e1159fea68447cb19dab174d25adf crypto/modes/asm/aes-gcm-armv8-unroll8_64.pl 33357356cd739d4ae89d52f0804b6900e4b94d8829323819c6f64c8908e978df crypto/modes/asm/aes-gcm-armv8_64.pl a91995f81b384b175ecf252690030bb068d6af64bfcdab2fe753484b2d07a184 crypto/modes/asm/aes-gcm-avx512.pl -8fab6574aa99ee635d564dbe68b014562b61af37fa4f151210690837cdae6707 crypto/modes/asm/aes-gcm-ppc.pl +038e4ac89aa7d1962058f2170efce9024804473a62ae90102c3989555a7858cc crypto/modes/asm/aes-gcm-ppc.pl dd0de5ca8913a941cfff781a42fba43227e133976a24d0fddebf63909f7e010a crypto/modes/asm/aes-gcm-riscv64-zvkb-zvkg-zvkned.pl 9dcd3be86cda832ebe0394f5a859a761f4b711f2010fb606457f754722c5fb84 crypto/modes/asm/aesni-gcm-x86_64.pl c2e874a8deb418b5d8c935b2e256370566a5150e040c9fa008cdb5b463c26904 crypto/modes/asm/ghash-alpha.pl @@ -293,9 +293,9 @@ b431ff38c3a85943f71be0d76b063dbe2930967629b8721465b8152ab7867296 crypto/modes/o 02e7659d8776f5885ebbc25b930ddec046262f92c9e8fa7e093f2a6a8d973a3b crypto/modes/wrap128.c 0a10e0cae6f4ac164afe97a64df09c8412145c8a25f387ff3a53ff7495572cbc crypto/modes/xts128.c 9a34ad9ae361f689b0b98c454092e89567d0bfc969c08a14c8001e60976920b2 crypto/modes/xts128gb.c -515e110e01867d6527bec758a264473b62cb7edff213816e2197faf6e96ec048 crypto/o_str.c +3f2c172dccf93227fc4b24f9960e1c0b01e987e1335dd9ab0e3c2d577195fed4 crypto/o_str.c 44594139dab6ada1f34f9c6887c97e258c1204b833a6c20f58097f17d0f1645e crypto/packet.c -a108cacd961b0e5a95d279c737926afa4636d8b89a2a912593b01916ea3ce43d crypto/param_build.c +05563d44cb345e7859093296f95a3ea5139fcc316e98fcb86c6748ee49363a84 crypto/param_build.c cae7bd4973d36edbdc3bdd8d2c8d157f2c4fcfae00fdf821b67aebb789bc8aa6 crypto/param_build_set.c d362864eab6707ba2f4efd65c91dd90d669721f2d8fdebc875fd1d2957154396 crypto/params.c c0e0ba07ca5d4acfe450e4ae53a10ed254097ed2f537f01a4a43a9f5b5cab501 crypto/params_dup.c @@ -317,9 +317,9 @@ aa58d7800d3ccf2989b0de3c2e2710dfac36c88dc51659129897b0dfd2162527 crypto/provide dce7413b4c4e588c9a099c6fd7c6c9a397e034f259a2027d4ea8bdfe149164fa crypto/rcu_internal.h 0c1d3e0e857e9e4f84752a8ef0b619d8af0d81427b52facbd0174e685dac9a47 crypto/riscv32cpuid.pl 231263dffc16987f5288592ebf4c0738902d5146bfc16bcd8a157e044cb697da crypto/riscv64cpuid.pl -32e427d3d75f7b2d37e2765e2d2c111d45ca5871200be98e8943219dc475e458 crypto/riscvcap.c +fff6a76f42f3caeff8244fffb379240e43570bc6caf25e4721471bc208b2be81 crypto/riscvcap.c f0c8792a99132e0b9c027cfa7370f45594a115934cdc9e8f23bdd64abecaf7fd crypto/rsa/rsa_acvp_test_params.c -b1584c4a1a5f83a1fd43d854ce72bb11735aa34945f2b2f983228f36f27fdad2 crypto/rsa/rsa_backend.c +aadf059519d33f41b859216246d215330a0c73d18153df580927fdfa6ef51b8f crypto/rsa/rsa_backend.c 38a102cd1da1f6ca5a46e6a22f018237964336274385f5c70cbedcaa6997647e crypto/rsa/rsa_chk.c e762c599b17d5c89f4b1c9eb7d0ca1f04a95d815c86a3e72c30b231ce57fb199 crypto/rsa/rsa_crpt.c e666568eadfd01ff3e435364dee2575fca7ff3e6855b2c258fa1e4d04239d933 crypto/rsa/rsa_gen.c @@ -347,7 +347,7 @@ be1e7dd9998e3f31cfa6e1b17bc198aeec584a8b76820e38f71d51b05f8a9f2a crypto/sha/asm 33bdcc6f7668460c3bdf779633e43bfad62b937042a73acb007b462fc5b0a034 crypto/sha/asm/keccak1600-c64x.pl 09fc831dd39bd90a701e9b16d9e9987cc215252a22e1e0355f5da6c495fca35a crypto/sha/asm/keccak1600-mmx.pl 6689c3adaa270bd88026ca686ce76b8aaa83a7cadf3954d84d3cf89c044cc958 crypto/sha/asm/keccak1600-ppc64.pl -79dec13ccbee4a6758a22d92bfd5694565416219e48b6894dfb63c6b0029ae28 crypto/sha/asm/keccak1600-s390x.pl +fea3ce181c7a33bc673e3a4607e0f737a3a3e5958a3826596fb911b1297e2ca4 crypto/sha/asm/keccak1600-s390x.pl 3fb93b9440f5c3008b5c876a8106acc5f8d38f1afedd79381f0befec7dd7d72b crypto/sha/asm/keccak1600-x86_64.pl 831b8b02ab25d78ba6300ce960d96c13439bfba5844e13061e19c4e25cbacc3d crypto/sha/asm/keccak1600p8-ppc.pl 75d832db9bf0e98e7a5c522169060a6dd276c5118cfb297fc3f1111f55cd4007 crypto/sha/asm/sha1-586.pl @@ -391,7 +391,7 @@ a7e074a2f2cea0c33e7875eacc8adb465b5802e4c1d100cda79ac3dd52cdb453 crypto/sha/sha 61ab6d7d7da9e65120ec59cfa9f5ede785502ae371696c3e4e04e039743ca111 crypto/sha/sha_local.h dfd99e02830973ab349409ac6ba0ee901ba7736216030965bd7e5a54356abd7c crypto/slh_dsa/slh_adrs.c c9b270de1259d9fa71a4d352786357bcf1dd3d22075edab84501e2f8e550b271 crypto/slh_dsa/slh_adrs.h -95d42ca839ff34a050a7006734a06c157ad259512c1a10b978e9f899efe69f12 crypto/slh_dsa/slh_dsa.c +2aa41787214996542778a42eaf1bc754809f7d4d31185ac77424a3c686d6759c crypto/slh_dsa/slh_dsa.c ab7b580b1cba302c5675918b457794a3b3d00aac42297312d9447bc6f6a40b09 crypto/slh_dsa/slh_dsa_hash_ctx.c 6a68c788eee184862cf90676324750fd4f17ca666b628ebc69b3b510d19ba819 crypto/slh_dsa/slh_dsa_key.c 4c7981f7db69025f52495c549fb3b3a76be62b9e13072c3f3b7f1dedeaf8cc91 crypto/slh_dsa/slh_dsa_key.h @@ -415,13 +415,13 @@ cb214ad206ea69ab98d24a727a47d3a4c614fce709e6b7fe6997dbaeed92f0fc crypto/thread/ f06b08138d73b834471abc4a3ba43b2be838f7196c937c3e933694d6cd69f74d crypto/thread/arch/thread_win.c 55953eb5a84d03e8d915ee867ddf8ec8be8c5eb444ea0b21b12a040a57e2c2c1 crypto/thread/internal.c 2e5955d706b96c487e4875ffbe208fac15bdca06b33cee916d5343978c14efa1 crypto/threads_lib.c -ca77056d184232d6fcfe39328ab0b887a4fc939913209717fca65898ebbd45c0 crypto/threads_none.c -021afe4321ff954f3f4dd1b1d07a5e3e7778f7bccfaede08fab193d5752d9740 crypto/threads_pthread.c -1915c5e3de649873745479df5cc365c38cf56ecb2fa21be6a053055f97013dce crypto/threads_win.c +0585d64ace8f607cde3ae8aba27eb203e2fd648d3226c7b87fc49350b1f53d36 crypto/threads_none.c +a8815d82ccf819040446fccc42984ee515341d7df14c896bee48d61aea55d2f4 crypto/threads_pthread.c +794e50fd64df6c4da259bd951117291aebb0859c8a47d657a2524e67df3a850b crypto/threads_win.c 93f8fe09f96492a6be6772ddbf0cc37912fc2a90acb7faea378da1735fe20f6f crypto/time.c 88c5f9f4d2611223d283ebd2ae10ae5ecbb9972d00f747d93fcb74b62641e3f9 crypto/x86_64cpuid.pl 085d9fe93adf232f1ff838be9235046c2c2abe2daeb0e6342921d8f2e955dc18 crypto/x86cpuid.pl -6486afb23846d3c11c3a655e7e6cae24f8cdaf5dd4d6a887b5a04c53f52895b0 include/crypto/aes_platform.h +0f089e0c6ab4091eebc1d3d54dbd18603fa4f90238fc6512610c3ec3469536ba include/crypto/aes_platform.h 8b68c7b69b8da6e729789dbd99d45c341458786e2bc0e2c6c6a341e6792d6b10 include/crypto/asn1.h 9acd69adc80fbf9fa88fed4bcc7b3c0ba87e2add98d7ba311d8b092a2d5a0d2c include/crypto/asn1_dsa.h 21084935a7f88a5926a087832afe8bc6705b1a7813fe226eb4c0df12c753d3a4 include/crypto/bn.h @@ -449,7 +449,7 @@ fd4a274688b694aaf010235e6ffd3fd1afd87bc5cee9cae1e4e8be69bf96a5cf include/crypto 3f28391ed526d791a578e76a40961592e15ae2bf62b81d5924525e1f21684659 include/crypto/security_bits.h 70b36014254ca6cbe4126573ea6a71069cc278a6ceaa36412343f19b204c4c13 include/crypto/sha.h 127ede705ecfa8ec504e57cdee1210c5d7a9044121ff05d1dcf72955958346ed include/crypto/slh_dsa.h -df915f569207111cdb011e85ee0f40bcd169ac0a413cc858ccee0b5001cefbb5 include/crypto/sparse_array.h +8d50d439dd064b66fe349787228435d7a5ba4bc46917a1287c8d876f7faf37db include/crypto/sparse_array.h eb1f4f50bafdd357aa15b54f60f5ecde10876253038f00bf518fbf60840addc1 include/crypto/types.h fd5e610fe38804f5de05931706b8efc717663a892f74aa6aee30301ff5e31a25 include/internal/bio.h d32565e2b426131dc2415e60a97c94570ca982d29ddd97d2e23d6b9f73b1d81c include/internal/common.h @@ -490,7 +490,7 @@ abf03dc8635f2925bdc2299feabe115f8d5d6eaa450b421172ded222872386ba include/intern fb5bdada32614d7214569dc111b8bbc43592886799f0536b844a64a2541727cb include/internal/thread.h a8fa7ddc1e54ca296bda9ee05a7a39bb7e803eb0567cc75a9b949b80cada7552 include/internal/thread_arch.h 1cc86957e734ce34acd949b9e9e9d588a6c82afb68a09c787fb69f5e4cb20b1a include/internal/thread_once.h -07af0c702bf779720f6849dcc54b59235a5ac87513c77d6123aa334d71f5a7b3 include/internal/time.h +d9f5e7c10f41913a25f1ef89bedef6070ed3b8bb3c6ae2fe9f7d8993082d86f4 include/internal/time.h 2a4f456b95ae6c60a1bd7be966400f7aa12f791ece6f2d31a22acae6fd77c623 include/internal/tlsgroups.h 79db205cd380711f09748b4ab020442050acaa0a8a940e2be38c4916e23dd1ff include/internal/to_hex.h 47c827eb0766d6aa82cec54648fc57b33a3dfec8539cab7bce161cf73455abaa include/internal/tsan_assist.h @@ -511,7 +511,7 @@ c70499c9109b083beb69d1b17807266b041d0ff28694d5bc1ab7cf2a59331c39 include/openss 4e195b6f7a734756e21c4269cc245b292e1a563aaec5644402929d0eac423c41 include/openssl/configuration.h.in f76830b31c947d86c2e6a302ab8df6b83076f8d29120bce9a58195551eb48e1a include/openssl/conftypes.h a013fca5cc6b5cc26eb1c76eaeba31e99408e88fe89c343a44cc0b22f8e63eab include/openssl/core.h -8486d6f6818911651b0f3ba02366a362b0d4d988f014089a4f3a3f6ecca7926c include/openssl/core_dispatch.h +06eff5fb11c68f0fd4b70b0162517647afeefeff345e2541f7f2d820c97a8d95 include/openssl/core_dispatch.h b47e5195bcf209e120858a2c671eaf0589fbd1baf1c5f69237ab94651772808a include/openssl/core_names.h.in e623d4e8d36d7e0f0825fe5cb48e1176be19c0bedc5053fce488aa48602f351c include/openssl/crypto.h.in 128ef415305b704d51461ab98c688c69fde868acb5f5f74c92b2d0517823e71a include/openssl/cryptoerr.h @@ -539,7 +539,7 @@ a7c65894dd0f3730769d56a46bc6e4777c9bd7c8826998373d2ccdd9a346f840 include/openss 1dc0dce58de44226fc0afb51073c39933fb65dfd3a0131c4eff17bcb93018665 include/openssl/indicator.h 36b0013002d44397aa41b021ec13433230221aa9722ce5fc31648f08d27ac448 include/openssl/kdf.h f4a6b9adcd0158222878f5c55e3b40c620361d328bc624ce22d4937c0c054fbf include/openssl/lhash.h.in -3a6bbc7833212d862484513a0f1ec895450c8377290a644c17061051fecd162c include/openssl/macros.h +e7753bdc658187d6ac5fb51902c79bff929f3ad416fd907c02cd34568a30864c include/openssl/macros.h 0da95b5743f5c12ba1a30c1ef84f9fe57ccd5816febb1b5fd3a4f573ec885cd8 include/openssl/ml_kem.h 06f0d4621c344401f280a4e69e48ba987a0600b7f52ee16b25c4620277b081f9 include/openssl/modes.h 6d40e3edc18bac56826b2beb9439e7e43a680867a0a9ae1d3f75e07dc72b024d include/openssl/obj_mac.h @@ -556,7 +556,7 @@ a15b0b69bc1e31d0091ad32f04021d4fba9750cf9e3c9c0d2509358543cac380 include/openss d0fffeeaf8a20f6c86e8a6bfaeb1eab7c00188b1844c109ead4232c8dfb3705b include/openssl/provider.h c467dcada2506c820e2dcb002dff9d797aaf9527c8778871d79d79a93bc673e7 include/openssl/rand.h 23d76dfea708747bdc2ffac41e25b156a22d2d0cb744323a3b9859c54bfbb98a include/openssl/randerr.h -06dd86ec673693fc7c47a8b8489a72b648a56a667469064fbbfc91bcf20ad650 include/openssl/rsa.h +c477f6a040cbd444318469a9f5899d368b4e42680ab7337f6859549bc55cf2af include/openssl/rsa.h 6f79765285a8244f6c1858b86db8e390e4bc6c7905a7e4576973316612f7b015 include/openssl/rsaerr.h 546e4277a9897ed5c01b9ab30168e82f4acf9a6a20da430ebf7dd698d5f888fc include/openssl/safestack.h.in 695683de2485c3b83d9116877f5d5ca3eb84a3bbb599f6bb02c9e595e7102b41 include/openssl/self_test.h @@ -565,7 +565,7 @@ c467dcada2506c820e2dcb002dff9d797aaf9527c8778871d79d79a93bc673e7 include/openss d381d0b4113f0fa18b3e421eae303fc84daf84eacb1236cb6e9976409a2d33a9 include/openssl/symhacks.h fc527427bafa6862d9e3847c961dd6cbbcccc39d25762c65ad3b99fae9599e2e include/openssl/thread.h a481e8762c694b3dac0e74aac8626fe60fa94962a14914f1f6969ea1214c40b1 include/openssl/trace.h -9e04a3e9ca5352adffbdd75a5ea5237e8ff96a8c0a842368cc3a29de006b2ee7 include/openssl/types.h +1e0253d1f5487b8e92c39f8c3a15ee3030625c4d9735f9cdbbcc9974c213e925 include/openssl/types.h 62e0cddeedfc217ac02bf37f3669ccea8d0822a88a74a8ec82b844a85b2700aa include/openssl/x509.h.in 869959c3d557d2ace84f38b7a8d0f23b3b0854de7f952f46310e828af04554dd include/openssl/x509_vfy.h.in 5dbee881fe4e1f08a773e8bd34eeda7639be7c474a3d4d6e7c8d779e19c7eb2a include/openssl/x509err.h @@ -616,10 +616,10 @@ d8cb05784ae8533a7d9569d4fbaaea4175b63a7c9f4fb0f254215224069dea6b providers/fips ef204adc49776214dbb299265bc4f2c40b48848cbea4c25b8029f2b46a5c9797 providers/fips/include/fips_indicator_params.inc f2581d7b4e105f2bb6d30908f3c2d9959313be08cec6dbeb49030c125a7676d3 providers/fips/include/fips_selftest_params.inc 7b80823bb5613e17e8576789ec77712d89c81e7beb6ce50b58037e925e465abd providers/fips/include/fipscommon.h -c00c429b0e022db3ef9b08b3400627a1f268fb071e84d0538fb68c060da6a3db providers/fips/self_test.c +44a6e7b590de3d8a7711ac373348e4c9bc7a24dd57759897f2cb5db2cd8bba62 providers/fips/self_test.c 5c2c6c2f69e2eb01b88fa35630f27948e00dd2c2fd351735c74f34ccb2005cbe providers/fips/self_test.h df83c901ad13675fbbb4708b6087feba6099870ad3dd0e8d09cfdb6798419770 providers/fips/self_test_data.inc -aab0bbdaa8e70f6cf9c3871d62b1efc6029cbe386c5d6318d7bc730da0fa8f19 providers/fips/self_test_kats.c +bc58582893d748a0a61662cf9363ad73c91f35f2956dbcafc8d1ed37039b15d3 providers/fips/self_test_kats.c d942921caa433ae9e62959b0ad1caad277b50d005ffc439c6d0e7b0886dba882 providers/implementations/asymciphers/rsa_enc.c c2f1b12c64fc369dfc3b9bc9e76a76de7280e6429adaee55d332eb1971ad1879 providers/implementations/ciphers/cipher_aes.c 6ba7d817081cf0d87ba7bfb38cd9d70e41505480bb8bc796ef896f68d4514ea6 providers/implementations/ciphers/cipher_aes.h @@ -639,7 +639,7 @@ be18c20e0197f25fe7b9e0268657a2271a69d216b89cb100f082fa5fcaad1e07 providers/impl 60c4f604cf9b5457be48f31cc24ca21729660381081b2dbf99f362a013a09684 providers/implementations/ciphers/cipher_aes_gcm_hw_vaes_avx512.inc e2886780637db72b12c9bc488d81647ed55a7f5c850efd4bdbf88ef7127e1913 providers/implementations/ciphers/cipher_aes_hw.c 89de794c090192459d99d95bc4a422e7782e62192cd0fdb3bdef4128cfedee68 providers/implementations/ciphers/cipher_aes_hw_aesni.inc -d95dde2258887edca985237a0623855b49dd9e93d21407e9fcfe33497513be4c providers/implementations/ciphers/cipher_aes_ocb.c +e691fd1ee71c40bc76b01bbe2a6f027496a210a2e49e20908b87033552fc8c52 providers/implementations/ciphers/cipher_aes_ocb.c 88138a1aff9705e608c0557653be92eb4de65b152555a2b79ec8b2a8fae73e8f providers/implementations/ciphers/cipher_aes_ocb.h 6c3a89771719b36d6917d23464be5441836378393731af96ba165fd788df1a41 providers/implementations/ciphers/cipher_aes_ocb_hw.c c7aac28a9dca1ad46e5bce4de93e07dffec1f89fab82394c3ff7cf1bda8b483f providers/implementations/ciphers/cipher_aes_wrp.c @@ -653,7 +653,7 @@ dc4626becaabc3990549483d9ef5f05c7dd9a9c2cf9be96ade3ba6a6e203f7f5 providers/impl 9cfdcc860a03b6e7ced8cc21bcbbc1c070c89aefab04b07f213c7a3db1895553 providers/implementations/ciphers/cipher_tdes.h 00b931090e26ce9a62ee4ea125586f439a9906db5d7b914ffc67d293a57c7c00 providers/implementations/ciphers/cipher_tdes_common.c cca34f1c7baf3a98964f7ce19a59e06d1eaf2ada121a0d4a438f4078a072b325 providers/implementations/ciphers/cipher_tdes_hw.c -d2f418806c7ed45f118683bc13329573804592684e522efced0fd0921f4548fd providers/implementations/ciphers/ciphercommon.c +5739bf4391b40a6715e25a03f42701e938b160e1189c33e72b21f57d4991586e providers/implementations/ciphers/ciphercommon.c ab9a2edb23aa61cf31da6addd8674a6028f93399eceeeee35a56ee770338fd6c providers/implementations/ciphers/ciphercommon_block.c 6b6090c233ddf29d819f2559361aeeae03505de7626a127628d5f0f6d3bce295 providers/implementations/ciphers/ciphercommon_ccm.c 6632a555d5bcd5af67d0355ce46c2906bb3a0dcdf1651595b29189c40a5ca675 providers/implementations/ciphers/ciphercommon_ccm_hw.c @@ -670,8 +670,8 @@ d44c5a6d3156392757415f34afc1ab164fb0e9cd1e97977386d7cd13f3555df5 providers/impl b1115636f53bf70f417b183cafeb6d38e230d11d8de731e6896ba60cc850d931 providers/implementations/exchange/kdf_exch.c 1644609260b996c1a46610d02474f991e1ee4bdff5d8175e759c49a92f2b5107 providers/implementations/include/prov/ciphercommon.h f1dd49b30604d9b8e948c135329a270a4d3e04857f7f9159a3e84f46a024d59d providers/implementations/include/prov/ciphercommon_aead.h -af38be5b3d16c3ced0028bc9b3fbe957a6a817e23967bacc7df65566ba107edb providers/implementations/include/prov/ciphercommon_ccm.h -35d1c063e840c9cd5114c5e57b007a19868982a82d8e40a99b2935c9f1f5e05e providers/implementations/include/prov/ciphercommon_gcm.h +3226fc5162aff5b2e992b24944c49bc28855a47bbf69a789bc73ccabd886e9c0 providers/implementations/include/prov/ciphercommon_ccm.h +45885a39d0f9e30a8032c6020970389104c69b909d9699fd1c79335184fb17fa providers/implementations/include/prov/ciphercommon_gcm.h 35596c97faf324823d19a01e1b5674c7a15f1a6e7ff1ef1c7d46400c2a68f63b providers/implementations/include/prov/digestcommon.h 1baf1c06b20a0eb8ec271452544922d67c1cc168dbe9853b259191de4bd99918 providers/implementations/include/prov/ecx.h b0d1f6fc3c9220fe6d4656e487bad8df16b6f840054018b95b2752ea9aef822d providers/implementations/include/prov/hmac_drbg.h @@ -694,7 +694,7 @@ f01cbd7c5351d4aa9ae667627503b2cfef6fc0695e7a42296b7bf015c9a418b3 providers/impl 39207243a84beb670cb0e64b6d0fe7bfc6a3dd84000617b647a3ecf52a1da3c2 providers/implementations/kdfs/x942kdf.c 748af266d06006da10524f3a621c65b8c3eeddf8b1ccd06ecdc6b689564d220c providers/implementations/kem/ml_kem_kem.c 35549cec7031452bb5b46aa8a86028abc7a3a2b39f9f6564fa4bd402451bc647 providers/implementations/kem/mlx_kem.c -e89b894af920504160abfc11860b89b505d116d978162a02213f72500180903b providers/implementations/kem/rsa_kem.c +c764555b9dc9b273c280514a5d2d44156f82f3e99155a77c627f2c773209bcd7 providers/implementations/kem/rsa_kem.c aa13d72bc69a374db72b6d44e2f2c2ddd5f7bddbe16b950e3c4666d876c63735 providers/implementations/keymgmt/dh_kmgmt.c c0446d1b2101ddd977063516b87d23f424cdca33473f293db4c3974b674169b0 providers/implementations/keymgmt/dsa_kmgmt.c 2b98ba2124a86eae2adc7b88bfa26e47b548e9628b99180cc2cd841eed5ed8da providers/implementations/keymgmt/ec_kmgmt.c @@ -703,7 +703,7 @@ f0a1b4c6599e6555c5784d6c036d2aae04cd01cd8d73a927505041e7df25125c providers/impl daf35a7ab961ef70aefca981d80407935904c5da39dca6692432d6e6bc98759d providers/implementations/keymgmt/kdf_legacy_kmgmt.c 69b509e9c7fe9692622d1059917c3adb991c0047e11bc116f0a393a3a0539445 providers/implementations/keymgmt/mac_legacy_kmgmt.c 3c63e65bd1a6a2e853828205c015a50c38a82f2fee9bf6787dce6dab7331bb91 providers/implementations/keymgmt/ml_dsa_kmgmt.c -30db36c6fe6b4449179488da1761e219d0c772a8fb8e74c8411d1e0f57e4aed2 providers/implementations/keymgmt/ml_kem_kmgmt.c +716e75fe56847f0c4c7bf7d86d78040ca575cdf1dcf63c1a93d351f0e836477f providers/implementations/keymgmt/ml_kem_kmgmt.c 01d75c1eba93ed23f98130d6c308550d0ab2e44c5651101628861bc0238623d0 providers/implementations/keymgmt/mlx_kmgmt.c cd4b8129eaccbd77f9b6c725d3cb57b71109c4649115ec786b6495100afaddf2 providers/implementations/keymgmt/rsa_kmgmt.c d640cff1c46911b69866eb83f48beba42a1741bb1d3f1db6e7201077a57761fc providers/implementations/keymgmt/slh_dsa_kmgmt.c @@ -714,12 +714,12 @@ a3bb4d7914f45cf82f86cd92135e20a712274ca153d9ed5ad24db7f33710726c providers/impl 0ebc5a48655a697231918644397308e64914c32421e9b8ee7afd7779b6a2fdb8 providers/implementations/rands/drbg.c d9e41abc1780bb253bdca6c58cc32af7d0a774e52c91fc5d64577f71defc52c2 providers/implementations/rands/drbg_ctr.c cf98646defb0b385d6ce4bedcd51559c9a03424491f4576ea7eb41e3db8a18b3 providers/implementations/rands/drbg_hash.c -57561d4bd3a79e6a250310a989958409437dfa68b2818d5f0dbb8a5e7ef04bb7 providers/implementations/rands/drbg_hmac.c +45993825b1224097f6b9ea12643c09a09dc66beecfdfb3dd337d468931ab0f25 providers/implementations/rands/drbg_hmac.c 841617c81d6d5eae5ea59064e8b45947d436d3e53b49283329d17016866d8f34 providers/implementations/rands/drbg_local.h 355bd437dde9ecd1da89f42691147f2b5cf9a012ff5f55062bf83b6bead1e181 providers/implementations/rands/fips_crng_test.c 4913fec58a2648fcec0e5a94dba9decab0505a6d725bed6eb861ce854db81df8 providers/implementations/rands/test_rng.c -c6c709dfd8b1be036e2a5232d3b21dc25f0150f2aae24cc7db6b09cd790a04ee providers/implementations/signature/dsa_sig.c -d10d611713a6d9aa5cdbe636f1ba90404043431fd1df01fc1a1ce8499bf96ad0 providers/implementations/signature/ecdsa_sig.c +74e60389dc5ab0a69701af0181b6a915fc87ce9a0874cc949f7e9e85ae4642e7 providers/implementations/signature/dsa_sig.c +ca090b1987debf6a30f17551b0be613f7a2e6ce0d07b0d6924e0f759a970af4d providers/implementations/signature/ecdsa_sig.c a837f69cb1aa5d0327372e26a63a8492b6ffb1156325f66e880c202011d07cbe providers/implementations/signature/eddsa_sig.c e0e67e402ff19b0d2eb5228d7ebd70b9477c12595ac34d6f201373d7c8a516f4 providers/implementations/signature/mac_legacy_sig.c 51251a1ca4c0b6faea059de5d5268167fe47565163317177d09db39978134f78 providers/implementations/signature/ml_dsa_sig.c diff --git a/deps/openssl/openssl/providers/fips.checksum b/deps/openssl/openssl/providers/fips.checksum index 8e36de6cf70724..b10e46c3519234 100644 --- a/deps/openssl/openssl/providers/fips.checksum +++ b/deps/openssl/openssl/providers/fips.checksum @@ -1 +1 @@ -541f8f3eafccc78db022af2226f0d6501b43a3d96e2e23fd7dffb29a80d218b8 providers/fips-sources.checksums +7fb222f49c7b3a423c4bb2f62da17eae3e209cb3e9b9a9a3db624bcdfba3151a providers/fips-sources.checksums diff --git a/deps/openssl/openssl/providers/fips/self_test.c b/deps/openssl/openssl/providers/fips/self_test.c index aa5a8c765811f3..008a4fac847fc6 100644 --- a/deps/openssl/openssl/providers/fips/self_test.c +++ b/deps/openssl/openssl/providers/fips/self_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -101,9 +101,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) init(); break; case DLL_PROCESS_DETACH: -#ifndef __CYGWIN__ cleanup(); -#endif break; default: break; diff --git a/deps/openssl/openssl/providers/fips/self_test_kats.c b/deps/openssl/openssl/providers/fips/self_test_kats.c index 0559a30cd69d93..f453b2f2fb493d 100644 --- a/deps/openssl/openssl/providers/fips/self_test_kats.c +++ b/deps/openssl/openssl/providers/fips/self_test_kats.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -1025,8 +1025,6 @@ static int set_kat_drbg(OSSL_LIB_CTX *ctx, EVP_RAND *rand; unsigned int strength = 256; EVP_RAND_CTX *parent_rand = NULL; - int reseed_time_interval = 0; - unsigned int reseed_requests = 0; OSSL_PARAM drbg_params[3] = { OSSL_PARAM_END, OSSL_PARAM_END, OSSL_PARAM_END }; @@ -1073,12 +1071,7 @@ static int set_kat_drbg(OSSL_LIB_CTX *ctx, EVP_RAND_CTX_free(parent_rand); parent_rand = NULL; - /* Disable time/request based reseeding to make selftests deterministic */ - drbg_params[0] = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL, - &reseed_time_interval); - drbg_params[1] = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS, - &reseed_requests); - if (!EVP_RAND_instantiate(kat_rand, strength, 0, persstr, persstr_len, drbg_params)) + if (!EVP_RAND_instantiate(kat_rand, strength, 0, persstr, persstr_len, NULL)) goto err; /* When we set the new private generator this one is freed, so upref it */ diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.inc b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.inc index a1df534f2a7a8d..153eb798917164 100644 --- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.inc +++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_gcm_hw_ppc.inc @@ -1,5 +1,5 @@ /* - * Copyright 2001-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -44,8 +44,8 @@ static inline u32 add32TOU(unsigned char buf[4], u32 n) static size_t ppc_aes_gcm_crypt(const unsigned char *in, unsigned char *out, size_t len, const void *key, unsigned char ivec[16], u64 *Xi, int encrypt) { - size_t s = 0; - size_t ndone = 0; + int s = 0; + int ndone = 0; int ctr_reset = 0; u64 blocks_unused; u64 nb = len / 16; @@ -119,7 +119,7 @@ static int ppc_aes_gcm_cipher_update(PROV_GCM_CTX *ctx, const unsigned char *in, size_t res = (16 - ctx->gcm.mres) % 16; if (CRYPTO_gcm128_decrypt(&ctx->gcm, in, out, res)) - return 0; + return -1; bulk = ppc_aes_gcm_crypt(in + res, out + res, len - res, ctx->gcm.key, diff --git a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.c b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.c index b724c425e3924d..a50099719c4a91 100644 --- a/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.c +++ b/deps/openssl/openssl/providers/implementations/ciphers/cipher_aes_ocb.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -27,7 +27,7 @@ #define OCB_MIN_IV_LEN 1 #define OCB_MAX_IV_LEN 15 -PROV_CIPHER_FUNC(int, ocb_cipher, (PROV_AES_OCB_CTX *ctx, const unsigned char *in, unsigned char *out, size_t nextblock)); +PROV_CIPHER_FUNC(int, ocb_cipher, (PROV_AES_OCB_CTX * ctx, const unsigned char *in, unsigned char *out, size_t nextblock)); /* forward declarations */ static OSSL_FUNC_cipher_encrypt_init_fn aes_ocb_einit; static OSSL_FUNC_cipher_decrypt_init_fn aes_ocb_dinit; diff --git a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.c b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.c index 9b6930e5c49b5e..ba2a9b68088b1c 100644 --- a/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.c +++ b/deps/openssl/openssl/providers/implementations/ciphers/ciphercommon.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -691,10 +691,6 @@ int ossl_cipher_generic_set_ctx_params(void *vctx, const OSSL_PARAM params[]) ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER); return 0; } - if (ctx->blocksize > 0 && num >= (unsigned int)ctx->blocksize) { - ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER); - return 0; - } ctx->num = num; } return 1; diff --git a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_ccm.h b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_ccm.h index fefe7ed3156548..59d77f0bb10dd1 100644 --- a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_ccm.h +++ b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_ccm.h @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -48,13 +48,13 @@ typedef struct prov_ccm_st { const PROV_CCM_HW *hw; /* hardware specific methods */ } PROV_CCM_CTX; -PROV_CIPHER_FUNC(int, CCM_cipher, (PROV_CCM_CTX *ctx, unsigned char *out, size_t *padlen, const unsigned char *in, size_t len)); -PROV_CIPHER_FUNC(int, CCM_setkey, (PROV_CCM_CTX *ctx, const unsigned char *key, size_t keylen)); -PROV_CIPHER_FUNC(int, CCM_setiv, (PROV_CCM_CTX *dat, const unsigned char *iv, size_t ivlen, size_t mlen)); -PROV_CIPHER_FUNC(int, CCM_setaad, (PROV_CCM_CTX *ctx, const unsigned char *aad, size_t aadlen)); -PROV_CIPHER_FUNC(int, CCM_auth_encrypt, (PROV_CCM_CTX *ctx, const unsigned char *in, unsigned char *out, size_t len, unsigned char *tag, size_t taglen)); -PROV_CIPHER_FUNC(int, CCM_auth_decrypt, (PROV_CCM_CTX *ctx, const unsigned char *in, unsigned char *out, size_t len, unsigned char *tag, size_t taglen)); -PROV_CIPHER_FUNC(int, CCM_gettag, (PROV_CCM_CTX *ctx, unsigned char *tag, size_t taglen)); +PROV_CIPHER_FUNC(int, CCM_cipher, (PROV_CCM_CTX * ctx, unsigned char *out, size_t *padlen, const unsigned char *in, size_t len)); +PROV_CIPHER_FUNC(int, CCM_setkey, (PROV_CCM_CTX * ctx, const unsigned char *key, size_t keylen)); +PROV_CIPHER_FUNC(int, CCM_setiv, (PROV_CCM_CTX * dat, const unsigned char *iv, size_t ivlen, size_t mlen)); +PROV_CIPHER_FUNC(int, CCM_setaad, (PROV_CCM_CTX * ctx, const unsigned char *aad, size_t aadlen)); +PROV_CIPHER_FUNC(int, CCM_auth_encrypt, (PROV_CCM_CTX * ctx, const unsigned char *in, unsigned char *out, size_t len, unsigned char *tag, size_t taglen)); +PROV_CIPHER_FUNC(int, CCM_auth_decrypt, (PROV_CCM_CTX * ctx, const unsigned char *in, unsigned char *out, size_t len, unsigned char *tag, size_t taglen)); +PROV_CIPHER_FUNC(int, CCM_gettag, (PROV_CCM_CTX * ctx, unsigned char *tag, size_t taglen)); /* * CCM Mode internal method table used to handle hardware specific differences, diff --git a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_gcm.h b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_gcm.h index 7c57e3cb7950b8..7b411618f027cc 100644 --- a/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_gcm.h +++ b/deps/openssl/openssl/providers/implementations/include/prov/ciphercommon_gcm.h @@ -1,6 +1,6 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -81,12 +81,12 @@ typedef struct prov_gcm_ctx_st { ctr128_f ctr; } PROV_GCM_CTX; -PROV_CIPHER_FUNC(int, GCM_setkey, (PROV_GCM_CTX *ctx, const unsigned char *key, size_t keylen)); -PROV_CIPHER_FUNC(int, GCM_setiv, (PROV_GCM_CTX *dat, const unsigned char *iv, size_t ivlen)); -PROV_CIPHER_FUNC(int, GCM_aadupdate, (PROV_GCM_CTX *ctx, const unsigned char *aad, size_t aadlen)); -PROV_CIPHER_FUNC(int, GCM_cipherupdate, (PROV_GCM_CTX *ctx, const unsigned char *in, size_t len, unsigned char *out)); -PROV_CIPHER_FUNC(int, GCM_cipherfinal, (PROV_GCM_CTX *ctx, unsigned char *tag)); -PROV_CIPHER_FUNC(int, GCM_oneshot, (PROV_GCM_CTX *ctx, unsigned char *aad, size_t aad_len, const unsigned char *in, size_t in_len, unsigned char *out, unsigned char *tag, size_t taglen)); +PROV_CIPHER_FUNC(int, GCM_setkey, (PROV_GCM_CTX * ctx, const unsigned char *key, size_t keylen)); +PROV_CIPHER_FUNC(int, GCM_setiv, (PROV_GCM_CTX * dat, const unsigned char *iv, size_t ivlen)); +PROV_CIPHER_FUNC(int, GCM_aadupdate, (PROV_GCM_CTX * ctx, const unsigned char *aad, size_t aadlen)); +PROV_CIPHER_FUNC(int, GCM_cipherupdate, (PROV_GCM_CTX * ctx, const unsigned char *in, size_t len, unsigned char *out)); +PROV_CIPHER_FUNC(int, GCM_cipherfinal, (PROV_GCM_CTX * ctx, unsigned char *tag)); +PROV_CIPHER_FUNC(int, GCM_oneshot, (PROV_GCM_CTX * ctx, unsigned char *aad, size_t aad_len, const unsigned char *in, size_t in_len, unsigned char *out, unsigned char *tag, size_t taglen)); struct prov_gcm_hw_st { OSSL_GCM_setkey_fn setkey; OSSL_GCM_setiv_fn setiv; diff --git a/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.c b/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.c index 397cd50ec6a862..fa4b808f4e1169 100644 --- a/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.c +++ b/deps/openssl/openssl/providers/implementations/kdfs/pkcs12kdf.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -266,15 +266,6 @@ static int kdf_pkcs12_set_ctx_params(void *vctx, const OSSL_PARAM params[]) if ((p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_ITER)) != NULL) if (!OSSL_PARAM_get_uint64(p, &ctx->iter)) return 0; -#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION - /* - * If we're running the fuzzer, limit iteration count to - * 100 so we don't time out running the derivation for - * a really long time - */ - if (getenv("OPENSSL_RUNNING_UNIT_TESTS") == NULL && p != NULL && ctx->iter > 100) - ctx->iter = 100; -#endif return 1; } diff --git a/deps/openssl/openssl/providers/implementations/kem/rsa_kem.c b/deps/openssl/openssl/providers/implementations/kem/rsa_kem.c index 78925809d9853a..f7bf368a0dfc71 100644 --- a/deps/openssl/openssl/providers/implementations/kem/rsa_kem.c +++ b/deps/openssl/openssl/providers/implementations/kem/rsa_kem.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -316,19 +316,17 @@ static int rsasve_generate(PROV_RSA_CTX *prsactx, return 0; /* Step(3): out = RSAEP((n,e), z) */ - ret = RSA_public_encrypt((int)nlen, secret, out, prsactx->rsa, - RSA_NO_PADDING); - if (ret <= 0 || ret != (int)nlen) { + ret = RSA_public_encrypt(nlen, secret, out, prsactx->rsa, RSA_NO_PADDING); + if (ret) { + ret = 1; + if (outlen != NULL) + *outlen = nlen; + if (secretlen != NULL) + *secretlen = nlen; + } else { OPENSSL_cleanse(secret, nlen); - return 0; } - - if (outlen != NULL) - *outlen = nlen; - if (secretlen != NULL) - *secretlen = nlen; - - return 1; + return ret; } /** diff --git a/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.c b/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.c index 7884f40ae58edd..0be2a1e29839b6 100644 --- a/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.c +++ b/deps/openssl/openssl/providers/implementations/keymgmt/ml_kem_kmgmt.c @@ -1,5 +1,5 @@ /* - * Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -799,7 +799,7 @@ static void ml_kem_gen_cleanup(void *vgctx) return; if (gctx->seed != NULL) - OPENSSL_cleanse(gctx->seed, ML_KEM_SEED_BYTES); + OPENSSL_cleanse(gctx->seed, ML_KEM_RANDOM_BYTES); OPENSSL_free(gctx->propq); OPENSSL_free(gctx); } diff --git a/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.c b/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.c index d3191e55a92919..ff8a6cd6f0a615 100644 --- a/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.c +++ b/deps/openssl/openssl/providers/implementations/rands/drbg_hmac.c @@ -437,7 +437,7 @@ static int drbg_fetch_algs_from_prov(const OSSL_PARAM params[], p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST); if (p) { - if (!OSSL_PARAM_get_utf8_string_ptr(p, &digest_name)) { + if (OSSL_PARAM_get_utf8_string_ptr(p, &digest_name)) { ERR_raise(ERR_LIB_PROV, PROV_R_VALUE_ERROR); goto done; } @@ -458,7 +458,7 @@ static int drbg_fetch_algs_from_prov(const OSSL_PARAM params[], if (p == NULL) { hmac_name = "HMAC"; } else { - if (!OSSL_PARAM_get_utf8_string_ptr(p, &hmac_name)) { + if (OSSL_PARAM_get_utf8_string_ptr(p, &hmac_name)) { ERR_raise(ERR_LIB_PROV, PROV_R_VALUE_ERROR); goto done; } diff --git a/deps/openssl/openssl/providers/implementations/signature/dsa_sig.c b/deps/openssl/openssl/providers/implementations/signature/dsa_sig.c index 48237d7eb9ed73..51dcc3f2300d5b 100644 --- a/deps/openssl/openssl/providers/implementations/signature/dsa_sig.c +++ b/deps/openssl/openssl/providers/implementations/signature/dsa_sig.c @@ -1,5 +1,5 @@ /* - * Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -634,14 +634,13 @@ static void *dsa_dupctx(void *vpdsactx) if (!ossl_prov_is_running()) return NULL; - if ((dstctx = OPENSSL_memdup(srcctx, sizeof(*srcctx))) == NULL) + dstctx = OPENSSL_zalloc(sizeof(*srcctx)); + if (dstctx == NULL) return NULL; + *dstctx = *srcctx; dstctx->dsa = NULL; dstctx->propq = NULL; - dstctx->md = NULL; - dstctx->mdctx = NULL; - dstctx->sig = NULL; if (srcctx->dsa != NULL && !DSA_up_ref(srcctx->dsa)) goto err; @@ -651,15 +650,18 @@ static void *dsa_dupctx(void *vpdsactx) goto err; dstctx->md = srcctx->md; - if (srcctx->mdctx != NULL - && (dstctx->mdctx = EVP_MD_CTX_dup(srcctx->mdctx)) == NULL) - goto err; - if (srcctx->propq != NULL - && ((dstctx->propq = OPENSSL_strdup(srcctx->propq)) == NULL)) - goto err; - if (srcctx->sig != NULL - && ((dstctx->sig = OPENSSL_memdup(srcctx->sig, srcctx->siglen)) == NULL)) - goto err; + if (srcctx->mdctx != NULL) { + dstctx->mdctx = EVP_MD_CTX_new(); + if (dstctx->mdctx == NULL + || !EVP_MD_CTX_copy_ex(dstctx->mdctx, srcctx->mdctx)) + goto err; + } + + if (srcctx->propq != NULL) { + dstctx->propq = OPENSSL_strdup(srcctx->propq); + if (dstctx->propq == NULL) + goto err; + } return dstctx; err: @@ -970,12 +972,6 @@ static int dsa_sigalg_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[]) if (!OSSL_PARAM_get_octet_string(p, (void **)&pdsactx->sig, 0, &pdsactx->siglen)) return 0; - /* The signature must not be empty */ - if (pdsactx->siglen == 0) { - OPENSSL_free(pdsactx->sig); - pdsactx->sig = NULL; - return 0; - } } } return 1; diff --git a/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.c b/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.c index 3ce4cd0d2a82c3..0c04fc4ec683e3 100644 --- a/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.c +++ b/deps/openssl/openssl/providers/implementations/signature/ecdsa_sig.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -630,37 +630,40 @@ static void *ecdsa_dupctx(void *vctx) PROV_ECDSA_CTX *srcctx = (PROV_ECDSA_CTX *)vctx; PROV_ECDSA_CTX *dstctx; - /* Test KATS should not need to be supported */ - if (!ossl_prov_is_running() - || srcctx->kinv != NULL - || srcctx->r != NULL - || (dstctx = OPENSSL_memdup(srcctx, sizeof(*srcctx))) == NULL) + if (!ossl_prov_is_running()) + return NULL; + + dstctx = OPENSSL_zalloc(sizeof(*srcctx)); + if (dstctx == NULL) return NULL; + *dstctx = *srcctx; dstctx->ec = NULL; dstctx->propq = NULL; - dstctx->md = NULL; - dstctx->mdctx = NULL; - dstctx->sig = NULL; if (srcctx->ec != NULL && !EC_KEY_up_ref(srcctx->ec)) goto err; + /* Test KATS should not need to be supported */ + if (srcctx->kinv != NULL || srcctx->r != NULL) + goto err; dstctx->ec = srcctx->ec; if (srcctx->md != NULL && !EVP_MD_up_ref(srcctx->md)) goto err; dstctx->md = srcctx->md; - if (srcctx->mdctx != NULL - && ((dstctx->mdctx = EVP_MD_CTX_new()) == NULL - || !EVP_MD_CTX_copy_ex(dstctx->mdctx, srcctx->mdctx))) - goto err; - if (srcctx->propq != NULL - && (dstctx->propq = OPENSSL_strdup(srcctx->propq)) == NULL) - goto err; - if (srcctx->sig != NULL - && (dstctx->sig = OPENSSL_memdup(srcctx->sig, srcctx->siglen)) == NULL) - goto err; + if (srcctx->mdctx != NULL) { + dstctx->mdctx = EVP_MD_CTX_new(); + if (dstctx->mdctx == NULL + || !EVP_MD_CTX_copy_ex(dstctx->mdctx, srcctx->mdctx)) + goto err; + } + + if (srcctx->propq != NULL) { + dstctx->propq = OPENSSL_strdup(srcctx->propq); + if (dstctx->propq == NULL) + goto err; + } return dstctx; err: @@ -987,12 +990,6 @@ static int ecdsa_sigalg_set_ctx_params(void *vctx, const OSSL_PARAM params[]) if (!OSSL_PARAM_get_octet_string(p, (void **)&ctx->sig, 0, &ctx->siglen)) return 0; - /* The signature must not be empty */ - if (ctx->siglen == 0) { - OPENSSL_free(ctx->sig); - ctx->sig = NULL; - return 0; - } } } return 1; diff --git a/deps/openssl/openssl/providers/implementations/signature/sm2_sig.c b/deps/openssl/openssl/providers/implementations/signature/sm2_sig.c index 4322e49f592feb..d367c493811446 100644 --- a/deps/openssl/openssl/providers/implementations/signature/sm2_sig.c +++ b/deps/openssl/openssl/providers/implementations/signature/sm2_sig.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -214,12 +214,6 @@ static int sm2sig_digest_signverify_init(void *vpsm2ctx, const char *mdname, int ret = 0; unsigned char *aid = NULL; - /* - * Each EVP_Digest{Sign,Verify}Init_ex(3) starts with fresh content, that - * needs to recompute the "Z" digest. - */ - ctx->flag_compute_z_digest = 1; - if (!sm2sig_signature_init(vpsm2ctx, ec, params) || !sm2sig_set_mdname(ctx, mdname)) return ret; @@ -253,6 +247,8 @@ static int sm2sig_digest_signverify_init(void *vpsm2ctx, const char *mdname, if (!EVP_DigestInit_ex2(ctx->mdctx, ctx->md, params)) goto error; + ctx->flag_compute_z_digest = 1; + ret = 1; error: diff --git a/deps/openssl/openssl/providers/implementations/storemgmt/file_store.c b/deps/openssl/openssl/providers/implementations/storemgmt/file_store.c index f73c5fd5c831d6..6568906ea1c46d 100644 --- a/deps/openssl/openssl/providers/implementations/storemgmt/file_store.c +++ b/deps/openssl/openssl/providers/implementations/storemgmt/file_store.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -104,8 +104,6 @@ struct file_ctx_st { /* Expected object type. May be unspecified */ int expected_type; - /* Fatal error occurred. We should indicate EOF. */ - int fatal_error; }; static void free_file_ctx(struct file_ctx_st *ctx) @@ -561,10 +559,8 @@ static int file_load_file(struct file_ctx_st *ctx, /* Setup the decoders (one time shot per session */ - if (!file_setup_decoders(ctx)) { - ctx->fatal_error = 1; + if (!file_setup_decoders(ctx)) return 0; - } /* Setup for this object */ @@ -762,9 +758,6 @@ static int file_eof(void *loaderctx) { struct file_ctx_st *ctx = loaderctx; - if (ctx->fatal_error) - return 1; - switch (ctx->type) { case IS_DIR: return ctx->_.dir.end_reached; diff --git a/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.c b/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.c index 9da24b4f55c0f7..cd3e4b94fb3bb4 100644 --- a/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.c +++ b/deps/openssl/openssl/providers/implementations/storemgmt/winstore_store.c @@ -1,5 +1,5 @@ /* - * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -272,10 +272,8 @@ static int winstore_load_using(struct winstore_ctx_st *ctx, const unsigned char *der_ = der; size_t der_len_ = der_len; - if (setup_decoder(ctx) == 0) { - ctx->state = STATE_EOF; + if (setup_decoder(ctx) == 0) return 0; - } data.object_cb = object_cb; data.object_cbarg = object_cbarg; diff --git a/deps/openssl/openssl/ssl/quic/quic_impl.c b/deps/openssl/openssl/ssl/quic/quic_impl.c index a8f9ac92c2a437..1b4bbd4a92159c 100644 --- a/deps/openssl/openssl/ssl/quic/quic_impl.c +++ b/deps/openssl/openssl/ssl/quic/quic_impl.c @@ -4504,10 +4504,6 @@ SSL *ossl_quic_new_from_listener(SSL *ssl, uint64_t flags) * to grab reference for qc. */ qc->ch = ossl_quic_port_create_outgoing(qc->port, qc->tls); - if (qc->ch == NULL) { - QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_INTERNAL_ERROR, NULL); - goto err; - } ossl_quic_channel_set_msg_callback(qc->ch, ql->obj.ssl.ctx->msg_callback, &qc->obj.ssl); ossl_quic_channel_set_msg_callback_arg(qc->ch, ql->obj.ssl.ctx->msg_callback_arg); @@ -4604,10 +4600,9 @@ SSL *ossl_quic_accept_connection(SSL *ssl, uint64_t flags) int ret; QCTX ctx; SSL *conn_ssl = NULL; - SSL *conn_ssl_tmp = NULL; SSL_CONNECTION *conn = NULL; QUIC_CHANNEL *new_ch = NULL; - QUIC_CONNECTION *qc = NULL; + QUIC_CONNECTION *qc; int no_block = ((flags & SSL_ACCEPT_CONNECTION_NO_BLOCK) != 0); if (!expect_quic_listener(ssl, &ctx)) @@ -4656,38 +4651,28 @@ SSL *ossl_quic_accept_connection(SSL *ssl, uint64_t flags) * bound to new_ch. If channel constructor fails to create any item here * it just fails to create channel. */ - if (!ossl_assert((conn_ssl_tmp = ossl_quic_channel_get0_tls(new_ch)) != NULL) - || !ossl_assert((conn = SSL_CONNECTION_FROM_SSL(conn_ssl_tmp)) != NULL) - || !ossl_assert((conn_ssl_tmp = SSL_CONNECTION_GET_USER_SSL(conn)) != NULL)) + if (!ossl_assert((conn_ssl = ossl_quic_channel_get0_tls(new_ch)) != NULL) + || !ossl_assert((conn = SSL_CONNECTION_FROM_SSL(conn_ssl)) != NULL) + || !ossl_assert((conn_ssl = SSL_CONNECTION_GET_USER_SSL(conn)) != NULL)) goto out; - qc = (QUIC_CONNECTION *)conn_ssl_tmp; - if (SSL_up_ref(&ctx.ql->obj.ssl)) { - qc->listener = ctx.ql; - conn_ssl = conn_ssl_tmp; - conn_ssl_tmp = NULL; - qc->pending = 0; + qc = (QUIC_CONNECTION *)conn_ssl; + qc->pending = 0; + if (!SSL_up_ref(&ctx.ql->obj.ssl)) { + /* + * You might expect ossl_quic_channel_free() to be called here. Be + * assured it happens, The process goes as follows: + * - The SSL_free() here is being handled by ossl_quic_free(). + * - The very last step of ossl_quic_free() is call to qc_cleanup() + * where channel gets freed. + */ + SSL_free(conn_ssl); } + qc->listener = ctx.ql; out: qctx_unlock(&ctx); - /* - * You might expect ossl_quic_channel_free() to be called here. Be - * assured it happens, The process goes as follows: - * - The SSL_free() here is being handled by ossl_quic_free(). - * - The very last step of ossl_quic_free() is call to qc_cleanup() - * where channel gets freed. - * NOTE: We defer this SSL_free until after the call to qctx_unlock above - * to avoid the deadlock that would occur when ossl_quic_free attempts to - * re-acquire this mutex. We also do the gymnastics with conn_ssl and - * conn_ssl_tmp above so that we only actually do the free on the SSL - * object if the up-ref above fails, in such a way that we don't unbalance - * the listener refcount (i.e. if the up-ref fails above, we don't set the - * listener pointer so that we don't then drop the ref-count erroneously - * during the free operation. - */ - SSL_free(conn_ssl_tmp); return conn_ssl; } diff --git a/deps/openssl/openssl/ssl/quic/quic_lcidm.c b/deps/openssl/openssl/ssl/quic/quic_lcidm.c index 89ee95055dc1d3..660eb802ba32f0 100644 --- a/deps/openssl/openssl/ssl/quic/quic_lcidm.c +++ b/deps/openssl/openssl/ssl/quic/quic_lcidm.c @@ -1,5 +1,5 @@ /* - * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -74,21 +74,15 @@ static unsigned long lcid_hash(const QUIC_LCID *lcid_obj) 0, }; unsigned long hashval = 0; - unsigned char digest[SIPHASH_MIN_DIGEST_SIZE]; - /* Use a supported SipHash digest size (8 or 16); 8 is sufficient here. */ - if (!SipHash_set_hash_size(&siphash, SIPHASH_MIN_DIGEST_SIZE)) + if (!SipHash_set_hash_size(&siphash, sizeof(unsigned long))) goto out; if (!SipHash_Init(&siphash, (uint8_t *)lcid_obj->hash_key, 0, 0)) goto out; SipHash_Update(&siphash, lcid_obj->cid.id, lcid_obj->cid.id_len); - if (!SipHash_Final(&siphash, digest, SIPHASH_MIN_DIGEST_SIZE)) + if (!SipHash_Final(&siphash, (unsigned char *)&hashval, + sizeof(unsigned long))) goto out; - - /* - * Truncate the 64-bit SipHash digest into an unsigned long. - */ - memcpy(&hashval, digest, sizeof(hashval) < sizeof(digest) ? sizeof(hashval) : sizeof(digest)); out: return hashval; } diff --git a/deps/openssl/openssl/ssl/quic/quic_reactor.c b/deps/openssl/openssl/ssl/quic/quic_reactor.c index c30bc3c595ab16..1a95f131e30cad 100644 --- a/deps/openssl/openssl/ssl/quic/quic_reactor.c +++ b/deps/openssl/openssl/ssl/quic/quic_reactor.c @@ -76,12 +76,6 @@ void ossl_quic_reactor_cleanup(QUIC_REACTOR *rtor) } #if defined(OPENSSL_SYS_WINDOWS) - -/* Work around for MinGW builds. */ -#if defined(__MINGW32__) && !defined(SIO_UDP_NETRESET) -#define SIO_UDP_NETRESET _WSAIOW(IOC_VENDOR, 15) -#endif - /* * On Windows recvfrom() may return WSAECONNRESET when destination port * used in preceding call to sendto() is no longer reachable. The reset diff --git a/deps/openssl/openssl/ssl/quic/quic_rx_depack.c b/deps/openssl/openssl/ssl/quic/quic_rx_depack.c index 786af9b4c221ad..83f66ef59e5a0d 100644 --- a/deps/openssl/openssl/ssl/quic/quic_rx_depack.c +++ b/deps/openssl/openssl/ssl/quic/quic_rx_depack.c @@ -1,5 +1,5 @@ /* - * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -1316,7 +1316,6 @@ static int depack_process_frames(QUIC_CHANNEL *ch, PACKET *pkt, OSSL_QUIC_ERR_PROTOCOL_VIOLATION, frame_type, "NEW_CONN_ID valid only in 0/1-RTT"); - return 0; } if (!depack_do_frame_new_conn_id(pkt, ch, ackm_data)) return 0; diff --git a/deps/openssl/openssl/ssl/quic/quic_srtm.c b/deps/openssl/openssl/ssl/quic/quic_srtm.c index 46f675cef239e5..405376fc465d63 100644 --- a/deps/openssl/openssl/ssl/quic/quic_srtm.c +++ b/deps/openssl/openssl/ssl/quic/quic_srtm.c @@ -1,5 +1,5 @@ /* - * Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -168,11 +168,6 @@ void ossl_quic_srtm_free(QUIC_SRTM *srtm) lh_SRTM_ITEM_free(srtm->items_rev); if (srtm->items_fwd != NULL) { - /* - * We don't need to call lh_SRTM_ITEM_set_down_load(..., 0) - * here because srtm_free_each() callback for _doall() does - * not call to lh_SRTIM_ITEM_delete(). - */ lh_SRTM_ITEM_doall(srtm->items_fwd, srtm_free_each); lh_SRTM_ITEM_free(srtm->items_fwd); } diff --git a/deps/openssl/openssl/ssl/quic/quic_stream_map.c b/deps/openssl/openssl/ssl/quic/quic_stream_map.c index b8175849a019ba..ae6a0a01e983ab 100644 --- a/deps/openssl/openssl/ssl/quic/quic_stream_map.c +++ b/deps/openssl/openssl/ssl/quic/quic_stream_map.c @@ -1,5 +1,5 @@ /* - * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -122,7 +122,6 @@ static void release_each(QUIC_STREAM *stream, void *arg) void ossl_quic_stream_map_cleanup(QUIC_STREAM_MAP *qsm) { - lh_QUIC_STREAM_set_down_load(qsm->map, 0); ossl_quic_stream_map_visit(qsm, release_each, qsm); lh_QUIC_STREAM_free(qsm->map); diff --git a/deps/openssl/openssl/ssl/quic/uint_set.c b/deps/openssl/openssl/ssl/quic/uint_set.c index e217816a395b72..f81148c79af7c2 100644 --- a/deps/openssl/openssl/ssl/quic/uint_set.c +++ b/deps/openssl/openssl/ssl/quic/uint_set.c @@ -1,5 +1,5 @@ /* - * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -303,8 +303,6 @@ int ossl_uint_set_remove(UINT_SET *s, const UINT_RANGE *range) * handled by the above cases. */ y = create_set_item(end + 1, z->range.end); - if (y == NULL) - return 0; ossl_list_uint_set_insert_after(s, z, y); z->range.end = start - 1; break; diff --git a/deps/openssl/openssl/ssl/record/methods/tls_common.c b/deps/openssl/openssl/ssl/record/methods/tls_common.c index bf035b13d54f4a..bbfb3620f195d3 100644 --- a/deps/openssl/openssl/ssl/record/methods/tls_common.c +++ b/deps/openssl/openssl/ssl/record/methods/tls_common.c @@ -1,5 +1,5 @@ /* - * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -620,11 +620,6 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl) thisrr->length = sslv2len & 0x7fff; - if (!rl->funcs->validate_record_header(rl, thisrr)) { - /* RLAYERfatal already called */ - return OSSL_RECORD_RETURN_FATAL; - } - if (thisrr->length > TLS_BUFFER_get_len(rbuf) - SSL2_RT_HEADER_LENGTH) { RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW, @@ -661,11 +656,6 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl) if (rl->msg_callback != NULL) rl->msg_callback(0, version, SSL3_RT_HEADER, p, 5, rl->cbarg); - if (!rl->funcs->validate_record_header(rl, thisrr)) { - /* RLAYERfatal already called */ - return OSSL_RECORD_RETURN_FATAL; - } - if (thisrr->length > TLS_BUFFER_get_len(rbuf) - SSL3_RT_HEADER_LENGTH) { RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW, SSL_R_PACKET_LENGTH_TOO_LONG); @@ -673,6 +663,11 @@ int tls_get_more_records(OSSL_RECORD_LAYER *rl) } } + if (!rl->funcs->validate_record_header(rl, thisrr)) { + /* RLAYERfatal already called */ + return OSSL_RECORD_RETURN_FATAL; + } + /* now rl->rstate == SSL_ST_READ_BODY */ } diff --git a/deps/openssl/openssl/ssl/s3_lib.c b/deps/openssl/openssl/ssl/s3_lib.c index 213ec84b171d5a..0e1445b38fb7d7 100644 --- a/deps/openssl/openssl/ssl/s3_lib.c +++ b/deps/openssl/openssl/ssl/s3_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * Copyright 2005 Nokia. All rights reserved. * @@ -4322,7 +4322,7 @@ long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)(void)) switch (cmd) { #if !defined(OPENSSL_NO_DEPRECATED_3_0) case SSL_CTRL_SET_TMP_DH_CB: - sc->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp; + sc->cert->dh_tmp_cb = (DH * (*)(SSL *, int, int)) fp; ret = 1; break; #endif @@ -4593,7 +4593,7 @@ long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void)) switch (cmd) { #if !defined(OPENSSL_NO_DEPRECATED_3_0) case SSL_CTRL_SET_TMP_DH_CB: { - ctx->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp; + ctx->cert->dh_tmp_cb = (DH * (*)(SSL *, int, int)) fp; } break; #endif case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB: diff --git a/deps/openssl/openssl/ssl/ssl_asn1.c b/deps/openssl/openssl/ssl/ssl_asn1.c index 13ab6490b9a7a6..5d4ec7e6ed8713 100644 --- a/deps/openssl/openssl/ssl/ssl_asn1.c +++ b/deps/openssl/openssl/ssl/ssl_asn1.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. * Copyright 2005 Nokia. All rights reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use @@ -81,7 +81,7 @@ ASN1_SEQUENCE(SSL_SESSION_ASN1) = { ASN1_EXP_OPT(SSL_SESSION_ASN1, peer_rpk, ASN1_OCTET_STRING, 20) } static_ASN1_SEQUENCE_END(SSL_SESSION_ASN1) -IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(SSL_SESSION_ASN1) + IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(SSL_SESSION_ASN1) /* Utility functions for i2d_SSL_SESSION */ diff --git a/deps/openssl/openssl/ssl/ssl_lib.c b/deps/openssl/openssl/ssl/ssl_lib.c index 05b0209a76b323..ac77faa677ce25 100644 --- a/deps/openssl/openssl/ssl/ssl_lib.c +++ b/deps/openssl/openssl/ssl/ssl_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * Copyright 2005 Nokia. All rights reserved. * @@ -3412,21 +3412,22 @@ char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size) int i; const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); - if (size < 2 || buf == NULL) + if (sc == NULL) return NULL; - buf[0] = '\0'; - - if (sc == NULL || !sc->server) + if (!sc->server + || sc->peer_ciphers == NULL + || size < 2) return NULL; p = buf; clntsk = sc->peer_ciphers; srvrsk = SSL_get_ciphers(s); + if (clntsk == NULL || srvrsk == NULL) + return NULL; - if (clntsk == NULL || sk_SSL_CIPHER_num(clntsk) == 0 - || srvrsk == NULL || sk_SSL_CIPHER_num(srvrsk) == 0) - return buf; + if (sk_SSL_CIPHER_num(clntsk) == 0 || sk_SSL_CIPHER_num(srvrsk) == 0) + return NULL; for (i = 0; i < sk_SSL_CIPHER_num(clntsk); i++) { int n; @@ -3446,9 +3447,10 @@ char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size) } /* No overlap */ - if (p != buf) - p[-1] = '\0'; + if (p == buf) + return NULL; + p[-1] = '\0'; return buf; } diff --git a/deps/openssl/openssl/ssl/ssl_sess.c b/deps/openssl/openssl/ssl/ssl_sess.c index 04cbfa5cfa9469..e54fb53e5294a2 100644 --- a/deps/openssl/openssl/ssl/ssl_sess.c +++ b/deps/openssl/openssl/ssl/ssl_sess.c @@ -790,10 +790,10 @@ int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c) ssl_tsan_counter(ctx, &ctx->stats.sess_cache_full); } } - - SSL_SESSION_list_add(ctx, c); } + SSL_SESSION_list_add(ctx, c); + if (s != NULL) { /* * existing cache entry -- decrement previously incremented reference diff --git a/deps/openssl/openssl/ssl/statem/statem_dtls.c b/deps/openssl/openssl/ssl/statem/statem_dtls.c index f62b757721fcd0..4052ef6219b8bb 100644 --- a/deps/openssl/openssl/ssl/statem/statem_dtls.c +++ b/deps/openssl/openssl/ssl/statem/statem_dtls.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2005-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -1177,11 +1177,7 @@ int dtls1_buffer_message(SSL_CONNECTION *s, int is_ccs) return 0; } - if (pqueue_insert(s->d1->sent_messages, item) == NULL) { - dtls1_hm_fragment_free(frag); - pitem_free(item); - return 0; - } + pqueue_insert(s->d1->sent_messages, item); return 1; } diff --git a/deps/openssl/openssl/ssl/t1_lib.c b/deps/openssl/openssl/ssl/t1_lib.c index ded6a1eadfb87f..cd471a636db162 100644 --- a/deps/openssl/openssl/ssl/t1_lib.c +++ b/deps/openssl/openssl/ssl/t1_lib.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -211,7 +211,7 @@ static const uint16_t suiteb_curves[] = { /* Group list string of the built-in pseudo group DEFAULT_SUITE_B */ #define SUITE_B_GROUP_NAME "DEFAULT_SUITE_B" -#define SUITE_B_GROUP_LIST "?secp256r1:?secp384r1", +#define SUITE_B_GROUP_LIST "secp256r1:secp384r1", struct provider_ctx_data_st { SSL_CTX *ctx; @@ -1244,8 +1244,8 @@ typedef struct { size_t ksidcnt; /* Number of key shares */ uint16_t *ksid_arr; /* The IDs of the key share groups (flat list) */ /* Variable to keep state between execution of callback or helper functions */ - int inner; /* Are we expanding a DEFAULT list */ - int first; /* First tuple of possibly nested expansion? */ + size_t tuple_mode; /* Keeps track whether tuple_cb called from 'the top' or from gid_cb */ + int ignore_unknown_default; /* Flag such that unknown groups for DEFAULT[_XYZ] are ignored */ } gid_cb_st; /* Forward declaration of tuple callback function */ @@ -1264,7 +1264,7 @@ static int gid_cb(const char *elem, int len, void *arg) int found_group = 0; char etmp[GROUP_NAME_BUFFER_LENGTH]; int retval = 1; /* We assume success */ - const char *current_prefix; + char *current_prefix; int ignore_unknown = 0; int add_keyshare = 0; int remove_group = 0; @@ -1320,16 +1320,16 @@ static int gid_cb(const char *elem, int len, void *arg) for (i = 0; i < OSSL_NELEM(default_group_strings); i++) { if ((size_t)len == (strlen(default_group_strings[i].list_name)) && OPENSSL_strncasecmp(default_group_strings[i].list_name, elem, len) == 0) { - int saved_first; - /* * We're asked to insert an entire list of groups from a * DEFAULT[_XYZ] 'pseudo group' which we do by * recursively calling this function (indirectly via * CONF_parse_list and tuple_cb); essentially, we treat a DEFAULT * group string like a tuple which is appended to the current tuple - * rather then starting a new tuple. + * rather then starting a new tuple. Variable tuple_mode is the flag which + * controls append tuple vs start new tuple. */ + if (ignore_unknown || remove_group) return -1; /* removal or ignore not allowed here -> syntax error */ @@ -1350,17 +1350,15 @@ static int gid_cb(const char *elem, int len, void *arg) default_group_strings[i].group_string, strlen(default_group_strings[i].group_string)); restored_default_group_string[strlen(default_group_strings[i].group_string) + restored_prefix_index] = '\0'; - /* - * Append first tuple of result to current tuple, and don't - * terminate the last tuple until we return to a top-level - * tuple_cb. - */ - saved_first = garg->first; - garg->inner = garg->first = 1; + /* We execute the recursive call */ + garg->ignore_unknown_default = 1; /* We ignore unknown groups for DEFAULT_XYZ */ + /* we enforce group mode (= append tuple) for DEFAULT_XYZ group lists */ + garg->tuple_mode = 0; + /* We use the tuple_cb callback to process the pseudo group tuple */ retval = CONF_parse_list(restored_default_group_string, TUPLE_DELIMITER_CHARACTER, 1, tuple_cb, garg); - garg->inner = 0; - garg->first = saved_first; + garg->tuple_mode = 1; /* next call to tuple_cb will again start new tuple */ + garg->ignore_unknown_default = 0; /* reset to original value */ /* We don't need the \0-terminated string anymore */ OPENSSL_free(restored_default_group_string); @@ -1380,6 +1378,9 @@ static int gid_cb(const char *elem, int len, void *arg) if (len == 0) return -1; /* Seems we have prefxes without a group name -> syntax error */ + if (garg->ignore_unknown_default == 1) /* Always ignore unknown groups for DEFAULT[_XYZ] */ + ignore_unknown = 1; + /* Memory management in case more groups are present compared to initial allocation */ if (garg->gidcnt == garg->gidmax) { uint16_t *tmp = OPENSSL_realloc(garg->gid_arr, @@ -1513,7 +1514,7 @@ static int gid_cb(const char *elem, int len, void *arg) /* and update the book keeping for the number of groups in current tuple */ garg->tuplcnt_arr[garg->tplcnt]++; - /* We want to add a key share for the current group */ + /* We memorize if needed that we want to add a key share for the current group */ if (add_keyshare) garg->ksid_arr[garg->ksidcnt++] = gid; } @@ -1522,39 +1523,6 @@ static int gid_cb(const char *elem, int len, void *arg) return retval; } -static int grow_tuples(gid_cb_st *garg) -{ - static size_t max_tplcnt = (~(size_t)0) / sizeof(size_t); - - /* This uses OPENSSL_realloc_array() in newer releases */ - if (garg->tplcnt == garg->tplmax) { - size_t newcnt = garg->tplmax + GROUPLIST_INCREMENT; - size_t newsz = newcnt * sizeof(size_t); - size_t *tmp; - - if (newsz > max_tplcnt - || (tmp = OPENSSL_realloc(garg->tuplcnt_arr, newsz)) == NULL) - return 0; - - garg->tplmax = newcnt; - garg->tuplcnt_arr = tmp; - } - return 1; -} - -static int close_tuple(gid_cb_st *garg) -{ - size_t gidcnt = garg->tuplcnt_arr[garg->tplcnt]; - - if (gidcnt == 0) - return 1; - if (!grow_tuples(garg)) - return 0; - - garg->tuplcnt_arr[++garg->tplcnt] = 0; - return 1; -} - /* Extract and process a tuple of groups */ static int tuple_cb(const char *tuple, int len, void *arg) { @@ -1568,9 +1536,16 @@ static int tuple_cb(const char *tuple, int len, void *arg) return 0; } - if (garg->inner && !garg->first && !close_tuple(garg)) - return 0; - garg->first = 0; + /* Memory management for tuples */ + if (garg->tplcnt == garg->tplmax) { + size_t *tmp = OPENSSL_realloc(garg->tuplcnt_arr, + (garg->tplmax + GROUPLIST_INCREMENT) * sizeof(*garg->tuplcnt_arr)); + + if (tmp == NULL) + return 0; + garg->tplmax += GROUPLIST_INCREMENT; + garg->tuplcnt_arr = tmp; + } /* Convert to \0-terminated string */ restored_tuple_string = OPENSSL_malloc((len + 1 /* \0 */) * sizeof(char)); @@ -1585,8 +1560,15 @@ static int tuple_cb(const char *tuple, int len, void *arg) /* We don't need the \o-terminated string anymore */ OPENSSL_free(restored_tuple_string); - if (!garg->inner && !close_tuple(garg)) - return 0; + if (garg->tuplcnt_arr[garg->tplcnt] > 0) { /* Some valid groups are present in current tuple... */ + if (garg->tuple_mode) { + /* We 'close' the tuple */ + garg->tplcnt++; + garg->tuplcnt_arr[garg->tplcnt] = 0; /* Next tuple is initialized to be empty */ + garg->tuple_mode = 1; /* next call will start a tuple (unless overridden in gid_cb) */ + } + } + return retval; } @@ -1617,6 +1599,8 @@ int tls1_set_groups_list(SSL_CTX *ctx, } memset(&gcb, 0, sizeof(gcb)); + gcb.tuple_mode = 1; /* We prepare to collect the first tuple */ + gcb.ignore_unknown_default = 0; gcb.gidmax = GROUPLIST_INCREMENT; gcb.tplmax = GROUPLIST_INCREMENT; gcb.ksidmax = GROUPLIST_INCREMENT; diff --git a/deps/openssl/openssl/util/checkplatformsyms.pl b/deps/openssl/openssl/util/checkplatformsyms.pl index 73f2a1b62184a0..742dd8ea84fe30 100755 --- a/deps/openssl/openssl/util/checkplatformsyms.pl +++ b/deps/openssl/openssl/util/checkplatformsyms.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2006-2023 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -14,13 +14,6 @@ shift(@ARGV); -# Check that object files exist -foreach (@ARGV) { - unless (-f $_ && -r $_) { - die "Path is not a regular readable file: '$_'"; - } -} - my $objlist; my $objfilelist = join(" ", @ARGV); my $expsyms; @@ -43,13 +36,13 @@ { chomp; my $dllfile = $_; - $dllfile =~ s/( +)(.*)(\.dll)(.*)/DLLFILE $2/; + $dllfile =~ s/( +)(.*)(\.dll)(.*)/DLLFILE \2/; if (index($dllfile, "DLLFILE") >= 0) { $currentdll = substr($dllfile, 8); $currentdll =~ s/^\s+|s+$//g; } # filter imports from our own library - if ("$currentdll" !~ /^libcrypto-[1-9][0-9]*(-x64)?$/) { + if ("$currentdll" ne "libcrypto-3-x64") { my $line = $_; $line =~ s/ [0-9a-fA-F]{1,2} /SYMBOL /; if (index($line, "SYMBOL") != -1) { @@ -58,28 +51,18 @@ } } } - - close($OBJFH); - ($? >> 8 == 0) or die "Command '$cmd' has failed."; - - my $ok = 1; foreach (@symlist) { - chomp; if (index($exps, $_) < 0) { print "Symbol $_ not in the allowed platform symbols list\n"; - $ok = 0; + exit 1; } } - exit !$ok; + exit 0; } else { - $cmd = "objdump -t " . $objfilelist . " | awk " . - "'/\\\\*UND\\\\*/ {" . - "split(\$NF, sym_lib, \"@\");" . - "if (sym_lib[2] !~ \"OPENSSL_[1-9][0-9]*\\\\.[0-9]+\\\\.[0-9]+\$\")" . - "syms[sym_lib[1]] = 1;" . - "}" . - "END { for (s in syms) print s; };'"; + $cmd = "objdump -t " . $objfilelist . " | grep UND | grep -v \@OPENSSL"; + $cmd = $cmd . " | awk '{print \$NF}' |"; + $cmd = $cmd . " sed -e\"s/@.*\$//\" | sort | uniq"; open $expsyms, '<', $expectedsyms or die; { @@ -89,16 +72,13 @@ close($expsyms); open($OBJFH, "$cmd|") or die "Cannot open process: $!"; - my $ok = 1; while (<$OBJFH>) { - chomp; if (index($exps, $_) < 0) { print "Symbol $_ not in the allowed platform symbols list\n"; - $ok = 0; + exit 1; } } close($OBJFH); - - exit !(!($? >> 8) || !$ok); + exit 0; } diff --git a/deps/openssl/openssl/util/missingcrypto.txt b/deps/openssl/openssl/util/missingcrypto.txt index 269c1d3fa1060b..3bed02a6ca79e1 100644 --- a/deps/openssl/openssl/util/missingcrypto.txt +++ b/deps/openssl/openssl/util/missingcrypto.txt @@ -1043,6 +1043,8 @@ X509V3_EXT_get(3) X509V3_EXT_get_nid(3) X509V3_EXT_nconf(3) X509V3_EXT_nconf_nid(3) +X509V3_EXT_print(3) +X509V3_EXT_print_fp(3) X509V3_EXT_val_prn(3) X509V3_NAME_from_section(3) X509V3_add_standard_extensions(3) diff --git a/deps/openssl/openssl/util/mkerr.pl b/deps/openssl/openssl/util/mkerr.pl index e2479e727b74df..803a3efc83cf78 100755 --- a/deps/openssl/openssl/util/mkerr.pl +++ b/deps/openssl/openssl/util/mkerr.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 1999-2026 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -339,21 +339,21 @@ sub help */ #ifndef $guard -#define $guard -#pragma once +# define $guard +# pragma once -#include -#include +# include +# include -#ifdef __cplusplus +# ifdef __cplusplus extern \"C\" { -#endif +# endif EOF $indent = ' '; if ($disablable) { print OUT <<"EOF"; -#ifndef OPENSSL_NO_${lib} +# ifndef OPENSSL_NO_${lib} EOF $indent = " "; @@ -380,7 +380,7 @@ sub help $rassigned{$lib} .= "$findcode:"; print STDERR "New Reason code $i\n" if $debug; } - printf OUT "#define $i $rcodes{$i}\n"; + printf OUT "#${indent}define $i%s $rcodes{$i}\n", " " x $z; } print OUT "\n"; } @@ -389,14 +389,14 @@ sub help # brace for 'extern "C" {'. while (length($indent) > 1) { $indent = substr $indent, 0, -1; - print OUT "#endif\n"; + print OUT "#${indent}endif\n"; } print OUT <<"EOF"; -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif EOF close OUT; @@ -408,8 +408,8 @@ sub help my $extra_include = $internal ? ($lib ne 'SSL' - ? "#include \n" - : "#include \n") + ? "# include \n" + : "# include \n") : ''; my $hfile = $hpubinc{$lib}; my $guard = $hfile; @@ -430,43 +430,46 @@ sub help */ #ifndef $guard -#define $guard -#pragma once +# define $guard +# pragma once -#include -#include +# include +# include $extra_include + EOF $indent = ' '; if ( $internal ) { if ($disablable) { print OUT <<"EOF"; -#ifndef OPENSSL_NO_${lib} +# ifndef OPENSSL_NO_${lib} + EOF $indent .= ' '; } } else { print OUT <<"EOF"; -#define ${lib}err(f, r) ERR_${lib}_error(0, (r), OPENSSL_FILE, OPENSSL_LINE) -#define ERR_R_${lib}_LIB ERR_${lib}_lib() +# define ${lib}err(f, r) ERR_${lib}_error(0, (r), OPENSSL_FILE, OPENSSL_LINE) +# define ERR_R_${lib}_LIB ERR_${lib}_lib() + EOF if ( ! $static ) { print OUT <<"EOF"; -#ifdef __cplusplus +# ifdef __cplusplus extern \"C\" { -#endif +# endif int ERR_load_${lib}_strings(void); void ERR_unload_${lib}_strings(void); void ERR_${lib}_error(int function, int reason, const char *file, int line); -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif EOF } } - print OUT "/*\n * $lib reason codes.\n */\n"; + print OUT "\n/*\n * $lib reason codes.\n */\n"; foreach my $i ( @reasons ) { my $z = 48 - length($i); $z = 0 if $z < 0; @@ -481,13 +484,13 @@ sub help $rassigned{$lib} .= "$findcode:"; print STDERR "New Reason code $i\n" if $debug; } - printf OUT "#define $i $rcodes{$i}\n"; + printf OUT "#${indent}define $i%s $rcodes{$i}\n", " " x $z; } print OUT "\n"; while (length($indent) > 0) { $indent = substr $indent, 0, -1; - print OUT "#endif\n"; + print OUT "#${indent}endif\n"; } close OUT; } @@ -547,7 +550,7 @@ sub help } } print OUT <<"EOF"; -#ifndef OPENSSL_NO_ERR +#${indent}ifndef OPENSSL_NO_ERR static ${const}ERR_STRING_DATA ${lib}_str_reasons[] = { EOF @@ -565,26 +568,26 @@ sub help $strings{$i} = $rn; } my $lines; - $lines = " { ERR_PACK($pack_lib, 0, $i), \"$rn\" },"; - $lines = " { ERR_PACK($pack_lib, 0, $i),\n \"$rn\" }," - if length($lines) > 82; + $lines = " {ERR_PACK($pack_lib, 0, $i), \"$rn\"},"; + $lines = " {ERR_PACK($pack_lib, 0, $i),\n \"$rn\"}," + if length($lines) > 80; print OUT "$lines\n"; } print OUT <<"EOF"; - { 0, NULL } + {0, NULL} }; -#endif +#${indent}endif EOF if ( $internal ) { print OUT <<"EOF"; int ossl_err_load_${lib}_strings(void) { -#ifndef OPENSSL_NO_ERR +#${indent}ifndef OPENSSL_NO_ERR if (ERR_reason_error_string(${lib}_str_reasons[0].error) == NULL) ERR_load_strings_const(${lib}_str_reasons); -#endif +#${indent}endif return 1; } EOF @@ -639,7 +642,7 @@ sub help while (length($indent) > 1) { $indent = substr $indent, 0, -1; - print OUT "#endif\n"; + print OUT "#${indent}endif\n"; } if ($internal && $disablable) { print OUT <<"EOF"; diff --git a/deps/openssl/openssl/util/mkinstallvars.pl b/deps/openssl/openssl/util/mkinstallvars.pl index 6e15282ddbff96..706bf38d02dbd4 100644 --- a/deps/openssl/openssl/util/mkinstallvars.pl +++ b/deps/openssl/openssl/util/mkinstallvars.pl @@ -29,7 +29,7 @@ LIBDIR => [ qw(ENGINESDIR MODULESDIR PKGCONFIGDIR CMAKECONFIGDIR) ]); # For completeness, other expected variables -my @others = qw(COMMENT VERSION LDLIBS); +my @others = qw(VERSION LDLIBS); my %all = ( ); foreach (@absolutes) { $all{$_} = 1 } @@ -135,10 +135,9 @@ package OpenSSL::safe::installdata; } print <<_____; - \$COMMENT \$VERSION \@LDLIBS + \$VERSION \@LDLIBS ); -our \$COMMENT = '$values{COMMENT}->[0]'; _____ foreach my $k (@absolutes) { diff --git a/deps/openssl/openssl/util/platform_symbols/windows-symbols.txt b/deps/openssl/openssl/util/platform_symbols/windows-symbols.txt index 0f6cc11450cd03..ef82cb14c8c2c6 100644 --- a/deps/openssl/openssl/util/platform_symbols/windows-symbols.txt +++ b/deps/openssl/openssl/util/platform_symbols/windows-symbols.txt @@ -1,175 +1,236 @@ -AcquireSRWLockExclusive -AcquireSRWLockShared -CertCloseStore -CertFindCertificateInStore -CertFreeCertificateContext -CertOpenSystemStoreW -CloseHandle -ConvertFiberToThread -ConvertThreadToFiberEx -CreateFiberEx -CreateSemaphoreA -CryptAcquireContextW CryptGenRandom +RegisterEventSourceW +ReportEventW +CryptAcquireContextW CryptReleaseContext -DeleteCriticalSection -DeleteFiber DeregisterEventSource -DisableThreadLibraryCalls -EnterCriticalSection -FindClose -FindFirstFileW -FindNextFileW -FormatMessageA -FreeLibrary -GetACP -GetConsoleMode -GetCurrentProcess -GetCurrentProcessId -GetCurrentThreadId -GetEnvironmentVariableW -GetExitCodeThread -GetFileType -GetLastError -GetModuleHandleExW -GetModuleHandleW -GetProcAddress -GetProcessWindowStation -GetStartupInfoW -GetStdHandle -GetSystemDirectoryA -GetSystemInfo -GetSystemTime -GetSystemTimeAsFileTime +CertFindCertificateInStore +CertFreeCertificateContext +CertOpenSystemStoreW +CertCloseStore GetUserObjectInformationW -InitializeCriticalSection -InitializeSListHead -InitializeSRWLock -IsDebuggerPresent -IsProcessorFeaturePresent -LeaveCriticalSection -LoadLibraryA -LoadLibraryW +GetProcessWindowStation MessageBoxW -MultiByteToWideChar -QueryPerformanceCounter -ReadConsoleA +GetCurrentProcess ReadConsoleW -RegisterEventSourceW -ReleaseSRWLockExclusive -ReleaseSRWLockShared +ReadConsoleA +SetConsoleMode +GetConsoleMode +CreateSemaphoreA +GetExitCodeThread +WaitForSingleObject ReleaseSemaphore -ReportEventW +GetCurrentProcessId +TryEnterCriticalSection +LeaveCriticalSection +EnterCriticalSection +InitializeCriticalSection +SystemTimeToFileTime +GetSystemTime +TlsFree +TlsSetValue +TlsGetValue +GetSystemTimeAsFileTime RtlCaptureContext RtlLookupFunctionEntry -RtlVirtualUnwind -SetConsoleMode -SetLastError +UnhandledExceptionFilter SetUnhandledExceptionFilter -Sleep -SwitchToFiber -SystemTimeToFileTime +IsProcessorFeaturePresent +IsDebuggerPresent +GetStartupInfoW +QueryPerformanceCounter +InitializeSListHead +DeleteCriticalSection TerminateProcess TlsAlloc -TlsFree -TlsGetValue -TlsSetValue -TryEnterCriticalSection -UnhandledExceptionFilter +GetCurrentThreadId +AcquireSRWLockShared +AcquireSRWLockExclusive +RtlVirtualUnwind +ConvertFiberToThread +ConvertThreadToFiberEx +SwitchToFiber +DeleteFiber +CreateFiberEx +GetSystemDirectoryA +FreeLibrary +GetProcAddress +LoadLibraryA +FormatMessageA +GetLastError +SetLastError +CloseHandle +LoadLibraryW +GetEnvironmentVariableW +GetStdHandle +GetFileType +WriteFile +GetModuleHandleW +MultiByteToWideChar +WideCharToMultiByte +GetACP +GetModuleHandleExW +GetSystemInfo VirtualAlloc +VirtualProtect VirtualFree VirtualLock -VirtualProtect -WSAIoctl -WSASocketA -WaitForSingleObject -WideCharToMultiByte -WriteFile -__C_specific_handler -__acrt_iob_func +FindClose +FindFirstFileW +FindNextFileW +Sleep +InitializeSRWLock +ReleaseSRWLockExclusive +ReleaseSRWLockShared __current_exception +__C_specific_handler +wcsstr __current_exception_context +strlen +strstr +strchr +memmove +strrchr +memcmp +memset +memcpy +memchr __std_type_info_destroy_list -__stdio_common_vfprintf -__stdio_common_vsnprintf_s __stdio_common_vsprintf -__stdio_common_vsprintf_s +__stdio_common_vfprintf __stdio_common_vsscanf +ftell +fseek +fread +_fileno __stdio_common_vswprintf +_wfopen +fopen +setvbuf +fflush +ferror +feof +clearerr +setbuf +fclose +fputs +__acrt_iob_func +__stdio_common_vsprintf_s +fwrite +fgets +_setmode +strtoul +atoi +strtol +tolower +strspn +strcspn +strncpy +strpbrk +strncmp +strcmp +strcat_s +isspace +_strdup +isdigit +strncpy_s +strcpy_s +_gmtime64_s __timezone +_mktime64 +_time64 +qsort +malloc +realloc +calloc +free +terminate +signal +_initialize_narrow_environment _beginthreadex -_cexit -_chmod -_configure_narrow_argv -_crt_at_quick_exit -_crt_atexit -_dclass _endthreadex -_errno +_register_onexit_function +strerror_s _execute_onexit_table +raise +_crt_atexit _exit -_fileno -_fstat64i32 -_get_osfhandle -_gmtime64_s -_initialize_narrow_environment +_crt_at_quick_exit +_errno +_cexit +_initterm_e +_configure_narrow_argv _initialize_onexit_table _initterm -_initterm_e -_mktime64 -_register_onexit_function _seh_filter_dll -_setmode +_chmod _stat64i32 -_strdup -_time64 -_wfopen -atoi -calloc -clearerr -fclose -feof -ferror -fflush -fgets -fopen -fputs -fread -free -fseek -ftell -fwrite +_fstat64i32 getenv -isdigit -isspace -malloc -memchr -memcmp +GetStartupInfoW +RtlLookupFunctionEntry +RtlVirtualUnwind +UnhandledExceptionFilter +GetSystemTime +SystemTimeToFileTime +CloseHandle +InitializeCriticalSection +EnterCriticalSection +LeaveCriticalSection +TryEnterCriticalSection +DeleteCriticalSection +ReleaseSemaphore +WaitForSingleObject +WSASocketA +WSAIoctl +GetCurrentThreadId +SetUnhandledExceptionFilter +GetExitCodeThread +CreateSemaphoreA +SetLastError +GetLastError +GetCurrentProcess +TerminateProcess +IsProcessorFeaturePresent +QueryPerformanceCounter +RtlCaptureContext +GetCurrentProcessId +GetSystemTimeAsFileTime +DisableThreadLibraryCalls +InitializeSListHead +IsDebuggerPresent +GetModuleHandleW memcpy -memmove memset -qsort -raise -realloc -setbuf -setvbuf -signal -strcat_s +__current_exception_context strchr -strcmp -strcpy_s -strcspn -strerror_s -strlen -strncmp -strncpy -strncpy_s -strpbrk -strrchr -strspn +memcmp +memchr strstr -strtol -strtoul +memmove +__std_type_info_destroy_list +__current_exception +__C_specific_handler +_errno +_endthreadex terminate -tolower -wcsstr +_initterm +_initterm_e +_seh_filter_dll +_configure_narrow_argv +_initialize_narrow_environment +_initialize_onexit_table +_register_onexit_function +_execute_onexit_table +_crt_atexit +_crt_at_quick_exit +_cexit +_beginthreadex +_time64 +strncmp +strcmp +qsort +_stat64i32 +atoi +__stdio_common_vsprintf +_dclass diff --git a/deps/openssl/openssl/util/wrap.pl.in b/deps/openssl/openssl/util/wrap.pl.in index 5b6b2a51428f4e..2c9cb29fec04d8 100644 --- a/deps/openssl/openssl/util/wrap.pl.in +++ b/deps/openssl/openssl/util/wrap.pl.in @@ -79,7 +79,6 @@ if ($ARGV[0] eq '-jitter') { $std_openssl_conf_include = catdir($there, 'providers'); } -local $ENV{OPENSSL_RUNNING_UNIT_TESTS} = "yes"; local $ENV{OPENSSL_CONF_INCLUDE} = $std_openssl_conf_include if defined $std_openssl_conf_include diff --git a/deps/perfetto/BUILD.gn b/deps/perfetto/BUILD.gn deleted file mode 100644 index df485c384d920a..00000000000000 --- a/deps/perfetto/BUILD.gn +++ /dev/null @@ -1,14 +0,0 @@ -############################################################################## -# # -# DO NOT EDIT THIS FILE! # -# # -############################################################################## - -# This file is used by GN for building, which is NOT the build system used for -# building official binaries. -# Please modify the gyp files if you are making changes to build system. - -import("unofficial.gni") - -perfetto_sdk_gn_build("perfetto_sdk") { -} diff --git a/deps/perfetto/LICENSE b/deps/perfetto/LICENSE deleted file mode 100644 index cbdc2881d57d5a..00000000000000 --- a/deps/perfetto/LICENSE +++ /dev/null @@ -1,265 +0,0 @@ - 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 - ------------------- - -Files: * except those files noted below - - Copyright (c) 2017, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - 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. - - ------------------- - -Files: src/trace_processor/perfetto_sql/stdlib/chromium/*, protos/third_party/chromium/*, test/trace_processor/diff_tests/stdlib/chrome/* - - Copyright 2015 The Chromium Authors - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google LLC nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ------------------- - -Files: src/trace_processor/perfetto_sql/preprocessor/preprocessor_grammar.{c, h} - -The author disclaims copyright to this source code. In place of a legal notice, here is a blessing: - -May you do good and not evil. -May you find forgiveness for yourself and forgive others. -May you share freely, never taking more than you give. - - ------------------- - -Files: src/base/intrusive_tree.cc - -$OpenBSD: tree.h,v 1.31 2023/03/08 04:43:09 guenther Exp $ - -Copyright 2002 Niels Provos -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/perfetto/VERSION b/deps/perfetto/VERSION deleted file mode 100644 index 517ac763657c22..00000000000000 --- a/deps/perfetto/VERSION +++ /dev/null @@ -1 +0,0 @@ -54.0 diff --git a/deps/perfetto/perfetto.gyp b/deps/perfetto/perfetto.gyp deleted file mode 100644 index 3836f3424cbd0e..00000000000000 --- a/deps/perfetto/perfetto.gyp +++ /dev/null @@ -1,22 +0,0 @@ -{ - 'variables': { - 'perfetto_sdk_sources': [ - 'sdk/perfetto.cc', - 'sdk/perfetto.h', - ] - }, - 'targets': [ - { - 'target_name': 'perfetto_sdk', - 'type': 'static_library', - 'include_dirs': [ 'sdk' ], - 'direct_dependent_settings': { - # Use like `#include "perfetto.h"` - 'include_dirs': [ 'sdk' ], - }, - 'sources': [ - '<@(perfetto_sdk_sources)', - ], - }, - ] -} diff --git a/deps/perfetto/sdk/perfetto.cc b/deps/perfetto/sdk/perfetto.cc deleted file mode 100644 index 2ccd11f7b8313d..00000000000000 --- a/deps/perfetto/sdk/perfetto.cc +++ /dev/null @@ -1,82755 +0,0 @@ -// Copyright (C) 2019 The Android Open Source Project -// -// 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 file is automatically generated by gen_amalgamated. Do not edit. - -// gen_amalgamated: predefined macros -#if !defined(PERFETTO_IMPLEMENTATION) -#define PERFETTO_IMPLEMENTATION -#endif -#include "perfetto.h" -// gen_amalgamated begin source: src/base/default_platform.cc -// gen_amalgamated begin header: include/perfetto/ext/base/platform.h -/* - * Copyright (C) 2023 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_PLATFORM_H_ -#define INCLUDE_PERFETTO_EXT_BASE_PLATFORM_H_ - -namespace perfetto { -namespace base { -namespace platform { - -// Executed before entering a syscall (e.g. poll, read, write etc) which might -// block. -// This is overridden in Google internal builds for dealing with userspace -// scheduling. -void BeforeMaybeBlockingSyscall(); - -// Executed after entering a syscall (e.g. poll, read, write etc) which might -// block. -// This is overridden in Google internal builds for dealing with userspace -// scheduling. -void AfterMaybeBlockingSyscall(); - -} // namespace platform -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_PLATFORM_H_ -/* - * Copyright (C) 2023 The Android Open Source Project - * - * 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. - */ - -// gen_amalgamated expanded: #include "perfetto/ext/base/platform.h" - -namespace perfetto { -namespace base { -namespace platform { - -// This is a no-op outside of Google3 where we have some custom logic to deal -// with the userspace scheduler. -void BeforeMaybeBlockingSyscall() {} - -// This is a no-op outside of Google3 where we have some custom logic to deal -// with the userspace scheduler. -void AfterMaybeBlockingSyscall() {} - -} // namespace platform -} // namespace base -} // namespace perfetto -// gen_amalgamated begin source: src/base/android_utils.cc -// gen_amalgamated begin header: include/perfetto/ext/base/android_utils.h -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_ANDROID_UTILS_H_ -#define INCLUDE_PERFETTO_EXT_BASE_ANDROID_UTILS_H_ - -#include -#include -#include - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" - -namespace perfetto { -namespace base { - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - -// Returns the value of the Android system property named `name`. If the -// property does not exist, returns an empty string (a non-existing property is -// the same as a property with an empty value for this API). -std::string GetAndroidProp(const char* name); - -#endif // PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - -struct Utsname { - std::string sysname; - std::string version; - std::string machine; - std::string release; -}; - -struct SystemInfo { - std::optional timezone_off_mins; - std::optional utsname_info; - std::optional page_size; - std::optional num_cpus; - std::optional system_ram_bytes; - std::string android_build_fingerprint; - std::string android_device_manufacturer; - std::optional android_sdk_version; - std::string android_soc_model; - std::string android_guest_soc_model; - std::string android_hardware_revision; - std::string android_storage_model; - std::string android_ram_model; - std::string android_serial_console; -}; - -// Returns the device's utsname information. -Utsname GetUtsname(); - -// Returns the device's system information. -SystemInfo GetSystemInfo(); - -// Returns the perfetto machine name. The PERFETTO_MACHINE_NAME env variable -// has the highest precedence in setting the machine name. In Android systems, -// if the env variable isn't set then the traced.machine_name system property -// is used. If no value is externally set, then the OS system name -// (see `uname -s`) is used as the default machine name. -std::string GetPerfettoMachineName(); - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_ANDROID_UTILS_H_ -// gen_amalgamated begin header: include/perfetto/ext/base/string_utils.h -// gen_amalgamated begin header: include/perfetto/ext/base/string_view.h -// gen_amalgamated begin header: include/perfetto/ext/base/fnv_hash.h -/* - * Copyright (C) 2019 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_FNV_HASH_H_ -#define INCLUDE_PERFETTO_EXT_BASE_FNV_HASH_H_ - -#include -#include -#include -#include -#include - -namespace perfetto::base { - -// A helper class which computes a 64-bit hash of the input data. -// The algorithm used is FNV-1a as it is fast and easy to implement and has -// relatively few collisions. -// WARNING: This hash function should not be used for any cryptographic purpose. -class FnvHasher { - public: - // Creates an empty hash object - constexpr FnvHasher() = default; - - // Hashes a numeric value. - template < - typename T, - typename std::enable_if::value, bool>::type = true> - void Update(T data) { - Update(reinterpret_cast(&data), sizeof(data)); - } - - constexpr void Update(char c) { return Update(&c, 1); } - - // Using the loop instead of "Update(str, strlen(str))" to avoid looping twice - constexpr void Update(const char* str) { - for (const auto* p = str; *p; ++p) - Update(*p); - } - - // Hashes a byte array. - constexpr void Update(const char* data, size_t size) { - for (size_t i = 0; i < size; i++) { - result_ ^= static_cast(data[i]); - // Note: Arithmetic overflow of unsigned integers is well defined in C++ - // standard unlike signed integers. - // https://stackoverflow.com/a/41280273 - result_ *= kFnv1a64Prime; - } - } - - // Allow hashing anything that has `data` and `size` and has the kHashable - // trait (e.g., base::StringView). - template > - constexpr void Update(const T& t) { - if constexpr (std::is_member_function_pointer_v) { - Update(t.data(), t.size()); - } else { - Update(t.data, t.size); - } - } - - constexpr void Update(std::string_view s) { Update(s.data(), s.size()); } - - constexpr uint64_t digest() const { return result_; } - - // Usage: - // uint64_t hashed_value = - // FnvHasher::Combine(33, false, "ABC", 458L, 3u, 'x'); - template - static constexpr uint64_t Combine(Ts&&... args) { - FnvHasher hasher; - hasher.UpdateAll(std::forward(args)...); - return hasher.digest(); - } - - // Creates a hasher with `args` already hashed. - // - // Usage: - // FnvHasher partial = FnvHasher::CreatePartial(33, false, "ABC", 458L); - template - static constexpr FnvHasher CreatePartial(Ts&&... args) { - FnvHasher hasher; - hasher.UpdateAll(std::forward(args)...); - return hasher; - } - - // `hasher.UpdateAll(33, false, "ABC")` is shorthand for: - // `hasher.Update(33); hasher.Update(false); hasher.Update("ABC");` - constexpr void UpdateAll() {} - - template - constexpr void UpdateAll(T&& arg, Ts&&... args) { - Update(arg); - UpdateAll(std::forward(args)...); - } - - private: - static constexpr uint64_t kFnv1a64OffsetBasis = 0xcbf29ce484222325; - static constexpr uint64_t kFnv1a64Prime = 0x100000001b3; - - uint64_t result_ = kFnv1a64OffsetBasis; -}; - -// base::FnvHash uses base::FnvHasher for integer values and falls back to -// std::hash for other types. This is needed as std::hash for integers is just -// the identity function and Perfetto uses open-addressing hash table, which are -// very sensitive to hash quality and are known to degrade in performance -// when using std::hash. -template -struct FnvHash { - // Version for ints, using base::FnvHasher. - template - auto operator()(const U& x) -> - typename std::enable_if::value, size_t>::type - const { - return FnvHasher::Combine(x); - } - - // Version for non-ints, falling back to std::hash. - template - auto operator()(const U& x) -> - typename std::enable_if::value, size_t>::type - const { - return std::hash()(x); - } -}; - -} // namespace perfetto::base - -#endif // INCLUDE_PERFETTO_EXT_BASE_FNV_HASH_H_ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_STRING_VIEW_H_ -#define INCLUDE_PERFETTO_EXT_BASE_STRING_VIEW_H_ - -#include - -#include -#include -#include - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" -// gen_amalgamated expanded: #include "perfetto/base/logging.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/fnv_hash.h" - -namespace perfetto { -namespace base { - -// A string-like object that refers to a non-owned piece of memory. -// Strings are internally NOT null terminated. -class StringView { - public: - // Allow hashing with base::FnvHash. - static constexpr bool kHashable = true; - static constexpr size_t npos = static_cast(-1); - - StringView() : data_(nullptr), size_(0) {} - StringView(const StringView&) = default; - StringView& operator=(const StringView&) = default; - StringView(const char* data, size_t size) : data_(data), size_(size) { - PERFETTO_DCHECK(size == 0 || data != nullptr); - } - - // Allow implicit conversion from any class that has a |data| and |size| field - // and has the kConvertibleToStringView trait (e.g., protozero::ConstChars). - template > - StringView(const T& x) : StringView(x.data, x.size) { - PERFETTO_DCHECK(x.size == 0 || x.data != nullptr); - } - - // Creates a StringView from a null-terminated C string. - // Deliberately not "explicit". - StringView(const char* cstr) : data_(cstr), size_(strlen(cstr)) { - PERFETTO_DCHECK(cstr != nullptr); - } - - StringView(std::string_view str) : data_(str.data()), size_(str.size()) {} - - // This instead has to be explicit, as creating a StringView out of a - // std::string can be subtle. - explicit StringView(const std::string& str) - : data_(str.data()), size_(str.size()) {} - - bool empty() const { return size_ == 0; } - size_t size() const { return size_; } - const char* data() const { return data_; } - const char* begin() const { return data_; } - const char* end() const { return data_ + size_; } - - char at(size_t pos) const { - PERFETTO_DCHECK(pos < size_); - return data_[pos]; - } - - size_t find(char c, size_t start_pos = 0) const { - for (size_t i = start_pos; i < size_; ++i) { - if (data_[i] == c) - return i; - } - return npos; - } - - size_t find(const StringView& str, size_t start_pos = 0) const { - if (start_pos > size()) - return npos; - auto it = std::search(begin() + start_pos, end(), str.begin(), str.end()); - size_t pos = static_cast(it - begin()); - return pos + str.size() <= size() ? pos : npos; - } - - size_t find(const char* str, size_t start_pos = 0) const { - return find(StringView(str), start_pos); - } - - size_t rfind(char c) const { - for (size_t i = size_; i > 0; --i) { - if (data_[i - 1] == c) - return i - 1; - } - return npos; - } - - StringView substr(size_t pos, size_t count = npos) const { - if (pos >= size_) - return StringView("", 0); - size_t rcount = std::min(count, size_ - pos); - return StringView(data_ + pos, rcount); - } - - bool CaseInsensitiveEq(const StringView& other) const { - if (size() != other.size()) - return false; - if (size() == 0) - return true; -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - return _strnicmp(data(), other.data(), size()) == 0; -#else - return strncasecmp(data(), other.data(), size()) == 0; -#endif - } - - bool CaseInsensitiveOneOf(const std::vector& others) const { - for (const StringView& other : others) { - if (CaseInsensitiveEq(other)) { - return true; - } - } - return false; - } - - bool StartsWith(const StringView& other) const { - if (other.size() == 0) - return true; - if (size() == 0) - return false; - if (other.size() > size()) - return false; - return memcmp(data(), other.data(), other.size()) == 0; - } - - bool EndsWith(const StringView& other) const { - if (other.size() == 0) - return true; - if (size() == 0) - return false; - if (other.size() > size()) - return false; - size_t off = size() - other.size(); - return memcmp(data() + off, other.data(), other.size()) == 0; - } - - std::string ToStdString() const { - return size_ == 0 ? "" : std::string(data_, size_); - } - - uint64_t Hash() const { - base::FnvHasher hasher; - hasher.Update(data_, size_); - return hasher.digest(); - } - - private: - const char* data_ = nullptr; - size_t size_ = 0; -}; - -inline bool operator==(const StringView& x, const StringView& y) { - if (x.size() != y.size()) - return false; - if (x.size() == 0) - return true; - return memcmp(x.data(), y.data(), x.size()) == 0; -} - -inline bool operator!=(const StringView& x, const StringView& y) { - return !(x == y); -} - -inline bool operator<(const StringView& x, const StringView& y) { - auto size = std::min(x.size(), y.size()); - if (size == 0) - return x.size() < y.size(); - int result = memcmp(x.data(), y.data(), size); - return result < 0 || (result == 0 && x.size() < y.size()); -} - -inline bool operator>=(const StringView& x, const StringView& y) { - return !(x < y); -} - -inline bool operator>(const StringView& x, const StringView& y) { - return y < x; -} - -inline bool operator<=(const StringView& x, const StringView& y) { - return !(y < x); -} - -} // namespace base -} // namespace perfetto - -template <> -struct std::hash<::perfetto::base::StringView> { - size_t operator()(const ::perfetto::base::StringView& sv) const { - return static_cast(sv.Hash()); - } -}; - -#endif // INCLUDE_PERFETTO_EXT_BASE_STRING_VIEW_H_ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_STRING_UTILS_H_ -#define INCLUDE_PERFETTO_EXT_BASE_STRING_UTILS_H_ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -// gen_amalgamated expanded: #include "perfetto/ext/base/string_view.h" - -namespace perfetto { -namespace base { - -inline char Lowercase(char c) { - return ('A' <= c && c <= 'Z') ? static_cast(c - ('A' - 'a')) : c; -} - -inline char Uppercase(char c) { - return ('a' <= c && c <= 'z') ? static_cast(c + ('A' - 'a')) : c; -} - -// Returns true if the character is an ASCII whitespace character. -// This is a locale-independent version that only considers ASCII whitespace: -// space (0x20), tab (0x09), newline (0x0A), vertical tab (0x0B), -// form feed (0x0C), and carriage return (0x0D). -inline bool IsSpace(char c) { - return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || - c == '\r'; -} - -inline std::optional CStringToUInt32(const char* s, int base = 10) { - char* endptr = nullptr; - auto value = static_cast(strtoul(s, &endptr, base)); - return (*s && !*endptr) ? std::make_optional(value) : std::nullopt; -} - -inline std::optional CStringToInt32(const char* s, int base = 10) { - char* endptr = nullptr; - auto value = static_cast(strtol(s, &endptr, base)); - return (*s && !*endptr) ? std::make_optional(value) : std::nullopt; -} - -// Note: it saturates to 7fffffffffffffff if parsing a hex number >= 0x8000... -inline std::optional CStringToInt64(const char* s, int base = 10) { - char* endptr = nullptr; - auto value = static_cast(strtoll(s, &endptr, base)); - return (*s && !*endptr) ? std::make_optional(value) : std::nullopt; -} - -inline std::optional CStringToUInt64(const char* s, int base = 10) { - char* endptr = nullptr; - auto value = static_cast(strtoull(s, &endptr, base)); - return (*s && !*endptr) ? std::make_optional(value) : std::nullopt; -} - -double StrToD(const char* nptr, char** endptr); - -inline std::optional CStringToDouble(const char* s) { - char* endptr = nullptr; - double value = StrToD(s, &endptr); - std::optional result(std::nullopt); - if (*s != '\0' && *endptr == '\0') - result = value; - return result; -} - -inline std::optional StringToUInt32(const std::string& s, - int base = 10) { - return CStringToUInt32(s.c_str(), base); -} - -inline std::optional StringToInt32(const std::string& s, - int base = 10) { - return CStringToInt32(s.c_str(), base); -} - -inline std::optional StringToUInt64(const std::string& s, - int base = 10) { - return CStringToUInt64(s.c_str(), base); -} - -inline std::optional StringToInt64(const std::string& s, - int base = 10) { - return CStringToInt64(s.c_str(), base); -} - -inline std::optional StringToDouble(const std::string& s) { - return CStringToDouble(s.c_str()); -} - -template -inline std::optional StringViewToNumber(const base::StringView& sv, - int base = 10) { - // std::from_chars() does not regonize the leading '+' character and only - // recognizes '-' so remove the '+' if it exists to avoid errors and match - // the behavior of the other string conversion utilities above. - size_t start_offset = !sv.empty() && sv.at(0) == '+' ? 1 : 0; - T value; - auto result = - std::from_chars(sv.begin() + start_offset, sv.end(), value, base); - if (result.ec == std::errc() && result.ptr == sv.end()) { - return value; - } else { - return std::nullopt; - } -} - -inline std::optional StringViewToUInt32(const base::StringView& sv, - int base = 10) { - // std::from_chars() does not recognize the leading '-' character for - // unsigned conversions, but strtol does. To Mimic the behavior of strtol, - // attempt a signed converion if we see a leading '-', and then cast the - // result back to unsigned. - if (sv.size() > 0 && sv.at(0) == '-') { - return static_cast >( - StringViewToNumber(sv, base)); - } else { - return StringViewToNumber(sv, base); - } -} - -inline std::optional StringViewToInt32(const base::StringView& sv, - int base = 10) { - return StringViewToNumber(sv, base); -} - -inline std::optional StringViewToUInt64(const base::StringView& sv, - int base = 10) { - // std::from_chars() does not recognize the leading '-' character for - // unsigned conversions, but strtol does. To Mimic the behavior of strtol, - // attempt a signed converion if we see a leading '-', and then cast the - // result back to unsigned. - if (sv.size() > 0 && sv.at(0) == '-') { - return static_cast >( - StringViewToNumber(sv, base)); - } else { - return StringViewToNumber(sv, base); - } -} - -inline std::optional StringViewToInt64(const base::StringView& sv, - int base = 10) { - return StringViewToNumber(sv, base); -} - -// TODO: As of Clang 19.0 std::from_chars is unimplemented for type double -// despite being part of C++17 standard, and already being supported by GCC and -// MSVC. Enable this once we have double support in Clang. -// inline std::optional StringViewToDouble(const base::StringView& sv) { -// return StringViewToNumber(sv); -// } - -bool StartsWith(const std::string& str, const std::string& prefix); -bool EndsWith(const std::string& str, const std::string& suffix); -bool StartsWithAny(const std::string& str, - const std::vector& prefixes); -bool Contains(const std::string& haystack, const std::string& needle); -bool Contains(const std::string& haystack, char needle); -bool Contains(const std::vector& haystack, - const std::string& needle); -size_t Find(const StringView& needle, const StringView& haystack); -bool CaseInsensitiveEqual(const std::string& first, const std::string& second); -std::string Join(const std::vector& parts, - const std::string& delim); -std::vector SplitString(const std::string& text, - const std::string& delimiter); -std::string StripPrefix(const std::string& str, const std::string& prefix); -std::string StripSuffix(const std::string& str, const std::string& suffix); -std::string TrimWhitespace(const std::string& str); -std::string ToLower(const std::string& str); -std::string ToUpper(const std::string& str); -std::string StripChars(const std::string& str, - const std::string& chars, - char replacement); -std::string ToHex(const char* data, size_t size); -inline std::string ToHex(const std::string& s) { - return ToHex(s.c_str(), s.size()); -} -std::string IntToHexString(uint32_t number); -std::string Uint64ToHexString(uint64_t number); -std::string Uint64ToHexStringNoPrefix(uint64_t number); -std::string ReplaceAll(std::string str, - const std::string& to_replace, - const std::string& replacement); - -// Checks if all characters in the input string view `str` are ASCII. -// -// If so, the function returns true and `output` is not modified. -// If `str` contains non-ASCII characters, the function returns false, -// removes invalid UTF-8 characters from `str`, and stores the result in -// `output`. -bool CheckAsciiAndRemoveInvalidUTF8(base::StringView str, std::string& output); - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -bool WideToUTF8(const std::wstring& source, std::string& output); -bool UTF8ToWide(const std::string& source, std::wstring& output); -#endif // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - -// A BSD-style strlcpy without the return value. -// Copies at most |dst_size|-1 characters. Unlike strncpy, it always \0 -// terminates |dst|, as long as |dst_size| is not 0. -// Unlike strncpy and like strlcpy it does not zero-pad the rest of |dst|. -// Returns nothing. The BSD strlcpy returns the size of |src|, which might -// be > |dst_size|. Anecdotal experience suggests people assume the return value -// is the number of bytes written in |dst|. That assumption can lead to -// dangerous bugs. -// In order to avoid being subtly uncompliant with strlcpy AND avoid misuse, -// the choice here is to return nothing. -inline void StringCopy(char* dst, const char* src, size_t dst_size) { - for (size_t i = 0; i < dst_size; ++i) { - if ((dst[i] = src[i]) == '\0') { - return; // We hit and copied the null terminator. - } - } - - // We were left off at dst_size. We over copied 1 byte. Null terminate. - if (PERFETTO_LIKELY(dst_size > 0)) - dst[dst_size - 1] = 0; -} - -// Like snprintf() but returns the number of chars *actually* written (without -// counting the null terminator) NOT "the number of chars which would have been -// written to the final string if enough space had been available". -// This should be used in almost all cases when the caller uses the return value -// of snprintf(). If the return value is not used, there is no benefit in using -// this wrapper, as this just calls snprintf() and mangles the return value. -// It always null-terminates |dst| (even in case of errors), unless -// |dst_size| == 0. -// Examples: -// SprintfTrunc(x, 4, "123whatever"): returns 3 and writes "123\0". -// SprintfTrunc(x, 4, "123"): returns 3 and writes "123\0". -// SprintfTrunc(x, 3, "123"): returns 2 and writes "12\0". -// SprintfTrunc(x, 2, "123"): returns 1 and writes "1\0". -// SprintfTrunc(x, 1, "123"): returns 0 and writes "\0". -// SprintfTrunc(x, 0, "123"): returns 0 and writes nothing. -// NOTE: This means that the caller has no way to tell when truncation happens -// vs the edge case of *just* fitting in the buffer. -size_t SprintfTrunc(char* dst, size_t dst_size, const char* fmt, ...) - PERFETTO_PRINTF_FORMAT(3, 4); - -// Line number starts from 1 -struct LineWithOffset { - base::StringView line; - uint32_t line_offset; - uint32_t line_num; -}; - -// For given string and offset Pfinds a line with character for -// which offset points, what number is this line (starts from 1), and the offset -// inside this line. returns std::nullopt if the offset points to -// line break character or exceeds string length. -std::optional FindLineWithOffset(base::StringView str, - uint32_t offset); - -// A helper class to facilitate construction and usage of write-once stack -// strings. -// Example usage: -// StackString<32> x("format %d %s", 42, string_arg); -// TakeString(x.c_str() | x.string_view() | x.ToStdString()); -// Rather than char x[32] + sprintf. -// Advantages: -// - Avoids useless zero-fills caused by people doing `char buf[32] {}` (mainly -// by fearing unknown snprintf failure modes). -// - Makes the code more robust in case of snprintf truncations (len() and -// string_view() will return the truncated length, unlike snprintf). -template -class StackString { - public: - explicit PERFETTO_PRINTF_FORMAT(/* 1=this */ 2, 3) - StackString(const char* fmt, ...) { - buf_[0] = '\0'; - va_list args; - va_start(args, fmt); - int res = vsnprintf(buf_, sizeof(buf_), fmt, args); - va_end(args); - buf_[sizeof(buf_) - 1] = '\0'; - len_ = res < 0 ? 0 : std::min(static_cast(res), sizeof(buf_) - 1); - } - - StringView string_view() const { return StringView(buf_, len_); } - std::string ToStdString() const { return std::string(buf_, len_); } - const char* c_str() const { return buf_; } - size_t len() const { return len_; } - char* mutable_data() { return buf_; } - - private: - char buf_[N]; - size_t len_ = 0; // Does not include the \0. -}; - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_STRING_UTILS_H_ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -// gen_amalgamated expanded: #include "perfetto/ext/base/android_utils.h" - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" - -#include - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) -#include -#endif - -// gen_amalgamated expanded: #include "perfetto/base/compiler.h" -// gen_amalgamated expanded: #include "perfetto/base/logging.h" -// gen_amalgamated expanded: #include "perfetto/base/time.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/string_utils.h" - -#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \ - !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL) && \ - !PERFETTO_BUILDFLAG(PERFETTO_OS_WASM) -#include -#include -#endif - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX_BUT_NOT_QNX) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) -#include -#endif - -namespace perfetto { -namespace base { - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - -std::string GetAndroidProp(const char* name) { - std::string ret; -#if __ANDROID_API__ >= 26 - const prop_info* pi = __system_property_find(name); - if (!pi) { - return ret; - } - __system_property_read_callback( - pi, - [](void* dst_void, const char*, const char* value, uint32_t) { - std::string& dst = *static_cast(dst_void); - dst = value; - }, - &ret); -#else // __ANDROID_API__ < 26 - char value_buf[PROP_VALUE_MAX]; - int len = __system_property_get(name, value_buf); - if (len > 0 && static_cast(len) < sizeof(value_buf)) { - ret = std::string(value_buf, static_cast(len)); - } -#endif - return ret; -} - -#endif // PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - -Utsname GetUtsname() { - Utsname utsname_info; -#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \ - !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL) && \ - !PERFETTO_BUILDFLAG(PERFETTO_OS_WASM) - struct utsname uname_info; - if (uname(&uname_info) == 0) { - utsname_info.sysname = uname_info.sysname; - utsname_info.version = uname_info.version; - utsname_info.machine = uname_info.machine; - utsname_info.release = uname_info.release; - } else { - PERFETTO_ELOG("Unable to read Utsname information"); - } -#endif // !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - return utsname_info; -} - -SystemInfo GetSystemInfo() { - SystemInfo info; - - info.timezone_off_mins = GetTimezoneOffsetMins(); - -#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) && \ - !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL) && \ - !PERFETTO_BUILDFLAG(PERFETTO_OS_WASM) - - info.utsname_info = GetUtsname(); - info.page_size = static_cast(sysconf(_SC_PAGESIZE)); - info.num_cpus = static_cast(sysconf(_SC_NPROCESSORS_CONF)); - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX_BUT_NOT_QNX) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - // Use the Linux-specific sysinfo() system call on Linux and Android. - // https://man7.org/linux/man-pages/man2/sysinfo.2.html - struct sysinfo sys_info; - if (sysinfo(&sys_info) == 0) { - info.system_ram_bytes = - static_cast(sys_info.totalram) * sys_info.mem_unit; - } -#else - // POSIX Fallback (macOS, BSD, etc.): Use sysconf() to get physical pages. - long pages = sysconf(_SC_PHYS_PAGES); - if (pages > 0 && info.page_size.has_value()) { - info.system_ram_bytes = static_cast(pages) * (*info.page_size); - } -#endif -#endif // !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - info.android_build_fingerprint = GetAndroidProp("ro.build.fingerprint"); - if (info.android_build_fingerprint.empty()) { - PERFETTO_ELOG("Unable to read ro.build.fingerprint"); - } - - info.android_device_manufacturer = GetAndroidProp("ro.product.manufacturer"); - if (info.android_device_manufacturer.empty()) { - PERFETTO_ELOG("Unable to read ro.product.manufacturer"); - } - - std::string sdk_str_value = GetAndroidProp("ro.build.version.sdk"); - info.android_sdk_version = StringToUInt64(sdk_str_value); - if (!info.android_sdk_version.has_value()) { - PERFETTO_ELOG("Unable to read ro.build.version.sdk"); - } - - info.android_soc_model = GetAndroidProp("ro.soc.model"); - if (info.android_soc_model.empty()) { - PERFETTO_ELOG("Unable to read ro.soc.model"); - } - - // guest_soc model is not always present - info.android_guest_soc_model = GetAndroidProp("ro.boot.guest_soc.model"); - - info.android_hardware_revision = GetAndroidProp("ro.boot.hardware.revision"); - if (info.android_hardware_revision.empty()) { - PERFETTO_ELOG("Unable to read ro.boot.hardware.revision"); - } - - info.android_storage_model = GetAndroidProp("ro.boot.hardware.ufs"); - if (info.android_storage_model.empty()) { - PERFETTO_ELOG("Unable to read ro.boot.hardware.ufs"); - } - - info.android_ram_model = GetAndroidProp("ro.boot.hardware.ddr"); - if (info.android_ram_model.empty()) { - PERFETTO_ELOG("Unable to read ro.boot.hardware.ddr"); - } - - info.android_serial_console = GetAndroidProp("init.svc.console"); - if (info.android_serial_console.empty()) { - PERFETTO_ELOG("Unable to read init.svc.console"); - } -#endif // PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - - return info; -} - -std::string GetPerfettoMachineName() { - const char* env_name = getenv("PERFETTO_MACHINE_NAME"); - if (env_name) { - return env_name; - } -#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - std::string name = base::GetAndroidProp("traced.machine_name"); - if (name.empty()) { - name = GetUtsname().sysname; - } - return name; -#else - return GetUtsname().sysname; -#endif -} - -} // namespace base -} // namespace perfetto -// gen_amalgamated begin source: src/base/base64.cc -// gen_amalgamated begin header: include/perfetto/ext/base/base64.h -// gen_amalgamated begin header: include/perfetto/ext/base/utils.h -// gen_amalgamated begin header: include/perfetto/ext/base/sys_types.h -/* - * Copyright (C) 2022 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_SYS_TYPES_H_ -#define INCLUDE_PERFETTO_EXT_BASE_SYS_TYPES_H_ - -// This headers deals with sys types commonly used in the codebase that are -// missing on Windows. - -#include // IWYU pragma: export -#include - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - -#ifdef __MINGW32__ - -using uid_t = int; -using gid_t = int; - -#else - -#if !PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) -// MinGW has these. clang-cl and MSVC, which use just the Windows SDK, don't. -using uid_t = int; -using gid_t = int; -using pid_t = int; -#endif // !GCC - -#if defined(_WIN64) -using ssize_t = int64_t; -#else -using ssize_t = long; -#endif // _WIN64 - -#endif // __MINGW32__ - -#endif // OS_WIN - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) -// From libcutils' android_filesystem_config.h -#ifndef AID_ROOT -#define AID_ROOT 0 -#endif -#ifndef AID_STATSD -#define AID_STATSD 1066 -#endif -#ifndef AID_SHELL -#define AID_SHELL 2000 -#endif -#endif - -namespace perfetto { -namespace base { - -// The machine ID used in the tracing core. -using MachineID = uint32_t; -// The default value reserved for the host trace. -constexpr MachineID kDefaultMachineID = 0; - -constexpr uid_t kInvalidUid = static_cast(-1); -constexpr pid_t kInvalidPid = static_cast(-1); - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_SYS_TYPES_H_ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_UTILS_H_ -#define INCLUDE_PERFETTO_EXT_BASE_UTILS_H_ - -#include -#include -#include -#include - -#include -#include -#include -#include - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" -// gen_amalgamated expanded: #include "perfetto/base/compiler.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/sys_types.h" - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -// Even if Windows has errno.h, the all syscall-restart behavior does not apply. -// Trying to handle EINTR can cause more harm than good if errno is left stale. -// Chromium does the same. -#define PERFETTO_EINTR(x) (x) -#else -#define PERFETTO_EINTR(x) \ - ([&] { \ - decltype(x) eintr_wrapper_result; \ - do { \ - eintr_wrapper_result = (x); \ - } while (eintr_wrapper_result == -1 && errno == EINTR); \ - return eintr_wrapper_result; \ - }()) -#endif - -namespace perfetto { -namespace base { - -namespace internal { -extern std::atomic g_cached_page_size; -uint32_t GetSysPageSizeSlowpath(); -} // namespace internal - -// Returns the system's page size. Use this when dealing with mmap, madvise and -// similar mm-related syscalls. -// This function might be called in hot paths. Avoid calling getpagesize() all -// the times, in many implementations getpagesize() calls sysconf() which is -// not cheap. -inline uint32_t GetSysPageSize() { - const uint32_t page_size = - internal::g_cached_page_size.load(std::memory_order_relaxed); - return page_size != 0 ? page_size : internal::GetSysPageSizeSlowpath(); -} - -template -constexpr size_t ArraySize(const T (&)[TSize]) { - return TSize; -} - -// Function object which invokes 'free' on its parameter, which must be -// a pointer. Can be used to store malloc-allocated pointers in std::unique_ptr: -// -// std::unique_ptr foo_ptr( -// static_cast(malloc(sizeof(int)))); -struct FreeDeleter { - inline void operator()(void* ptr) const { free(ptr); } -}; - -template -constexpr T AssumeLittleEndian(T value) { -#if !PERFETTO_IS_LITTLE_ENDIAN() - static_assert(false, "Unimplemented on big-endian archs"); -#endif - return value; -} - -// Round up |size| to a multiple of |alignment| (must be a power of two). -inline constexpr size_t AlignUp(size_t size, size_t alignment) { - return (size + alignment - 1) & ~(alignment - 1); -} - -// TODO(primiano): clean this up and move all existing usages to the constexpr -// version above. -template -constexpr size_t AlignUp(size_t size) { - static_assert((alignment & (alignment - 1)) == 0, "alignment must be a pow2"); - return AlignUp(size, alignment); -} - -inline bool IsAgain(int err) { - return err == EAGAIN || err == EWOULDBLOCK; -} - -// setenv(2)-equivalent. Deals with Windows vs Posix discrepancies. -void SetEnv(const std::string& key, const std::string& value); - -// unsetenv(2)-equivalent. Deals with Windows vs Posix discrepancies. -void UnsetEnv(const std::string& key); - -// Calls mallopt(M_PURGE, 0) on Android. Does nothing on other platforms. -// This forces the allocator to release freed memory. This is used to work -// around various Scudo inefficiencies. See b/170217718. -void MaybeReleaseAllocatorMemToOS(); - -// geteuid() on POSIX OSes, returns 0 on Windows (See comment in utils.cc). -uid_t GetCurrentUserId(); - -// Forks the process. -// Parent: prints the PID of the child, calls |parent_cb| and exits from the -// process with its return value. -// Child: redirects stdio onto /dev/null, chdirs into / and returns. -void Daemonize(std::function parent_cb); - -// Returns the path of the current executable, e.g. /foo/bar/exe. -std::string GetCurExecutablePath(); - -// Returns the directory where the current executable lives in, e.g. /foo/bar. -// This is independent of cwd(). -std::string GetCurExecutableDir(); - -// Memory returned by AlignedAlloc() must be freed via AlignedFree() not just -// free. It makes a difference on Windows where _aligned_malloc() and -// _aligned_free() must be paired. -// Prefer using the AlignedAllocTyped() below which takes care of the pairing. -void* AlignedAlloc(size_t alignment, size_t size); -void AlignedFree(void*); - -// Detects Sync-mode MTE (currently being tested in some Android builds). -// This is known to use extra memory for the stack history buffer. -bool IsSyncMemoryTaggingEnabled(); - -// A RAII version of the above, which takes care of pairing Aligned{Alloc,Free}. -template -struct AlignedDeleter { - inline void operator()(T* ptr) const { AlignedFree(ptr); } -}; - -// The remove_extent here and below is to allow defining unique_ptr. -// As per https://en.cppreference.com/w/cpp/memory/unique_ptr the Deleter takes -// always a T*, not a T[]*. -template -using AlignedUniquePtr = - std::unique_ptr::type>>; - -template -AlignedUniquePtr AlignedAllocTyped(size_t n_membs) { - using TU = typename std::remove_extent::type; - return AlignedUniquePtr( - static_cast(AlignedAlloc(alignof(TU), sizeof(TU) * n_membs))); -} - -// A RAII wrapper to invoke a function when leaving a function/scope. -template -class OnScopeExitWrapper { - public: - explicit OnScopeExitWrapper(Func f) : f_(std::move(f)), active_(true) {} - OnScopeExitWrapper(OnScopeExitWrapper&& other) noexcept - : f_(std::move(other.f_)), active_(other.active_) { - other.active_ = false; - } - ~OnScopeExitWrapper() { - if (active_) - f_(); - } - - private: - Func f_; - bool active_; -}; - -template -PERFETTO_WARN_UNUSED_RESULT OnScopeExitWrapper OnScopeExit(Func f) { - return OnScopeExitWrapper(std::move(f)); -} - -// Returns a xxd-style hex dump (hex + ascii chars) of the input data. -std::string HexDump(const void* data, size_t len, size_t bytes_per_line = 16); -inline std::string HexDump(const std::string& data, - size_t bytes_per_line = 16) { - return HexDump(data.data(), data.size(), bytes_per_line); -} - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_UTILS_H_ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_BASE64_H_ -#define INCLUDE_PERFETTO_EXT_BASE_BASE64_H_ - -#include -#include - -// gen_amalgamated expanded: #include "perfetto/ext/base/string_view.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h" // For ssize_t. - -namespace perfetto { -namespace base { - -// Returns the length of the destination string (included '=' padding). -// Does NOT include the size of the string null terminator. -inline size_t Base64EncSize(size_t src_size) { - return (src_size + 2) / 3 * 4; -} - -// Returns the upper bound on the length of the destination buffer. -// The actual decoded length might be <= the number returned here. -inline size_t Base64DecSize(size_t src_size) { - return (src_size + 3) / 4 * 3; -} - -// Does NOT null-terminate |dst|. -ssize_t Base64Encode(const void* src, - size_t src_size, - char* dst, - size_t dst_size); - -std::string Base64Encode(const void* src, size_t src_size); - -inline std::string Base64Encode(StringView sv) { - return Base64Encode(sv.data(), sv.size()); -} - -// Returns -1 in case of failure. -ssize_t Base64Decode(const char* src, - size_t src_size, - uint8_t* dst, - size_t dst_size); - -std::optional Base64Decode(const char* src, size_t src_size); - -inline std::optional Base64Decode(StringView sv) { - return Base64Decode(sv.data(), sv.size()); -} - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_BASE64_H_ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -// gen_amalgamated expanded: #include "perfetto/ext/base/base64.h" - -namespace perfetto { -namespace base { - -namespace { - -constexpr char kPadding = '='; - -constexpr char kEncTable[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -static_assert(sizeof(kEncTable) == (1u << 6) + sizeof('\0'), "Bad table size"); - -// Maps an ASCII character to its 6-bit value. It only contains translations -// from '+' to 'z'. Supports the standard (+/) and URL-safe (-_) alphabets. -constexpr uint8_t kX = 0xff; // Value used for invalid characters -constexpr uint8_t kDecTable[] = { - 62, kX, 62, kX, 63, 52, 53, 54, 55, 56, // 00 - 09 - 57, 58, 59, 60, 61, kX, kX, kX, 0, kX, // 10 - 19 - kX, kX, 0, 1, 2, 3, 4, 5, 6, 7, // 20 - 29 - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, // 30 - 39 - 18, 19, 20, 21, 22, 23, 24, 25, kX, kX, // 40 - 49 - kX, kX, 63, kX, 26, 27, 28, 29, 30, 31, // 50 - 59 - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, // 60 - 69 - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, // 70 - 79 -}; -constexpr char kMinDecChar = '+'; -constexpr char kMaxDecChar = 'z'; -static_assert(kMaxDecChar - kMinDecChar <= sizeof(kDecTable), "Bad table size"); - -inline uint8_t DecodeChar(char c) { - if (c < kMinDecChar || c > kMaxDecChar) - return kX; - return kDecTable[c - kMinDecChar]; -} - -} // namespace - -ssize_t Base64Encode(const void* src, - size_t src_size, - char* dst, - size_t dst_size) { - const size_t padded_dst_size = Base64EncSize(src_size); - if (dst_size < padded_dst_size) - return -1; // Not enough space in output. - - const uint8_t* rd = static_cast(src); - const uint8_t* const end = rd + src_size; - size_t wr_size = 0; - while (rd < end) { - uint8_t s[3]{}; - s[0] = *(rd++); - dst[wr_size++] = kEncTable[s[0] >> 2]; - - uint8_t carry0 = static_cast((s[0] & 0x03) << 4); - if (PERFETTO_LIKELY(rd < end)) { - s[1] = *(rd++); - dst[wr_size++] = kEncTable[carry0 | (s[1] >> 4)]; - } else { - dst[wr_size++] = kEncTable[carry0]; - dst[wr_size++] = kPadding; - dst[wr_size++] = kPadding; - break; - } - - uint8_t carry1 = static_cast((s[1] & 0x0f) << 2); - if (PERFETTO_LIKELY(rd < end)) { - s[2] = *(rd++); - dst[wr_size++] = kEncTable[carry1 | (s[2] >> 6)]; - } else { - dst[wr_size++] = kEncTable[carry1]; - dst[wr_size++] = kPadding; - break; - } - - dst[wr_size++] = kEncTable[s[2] & 0x3f]; - } - PERFETTO_DCHECK(wr_size == padded_dst_size); - return static_cast(padded_dst_size); -} - -std::string Base64Encode(const void* src, size_t src_size) { - std::string dst; - dst.resize(Base64EncSize(src_size)); - auto res = Base64Encode(src, src_size, &dst[0], dst.size()); - PERFETTO_CHECK(res == static_cast(dst.size())); - return dst; -} - -ssize_t Base64Decode(const char* src, - size_t src_size, - uint8_t* dst, - size_t dst_size) { - const size_t min_dst_size = Base64DecSize(src_size); - if (dst_size < min_dst_size) - return -1; - - const char* rd = src; - const char* const end = src + src_size; - size_t wr_size = 0; - - char s[4]{}; - while (rd < end) { - uint8_t d[4]; - for (uint32_t j = 0; j < 4; j++) { - // Padding is only feasible for the last 2 chars of each group of 4. - s[j] = rd < end ? *(rd++) : (j < 2 ? '\0' : kPadding); - d[j] = DecodeChar(s[j]); - if (d[j] == kX) - return -1; // Invalid input char. - } - dst[wr_size] = static_cast((d[0] << 2) | (d[1] >> 4)); - dst[wr_size + 1] = static_cast((d[1] << 4) | (d[2] >> 2)); - dst[wr_size + 2] = static_cast((d[2] << 6) | (d[3])); - wr_size += 3; - } - - PERFETTO_CHECK(wr_size <= dst_size); - wr_size -= (s[3] == kPadding ? 1 : 0) + (s[2] == kPadding ? 1 : 0); - return static_cast(wr_size); -} - -std::optional Base64Decode(const char* src, size_t src_size) { - std::string dst; - dst.resize(Base64DecSize(src_size)); - auto res = Base64Decode(src, src_size, reinterpret_cast(&dst[0]), - dst.size()); - if (res < 0) - return std::nullopt; // Decoding error. - - PERFETTO_CHECK(res <= static_cast(dst.size())); - dst.resize(static_cast(res)); - return std::make_optional(dst); -} - -} // namespace base -} // namespace perfetto -// gen_amalgamated begin source: src/base/crash_keys.cc -// gen_amalgamated begin header: include/perfetto/ext/base/crash_keys.h -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_CRASH_KEYS_H_ -#define INCLUDE_PERFETTO_EXT_BASE_CRASH_KEYS_H_ - -#include -#include - -#include -#include - -// gen_amalgamated expanded: #include "perfetto/base/compiler.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/string_view.h" - -// Crash keys are very simple global variables with static-storage that -// are reported on crash time for managed crashes (CHECK/FATAL/Watchdog). -// - Translation units can define a CrashKey and register it at some point -// during initialization. -// - CrashKey instances must be long-lived. They should really be just global -// static variable in the anonymous namespace. -// Example: -// subsystem_1.cc -// CrashKey g_client_id("ipc_client_id"); -// ... -// OnIpcReceived(client_id) { -// g_client_id.Set(client_id); -// ... // Process the IPC -// g_client_id.Clear(); -// } -// Or equivalently: -// OnIpcReceived(client_id) { -// auto scoped_key = g_client_id.SetScoped(client_id); -// ... // Process the IPC -// } -// -// If a crash happens while processing the IPC, the crash report will -// have a line "ipc_client_id: 42". -// -// Thread safety considerations: -// CrashKeys can be registered and set/cleared from any thread. -// There is no compelling use-case to have full acquire/release consistency when -// setting a key. This means that if a thread crashes immediately after a -// crash key has been set on another thread, the value printed on the crash -// report could be incomplete. The code guarantees defined behavior and does -// not rely on null-terminated string (in the worst case 32 bytes of random -// garbage will be printed out). - -// The tests live in logging_unittest.cc. - -namespace perfetto { -namespace base { - -constexpr size_t kCrashKeyMaxStrSize = 32; - -// CrashKey instances must be long lived -class CrashKey { - public: - class ScopedClear { - public: - explicit ScopedClear(CrashKey* k) : key_(k) {} - ~ScopedClear() { - if (key_) - key_->Clear(); - } - ScopedClear(const ScopedClear&) = delete; - ScopedClear& operator=(const ScopedClear&) = delete; - ScopedClear& operator=(ScopedClear&&) = delete; - ScopedClear(ScopedClear&& other) noexcept : key_(other.key_) { - other.key_ = nullptr; - } - - private: - CrashKey* key_; - }; - - // constexpr so it can be used in the anon namespace without requiring a - // global constructor. - // |name| must be a long-lived string. - constexpr explicit CrashKey(const char* name) - : registered_{}, type_(Type::kUnset), name_(name), str_value_{} {} - CrashKey(const CrashKey&) = delete; - CrashKey& operator=(const CrashKey&) = delete; - CrashKey(CrashKey&&) = delete; - CrashKey& operator=(CrashKey&&) = delete; - - enum class Type : uint8_t { kUnset = 0, kInt, kStr }; - - void Clear() { - int_value_.store(0, std::memory_order_relaxed); - type_.store(Type::kUnset, std::memory_order_relaxed); - } - - void Set(int64_t value) { - int_value_.store(value, std::memory_order_relaxed); - type_.store(Type::kInt, std::memory_order_relaxed); - if (PERFETTO_UNLIKELY(!registered_.load(std::memory_order_relaxed))) - Register(); - } - - void Set(StringView sv) { - size_t len = std::min(sv.size(), sizeof(str_value_) - 1); - for (size_t i = 0; i < len; ++i) - str_value_[i].store(sv.data()[i], std::memory_order_relaxed); - str_value_[len].store('\0', std::memory_order_relaxed); - type_.store(Type::kStr, std::memory_order_relaxed); - if (PERFETTO_UNLIKELY(!registered_.load(std::memory_order_relaxed))) - Register(); - } - - ScopedClear SetScoped(int64_t value) PERFETTO_WARN_UNUSED_RESULT { - Set(value); - return ScopedClear(this); - } - - ScopedClear SetScoped(StringView sv) PERFETTO_WARN_UNUSED_RESULT { - Set(sv); - return ScopedClear(this); - } - - void Register(); - - int64_t int_value() const { - return int_value_.load(std::memory_order_relaxed); - } - size_t ToString(char* dst, size_t len); - - private: - std::atomic registered_; - std::atomic type_; - const char* const name_; - union { - std::atomic str_value_[kCrashKeyMaxStrSize]; - std::atomic int_value_; - }; -}; - -// Fills |dst| with a string containing one line for each crash key -// (excluding the unset ones). -// Returns number of chars written, without counting the NUL terminator. -// This is used in logging.cc when emitting the crash report abort message. -size_t SerializeCrashKeys(char* dst, size_t len); - -void UnregisterAllCrashKeysForTesting(); - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_CRASH_KEYS_H_ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -// gen_amalgamated expanded: #include "perfetto/ext/base/crash_keys.h" - -#include - -#include -#include - -// gen_amalgamated expanded: #include "perfetto/ext/base/string_utils.h" - -namespace perfetto { -namespace base { - -namespace { - -constexpr size_t kMaxKeys = 32; - -std::atomic g_keys[kMaxKeys]{}; -std::atomic g_num_keys{}; -} // namespace - -void CrashKey::Register() { - // If doesn't matter if we fail below. If there are no slots left, don't - // keep trying re-registering on every Set(), the outcome won't change. - - // If two threads raced on the Register(), avoid registering the key twice. - if (registered_.exchange(true)) - return; - - uint32_t slot = g_num_keys.fetch_add(1); - if (slot >= kMaxKeys) { - PERFETTO_LOG("Too many crash keys registered"); - return; - } - g_keys[slot].store(this); -} - -// Returns the number of chars written, without counting the \0. -size_t CrashKey::ToString(char* dst, size_t len) { - if (len > 0) - *dst = '\0'; - switch (type_.load(std::memory_order_relaxed)) { - case Type::kUnset: - break; - case Type::kInt: - return SprintfTrunc(dst, len, "%s: %" PRId64 "\n", name_, - int_value_.load(std::memory_order_relaxed)); - case Type::kStr: - char buf[sizeof(str_value_)]; - for (size_t i = 0; i < sizeof(str_value_); i++) - buf[i] = str_value_[i].load(std::memory_order_relaxed); - - // Don't assume |str_value_| is properly null-terminated. - return SprintfTrunc(dst, len, "%s: %.*s\n", name_, int(sizeof(buf)), buf); - } - return 0; -} - -void UnregisterAllCrashKeysForTesting() { - g_num_keys.store(0); - for (auto& key : g_keys) - key.store(nullptr); -} - -size_t SerializeCrashKeys(char* dst, size_t len) { - size_t written = 0; - uint32_t num_keys = g_num_keys.load(); - if (len > 0) - *dst = '\0'; - for (uint32_t i = 0; i < num_keys && written < len; i++) { - CrashKey* key = g_keys[i].load(); - if (!key) - continue; // Can happen if we hit this between the add and the store. - written += key->ToString(dst + written, len - written); - } - PERFETTO_DCHECK(written <= len); - PERFETTO_DCHECK(len == 0 || dst[written] == '\0'); - return written; -} - -} // namespace base -} // namespace perfetto -// gen_amalgamated begin source: src/base/ctrl_c_handler.cc -// gen_amalgamated begin header: include/perfetto/ext/base/ctrl_c_handler.h -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_CTRL_C_HANDLER_H_ -#define INCLUDE_PERFETTO_EXT_BASE_CTRL_C_HANDLER_H_ - -namespace perfetto { -namespace base { - -// On Linux/Android/Mac: installs SIGINT + SIGTERM signal handlers. -// On Windows: installs a SetConsoleCtrlHandler() handler. -// The passed handler must be async safe. -using CtrlCHandlerFunction = void (*)(); -void InstallCtrlCHandler(CtrlCHandlerFunction); - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_CTRL_C_HANDLER_H_ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -// gen_amalgamated expanded: #include "perfetto/ext/base/ctrl_c_handler.h" - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" -// gen_amalgamated expanded: #include "perfetto/base/compiler.h" -// gen_amalgamated expanded: #include "perfetto/base/logging.h" - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -#include - -#include -#else -#include -#include -#endif - -namespace perfetto { -namespace base { - -namespace { -CtrlCHandlerFunction g_handler = nullptr; - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -BOOL WINAPI Trampoline(DWORD type) { - if (type == CTRL_C_EVENT) { - g_handler(); - return TRUE; - } - return FALSE; -} -#endif -} // namespace - -void InstallCtrlCHandler(CtrlCHandlerFunction handler) { - PERFETTO_CHECK(g_handler == nullptr); - g_handler = handler; - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - ::SetConsoleCtrlHandler(Trampoline, true); -#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) - // Setup signal handler. - struct sigaction sa{}; - -// Glibc headers for sa_sigaction trigger this. -#pragma GCC diagnostic push -#if defined(__clang__) -#pragma GCC diagnostic ignored "-Wdisabled-macro-expansion" -#endif - sa.sa_handler = [](int) { g_handler(); }; -#if !PERFETTO_BUILDFLAG(PERFETTO_OS_QNX) - sa.sa_flags = static_cast(SA_RESETHAND | SA_RESTART); -#else // POSIX-compliant - sa.sa_flags = static_cast(SA_RESETHAND); -#endif -#pragma GCC diagnostic pop - sigaction(SIGINT, &sa, nullptr); - sigaction(SIGTERM, &sa, nullptr); -#else - // Do nothing on NaCL and Fuchsia. - ignore_result(handler); -#endif -} - -} // namespace base -} // namespace perfetto -// gen_amalgamated begin source: src/base/event_fd.cc -// gen_amalgamated begin header: include/perfetto/ext/base/event_fd.h -// gen_amalgamated begin header: include/perfetto/ext/base/scoped_file.h -/* - * Copyright (C) 2017 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_SCOPED_FILE_H_ -#define INCLUDE_PERFETTO_EXT_BASE_SCOPED_FILE_H_ - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" - -#include - -#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -#include // For DIR* / opendir(). -#endif - -#include - -// gen_amalgamated expanded: #include "perfetto/base/export.h" -// gen_amalgamated expanded: #include "perfetto/base/logging.h" -// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h" - -namespace perfetto { -namespace base { - -namespace internal { -// Used for the most common cases of ScopedResource where there is only one -// invalid value. -template -struct DefaultValidityChecker { - static bool IsValid(T t) { return t != InvalidValue; } -}; -} // namespace internal - -// RAII classes for auto-releasing fds and dirs. -// if T is a pointer type, InvalidValue must be nullptr. Doing otherwise -// causes weird unexpected behaviors (See https://godbolt.org/z/5nGMW4). -template > -class ScopedResource { - public: - using ValidityChecker = Checker; - static constexpr T kInvalid = InvalidValue; - - explicit ScopedResource(T t = InvalidValue) : t_(t) {} - ScopedResource(ScopedResource&& other) noexcept : t_(other.t_) { - other.t_ = InvalidValue; - } - ScopedResource& operator=(ScopedResource&& other) { - reset(other.t_); - other.t_ = InvalidValue; - return *this; - } - T get() const { return t_; } - T operator*() const { return t_; } - explicit operator bool() const { return Checker::IsValid(t_); } - void reset(T r = InvalidValue) { - if (Checker::IsValid(t_)) { - int res = CloseFunction(t_); - if (CheckClose) - PERFETTO_CHECK(res == 0); - } - t_ = r; - } - T release() { - T t = t_; - t_ = InvalidValue; - return t; - } - ~ScopedResource() { reset(InvalidValue); } - - private: - ScopedResource(const ScopedResource&) = delete; - ScopedResource& operator=(const ScopedResource&) = delete; - T t_; -}; - -// Declared in file_utils.h. Forward declared to avoid #include cycles. -int PERFETTO_EXPORT_COMPONENT CloseFile(int fd); - -// Use this for file resources obtained via open() and similar APIs. -using ScopedFile = ScopedResource; -using ScopedFstream = ScopedResource; - -// Use this for resources that are HANDLE on Windows. See comments in -// platform_handle.h -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -using ScopedPlatformHandle = ScopedResource; -#else -// On non-windows systems we alias ScopedPlatformHandle to ScopedFile because -// they are really the same. This is to allow assignments between the two in -// Linux-specific code paths that predate ScopedPlatformHandle. -static_assert(std::is_same::value, ""); -using ScopedPlatformHandle = ScopedFile; - -// DIR* does not exist on Windows. -using ScopedDir = ScopedResource; -#endif - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_SCOPED_FILE_H_ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_EVENT_FD_H_ -#define INCLUDE_PERFETTO_EXT_BASE_EVENT_FD_H_ - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" -// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h" - -namespace perfetto { -namespace base { - -// A waitable event that can be used with poll/select. -// This is really a wrapper around eventfd_create with a pipe-based fallback -// for other platforms where eventfd is not supported. -class EventFd { - public: - EventFd(); - ~EventFd(); - EventFd(EventFd&&) noexcept = default; - EventFd& operator=(EventFd&&) = default; - - // The non-blocking file descriptor that can be polled to wait for the event. - PlatformHandle fd() const { return event_handle_.get(); } - - // Can be called from any thread. - void Notify(); - - // Can be called from any thread. If more Notify() are queued a Clear() call - // can clear all of them (up to 16 per call). - void Clear(); - - private: - // The eventfd, when eventfd is supported, otherwise this is the read end of - // the pipe for fallback mode. - ScopedPlatformHandle event_handle_; - -// QNX is specified because it is a non-Linux UNIX platform but it -// still sets the PERFETTO_OS_LINUX flag to be as compatible as possible -// with the Linux build. -#if !PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX_BUT_NOT_QNX) && \ - !PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) && \ - !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - // On Mac and other non-Linux UNIX platforms a pipe-based fallback is used. - // The write end of the wakeup pipe. - ScopedFile write_fd_; -#endif -}; - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_EVENT_FD_H_ -// gen_amalgamated begin header: include/perfetto/ext/base/pipe.h -/* - * Copyright (C) 2018 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_PIPE_H_ -#define INCLUDE_PERFETTO_EXT_BASE_PIPE_H_ - -// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h" - -namespace perfetto { -namespace base { - -class Pipe { - public: - enum Flags { - kBothBlock = 0, -#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - kBothNonBlock, - kRdNonBlock, - kWrNonBlock, -#endif - }; - - static Pipe Create(Flags = kBothBlock); - - Pipe(); - Pipe(Pipe&&) noexcept; - Pipe& operator=(Pipe&&); - - ScopedPlatformHandle rd; - ScopedPlatformHandle wr; -}; - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_PIPE_H_ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * 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. - */ - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" - -#include -#include - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -#include - -#include -#elif PERFETTO_BUILDFLAG(PERFETTO_OS_QNX) -#include -#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) -#include -#include -#else // Mac, Fuchsia and other non-Linux UNIXes -#include -#endif - -// gen_amalgamated expanded: #include "perfetto/base/logging.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/event_fd.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/pipe.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h" - -namespace perfetto { -namespace base { - -EventFd::~EventFd() = default; - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -EventFd::EventFd() { - event_handle_.reset( - CreateEventA(/*lpEventAttributes=*/nullptr, /*bManualReset=*/true, - /*bInitialState=*/false, /*bInitialState=*/nullptr)); -} - -void EventFd::Notify() { - if (!SetEvent(event_handle_.get())) // 0: fail, !0: success, unlike UNIX. - PERFETTO_DFATAL("EventFd::Notify()"); -} - -void EventFd::Clear() { - if (!ResetEvent(event_handle_.get())) // 0: fail, !0: success, unlike UNIX. - PERFETTO_DFATAL("EventFd::Clear()"); -} - -#elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX_BUT_NOT_QNX) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - -EventFd::EventFd() { - event_handle_.reset(eventfd(/*initval=*/0, EFD_CLOEXEC | EFD_NONBLOCK)); - PERFETTO_CHECK(event_handle_); -} - -void EventFd::Notify() { - const uint64_t value = 1; - ssize_t ret = write(event_handle_.get(), &value, sizeof(value)); - if (ret <= 0 && errno != EAGAIN) - PERFETTO_DFATAL("EventFd::Notify()"); -} - -void EventFd::Clear() { - uint64_t value; - ssize_t ret = - PERFETTO_EINTR(read(event_handle_.get(), &value, sizeof(value))); - if (ret <= 0 && errno != EAGAIN) - PERFETTO_DFATAL("EventFd::Clear()"); -} - -#else - -EventFd::EventFd() { - // Make the pipe non-blocking so that we never block the waking thread (either - // the main thread or another one) when scheduling a wake-up. - Pipe pipe = Pipe::Create(Pipe::kBothNonBlock); - event_handle_ = ScopedPlatformHandle(std::move(pipe.rd).release()); - write_fd_ = std::move(pipe.wr); -} - -void EventFd::Notify() { - const uint64_t value = 1; - ssize_t ret = write(write_fd_.get(), &value, sizeof(uint8_t)); - if (ret <= 0 && errno != EAGAIN) - PERFETTO_DFATAL("EventFd::Notify()"); -} - -void EventFd::Clear() { - // Drain the byte(s) written to the wake-up pipe. We can potentially read - // more than one byte if several wake-ups have been scheduled. - char buffer[16]; - ssize_t ret = - PERFETTO_EINTR(read(event_handle_.get(), &buffer[0], sizeof(buffer))); - if (ret <= 0 && errno != EAGAIN) - PERFETTO_DFATAL("EventFd::Clear()"); -} -#endif - -} // namespace base -} // namespace perfetto -// gen_amalgamated begin source: src/base/file_utils.cc -// gen_amalgamated begin header: include/perfetto/ext/base/file_utils.h -// gen_amalgamated begin header: include/perfetto/base/status.h -/* - * Copyright (C) 2019 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_BASE_STATUS_H_ -#define INCLUDE_PERFETTO_BASE_STATUS_H_ - -#include -#include -#include -#include - -// gen_amalgamated expanded: #include "perfetto/base/compiler.h" -// gen_amalgamated expanded: #include "perfetto/base/export.h" -// gen_amalgamated expanded: #include "perfetto/base/logging.h" - -namespace perfetto { -namespace base { - -// Represents either the success or the failure message of a function. -// This can used as the return type of functions which would usually return an -// bool for success or int for errno but also wants to add some string context -// (ususally for logging). -// -// Similar to absl::Status, an optional "payload" can also be included with more -// context about the error. This allows passing additional metadata about the -// error (e.g. location of errors, potential mitigations etc). -class PERFETTO_EXPORT_COMPONENT Status { - public: - Status() : ok_(true) {} - explicit Status(std::string msg) : ok_(false), message_(std::move(msg)) { - PERFETTO_CHECK(!message_.empty()); - } - - // Copy operations. - Status(const Status&) = default; - Status& operator=(const Status&) = default; - - // Move operations. The moved-from state is valid but unspecified. - Status(Status&&) noexcept = default; - Status& operator=(Status&&) = default; - - bool ok() const { return ok_; } - - // When ok() is false this returns the error message. Returns the empty string - // otherwise. - const std::string& message() const { return message_; } - const char* c_message() const { return message_.c_str(); } - - ////////////////////////////////////////////////////////////////////////////// - // Payload Management APIs - ////////////////////////////////////////////////////////////////////////////// - - // Payloads can be attached to error statuses to provide additional context. - // - // Payloads are (key, value) pairs, where the key is a string acting as a - // unique "type URL" and the value is an opaque string. The "type URL" should - // be unique, follow the format of a URL and, ideally, documentation on how to - // interpret its associated data should be available. - // - // To attach a payload to a status object, call `Status::SetPayload()`. - // Similarly, to extract the payload from a status, call - // `Status::GetPayload()`. - // - // Note: the payload APIs are only meaningful to call when the status is an - // error. Otherwise, all methods are noops. - - // Gets the payload for the given |type_url| if one exists. - // - // Will always return std::nullopt if |ok()|. - std::optional GetPayload(std::string_view type_url) const; - - // Sets the payload for the given key. The key should - // - // Will always do nothing if |ok()|. - void SetPayload(std::string_view type_url, std::string value); - - // Erases the payload for the given string and returns true if the payload - // existed and was erased. - // - // Will always do nothing if |ok()|. - bool ErasePayload(std::string_view type_url); - - private: - struct Payload { - std::string type_url; - std::string payload; - }; - - bool ok_ = false; - std::string message_; - std::vector payloads_; -}; - -// Returns a status object which represents the Ok status. -inline Status OkStatus() { - return Status(); -} - -Status ErrStatus(const char* format, ...) PERFETTO_PRINTF_FORMAT(1, 2); - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_BASE_STATUS_H_ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_FILE_UTILS_H_ -#define INCLUDE_PERFETTO_EXT_BASE_FILE_UTILS_H_ - -#include // For mode_t & O_RDONLY/RDWR. Exists also on Windows. -#include - -#include -#include -#include -#include -#include - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" -// gen_amalgamated expanded: #include "perfetto/base/export.h" -// gen_amalgamated expanded: #include "perfetto/base/status.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/sys_types.h" - -namespace perfetto { -namespace base { - -class TaskRunner; - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -using FileOpenMode = int; -inline constexpr char kDevNull[] = "NUL"; -inline constexpr char kFopenReadFlag[] = "r"; -#else -using FileOpenMode = mode_t; -inline constexpr char kDevNull[] = "/dev/null"; -inline constexpr char kFopenReadFlag[] = "re"; -#endif - -constexpr FileOpenMode kFileModeInvalid = static_cast(-1); - -bool ReadPlatformHandle(PlatformHandle, std::string* out); -bool ReadFileDescriptor(int fd, std::string* out); -bool ReadFileStream(FILE* f, std::string* out); -bool ReadFile(const std::string& path, std::string* out); - -// A wrapper around read(2). It deals with Linux vs Windows includes. It also -// deals with handling EINTR. Has the same semantics of UNIX's read(2). -ssize_t Read(int fd, void* dst, size_t dst_size); - -// Call write until all data is written or an error is detected. -// -// man 2 write: -// If a write() is interrupted by a signal handler before any bytes are -// written, then the call fails with the error EINTR; if it is -// interrupted after at least one byte has been written, the call -// succeeds, and returns the number of bytes written. -ssize_t WriteAll(int fd, const void* buf, size_t count); - -// Copies all data from |fd_in| to |fd_out|. Saves the offset of |fd_in|, -// rewinds it to the beginning, copies the content, and restores the offset. -// |fd_in| can't be a pipe, socket of FIFO. -base::Status CopyFileContents(int fd_in, int fd_out); - -ssize_t WriteAllHandle(PlatformHandle, const void* buf, size_t count); - -ScopedFile OpenFile(const std::string& path, - int flags, - FileOpenMode = kFileModeInvalid); -ScopedFstream OpenFstream(const std::string& path, const std::string& mode); - -// This is an alias for close(). It's to avoid leaking windows.h in headers. -// Exported because ScopedFile is used in the /include/ext API by Chromium -// component builds. -int PERFETTO_EXPORT_COMPONENT CloseFile(int fd); - -bool FlushFile(int fd); - -// Returns true if mkdir succeeds, false if it fails (see errno in that case). -bool Mkdir(const std::string& path); - -// Calls rmdir() on UNIX, _rmdir() on Windows. -bool Rmdir(const std::string& path); - -// Wrapper around access(path, F_OK). -bool FileExists(const std::string& path); - -// Gets the extension for a filename. If the file has two extensions, returns -// only the last one (foo.pb.gz => .gz). Returns empty string if there is no -// extension. -std::string GetFileExtension(const std::string& filename); - -// Returns the basename component of a path (the final component after the last -// directory separator). Behaves like man 2 basename, but works with both '/' -// and '\' separators for cross-platform compatibility. -// Examples: -// Basename("/usr/bin/ls") => "ls" -// Basename("/usr/bin/") => "bin" -// Basename("/") => "/" -// Basename("foo") => "foo" -// Basename("") => "." -// Basename("C:\\Windows\\System32") => "System32" -std::string Basename(const std::string& path); - -// Returns the directory component of a path (everything up to but not -// including the final component). Behaves like man 2 dirname, but works with -// both '/' and '\' separators for cross-platform compatibility. -// Examples: -// Dirname("/usr/bin/ls") => "/usr/bin" -// Dirname("/usr/bin") => "/usr" -// Dirname("/") => "/" -// Dirname("foo") => "." -// Dirname("") => "." -// Dirname("C:\\Windows\\System32") => "C:\\Windows" -std::string Dirname(const std::string& path); - -// Puts the path to all files under |dir_path| in |output|, recursively walking -// subdirectories. File paths are relative to |dir_path|. Only files are -// included, not directories. Path separator is always '/', even on windows (not -// '\'). -base::Status ListFilesRecursive(const std::string& dir_path, - std::vector& output); - -// Lists immediate subdirectories in |dir_path| (non-recursive). Directory names -// are relative to |dir_path| and do not include the path separator. Returns -// only directories, not files. Works on both Unix and Windows. -base::Status ListDirectories(const std::string& dir_path, - std::vector& output); - -// Sets |path|'s owner group to |group_name| and permission mode bits to -// |mode_bits|. -base::Status SetFilePermissions(const std::string& path, - const std::string& group_name, - const std::string& mode_bits); - -// Returns the size of the file located at |path|, or nullopt in case of error. -std::optional GetFileSize(const std::string& path); - -// Returns the size of the open file |fd|, or nullopt in case of error. -std::optional GetFileSize(PlatformHandle fd); - -// This class uses inotify (on Linux/Android) to watch for the creation of -// files in the filesystem. When the specified file is created, it triggers a -// callback function. -// Destroying the returned unique_ptr will automatically unregister the watch. -// -// Note: This only works with filesystem paths (not abstract sockets or other -// special file types). -// It's only supported on Linux and Android, it's a no-op (returns nullptr) on -// other platforms. -// -// Usage: -// auto watch = LinuxFileWatch::WatchFileCreation( -// task_runner, "/tmp/my_file", []() { -// // Called when /tmp/my_file is created -// }); -class LinuxFileWatch { - public: - // Creates a watcher for file creation. Returns nullptr if the path is not a - // valid filesystem path or if the platform doesn't support inotify. The - // callback will be invoked on the provided TaskRunner when the file is - // created. - static std::unique_ptr WatchFileCreation( - TaskRunner*, - const char* path, - std::function callback); - - virtual ~LinuxFileWatch(); - - protected: - LinuxFileWatch() = default; -}; - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_FILE_UTILS_H_ -// gen_amalgamated begin header: include/perfetto/base/task_runner.h -/* - * Copyright (C) 2017 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_ -#define INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_ - -#include - -#include - -// gen_amalgamated expanded: #include "perfetto/base/export.h" -// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h" - -namespace perfetto { -namespace base { - -// A generic interface to allow the library clients to interleave the execution -// of the tracing internals in their runtime environment. -// The expectation is that all tasks, which are queued either via PostTask() or -// AddFileDescriptorWatch(), are executed on the same sequence (either on the -// same thread, or on a thread pool that gives sequencing guarantees). -// -// Tasks are never executed synchronously inside PostTask and there is a full -// memory barrier between tasks. -// -// All methods of this interface can be called from any thread. -class PERFETTO_EXPORT_COMPONENT TaskRunner { - public: - virtual ~TaskRunner(); - - // Schedule a task for immediate execution. Immediate tasks are always - // executed in the order they are posted. Can be called from any thread. - virtual void PostTask(std::function) = 0; - - // Schedule a task for execution after |delay_ms|. Note that there is no - // strict ordering guarantee between immediate and delayed tasks. Can be - // called from any thread. - virtual void PostDelayedTask(std::function, uint32_t delay_ms) = 0; - - // Schedule a task to run when the handle becomes readable. The same handle - // can only be monitored by one function. Note that this function only needs - // to be implemented on platforms where the built-in ipc framework is used. - // Can be called from any thread. - // TODO(skyostil): Refactor this out of the shared interface. - virtual void AddFileDescriptorWatch(PlatformHandle, - std::function) = 0; - - // Remove a previously scheduled watch for the handle. If this is run on the - // target thread of this TaskRunner, guarantees that the task registered to - // this handle will not be executed after this function call. - // Can be called from any thread. - virtual void RemoveFileDescriptorWatch(PlatformHandle) = 0; - - // Checks if the current thread is the same thread where the TaskRunner's task - // run. This allows single threaded task runners (like the ones used in - // perfetto) to inform the caller that anything posted will run on the same - // thread/sequence. This can allow some callers to skip PostTask and instead - // directly execute the code. Can be called from any thread. - virtual bool RunsTasksOnCurrentThread() const = 0; -}; - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_BASE_TASK_RUNNER_H_ -// gen_amalgamated begin header: include/perfetto/ext/base/weak_ptr.h -// gen_amalgamated begin header: include/perfetto/ext/base/thread_checker.h -/* - * Copyright (C) 2017 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_THREAD_CHECKER_H_ -#define INCLUDE_PERFETTO_EXT_BASE_THREAD_CHECKER_H_ - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" - -#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -#include -#endif -#include - -// gen_amalgamated expanded: #include "perfetto/base/export.h" -// gen_amalgamated expanded: #include "perfetto/base/logging.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h" - -namespace perfetto { -namespace base { - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -using ThreadID = unsigned long; -#else -using ThreadID = pthread_t; -#endif - -class PERFETTO_EXPORT_COMPONENT ThreadChecker { - public: - ThreadChecker(); - ~ThreadChecker(); - ThreadChecker(const ThreadChecker&); - ThreadChecker& operator=(const ThreadChecker&); - bool CalledOnValidThread() const PERFETTO_WARN_UNUSED_RESULT; - void DetachFromThread(); - - private: - mutable std::atomic thread_id_; -}; - -#if PERFETTO_DCHECK_IS_ON() && !PERFETTO_BUILDFLAG(PERFETTO_CHROMIUM_BUILD) -// TODO(primiano) Use Chromium's thread checker in Chromium. -#define PERFETTO_THREAD_CHECKER(name) base::ThreadChecker name; -#define PERFETTO_DCHECK_THREAD(name) \ - PERFETTO_DCHECK((name).CalledOnValidThread()) -#define PERFETTO_DETACH_FROM_THREAD(name) (name).DetachFromThread() -#else -#define PERFETTO_THREAD_CHECKER(name) -#define PERFETTO_DCHECK_THREAD(name) -#define PERFETTO_DETACH_FROM_THREAD(name) -#endif // PERFETTO_DCHECK_IS_ON() - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_THREAD_CHECKER_H_ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_WEAK_PTR_H_ -#define INCLUDE_PERFETTO_EXT_BASE_WEAK_PTR_H_ - -// gen_amalgamated expanded: #include "perfetto/ext/base/thread_checker.h" - -#include - -namespace perfetto { -namespace base { - -// A simple WeakPtr for single-threaded cases. -// Generally keep the WeakPtrFactory as last fields in classes: it makes the -// WeakPtr(s) invalidate as first thing in the class dtor. -// Usage: -// class MyClass { -// MyClass() : weak_factory_(this) {} -// WeakPtr GetWeakPtr() { return weak_factory_.GetWeakPtr(); } -// -// private: -// WeakPtrFactory weak_factory_; -// } -// -// int main() { -// std::unique_ptr foo(new MyClass); -// auto wptr = foo.GetWeakPtr(); -// ASSERT_TRUE(wptr); -// ASSERT_EQ(foo.get(), wptr->get()); -// foo.reset(); -// ASSERT_FALSE(wptr); -// ASSERT_EQ(nullptr, wptr->get()); -// } - -template -class WeakPtrFactory; // Forward declaration, defined below. - -template -class WeakPtr { - public: - WeakPtr() {} - WeakPtr(const WeakPtr&) = default; - WeakPtr& operator=(const WeakPtr&) = default; - WeakPtr(WeakPtr&&) = default; - WeakPtr& operator=(WeakPtr&&) = default; - - T* get() const { - PERFETTO_DCHECK_THREAD(thread_checker); - return handle_ ? *handle_.get() : nullptr; - } - T* operator->() const { return get(); } - T& operator*() const { return *get(); } - - explicit operator bool() const { return !!get(); } - - private: - friend class WeakPtrFactory; - explicit WeakPtr(const std::shared_ptr& handle) : handle_(handle) {} - - std::shared_ptr handle_; - PERFETTO_THREAD_CHECKER(thread_checker) -}; - -template -class WeakPtrFactory { - public: - explicit WeakPtrFactory(T* owner) : weak_ptr_(std::make_shared(owner)) { - PERFETTO_DCHECK_THREAD(thread_checker); - } - - ~WeakPtrFactory() { - PERFETTO_DCHECK_THREAD(thread_checker); - *(weak_ptr_.handle_.get()) = nullptr; - } - - // Can be safely called on any thread, since it simply copies |weak_ptr_|. - // Note that any accesses to the returned pointer need to be made on the - // thread that created/reset the factory. - WeakPtr GetWeakPtr() const { return weak_ptr_; } - - // Reset the factory to a new owner & thread. May only be called before any - // weak pointers were passed out. Future weak pointers will be valid on the - // calling thread. - void Reset(T* owner) { - // Reset thread checker to current thread. - PERFETTO_DETACH_FROM_THREAD(thread_checker); - PERFETTO_DCHECK_THREAD(thread_checker); - - // We should not have passed out any weak pointers yet at this point. - PERFETTO_DCHECK(weak_ptr_.handle_.use_count() == 1); - - weak_ptr_ = WeakPtr(std::make_shared(owner)); - } - - private: - WeakPtrFactory(const WeakPtrFactory&) = delete; - WeakPtrFactory& operator=(const WeakPtrFactory&) = delete; - - WeakPtr weak_ptr_; - PERFETTO_THREAD_CHECKER(thread_checker) -}; - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_WEAK_PTR_H_ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * 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. - */ - -// gen_amalgamated expanded: #include "perfetto/ext/base/file_utils.h" - -#include -#include - -#include -#include -#include -#include -#include - -// gen_amalgamated expanded: #include "perfetto/base/build_config.h" -// gen_amalgamated expanded: #include "perfetto/base/compiler.h" -// gen_amalgamated expanded: #include "perfetto/base/logging.h" -// gen_amalgamated expanded: #include "perfetto/base/platform_handle.h" -// gen_amalgamated expanded: #include "perfetto/base/status.h" -// gen_amalgamated expanded: #include "perfetto/base/task_runner.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/platform.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/scoped_file.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/string_utils.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/utils.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/weak_ptr.h" - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -#include - -#include -#include -#include -#else -#include -#include -#endif - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_FREEBSD) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) -#define PERFETTO_SET_FILE_PERMISSIONS -#include -#include -#include -#include -#include -#endif - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX_BUT_NOT_QNX) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) -// For inotify. QNX doesn't have full support for inotify_init1(). -#include -#endif - -namespace perfetto { -namespace base { -namespace { -constexpr size_t kBufSize = 2048; - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) -// Wrap FindClose to: (1) make the return unix-style; (2) deal with stdcall. -int CloseFindHandle(HANDLE h) { - return FindClose(h) ? 0 : -1; -} - -std::optional ToUtf16(const std::string& str) { - int len = MultiByteToWideChar(CP_UTF8, 0, str.data(), - static_cast(str.size()), nullptr, 0); - if (len < 0) { - return std::nullopt; - } - std::vector tmp; - tmp.resize(static_cast::size_type>(len)); - len = - MultiByteToWideChar(CP_UTF8, 0, str.data(), static_cast(str.size()), - tmp.data(), static_cast(tmp.size())); - if (len < 0) { - return std::nullopt; - } - PERFETTO_CHECK(static_cast::size_type>(len) == - tmp.size()); - return std::wstring(tmp.data(), tmp.size()); -} - -#endif - -} // namespace - -ssize_t Read(int fd, void* dst, size_t dst_size) { - ssize_t ret; - platform::BeforeMaybeBlockingSyscall(); -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - ret = _read(fd, dst, static_cast(dst_size)); -#else - ret = PERFETTO_EINTR(read(fd, dst, dst_size)); -#endif - platform::AfterMaybeBlockingSyscall(); - return ret; -} - -bool ReadFileDescriptor(int fd, std::string* out) { - // Do not override existing data in string. - size_t i = out->size(); - - struct stat buf{}; - if (fstat(fd, &buf) != -1) { - if (buf.st_size > 0) - out->resize(i + static_cast(buf.st_size)); - } - - ssize_t bytes_read; - for (;;) { - if (out->size() < i + kBufSize) - out->resize(out->size() + kBufSize); - - bytes_read = Read(fd, &((*out)[i]), kBufSize); - if (bytes_read > 0) { - i += static_cast(bytes_read); - } else { - out->resize(i); - return bytes_read == 0; - } - } -} - -bool ReadPlatformHandle(PlatformHandle h, std::string* out) { -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - // Do not override existing data in string. - size_t i = out->size(); - - for (;;) { - if (out->size() < i + kBufSize) - out->resize(out->size() + kBufSize); - DWORD bytes_read = 0; - auto res = ::ReadFile(h, &((*out)[i]), kBufSize, &bytes_read, nullptr); - if (res && bytes_read > 0) { - i += static_cast(bytes_read); - } else { - out->resize(i); - const bool is_eof = res && bytes_read == 0; - auto err = res ? 0 : GetLastError(); - // The "Broken pipe" error on Windows is slightly different than Unix: - // On Unix: a "broken pipe" error can happen only on the writer side. On - // the reader there is no broken pipe, just a EOF. - // On windows: the reader also sees a broken pipe error. - // Here we normalize on the Unix behavior, treating broken pipe as EOF. - return is_eof || err == ERROR_BROKEN_PIPE; - } - } -#else - return ReadFileDescriptor(h, out); -#endif -} - -bool ReadFileStream(FILE* f, std::string* out) { - return ReadFileDescriptor(fileno(f), out); -} - -bool ReadFile(const std::string& path, std::string* out) { - base::ScopedFile fd = base::OpenFile(path, O_RDONLY); - if (!fd) - return false; - - return ReadFileDescriptor(*fd, out); -} - -ssize_t WriteAll(int fd, const void* buf, size_t count) { - size_t written = 0; - while (written < count) { - // write() on windows takes an unsigned int size. - uint32_t bytes_left = static_cast( - std::min(count - written, static_cast(UINT32_MAX))); - platform::BeforeMaybeBlockingSyscall(); - ssize_t wr = PERFETTO_EINTR( - write(fd, static_cast(buf) + written, bytes_left)); - platform::AfterMaybeBlockingSyscall(); - if (wr == 0) - break; - if (wr < 0) - return wr; - written += static_cast(wr); - } - return static_cast(written); -} - -base::Status CopyFileContents(int fd_in, int fd_out) { - off_t original_offset = lseek(fd_in, 0, SEEK_CUR); - if (original_offset == -1) { - return base::ErrStatus( - "Can't get offset in 'fd_in', lseek error: %s (errno: %d)", - strerror(errno), errno); - } - - if (lseek(fd_in, 0, SEEK_SET) == -1) { - return base::ErrStatus( - "Can't change the offset in 'fd_in', lseek error: %s (errno: %d)", - strerror(errno), errno); - } - - auto restore_offset_on_exit = OnScopeExit([fd_in, original_offset] { - // 'lseek' should never fail here, but if it fails, we crash, to prevent - // possible data loss/overwrite in the 'fd_in'. - PERFETTO_CHECK(lseek(fd_in, original_offset, SEEK_SET) >= 0); - }); - - // Use bigger buffer when copy files. - constexpr size_t kCopyFileBufSize = 32 * 1024; // 32KB. - static_assert(kCopyFileBufSize > kBufSize); - // Don't allocate that much memory on stack. - std::vector buffer(kCopyFileBufSize); - for (;;) { - ssize_t bytes_read = Read(fd_in, buffer.data(), buffer.size()); - if (bytes_read == 0) - break; - if (bytes_read < 0) { - return base::ErrStatus("Read failed: %s (errno: %d)", strerror(errno), - errno); - } - ssize_t written = - WriteAll(fd_out, buffer.data(), static_cast(bytes_read)); - if (written != bytes_read) { - return base::ErrStatus("Write failed: %s (errno: %d)", strerror(errno), - errno); - } - } - return base::OkStatus(); -} - -ssize_t WriteAllHandle(PlatformHandle h, const void* buf, size_t count) { -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - DWORD wsize = 0; - if (::WriteFile(h, buf, static_cast(count), &wsize, nullptr)) { - return wsize; - } else { - return -1; - } -#else - return WriteAll(h, buf, count); -#endif -} - -bool FlushFile(int fd) { - PERFETTO_DCHECK(fd != 0); -#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - return !PERFETTO_EINTR(fdatasync(fd)); -#elif PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - return !PERFETTO_EINTR(_commit(fd)); -#else - return !PERFETTO_EINTR(fsync(fd)); -#endif -} - -bool Mkdir(const std::string& path) { -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - return _mkdir(path.c_str()) == 0; -#else - return mkdir(path.c_str(), 0755) == 0; -#endif -} - -bool Rmdir(const std::string& path) { -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - return _rmdir(path.c_str()) == 0; -#else - return rmdir(path.c_str()) == 0; -#endif -} - -int CloseFile(int fd) { - return close(fd); -} - -ScopedFile OpenFile(const std::string& path, int flags, FileOpenMode mode) { - // If a new file might be created, ensure that the permissions for the new - // file are explicitly specified. - PERFETTO_CHECK((flags & O_CREAT) == 0 || mode != kFileModeInvalid); -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - // Always use O_BINARY on Windows, to avoid silly EOL translations. - ScopedFile fd(_open(path.c_str(), flags | O_BINARY, mode)); -#else - // Always open a ScopedFile with O_CLOEXEC so we can safely fork and exec. - ScopedFile fd(open(path.c_str(), flags | O_CLOEXEC, mode)); -#endif - return fd; -} - -ScopedFstream OpenFstream(const std::string& path, const std::string& mode) { - ScopedFstream file; - // On Windows fopen interprets filename using the ANSI or OEM codepage but - // sqlite3_value_text returns a UTF-8 string. To make sure we interpret the - // filename correctly we use _wfopen and a UTF-16 string on windows. - // - // On Windows fopen also open files in the text mode by default, but we want - // to open them in the binary mode, to avoid silly EOL translations (and to be - // consistent with base::OpenFile). So we check the mode first and append 'b' - // mode only when it makes sense. -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - std::string s_mode(mode); - // Windows supports non-standard mode extension that sets encoding in text - // mode. If you need to open a FILE* in text mode, use the fopen API directly. - bool is_text_mode = Contains(s_mode, "ccs=") || Contains(s_mode, "t"); - PERFETTO_CHECK(!is_text_mode); - bool is_binary_mode = Contains(s_mode, 'b'); - if (!is_binary_mode) - s_mode += 'b'; - - auto w_path = ToUtf16(path); - auto w_mode = ToUtf16(s_mode); - if (w_path && w_mode) { - file.reset(_wfopen(w_path->c_str(), w_mode->c_str())); - } -#else - file.reset(fopen(path.c_str(), mode.c_str())); -#endif - return file; -} - -bool FileExists(const std::string& path) { -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - return _access(path.c_str(), 0) == 0; -#else - return access(path.c_str(), F_OK) == 0; -#endif -} - -// Declared in base/platform_handle.h. -int ClosePlatformHandle(PlatformHandle handle) { -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - // Make the return value UNIX-style. - return CloseHandle(handle) ? 0 : -1; -#else - return close(handle); -#endif -} - -base::Status ListFilesRecursive(const std::string& dir_path, - std::vector& output) { - std::string root_dir_path = dir_path; - if (root_dir_path.back() == '\\') { - root_dir_path.back() = '/'; - } else if (root_dir_path.back() != '/') { - root_dir_path.push_back('/'); - } - - // dir_queue contains full paths to the directories. The paths include the - // root_dir_path at the beginning and the trailing slash at the end. - std::deque dir_queue; - dir_queue.push_back(root_dir_path); - - while (!dir_queue.empty()) { - const std::string cur_dir = std::move(dir_queue.front()); - dir_queue.pop_front(); -#if PERFETTO_BUILDFLAG(PERFETTO_OS_NACL) - return base::ErrStatus("ListFilesRecursive not supported yet"); -#elif PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - std::string glob_path = cur_dir + "*"; - // + 1 because we also have to count the NULL terminator. - if (glob_path.length() + 1 > MAX_PATH) - return base::ErrStatus("Directory path %s is too long", dir_path.c_str()); - WIN32_FIND_DATAA ffd; - - base::ScopedResource - hFind(FindFirstFileA(glob_path.c_str(), &ffd)); - if (!hFind) { - // For empty directories, there should be at least one entry '.'. - // If FindFirstFileA returns INVALID_HANDLE_VALUE, this means directory - // couldn't be accessed. - return base::ErrStatus("Failed to open directory %s", cur_dir.c_str()); - } - do { - if (strcmp(ffd.cFileName, ".") == 0 || strcmp(ffd.cFileName, "..") == 0) - continue; - if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - std::string subdir_path = cur_dir + ffd.cFileName + '/'; - dir_queue.push_back(subdir_path); - } else { - const std::string full_path = cur_dir + ffd.cFileName; - PERFETTO_CHECK(full_path.length() > root_dir_path.length()); - output.push_back(full_path.substr(root_dir_path.length())); - } - } while (FindNextFileA(*hFind, &ffd)); -#else - ScopedDir dir = ScopedDir(opendir(cur_dir.c_str())); - if (!dir) { - return base::ErrStatus("Failed to open directory %s", cur_dir.c_str()); - } - for (auto* dirent = readdir(dir.get()); dirent != nullptr; - dirent = readdir(dir.get())) { - if (strcmp(dirent->d_name, ".") == 0 || - strcmp(dirent->d_name, "..") == 0) { - continue; - } - struct stat dirstat; - std::string full_path = cur_dir + dirent->d_name; - PERFETTO_CHECK(stat(full_path.c_str(), &dirstat) == 0); - if (S_ISDIR(dirstat.st_mode)) { - dir_queue.push_back(full_path + '/'); - } else if (S_ISREG(dirstat.st_mode)) { - PERFETTO_CHECK(full_path.length() > root_dir_path.length()); - output.push_back(full_path.substr(root_dir_path.length())); - } - } -#endif - } - return base::OkStatus(); -} - -base::Status ListDirectories(const std::string& dir_path, - std::vector& output) { - std::string normalized_path = dir_path; - if (!normalized_path.empty() && normalized_path.back() != '/' && - normalized_path.back() != '\\') { - normalized_path.push_back('/'); - } - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_NACL) - return base::ErrStatus("ListDirectories not supported yet"); -#elif PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - std::string glob_path = normalized_path + "*"; - if (glob_path.length() + 1 > MAX_PATH) { - return base::ErrStatus("Directory path %s is too long", dir_path.c_str()); - } - WIN32_FIND_DATAA ffd; - - base::ScopedResource - hFind(FindFirstFileA(glob_path.c_str(), &ffd)); - if (!hFind) { - return base::ErrStatus("Failed to open directory %s", - normalized_path.c_str()); - } - do { - if (strcmp(ffd.cFileName, ".") == 0 || strcmp(ffd.cFileName, "..") == 0) { - continue; - } - if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - output.push_back(ffd.cFileName); - } - } while (FindNextFileA(*hFind, &ffd)); -#else - ScopedDir dir = ScopedDir(opendir(normalized_path.c_str())); - if (!dir) { - return base::ErrStatus("Failed to open directory %s", - normalized_path.c_str()); - } - for (auto* dirent = readdir(dir.get()); dirent != nullptr; - dirent = readdir(dir.get())) { - if (strcmp(dirent->d_name, ".") == 0 || strcmp(dirent->d_name, "..") == 0) { - continue; - } - std::string full_path = normalized_path + dirent->d_name; - struct stat dirstat; - if (stat(full_path.c_str(), &dirstat) == 0 && S_ISDIR(dirstat.st_mode)) { - output.push_back(dirent->d_name); - } - } -#endif - return base::OkStatus(); -} - -std::string GetFileExtension(const std::string& filename) { - auto ext_idx = filename.rfind('.'); - if (ext_idx == std::string::npos) - return std::string(); - return filename.substr(ext_idx); -} - -std::string Basename(const std::string& path) { - // Handle empty path - if (path.empty()) - return "."; - - // Make a copy to work with - std::string p = path; - - // Strip trailing slashes (both / and \) - while (p.size() > 1 && (p.back() == '/' || p.back() == '\\')) { - p.pop_back(); - } - - // If the path is now empty or just a single slash, return it - if (p.empty() || p == "/" || p == "\\") - return p.empty() ? "/" : p; - - // Find the last directory separator (either / or \) - size_t last_sep = p.find_last_of("/\\"); - - if (last_sep == std::string::npos) { - // No separator found, the whole path is the basename - return p; - } - - // Return everything after the last separator - return p.substr(last_sep + 1); -} - -std::string Dirname(const std::string& path) { - // Handle empty path - if (path.empty()) - return "."; - - // Make a copy to work with - std::string p = path; - - // Strip trailing slashes (both / and \) - while (p.size() > 1 && (p.back() == '/' || p.back() == '\\')) { - p.pop_back(); - } - - // If the path is now just a single slash, return it - if (p == "/" || p == "\\") - return p; - - // Find the last directory separator (either / or \) - size_t last_sep = p.find_last_of("/\\"); - - if (last_sep == std::string::npos) { - // No separator found, return "." - return "."; - } - - // If the separator is at position 0, return the root - if (last_sep == 0) - return p.substr(0, 1); // Return "/" or "\" - - // Strip trailing slashes from the dirname part - while (last_sep > 0 && (p[last_sep - 1] == '/' || p[last_sep - 1] == '\\')) { - --last_sep; - } - - // If we've consumed all characters, return the root - if (last_sep == 0) - return p.substr(0, 1); - - // Return everything up to (but not including) the last separator - return p.substr(0, last_sep); -} - -base::Status SetFilePermissions(const std::string& file_path, - const std::string& group_name_or_id, - const std::string& mode_bits) { -#ifdef PERFETTO_SET_FILE_PERMISSIONS - PERFETTO_CHECK(!file_path.empty()); - PERFETTO_CHECK(!group_name_or_id.empty()); - - // Default |group_id| to -1 for not changing the group ownership. - gid_t group_id = static_cast(-1); - auto maybe_group_id = base::StringToUInt32(group_name_or_id); - if (maybe_group_id) { // A numerical group ID. - group_id = *maybe_group_id; - } else { // A group name. - struct group* file_group = nullptr; - // Query the group ID of |group|. - do { - file_group = getgrnam(group_name_or_id.c_str()); - } while (file_group == nullptr && errno == EINTR); - if (file_group == nullptr) { - return base::ErrStatus("Failed to get group information of %s ", - group_name_or_id.c_str()); - } - group_id = file_group->gr_gid; - } - - if (PERFETTO_EINTR(chown(file_path.c_str(), geteuid(), group_id))) { - return base::ErrStatus("Failed to chown %s ", file_path.c_str()); - } - - // |mode| accepts values like "0660" as "rw-rw----" mode bits. - auto mode_value = base::StringToInt32(mode_bits, 8); - if (!(mode_bits.size() == 4 && mode_value.has_value())) { - return base::ErrStatus( - "The chmod mode bits must be a 4-digit octal number, e.g. 0660"); - } - if (PERFETTO_EINTR( - chmod(file_path.c_str(), static_cast(mode_value.value())))) { - return base::ErrStatus("Failed to chmod %s", file_path.c_str()); - } - return base::OkStatus(); -#else - base::ignore_result(file_path); - base::ignore_result(group_name_or_id); - base::ignore_result(mode_bits); - return base::ErrStatus( - "Setting file permissions is not supported on this platform"); -#endif -} - -std::optional GetFileSize(const std::string& file_path) { -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - // This does not use base::OpenFile to avoid getting an exclusive lock. - base::ScopedPlatformHandle fd( - CreateFileA(file_path.c_str(), FILE_READ_ATTRIBUTES, FILE_SHARE_READ, - nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr)); -#else - base::ScopedFile fd(base::OpenFile(file_path, O_RDONLY | O_CLOEXEC)); -#endif - if (!fd) { - return std::nullopt; - } - return GetFileSize(*fd); -} - -std::optional GetFileSize(PlatformHandle fd) { -#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) - LARGE_INTEGER file_size; - file_size.QuadPart = 0; - if (!GetFileSizeEx(fd, &file_size)) { - return std::nullopt; - } - static_assert(sizeof(decltype(file_size.QuadPart)) <= sizeof(uint64_t)); - return static_cast(file_size.QuadPart); -#else - struct stat buf{}; - if (fstat(fd, &buf) == -1) { - return std::nullopt; - } - static_assert(sizeof(decltype(buf.st_size)) <= sizeof(uint64_t)); - return static_cast(buf.st_size); -#endif -} - -// LinuxFileWatch - -#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX_BUT_NOT_QNX) || \ - PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) - -namespace { - -// Implementation class extends LinuxFileWatch -class FileWatchImpl : public LinuxFileWatch { - public: - FileWatchImpl(TaskRunner* tr, - std::string fn, - ScopedFile ifd, - std::function cb) - : task_runner_(tr), - file_base_name_(std::move(fn)), - inotify_fd_(std::move(ifd)), - callback_(std::move(cb)), - weak_ptr_factory_(this) { - task_runner_->AddFileDescriptorWatch( - *inotify_fd_, [weak_handle = weak_ptr_factory_.GetWeakPtr()] { - if (!weak_handle) - return; - alignas(struct inotify_event) char buf[4096]; - ssize_t rsize = - base::Read(*weak_handle->inotify_fd_, buf, sizeof(buf)); - if (rsize <= 0) - return; - for (ssize_t i = 0; i < rsize;) { - auto* evt = reinterpret_cast(&buf[i]); - i += static_cast(sizeof(inotify_event) + evt->len); - if (evt->len > 0 && (evt->mask & IN_CREATE)) { - if (weak_handle->file_base_name_ == evt->name) { - weak_handle->task_runner_->PostTask(weak_handle->callback_); - return; - } - } - } // for(evt); - }); - } - - ~FileWatchImpl() override { - if (!inotify_fd_) - return; - task_runner_->RemoveFileDescriptorWatch(*inotify_fd_); - inotify_fd_.reset(); - } - - private: - TaskRunner* task_runner_ = nullptr; - std::string file_base_name_; // Only the name without the path. - ScopedFile inotify_fd_; - std::function callback_; - WeakPtrFactory weak_ptr_factory_; // Keep last. -}; - -} // namespace - -std::unique_ptr LinuxFileWatch::WatchFileCreation( - TaskRunner* task_runner, - const char* path, - std::function callback) { - if (!path || path[0] == '\0') { - // We can add a inotify watch only for valid filesystem paths. - return nullptr; - } - - ScopedFile inotify_fd(inotify_init1(IN_CLOEXEC | IN_NONBLOCK)); - if (!inotify_fd) { - PERFETTO_DLOG("inotify_init() failed"); - return nullptr; - } - - // Here we watch the parent dir, not the file itself. We cannot watch for - // a file that doesn't exist yet, because the kernel internally attaches the - // watch to an inode, and a non-existing file doesn't have inodes. - // We are not interested in IN_MOVED_TO because we don't mv files. - std::string file_dir = Dirname(path); - if (inotify_add_watch(*inotify_fd, file_dir.c_str(), IN_CREATE) < 0) { - PERFETTO_DLOG("inotify_add_watch(%s) failed", file_dir.c_str()); - return nullptr; - } - - std::string file_base_name = Basename(path); - - return std::unique_ptr( - new FileWatchImpl(task_runner, std::move(file_base_name), - std::move(inotify_fd), std::move(callback))); -} - -LinuxFileWatch::~LinuxFileWatch() = default; - -#else - -std::unique_ptr LinuxFileWatch::WatchFileCreation( - TaskRunner*, - const char*, - std::function) { - return nullptr; // Not supported on other platforms. -} - -LinuxFileWatch::~LinuxFileWatch() = default; - -#endif // OS_LINUX || OS_ANDROID - -} // namespace base -} // namespace perfetto -// gen_amalgamated begin source: src/base/fixed_string_writer.cc -// gen_amalgamated begin header: include/perfetto/ext/base/fixed_string_writer.h -/* - * Copyright (C) 2019 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_FIXED_STRING_WRITER_H_ -#define INCLUDE_PERFETTO_EXT_BASE_FIXED_STRING_WRITER_H_ - -#include - -#include -#include -#include -#include -#include -#include - -// gen_amalgamated expanded: #include "perfetto/base/logging.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/string_utils.h" -// gen_amalgamated expanded: #include "perfetto/ext/base/string_view.h" - -namespace perfetto { -namespace base { - -// A helper class which writes formatted data to a string buffer. -// This is used in the trace processor where we write O(GBs) of strings and -// sprintf is too slow. -class FixedStringWriter { - public: - // Creates a string buffer from a char buffer and length. - FixedStringWriter(char* buffer, size_t size) : buffer_(buffer), size_(size) {} - - // Appends n instances of a char to the buffer. - void AppendChar(char in, size_t n = 1) { - PERFETTO_DCHECK(pos_ + n <= size_); - memset(&buffer_[pos_], in, n); - pos_ += n; - } - - // Appends a length delimited string to the buffer. - void AppendString(const char* in, size_t n) { - PERFETTO_DCHECK(pos_ + n <= size_); - memcpy(&buffer_[pos_], in, n); - pos_ += n; - } - - void AppendStringView(StringView sv) { AppendString(sv.data(), sv.size()); } - - // Appends a null-terminated string literal to the buffer. - template - inline void AppendLiteral(const char (&in)[N]) { - AppendString(in, N - 1); - } - - // Appends a StringView to the buffer. - void AppendString(StringView data) { AppendString(data.data(), data.size()); } - - // Appends an integer to the buffer. - void AppendInt(int64_t value) { AppendPaddedInt<'0', 0>(value); } - - // Appends an integer to the buffer, padding with |padchar| if the number of - // digits of the integer is less than |padding|. - template - void AppendPaddedInt(int64_t sign_value) { - const bool negate = std::signbit(static_cast(sign_value)); - uint64_t absolute_value; - if (sign_value == std::numeric_limits::min()) { - absolute_value = - static_cast(std::numeric_limits::max()) + 1; - } else { - absolute_value = static_cast(std::abs(sign_value)); - } - AppendPaddedInt(absolute_value, negate); - } - - void AppendUnsignedInt(uint64_t value) { - AppendPaddedUnsignedInt<'0', 0>(value); - } - - // Appends an unsigned integer to the buffer, padding with |padchar| if the - // number of digits of the integer is less than |padding|. - template - void AppendPaddedUnsignedInt(uint64_t value) { - AppendPaddedInt(value, false); - } - - template - void AppendPaddedHexInt(IntType value, char padchar, uint64_t padding) { - using UnsignedType = std::make_unsigned_t; - constexpr size_t kMaxHexDigits = sizeof(IntType) * 2; - // 32 bytes is more than enough for any integer type (max 16 hex digits for - // 64-bit) - constexpr size_t kBufferSize = 32; - auto size_needed = - kMaxHexDigits > padding ? kMaxHexDigits : static_cast(padding); - PERFETTO_DCHECK(size_needed <= kBufferSize); - PERFETTO_DCHECK(pos_ + size_needed <= size_); - - std::array data; - constexpr char hex_asc[] = "0123456789abcdef"; - - size_t idx = size_needed - 1; - auto uvalue = static_cast(value); - do { - data[idx--] = hex_asc[uvalue & 0xF]; - uvalue >>= 4; - } while (uvalue != 0); - - if (padding > 0) { - const auto num_digits = static_cast(size_needed - 1 - idx); - // std::max() needed to work around GCC not being able to tell that - // padding > 0. - for (auto i = num_digits; i < std::max(uint64_t{1u}, padding); i++) { - data[idx--] = padchar; - } - } - AppendString(&data[idx + 1], size_needed - idx - 1); - } - - // Appends a hex integer to the buffer. - template - void AppendHexInt(IntType value) { - AppendPaddedHexInt(value, '0', 0); - } - - // Appends a hex string to the buffer. - void AppendHexString(const uint8_t* data, size_t size, char separator); - - void AppendHexString(StringView data, char separator) { - AppendHexString(reinterpret_cast(data.data()), data.size(), - separator); - } - - // Appends a double to the buffer. - void AppendDouble(double value) { - // TODO(lalitm): trying to optimize this is premature given we almost never - // print doubles. Reevaluate this in the future if we do print them more. - size_t res = base::SprintfTrunc(buffer_ + pos_, size_ - pos_, "%lf", value); - PERFETTO_DCHECK(pos_ + res <= size_); - pos_ += res; - } - - void AppendBool(bool value) { - if (value) { - AppendLiteral("true"); - return; - } - AppendLiteral("false"); - } - - StringView GetStringView() { - PERFETTO_DCHECK(pos_ <= size_); - return StringView(buffer_, pos_); - } - - char* CreateStringCopy() { - char* dup = reinterpret_cast(malloc(pos_ + 1)); - if (dup) { - memcpy(dup, buffer_, pos_); - dup[pos_] = '\0'; - } - return dup; - } - - size_t pos() const { return pos_; } - size_t size() const { return size_; } - void reset() { pos_ = 0; } - - private: - template - void AppendPaddedInt(uint64_t absolute_value, bool negate) { - // Need to add 2 to the number of digits to account for minus sign and - // rounding down of digits10. - constexpr auto kMaxDigits = std::numeric_limits::digits10 + 2; - constexpr auto kSizeNeeded = kMaxDigits > padding ? kMaxDigits : padding; - PERFETTO_DCHECK(pos_ + kSizeNeeded <= size_); - - char data[kSizeNeeded]; - - size_t idx; - for (idx = kSizeNeeded - 1; absolute_value >= 10;) { - char digit = absolute_value % 10; - absolute_value /= 10; - data[idx--] = digit + '0'; - } - data[idx--] = static_cast(absolute_value) + '0'; - - if (padding > 0) { - size_t num_digits = kSizeNeeded - 1 - idx; - // std::max() needed to work around GCC not being able to tell that - // padding > 0. - for (size_t i = num_digits; i < std::max(uint64_t{1u}, padding); i++) { - data[idx--] = padchar; - } - } - - if (negate) - buffer_[pos_++] = '-'; - AppendString(&data[idx + 1], kSizeNeeded - idx - 1); - } - - char* buffer_ = nullptr; - size_t size_ = 0; - size_t pos_ = 0; -}; - -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_FIXED_STRING_WRITER_H_ -/* - * Copyright (C) 2026 The Android Open Source Project - * - * 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. - */ - -// gen_amalgamated expanded: #include "perfetto/ext/base/fixed_string_writer.h" - -#include -#include -#include - -namespace perfetto { -namespace base { - -void FixedStringWriter::AppendHexString(const uint8_t* data, - size_t size, - char separator) { - // Truncate to 64 bytes, as this is the maximum supported by the Linux - // kernel's vsnprintf implementation. - size_t printed_size = std::min(size, size_t{64}); - // Remove trailing separator from calculation if printed_size > 0. - size_t max_chars = printed_size * 3 - (printed_size > 0 ? 1 : 0); - PERFETTO_DCHECK(pos_ + max_chars <= size_); - - if (printed_size) { - AppendPaddedHexInt(data[0], '0', 2); - } - for (size_t pos = 1; pos < printed_size; pos++) { - AppendChar(separator); - AppendPaddedHexInt(data[pos], '0', 2); - } -} - -} // namespace base -} // namespace perfetto -// gen_amalgamated begin source: src/base/getopt_compat.cc -// gen_amalgamated begin header: include/perfetto/ext/base/getopt_compat.h -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -#ifndef INCLUDE_PERFETTO_EXT_BASE_GETOPT_COMPAT_H_ -#define INCLUDE_PERFETTO_EXT_BASE_GETOPT_COMPAT_H_ - -#include // For std::nullptr_t - -// No translation units other than base/getopt.h and getopt_compat_unittest.cc -// should directly include this file. Use base/getopt.h instead. - -namespace perfetto { -namespace base { -namespace getopt_compat { - -// A tiny getopt() replacement for Windows, which doesn't have . -// This implementation is based on the subset of features that we use in the -// Perfetto codebase. It doesn't even try to deal with the full surface of GNU's -// getopt(). -// Limitations: -// - getopt_long_only() is not supported. -// - optional_argument is not supported. That is extremely subtle and caused us -// problems in the past with GNU's getopt. -// - It does not reorder non-option arguments. It behaves like MacOS getopt, or -// GNU's when POSIXLY_CORRECT=1. -// - Doesn't expose optopt or opterr. -// - option.flag and longindex are not supported and must be nullptr. - -enum { - no_argument = 0, - required_argument = 1, -}; - -struct option { - const char* name; - int has_arg; - std::nullptr_t flag; // Only nullptr is supported. - int val; -}; - -extern char* optarg; -extern int optind; -extern int optopt; -extern int opterr; - -int getopt_long(int argc, - char** argv, - const char* shortopts, - const option* longopts, - std::nullptr_t /*longindex is not supported*/); - -int getopt(int argc, char** argv, const char* shortopts); - -} // namespace getopt_compat -} // namespace base -} // namespace perfetto - -#endif // INCLUDE_PERFETTO_EXT_BASE_GETOPT_COMPAT_H_ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * 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. - */ - -// gen_amalgamated expanded: #include "perfetto/ext/base/getopt_compat.h" - -#include -#include -#include - -#include - -// gen_amalgamated expanded: #include "perfetto/base/logging.h" - -namespace perfetto { -namespace base { -namespace getopt_compat { - -char* optarg = nullptr; -int optind = 0; -int optopt = 0; -int opterr = 1; - -namespace { - -char* nextchar = nullptr; - -const option* LookupLongOpt(const std::vector