Modernization: C++23 Core Refactor, CMake Build System, and Security Hardening#22
Open
dutch2005 wants to merge 6 commits into
Open
Modernization: C++23 Core Refactor, CMake Build System, and Security Hardening#22dutch2005 wants to merge 6 commits into
dutch2005 wants to merge 6 commits into
Conversation
…hardening Replace the legacy Makefile/rules.mk build system with a modern CMakeLists.txt that targets C++23 and integrates: - CMake presets for reproducible builds - CPack packaging for .deb (amd64/arm64) and .rpm generation - ARM64 cross-compilation via cmake/toolchain-arm64.cmake - GitHub Actions CI/CD pipeline (build.yml) with multi-arch matrix - Docker-based build environment - Security hardening: Full RELRO, PIE, stack protector, FORTIFY_SOURCE=2 - Generated version.h from version.h.in template - Pre-push hook for local validation Removed: Makefile, rules.mk, module.mk, src/module.mk, tools/Makefile, ppd/Makefile, ppd/compile.sh
- Fix pointer arithmetic and buffer overflow vulnerabilities in qpdl.cpp - Add sp_portable.h and sp_result.h for explicit error handling - Replace deprecated synchronization primitives with sp_semaphore - Initialize cache arrays properly to prevent race conditions - Use strictly typed integer sizes and bounds checking
- Add Samsung ML-1670, ML-1860 series, SCX-3400, M2020, M2070 - Add Samsung M262x / M267x / M283x series - Add Xerox Phaser 3020 support - Update existing PPD files with robust attribute lookup and quotes stripping - Support direct PPD fallback parsing for headless CI environments
- Integrate Google Test via CMake FetchContent - Add functional_test.sh with CUPS mocking for headless testing - Add Docker-based test runner scripts (run_tests_docker.sh, run_tests_docker.ps1) - Add CMake tests (test_build.sh) covering standard and cross-compiled builds
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.
Overview
This Pull Request introduces a comprehensive modernization of the SpliX driver, transitioning the original 2006-era C++98 codebase to modern C++23 standards.
The primary motivation for this effort (completed in April 2026) was to eliminate long-standing memory management boilerplate, deprecate the legacy Makefile system, and establish a robust, automated CI/CD pipeline. These changes ensure the driver's long-term maintainability, security, and stability on modern Linux/macOS distributions, while strictly maintaining 100% bit-perfect protocol compatibility with all legacy Samsung, Xerox, and Dell printers.
What was changed & Why
malloc/free,new/delete) and legacy POSIX threading. Replaced withstd::vector,std::span, andstd::counting_semaphore. Why: To natively guarantee memory safety, eliminate historical memory leaks, and remove hundreds of lines of duplicated buffer-tracking boilerplate.Makefileandrules.mkwith a robustCMake(3.25+) configuration. Why: To support modern IDEs, simplify dependency tracking, and natively integrate withCPackfor automated.deband.rpmpackaging.-fstack-protector-strong), and Fortify Source. Added explicit output-size bounds checking to the Algo0x11 (LZS) compression. Why: To bring the driver up to modern enterprise security standards and prevent potential edge-case buffer overflows on printer firmware.#ifdef WORDS_BIGENDIANfallback logic with modern standard-compliantmemcpy. Why: The previous logic was required for old Big-Endian host CPUs (like PowerPC). Modern C++ handles this natively, allowing us to generate the required Little-Endian QPDL payloads with much leaner code..ppdfiles natively. Why: Removes the burden for end-users to havecups-ppdcinstalled on modern operating systems.Verification
ubuntu:26.04to automatically cross-compile for both AMD64 and ARM64.0x11,0x15,0x0D,0x0E).