os icon indicating copy to clipboard operation
os copied to clipboard

wasi-sdk/24 package update

Open kartik-gupta-ij opened this issue 6 months ago • 1 comments

Fixes: This PR updates the wasi-sdk package to version 24. The latest update addresses a build system rewrite introduced in WebAssembly/wasi-sdk@e29a3fe, included in wasi-sdk version 23. The previous build system is no longer compatible, leading to build failures as indicated by the following error:

2024/07/24 10:36:32 WARN make: *** No rule to make target 'build'.  Stop.

Related:

#24842 #24168 #25505

Why Custom CFLAGS and LDFLAGS?

To address specific issues encountered during the build process, custom CFLAGS, CXXFLAGS, and LDFLAGS have been hardcoded as follows:

export CFLAGS="-O2 -Wall -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-Wl,-z,stack-size=8192"

These flags were chosen to mitigate the following errors:

  • Unused Argument Warning: The flag -mtune=broadwell triggered a warning for being unused during the compilation. The chosen CFLAGS explicitly remove unnecessary architecture-specific flags that are not compatible with the wasm32-wasi target.

  • Unsupported Option Error: The flag -march=x86-64-v2 is not supported for the wasm32-wasi target, causing a failure. By adjusting CFLAGS, the build now avoids using unsupported options.

  • Linker Errors: The linker (wasm-ld) raised errors due to unsupported arguments such as --as-needed, --sort-common, and several -z values. The custom LDFLAGS ensure that only compatible linker options are used.

Pre-review Checklist

For package updates (renames) in the base images

When updating packages part of base images (i.e. cgr.dev/chainguard/wolfi-base or ghcr.io/wolfi-dev/sdk)

  • [x] REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk images successfully build
  • [x] REQUIRED cgr.dev/chainguard/wolfi-base and ghcr.io/wolfi-dev/sdk contain no obsolete (no longer built) packages
  • [x] Upon launch, does apk upgrade --latest successfully upgrades packages or performs no actions

kartik-gupta-ij avatar Aug 18 '24 14:08 kartik-gupta-ij