On Wed, 10 Sep 2025 13:10:07 GMT, SendaoYan <s...@openjdk.org> wrote:
> GHA job [linux-cross-compile / build > (aarch64)](https://github.com/sendaoYan/jdk-ysd/actions/runs/17609624612/job/50028351829#logs) > fails: > > ``` > configure:178281: /usr/bin/cc -c -march=armv8-a+sve -Werror > -ffp-contract=off --sysroot=/home/runner/work/jdk-ysd/jdk-ysd/sysroot > conftest.c >&5 > cc1: error: bad value (‘armv8-a+sve’) for ‘-march=’ switch > cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem > corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 > broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server > cascadelake tigerlake cooperlake bonnell atom silvermont slm goldmont > goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 > nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron > opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 > bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 native > ``` > > /usr/bin/cc is linux-x64 native compiler, it should not receive linux-aarch64 > gcc parameter `-march=armv8-a+sve` This happens because the conditional for when to perform the check isn't correct. It's checking if `OPENJDK_TARGET_CPU` is aarch64, but that's the global target for the whole configuration. It should be checking if the current compiler target is aarch64. Before calling `FLAGS_SETUP_CFLAGS_CPU_DEP`, variables for this are setup. In this case you should be using `FLAGS_CPU` and `FLAGS_OS` instead of `OPENJDK_TARGET_CPU` and `OPENJDK_TARGET_OS`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27073#issuecomment-3275110912