Skip to content

Conversation

Copy link

Copilot AI commented Nov 2, 2025

Enables building OpenSSL for WebAssembly using WASI Preview 1, addressing the need to use OpenSSL cryptographic operations in WASM environments.

Changes

Configuration

  • Configurations/15-wasm.conf: New platform config defining wasm32-wasip1 and wasm32-wasi targets
    • Compiler: wasm32-wasip1-clang / wasm32-wasi-clang
    • Archiver: llvm-ar, llvm-ranlib
    • Auto-disables: threads, shared libs, asm, dso, engines
    • Bignum ops: BN_LLONG (32-bit with 64-bit long long)

Documentation

  • NOTES-WASM.md: Build instructions, prerequisites (WASI SDK), configuration options, troubleshooting
  • README.md: Added WASM platform reference

Tooling & Examples

  • build-wasm32-wasip1.sh: Automated build script with WASI SDK validation
  • demos/wasm/: Working crypto example (SHA-256, AES-256-CBC) with build instructions

Usage

# Option 1: Automated
./build-wasm32-wasip1.sh /path/to/install

# Option 2: Manual
./Configure wasm32-wasip1 --prefix=/path/to/install
make && make install

# Build WASM applications
wasm32-wasip1-clang -O3 \
  -I/path/to/install/include \
  -L/path/to/install/lib \
  -o app.wasm app.c \
  -lssl -lcrypto

Verification

$ ./Configure LIST | grep wasm
wasm32-wasi
wasm32-wasip1

$ ./Configure wasm32-wasip1 --prefix=/tmp/test
Configuring OpenSSL version 4.0.0-dev for target wasm32-wasip1
***   OpenSSL has been successfully configured   ***
Original prompt

how to build openssl 1.0.2a for WASM32-wasip1


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add build instructions for OpenSSL 1.0.2a targeting WASM32-wasip1 Add WebAssembly (WASM32-wasip1) build target support Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants