Opened 13 years ago

Last modified 12 years ago

#31948 closed defect

apple-gcc42: change behavior of the -isysroot option — at Initial Version

Reported by: royliu@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: haspatch Cc:
Port: apple-gcc42

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.

Change History (1)

Changed 13 years ago by royliu@…

Attachment: patch-incpath.c.diff added

A patch that prevents prepending of the -isysroot option argument to the compiler's own search path.

Note: See TracTickets for help on using tickets.