SOURCES: rpm.macros - __spec_install_post_check_so macro that finds unresol...

arekm arekm at pld-linux.org
Wed Nov 5 10:54:32 CET 2008


Author: arekm                        Date: Wed Nov  5 09:54:32 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- __spec_install_post_check_so macro that finds unresolved symbols in shared object files

---- Files affected:
SOURCES:
   rpm.macros (1.485 -> 1.486) 

---- Diffs:

================================================================
Index: SOURCES/rpm.macros
diff -u SOURCES/rpm.macros:1.485 SOURCES/rpm.macros:1.486
--- SOURCES/rpm.macros:1.485	Tue Nov  4 13:33:35 2008
+++ SOURCES/rpm.macros	Wed Nov  5 10:54:27 2008
@@ -488,6 +488,21 @@
 fi; }; __spec_install_post_chrpath } } }
 
 #-----------------------------------------------------------------
+# Find all shared object files with unresolved symbols. Warn
+# and terminate if any found (termination can be turned off by define).
+#%no_install_post_check_so 1
+%__spec_install_post_check_so { \
+ __spec_install_post_check_so() { \
+    fail=0; \
+    printf "Searching for shared objects with unresolved symbols..."; \
+    for f in $(find $RPM_BUILD_ROOT -type f -name '*.so*' -print); do \
+        LC_ALL=C objdump -T $f 2> /dev/null | LC_ALL=C awk -v "file=$f" 'BEGIN { found=0; symbols = "" } /^[0-9a-z]+ +D +\*UND\*/ { found = 1; symbols = symbols "\n\t" $NF } END { if (found) { print "Unresolved symbols found in: " file symbols; exit(1); } } ' || fail=1 ; \
+    done ; \
+    echo " DONE"; \
+    %{!?no_install_post_check_so:[ $fail -eq 1 ] && exit 1;} \
+}; __spec_install_post_check_so }}
+
+#-----------------------------------------------------------------
 # Find and gzip all kernel modules
 #
 # Requires: find
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/rpm.macros?r1=1.485&r2=1.486&f=u



More information about the pld-cvs-commit mailing list