#169 dar 2.4.14 build failures under OS X

v2_4_14
closed
None
1
2014-09-06
2014-06-21
Marius
No

Dar 2.4.14 fails to build under OS X 10.9.3 using MacPorts. The issue is with the default compiler:
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.
as I can cleanly compile dar using gcc 4.5 on the same platform. This issue does not affect OS X 10.8.5, where dar build with the default compiler. However, I have not been able to build any version dar 2.4.x under OS 10.7.4, while dar 2.3.x build cleanly.
I've attached the build log file.

1 Attachments

Discussion

  • Ryan Schmidt

    Ryan Schmidt - 2014-06-25

    Sounds like the problem is not with the compiler, but with the fact that OS X 10.9 uses libc++ (and the clang compiler is required to use that), whereas OS X 10.8 and earlier use libstdc++ regardless of compiler.

     
  • Denis Corbin

    Denis Corbin - 2014-06-25
    • status: unread --> open
    • assigned_to: Denis Corbin
     
  • Denis Corbin

    Denis Corbin - 2014-06-25

    OK, I understand that:
    - OS X 10.8 has libstdc++ and gcc 4.5 and all works fine while compiling dar,
    - OS X 10.9 has libc++ and clang and all works fine in that case too,
    - The problem arises under OS X 10.9 when you using clang (default compiler) and have libstdc++ installed instead of libc++

    In another hand, I have re-tested dar-2.4.14 on a FreeBSD system using clang 3.3. I have found a problem for the compilation of dar_cp and dar_static (which is not the problem met here). The attached patch (which is available also from GIT on branch_2.4.x) fixes the problem. So now dar can cleanly compile using clang again.

    if there is still problems please advise, thanks.

     
  • Denis Corbin

    Denis Corbin - 2014-06-25
    • status: open --> fixed
     
  • Ryan Schmidt

    Ryan Schmidt - 2014-07-22

    The patch doesn't fix the issue.

    To correct some of what was said above:

    • OS X 10.8 has libstdc++ and libc++. With Xcode 5, clang is the default and only compiler. libstdc++ is the C++ library used by the OS and by clang and other 3rd-party compilers by default.
    • OS X 10.9 has libstdc++ and libc++. With Xcode 5, clang is the default and only compiler. libc++ is the C++ library used by the OS and by clang by default; other 3rd-party compilers use libstdc++.
    • The problem arises when using libc++ instead of libstdc++.
     
  • Denis Corbin

    Denis Corbin - 2014-07-24
    • status: fixed --> open
     
  • Denis Corbin

    Denis Corbin - 2014-07-29

    Well, the problem I have here, is that there is no way to define from within autoconf and automake configuration files the standard C++ library to be used. Same thing about the compiler. In fact it would be dangerous to force a give value from within these configuration files as it would restrict the ability of the autoconf/automake stuff to adapt to the different Unix environments.

    The compiler used is the one pointed to by the CXX environment variable. If not set, autoconf tries different common name (g++, c++, ...) up to one available in the paths pointed to by the PATH environment variable.

    for the standard C++ library, the CXXFLAGS environment variable can receive a set of "-I" same thing with the LDFLAGS variable which can be set to the adhoc "-L" and eventually "-l<library>" before calling ./configure to point to the correct library if the selected compiler does not by default use the correct standard C++ library it can work with.

    ./configure --help gives a list of other useful environment variable that can be used to overcome default settings. ... I just hope it will be sufficient to address this issue.

     
  • Ryan Schmidt

    Ryan Schmidt - 2014-07-29

    None of that's relevant to the problem though. Yes, I'm aware that I can change the C++ library on Mavericks from libc++ to libstdc++ by adding -stdlib=libstdc++ to CXXFLAGS, and the build then succeeds. But that's only a workaround. The real solution is for you to rewrite your code so that it is compatible with libc++ too. But I'm not a C++ programmer so I'm not well equipped to help you do that.

     
  • Denis Corbin

    Denis Corbin - 2014-07-30

    Sorry for my misunderstanding. I thought the problem was a incompatibility between clang and libstdc++ not a problem between dar/libdar and libc++.

     
  • Denis Corbin

    Denis Corbin - 2014-07-31

    I have tested dar/libdar against libc++ and clang on linux (not on BSD). I fixed all issues I could find that way. Just hope it also fixes the problem met under OS X. Waiting for release 2.4.15, a source tarball is available (with signature) at:
    ftp://dar:2.4.15_RC@edrusb.is-a-geek.org/

    Any feedback is welcome, of course.

     
    Last edit: Denis Corbin 2014-08-09
  • Ryan Schmidt

    Ryan Schmidt - 2014-07-31

    2.4.15_RC1 built fine with libc++. I also tested on Mac OS X 10.6 which uses libstdc++ and it still built fine there as well. Thanks so much!

     
  • Denis Corbin

    Denis Corbin - 2014-08-01
    • status: open --> fixed
     
  • Denis Corbin

    Denis Corbin - 2014-08-01

    you are welcome! :)

     
  • Denis Corbin

    Denis Corbin - 2014-09-06
    • status: fixed --> closed
     

Log in to post a comment.