Skip to content

Conversation

@suxiaogang223
Copy link
Contributor

Purpose

Linked issue: close #xxx

This PR fixes build errors encountered with GCC 15 compiler and optimizes build time by disabling unnecessary components (tests, examples, tools) in third-party libraries.

Build Fixes:

  1. lz4: Disable CLI tools (LZ4_BUILD_CLI=OFF, LZ4_BUILD_LEGACY_LZ4C=OFF) to avoid pthread_sigmask linking errors
  2. fmt: Disable tests and documentation (FMT_TEST=OFF, FMT_DOC=OFF) to avoid pthread_sigmask linking errors
  3. thrift (via arrow): Add -include cstdint compiler flag to fix int64_t undefined errors with GCC 15's stricter C++ standard implementation

Build Optimizations:
4. zstd: Disable command-line programs (ZSTD_BUILD_PROGRAMS=OFF) to reduce build time
5. arrow: Disable tests, benchmarks, and examples (ARROW_BUILD_TESTS=OFF, ARROW_BUILD_BENCHMARKS=OFF, ARROW_BUILD_EXAMPLES=OFF) to reduce build time

Tests

  • Verified that the project builds successfully with GCC 15.1.0
  • Confirmed that all third-party libraries compile without errors
  • Verified that the final binaries link correctly without missing symbols
  • Build time reduced significantly by disabling unnecessary components

API and Format

No API changes. This PR only affects the build configuration of third-party dependencies.

Documentation

No new features. This is a build system fix and optimization.

Detailed Changes

1. lz4 Build Configuration (build_lz4 macro)

Problem: Building lz4 CLI tools failed with pthread_sigmask undefined symbol error.
Solution: Added -DLZ4_BUILD_CLI=OFF -DLZ4_BUILD_LEGACY_LZ4C=OFF to disable both CLI tools since only the static library is needed.
Impact: Eliminates linking errors and reduces build time.

2. fmt Build Configuration (build_fmt macro)

Problem: Building fmt tests failed with pthread_sigmask undefined symbol error.
Solution: Added -DFMT_TEST=OFF -DFMT_DOC=OFF to disable tests and documentation generation.
Impact: Eliminates linking errors and reduces build time.

3. thrift Build Fix (via arrow configuration)

Problem: thrift's Mutex.h missing #include <cstdint> caused int64_t undefined errors with GCC 15's stricter C++ standard implementation (known issue THRIFT-5842).
Solution: Added -include cstdint compiler flag to ARROW_CMAKE_CXX_FLAGS to automatically include <cstdint> for all C++ files during arrow/thrift build.
Impact: Fixes compilation errors without modifying third-party source code. This is a cleaner solution than patching source files.

4. zstd Build Optimization (build_zstd macro)

Purpose: Reduce build time by disabling unnecessary command-line programs.
Change: Added -DZSTD_BUILD_PROGRAMS=OFF to disable zstd CLI tools.
Impact: Faster builds since only the static library is needed.

5. arrow Build Optimization (build_arrow macro)

Purpose: Reduce build time by disabling tests, benchmarks, and examples.
Change: Added -DARROW_BUILD_TESTS=OFF -DARROW_BUILD_BENCHMARKS=OFF -DARROW_BUILD_EXAMPLES=OFF.
Impact: Significantly faster arrow builds, especially important since arrow is one of the largest dependencies.

- Disable tests and documentation for fmt library.
- Disable CLI and legacy LZ4C builds for lz4 library.
- Add forced inclusion of <cstdint> for Arrow to address GCC 15 strictness.
- Disable program builds for zstd.
- Disable tests, benchmarks, and examples for arrow.
@CLAassistant
Copy link

CLAassistant commented Jan 7, 2026

CLA assistant check
All committers have signed the CLA.

@lucasfang
Copy link
Collaborator

+1

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes build errors with GCC 15 and optimizes third-party library build times by disabling unnecessary components. The changes address pthread_sigmask linking errors and missing int64_t type definition issues.

Key changes:

  • Added compiler flag -include cstdint to fix thrift's missing <cstdint> include with GCC 15
  • Disabled tests, CLI tools, and documentation builds for lz4, fmt, zstd, and arrow to eliminate linking errors and reduce build time

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@lxy-9602 lxy-9602 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@lxy-9602 lxy-9602 merged commit 43d9d02 into alibaba:main Jan 10, 2026
8 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.

4 participants