diff options
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | include/alsa-symbols.h | 12 | ||||
-rw-r--r-- | src/Makefile.am | 8 | ||||
-rw-r--r-- | src/pcm/pcm.c | 8 | ||||
-rw-r--r-- | src/timer/timer.c | 8 | ||||
-rw-r--r-- | src/timer/timer_query.c | 6 |
6 files changed, 31 insertions, 12 deletions
diff --git a/configure.in b/configure.in index 47217edb..fd415004 100644 --- a/configure.in +++ b/configure.in @@ -102,6 +102,7 @@ if test "$versioned" = "yes"; then else AC_MSG_RESULT(no) fi +AM_CONDITIONAL(VERSIONED_SYMBOLS, test x$versioned = xyes) dnl Check for debug... AC_MSG_CHECKING(for debug) diff --git a/include/alsa-symbols.h b/include/alsa-symbols.h index e1a32e65..43d9cab2 100644 --- a/include/alsa-symbols.h +++ b/include/alsa-symbols.h @@ -34,4 +34,16 @@ #define default_symbol_version(real, name, version) \ __asm__ (".symver " #real "," #name "@@" #version) +#ifdef USE_VERSIONED_SYMBOLS +#define use_symbol_version(real, name, version) \ + symbol_version(real, name, version) +#define use_default_symbol_version(real, name, version) \ + default_symbol_version(real, name, version) +#else +#define use_symbol_version(real, name, version) /* nothing */ +#define use_default_symbol_version(real, name, version) \ + __asm__ (".weak " #name); \ + __asm__ (".set " #name "," #real) +#endif + #endif /* __ALSA_SYMBOLS_H */ diff --git a/src/Makefile.am b/src/Makefile.am index 95c7c587..b631d174 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,6 +2,12 @@ SUBDIRS=control mixer pcm rawmidi timer hwdep seq instr compat conf EXTRA_DIST=Versions COMPATNUM=@LIBTOOL_VERSION_INFO@ +if VERSIONED_SYMBOLS +VSYMS = -Wl,--version-script=Versions +else +VSYMS = +endif + lib_LTLIBRARIES = libasound.la libasound_la_SOURCES = conf.c confmisc.c input.c output.c async.c error.c dlmisc.c libasound_la_LIBADD = control/libcontrol.la mixer/libmixer.la pcm/libpcm.la \ @@ -10,7 +16,7 @@ libasound_la_LIBADD = control/libcontrol.la mixer/libmixer.la pcm/libpcm.la \ compat/libcompat.la -lm -ldl -lpthread libasound_la_LDFLAGS = -version-info $(COMPATNUM) -LDFLAGS = -Wl,--version-script=Versions +LDFLAGS = $(VSYMS) control/libcontrol.la: $(MAKE) -C control libcontrol.la diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index c510ceec..6a514b74 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -1022,7 +1022,7 @@ snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames) assert(frames > 0); return pcm->fast_ops->forward(pcm->fast_op_arg, frames); } -default_symbol_version(__snd_pcm_forward, snd_pcm_forward, ALSA_0.9.0rc8); +use_default_symbol_version(__snd_pcm_forward, snd_pcm_forward, ALSA_0.9.0rc8); /** * \brief Write interleaved frames to a PCM @@ -1555,7 +1555,7 @@ const char *snd_pcm_type_name(snd_pcm_type_t type) return NULL; return snd_pcm_type_names[type]; } -default_symbol_version(__snd_pcm_type_name, snd_pcm_type_name, ALSA_0.9.0); +use_default_symbol_version(__snd_pcm_type_name, snd_pcm_type_name, ALSA_0.9.0); /** * \brief Dump current hardware setup for PCM @@ -5633,7 +5633,7 @@ void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimest assert(obj && ptr); *ptr = obj->trigger_tstamp; } -default_symbol_version(__snd_pcm_status_get_trigger_htstamp, snd_pcm_status_get_trigger_htstamp, ALSA_0.9.0rc8); +use_default_symbol_version(__snd_pcm_status_get_trigger_htstamp, snd_pcm_status_get_trigger_htstamp, ALSA_0.9.0rc8); /** * \brief Get "now" timestamp from a PCM status container @@ -5659,7 +5659,7 @@ void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *p assert(obj && ptr); *ptr = obj->tstamp; } -default_symbol_version(__snd_pcm_status_get_htstamp, snd_pcm_status_get_htstamp, ALSA_0.9.0rc8); +use_default_symbol_version(__snd_pcm_status_get_htstamp, snd_pcm_status_get_htstamp, ALSA_0.9.0rc8); /** * \brief Get delay from a PCM status container (see #snd_pcm_delay) diff --git a/src/timer/timer.c b/src/timer/timer.c index 8b366e66..608662dd 100644 --- a/src/timer/timer.c +++ b/src/timer/timer.c @@ -581,7 +581,7 @@ void snd_timer_params_set_exclusive(snd_timer_params_t * params, int exclusive) else params->flags &= ~SNDRV_TIMER_PSFLG_EXCLUSIVE; } -default_symbol_version(__snd_timer_params_set_exclusive, snd_timer_params_set_exclusive, ALSA_0.9.0); +use_default_symbol_version(__snd_timer_params_set_exclusive, snd_timer_params_set_exclusive, ALSA_0.9.0); /** * \brief determine if timer has exclusive flag @@ -597,7 +597,7 @@ int snd_timer_params_get_exclusive(snd_timer_params_t * params) assert(params); return params->flags & SNDRV_TIMER_PSFLG_EXCLUSIVE ? 1 : 0; } -default_symbol_version(__snd_timer_params_get_exclusive, snd_timer_params_get_exclusive, ALSA_0.9.0); +use_default_symbol_version(__snd_timer_params_get_exclusive, snd_timer_params_get_exclusive, ALSA_0.9.0); /** * \brief set timer ticks @@ -654,7 +654,7 @@ void snd_timer_params_set_filter(snd_timer_params_t * params, unsigned int filte assert(params); params->filter = filter; } -default_symbol_version(__snd_timer_params_set_filter, snd_timer_params_set_filter, ALSA_0.9.0); +use_default_symbol_version(__snd_timer_params_set_filter, snd_timer_params_set_filter, ALSA_0.9.0); /** * \brief get timer event filter @@ -670,7 +670,7 @@ unsigned int snd_timer_params_get_filter(snd_timer_params_t * params) assert(params); return params->filter; } -default_symbol_version(__snd_timer_params_get_filter, snd_timer_params_get_filter, ALSA_0.9.0); +use_default_symbol_version(__snd_timer_params_get_filter, snd_timer_params_get_filter, ALSA_0.9.0); /** * \brief set parameters for timer handle diff --git a/src/timer/timer_query.c b/src/timer/timer_query.c index 2765c235..2e3096f2 100644 --- a/src/timer/timer_query.c +++ b/src/timer/timer_query.c @@ -236,7 +236,7 @@ int snd_timer_query_info(snd_timer_query_t *timer, snd_timer_ginfo_t *info) assert(info); return timer->ops->info(timer, info); } -default_symbol_version(__snd_timer_query_info, snd_timer_query_info, ALSA_0.9.0); +use_default_symbol_version(__snd_timer_query_info, snd_timer_query_info, ALSA_0.9.0); /** * \brief set the timer global parameters @@ -254,7 +254,7 @@ int snd_timer_query_params(snd_timer_query_t *timer, snd_timer_gparams_t *params assert(params); return timer->ops->params(timer, params); } -default_symbol_version(__snd_timer_query_params, snd_timer_query_params, ALSA_0.9.0); +use_default_symbol_version(__snd_timer_query_params, snd_timer_query_params, ALSA_0.9.0); /** * \brief get the timer global status @@ -272,7 +272,7 @@ int snd_timer_query_status(snd_timer_query_t *timer, snd_timer_gstatus_t *status assert(status); return timer->ops->status(timer, status); } -default_symbol_version(__snd_timer_query_status, snd_timer_query_status, ALSA_0.9.0); +use_default_symbol_version(__snd_timer_query_status, snd_timer_query_status, ALSA_0.9.0); /** * \brief get size of the snd_timer_id_t structure in bytes |