[OE-core] [PATCH 2/2] quilt: fix test for target build

Khem Raj raj.khem at gmail.com
Thu Apr 14 15:23:13 UTC 2011


On Wed, Apr 13, 2011 at 7:00 PM, Qing He <qing.he at intel.com> wrote:
> On Wed, 2011-04-13 at 23:36 +0800, Khem Raj wrote:
>> On Wed, Apr 13, 2011 at 2:26 AM, Qing He <qing.he at intel.com> wrote:
>> > From: Qing He <qing.he at intel.com>
>> >
>> > fixes [YOCTO #969]
>> >
>> > Signed-off-by: Qing He <qing.he at intel.com>
>> > ---
>> > ??.../quilt/quilt/gnu_patch_test_fix_target.patch ?? ??| ?? 66 ++++++++++++++++++++
>> > ??meta/recipes-devtools/quilt/quilt_0.48.bb ?? ?? ?? ?? ??| ?? ??6 +-
>> > ??2 files changed, 70 insertions(+), 2 deletions(-)
>> > ??create mode 100644 meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
>> >
>> > diff --git a/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch b/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
>> > new file mode 100644
>> > index 0000000..784fe76
>> > --- /dev/null
>> > +++ b/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
>> > @@ -0,0 +1,66 @@
>> > +The test of patch and diff should not be run for cross build,
>> > +rather, assume them as gnu version is rather safe. This is a
>> > +workaround to remove it altogether.
>> > +
>>
>> why is this patch needed. I assume all linux distributions use GNU
>> diff and patch
>> and that what is being checked so why remove the checks ? these messages
>> are atleast useful for folks who are trying other build hosts e.g. darwin
>
> Because patch is used at runtime rather than build time. It is used
> mainly in patch-wrapper and some other scripts.
>
> configure.ac of quilt practically doesn't differentiate them,
> this leads to problems in cross-compiling:
>  1. the QUILT_COMPAT_PROG_PATH finds the wrong patch, say we are
>     building on darwin with a non-GNU patch, host patch found in
>     /usr/bin or /sw/bin is irrelevant, what should be tested is
>     <target sysroot>/path/to/patch(which may not be /usr/bin), and
>     then @PATCH@ should be set to a value with <target sysroot>
>     removed.
>  2. the test is performed by running "patch --version", this obviously
>     doesn't work for cross-compiling.
>
> The right way to do this may be something like:
>  if test "x$cross_compiling" = "xyes"; then
>    AC_CHECK_PROG in target sysroot
>    PATCH=strip sysroot in the absolute path
>  else
>    QUILT_COPAT_PROG_PATH
>    original test
>  fi
>
> This is troublesome and error prone, since a separate SYSROOT needs to
> be handled by configure, and target patch may as well not in a standard
> path. The simplest way to do it is to remove the test, as we have
> separate recipes for quilt and quilt-native.
>
>
> The reason to touch this part of code is that the test itself doesn't
> work for newer versions of GNU patch, see:
>  http://lists.nongnu.org/archive/html/quilt-dev/2010-06/msg00002.html
> This surely fixes the configure error, but is logically not suitable for
> cross compiling.

As I understand you are trying to fix quilt target recipe. Then may it
will be better to take the above
patch for both target and native but apply this
workaround conditionally only for target recipe

there are options --with-patch --with-diff also
there to point these utilities
>
> Thanks,
> Qing
>




More information about the Openembedded-core mailing list