[cairo-commit] 5 commits - Makefile.am perf/.gitignore perf/Makefile.am RELEASING src/check-def.sh src/check-plt.sh src/Makefile.am test/Makefile.am

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Sep 6 10:54:25 PDT 2006


 Makefile.am      |   12 ++++++------
 RELEASING        |   36 +++++++-----------------------------
 perf/.gitignore  |    2 +-
 perf/Makefile.am |    2 +-
 src/Makefile.am  |    3 +++
 src/check-def.sh |   31 +++++++++++++++++++++++++++++++
 src/check-plt.sh |   17 +++++++++++++++++
 test/Makefile.am |    1 +
 8 files changed, 67 insertions(+), 37 deletions(-)

New commits:
diff-tree cd1b6650648b5a688b4b6c2d696d9434c824a13f (from 3d398b1a214a4e30806773a5198db0dace061608)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Sep 6 13:54:12 2006 -0400

    Add scripts to sanity check the shared object for exported and PLT symbols
    
    src/check-def.sh checks that the list of symbols exported is the same as the
    list of symbols in cairo.def, ie. symbols in public header files. (except for
    symbols starting with _cairo)
    
    src/check-plt.sh checks that no PLT entries exist for local function calls.
    This makes sure we keep the 'slim' annotations uptodate.
    
    These two are defined as tests in src/ and will be run during "make distcheck".
    However, they are skipped if the commands 'nm' and 'readelf' are not found.
    (We don't really rely on any functionality of eu-readelf, so using readelf
    proper which should be more commonlly installed.)

diff --git a/RELEASING b/RELEASING
index 3190072..3275972 100644
--- a/RELEASING
+++ b/RELEASING
@@ -7,6 +7,9 @@ Here are the steps to follow to create a
 
 2) Verify that the code passes "make distcheck"
 
+	First, make sure you have 'nm' and 'readelf' commands in PATH.
+	this should be Ok with any Linux distro.
+
 	Running "make distcheck" should result in no warnings or
 	errors and end with a message of the form:
 
@@ -18,35 +21,10 @@ Here are the steps to follow to create a
 	(But the tar file isn't actually ready yet, as we still have
 	some more steps to follow).
 
-2.a) Verify that there are no local symbol PLT entries.
-
-	XXX: Currently this is a manual step, but it would be nice to
-	get all the support for this integrated automatically into
-	make distcheck. (An alternative approach would automate the
-	generation of the aliases such as is done for fontconfig
-	rather than maintaining these manually with the slim_hidden
-	macros).
-
-	For now, here's what you need:
-
-	1. The elfutils package for your distribution
-	2. The relinfo.pl scritp available here:
-
-		http://people.freedesktop.org/~keithp/relinfo.pl
-
-	Then run the following command:
-
-		relinfo.pl src/.libs/libcairo.so
-
-	And ensure that it reports "0 for local syms". If not, then
-	run the following:
-
-		eu-readelf -r src/.libs/libcairo.so
-
-	And look for the symbols related to cairo in the relocation
-	section. For each of these, a call to slim_hidden_def and
-	slim_hidden_proto is needed in the cairo implementation in the
-	style of other similar calls.
+	If you get errors about local PLT entries, you get the list of
+	cairo and pixman entries with the error.  For each of these, a
+	call to slim_hidden_def and slim_hidden_proto is needed in the
+	cairo or pixman implementation in the style of other similar calls.
 
 3) Fill out an entry in the NEWS file
 
diff --git a/src/Makefile.am b/src/Makefile.am
index a22bf9b..745dfbc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -264,4 +264,7 @@ install-data-local:
 	  false ;									\
         fi
 
+TESTS = check-def.sh check-plt.sh
+EXTRA_DIST += $(TESTS)
+
 CLEANFILES = cairo.def cairo-features.h
