[FFmpeg-devel] Round 2: Symbol versioning

Reinhard Tartler siretart
Sun Dec 27 10:35:14 CET 2009


As discussed in the other thread, here is the 2nd round of the symbol
versioning patches. Both patches are included in this email. I'm
starting a new thread in order to get more attention for people who
might have lost interest by reading the other thread.

Comments/Flames as usual welcome.

[PATCH 1/2]

Add initial versioning scripts

These version scripts need to be adjusted on every SONAME bump. They do
not include the '.so' in the file name to avoid having them removed by
'make distclean'. This avoids having the files removed by distclean and
avoids that the file needs to be renamed on SONAME bumps.

libavformat and libavcodec are left rather liberal ATM because it is not
clear at this point which symbols are supposed to be exported and which
should rather be hidden. This file should be updated bit by bit by the
respective file maintainers.

---
 libavcodec/libavcodec.v   |    3 +++
 libavdevice/libavdevice.v |    4 ++++
 libavfilter/libavfilter.v |    4 ++++
 libavformat/libavformat.v |    3 +++
 libavutil/libavutil.v     |    4 ++++
 libpostproc/libpostproc.v |    4 ++++
 libswscale/libswscale.v   |    4 ++++
 7 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 libavcodec/libavcodec.v
 create mode 100644 libavdevice/libavdevice.v
 create mode 100644 libavfilter/libavfilter.v
 create mode 100644 libavformat/libavformat.v
 create mode 100644 libavutil/libavutil.v
 create mode 100644 libpostproc/libpostproc.v
 create mode 100644 libswscale/libswscale.v

diff --git a/libavcodec/libavcodec.v b/libavcodec/libavcodec.v
new file mode 100644
index 0000000..2be912f
--- /dev/null
+++ b/libavcodec/libavcodec.v
@@ -0,0 +1,3 @@
+LIBAVCODEC_52 {
+	global: *;
+};
diff --git a/libavdevice/libavdevice.v b/libavdevice/libavdevice.v
new file mode 100644
index 0000000..0a2d779
--- /dev/null
+++ b/libavdevice/libavdevice.v
@@ -0,0 +1,4 @@
+LIBAVDEVICE_52 {
+	global: avdevice_*;
+	local: *;
+};
diff --git a/libavfilter/libavfilter.v b/libavfilter/libavfilter.v
new file mode 100644
index 0000000..c179ebf
--- /dev/null
+++ b/libavfilter/libavfilter.v
@@ -0,0 +1,4 @@
+LIBAVFILTER_1 {
+	global: avfilter_*; av_*;
+	local: *;
+};
diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v
new file mode 100644
index 0000000..3608b14
--- /dev/null
+++ b/libavformat/libavformat.v
@@ -0,0 +1,3 @@
+LIBAVFORMAT_52 {
+	global: *;
+};
diff --git a/libavutil/libavutil.v b/libavutil/libavutil.v
new file mode 100644
index 0000000..ec8bec0
--- /dev/null
+++ b/libavutil/libavutil.v
@@ -0,0 +1,4 @@
+LIBAVUTIL_50 {
+	global: av_*; ff_*; avutil_*;
+	local: *;
+};
diff --git a/libpostproc/libpostproc.v b/libpostproc/libpostproc.v
new file mode 100644
index 0000000..36566ec
--- /dev/null
+++ b/libpostproc/libpostproc.v
@@ -0,0 +1,4 @@
+LIBPOSTPROC_51 {
+	global: postproc_*; pp_*;
+	local: *;
+};
diff --git a/libswscale/libswscale.v b/libswscale/libswscale.v
new file mode 100644
index 0000000..9946ddb
--- /dev/null
+++ b/libswscale/libswscale.v
@@ -0,0 +1,4 @@
+LIBSWSCALE_0 {
+	global: swscale_*; sws_*; ff_*;
+	local: *;
+};
-- 
1.6.3.3

[PATCH 2/2] Apply symbol versioning

This approach works for both 'regular' build as well as 'out-of-tree'
builds.
---
 subdir.mak |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/subdir.mak b/subdir.mak
index 1a5158a..2e33784 100644
--- a/subdir.mak
+++ b/subdir.mak
@@ -53,7 +53,9 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
 
 $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS)
 	$(SLIB_CREATE_DEF_CMD)
-	$(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
+	$(LD) $(SHFLAGS) $(FFLDFLAGS) \
+		-Wl,--version-script,$(SRC_PATH)/$$(@D)/$$(basename $(SLIBNAME)).v \
+		-o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
 	$(SLIB_EXTRA_CMD)
 
 ifdef SUBDIR
-- 
1.6.3.3



-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4




More information about the ffmpeg-devel mailing list