build: add generic Zig cross-compilation toolchain and refactor external project support#2974
Open
irozzo-1A wants to merge 1 commit intofalcosecurity:masterfrom
Open
build: add generic Zig cross-compilation toolchain and refactor external project support#2974irozzo-1A wants to merge 1 commit intofalcosecurity:masterfrom
irozzo-1A wants to merge 1 commit intofalcosecurity:masterfrom
Conversation
Perf diff from master - unit testsHeap diff from master - unit testsHeap diff from master - scap fileBenchmarks diff from master |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2974 +/- ##
==========================================
+ Coverage 75.00% 75.16% +0.16%
==========================================
Files 297 297
Lines 31912 32284 +372
Branches 5059 5107 +48
==========================================
+ Hits 23936 24267 +331
- Misses 7976 8017 +41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8322cdd to
02c9933
Compare
52468dc to
77315a8
Compare
…nal project support
Introduce cmake/toolchains/zig.cmake, a generic Zig toolchain file that
derives CMAKE_SYSTEM_PROCESSOR from the ZIG_TARGET env var and locates
the zig executable via ZIG env var, CMAKE_C_COMPILER fallback, or PATH.
Refactor ExternalProjectToolchain.cmake to correctly propagate compiler
subcommands (CMAKE_*_COMPILER_ARG1), target flags, and multi-tool
archivers (via ENV{AR}/ENV{RANLIB}) to autotools-based external projects.
Add FALCOSECURITY_AUTOTOOLS_HOST_FLAG for cross-compilation --host support.
Update install-zig action to export ZIG, ZIG_TARGET, and
ZIG_TOOLCHAIN_FILE instead of wrapper scripts. Update CI to use
-DCMAKE_TOOLCHAIN_FILE.
Additional fixes for glibc 2.17 compatibility:
- Add gettid() fallback in libpman for glibc < 2.30
- Propagate toolchain CFLAGS into zlib's configure
- Use falcosecurity_external_project_cache_args in fmt
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
765e6d7 to
f3888e2
Compare
Contributor
|
LGTM label has been added. DetailsGit tree hash: 31710b15aacbd77788a6b9812ffb57b03c8d8111 |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekoops, irozzo-1A The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area build
/area CI
Does this PR require a change in the driver versions?
What this PR does / why we need it:
Introduce cmake/toolchains/zig.cmake, a generic Zig toolchain file that derives CMAKE_SYSTEM_PROCESSOR from the ZIG_TARGET env var and locates the zig executable via ZIG env var, CMAKE_C_COMPILER fallback, or PATH.
Refactor ExternalProjectToolchain.cmake to correctly propagate compiler subcommands (CMAKE_*_COMPILER_ARG1), target flags, and multi-tool archivers (via ENV{AR}/ENV{RANLIB}) to autotools-based external projects. Add FALCOSECURITY_AUTOTOOLS_HOST_FLAG for cross-compilation --host support.
Update install-zig action to export ZIG, ZIG_TARGET, and ZIG_TOOLCHAIN_FILE instead of wrapper scripts. Update CI to use -DCMAKE_TOOLCHAIN_FILE.
Additional fixes for glibc 2.17 compatibility:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: