[Crash-utility] crash-utility at redhat.com, anderson at redhat.com

Dave Anderson anderson at redhat.com
Fri Jul 4 13:27:33 UTC 2014



----- Original Message -----
> Hi
> 
> I have not seen anything like this before, so I cannot really help you with
> the problem. You should however be aware the in this case Crash is built as
> a 32-bit executable and must be built in that way to work properly. So you
> should look for missing 32-bit libraries.

That's right -- in this case the 32-bit ncurses-devel library is missing.

But there may be other libraries required.  I've transposed a bunch of notes 
that I have w/respect to building x86 (or arm as a target) binaries on an
x86_64 host:


09/26/12 Fedora 17: i686 packages installed to build x86 crash on x86_64:

         # rpm -qa | grep i686
         glibc-2.15-57.fc17.i686
         ncurses-libs-5.9-4.20120204.fc17.i686
         libgcc-4.7.0-5.fc17.i686
         zlib-static-1.2.5-7.fc17.i686
         ncurses-devel-5.9-4.20120204.fc17.i686
         nss-softokn-freebl-3.13.5-1.fc17.i686
         glibc-devel-2.15-57.fc17.i686
         #

09/07/11 If gdb won't build with target=X86 (or AMM) on Fedora 14 and 15, even with 
         glibc-devel.i686 and libgcc.i686 installed:

         crash build fails because of an ncurses issue:

         ...
         checking for library containing waddstr... no
         configure: WARNING: no enhanced curses library found; disabling TUI
         checking for library containing tgetent... no
         configure: error: no termcap library found
         make[3]: *** [configure-gdb] Error 1
         make[2]: *** [all] Error 2
         
         gdb build failed: gdb-7.0/gdb/libgdb.a does not exist

         After doing this:

	   sudo yum install ncurses-libs.i686
           sudo yum install ncurses.i686
	
         F15 yum couldn't find ncurses-devel.i686 and ncurses.i686
         so I did this:

	   rpm -ivh /root/ncurses-5.8-2.20110319.fc15.i686.rpm
           rpm -ivh /root/ncurses-devel-5.8-2.20110319.fc15.i686.rpm

         It would not use "incompatible" /usr/lib64/libz.a in the final link.

         Tried this:

         sudo yum install zlib.i686  (zlib-static used by x86_64 doesn't exist
         for i686, but that didn't work because -lz seems to still try the
         /usr/lib64 version.

         So I downloaded zlib-static.i686 from Fedora (it *does* exist), and
         manually installed the static /lib/libz.a.  And that worked:

         gcc -m32 -o ../../crash ../../crashlib.a libgdb.a \
           ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a  
           ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lncurses 
           -lm  ../libiberty/libiberty.a  gnulib/libgnu.a   -lz -ldl -rdynamic

         On F15, I did it right:
         
           rpm -ivh /root/zlib-static-1.2.5-3.fc15.i686.rpm
      
         The other libraries for -ldl and -lm were found, here showing the
         difference between a 32-bit and 64-bit binary:

         # ldd ./crash   
            linux-gate.so.1 =>  (0x005fa000)
            libncurses.so.5 => /lib/libncurses.so.5 (0x00cff000)
            libtinfo.so.5 => /lib/libtinfo.so.5 (0x005b6000)
            libm.so.6 => /lib/libm.so.6 (0x003ef000)
            libdl.so.2 => /lib/libdl.so.2 (0x00af0000)
            libc.so.6 => /lib/libc.so.6 (0x00883000)
            /lib/ld-linux.so.2 (0x002c5000)
         # ldd /usr/bin/crash
            linux-vdso.so.1 =>  (0x00007fffb3e85000)
            libncurses.so.5 => /lib64/libncurses.so.5 (0x0000003b06000000)
            libtinfo.so.5 => /lib64/libtinfo.so.5 (0x0000003b01800000)
            libz.so.1 => /lib64/libz.so.1 (0x0000003af8400000)
            libm.so.6 => /lib64/libm.so.6 (0x00007f3b6503a000)
            libdl.so.2 => /lib64/libdl.so.2 (0x00007f3b64e36000)
            libc.so.6 => /lib64/libc.so.6 (0x00007f3b64a9a000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f3b652bf000)
         # 

09/20/10 RHEL6 yum installation procedure required to build X86/ARM on X86_64:

         # yum groupinstall "Compatibility libraries"
         # yum install glibc-devel.i686
         # cc -m32 ...  (works OK)
         # yum install ncurses-devel.i686 zlib-devel.i686 
         # make target=X86
         ...

Hope this helps,
  Dave





> 
> Jan
> 
> Jan Karlsson
> Senior Software Engineer
> System Assurance
> 
> Sony Mobile Communications
> Tel: +46 703 062 174
> jan.karlsson at sonymobile.com
> 
> sonymobile.com
> 
> 
> 
> -----Original Message-----
> From: Yu Chen [mailto:chenyu105 at gmail.com]
> Sent: den 4 juli 2014 06:40
> To: ext-mika.1.westerberg at nokia.com; Karlsson, Jan; Fänge, Thomas
> Subject: crash-utility at redhat.com, anderson at redhat.com
> 
> Hi all!
> I am trying to compile crash-7.0.7  on x86_64 host  for arm.
> (x86 binary to analyze ARM dumpfiles)
> Here's the failure information:
> 
> -bash-4.1$ make target=arm
> TARGET: ARM
>  CRASH: 7.0.7
>    GDB: 7.6
> ...
> checking for gcc... gcc
> checking for C compiler default output file name... a.out checking whether
> the C compiler works... yes checking whether we are cross compiling... no
> checking for objcopy... objcopy checking for objdump... objdump checking for
> readelf... readelf checking for arm-elf-linux-cc... no checking for
> arm-elf-linux-gcc... no checking for arm-elf-linux-c++... no checking for
> arm-elf-linux-g++... no checking for arm-elf-linux-cxx... no checking for
> arm-elf-linux-gxx... no checking for arm-elf-linux-gcc... no checking for
> arm-elf-linux-gcj... no
> 
> ...
> checking for library containing waddstr... no
> configure: WARNING: no enhanced curses library found; disabling TUI checking
> for library containing tgetent... no
> configure: error: no termcap library found
> make[3]: *** [configure-gdb] Error 1
> make[2]: *** [all] Error 2
> 
> crash build failed
> 
> make[1]: *** [gdb_merge] Error 1
> make: *** [all] Error 2
> 
> I thought the reason for  above error  message was due to lack of  termcap
> library. However, the termcap library could be found on my host machine:
> 
> -bash-4.1$ find . -name "*termcap*"
> ./libtermcap.so.2
> ./libtermcap.so.2.0.8
> -bash-4.1$ pwd
> /lib64
> -bash-4.1$ uname -a
> Linux localhost.localdomain 2.6.32-220.el6.x86_64 #1 SMP Mon Sep 3
> 07:34:44 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
> 
> After I copyed x86_64 libtermcap.a into /lib64 ,the error message still
> exist.
> 
> I am confused if crash should be cross compiled in this situation?
> Or is there any step I  should take before compile crash?
> 
> 
> Many  thanks !
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility




More information about the Crash-utility mailing list