diff --git a/src/check-def.sh b/src/check-def.sh
new file mode 100755
index 0000000..9417dbe
--- /dev/null
+++ b/src/check-def.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+LANG=C
+
+if ! which nm 2>/dev/null >/dev/null; then
+	echo "'nm' not found; skipping test"
+	exit 0
+fi
+
+test -z "$srcdir" && srcdir=.
+status=0
+
+defs="cairo.def"
+make $defs
+for def in $defs; do
+	lib=${def%.def}
+	lib=${lib##*/}
+	so=.libs/lib${lib}.so
+
+	test -f $so || continue
+	echo Checking $def
+
+	{
+		echo EXPORTS
+		nm $so | grep ' T ' | cut -d' ' -f3 | grep -v '^_cairo\|^_fini\|^_init' | sort -u
+		# cheat: copy the last line from the def file!
+		tail -n1 $def
+	} | diff $def - || status=1
+done
+
+exit $status
diff --git a/src/check-plt.sh b/src/check-plt.sh
new file mode 100755
index 0000000..1dd9005
--- /dev/null
+++ b/src/check-plt.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+LANG=C
+
+status=0
+
+if ! which readelf 2>/dev/null >/dev/null; then
+	echo "'readelf' not found; skipping test"
+	exit 0
+fi
+
+for so in .libs/lib*.so; do
+	echo Checking $so for local PLT entries
+	readelf -r $so | grep 'JU\?MP_SLOT' | grep 'cairo\|pixman' && status=1
+done
+
+exit $status
diff-tree 3d398b1a214a4e30806773a5198db0dace061608 (from c4d863afad7f45a0360c732b5b6d1c29064dc1f5)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Sep 6 13:49:53 2006 -0400

    [test/Makefile] Unset DIST_SUBDIRS

diff --git a/test/Makefile.am b/test/Makefile.am
index e5da2ab..111f1c1 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,5 @@
 SUBDIRS=../boilerplate
+DIST_SUBDIRS =
 
 # Here are all the tests that are run unconditionally
 TESTS = 			\
diff-tree c4d863afad7f45a0360c732b5b6d1c29064dc1f5 (from 6b377b62ac45b92e08e7dee2378d50d87f0ab410)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Sep 6 13:49:27 2006 -0400

    [perf/Makefile] Unset DIST_SUBDIRS

diff --git a/perf/Makefile.am b/perf/Makefile.am
index 099576f..d10c3d0 100644
--- a/perf/Makefile.am
+++ b/perf/Makefile.am
@@ -1,4 +1,5 @@
 SUBDIRS=../boilerplate
+DIST_SUBDIRS =
 
 # We're using _GNU_SOURCE to get the prototype for asprintf. This may
 # not be the most portable approach, but it is pragmatic and I'm
@@ -16,7 +17,6 @@ noinst_PROGRAMS = cairo-perf
 cairo_perf_SOURCES =		\
 	cairo-perf.c		\
 	cairo-perf.h		\
-	cairo-perf-timer.h	\
 	paint.c			\
 	tessellate.c
 
diff-tree 6b377b62ac45b92e08e7dee2378d50d87f0ab410 (from 94c361cd2a775a94a6e770ea81f6e81edf6165b4)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Sep 6 13:49:02 2006 -0400

    Update

diff --git a/perf/.gitignore b/perf/.gitignore
index 5ce1a44..f182130 100644
--- a/perf/.gitignore
+++ b/perf/.gitignore
@@ -1,2 +1,2 @@
 cairo-perf
-
+*.o
diff-tree 94c361cd2a775a94a6e770ea81f6e81edf6165b4 (from 8c9ea020cab66c9f133571db2b56f96d4c28cdbd)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Sep 6 13:47:37 2006 -0400

    [Makefile] Add perf to DIST_SUBDIRS

diff --git a/Makefile.am b/Makefile.am
index efc2bba..eb98104 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,10 @@
-DIST_SUBDIRS = pixman src boilerplate test doc
+DIST_SUBDIRS = pixman src boilerplate test perf doc
 SUBDIRS = pixman src doc
+# libpng is required for our test programs
+if CAIRO_HAS_PNG_FUNCTIONS
+SUBDIRS += test
+endif
+
 
 .PHONY: doc test retest recheck check-valgrind
 doc:
@@ -15,11 +20,6 @@ check-valgrind: all
 perf: all
 	cd perf && $(MAKE) $(AM_MAKEFLAGS) perf
 
-# libpng is required for our test programs
-if CAIRO_HAS_PNG_FUNCTIONS
-SUBDIRS += test
-endif
-
 EXTRA_DIST = \
 	BUGS \
 	CODING_STYLE \


More information about the cairo-commit mailing list