Opened 12 years ago

Closed 12 years ago

#38389 closed enhancement (wontfix)

hdf5-18: LLVM C11 support

Reported by: l@… Owned by: mamoll (Mark Moll)
Priority: Low Milestone:
Component: ports Version: 2.1.3
Keywords: C11 Cc:
Port: hdf5-18

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Hello,

For the C++ support for this port under Xcode if compiling with LLVM stdlib the flag -stdlib=libc++ is required if a project has been compiled with LLVM C11 support in Xcode. As such the following variant is necessary for the linker to not complain.

variant c11 description {
    Build with C11 support.
} conflicts universal gcc44 gcc45 gcc46 gcc47 {
    configure.cxxflags          -stdlib=libc++
}

Given that LLVM is the default compiler now, this should perhaps even be a default variant....

/Lasse

Change History (2)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Owner: changed from macports-tickets@… to mmoll@…
Summary: LLVM C11 supporthdf5-18: LLVM C11 support

When you say "LLVM is the default compiler now", that's not true for all versions of Xcode that MacPorts supports (Xcode 2.4.1 and up, mostly).

Why does this new variant need to conflict with universal? We like being able to build universal, so I would prefer if the default set of variants did not prevent it.

Shouldn't you be appending to the cxxflags rather than overwriting them?

comment:2 Changed 12 years ago by mamoll (Mark Moll)

Resolution: wontfix
Status: newclosed

That flag doesn't enable C++11 support. This flag does: -std=c++11. The flag -stdlib=libc++ just switches the C++ standard library from libstdc++ to libc++. This is not the default in any official release of xcode/clang at the moment. Since the two C++ libraries are not ABI compatible, all C++ code would have to compiled and linked against the same C++ library. Selectively adding variants is a bad way to do this. I wouldn't be surprised if there's a lot of legacy code that would break when compiled with libc++ (wether in C++11 mode or not).

Note: See TracTickets for help on using tickets.