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

abseil-cpp\CMake\AbseilHelpers.cmake #796

Closed
ulinzeng opened this issue Sep 29, 2020 · 2 comments · Fixed by #797
Closed

abseil-cpp\CMake\AbseilHelpers.cmake #796

ulinzeng opened this issue Sep 29, 2020 · 2 comments · Fixed by #797
Labels

Comments

@ulinzeng
Copy link
Contributor

Describe the bug

When I use Abseil as a third-party library with source code integration, I want to compile a dynamic library under Windows. At this time, the problem arises. The target in abseil will also be compiled as dll_dep, and I have set BUILD_SHARED_LIBS=ON. Through debugging, I found that it turned out to be the reason for the setting of _NAME. When abseil is used as a third-party library, NAME will be set to "absl${ABSL_CC_LIB_NAME}", which is judged to be not part of the dll in the subsequent absl_internal_dll_contains function. These targets are thus identified as dll_dep, and then compiled with the ABSL_CONSUME_DLL macro definition attached, resulting in compilation errors.

@ulinzeng ulinzeng added the bug label Sep 29, 2020
@ulinzeng
Copy link
Contributor Author

log

The following is the log when compiled as a third-party library

==========================================
targetName: absl_atomic_hook              
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_errno_saver              
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_log_severity             
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_raw_logging_internal     
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_spinlock_wait            
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_config                   
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_dynamic_annotations      
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_core_headers             
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_malloc_internal          
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_base_internal            
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_base                     
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_throw_delegate           
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_pretty_function          
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_endian                   
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_bits                     
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_exponential_biased       
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_periodic_sampler         
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_scoped_set_env           
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_strerror                 
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_fast_type_id             
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_algorithm                
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_algorithm_container      
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_container                
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_btree                    
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_compressed_tuple         
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_fixed_array              
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_inlined_vector_internal  
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_inlined_vector           
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_counting_allocator       
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_flat_hash_map            
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_flat_hash_set            
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_node_hash_map            
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_node_hash_set            
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_container_memory         
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_hash_function_defaults   
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_hash_policy_traits       
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_hashtablez_sampler       
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_hashtable_debug          
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_hashtable_debug_hooks    
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_have_sse                 
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_node_hash_policy         
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_raw_hash_map             
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_container_common         
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_raw_hash_set             
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_layout                   
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_stacktrace               
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_symbolize                
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_examine_stack            
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================
targetName: absl_failure_signal_handler   
_ind_ll is 0                              
_build_type is dll_dep                    
==========================================

The following is the log when abseil is compiled as the main project

==========================================   
targetName: atomic_hook                      
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: errno_saver                      
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: log_severity                     
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: raw_logging_internal             
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: spinlock_wait                    
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: config                           
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: dynamic_annotations              
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: core_headers                     
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: malloc_internal                  
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: base_internal                    
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: base                             
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: throw_delegate                   
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: pretty_function                  
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: endian                           
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: bits                             
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: exponential_biased               
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: periodic_sampler                 
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: scoped_set_env                   
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: strerror                         
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: fast_type_id                     
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: algorithm                        
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: algorithm_container              
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: container                        
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: btree                            
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: compressed_tuple                 
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: fixed_array                      
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: inlined_vector_internal          
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: inlined_vector                   
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: counting_allocator               
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: flat_hash_map                    
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: flat_hash_set                    
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: node_hash_map                    
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: node_hash_set                    
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: container_memory                 
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: hash_function_defaults           
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: hash_policy_traits               
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: hashtablez_sampler               
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: hashtable_debug                  
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: hashtable_debug_hooks            
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: have_sse                         
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: node_hash_policy                 
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: raw_hash_map                     
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: container_common                 
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: raw_hash_set                     
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: layout                           
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: stacktrace                       
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: symbolize                        
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: examine_stack                    
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: failure_signal_handler           
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: debugging_internal               
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: demangle_internal                
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: leak_check                       
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: leak_check_disable               
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: debugging                        
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: flags_path_util                  
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_program_name               
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_config                     
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_marshalling                
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_commandlineflag_internal   
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_commandlineflag            
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_private_handle_accessor    
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_reflection                 
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_internal                   
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags                            
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_usage_internal             
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_usage                      
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: flags_parse                      
_ind_ll is 0                                 
_build_type is dll_dep                       
==========================================   
targetName: bind_front                       
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: function_ref                     
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: hash                             
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: city                             
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: memory                           
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: type_traits                      
_ind_ll is 1                                 
_build_type is dll                           
==========================================   
targetName: meta                             
_ind_ll is 1                                 
_build_type is dll                           

@ulinzeng
Copy link
Contributor Author

#797

@ulinzeng ulinzeng changed the title abseil-cpp\CMake\AbseilDll.cmake abseil-cpp\CMake\AbseilHelpers.cmake Sep 29, 2020
@suertreus suertreus linked a pull request Oct 3, 2020 that will close this issue
absl-federation-github pushed a commit that referenced this issue Nov 13, 2020
--
a1b28d83d60f96e14487f093566f12ba07f92732 by Mark Barolak <mbar@google.com>:

Import of CCTZ from GitHub.

PiperOrigin-RevId: 342270204

--
3d99c08b7e2ee23050f64965f09881b54821cdd0 by Mark Barolak <mbar@google.com>:

Fix a Windows DLL breakage that is causing all sub-libraries to be compiled as DLL dependencies instead of stand-alone DLLs.

See #796 for the bug report.

Import of #797

PiperOrigin-RevId: 341892182
GitOrigin-RevId: a1b28d83d60f96e14487f093566f12ba07f92732
Change-Id: I7d70f07492bfa9b657ec280a4f005c1ee893594c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant