Skip to content

Propagate CMAKE_SYSROOT/gcc-toolchain into hwloc's autotools CC/CXX - #1597

Merged
lukaszstolarczuk merged 2 commits into
oneapi-src:mainfrom
wenju-he:sysroot-hwloc-cc-cxx
Jul 27, 2026
Merged

Propagate CMAKE_SYSROOT/gcc-toolchain into hwloc's autotools CC/CXX#1597
lukaszstolarczuk merged 2 commits into
oneapi-src:mainfrom
wenju-he:sysroot-hwloc-cc-cxx

Conversation

@wenju-he

@wenju-he wenju-he commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

PR #1585 forwards CC=${CMAKE_C_COMPILER}/CXX=${CMAKE_CXX_COMPILER} into hwloc's ExternalProject_Add autogen.sh/configure invocation, but those are bare compiler paths with no notion of CMAKE_SYSROOT or CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN. When UMF_LINK_HWLOC_STATICALLY is combined with a sysroot- or toolchain-file-pinned compiler, hwloc still ends up built against the host's headers/libs instead of the sysroot's, which can produce ABI mismatches (e.g. undefined glibc symbols) at final link time.

CC/CXX are passed to autotools as space-separated "compiler [flags...]" strings (the same convention as CC="ccache gcc"), so --sysroot and --gcc-toolchain can be appended directly without needing wrapper scripts or touching CMAKE_C_COMPILER/CMAKE_CXX_COMPILER themselves.

Checklist

  • [x ] Code compiles without errors locally
  • [x ] ninja test pass locally on Linux
  • CI workflows execute properly

PR oneapi-src#1585 forwards CC=${CMAKE_C_COMPILER}/CXX=${CMAKE_CXX_COMPILER}
into hwloc's ExternalProject_Add autogen.sh/configure invocation, but
those are bare compiler paths with no notion of CMAKE_SYSROOT or
CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN. When UMF_LINK_HWLOC_STATICALLY is
combined with a sysroot- or toolchain-file-pinned compiler, hwloc still
ends up built against the host's headers/libs instead of the sysroot's,
which can produce ABI mismatches (e.g. undefined glibc symbols) at
final link time.

CC/CXX are passed to autotools as space-separated "compiler [flags...]"
strings (the same convention as CC="ccache gcc"), so --sysroot and
--gcc-toolchain can be appended directly without needing wrapper
scripts or touching CMAKE_C_COMPILER/CMAKE_CXX_COMPILER themselves.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@wenju-he
wenju-he marked this pull request as ready for review July 27, 2026 07:50
@wenju-he
wenju-he requested a review from a team as a code owner July 27, 2026 07:50
@lukaszstolarczuk
lukaszstolarczuk merged commit b57e557 into oneapi-src:main Jul 27, 2026
75 checks passed
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.

3 participants