[SCM] invada-ladspa/master: do not use _init and _fini but instead {con, de}structor attributes
fsateler at users.alioth.debian.org
fsateler at users.alioth.debian.org
Tue Mar 4 14:24:21 UTC 2014
The following commit has been merged in the master branch:
commit 2ec081c923d70e2495fa0b4852331861fa5b9228
Author: Felipe Sateler <fsateler at debian.org>
Date: Tue Mar 4 11:23:32 2014 -0300
do not use _init and _fini but instead {con,de}structor attributes
According to [1] the use of _init is dangerous, the constructor
attribute should be used instead.
This also enables the use of regular gcc instead of ld in linker lines
in the makefile. This is useful to add support for LDFLAGS.
[1]
http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html#INIT-AND-CLEANUP
diff --git a/debian/patches/02-no-_init-_fini.patch b/debian/patches/02-no-_init-_fini.patch
new file mode 100644
index 0000000..4c97deb
--- /dev/null
+++ b/debian/patches/02-no-_init-_fini.patch
@@ -0,0 +1,130 @@
+Description: do not use _init and _fini but instead constructor attributes
+According to [1] the use of _init is dangerous, the constructor
+attribute should be used instead.
+
+This also enables the use of regular gcc instead of ld in linker lines
+in the makefile. This is useful to add support for LDFLAGS.
+
+[1] http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html#INIT-AND-CLEANUP
+Forwarded: no
+--- a/inv_compressor.c
++++ b/inv_compressor.c
+@@ -301,7 +301,8 @@ void cleanupIcomp(LADSPA_Handle Instance
+ LADSPA_Descriptor * g_psMonoCompDescriptor = NULL;
+ LADSPA_Descriptor * g_psStereoCompDescriptor = NULL;
+
+-void _init() {
++
++void __attribute__((constructor)) do_init() {
+
+ char ** pcPortNames;
+ LADSPA_PortDescriptor * piPortDescriptors;
+@@ -538,8 +539,8 @@ void deleteDescriptor(LADSPA_Descriptor
+ }
+ }
+
+-/* _fini() is called automatically when the library is unloaded. */
+-void _fini()
++/* do_fini() is called automatically when the library is unloaded. */
++void __attribute__((destructor)) do_fini()
+ {
+ deleteDescriptor(g_psMonoCompDescriptor);
+ deleteDescriptor(g_psStereoCompDescriptor);
+--- a/inv_erreverb.c
++++ b/inv_erreverb.c
+@@ -584,8 +584,8 @@ void cleanupIreverbER(LADSPA_Handle Inst
+ LADSPA_Descriptor * g_psMonoReverbDescriptor = NULL;
+ LADSPA_Descriptor * g_psSumReverbDescriptor = NULL;
+
+-/* _init() is called automatically when the plugin library is first loaded. */
+-void _init() {
++/* do_init() is called automatically when the plugin library is first loaded. */
++void __attribute__((constructor)) do_init() {
+
+ char ** pcPortNames;
+ LADSPA_PortDescriptor * piPortDescriptors;
+@@ -848,8 +848,8 @@ void deleteDescriptor(LADSPA_Descriptor
+ }
+ }
+
+-/* _fini() is called automatically when the library is unloaded. */
+-void _fini() {
++/* do_fini() is called automatically when the library is unloaded. */
++void __attribute__((destructor)) do_fini() {
+ deleteDescriptor(g_psMonoReverbDescriptor);
+ deleteDescriptor(g_psSumReverbDescriptor);
+ }
+--- a/inv_filter.c
++++ b/inv_filter.c
+@@ -305,8 +305,8 @@ LADSPA_Descriptor * g_psStereoLPFDescrip
+ LADSPA_Descriptor * g_psStereoHPFDescriptor = NULL;
+
+
+-/* _init() is called automatically when the plugin library is first loaded. */
+-void _init() {
++/* do_init() is called automatically when the plugin library is first loaded. */
++void __attribute__((constructor)) do_init() {
+
+ char ** pcPortNames;
+ LADSPA_PortDescriptor * piPortDescriptors;
+@@ -581,8 +581,8 @@ void deleteDescriptor(LADSPA_Descriptor
+ }
+ }
+
+-/* _fini() is called automatically when the library is unloaded. */
+-void _fini() {
++/* do_fini() is called automatically when the library is unloaded. */
++void __attribute__((destructor)) do_fini() {
+ deleteDescriptor(g_psMonoLPFDescriptor);
+ deleteDescriptor(g_psMonoHPFDescriptor);
+ deleteDescriptor(g_psStereoLPFDescriptor);
+--- a/inv_input.c
++++ b/inv_input.c
+@@ -223,9 +223,9 @@ void cleanupIinput(LADSPA_Handle Instanc
+
+ LADSPA_Descriptor * g_psStereoDescriptor = NULL;
+
+-/* _init() is called automatically when the plugin library is first
++/* do_init() is called automatically when the plugin library is first
+ loaded. */
+-void _init() {
++void __attribute__((constructor)) do_init() {
+
+ char ** pcPortNames;
+ LADSPA_PortDescriptor * piPortDescriptors;
+@@ -333,8 +333,8 @@ deleteDescriptor(LADSPA_Descriptor * psD
+ }
+ }
+
+-/* _fini() is called automatically when the library is unloaded. */
+-void _fini() {
++/* do_fini() is called automatically when the library is unloaded. */
++void __attribute__((destructor)) do_fini() {
+ deleteDescriptor(g_psStereoDescriptor);
+ }
+
+--- a/inv_tube.c
++++ b/inv_tube.c
+@@ -226,9 +226,9 @@ void cleanupItube(LADSPA_Handle Instance
+ LADSPA_Descriptor * g_psMonoTubeDescriptor = NULL;
+ LADSPA_Descriptor * g_psStereoTubeDescriptor = NULL;
+
+-/* _init() is called automatically when the plugin library is first
++/* do_init() is called automatically when the plugin library is first
+ loaded. */
+-void _init() {
++void __attribute__((constructor)) do_init() {
+ char ** pcPortNames;
+ LADSPA_PortDescriptor * piPortDescriptors;
+ LADSPA_PortRangeHint * psPortRangeHints;
+@@ -389,8 +389,8 @@ void deleteDescriptor(LADSPA_Descriptor
+ }
+ }
+
+-/* _fini() is called automatically when the library is unloaded. */
+-void _fini() {
++/* do_fini() is called automatically when the library is unloaded. */
++void __attribute__((destructor)) do_fini() {
+ deleteDescriptor(g_psMonoTubeDescriptor);
+ deleteDescriptor(g_psStereoTubeDescriptor);
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 1714350..dfa3a35 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
01-pass_flags.patch
+02-no-_init-_fini.patch
--
invada-ladspa packaging
More information about the pkg-multimedia-commits
mailing list