[Crash-utility] PPC64 compiler question

Dave Anderson anderson at redhat.com
Tue Jun 26 13:22:57 UTC 2012


While doing some testing I ran into a surprising crash-build
bug on ppc64, where on a RHEL5 ppc64 host, a simple "make"
command would build a 32-bit PPC crash utility.  But on RHEL6,
it built as 64-bit PPC64 crash utility as expected.  (This was due
to a crash-6.0.3 change to support "make target=PPC" on
a ppc64 host).

Anyway, the reason is that in the RHEL5 environment, if an 
application is compiled without specifying -m32 or -m64,
it builds a 32-bit binary, whereas on RHEL6 it builds a 
64-bit binary by default:

RHEL5:

# cat doit.c
main() {}
# gcc doit.c
# file a.out
a.out: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped
# gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# uname -r
2.6.18-308.el5
#

RHEL6:

# cat doit.c
main() {}
# gcc doit.c
# file a.out
a.out: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
# gcc --version
gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# uname -r
2.6.32-220.el6.ppc64
#

What controls that?  Is it the compiler, some environment setting, or what?

Dave




More information about the Crash-utility mailing list