From b9c7a3ed764d9a9daaf110d3078a74dfac4c4b7a Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Sun, 21 Nov 2010 18:57:22 -0500 Subject: [PATCH] Solaris: Support -i in shlib-build Our librokenafs.map file contains symbols that we may not actually define, since the list of exported symbols varies depending on the platform's capabilities. This causes errors during linking, which can be suppressed by marking all symbols as "= EXTERN". Do so by having shlib-build modify the mapfile at link-time, when -i is specified to indicate ignoring undefined symbols. Reviewed-on: http://gerrit.openafs.org/3365 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit 222067f6f8fd4f596302befbc48918e10547ed1d) Change-Id: I4bdf000bbdc10b0818c2fab6eaff912f18e1f4fb Reviewed-on: http://gerrit.openafs.org/3561 Tested-by: Derrick Brashear --- src/config/shlib-build.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/config/shlib-build.in b/src/config/shlib-build.in index e54742b0c..bccbf11a1 100644 --- a/src/config/shlib-build.in +++ b/src/config/shlib-build.in @@ -92,7 +92,15 @@ rs_aix*) ;; sun*_5*) if [ -f "$srcdir/$library.map" ] ; then - export="-Wl,-M$srcdir/$library.map" + if [ -z "$ignore" ] ; then + export="-Wl,-M$srcdir/$library.map" + else + # add "= EXTERN" to every symbol, so we don't get errors about + # undefined symbols + cat "$srcdir/$library.map" | \ + sed -e 's/\([a-zA-Z_]\);$/\1 = EXTERN;/' > "$library.real.map" + export="-Wl,-M$library.real.map" + fi fi if [ -z "$soname" ] ; then echo "$linker $export -o $filename $*" -- 2.39.5