[MacPorts] #34233: apple-gcc42 doesn't honor -isysroot correctly
MacPorts
noreply at macports.org
Thu May 17 04:10:25 PDT 2012
#34233: apple-gcc42 doesn't honor -isysroot correctly
-----------------------------------+----------------------------------------
Reporter: jeremyhu@… | Owner: royliu@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.0.4
Keywords: | Port: apple-gcc42
-----------------------------------+----------------------------------------
Comment(by royliu@…):
I'm still not understanding how my patch made things worse. There are
essentially two types of includes that are being addressed. They look
like:
{{{
/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686
-apple-darwin11/4.2.1/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include
}}}
I think the problem arises when Apple provides default compilers. These
default compilers are installed in the default prefix, i.e., `/usr`.
Apple also provides SDKs which serve as sysroots. A sysroot is a self-
contained, alternate include hierarchy. Naturally, the internal structure
of Apple SDKs use the `/usr` hierarchy to mirror their compiler
installations, and it's all good. The MacPorts compiler is installed in
`/opt/local`, and third party libraries are asking for `-isysroot` to be
set to an Apple-provided SDK which uses the `/usr` hierarchy. This is the
crux of the problem. The patch I made attempts to address the above two
cases. In the first case, the include directory is compiler-specific, and
so we actually want the MacPorts compiler's hierarchy, and drop the
sysroot. In the second case, the user's intention is to use a "default"
set of includes provided by the SDK. The best way I can think of is to:
1. Ignore `sysroot` for the compiler's include directory (the MacPorts
compiler directory being invariant over SDKs).
2. Overwrite `/opt/local/include` with `/usr/include` when `sysroot` is
about to be prepended, since that is what your vanilla Apple-provided
compiler has access to.
Is this set of policies what you had in mind? If not, what should be the
correct set of includes for a MacPorts compiler when `-isysroot` is
specified? If so, then can you give a case where my patch isn't correct?
--
Ticket URL: <https://trac.macports.org/ticket/34233#comment:16>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list