Files
runc/script
Kir Kolyshkin 78c3b60426 script: do not modify CFLAGS in set_cross_vars
When cross-building libseccomp, build_libseccomp resets CFLAGS to an
empty value (if it was unset) before each architecture, and
set_cross_vars exports it. Autoconf only applies its default CFLAGS
(-g -O2) when CFLAGS is unset, so the per-architecture libseccomp
builds (which are what release binaries link against, including for
the native architecture) end up unoptimized.

The only reason CFLAGS was touched at all is that set_cross_vars puts
-m32 -march=... there for 386, which is why callers had to save and
restore it. Pass these flags via CC instead (as autoconf documentation
suggests for multilib builds), so set_cross_vars no longer modifies
CFLAGS, and remove the now-unneeded save/restore dance from both
build-seccomp.sh and release_build.sh.

This way, a user-provided CFLAGS is passed as is, and if it is unset,
configure uses its defaults for all architectures, including 386.

Note that go build does not use CFLAGS (cgo uses CGO_CFLAGS), and it
handles CC with arguments just fine.

Reported-by: Ciprian Hacman <ciprian@hakman.dev>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-09-16 16:40:02 -07:00
..
2026-09-07 14:21:15 +10:00