[MacPorts] #31948: apple-gcc42: change behavior of the -isysroot option
#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 ---------------------------------+------------------------------------------ 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. -- Ticket URL: <https://trac.macports.org/ticket/31948> MacPorts <http://www.macports.org/> Ports system for Mac OS
#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
#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 ---------------------------------+------------------------------------------ Changes (by royliu@…): * cc: jeremyhu@… (added) -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#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 ---------------------------------+------------------------------------------ Comment(by royliu@…): I've also attached a cumulative patch for the port itself in `patch- isysroot.diff`. -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31948: apple-gcc42: change behavior of the -isysroot option ---------------------------------+------------------------------------------ Reporter: royliu@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: haspatch | Port: apple-gcc42 ---------------------------------+------------------------------------------ Changes (by ryandesign@…): * cc: jeremyhu@… (removed) * owner: macports-tickets@… => jeremyhu@… Comment: I imagine the portfile revision also needs to be increased. -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31948: apple-gcc42: change behavior of the -isysroot option ---------------------------------+------------------------------------------ Reporter: royliu@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: haspatch | Port: apple-gcc42 ---------------------------------+------------------------------------------ Comment(by royliu@…): By the way, if you deign to see the problem for yourself, try compiling `test.cpp` with `build_test.sh` without the patch. I've attached them. -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31948: apple-gcc42: change behavior of the -isysroot option ---------------------------------+------------------------------------------ Reporter: royliu@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: haspatch | Port: apple-gcc42 ---------------------------------+------------------------------------------ Comment(by jeremyhu@…): Yeah, this seems like the right approach to me. The compiler's bits don't belong in the SDK anyways, so even if this "worked" before, we'd be getting the wrong headers. I give this my maintainer blessing, but I'm confused why you modified other_langs.patch -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31948: apple-gcc42: change behavior of the -isysroot option ---------------------------------+------------------------------------------ Reporter: royliu@… | Owner: royliu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: haspatch | Port: apple-gcc42 ---------------------------------+------------------------------------------ Changes (by jeremyhu@…): * owner: jeremyhu@… => royliu@… Comment: Also, do we need to do this for the vanilla gcc ports as well? -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31948: apple-gcc42: change behavior of the -isysroot option ---------------------------------+------------------------------------------ Reporter: royliu@… | Owner: royliu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: haspatch | Port: apple-gcc42 ---------------------------------+------------------------------------------ Comment(by royliu@…): Well, assuming the patch is reasonable, yes: All Apple-modified compiler ports require patching. If I'm not mistaken, that means: * apple-gcc40 * apple-gcc42 * clang-2.9 * clang-3.0 * clang-3.1 Vanilla GCC doesn't seem to be affected, as search path modifications aren't present. Since this is such a far-reaching change, and since I'm not a compiler person, I am seeking your blessings as well as those of other compiler maintainers. :) Replying to [comment:7 jeremyhu@…]:
Also, do we need to do this for the vanilla gcc ports as well?
-- Ticket URL: <https://trac.macports.org/ticket/31948#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31948: apple-gcc42: change behavior of the -isysroot option ----------------------------------+----------------------------------------- Reporter: royliu@… | Owner: royliu@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Resolution: fixed | Keywords: haspatch Port: apple-gcc42 | ----------------------------------+----------------------------------------- Changes (by royliu@…): * status: new => closed * resolution: => fixed Comment: jeremyhu, FYI, those patch changes help the patches apply without warnings. I've committed r87123 and am closing this for now. Please open a new bug if this change causes trouble. -Roy -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31948: apple-gcc42: change behavior of the -isysroot option ----------------------------------+----------------------------------------- Reporter: royliu@… | Owner: royliu@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Resolution: fixed | Keywords: haspatch Port: apple-gcc42 | ----------------------------------+----------------------------------------- Changes (by jmr@…): * cc: jeremyhu@… (added) -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31948: apple-gcc42: change behavior of the -isysroot option ----------------------------------+----------------------------------------- Reporter: royliu@… | Owner: royliu@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Resolution: fixed | Keywords: haspatch Port: apple-gcc42 | ----------------------------------+----------------------------------------- Comment(by jeremyhu@…): Nope, the change looks right to me. If anything crops up, we'll address it then, but I think this is "the right way" ... toolchain headers shouldn't be in the SDK anyways. Thanks for catching it. -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31948: apple-gcc42: change behavior of the -isysroot option ----------------------------------+----------------------------------------- Reporter: royliu@… | Owner: royliu@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Resolution: fixed | Keywords: haspatch Port: apple-gcc42 | ----------------------------------+----------------------------------------- Comment(by jeremyhu@…): Regression: #34233 -- Ticket URL: <https://trac.macports.org/ticket/31948#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts