* [PATCH] gcc-4.6: Add fix for relocation problem and ccache @ 2012-04-13 11:56 Richard Purdie 2012-04-13 13:13 ` [PATCHv2] " Richard Purdie 0 siblings, 1 reply; 4+ messages in thread From: Richard Purdie @ 2012-04-13 11:56 UTC (permalink / raw) To: openembedded-core If the toolchain is reused from sstate and ccache is installed, build failures were occuring due to gcc trying to access the original sysroot rather than the new one, particularly if the old sysroot existed but was not readable by the current user. This turns out of the an issue inside gcc to do with preservation of the sysroot option. See the gcc patch for more details. It only triggers when preprocessed sources are used which happens when ccache is used. [YOCTO #2074] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- diff --git a/meta/recipes-devtools/gcc/gcc-4.6.inc b/meta/recipes-devtools/gcc/gcc-4.6.inc index d40a534..3b2e97e 100644 --- a/meta/recipes-devtools/gcc/gcc-4.6.inc +++ b/meta/recipes-devtools/gcc/gcc-4.6.inc @@ -73,6 +73,7 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ file://gcc-arm-set-cost.patch \ file://GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch \ file://fortran-cross-compile-hack.patch \ + file://cpp-honour-sysroot.patch \ " SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch " diff --git a/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch new file mode 100644 index 0000000..808596f --- a/dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch @@ -0,0 +1,29 @@ +Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile +preprocessed source (.i files), the compiler will try and access the builtin sysroot location +rather than the --sysroot option specified on the commandline. If access to that directory is +permission denied (unreadable), gcc will error. + +This happens when ccache is in use due to the fact it uses preprocessed source files. + +The fix below adds %I to the cpp-output spec macro so the default sustitutions for -iprefix, +-isystem, -isysroot happen and the correct sysroot is used. + +[YOCTO #2074] + +Upstream-Status: Pending + +RP 2012/04/13 + +Index: gcc-4_6-branch/gcc/gcc.c +=================================================================== +--- gcc-4_6-branch.orig/gcc/gcc.c 2012-04-13 11:21:23.119758988 +0000 ++++ gcc-4_6-branch/gcc/gcc.c 2012-04-13 11:21:54.095758269 +0000 +@@ -953,7 +953,7 @@ + %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, + {".i", "@cpp-output", 0, 0, 0}, + {"@cpp-output", +- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, ++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, + {".s", "@assembler", 0, 0, 0}, + {"@assembler", + "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, -- cgit 0.9.0.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCHv2] gcc-4.6: Add fix for relocation problem and ccache 2012-04-13 11:56 [PATCH] gcc-4.6: Add fix for relocation problem and ccache Richard Purdie @ 2012-04-13 13:13 ` Richard Purdie 2012-04-13 18:05 ` Khem Raj 2012-04-13 20:57 ` McClintock Matthew-B29882 0 siblings, 2 replies; 4+ messages in thread From: Richard Purdie @ 2012-04-13 13:13 UTC (permalink / raw) To: Patches and discussions about the oe-core layer If the toolchain is reused from sstate and ccache is installed, build failures were occuring due to gcc trying to access the original sysroot rather than the new one, particularly if the old sysroot existed but was not readable by the current user. This turns out of the an issue inside gcc to do with preservation of the sysroot option. See the gcc patch for more details. It only triggers when preprocessed sources are used which happens when ccache is used. The same issue occurs with c++ and c++-cpp-output so the same fix is applied there. [YOCTO #2074] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- diff --git a/meta/recipes-devtools/gcc/gcc-4.6.inc b/meta/recipes-devtools/gcc/gcc-4.6.inc index d40a534..020e21b 100644 --- a/meta/recipes-devtools/gcc/gcc-4.6.inc +++ b/meta/recipes-devtools/gcc/gcc-4.6.inc @@ -1,6 +1,6 @@ require gcc-common.inc -PR = "r24" +PR = "r25" # Third digit in PV should be incremented after a minor release # happens from this branch on gcc e.g. currently its 4.6.0 @@ -73,6 +73,7 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ file://gcc-arm-set-cost.patch \ file://GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch \ file://fortran-cross-compile-hack.patch \ + file://cpp-honour-sysroot.patch \ " SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch " diff --git a/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch new file mode 100644 index 0000000..4792c20 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch @@ -0,0 +1,40 @@ +Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile +preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location +rather than the --sysroot option specified on the commandline. If access to that directory is +permission denied (unreadable), gcc will error. + +This happens when ccache is in use due to the fact it uses preprocessed source files. + +The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix, +-isystem, -isysroot happen and the correct sysroot is used. + +[YOCTO #2074] + +Upstream-Status: Pending + +RP 2012/04/13 + +Index: gcc-4_6-branch/gcc/gcc.c +=================================================================== +--- gcc-4_6-branch.orig/gcc/gcc.c 2012-04-13 12:24:37.939671140 +0000 ++++ gcc-4_6-branch/gcc/gcc.c 2012-04-13 12:24:54.439670688 +0000 +@@ -953,7 +953,7 @@ + %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, + {".i", "@cpp-output", 0, 0, 0}, + {"@cpp-output", +- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, ++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, + {".s", "@assembler", 0, 0, 0}, + {"@assembler", + "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, +Index: gcc-4_6-branch/gcc/cp/lang-specs.h +=================================================================== +--- gcc-4_6-branch.orig/gcc/cp/lang-specs.h 2012-04-13 12:25:01.019670594 +0000 ++++ gcc-4_6-branch/gcc/cp/lang-specs.h 2012-04-13 12:25:07.567670180 +0000 +@@ -64,5 +64,5 @@ + {".ii", "@c++-cpp-output", 0, 0, 0}, + {"@c++-cpp-output", + "%{!M:%{!MM:%{!E:\ +- cc1plus -fpreprocessed %i %(cc1_options) %2\ ++ cc1plus -fpreprocessed %i %I %(cc1_options) %2\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv2] gcc-4.6: Add fix for relocation problem and ccache 2012-04-13 13:13 ` [PATCHv2] " Richard Purdie @ 2012-04-13 18:05 ` Khem Raj 2012-04-13 20:57 ` McClintock Matthew-B29882 1 sibling, 0 replies; 4+ messages in thread From: Khem Raj @ 2012-04-13 18:05 UTC (permalink / raw) To: Patches and discussions about the oe-core layer On Fri, Apr 13, 2012 at 6:13 AM, Richard Purdie <richard.purdie@linuxfoundation.org> wrote: > If the toolchain is reused from sstate and ccache is installed, build failures > were occuring due to gcc trying to access the original sysroot rather than the > new one, particularly if the old sysroot existed but was not readable by the > current user. > > This turns out of the an issue inside gcc to do with preservation of the sysroot > option. See the gcc patch for more details. It only triggers when preprocessed > sources are used which happens when ccache is used. > > The same issue occurs with c++ and c++-cpp-output so the same fix is applied there. > > [YOCTO #2074] > > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> looks good. Acked-by: Khem Raj <raj.khem@gmail.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv2] gcc-4.6: Add fix for relocation problem and ccache 2012-04-13 13:13 ` [PATCHv2] " Richard Purdie 2012-04-13 18:05 ` Khem Raj @ 2012-04-13 20:57 ` McClintock Matthew-B29882 1 sibling, 0 replies; 4+ messages in thread From: McClintock Matthew-B29882 @ 2012-04-13 20:57 UTC (permalink / raw) To: Patches and discussions about the oe-core layer I suspect this would effect 1.1.2. -M On Fri, Apr 13, 2012 at 8:13 AM, Richard Purdie <richard.purdie@linuxfoundation.org> wrote: > If the toolchain is reused from sstate and ccache is installed, build failures > were occuring due to gcc trying to access the original sysroot rather than the > new one, particularly if the old sysroot existed but was not readable by the > current user. > > This turns out of the an issue inside gcc to do with preservation of the sysroot > option. See the gcc patch for more details. It only triggers when preprocessed > sources are used which happens when ccache is used. > > The same issue occurs with c++ and c++-cpp-output so the same fix is applied there. > > [YOCTO #2074] > > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> > --- > diff --git a/meta/recipes-devtools/gcc/gcc-4.6.inc b/meta/recipes-devtools/gcc/gcc-4.6.inc > index d40a534..020e21b 100644 > --- a/meta/recipes-devtools/gcc/gcc-4.6.inc > +++ b/meta/recipes-devtools/gcc/gcc-4.6.inc > @@ -1,6 +1,6 @@ > require gcc-common.inc > > -PR = "r24" > +PR = "r25" > > # Third digit in PV should be incremented after a minor release > # happens from this branch on gcc e.g. currently its 4.6.0 > @@ -73,6 +73,7 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \ > file://gcc-arm-set-cost.patch \ > file://GPLUSPLUS_INCLUDE_DIR_with_sysroot.patch \ > file://fortran-cross-compile-hack.patch \ > + file://cpp-honour-sysroot.patch \ > " > > SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch " > diff --git a/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch > new file mode 100644 > index 0000000..4792c20 > --- /dev/null > +++ b/meta/recipes-devtools/gcc/gcc-4.6/cpp-honour-sysroot.patch > @@ -0,0 +1,40 @@ > +Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile > +preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location > +rather than the --sysroot option specified on the commandline. If access to that directory is > +permission denied (unreadable), gcc will error. > + > +This happens when ccache is in use due to the fact it uses preprocessed source files. > + > +The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix, > +-isystem, -isysroot happen and the correct sysroot is used. > + > +[YOCTO #2074] > + > +Upstream-Status: Pending > + > +RP 2012/04/13 > + > +Index: gcc-4_6-branch/gcc/gcc.c > +=================================================================== > +--- gcc-4_6-branch.orig/gcc/gcc.c 2012-04-13 12:24:37.939671140 +0000 > ++++ gcc-4_6-branch/gcc/gcc.c 2012-04-13 12:24:54.439670688 +0000 > +@@ -953,7 +953,7 @@ > + %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, > + {".i", "@cpp-output", 0, 0, 0}, > + {"@cpp-output", > +- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, > ++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, > + {".s", "@assembler", 0, 0, 0}, > + {"@assembler", > + "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, > +Index: gcc-4_6-branch/gcc/cp/lang-specs.h > +=================================================================== > +--- gcc-4_6-branch.orig/gcc/cp/lang-specs.h 2012-04-13 12:25:01.019670594 +0000 > ++++ gcc-4_6-branch/gcc/cp/lang-specs.h 2012-04-13 12:25:07.567670180 +0000 > +@@ -64,5 +64,5 @@ > + {".ii", "@c++-cpp-output", 0, 0, 0}, > + {"@c++-cpp-output", > + "%{!M:%{!MM:%{!E:\ > +- cc1plus -fpreprocessed %i %(cc1_options) %2\ > ++ cc1plus -fpreprocessed %i %I %(cc1_options) %2\ > + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, > > > > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-13 21:06 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-04-13 11:56 [PATCH] gcc-4.6: Add fix for relocation problem and ccache Richard Purdie 2012-04-13 13:13 ` [PATCHv2] " Richard Purdie 2012-04-13 18:05 ` Khem Raj 2012-04-13 20:57 ` McClintock Matthew-B29882
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.