0

when linking a dynamic lib, I get the following linker error and backtrace:

ld -dylib  -o libstx_libbasic.so -install_name @executable_path/libstx_libbasic.so libstx_libbasic.o /usr/lib/bundle1.o -lc -lffi ../librun/librun.so -lz -lbz2 -L/usr/X11/lib -lX11 -lXext 
ld: warning: -macosx_version_min not specificed, assuming 10.6

Assertion failed: (_dependentDylibs.size() != 0), function File, file /SourceCache/ld64/ld64-127.2/src/ld/parsers/macho_dylib_file.cpp, line 403.
0  0x100011051  __assert_rtn + 81
1  0x100070195  mach_o::dylib::File<x86_64>::File(unsigned char const*, unsigned long long, char const*, long, unsigned int, bool, bool, bool, ld::MacVersionMin, ld::IOSVersionMin, bool, bool, char const*, bool) + 2181
2  0x100062ce9  mach_o::dylib::Parser<x86_64>::parse(unsigned char const*, unsigned long long, char const*, long, unsigned int, Options const&, bool) + 249
3  0x100061fcb  mach_o::dylib::parse(unsigned char const*, unsigned long long, char const*, long, Options const&, unsigned int, bool, bool) + 315
4  0x100073980  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 768
5  0x10007507b  ld::tool::InputFiles::InputFiles(Options&, char const**) + 603
6  0x10001124a  main + 282
make[4]: *** [libstx_libbasic.so] Error 1

Now the funny (strange) thing is, that I only get this error on a macmini with xcode4.2 (which serves as a jenkins build server), NOT on a macbook pro with 3.2.6, on which I develop. Both have the same 10.6 and gcc versions installed: System:

  Systemversion:    Mac OS X 10.6.8 (10K549)
  Kernel-Version:   Darwin 10.8.0 

gcc:

  i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

However, the failing machine has XCode4.2, whereas the successful one has XCode3.2.6!

Bad (macmini):

  Version:  4.2 (4C199)
  Applications:
    Xcode:  4.2 (828)
    Instruments:    4.2 (4233)
    Dashcode:   3.0.2 (336)
  SDKs:
    Mac OS X:
      10.6: (10K549)

Good (macpro):

  Version:  3.2 (10M2518)
  Applications:
    Xcode:  3.2.6 (1761)
    Instruments:    2.7 (3017)
    Dashcode:   3.0.2 (333)
  SDKs:
    Mac OS X:
      10.5: (9L31a)
      10.6: (10M2518)

Does anyone know how to fix this situation (via compiler flags / additional installation of libs?), did I install things incorrect or do I have to revert to 3.2.6 on the build machine? I'd rather like to get it to compile with 4.2, as sooner or later, I will have to use it anyway.

Additional information: I don't need any of the XCode features, as this is a pure C/X11 application, which does not need UIbuilder or even Objective-C (at the moment). The target is x86_64 (i.e. not iphone)

ld version bad:

@(#)PROGRAM:ld  PROJECT:ld64-127.2
llvm version 3.0svn, from Apple Clang 3.0 (build 211.10.1)

ld version ok:

@(#)PROGRAM:ld  PROJECT:ld64-97.17
llvm version 2.9svn, from Apple Clang 1.7 (build 77)
4

0 回答 0