Skip to content

KasperskyLab/abseil-cpp-kos

Repository files navigation

KasperskyOS adaptation patch for Abseil (C++ Common Libraries)

This project provides an adaptation patch for the Abseil C++ library, enabling its use in KasperskyOS-based solutions. The project is based on the 20250512.0 version.

For more information about the original Abseil C++ library, see its README.md file or Abseil website.

For additional details on KasperskyOS, including its limitations and known issues, please refer to the KasperskyOS Community Edition Online Help.

Table of contents

Getting started

Prerequisites

  1. Confirm that your host system meets all the System requirements listed in the KasperskyOS Community Edition Developer's Guide.
  2. Install the KasperskyOS Community Edition SDK version 1.4. You can download it for free from os.kaspersky.com.
  3. Copy the source files of this adaptation patch to your local project directory.
  4. Source the SDK setup script to configure the build environment. This exports the KOSCEDIR environment variable, which points to the SDK installation directory:
    source /opt/KasperskyOS-Community-Edition-<platform>-<version>/common/set_env.sh

Building and installing

The KasperskyOS-adapted version of the Abseil C++ library is built using the CMake build system, which is provided in the KasperskyOS Community Edition SDK. When you develop a KasperskyOS-based solution, use the recommended structure of project directories to simplify the use of CMake scripts.

Suppose to install the library into a user directory ~/.local/share/kos/. This path is passed to CMake using the CMAKE_INSTALL_PREFIX option.

To build and install the library, choose the command block corresponding to your desired library type:

  • Static Library

    $ cmake -B build \
            -D CMAKE_INSTALL_PREFIX=~/.local/share/kos/$(basename $KOSCEDIR)/sysroot-aarch64-kos \
            -D CMAKE_TOOLCHAIN_FILE="${KOSCEDIR}/toolchain/share/toolchain-aarch64-kos.cmake"
    $ cmake --build build -j`nproc` --target all install
  • Dynamic (Shared) Library

    $ cmake -B build \
            -D BUILD_SHARED_LIBS=ON \
            -D CMAKE_INSTALL_PREFIX=~/.local/share/kos/$(basename $KOSCEDIR)/sysroot-aarch64-kos \
            -D CMAKE_TOOLCHAIN_FILE="${KOSCEDIR}/toolchain/share/toolchain-aarch64-kos.cmake"
    $ cmake --build build -j`nproc` --target all install
  • Monolithic Shared Library (single .so file)

    $ cmake -B build \
            -D BUILD_SHARED_LIBS=ON \
            -D ABSL_BUILD_MONOLITHIC_SHARED_LIBS=ON \
            -D CMAKE_INSTALL_PREFIX=~/.local/share/kos/$(basename $KOSCEDIR)/sysroot-aarch64-kos \
            -D CMAKE_TOOLCHAIN_FILE="${KOSCEDIR}/toolchain/share/toolchain-aarch64-kos.cmake"
    $ cmake --build build -j`nproc` --target all install

After a successful build, the library is installed in the ~/.local/share/kos/$(basename $KOSCEDIR)/sysroot-aarch64-kos directory.

Note

This adaptation patch does not include the adaptation of unit tests.

Running the original Abseil unit tests on KasperskyOS requires significant additional adaptation, including but not limited to:

  • Adapting the test source code for the KasperskyOS.
  • Resolving external dependencies.
  • Adapting the CMake build scripts, including writing wrappers that create appropriate solutions for KasperskyOS for each test.

⬆ Back to Top

Usage

To integrate the KasperskyOS-adapted Abseil C++ library into your solution, first build and install it into the ~/.local/share/kos/ directory. For a practical implementation, refer to the abseil example in the KasperskyLab/kos-ce-extra repository, which demonstrates this exact workflow.

Trademarks

Registered trademarks and endpoint marks are the property of their respective owners.

AIX is a trademark of International Business Machines Corporation, registered in many jurisdictions worldwide.

Apache is either a registered trademark or a trademark of the Apache Software Foundation in the United States and/or other countries.

Apple, macOS are trademarks of Apple Inc.

Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein.

FreeBSD is a registered trademark of The FreeBSD Foundation.

GITHUB is a trademark of GitHub, Inc., registered in the United States and other countries.

iOS is a registered trademark or trademark of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

LTS is a registered trademark of Canonical Ltd.

VxWorks is a registered trademark (®) or service mark (SM) of Wind River Systems, Inc. This product is not affiliated with, endorsed, sponsored, supported by the owners of the third-party trademark mentioned herein.

Win32 is a trademark of the Microsoft group of companies.

Contributing

Only KasperskyOS-specific changes can be approved. See CONTRIBUTING.md for detailed instructions on code contribution.

Licensing

This project is licensed under the terms of the MIT license. See LICENSE for more information.

This project comprises publication(s) intended to be used with Abseil C++ library ( “Upstream Project”). The Upstream Project is licensed and distributed under its own license terms, which are separate from the terms of this project. Nothing in this repository is intended to modify, replace, supersede, or relicense the Upstream Project or any of its components.

⬆ Back to Top

© 2026 AO Kaspersky Lab

About

Abseil is an open source collection of C++ libraries drawn from the most fundamental pieces of Google’s internal codebase.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages