Fix 32bit kernel builds by not using eu-strip accepted/tizen/20130520.094313 submit/tizen/20130509.184059 submit/tizen/20130517.024101
authorWilliam Douglas <william.douglas@intel.com>
Tue, 7 May 2013 19:57:42 +0000 (12:57 -0700)
committerWilliam Douglas <william.douglas@intel.com>
Tue, 7 May 2013 23:00:58 +0000 (16:00 -0700)
Right now 32bit kernel builds are failing because eu-strip is not
performing safe operations. In order to work around this, use objdump
as before when running a kernel build (by checking for a Kconfig file
in the BUILDIR).

Change-Id: I8c24eaab9e0ac1dfe21484522ce4e415d21fcb14
Signed-off-by: William Douglas <william.douglas@intel.com>
scripts/find-debuginfo.sh

index 50ceb18..c73f06b 100644 (file)
@@ -294,12 +294,36 @@ while read nlinks inum f; do
   esac
 
   mkdir -p "${debugdn}"
-  if test -w "$f"; then
-    strip_to_debug "${debugfn}" "$f"
+  if [ -e "${BUILDDIR}/Kconfig" ] ; then
+      mode=$(stat -c %a "$f")
+      chmod +w "$f"
+      objcopy --only-keep-debug $f $debugfn || :
+      (
+         shopt -s extglob
+         strip_option="--strip-all"
+         case "$f" in
+             *.ko)
+                 strip_option="--strip-debug" ;;
+             *$STRIP_KEEP_SYMTAB*)
+                 if test -n "$STRIP_KEEP_SYMTAB"; then
+                     strip_option="--strip-debug"
+                 fi
+                 ;;
+         esac
+         if test "$NO_DEBUGINFO_STRIP_DEBUG" = true ; then
+             strip_option=
+         fi
+         objcopy --add-gnu-debuglink=$debugfn -R .comment -R .GCC.command.line $strip_option $f
+         chmod $mode $f
+      ) || :
   else
-    chmod u+w "$f"
-    strip_to_debug "${debugfn}" "$f"
-    chmod u-w "$f"
+      if test -w "$f"; then
+         strip_to_debug "${debugfn}" "$f"
+      else
+         chmod u+w "$f"
+         strip_to_debug "${debugfn}" "$f"
+         chmod u-w "$f"
+      fi
   fi
 
   if [ -n "$id" ]; then