Skip to content

Commit

Permalink
Fix build with -DCLR_CMAKE_USE_SYSTEM_BROTLI=true
Browse files Browse the repository at this point in the history
Currently, this fails on Fedora 41:

    $ ./build.sh  --cmakeargs  -DCLR_CMAKE_USE_SYSTEM_BROTLI=true /p:FullAssemblySigningSupported=false
    ...
    [100%] Linking CXX executable singlefilehost
    ld.lld: error: undefined symbol: BrotliDecoderCreateInstance
    >>> referenced by entrypoints.c
    >>> entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a

This seems to be a regression introduced when this bit was accidentally
dropped:
https://github.com/dotnet/runtime/pull/109707/files#diff-7a160e52815fdd808d9415ada41dd5b1748826b27c78277e14f4adcf1ce61511

Fix the build by re-introducing it.

Fixes: #110751
  • Loading branch information
omajid committed Dec 18, 2024
1 parent efb8a8f commit 5e42b11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/native/libs/System.IO.Compression.Native/extra_libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,12 @@ macro(append_extra_compression_libs NativeLibsExtra)
list(APPEND ZLIB_LIBRARIES $<IF:$<BOOL:${CLR_CMAKE_USE_SYSTEM_ZLIB}>,z,zlib>)
endif ()
list(APPEND ${NativeLibsExtra} ${ZLIB_LIBRARIES})

if (CLR_CMAKE_USE_SYSTEM_BROTLI)
find_library(BROTLIDEC brotlidec REQUIRED)
find_library(BROTLIENC brotlienc REQUIRED)

list(APPEND ${NativeLibsExtra} ${BROTLIDEC} ${BROTLIENC})
endif ()

endmacro()

0 comments on commit 5e42b11

Please sign in to comment.