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

snmalloc/0.7.0 package update #35468

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented Nov 28, 2024

Signed-off-by: wolfi-bot <121097084+wolfi-bot@users.noreply.github.com>
@octo-sts octo-sts bot added request-version-update request for a newer version of a package automated pr labels Nov 28, 2024
Copy link
Contributor Author

octo-sts bot commented Nov 28, 2024

Gen AI suggestions to solve the build error:

• Detected Error:

/home/build/src/snmalloc/override/memcpy.cc:8:3: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
/home/build/src/snmalloc/override/memcpy.cc:9:24: error: redefinition of a 'extern inline' function 'memcpy' is not supported in C++

• Error Category: Build Configuration

• Failure Point: Compilation of memcpy.cc during cmake/build step

• Root Cause Analysis:
The error indicates two issues:

  1. Attribute declaration ordering problem with SNMALLOC_EXPORT
  2. Conflict with existing memcpy definition from glibc headers

• Suggested Fix:
Add the following CMake option to disable memcpy override:

  - uses: cmake/configure
    with:
      opts: |
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_C_COMPILER=clang \
        -DCMAKE_CXX_COMPILER=clang++ \
        -DSNMALLOC_BUILD_TESTING=OFF \
        -DSNMALLOC_LINK_ICF=ON \
        -DSNMALLOC_IPO=ON \
        -DSNMALLOC_STATIC_LIBRARY_PREFIX= \
        -DSNMALLOC_OVERRIDE_MEMCPY=OFF

• Explanation:
The build is failing because snmalloc tries to override the memcpy function, but this conflicts with glibc's fortified memcpy implementation. Disabling the memcpy override through SNMALLOC_OVERRIDE_MEMCPY=OFF will prevent this conflict while maintaining the core allocation functionality.

• Additional Notes:

  • This is a known issue when building with newer glibc versions that provide fortified string functions
  • The memcpy override is not critical for the core allocator functionality
  • This solution maintains compatibility while preserving security features from glibc

• References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated pr request-version-update request for a newer version of a package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant