Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GLIBCXX error on Linux by adjusting CMAKE_SYSTEM_NAME check #440

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

ncvicchi
Copy link
Member

@ncvicchi ncvicchi commented Dec 17, 2024

Related issue
Close #441

Description

This PR resolves the GLIBCXX version error observed when running the Wazuh agent on Linux after installing the latest RPM package.

The issue was caused by the CMAKE_SYSTEM_NAME check being executed before the project() declaration in the CMakeLists.txt file, which prevented proper detection of the system type.

This fix adjusts the location of the CMAKE_SYSTEM_NAME check to ensure it is evaluated after the project is initialized.

Root Cause

The following condition was evaluated too early:

if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
endif()

As a result, the -static-libstdc++ linker flag was not applied correctly during the build process for Linux.

@cborla cborla linked an issue Dec 17, 2024 that may be closed by this pull request
@cborla cborla changed the title librpm library missing fix Fix GLIBCXX version error on Linux by adjusting CMAKE_SYSTEM_NAME check Dec 17, 2024
@cborla cborla merged commit 49dc23d into master Dec 17, 2024
5 checks passed
@cborla cborla deleted the fix/167-library-missing-rpm branch December 17, 2024 19:34
@cborla cborla changed the title Fix GLIBCXX version error on Linux by adjusting CMAKE_SYSTEM_NAME check Fix GLIBCXX error on Linux by adjusting CMAKE_SYSTEM_NAME check Dec 17, 2024
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.

GLIBCXX version error when running the agent RPM package
4 participants