[MacPorts] #31948: apple-gcc42: change behavior of the -isysroot option

MacPorts noreply at macports.org
Sun Nov 6 20:37:19 PST 2011


#31948: apple-gcc42: change behavior of the -isysroot option
---------------------------------+------------------------------------------
 Reporter:  royliu@…             |       Owner:  macports-tickets@…                   
     Type:  defect               |      Status:  new                                  
 Priority:  Normal               |   Milestone:                                       
Component:  ports                |     Version:  2.0.3                                
 Keywords:  haspatch             |        Port:  apple-gcc42                          
---------------------------------+------------------------------------------
Description changed by royliu@…:

Old description:

> When attempting to compile a port like `virtualbox` with the MacPorts
> `apple-gcc42` compiler, strange errors like this occur:
> {{{
> /Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error:
> stdarg.h: No such file or directory
> }}}
> After further investigation, this is because the `-isysroot` option is
> set.  Recall that doing so will cause the search for the compiler's own
> headers to occur in directories like (in the case of Xcode's own `llvm-
> gcc-4.2`):
> {{{
> /Developer/SDKs/MacOSX10.6.sdk/Developer/usr/llvm-gcc-4.2/lib/gcc/i686
> -apple-darwin11/4.2.1/include
> }}}
> Since we installed a MacPorts-based compiler, it will search in
> {{{
> /Developer/SDKs/MacOSX10.6.sdk/Developer/opt/local/lib/apple-
> gcc42/gcc/i686-apple-darwin11/4.2.1/include
> }}}
> Such a directory clearly doesn't exist, and this causes the `apple-gcc42`
> compiler to not find headers like `stdarg.h`.  The attached patch
> prevents appending of the SDK root to the compiler's own search paths.  I
> believe that this is a reasonable "fix" to the problem because:
>   1. MacPorts doesn't put a bunch of compiler-specific stuff into the SDK
> directories themselves.
>   2. The patch is essentially saying "Regardless of the SDK, I want to
> use a common set of compiler headers".
> Again, this is not a bug, but more of a change tailor-made for the way
> that MacPorts distributes packages.

New description:

 When attempting to compile a port like `virtualbox` with the MacPorts
 `apple-gcc42` compiler, strange errors like this occur:
 {{{
 /Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h:
 No such file or directory
 }}}
 After further investigation, this is because the `-isysroot` option is
 set.  Recall that doing so will cause the search for the compiler's own
 headers to occur in directories like (in the case of Xcode's own `llvm-
 gcc-4.2`):
 {{{
 /Developer/SDKs/MacOSX10.6.sdk/Developer/usr/llvm-gcc-4.2/lib/gcc/i686
 -apple-darwin11/4.2.1/include
 }}}
 Since we installed a MacPorts-based compiler, it will search in
 {{{
 /Developer/SDKs/MacOSX10.6.sdk/Developer/opt/local/lib/apple-
 gcc42/gcc/i686-apple-darwin11/4.2.1/include
 }}}
 Such a directory clearly doesn't exist, and this causes the `apple-gcc42`
 compiler to not find headers like `stdarg.h`.  The attached patch prevents
 prepending of the SDK root to the compiler's own search paths.  I believe
 that this is a reasonable "fix" to the problem because:
   1. MacPorts doesn't put a bunch of compiler-specific stuff into the SDK
 directories themselves.
   2. The patch is essentially saying "Regardless of the SDK, I want to use
 a common set of compiler headers".
 Again, this is not a bug, but more of a change tailor-made for the way
 that MacPorts distributes packages.

--

-- 
Ticket URL: <https://trac.macports.org/ticket/31948#comment:1>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list