mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	snd_dlsym: only do versioning checks if built --with-versioning
a combination of some of the following garbage collecting LD/CFLAGS -Os -g0 -fdata-sections -ffunction-sections -s -Wl,--gc-sections -fno-unwind-tables -fno-asynchronous-unwind-tables causes the symbol versioning marker symbols to be removed from BSS since they're otherwise unreferenced. this causes dlsym failing to find them which results in runtime breakage: $ alsamixer ALSA lib dlmisc.c:142:(snd_dlsym_verify) unable to verify version for symbol snd_config_hook_load ALSA lib conf.c:3328:(snd_config_hooks_call) symbol snd_config_hook_load is not defined inside (null) ALSA lib conf.c:3788:(snd_config_update_r) hooks failed, removing configuration cannot open mixer: No such device or address correct DSO: $ objdump -T libasound.so.2.strip | grep _snd_config_hook_load_dlsym_config_hook_001 001196bc g DO .bss 00000001 _snd_config_hook_load_dlsym_config_hook_001 incorrect DSO: $ objdump -T libs/libasound.so.2 | grep _snd_config_hook_load_dlsym_config_hook_001 00000000 g DO *ABS* 00000001 _snd_config_hook_load_dlsym_config_hook_001 since alsa was built with --without-versioning, doing those versioning checks at all is unnecessary and harmful and thus now disabled in this case. Signed-off-by: John Spencer <maillist-alsa@barfooze.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									5a066cb884
								
							
						
					
					
						commit
						11fdac949b
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -177,11 +177,13 @@ void *snd_dlsym(void *handle, const char *name, const char *version)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#ifdef HAVE_LIBDL
 | 
					#ifdef HAVE_LIBDL
 | 
				
			||||||
 | 
					#ifdef VERSIONED_SYMBOLS
 | 
				
			||||||
	if (version) {
 | 
						if (version) {
 | 
				
			||||||
		err = snd_dlsym_verify(handle, name, version);
 | 
							err = snd_dlsym_verify(handle, name, version);
 | 
				
			||||||
		if (err < 0)
 | 
							if (err < 0)
 | 
				
			||||||
			return NULL;
 | 
								return NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
	return dlsym(handle, name);
 | 
						return dlsym(handle, name);
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	return NULL;
 | 
						return NULL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue