### Setup wasixcc in GitHub Actions Source: https://context7.com/wasix-org/wasixcc/llms.txt Configures wasixcc within a GitHub Actions workflow. This setup includes specifying versions for wasixcc, sysroot, LLVM, and Binaryen, and enabling their installation. ```yaml name: Build with wasixcc on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install wasixcc uses: wasix-org/wasixcc@main with: version: 'latest' github_token: ${{ secrets.GITHUB_TOKEN }} sysroot-tag: 'latest' llvm-tag: 'latest' binaryen-tag: 'latest' install-sysroot: 'true' install-llvm: 'true' install-binaryen: 'true' - name: Compile C program run: | wasixcc hello.c -o hello.wasm - name: Compile with optimizations run: | wasixcc -O3 -sWASM_OPT_FLAGS="-O3:-Oz" app.c -o app.wasm - name: Build C++ project run: | wasix++ src/main.cpp src/utils.cpp -O2 -o program.wasm ``` -------------------------------- ### Install wasixcc Locally using Cargo Source: https://github.com/wasix-org/wasixcc/blob/main/README.md This code demonstrates local installation of wasixcc using the Rust package manager, Cargo. It includes instructions for standard installation, using cargo-binstall for pre-built binaries, and building from source. Ensure Binaryen is installed beforehand. ```bash cargo install wasixcc -F bin ``` ```bash cargo binstall wasixcc ``` ```bash git clone https://github.com/wasix-org/wasixcc cd wasixcc cargo build -r -F bin --bin wasixcc ``` -------------------------------- ### Toolchain Installation and Management Source: https://context7.com/wasix-org/wasixcc/llms.txt Commands to install wasixcc, LLVM toolchain, sysroot, and optimization tools. ```APIDOC ## Toolchain Installation and Management Commands to install wasixcc, LLVM toolchain, sysroot, and optimization tools. ### Install wasixcc locally using cargo ```bash cargo install wasixcc -F bin ``` ### Install using cargo-binstall for pre-built binaries ```bash cargo binstall wasixcc ``` ### Install all wrapper executables to system path ```bash sudo wasixcc --install-executables /usr/local/bin ``` ### Download latest LLVM toolchain and sysroot ```bash wasixcc --download-all ``` ### Download specific version of sysroot ```bash wasixcc --download-sysroot v2025-01-01.1 ``` ### Download specific LLVM version ```bash wasixcc --download-llvm v2025-01-01.1 ``` ### Download binaryen (wasm-opt) tools ```bash wasixcc --download-binaryen latest ``` ### Print the sysroot location for current build configuration ```bash wasixcc --print-sysroot # Output: /home/user/.wasixcc/sysroot/sysroot ``` ### Print sysroot location with exception handling enabled ```bash wasixcc -sWASM_EXCEPTIONS=yes --print-sysroot # Output: /home/user/.wasixcc/sysroot/sysroot-eh ``` ``` -------------------------------- ### Install wasixcc using cargo-binstall Source: https://context7.com/wasix-org/wasixcc/llms.txt Installs wasixcc using cargo-binstall, which allows for faster installation of pre-built binaries. This is an alternative to compiling from source. ```bash cargo binstall wasixcc ``` -------------------------------- ### Install wasixcc Executables and Download Tools Source: https://github.com/wasix-org/wasixcc/blob/main/README.md These bash commands are used after installing wasixcc to make its executables accessible and to download necessary development tools. The first command installs binaries like `wasix++` and `wasixar` to a specified PATH, while the second downloads the latest LLVM toolchain and WASIX sysroot. ```bash sudo wasixcc --install-executables /usr/local/bin ``` ```bash wasixcc --download-all ``` -------------------------------- ### Install wasixcc via GitHub Actions Source: https://github.com/wasix-org/wasixcc/blob/main/README.md This snippet shows how to install wasixcc directly within a GitHub Actions workflow. It utilizes the official wasix-org/wasixcc action, ensuring that the compiler is available for subsequent build steps in your CI/CD pipeline. ```yaml - name: Install wasixcc uses: wasix-org/wasixcc@main ``` -------------------------------- ### Install wasixcc Wrapper Executables System-Wide Source: https://context7.com/wasix-org/wasixcc/llms.txt Installs all wasixcc wrapper executables (like wasix++, wasixar) to a specified system path, such as /usr/local/bin. This makes them globally available. ```bash sudo wasixcc --install-executables /usr/local/bin ``` -------------------------------- ### Install wasixcc Locally with Cargo Source: https://context7.com/wasix-org/wasixcc/llms.txt Installs the wasixcc compiler locally using the Rust Cargo package manager. The '-F bin' flag ensures that the wrapper executables are also installed. ```bash cargo install wasixcc -F bin ``` -------------------------------- ### Compiling with Custom Sysroot and Optimization Flags Source: https://github.com/wasix-org/wasixcc/blob/main/README.md Examples of compiling programs with a custom sysroot and specifying custom optimization flags for both the compiler and WASM output. Shows how to override default settings via CLI arguments. ```bash wasixcc -sSYSROOT=/path/to/sysroot program.c -o program.wasm ``` ```bash wasixcc -sCOMPILER_FLAGS="-O3" -sWASM_OPT_FLAGS="-O3" app.c -o app.wasm ``` -------------------------------- ### Build C++ Project in GitHub Actions Source: https://context7.com/wasix-org/wasixcc/llms.txt Compiles a C++ project using wasix++ within a GitHub Actions workflow. This example shows compiling multiple source files and specifying optimization levels. ```bash wasix++ src/main.cpp src/utils.cpp -O2 -o program.wasm ``` -------------------------------- ### Setting WASIXCC Environment Variables Source: https://github.com/wasix-org/wasixcc/blob/main/README.md Configure WASIXCC by setting environment variables prefixed with WASIXCC_. This is useful for build systems where direct CLI invocation is not possible. Example shows setting SYSROOT and COMPILER_FLAGS. ```bash export WASIXCC_SYSROOT=/custom/sysroot export WASIXCC_COMPILER_FLAGS="-O2" wasixcc program.c -o program.wasm ``` -------------------------------- ### Integrating WASIXCC with GNU Autotools Source: https://github.com/wasix-org/wasixcc/blob/main/README.md Guide for integrating WASIXCC into GNU Autotools projects. It involves setting environment variables to point to WASIXCC tools and disabling/enabling `wasm-opt` during specific build phases. ```bash # Set up wasixcc's settings export WASIXCC_XXX=YYY # Replace default tools with wasixcc equivalents export \ CC=wasixcc \ CXX=wasix++ \ LD=wasixld \ AR=wasixar \ NM=wasixnm \ RANLIB=wasixranlib # Disable wasm-opt during configuration... WASIXCC_RUN_WASM_OPT=no \ ./configure ... # ... but make sure to enable it again during the build make ... ``` -------------------------------- ### Compiling C and C++ Programs with WASIXCC Source: https://github.com/wasix-org/wasixcc/blob/main/README.md Basic compilation commands for C and C++ source files into WebAssembly modules. Demonstrates the use of `wasixcc` for C and `wasix++` for C++. ```bash wasixcc hello.c -o hello.wasm ``` ```bash wasix++ hello.cpp -o program.wasm ``` -------------------------------- ### Download Latest Binaryen Tools Source: https://context7.com/wasix-org/wasixcc/llms.txt Downloads the latest version of the Binaryen toolchain, which includes wasm-opt for WebAssembly optimization. This ensures the most up-to-date optimization passes are available. ```bash wasixcc --download-binaryen latest ``` -------------------------------- ### Download All wasixcc Dependencies Source: https://context7.com/wasix-org/wasixcc/llms.txt Downloads the latest versions of the LLVM toolchain, WASIX sysroot, and Binaryen (wasm-opt) tools required for compilation. This command ensures all necessary components are available. ```bash wasixcc --download-all ``` -------------------------------- ### Enabling WASM Exception Handling and PIC Source: https://github.com/wasix-org/wasixcc/blob/main/README.md Instructions on how to enable specific build configurations for WASIXCC. The EH configuration uses WASM Exception Handling for better performance, while EH+PIC adds Position-Independent Code support, necessary for dynamic linking. ```bash wasixcc -sWASM_EXCEPTIONS=yes ``` ```bash wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes ``` -------------------------------- ### WASIXCC Module Kinds and Build Configurations Source: https://context7.com/wasix-org/wasixcc/llms.txt Explains different WASIXCC module kinds: static-main, dynamic-main, shared-library, and object-file. It details their characteristics regarding dynamic linking, exception handling, position independence, and entry points, along with corresponding compilation commands. ```bash # Static main module (default): Standard executable, no dynamic linking # Uses asyncify for setjmp/longjmp, has performance overhead wasixcc program.c -o program.wasm # Module kind: static-main # Dynamic linking: No # Exception handling: No (uses asyncify) # Can run: Anywhere # EH configuration: Exception handling for better performance # Uses WebAssembly exception proposal instead of asyncify wasixcc -sWASM_EXCEPTIONS=yes program.cpp -o program.wasm # Module kind: static-main # Dynamic linking: No # Exception handling: Yes # Can run: EH-enabled runtimes (Wasmer LLVM backend, browsers) # Performance: Much faster than asyncify # C++ exceptions: Fully supported # Dynamic main module: Can load shared libraries at runtime # Requires EH+PIC, embeds all libc symbols for side modules wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes \ -sMODULE_KIND=dynamic-main \ main.c -o main.wasm # Module kind: dynamic-main # Dynamic linking: Yes (can dlopen side modules) # Exception handling: Yes # Position-independent: Yes # Exports: All symbols (--export-all) # Shared library side module: Loaded by dynamic main at runtime wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes \ -shared library.c -o library.so # Module kind: shared-library # Dynamic linking: Yes (loaded via dlopen) # Exception handling: Yes # Position-independent: Yes # Entry point: None (--no-entry) # Object file: Compilation only, no linking wasixcc -c module.c -o module.o # Module kind: object-file # Linking: Not performed # Output: WASM object file for later linking ``` -------------------------------- ### GitHub Actions Integration Source: https://context7.com/wasix-org/wasixcc/llms.txt Integrate wasixcc into CI/CD pipelines using the official GitHub Action. ```APIDOC ## GitHub Actions Integration Integrate wasixcc into CI/CD pipelines using the official GitHub Action. ```yaml name: Build with wasixcc on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install wasixcc uses: wasix-org/wasixcc@main with: version: 'latest' github_token: ${{ secrets.GITHUB_TOKEN }} sysroot-tag: 'latest' llvm-tag: 'latest' binaryen-tag: 'latest' install-sysroot: 'true' install-llvm: 'true' install-binaryen: 'true' - name: Compile C program run: | wasixcc hello.c -o hello.wasm - name: Compile with optimizations run: | wasixcc -O3 -sWASM_OPT_FLAGS="-O3:-Oz" app.c -o app.wasm - name: Build C++ project run: | wasix++ src/main.cpp src/utils.cpp -O2 -o program.wasm ``` ``` -------------------------------- ### wasixcc Create Shared Library Source: https://context7.com/wasix-org/wasixcc/llms.txt Creates a shared library (.so file) that can be dynamically loaded by other WASM modules. It requires exception handling and PIC to be enabled. ```bash wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes -shared library.c -o library.so ``` -------------------------------- ### Configuring WASIXCC for Dynamic Linking Source: https://github.com/wasix-org/wasixcc/blob/main/README.md Setting the module kind to 'dynamic-main' is required for enabling dynamic linking scenarios. This ensures the main module embeds necessary libc/libc++ symbols for side modules. ```bash wasixcc -sMODULE_KIND=dynamic-main ``` -------------------------------- ### Basic wasixcc Usage Source: https://github.com/wasix-org/wasixcc/blob/main/README.md This is the fundamental command structure for using wasixcc. It shows that wasixcc accepts its own options followed by a `--` separator, after which any standard compiler or linker options can be passed through directly to the underlying toolchain. ```bash wasixcc [OPTIONS] -- [PASS-THROUGH OPTIONS] ``` -------------------------------- ### Environment Variable Configuration Source: https://context7.com/wasix-org/wasixcc/llms.txt Configure wasixcc behavior via environment variables for build system integration. ```APIDOC ## Environment Variable Configuration Configure wasixcc behavior via environment variables for build system integration. ### Set sysroot location via environment ```bash export WASIXCC_SYSROOT=/path/to/sysroot wasixcc program.c -o program.wasm ``` ### Add custom compiler flags (colon-separated) ```bash export WASIXCC_COMPILER_FLAGS="-O2:-Wall:-Wextra" wasixcc program.c -o program.wasm ``` ### Configure C++-specific flags ```bash export WASIXCC_COMPILER_FLAGS_CXX="-std=c++17:-fno-exceptions" wasix++ app.cpp -o app.wasm ``` ### Add custom linker flags ```bash export WASIXCC_LINKER_FLAGS="-lm:-lpthread" wasixcc math_app.c -o math_app.wasm ``` ### Disable wasm-opt during configure phase ```bash export WASIXCC_RUN_WASM_OPT=no ./configure CC=wasixcc CXX=wasix++ unset WASIXCC_RUN_WASM_OPT make ``` ### Enable exception handling and PIC for dynamic linking ```bash export WASIXCC_WASM_EXCEPTIONS=yes export WASIXCC_PIC=yes wasixcc main.c -o main.wasm ``` ``` -------------------------------- ### Compile with Optimizations in GitHub Actions Source: https://context7.com/wasix-org/wasixcc/llms.txt Compiles a C program with specific optimization flags using wasixcc within a GitHub Actions job. It utilizes WASM_OPT_FLAGS for fine-grained control over wasm-opt. ```bash wasixcc -O3 -sWASM_OPT_FLAGS="-O3:-Oz" app.c -o app.wasm ``` -------------------------------- ### Enable Exception Handling and PIC via Environment Variables Source: https://context7.com/wasix-org/wasixcc/llms.txt Enables WebAssembly exception handling and position-independent code (PIC) by setting environment variables WASIXCC_WASM_EXCEPTIONS and WASIXCC_PIC. This prepares for dynamic linking scenarios. ```bash export WASIXCC_WASM_EXCEPTIONS=yes export WASIXCC_PIC=yes wasixcc main.c -o main.wasm ``` -------------------------------- ### Command Line Compiler Interface Source: https://context7.com/wasix-org/wasixcc/llms.txt Use wasixcc and wasix++ from the command line like standard clang/clang++, with automatic WASIX-specific configurations. ```APIDOC ## Command Line Compiler Interface Use wasixcc and wasix++ from the command line like standard clang/clang++, with automatic WASIX-specific configurations. ### Compile a simple C program to WebAssembly ```bash wasixcc hello.c -o hello.wasm ``` ### Compile C++ with optimization ```bash wasix++ program.cpp -O3 -o program.wasm ``` ### Compile with custom sysroot location ```bash wasixcc -sSYSROOT=/custom/sysroot app.c -o app.wasm ``` ### Enable WebAssembly exception handling ```bash wasixcc -sWASM_EXCEPTIONS=yes program.c -o program.wasm ``` ### Compile position-independent code for dynamic linking ```bash wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes -sMODULE_KIND=dynamic-main main.c -o main.wasm ``` ### Create a shared library for dynamic loading ```bash wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes -shared library.c -o library.so ``` ``` -------------------------------- ### Download Specific Sysroot Version Source: https://context7.com/wasix-org/wasixcc/llms.txt Downloads a specific version of the WASIX sysroot. This allows for reproducible builds by pinning the sysroot version. ```bash wasixcc --download-sysroot v2025-01-01.1 ``` -------------------------------- ### Advanced WASIXCC Compilation Options Source: https://context7.com/wasix-org/wasixcc/llms.txt Demonstrates advanced WASIXCC compilation flags for fine-tuning the build process. This includes custom wasm-opt flags, preserving unoptimized output, suppressing default optimization, building dynamic main modules, shared libraries, disabling symbolic linking, and including C++ symbols. ```bash # Compile with custom wasm-opt flags and preserve unoptimized output wasixcc app.c -o app.wasm \ -sWASM_OPT_FLAGS="-O3:-Oz:--inline-functions-with-loops" \ -sWASM_OPT_PRESERVE_UNOPTIMIZED=yes # Suppress default wasm-opt flags and use only custom ones wasixcc app.c -o app.wasm \ -sWASM_OPT_SUPPRESS_DEFAULT=yes \ -sWASM_OPT_FLAGS="-O2" # Build a dynamic main module that can load shared libraries wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes \ -sMODULE_KIND=dynamic-main \ main.c -o main.wasm # Build shared library side module for dynamic linking wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes \ -shared plugin.c -o plugin.so # Disable -Bsymbolic linking for shared libraries wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes -sLINK_SYMBOLIC=no \ -shared lib.c -o lib.so # Include C++ symbols in dynamic main even when compiling C code wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes \ -sINCLUDE_CPP_SYMBOLS=yes \ -sMODULE_KIND=dynamic-main \ main.c -o main.wasm # Add custom compiler and linker flags with different precedence wasixcc \ -sCOMPILER_FLAGS="-DVERSION=1:-DDEBUG" \ -sCOMPILER_POST_FLAGS="-Wno-unused-parameter" \ -sLINKER_FLAGS="-lm:-lpthread" \ app.c -o app.wasm ``` -------------------------------- ### Linker-Only Mode with WASIXLD Source: https://context7.com/wasix-org/wasixcc/llms.txt Utilizes WASIXLD for linking pre-compiled object files without recompiling source code. It demonstrates linking multiple object files into an executable, linking with custom options, and creating shared libraries. ```bash # Compile source files to object files wasixcc -c main.c -o main.o wasixcc -c utils.c -o utils.o # Link object files into final executable wasixld main.o utils.o -o program.wasm # Link with custom options wasixld \ -sWASM_EXCEPTIONS=yes \ main.o utils.o \ -o program.wasm # Link shared library wasixld -shared plugin.o helper.o -o plugin.so ``` -------------------------------- ### Integrating WASIXCC with CMake Source: https://github.com/wasix-org/wasixcc/blob/main/README.md Instructions for using WASIXCC with CMake via a toolchain file. It emphasizes setting WASIXCC environment variables and the WASIX_SYSROOT for correct build configuration. ```bash # First, set up wasixcc settings for the build. export WASIXCC_XXX=YYY # wasix-toolchain.cmake references this variable export WASIX_SYSROOT=$(wasixcc --print-sysroot) # Disable wasm-opt during configuration... WASIXCC_RUN_WASM_OPT=no \ cmake ... -DCMAKE_TOOLCHAIN_FILE=wasix-toolchain.cmake # ... but make sure to enable it again during the build cmake --build ... ``` -------------------------------- ### Download Specific LLVM Version Source: https://context7.com/wasix-org/wasixcc/llms.txt Downloads a specific version of the LLVM toolchain. This is useful for targeting specific LLVM features or ensuring compatibility. ```bash wasixcc --download-llvm v2025-01-01.1 ``` -------------------------------- ### Compile C Program with wasixcc Source: https://context7.com/wasix-org/wasixcc/llms.txt Compiles a C program into a WebAssembly module using the wasixcc command-line interface. This is the basic usage for converting C source files to WASM. ```bash wasixcc hello.c -o hello.wasm ``` -------------------------------- ### Print wasixcc Sysroot Location Source: https://context7.com/wasix-org/wasixcc/llms.txt Prints the configured sysroot location for the current build environment. This helps in verifying the sysroot path used by wasixcc. ```bash wasixcc --print-sysroot ``` -------------------------------- ### Print wasixcc Sysroot Location with Exception Handling Source: https://context7.com/wasix-org/wasixcc/llms.txt Prints the sysroot location when exception handling is enabled. This shows the specific sysroot path used for builds with WebAssembly exceptions. ```bash wasixcc -sWASM_EXCEPTIONS=yes --print-sysroot ``` -------------------------------- ### Configure wasixcc Sysroot via Environment Variable Source: https://context7.com/wasix-org/wasixcc/llms.txt Sets the WASIX sysroot location using the WASIXCC_SYSROOT environment variable. This is useful for integrating wasixcc into build systems that do not directly support custom flags. ```bash export WASIXCC_SYSROOT=/path/to/sysroot wasixcc program.c -o program.wasm ``` -------------------------------- ### Configure wasixcc Compiler Flags via Environment Variable Source: https://context7.com/wasix-org/wasixcc/llms.txt Adds custom compiler flags, such as optimization and warning levels, using the WASIXCC_COMPILER_FLAGS environment variable. Flags are colon-separated. ```bash export WASIXCC_COMPILER_FLAGS="-O2:-Wall:-Wextra" wasixcc program.c -o program.wasm ``` -------------------------------- ### CMake Integration Source: https://context7.com/wasix-org/wasixcc/llms.txt Integrate wasixcc into CMake projects using the provided toolchain file. ```APIDOC ## CMake Integration Integrate wasixcc into CMake projects using the provided toolchain file. *Download the toolchain file from the repository. *Place `wasix-toolchain.cmake` in your project. ``` -------------------------------- ### Compile C++ Program with wasix++ Source: https://context7.com/wasix-org/wasixcc/llms.txt Compiles a C++ program into a WebAssembly module using the wasix++ command-line interface, supporting optimization flags. This is used for C++ source files. ```bash wasix++ program.cpp -O3 -o program.wasm ``` -------------------------------- ### Configure wasixcc Linker Flags via Environment Variable Source: https://context7.com/wasix-org/wasixcc/llms.txt Specifies custom linker flags, such as linking against math or thread libraries, using the WASIXCC_LINKER_FLAGS environment variable. This is essential for complex applications. ```bash export WASIXCC_LINKER_FLAGS="-lm:-lpthread" wasixcc math_app.c -o math_app.wasm ``` -------------------------------- ### CMake Project Configuration with WASIXCC Source: https://context7.com/wasix-org/wasixcc/llms.txt Configure a CMake project to use WASIXCC as the toolchain. It sets environment variables for WASM exceptions and Position Independent Code (PIC), retrieves the sysroot, and configures the build with a specific toolchain file, disabling wasm-opt during the initial configuration phase. ```bash export WASIXCC_WASM_EXCEPTIONS=yes export WASIXCC_PIC=yes export WASIX_SYSROOT=$(wasixcc --print-sysroot) WASIXCC_RUN_WASM_OPT=no cmake -B build \ -DCMAKE_TOOLCHAIN_FILE=wasix-toolchain.cmake \ -DCMAKE_BUILD_TYPE=Release cmake --build build ``` -------------------------------- ### Configure wasixcc C++ Compiler Flags via Environment Variable Source: https://context7.com/wasix-org/wasixcc/llms.txt Sets C++ specific compiler flags, like C++ standard version and exception handling behavior, using WASIXCC_COMPILER_FLAGS_CXX. This allows fine-grained control over C++ compilation. ```bash export WASIXCC_COMPILER_FLAGS_CXX="-std=c++17:-fno-exceptions" wasix++ app.cpp -o app.wasm ``` -------------------------------- ### GNU Autotools Integration with WASIXCC Source: https://context7.com/wasix-org/wasixcc/llms.txt Integrates WASIXCC into an Autotools build system by setting compiler and linker environment variables. It configures the build for a Wasm32-WASI target, disabling wasm-opt during configure to speed up tests, and then builds the project with wasm-opt enabled by default. ```bash export WASIXCC_WASM_EXCEPTIONS=yes export WASIXCC_MODULE_KIND=static-main export CC=wasixcc export CXX=wasix++ export LD=wasixld export AR=wasixar export NM=wasixnm export RANLIB=wasixranlib WASIXCC_RUN_WASM_OPT=no ./configure \ --host=wasm32-wasi \ --prefix=/usr/local/wasm32-wasi \ --enable-shared=no make -j$(noproc) make install ``` -------------------------------- ### wasixcc Compile with Custom Sysroot Source: https://context7.com/wasix-org/wasixcc/llms.txt Compiles a C program using a specified custom sysroot location. This allows developers to manage their own WASIX system root directories. ```bash wasixcc -sSYSROOT=/custom/sysroot app.c -o app.wasm ``` -------------------------------- ### wasixcc Compile with Exception Handling Source: https://context7.com/wasix-org/wasixcc/llms.txt Enables WebAssembly exception handling during compilation for improved performance. This flag is crucial for applications relying on C++ exceptions. ```bash wasixcc -sWASM_EXCEPTIONS=yes program.c -o program.wasm ``` -------------------------------- ### wasixcc Compile Position-Independent Code (PIC) Source: https://context7.com/wasix-org/wasixcc/llms.txt Compiles position-independent code (PIC) suitable for dynamic linking. This is used when creating shared libraries or modules that can be loaded at runtime. ```bash wasixcc -sWASM_EXCEPTIONS=yes -sPIC=yes -sMODULE_KIND=dynamic-main main.c -o main.wasm ``` -------------------------------- ### Disable wasm-opt During Configuration Source: https://context7.com/wasix-org/wasixcc/llms.txt Temporarily disables the wasm-opt post-processing step by setting WASIXCC_RUN_WASM_OPT to 'no'. This is useful during the configure phase of build systems like Make. ```bash export WASIXCC_RUN_WASM_OPT=no ./configure CC=wasixcc CXX=wasix++ unset WASIXCC_RUN_WASM_OPT make ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.