This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling 64bit programms on redhat as 4


On Fri, 2005-10-14 at 15:10 +0200, Peter Alberer wrote:
> Hi there,
> 
> i am trying to get gcc-3.4.4-2 to compile programms in 64 bit mode for a
> power5 system running redhat as 4 update 1. it works for some programms, but
> others (postgresql) are showing problems. 
> 
> my problem is that the default rpm-installation seems to think that 32-bit
> is the default compile variant. I have to add the -m64 switch to all gcc
> commands. The gcc configure options are the following:

I have exactly the same problem/question for the AMD64 architecture.
Can we have a general answer to this question?




> 
> Reading specs from /usr/lib/gcc/ppc64-redhat-linux/3.4.4/specs
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
> --infodir=/usr/share/info --enable-shared --enable-threads=posix
> --disable-checking --with-system-zlib --enable-__cxa_atexit
> --disable-libunwind-exceptions --enable-java-awt=gtk
> --host=ppc64-redhat-linux --build=ppc64-redhat-linux
> --target=ppc64-redhat-linux --with-cpu=default32
> Thread model: posix
> gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)
> 

My specs file is located in: 
"/usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3"
Where do I find how my gcc was configured?





> I have tried to ways to get gcc to create 64bit output:
> - use the rpm version with the -m64 switch
> - use a self-compiled version of gcc I installed to /opt/gcc64
> 
> But both of these compilers somehow _seem_ to be somehow tied to the 32bit
> environment. When a do an "strace gcc ..." I always see the following:
> 
> [snip]
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
> directory)
> open("/etc/ld.so.cache", O_RDONLY)      = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=43636, ...}) = 0
> mmap(NULL, 43636, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf7ff4000
> close(3)                                = 0
> ----> open("/lib/tls/libc.so.6", O_RDONLY)    = 3 <-----
> read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\17\351"..., 512) =
> 512
> fstat64(3, {st_mode=S_IFREG|0755, st_size=1503784, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> 0xf7ff3000
> mmap(0xfe80000, 1357276, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
> 0) = 0xfe80000
> mprotect(0xffb5000, 91612, PROT_NONE)   = 0
> mmap(0xffc4000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC,
> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x134000) = 0xffc4000
> mmap(0xffca000, 5596, PROT_READ|PROT_WRITE|PROT_EXEC,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffca000
> close(3)             
> [/snip]
> 
> My main questions:
> - Why is the file "/lib/tls/libc.so.6" used here and not the same file in
> /lib64?
> - Where does gcc find the info which version of the libs (32/64-bit) to use?
> - do others have experience with systems running redhat as4 where gcc seems
> to behave funny?

Same question for me.



> 
> TIA, peter
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]