Skip to content

Build fails with -DCLR_CMAKE_USE_SYSTEM_BROTLI=true #110751

@omajid

Description

@omajid

Description

Building the runtime with system brotli fails in the main branch

Reproduction Steps

$ git rev-parse HEAD
efb8a8fe6263cb66c154576c859523e885dc5a24
$ git branch -lv
* main efb8a8fe626 [browser] Speed up `WasmBuildTests` by using the compression switch (#110645)
$ ./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                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                             
  ld.lld: error: undefined symbol: BrotliDecoderDecompress                                                                                                    
  >>> referenced by entrypoints.c                                                                                                                             
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a       
                                                                                                                                                                                                                                                                                                                             
  ld.lld: error: undefined symbol: BrotliDecoderDecompressStream                                                                                              
  >>> referenced by entrypoints.c                                                                                                                             
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a          
                                                                                                                                                                                                                                                                                                                             
  ld.lld: error: undefined symbol: BrotliDecoderDestroyInstance                                                                                                                                                                                                                                                              
  >>> referenced by entrypoints.c                                                                                                                                                                                                                                                                                            
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                             
  ld.lld: error: undefined symbol: BrotliDecoderIsFinished                                                                                                                                                                                                                                                                   
  >>> referenced by entrypoints.c                                                                                                                                                                                                                                                                                            
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                             
  ld.lld: error: undefined symbol: BrotliEncoderCompress                                                                                                      
  >>> referenced by entrypoints.c                                                                                                                             
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a                                                                                                                                                                           
                                                                                                                                                              
  ld.lld: error: undefined symbol: BrotliEncoderCompressStream                                                                                                
  >>> referenced by entrypoints.c                                                                                                                             
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a                                                                                                                                                                           
                                                                                                                                                                                                                                                                                                                             
  ld.lld: error: undefined symbol: BrotliEncoderCreateInstance                                                                                                
  >>> referenced by entrypoints.c                                                                                                                             
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a                                                                                                                                                                           
                                                                                                                                                              
  ld.lld: error: undefined symbol: BrotliEncoderDestroyInstance                                                                                               
  >>> referenced by entrypoints.c                                                                                                                             
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a        
                                              
  ld.lld: error: undefined symbol: BrotliEncoderHasMoreOutput 
  >>> referenced by entrypoints.c
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a
   
  ld.lld: error: undefined symbol: BrotliEncoderMaxCompressedSize
  >>> referenced by entrypoints.c
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a
   
  ld.lld: error: undefined symbol: BrotliEncoderSetParameter    
  >>> referenced by entrypoints.c
  >>>               entrypoints.c.o:(s_compressionNative) in archive ../libs-native/System.IO.Compression.Native/libSystem.IO.Compression.Native.a
  clang++-19: error: linker command failed with exit code 1 (use -v to see invocation)                                                                        
  make[2]: *** [Corehost.Static/CMakeFiles/singlefilehost.dir/build.make:1303: Corehost.Static/singlefilehost] Error 1                                        
  make[1]: *** [CMakeFiles/Makefile2:2191: Corehost.Static/CMakeFiles/singlefilehost.dir/all] Error 2      

Expected behavior

Build works

Actual behavior

Linker fails to assemble an executable

Regression?

Yes. This was working some time ago.

Known Workarounds

No response

Configuration

  • This is main branch of dotnet/runtime
  • Fedora 41 on x64 (aka x86_64)

Other information

No response

Metadata

Metadata

Assignees

Labels

area-System.IO.Compressionin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions