tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Cross-building NetBSD-current on Mac OS X 10.5 (Leopard)



On Thu, 18 Aug 2011, Alistair Crooks wrote:
        checking for recent GMP... yes
        checking for __gmpz_init in -lgmp... no
        configure: error: libgmp not found or uses a different ABI.
        Please read the INSTALL file -- see "In case of problem".

Full/more output is appended below.

Yeah, we really need to see the link error from the mpz_init test in
config.log.

Full log is at http://www.feyrer.de/Misc/mpfr-config.log, the interesting part is:

        configure:13571: checking for __gmpz_init in -lgmp
        configure:13596: cc -o conftest -Wall -Wmissing-prototypes 
-Wpointer-arith
        -g -O2  
-I/Users/feyrer/work/NetBSD/cvs/src-current/tooldir.Darwin/include
        -Wl,-search_paths_first
        -L/Users/feyrer/work/NetBSD/cvs/src-current/tooldir.Darwin/lib 
conftest.c
        -lgmp   >&5
        ld: warning: ignoring file
        /Users/feyrer/work/NetBSD/cvs/src-current/tooldir.Darwin/lib/libgmp.a,
        file was built for archive which is not the architecture being linked
        (x86_64)
        Undefined symbols for architecture x86_64:
          "___gmpz_init", referenced from:
              _main in cc1RpI4I.o
        ld: symbol(s) not found for architecture x86_64
        collect2: ld returned 1 exit status

It seems that gmp was properly(?) built as 32bit object files:

        mini% file obj.i386-Darwin-XXX/tools/gmp/build/*.o
        obj.i386-Darwin-XXX/tools/gmp/build/assert.o:      Mach-O object i386
        obj.i386-Darwin-XXX/tools/gmp/build/compat.o:      Mach-O object i386
        ...

In the gmp config.log, -m32 is used (probably because of the ABI=32?),
I do not see this in the mpfr config.log. Example:

gmp config.log:
        configure:8564: checking whether the C compiler works
        configure:8586: cc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=core2 
-march=core2   conftest.c  >&5

mpfr config.log:
        configure:3950: checking whether the C compiler works
        configure:3972: cc   
-I/Users/feyrer/work/NetBSD/cvs/src-current/tooldir.Darwin/include  
-L/Users/feyrer/work/NetBSD/cvs/src-current/tooldir.Darwin/lib conftest.c  >&5


Also, it looks like the gcc version on Snow Leopard's
xcode is gcc 4.2, and there was a special case for that compiler in
gmp-h.in - more investigation required.

I have a newer Xcode than what Snow Leopart comes with, received from the Mac App Store. Version:

        mini% gcc -v
        Using built-in specs.
        Target: i686-apple-darwin10
        Configured with: /var/tmp/gcc/gcc-5666.3~123/src/configure
        --disable-checking --enable-werror --prefix=/usr --mandir=/share/man
        --enable-languages=c,objc,c++,obj-c++
        --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib
        --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10-
        --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
        --with-gxx-include-dir=/include/c++/4.2.1
        Thread model: posix
        gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)

Where to go from there?


 - Hubert


Home | Main Index | Thread Index | Old Index