This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: gmp 4.2 failures on the G5


Dominique,
    Problem solved. On Darwin, we need an explicit -fPIC added to the
compile flags for gcc and g++. The reason was explained to me on the
darwin-dev mailing list...

--------------------------------------------------------------------
-fno-common is not the issue.

The issue is that GMP 4.2 compiles with:
using ABI="mode64"
       CC="gcc"
       CFLAGS="-m64 -mcpu=970 -fast"
       CPPFLAGS=""
       CXX="g++"
       CXXFLAGS="-m64 -mcpu=970 -fast"
       MPN_PATH=" powerpc64/mode64 powerpc64/vmx powerpc64 generic"

If one reads the documentation, one finds that -fast implies -mdynamic- 
no-pic, which generates object files that are not suitable for use in  
a dylib. The gcc man page has:

            To build shared libraries with -fast, specify -fPIC on  
command
            line.


Shantonu
---------------------------------------------------------------------
Does anyone know if it is possible to detect non-PIC code in darwin
shared libraries with the available tools in MacOS X? I recall there
was some discussion of doing this sort of test for ELF shared libraries
on Debian...

http://lists.debian.org/debian-gcc/2003/10/msg00115.html

It would be really nice if something like that were possible on MacOS X
as well. Specifically the fink developers could modify the behavior of
'fink validate' to perform such a check on any shared lib being packaged.
              Jack
ps If you try a build on your G5 with Apple's compilers using...

./configure --enable-cxx CC='gcc -fPIC' CXX='g++ -fPIC'

...the gmp 4.2 testsuite should pass completely. It is a miracle that 
the thing every worked.


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