[yocto] [prelink-cross][PATCH] Add option to return an error if all binaries cannot be prelinked

2018-10-12 Thread Kyle Russell
Otherwise, there's no way to validate whether or not the operation
was actually successful without rescanning.

Signed-off-by: Kyle Russell 
---
 src/doit.c| 16 +++-
 src/main.c|  8 +++-
 src/prelink.h |  2 +-
 3 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/doit.c b/src/doit.c
index 1e32ad5..3784866 100644
--- a/src/doit.c
+++ b/src/doit.c
@@ -237,11 +237,11 @@ error_out:
   return;
 }
 
-void
+int
 prelink_all (void)
 {
   struct collect_ents l;
-  int i;
+  int i, fails = 0;
 
   l.ents =
 (struct prelink_entry **) alloca (prelink_entry_count
@@ -250,7 +250,13 @@ prelink_all (void)
   htab_traverse (prelink_filename_htab, find_ents, );
 
   for (i = 0; i < l.nents; ++i)
-if (l.ents[i]->done == 1
-   || (l.ents[i]->done == 0 && l.ents[i]->type == ET_EXEC))
-  prelink_ent (l.ents[i]);
+{
+  if (l.ents[i]->done == 1
+ || (l.ents[i]->done == 0 && l.ents[i]->type == ET_EXEC))
+   prelink_ent (l.ents[i]);
+  if (l.ents[i]->type == ET_UNPRELINKABLE)
+   fails++;
+}
+
+  return fails;
 }
diff --git a/src/main.c b/src/main.c
index 0cea86d..6ba89d5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -47,6 +47,7 @@ int one_file_system;
 int enable_cxx_optimizations = 1;
 int exec_shield;
 int undo, verify;
+int errors;
 enum verify_method_t verify_method;
 int quick;
 int compute_checksum;
@@ -90,6 +91,7 @@ static struct argp_option options[] = {
   {"black-list",   'b', "PATH", 0, "Blacklist path" },
   {"cache-file",   'C', "CACHE", 0, "Use CACHE as cache file" },
   {"config-file",  'c', "CONF", 0, "Use CONF as configuration file" },
+  {"errors",'e', 0, 0,  "Returns an error if all binaries are not 
prelinkable" },
   {"force",'f', 0, 0,  "Force prelinking" },
   {"dereference",  'h', 0, 0,  "Follow symlinks when processing directory 
trees from command line" },
   {"one-file-system",  'l', 0, 0,  "Stay in local file system when processing 
directories from command line" },
@@ -139,6 +141,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
   if (add_to_blacklist (arg, dereference, one_file_system))
exit (EXIT_FAILURE);
   break;
+case 'e':
+  errors = 1;
+  break;
 case 'f':
   force = 1;
   break;
@@ -524,7 +529,8 @@ main (int argc, char *argv[])
 prelink_load_cache ();
 
   layout_libs ();
-  prelink_all ();
+  if(prelink_all () && errors)
+return EXIT_FAILURE;
 
   if (! no_update && ! dry_run)
 prelink_save_cache (all);
diff --git a/src/prelink.h b/src/prelink.h
index 93dbf7a..c7b57e2 100644
--- a/src/prelink.h
+++ b/src/prelink.h
@@ -574,7 +574,7 @@ int get_relocated_mem (struct prelink_info *info, DSO *dso, 
GElf_Addr addr,
 
 int layout_libs (void);
 
-void prelink_all (void);
+int prelink_all (void);
 
 int undo_all (void);
 
-- 
2.17.1

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [prelink-cross][PATCH] Support copy relocations in .data.rel.ro

2018-10-12 Thread Kyle Russell
Do you want me to just resent my last two patches?  I don't mind if that
would be easier, and I'll remember to add the Signed-off-by. :)

On Fri, Oct 12, 2018 at 10:00 AM Mark Hatle 
wrote:

> On 10/4/18 9:12 AM, Kyle Russell wrote:
> > Hey Mark,
> >
> > Do you think this approach is reasonable?  If so, I have another patch
> I'd like
> > to propose that would enable us to better catch error scenarios (like
> the last
> > two patches address) that we might encounter during do_image_prelink.
> We just
> > happened to detect these last two issues even though image_prelink
> didn't fail
> > the build, so I'd like to provide an option to enable a little more
> assertive
> > error path, if desired.
>
> I'm getting caught back up on my prelink 'TODO' set.  The approach seems
> reasonable to me.  However, I appear to have lost the reference to the
> original
> patch email.
>
> I'm going to try to reapply from this email (or the list archive), but I
> may
> need you to resend it.  I'll let you [and others know] once I get these
> things
> merged.
>
> Thanks!
> --Mark
>
> > Thanks,
> > Kyle
> >
> > On Fri, Sep 28, 2018 at 10:57 AM Kyle Russell  > <mailto:bkyleruss...@gmail.com>> wrote:
> >
> > binutils-2.28 (17026142ef35b62ac88bfe517b4160614902cb28) adds support
> > for copying read-only dynamic symbols into .data.rel.ro <
> http://data.rel.ro>
> > instead of .bss
> > since .bss is technically writable.  This causes prelink to error
> out on
> > any binary containing COPY relocations in .data.rel.ro <
> http://data.rel.ro>.
> >
> > Read-only variables defined in shared libraries should be copied
> directly
> > into the space allocated for them in .data.rel.ro <
> http://data.rel.ro> by
> > the linker.
> >
> > To achieve this, we determine whether either of the two sections
> > containing copy relocations is .data.rel.ro <http://data.rel.ro>.
> If so, we
> > relocate the
> > symbol memory directly into the existing section instead of
> constructing
> > a new .(s)dynbss section once prelink_build_conflicts() returns.
> >
> > Fixes cxx1.sh, cxx2.sh, and cxx3.sh on Fedora 28 (which uses
> > binutils-2.29).
> > ---
> >  src/conflict.c | 51
> +-
> >  src/undo.c |  9 +
> >  2 files changed, 47 insertions(+), 13 deletions(-)
> >
> > diff --git a/src/conflict.c b/src/conflict.c
> > index 9ae2ddb..5613ace 100644
> > --- a/src/conflict.c
> > +++ b/src/conflict.c
> > @@ -450,7 +450,7 @@ get_relocated_mem (struct prelink_info *info,
> DSO *dso,
> > GElf_Addr addr,
> >  int
> >  prelink_build_conflicts (struct prelink_info *info)
> >  {
> > -  int i, ndeps = info->ent->ndepends + 1;
> > +  int i, reset_dynbss = 0, reset_sdynbss = 0, ndeps =
> info->ent->ndepends + 1;
> >struct prelink_entry *ent;
> >int ret = 0;
> >DSO *dso;
> > @@ -675,6 +675,11 @@ prelink_build_conflicts (struct prelink_info
> *info)
> >  dso->filename);
> >   goto error_out;
> > }
> > +
> > + name = strptr (dso, dso->ehdr.e_shstrndx,
> dso->shdr[bss1].sh_name);
> > + if (strcmp(name, ".data.rel.ro <http://data.rel.ro>") ==
> 0)
> > +   reset_sdynbss = 1;
> > +
> >   firstbss2 = i;
> >   info->sdynbss_size = cr.rela[i - 1].r_offset -
> cr.rela[0].r_offset;
> >   info->sdynbss_size += cr.rela[i - 1].r_addend;
> > @@ -702,6 +707,10 @@ prelink_build_conflicts (struct prelink_info
> *info)
> > }
> > }
> >
> > +  name = strptr (dso, dso->ehdr.e_shstrndx,
> dso->shdr[bss2].sh_name);
> > +  if (strcmp(name, ".data.rel.ro <http://data.rel.ro>") == 0)
> > +reset_dynbss = 1;
> > +
> >info->dynbss_size = cr.rela[cr.count - 1].r_offset
> >   - cr.rela[firstbss2].r_offset;
> >info->dynbss_size += cr.rela[cr.count - 1].r_addend;
> > @@ -719,9 +728,9 @@ prelink_build_conflicts (struct prelink_info
> *info)
> >   && strcmp (name = strptr (dso, dso->ehdr.e_shstrndx,
> > dso->shdr[bss1].sh_na

Re: [yocto] [prelink-cross][PATCH] Support copy relocations in .data.rel.ro

2018-10-04 Thread Kyle Russell
Hey Mark,

Do you think this approach is reasonable?  If so, I have another patch I'd
like to propose that would enable us to better catch error scenarios (like
the last two patches address) that we might encounter during
do_image_prelink.  We just happened to detect these last two issues even
though image_prelink didn't fail the build, so I'd like to provide an
option to enable a little more assertive error path, if desired.

Thanks,
Kyle

On Fri, Sep 28, 2018 at 10:57 AM Kyle Russell 
wrote:

> binutils-2.28 (17026142ef35b62ac88bfe517b4160614902cb28) adds support
> for copying read-only dynamic symbols into .data.rel.ro instead of .bss
> since .bss is technically writable.  This causes prelink to error out on
> any binary containing COPY relocations in .data.rel.ro.
>
> Read-only variables defined in shared libraries should be copied directly
> into the space allocated for them in .data.rel.ro by the linker.
>
> To achieve this, we determine whether either of the two sections
> containing copy relocations is .data.rel.ro.  If so, we relocate the
> symbol memory directly into the existing section instead of constructing
> a new .(s)dynbss section once prelink_build_conflicts() returns.
>
> Fixes cxx1.sh, cxx2.sh, and cxx3.sh on Fedora 28 (which uses
> binutils-2.29).
> ---
>  src/conflict.c | 51 +-
>  src/undo.c |  9 +
>  2 files changed, 47 insertions(+), 13 deletions(-)
>
> diff --git a/src/conflict.c b/src/conflict.c
> index 9ae2ddb..5613ace 100644
> --- a/src/conflict.c
> +++ b/src/conflict.c
> @@ -450,7 +450,7 @@ get_relocated_mem (struct prelink_info *info, DSO
> *dso, GElf_Addr addr,
>  int
>  prelink_build_conflicts (struct prelink_info *info)
>  {
> -  int i, ndeps = info->ent->ndepends + 1;
> +  int i, reset_dynbss = 0, reset_sdynbss = 0, ndeps = info->ent->ndepends
> + 1;
>struct prelink_entry *ent;
>int ret = 0;
>DSO *dso;
> @@ -675,6 +675,11 @@ prelink_build_conflicts (struct prelink_info *info)
>  dso->filename);
>   goto error_out;
> }
> +
> + name = strptr (dso, dso->ehdr.e_shstrndx,
> dso->shdr[bss1].sh_name);
> + if (strcmp(name, ".data.rel.ro") == 0)
> +   reset_sdynbss = 1;
> +
>   firstbss2 = i;
>   info->sdynbss_size = cr.rela[i - 1].r_offset -
> cr.rela[0].r_offset;
>   info->sdynbss_size += cr.rela[i - 1].r_addend;
> @@ -702,6 +707,10 @@ prelink_build_conflicts (struct prelink_info *info)
> }
> }
>
> +  name = strptr (dso, dso->ehdr.e_shstrndx, dso->shdr[bss2].sh_name);
> +  if (strcmp(name, ".data.rel.ro") == 0)
> +reset_dynbss = 1;
> +
>info->dynbss_size = cr.rela[cr.count - 1].r_offset
>   - cr.rela[firstbss2].r_offset;
>info->dynbss_size += cr.rela[cr.count - 1].r_addend;
> @@ -719,9 +728,9 @@ prelink_build_conflicts (struct prelink_info *info)
>   && strcmp (name = strptr (dso, dso->ehdr.e_shstrndx,
> dso->shdr[bss1].sh_name),
>  ".dynbss") != 0
> - && strcmp (name, ".sdynbss") != 0)
> + && strcmp (name, ".sdynbss") != 0 && strcmp (name, ".data.rel.ro")
> != 0)
> {
> - error (0, 0, "%s: COPY relocations don't point into .bss or
> .sbss section",
> + error (0, 0, "%s: COPY relocations don't point into .bss, .sbss,
> or .data.rel.ro sections",
>  dso->filename);
>   goto error_out;
> }
> @@ -730,9 +739,9 @@ prelink_build_conflicts (struct prelink_info *info)
>   && strcmp (name = strptr (dso, dso->ehdr.e_shstrndx,
> dso->shdr[bss2].sh_name),
>  ".dynbss") != 0
> - && strcmp (name, ".sdynbss") != 0)
> + && strcmp (name, ".sdynbss") != 0 && strcmp (name, ".data.rel.ro")
> != 0)
> {
> - error (0, 0, "%s: COPY relocations don't point into .bss or
> .sbss section",
> + error (0, 0, "%s: COPY relocations don't point into .bss, .sbss,
> or .data.rel.ro section",
>  dso->filename);
>   goto error_out;
> }
> @@ -768,16 +777,21 @@ prelink_build_conflicts (struct prelink_info *info)
>   }
>
>   assert (j < ndeps);
> + GElf_Addr symaddr = s->u.ent->base + s->value;
> + char *buf;
> +
> 

Re: [yocto] [prelink-cross][PATCH] rtld: get machine from undef_map for protected symbols

2018-09-28 Thread Kyle Russell
No objections, please go ahead.  Sorry I forgot!  I realize I didn't do
that on the other patch I just sent either.

On Fri, Sep 28, 2018 at 11:19 AM Mark Hatle 
wrote:

> On 9/28/18 9:55 AM, Kyle Russell wrote:
> > Avoids rtld segfault when _dl_lookup_symbol_x is called with NULL
> > for skip_map on a protected symbol relocation.
> >
> > Global protected symbols may not actually require a copy relocaton,
> > in which case skip_map is undefined, so use the undef_map to determine
> > the symbol arch.
>
> Thank you.  Any objections with me adding a 'Signed-off-by: ' line with
> your name?
>
> I'm going to start enforcing submissions need a signed-off-by line per the
> terms
> of the "Developer's Certificate of Origin",
>
>
> https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
>
> (While it is not yet a requirement, I'd like to start doing it now.)
>
> Thanks!
> --Mark
>
> > ---
> >  src/rtld/dl-lookupX.h   |  6 +++---
> >  testsuite/Makefile.am   |  2 +-
> >  testsuite/reloc12.c | 19 +++
> >  testsuite/reloc12.h | 11 +++
> >  testsuite/reloc12.sh| 20 
> >  testsuite/reloc12lib1.c | 11 +++
> >  testsuite/reloc12lib2.c | 16 
> >  7 files changed, 81 insertions(+), 4 deletions(-)
> >  create mode 100644 testsuite/reloc12.c
> >  create mode 100644 testsuite/reloc12.h
> >  create mode 100755 testsuite/reloc12.sh
> >  create mode 100644 testsuite/reloc12lib1.c
> >  create mode 100644 testsuite/reloc12lib2.c
> >
> > diff --git a/src/rtld/dl-lookupX.h b/src/rtld/dl-lookupX.h
> > index 425bb4b..250c509 100644
> > --- a/src/rtld/dl-lookupX.h
> > +++ b/src/rtld/dl-lookupX.h
> > @@ -679,10 +679,10 @@ _dl_lookup_symbol_x (const char *undef_name,
> struct link_map *undef_map,
> >   if (do_lookup_x (undef_name, new_hash, _hash, *ref,
> >_value, *scope, i, version, flags,
> >skip_map,
> > -
> (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(skip_map->machine)
> > +
> (ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(undef_map->machine)
> > && ELFW(ST_TYPE) ((*ref)->st_info) ==
> STT_OBJECT
> > -   && type_class ==
> ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(skip_map->machine))
> > -  ?
> ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(skip_map->machine)
> > +   && type_class ==
> ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(undef_map->machine))
> > +  ?
> ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(undef_map->machine)
> >: ELF_RTYPE_CLASS_PLT, NULL) != 0)
> > break;
> >
> > diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
> > index 030f65b..21de6a9 100644
> > --- a/testsuite/Makefile.am
> > +++ b/testsuite/Makefile.am
> > @@ -5,7 +5,7 @@ AM_CFLAGS = -Wall
> >
> >  TESTS = movelibs.sh \
> >   reloc1.sh reloc2.sh reloc3.sh reloc4.sh reloc5.sh reloc6.sh \
> > - reloc7.sh reloc8.sh reloc9.sh reloc10.sh reloc11.sh \
> > + reloc7.sh reloc8.sh reloc9.sh reloc10.sh reloc11.sh reloc12.sh \
> >   shuffle1.sh shuffle2.sh shuffle3.sh shuffle4.sh shuffle5.sh \
> >   shuffle6.sh shuffle7.sh shuffle8.sh shuffle9.sh undo1.sh \
> >   layout1.sh layout2.sh unprel1.sh \
> > diff --git a/testsuite/reloc12.c b/testsuite/reloc12.c
> > new file mode 100644
> > index 000..cfa
> > --- /dev/null
> > +++ b/testsuite/reloc12.c
> > @@ -0,0 +1,19 @@
> > +#include "reloc12.h"
> > +#include 
> > +
> > +int main()
> > +{
> > +  A* ptr = find('b');
> > +  if(b(ptr) != 0)
> > +abort();
> > +
> > +  ptr = find('a');
> > +  if(b(ptr) != 1)
> > +abort();
> > +
> > +  ptr = find('r');
> > +  if(b(ptr) != 2)
> > +abort();
> > +
> > +  exit(0);
> > +}
> > diff --git a/testsuite/reloc12.h b/testsuite/reloc12.h
> > new file mode 100644
> > index 000..8e09405
> > --- /dev/null
> > +++ b/testsuite/reloc12.h
> > @@ -0,0 +1,11 @@
> > +typedef struct
> > +  {
> > +char a;
> > +int b;
> > +  } A;
> > +
> > +extern A foo[] __attribute ((visibility ("protected")));
> > +
> > +A* find(char a);
> > +char a(const A*);
> > +int b(const A*);
> > diff --git a/testsuite/relo

[yocto] [prelink-cross][PATCH] Support copy relocations in .data.rel.ro

2018-09-28 Thread Kyle Russell
binutils-2.28 (17026142ef35b62ac88bfe517b4160614902cb28) adds support
for copying read-only dynamic symbols into .data.rel.ro instead of .bss
since .bss is technically writable.  This causes prelink to error out on
any binary containing COPY relocations in .data.rel.ro.

Read-only variables defined in shared libraries should be copied directly
into the space allocated for them in .data.rel.ro by the linker.

To achieve this, we determine whether either of the two sections
containing copy relocations is .data.rel.ro.  If so, we relocate the
symbol memory directly into the existing section instead of constructing
a new .(s)dynbss section once prelink_build_conflicts() returns.

Fixes cxx1.sh, cxx2.sh, and cxx3.sh on Fedora 28 (which uses
binutils-2.29).
---
 src/conflict.c | 51 +-
 src/undo.c |  9 +
 2 files changed, 47 insertions(+), 13 deletions(-)

diff --git a/src/conflict.c b/src/conflict.c
index 9ae2ddb..5613ace 100644
--- a/src/conflict.c
+++ b/src/conflict.c
@@ -450,7 +450,7 @@ get_relocated_mem (struct prelink_info *info, DSO *dso, 
GElf_Addr addr,
 int
 prelink_build_conflicts (struct prelink_info *info)
 {
-  int i, ndeps = info->ent->ndepends + 1;
+  int i, reset_dynbss = 0, reset_sdynbss = 0, ndeps = info->ent->ndepends + 1;
   struct prelink_entry *ent;
   int ret = 0;
   DSO *dso;
@@ -675,6 +675,11 @@ prelink_build_conflicts (struct prelink_info *info)
 dso->filename);
  goto error_out;
}
+
+ name = strptr (dso, dso->ehdr.e_shstrndx, dso->shdr[bss1].sh_name);
+ if (strcmp(name, ".data.rel.ro") == 0)
+   reset_sdynbss = 1;
+
  firstbss2 = i;
  info->sdynbss_size = cr.rela[i - 1].r_offset - cr.rela[0].r_offset;
  info->sdynbss_size += cr.rela[i - 1].r_addend;
@@ -702,6 +707,10 @@ prelink_build_conflicts (struct prelink_info *info)
}
}
 
+  name = strptr (dso, dso->ehdr.e_shstrndx, dso->shdr[bss2].sh_name);
+  if (strcmp(name, ".data.rel.ro") == 0)
+reset_dynbss = 1;
+
   info->dynbss_size = cr.rela[cr.count - 1].r_offset
  - cr.rela[firstbss2].r_offset;
   info->dynbss_size += cr.rela[cr.count - 1].r_addend;
@@ -719,9 +728,9 @@ prelink_build_conflicts (struct prelink_info *info)
  && strcmp (name = strptr (dso, dso->ehdr.e_shstrndx,
dso->shdr[bss1].sh_name),
 ".dynbss") != 0
- && strcmp (name, ".sdynbss") != 0)
+ && strcmp (name, ".sdynbss") != 0 && strcmp (name, ".data.rel.ro") != 
0)
{
- error (0, 0, "%s: COPY relocations don't point into .bss or .sbss 
section",
+ error (0, 0, "%s: COPY relocations don't point into .bss, .sbss, or 
.data.rel.ro sections",
 dso->filename);
  goto error_out;
}
@@ -730,9 +739,9 @@ prelink_build_conflicts (struct prelink_info *info)
  && strcmp (name = strptr (dso, dso->ehdr.e_shstrndx,
dso->shdr[bss2].sh_name),
 ".dynbss") != 0
- && strcmp (name, ".sdynbss") != 0)
+ && strcmp (name, ".sdynbss") != 0 && strcmp (name, ".data.rel.ro") != 
0)
{
- error (0, 0, "%s: COPY relocations don't point into .bss or .sbss 
section",
+ error (0, 0, "%s: COPY relocations don't point into .bss, .sbss, or 
.data.rel.ro section",
 dso->filename);
  goto error_out;
}
@@ -768,16 +777,21 @@ prelink_build_conflicts (struct prelink_info *info)
  }
 
  assert (j < ndeps);
+ GElf_Addr symaddr = s->u.ent->base + s->value;
+ char *buf;
+
  if (i < firstbss2)
-   j = get_relocated_mem (info, ndso, s->u.ent->base + s->value,
-  info->sdynbss + cr.rela[i].r_offset
-  - info->sdynbss_base, cr.rela[i].r_addend,
-  cr.rela[i].r_offset);
+   if (reset_sdynbss)
+ buf = get_data(dso, cr.rela[i].r_offset, NULL, NULL);
+   else
+ buf = info->sdynbss + cr.rela[i].r_offset - info->sdynbss_base;
  else
-   j = get_relocated_mem (info, ndso, s->u.ent->base + s->value,
-  info->dynbss + cr.rela[i].r_offset
-  - info->dynbss_base, cr.rela[i].r_addend,
-  cr.rela[i].r_offset);
+   if (reset_dynbss)
+ buf = get_data(dso, cr.rela[i].r_offset, NULL, NULL);
+   else
+ buf = info->dynbss + cr.rela[i].r_offset - info->dynbss_base;
+
+ j = get_relocated_mem (info, ndso, symaddr, buf, cr.rela[i].r_addend, 
cr.rela[i].r_offset);
 
  switch (j)
{
@@ -815,6 +829,17 @@ prelink_build_conflicts (struct prelink_info *info)
 if (info->dsos[i])
   close_dso 

[yocto] [prelink-cross][PATCH] rtld: get machine from undef_map for protected symbols

2018-09-28 Thread Kyle Russell
Avoids rtld segfault when _dl_lookup_symbol_x is called with NULL
for skip_map on a protected symbol relocation.

Global protected symbols may not actually require a copy relocaton,
in which case skip_map is undefined, so use the undef_map to determine
the symbol arch.
---
 src/rtld/dl-lookupX.h   |  6 +++---
 testsuite/Makefile.am   |  2 +-
 testsuite/reloc12.c | 19 +++
 testsuite/reloc12.h | 11 +++
 testsuite/reloc12.sh| 20 
 testsuite/reloc12lib1.c | 11 +++
 testsuite/reloc12lib2.c | 16 
 7 files changed, 81 insertions(+), 4 deletions(-)
 create mode 100644 testsuite/reloc12.c
 create mode 100644 testsuite/reloc12.h
 create mode 100755 testsuite/reloc12.sh
 create mode 100644 testsuite/reloc12lib1.c
 create mode 100644 testsuite/reloc12lib2.c

diff --git a/src/rtld/dl-lookupX.h b/src/rtld/dl-lookupX.h
index 425bb4b..250c509 100644
--- a/src/rtld/dl-lookupX.h
+++ b/src/rtld/dl-lookupX.h
@@ -679,10 +679,10 @@ _dl_lookup_symbol_x (const char *undef_name, struct 
link_map *undef_map,
if (do_lookup_x (undef_name, new_hash, _hash, *ref,
 _value, *scope, i, version, flags,
 skip_map,
-
(ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(skip_map->machine)
+
(ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(undef_map->machine)
  && ELFW(ST_TYPE) ((*ref)->st_info) == STT_OBJECT
- && type_class == 
ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(skip_map->machine))
-? 
ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(skip_map->machine)
+ && type_class == 
ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(undef_map->machine))
+? 
ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA(undef_map->machine)
 : ELF_RTYPE_CLASS_PLT, NULL) != 0)
  break;
 
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 030f65b..21de6a9 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -5,7 +5,7 @@ AM_CFLAGS = -Wall
 
 TESTS = movelibs.sh \
reloc1.sh reloc2.sh reloc3.sh reloc4.sh reloc5.sh reloc6.sh \
-   reloc7.sh reloc8.sh reloc9.sh reloc10.sh reloc11.sh \
+   reloc7.sh reloc8.sh reloc9.sh reloc10.sh reloc11.sh reloc12.sh \
shuffle1.sh shuffle2.sh shuffle3.sh shuffle4.sh shuffle5.sh \
shuffle6.sh shuffle7.sh shuffle8.sh shuffle9.sh undo1.sh \
layout1.sh layout2.sh unprel1.sh \
diff --git a/testsuite/reloc12.c b/testsuite/reloc12.c
new file mode 100644
index 000..cfa
--- /dev/null
+++ b/testsuite/reloc12.c
@@ -0,0 +1,19 @@
+#include "reloc12.h"
+#include 
+
+int main()
+{
+  A* ptr = find('b');
+  if(b(ptr) != 0)
+abort();
+
+  ptr = find('a');
+  if(b(ptr) != 1)
+abort();
+
+  ptr = find('r');
+  if(b(ptr) != 2)
+abort();
+
+  exit(0);
+}
diff --git a/testsuite/reloc12.h b/testsuite/reloc12.h
new file mode 100644
index 000..8e09405
--- /dev/null
+++ b/testsuite/reloc12.h
@@ -0,0 +1,11 @@
+typedef struct
+  {
+char a;
+int b;
+  } A;
+
+extern A foo[] __attribute ((visibility ("protected")));
+
+A* find(char a);
+char a(const A*);
+int b(const A*);
diff --git a/testsuite/reloc12.sh b/testsuite/reloc12.sh
new file mode 100755
index 000..a8a43c7
--- /dev/null
+++ b/testsuite/reloc12.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+. `dirname $0`/functions.sh
+rm -f reloc12 reloc12lib*.so reloc12.log
+rm -f prelink.cache
+$RUN_HOST $CC -shared -O2 -fpic -o reloc12lib1.so $srcdir/reloc12lib1.c
+$RUN_HOST $CC -shared -O2 -fpic -o reloc12lib2.so $srcdir/reloc12lib2.c
+BINS="reloc12"
+LIBS="reloc12lib1.so reloc12lib2.so"
+$RUN_HOST $CCLINK -o reloc12 $srcdir/reloc12.c -Wl,--rpath-link,. ${LIBS}
+savelibs
+echo $PRELINK ${PRELINK_OPTS--vm} ./reloc12 > reloc12.log
+$RUN_HOST $PRELINK ${PRELINK_OPTS--vm} ./reloc12 >> reloc12.log 2>&1 || exit 1
+grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` reloc12.log && exit 2
+if [ "x$CROSS" = "x" ]; then
+ $RUN LD_LIBRARY_PATH=. ./reloc12 || exit 3
+fi
+$RUN_HOST $READELF -a ./reloc12 >> reloc12.log 2>&1 || exit 4
+# So that it is not prelinked again
+chmod -x ./reloc12
+comparelibs >> reloc12.log 2>&1 || exit 5
diff --git a/testsuite/reloc12lib1.c b/testsuite/reloc12lib1.c
new file mode 100644
index 000..db7e64f
--- /dev/null
+++ b/testsuite/reloc12lib1.c
@@ -0,0 +1,11 @@
+#include "reloc12.h"
+
+char a(const A *d)
+{
+  return d ? d->a : 0;
+}
+
+int b(const A *d)
+{
+  return d ? d->b : -1;
+}
diff --git a/testsuite/reloc12lib2.c b/testsuite/reloc12lib2.c
new file mode 100644
index 000..ffa60a0
--- /dev/null
+++ b/testsuite/reloc12lib2.c
@@ -0,0 +1,16 @@
+#include "reloc12.h"
+
+A foo[] = {
+  { 'b', 0 },
+  { 'a', 1 },
+  { 'r', 2 }
+};
+
+A* find(char a)
+{
+  for(A* ptr = foo; ptr < foo + sizeof(foo)/sizeof(foo[0]); ptr++)
+if(ptr->a == a)
+  return ptr;
+
+  return 0;
+}
-- 
2.17.1

-- 

[yocto] [error-report-web][PATCH] error-details: pull Bugzilla URL from project settings

2018-03-29 Thread Kyle Russell
Signed-off-by: Kyle Russell <bkyleruss...@gmail.com>
---
 Post/views.py| 2 +-
 project/settings.py  | 2 ++
 templates/error-details.html | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Post/views.py b/Post/views.py
index 7f2cffb..c093e7b 100644
--- a/Post/views.py
+++ b/Post/views.py
@@ -260,7 +260,7 @@ def details(request, fail_id):
 except ObjectDoesNotExist:
   build_failure = None
 
-context = {'detail' : build_failure, 'error_types' : ErrorType }
+context = {'detail' : build_failure, 'error_types' : ErrorType, 
'bugzilla_url' : settings.BUGZILLA_URL }
 
 return render(request, "error-details.html", context)
 
diff --git a/project/settings.py b/project/settings.py
index 3c6c87e..ca6f7fb 100644
--- a/project/settings.py
+++ b/project/settings.py
@@ -195,6 +195,8 @@ TEMPLATE_CONTEXT_PROCESSORS = (
 
 AUTH_PROFILE_MODULE = 'registration.RegistrationProfile'
 
+BUGZILLA_URL = 'https://bugzilla.yoctoproject.org'
+
 ACCOUNT_ACTIVATION_DAYS = 2
 EMAIL_HOST = 'localhost'
 DEFAULT_FROM_EMAIL = 'nore...@example.com'
diff --git a/templates/error-details.html b/templates/error-details.html
index c30160d..35bf0aa 100644
--- a/templates/error-details.html
+++ b/templates/error-details.html
@@ -83,7 +83,7 @@
 
   
   
-https://bugzilla.yoctoproject.org/enter_bug.cgi?classification=__all; 
>Open a bug
+Open a bug
   
 
   
-- 
2.7.4

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [meta][PATCH] ptest.bbclass: fix path for multilib

2018-03-14 Thread Kyle Russell
I logged a bug for this so not to lose track of it. I'll be glad to do the
work, but I want to make sure it's valuable if something more than a
trivial fix is desired.

https://bugzilla.yoctoproject.org/show_bug.cgi?id=12604

On Mon, Feb 19, 2018, 12:46 PM Kyle Russell <bkyleruss...@gmail.com> wrote:

> That's reasonable, but how would you propose that work?  An analogous fix
> for ptest-runner is to use ${libdir} instead of /usr/lib (leaving the
> bbclass intact), but that just flips the problem if you try to run
> lib32-libfoo-ptest using a 64-bit ptest-runner with default arguments (not
> specifying -d /usr/lib).  Alternatively, I suppose ptest-runner could look
> in multiple directories by default (for example, ${libdir} and
> ${nonarch_libdir}, assuming they're different).  Although, it almost feels
> like the run-ptest scripts should really be installed to ${libexecdir}.
>
> I'll be glad to workup a different patch, but I want to make sure I
> understand the desired design.
>
> On Fri, Feb 16, 2018 at 6:12 PM, Burton, Ross <ross.bur...@intel.com>
> wrote:
>
>> On 16 February 2018 at 21:41, Kyle Russell <bkyleruss...@gmail.com>
>> wrote:
>>
>>> ptest-runner always looks at /usr/lib, so make this arch independent.
>>>
>>
>> I'd say the bug here is in ptest-runner.  I'd expect to be able to
>> install libfoo-ptest and lib32-libfoo-ptest in parallel.
>>
>> Ross
>>
>
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [meta][PATCH] ptest.bbclass: fix path for multilib

2018-02-19 Thread Kyle Russell
That's reasonable, but how would you propose that work?  An analogous fix
for ptest-runner is to use ${libdir} instead of /usr/lib (leaving the
bbclass intact), but that just flips the problem if you try to run
lib32-libfoo-ptest using a 64-bit ptest-runner with default arguments (not
specifying -d /usr/lib).  Alternatively, I suppose ptest-runner could look
in multiple directories by default (for example, ${libdir} and
${nonarch_libdir}, assuming they're different).  Although, it almost feels
like the run-ptest scripts should really be installed to ${libexecdir}.

I'll be glad to workup a different patch, but I want to make sure I
understand the desired design.

On Fri, Feb 16, 2018 at 6:12 PM, Burton, Ross <ross.bur...@intel.com> wrote:

> On 16 February 2018 at 21:41, Kyle Russell <bkyleruss...@gmail.com> wrote:
>
>> ptest-runner always looks at /usr/lib, so make this arch independent.
>>
>
> I'd say the bug here is in ptest-runner.  I'd expect to be able to install
> libfoo-ptest and lib32-libfoo-ptest in parallel.
>
> Ross
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta][PATCH] ptest.bbclass: fix path for multilib

2018-02-16 Thread Kyle Russell
ptest-runner always looks at /usr/lib, so make this arch independent.

Signed-off-by: Kyle Russell <bkyleruss...@gmail.com>
---
 meta/classes/ptest.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
index c19f65b..62b3621 100644
--- a/meta/classes/ptest.bbclass
+++ b/meta/classes/ptest.bbclass
@@ -2,7 +2,7 @@ SUMMARY_${PN}-ptest ?= "${SUMMARY} - Package test files"
 DESCRIPTION_${PN}-ptest ?= "${DESCRIPTION}  \
 This package contains a test directory ${PTEST_PATH} for package test 
purposes."
 
-PTEST_PATH ?= "${libdir}/${BPN}/ptest"
+PTEST_PATH ?= "${nonarch_libdir}/${BPN}/ptest"
 FILES_${PN}-ptest = "${PTEST_PATH}"
 SECTION_${PN}-ptest = "devel"
 ALLOW_EMPTY_${PN}-ptest = "1"
-- 
2.7.4

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [prelink-cross][PATCH] rtld: Add missing DT_NEEDED DSOs to needed_list

2017-06-21 Thread Kyle Russell
Just wanted to follow-up on this so it doesn't get lost.  Any chance this
could be included in cross_prelink_staging?

On Thu, Aug 25, 2016 at 1:03 PM, Mark Hatle <mark.ha...@windriver.com>
wrote:

> Thanks!  I'll try to get this included soon.
>
> --Mark
>
> On 8/25/16 10:39 AM, Kyle Russell wrote:
> > prelink-rtld may report an "error while loading shared libraries" for
> > the wrong library.
> >
> > If some set of DT_NEEDED DSOs are not in the default search path, they
> > may have a dso_list entry added, but no matching entry is added to the
> > needed_list.  This causes the linker to miscalculate the max number of
> > dsos during build_local_scope(), which later causes find_needed() to not
> > search the entire l_local_scope[0]->r_list during
> > _dl_check_map_versions() (since the max from build_local_scope() becomes
> > l_local_scope[0]->r_nlist).
> >
> > Since find_needed() searches through the r_list, which would have the
> > dso_list entries for the libraries that weren't found earlier, this cuts
> > the search short, meaning libraries near the end of the local scope don't
> > get included in the map version search.
> >
> > As the comment in _dl_check_map_versions() suggests, if needed is NULL,
> > that means a dependency was not found and no stub entry created, which
> > should never happen.
> >
> > Signed-off-by: Kyle Russell <bkyleruss...@gmail.com>
> > ---
> >  src/rtld/rtld.c | 36 ++--
> >  1 file changed, 22 insertions(+), 14 deletions(-)
> >
> > diff --git a/src/rtld/rtld.c b/src/rtld/rtld.c
> > index 8d7d760..d9a0862 100644
> > --- a/src/rtld/rtld.c
> > +++ b/src/rtld/rtld.c
> > @@ -686,6 +686,25 @@ find_lib_by_soname (const char *soname, struct
> dso_list *loader,
> >return NULL;
> >  }
> >
> > +static void
> > +add_dso_to_needed (struct dso_list *cur_dso_ent, struct dso_list
> *new_dso_ent)
> > +{
> > +  if (!cur_dso_ent->needed)
> > +{
> > +  cur_dso_ent->needed = malloc (sizeof (struct needed_list));
> > +  cur_dso_ent->needed_tail = cur_dso_ent->needed;
> > +  cur_dso_ent->needed_tail->ent = new_dso_ent;
> > +  cur_dso_ent->needed_tail->next = NULL;
> > +}
> > +  else if (!in_needed_list (cur_dso_ent->needed, new_dso_ent->name))
> > +{
> > +  cur_dso_ent->needed_tail->next = malloc (sizeof (struct
> needed_list));
> > +  cur_dso_ent->needed_tail = cur_dso_ent->needed_tail->next;
> > +  cur_dso_ent->needed_tail->ent = new_dso_ent;
> > +  cur_dso_ent->needed_tail->next = NULL;
> > +}
> > +}
> > +
> >  static struct dso_list *
> >  load_dsos (DSO *dso, int host_paths)
> >  {
> > @@ -812,6 +831,8 @@ load_dsos (DSO *dso, int host_paths)
> > dso_list_tail->canon_filename = strdup(soname);
> > dso_list_tail->err_no = errno;
> >
> > +  add_dso_to_needed(cur_dso_ent, new_dso_ent);
> > +
> > continue;
> >   }
> >
> > @@ -854,20 +875,7 @@ load_dsos (DSO *dso, int host_paths)
> >   dso_list_tail->name = new_dso->soname;
> >   }
> >
> > -   if (!cur_dso_ent->needed)
> > - {
> > -   cur_dso_ent->needed = malloc (sizeof (struct
> needed_list));
> > -   cur_dso_ent->needed_tail = cur_dso_ent->needed;
> > -   cur_dso_ent->needed_tail->ent = new_dso_ent;
> > -   cur_dso_ent->needed_tail->next = NULL;
> > - }
> > -   else if (!in_needed_list (cur_dso_ent->needed, soname))
> > - {
> > -   cur_dso_ent->needed_tail->next = malloc (sizeof
> (struct needed_list));
> > -   cur_dso_ent->needed_tail = cur_dso_ent->needed_tail->
> next;
> > -   cur_dso_ent->needed_tail->ent = new_dso_ent;
> > -   cur_dso_ent->needed_tail->next = NULL;
> > - }
> > +  add_dso_to_needed(cur_dso_ent, new_dso_ent);
> >
> > continue;
> >   }
> >
>
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [prelink-cross][PATCH] rtld: Add missing DT_NEEDED DSOs to needed_list

2016-08-25 Thread Kyle Russell
prelink-rtld may report an "error while loading shared libraries" for
the wrong library.

If some set of DT_NEEDED DSOs are not in the default search path, they
may have a dso_list entry added, but no matching entry is added to the
needed_list.  This causes the linker to miscalculate the max number of
dsos during build_local_scope(), which later causes find_needed() to not
search the entire l_local_scope[0]->r_list during
_dl_check_map_versions() (since the max from build_local_scope() becomes
l_local_scope[0]->r_nlist).

Since find_needed() searches through the r_list, which would have the
dso_list entries for the libraries that weren't found earlier, this cuts
the search short, meaning libraries near the end of the local scope don't
get included in the map version search.

As the comment in _dl_check_map_versions() suggests, if needed is NULL,
that means a dependency was not found and no stub entry created, which
should never happen.

Signed-off-by: Kyle Russell <bkyleruss...@gmail.com>
---
 src/rtld/rtld.c | 36 ++--
 1 file changed, 22 insertions(+), 14 deletions(-)

diff --git a/src/rtld/rtld.c b/src/rtld/rtld.c
index 8d7d760..d9a0862 100644
--- a/src/rtld/rtld.c
+++ b/src/rtld/rtld.c
@@ -686,6 +686,25 @@ find_lib_by_soname (const char *soname, struct dso_list 
*loader,
   return NULL;
 }
 
+static void
+add_dso_to_needed (struct dso_list *cur_dso_ent, struct dso_list *new_dso_ent)
+{
+  if (!cur_dso_ent->needed)
+{
+  cur_dso_ent->needed = malloc (sizeof (struct needed_list));
+  cur_dso_ent->needed_tail = cur_dso_ent->needed;
+  cur_dso_ent->needed_tail->ent = new_dso_ent;
+  cur_dso_ent->needed_tail->next = NULL;
+}
+  else if (!in_needed_list (cur_dso_ent->needed, new_dso_ent->name))
+{
+  cur_dso_ent->needed_tail->next = malloc (sizeof (struct needed_list));
+  cur_dso_ent->needed_tail = cur_dso_ent->needed_tail->next;
+  cur_dso_ent->needed_tail->ent = new_dso_ent;
+  cur_dso_ent->needed_tail->next = NULL;
+}
+}
+
 static struct dso_list *
 load_dsos (DSO *dso, int host_paths)
 {
@@ -812,6 +831,8 @@ load_dsos (DSO *dso, int host_paths)
  dso_list_tail->canon_filename = strdup(soname);
  dso_list_tail->err_no = errno;
 
+  add_dso_to_needed(cur_dso_ent, new_dso_ent);
+
  continue;
}
 
@@ -854,20 +875,7 @@ load_dsos (DSO *dso, int host_paths)
dso_list_tail->name = new_dso->soname;
}
 
- if (!cur_dso_ent->needed)
-   {
- cur_dso_ent->needed = malloc (sizeof (struct 
needed_list));
- cur_dso_ent->needed_tail = cur_dso_ent->needed;
- cur_dso_ent->needed_tail->ent = new_dso_ent;
- cur_dso_ent->needed_tail->next = NULL;
-   }
- else if (!in_needed_list (cur_dso_ent->needed, soname))
-   {
- cur_dso_ent->needed_tail->next = malloc (sizeof (struct 
needed_list));
- cur_dso_ent->needed_tail = cur_dso_ent->needed_tail->next;
- cur_dso_ent->needed_tail->ent = new_dso_ent;
- cur_dso_ent->needed_tail->next = NULL;
-   }
+  add_dso_to_needed(cur_dso_ent, new_dso_ent);
 
  continue;
}
-- 
2.7.4

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [meta][PATCH v2] python-3.4-manifest: Add some missing RDEPENDS

2016-08-12 Thread Kyle Russell
Ok, thanks!  Sorry about that, not sure what happened.

On Fri, Aug 12, 2016 at 10:00 AM, Burton, Ross <ross.bur...@intel.com>
wrote:

>
> On 11 August 2016 at 22:14, Kyle Russell <bkyleruss...@gmail.com> wrote:
>
>> In case anyone is interested, I posted an update for both the script and
>> .inc to openembedded-core (which now has master at python 3.5), but it
>> doesn't seem to have gone anywhere yet.
>>
>
> Sorry that got stalled because the patch was mangled by your mailer so I
> had to fix the patch by hand.  I've applied it to my staging branch, thanks.
>
> Ross
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [meta][PATCH v2] python-3.4-manifest: Add some missing RDEPENDS

2016-08-11 Thread Kyle Russell
In case anyone is interested, I posted an update for both the script and
.inc to openembedded-core (which now has master at python 3.5), but it
doesn't seem to have gone anywhere yet.

http://lists.openembedded.org/pipermail/openembedded-core/2016-August/124672.html

On Mon, Aug 1, 2016 at 9:56 AM, Khem Raj <raj.k...@gmail.com> wrote:

> and when patch is ready send it to openembedded-core ml
>
> On Mon, Aug 1, 2016 at 6:49 AM, Kyle Russell <bkyleruss...@gmail.com>
> wrote:
> > Well, that makes sense.  I'm just tripping all over this one.
> >
> > On Mon, Aug 1, 2016 at 8:29 AM, Burton, Ross <ross.bur...@intel.com>
> wrote:
> >>
> >>
> >> On 1 August 2016 at 13:01, Kyle Russell <bkyleruss...@gmail.com> wrote:
> >>>
> >>>  scripts/contrib/python/generate-manifest-3.4.py | 10 +-
> >>
> >>
> >> Sorry, but you need to edit the script and then run the script, so the
> >> patch contains both the script and inc file changes.
> >>
> >> Ross
> >
> >
> >
> > --
> > ___
> > yocto mailing list
> > yocto@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/yocto
> >
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [meta][PATCH v2] python-3.4-manifest: Add some missing RDEPENDS

2016-08-01 Thread Kyle Russell
Well, that makes sense.  I'm just tripping all over this one.

On Mon, Aug 1, 2016 at 8:29 AM, Burton, Ross <ross.bur...@intel.com> wrote:

>
> On 1 August 2016 at 13:01, Kyle Russell <bkyleruss...@gmail.com> wrote:
>
>>  scripts/contrib/python/generate-manifest-3.4.py | 10 +-
>>
>
> Sorry, but you need to edit the script and then run the script, so the
> patch contains both the script and inc file changes.
>
> Ross
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta][PATCH v2] python-3.4-manifest: Add some missing RDEPENDS

2016-08-01 Thread Kyle Russell
Several packages were missing RDEPENDS on other modules they import.

Signed-off-by: Kyle Russell <bkyleruss...@gmail.com>
---
 scripts/contrib/python/generate-manifest-3.4.py | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/contrib/python/generate-manifest-3.4.py 
b/scripts/contrib/python/generate-manifest-3.4.py
index ca2fa61..ba4ab72 100755
--- a/scripts/contrib/python/generate-manifest-3.4.py
+++ b/scripts/contrib/python/generate-manifest-3.4.py
@@ -229,7 +229,7 @@ if __name__ == "__main__":
 m.addPackage( "${PN}-curses", "Python curses support", "${PN}-core",
 "curses lib-dynload/_curses.*.so lib-dynload/_curses_panel.*.so" ) # 
directory + low level module
 
-m.addPackage( "${PN}-ctypes", "Python C types support", "${PN}-core",
+m.addPackage( "${PN}-ctypes", "Python C types support", "${PN}-core 
${PN}-subprocess",
 "ctypes lib-dynload/_ctypes.*.so lib-dynload/_ctypes_test.*.so" ) # 
directory + low level module
 
 m.addPackage( "${PN}-datetime", "Python calendar and time support", 
"${PN}-core ${PN}-codecs",
@@ -282,7 +282,7 @@ if __name__ == "__main__":
 m.addPackage( "${PN}-json", "Python JSON support", "${PN}-core ${PN}-math 
${PN}-re",
 "json lib-dynload/_json.*.so" ) # package
 
-m.addPackage( "${PN}-lang", "Python low-level language support", 
"${PN}-core",
+m.addPackage( "${PN}-lang", "Python low-level language support", 
"${PN}-core ${PN}-importlib",
 "lib-dynload/_bisect.*.so lib-dynload/_collections.*.so 
lib-dynload/_heapq.*.so lib-dynload/_weakref.*.so lib-dynload/_functools.*.so " 
+
 "lib-dynload/array.*.so lib-dynload/itertools.*.so 
lib-dynload/operator.*.so lib-dynload/parser.*.so " +
 "atexit.* bisect.* code.* codeop.* collections.* _collections_abc.* dis.* 
functools.* heapq.* inspect.* keyword.* opcode.* symbol.* repr.* token.* " +
@@ -294,7 +294,7 @@ if __name__ == "__main__":
 m.addPackage( "${PN}-mailbox", "Python mailbox format support", 
"${PN}-core ${PN}-mime",
 "mailbox.*" )
 
-m.addPackage( "${PN}-math", "Python math support", "${PN}-core",
+m.addPackage( "${PN}-math", "Python math support", "${PN}-core 
${PN}-crypt",
 "lib-dynload/cmath.*.so lib-dynload/math.*.so lib-dynload/_random.*.so 
random.* sets.*" )
 
 m.addPackage( "${PN}-mime", "Python MIME handling APIs", "${PN}-core 
${PN}-io",
@@ -340,10 +340,10 @@ if __name__ == "__main__":
 m.addPackage( "${PN}-resource", "Python resource control interface", 
"${PN}-core",
 "lib-dynload/resource.*.so" )
 
-m.addPackage( "${PN}-shell", "Python shell-like functionality", 
"${PN}-core ${PN}-re",
+m.addPackage( "${PN}-shell", "Python shell-like functionality", 
"${PN}-core ${PN}-re ${PN}-compression",
 "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" )
 
-m.addPackage( "${PN}-subprocess", "Python subprocess support", "${PN}-core 
${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle",
+m.addPackage( "${PN}-subprocess", "Python subprocess support", "${PN}-core 
${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle ${PN}-threading",
 "subprocess.*" )
 
 m.addPackage( "${PN}-sqlite3", "Python Sqlite3 database support", 
"${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading",
-- 
1.9.1

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [meta][PATCH] python-3.4-manifest: Add some missing RDEPENDS

2016-08-01 Thread Kyle Russell
Thanks, sorry I missed that.  I'll post an updated patch.

On Sun, Jul 31, 2016 at 9:12 PM, Martin Jansa <martin.ja...@gmail.com>
wrote:

> On Fri, Jul 29, 2016 at 04:20:37PM -0400, Kyle Russell wrote:
> > Signed-off-by: Kyle Russell <bkyleruss...@gmail.com>
>
> manifest is generated, you need to update the script which generates
> that (read file header).
>
> > ---
> >  meta/recipes-devtools/python/python-3.4-manifest.inc | 10 +-
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/meta/recipes-devtools/python/python-3.4-manifest.inc
> b/meta/recipes-devtools/python/python-3.4-manifest.inc
> > index 97070b6..f71 100644
> > --- a/meta/recipes-devtools/python/python-3.4-manifest.inc
> > +++ b/meta/recipes-devtools/python/python-3.4-manifest.inc
> > @@ -42,7 +42,7 @@ RDEPENDS_${PN}-crypt="${PN}-core"
> >  FILES_${PN}-crypt="${libdir}/python3.4/hashlib.*
> ${libdir}/python3.4/md5.* ${libdir}/python3.4/sha.*
> ${libdir}/python3.4/lib-dynload/crypt.*.so
> ${libdir}/python3.4/lib-dynload/_hashlib.*.so
> ${libdir}/python3.4/lib-dynload/_sha256.*.so
> ${libdir}/python3.4/lib-dynload/_sha512.*.so "
> >
> >  SUMMARY_${PN}-ctypes="Python C types support"
> > -RDEPENDS_${PN}-ctypes="${PN}-core"
> > +RDEPENDS_${PN}-ctypes="${PN}-core ${PN}-subprocess"
> >  FILES_${PN}-ctypes="${libdir}/python3.4/ctypes
> ${libdir}/python3.4/lib-dynload/_ctypes.*.so
> ${libdir}/python3.4/lib-dynload/_ctypes_test.*.so "
> >
> >  SUMMARY_${PN}-curses="Python curses support"
> > @@ -122,7 +122,7 @@ RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re"
> >  FILES_${PN}-json="${libdir}/python3.4/json
> ${libdir}/python3.4/lib-dynload/_json.*.so "
> >
> >  SUMMARY_${PN}-lang="Python low-level language support"
> > -RDEPENDS_${PN}-lang="${PN}-core"
> > +RDEPENDS_${PN}-lang="${PN}-core ${PN}-importlib"
> >  FILES_${PN}-lang="${libdir}/python3.4/lib-dynload/_bisect.*.so
> ${libdir}/python3.4/lib-dynload/_collections.*.so
> ${libdir}/python3.4/lib-dynload/_heapq.*.so
> ${libdir}/python3.4/lib-dynload/_weakref.*.so
> ${libdir}/python3.4/lib-dynload/_functools.*.so
> ${libdir}/python3.4/lib-dynload/array.*.so
> ${libdir}/python3.4/lib-dynload/itertools.*.so
> ${libdir}/python3.4/lib-dynload/operator.*.so
> ${libdir}/python3.4/lib-dynload/parser.*.so ${libdir}/python3.4/atexit.*
> ${libdir}/python3.4/bisect.* ${libdir}/python3.4/code.*
> ${libdir}/python3.4/codeop.* ${libdir}/python3.4/collections.*
> ${libdir}/python3.4/_collections_abc.* ${libdir}/python3.4/dis.*
> ${libdir}/python3.4/functools.* ${libdir}/python3.4/heapq.*
> ${libdir}/python3.4/inspect.* ${libdir}/python3.4/keyword.*
> ${libdir}/python3.4/opcode.* ${libdir}/python3.4/symbol.*
> ${libdir}/python3.4/repr.* ${libdir}/python3.4/token.*
> ${libdir}/python3.4/tokenize.* ${libdir}/python3.4/traceback.*
> ${libdir}/python3.4/weakref.* "
> >
> >  SUMMARY_${PN}-logging="Python logging support"
> > @@ -134,7 +134,7 @@ RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
> >  FILES_${PN}-mailbox="${libdir}/python3.4/mailbox.* "
> >
> >  SUMMARY_${PN}-math="Python math support"
> > -RDEPENDS_${PN}-math="${PN}-core"
> > +RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt"
> >  FILES_${PN}-math="${libdir}/python3.4/lib-dynload/cmath.*.so
> ${libdir}/python3.4/lib-dynload/math.*.so
> ${libdir}/python3.4/lib-dynload/_random.*.so ${libdir}/python3.4/random.*
> ${libdir}/python3.4/sets.* "
> >
> >  SUMMARY_${PN}-mime="Python MIME handling APIs"
> > @@ -198,7 +198,7 @@ RDEPENDS_${PN}-resource="${PN}-core"
> >  FILES_${PN}-resource="${libdir}/python3.4/lib-dynload/resource.*.so "
> >
> >  SUMMARY_${PN}-shell="Python shell-like functionality"
> > -RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
> > +RDEPENDS_${PN}-shell="${PN}-core ${PN}-re ${PN}-compression"
> >  FILES_${PN}-shell="${libdir}/python3.4/cmd.*
> ${libdir}/python3.4/commands.* ${libdir}/python3.4/dircache.*
> ${libdir}/python3.4/fnmatch.* ${libdir}/python3.4/glob.*
> ${libdir}/python3.4/popen2.* ${libdir}/python3.4/shlex.*
> ${libdir}/python3.4/shutil.* "
> >
> >  SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
> > @@ -218,7 +218,7 @@ RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
> >  FILES_${PN}-stringold="${libdir}/python3.4/lib-dynload/strop.*.so
> ${libdir}/python3.4/string.* ${libdir}/python3.4/string

[yocto] [meta][PATCH] python-3.4-manifest: Add some missing RDEPENDS

2016-07-29 Thread Kyle Russell
Signed-off-by: Kyle Russell <bkyleruss...@gmail.com>
---
 meta/recipes-devtools/python/python-3.4-manifest.inc | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-devtools/python/python-3.4-manifest.inc 
b/meta/recipes-devtools/python/python-3.4-manifest.inc
index 97070b6..f71 100644
--- a/meta/recipes-devtools/python/python-3.4-manifest.inc
+++ b/meta/recipes-devtools/python/python-3.4-manifest.inc
@@ -42,7 +42,7 @@ RDEPENDS_${PN}-crypt="${PN}-core"
 FILES_${PN}-crypt="${libdir}/python3.4/hashlib.* ${libdir}/python3.4/md5.* 
${libdir}/python3.4/sha.* ${libdir}/python3.4/lib-dynload/crypt.*.so 
${libdir}/python3.4/lib-dynload/_hashlib.*.so 
${libdir}/python3.4/lib-dynload/_sha256.*.so 
${libdir}/python3.4/lib-dynload/_sha512.*.so "
 
 SUMMARY_${PN}-ctypes="Python C types support"
-RDEPENDS_${PN}-ctypes="${PN}-core"
+RDEPENDS_${PN}-ctypes="${PN}-core ${PN}-subprocess"
 FILES_${PN}-ctypes="${libdir}/python3.4/ctypes 
${libdir}/python3.4/lib-dynload/_ctypes.*.so 
${libdir}/python3.4/lib-dynload/_ctypes_test.*.so "
 
 SUMMARY_${PN}-curses="Python curses support"
@@ -122,7 +122,7 @@ RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re"
 FILES_${PN}-json="${libdir}/python3.4/json 
${libdir}/python3.4/lib-dynload/_json.*.so "
 
 SUMMARY_${PN}-lang="Python low-level language support"
-RDEPENDS_${PN}-lang="${PN}-core"
+RDEPENDS_${PN}-lang="${PN}-core ${PN}-importlib"
 FILES_${PN}-lang="${libdir}/python3.4/lib-dynload/_bisect.*.so 
${libdir}/python3.4/lib-dynload/_collections.*.so 
${libdir}/python3.4/lib-dynload/_heapq.*.so 
${libdir}/python3.4/lib-dynload/_weakref.*.so 
${libdir}/python3.4/lib-dynload/_functools.*.so 
${libdir}/python3.4/lib-dynload/array.*.so 
${libdir}/python3.4/lib-dynload/itertools.*.so 
${libdir}/python3.4/lib-dynload/operator.*.so 
${libdir}/python3.4/lib-dynload/parser.*.so ${libdir}/python3.4/atexit.* 
${libdir}/python3.4/bisect.* ${libdir}/python3.4/code.* 
${libdir}/python3.4/codeop.* ${libdir}/python3.4/collections.* 
${libdir}/python3.4/_collections_abc.* ${libdir}/python3.4/dis.* 
${libdir}/python3.4/functools.* ${libdir}/python3.4/heapq.* 
${libdir}/python3.4/inspect.* ${libdir}/python3.4/keyword.* 
${libdir}/python3.4/opcode.* ${libdir}/python3.4/symbol.* 
${libdir}/python3.4/repr.* ${libdir}/python3.4/token.* 
${libdir}/python3.4/tokenize.* ${libdir}/python3.4/traceback.* 
${libdir}/python3.4/weakref.* "
 
 SUMMARY_${PN}-logging="Python logging support"
@@ -134,7 +134,7 @@ RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
 FILES_${PN}-mailbox="${libdir}/python3.4/mailbox.* "
 
 SUMMARY_${PN}-math="Python math support"
-RDEPENDS_${PN}-math="${PN}-core"
+RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt"
 FILES_${PN}-math="${libdir}/python3.4/lib-dynload/cmath.*.so 
${libdir}/python3.4/lib-dynload/math.*.so 
${libdir}/python3.4/lib-dynload/_random.*.so ${libdir}/python3.4/random.* 
${libdir}/python3.4/sets.* "
 
 SUMMARY_${PN}-mime="Python MIME handling APIs"
@@ -198,7 +198,7 @@ RDEPENDS_${PN}-resource="${PN}-core"
 FILES_${PN}-resource="${libdir}/python3.4/lib-dynload/resource.*.so "
 
 SUMMARY_${PN}-shell="Python shell-like functionality"
-RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
+RDEPENDS_${PN}-shell="${PN}-core ${PN}-re ${PN}-compression"
 FILES_${PN}-shell="${libdir}/python3.4/cmd.* ${libdir}/python3.4/commands.* 
${libdir}/python3.4/dircache.* ${libdir}/python3.4/fnmatch.* 
${libdir}/python3.4/glob.* ${libdir}/python3.4/popen2.* 
${libdir}/python3.4/shlex.* ${libdir}/python3.4/shutil.* "
 
 SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
@@ -218,7 +218,7 @@ RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
 FILES_${PN}-stringold="${libdir}/python3.4/lib-dynload/strop.*.so 
${libdir}/python3.4/string.* ${libdir}/python3.4/stringold.* "
 
 SUMMARY_${PN}-subprocess="Python subprocess support"
-RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl 
${PN}-pickle"
+RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl 
${PN}-pickle ${PN}-threading"
 FILES_${PN}-subprocess="${libdir}/python3.4/subprocess.* "
 
 SUMMARY_${PN}-syslog="Python syslog interface"
-- 
1.9.1

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta][PATCH] python-native: Compute prefix based on staging area

2016-07-28 Thread Kyle Russell
python-native should not assume that prefix points to the native
sysroot, and instead use STAGING_LIBDIR to determine prefix, since
python-native may be used to compile non-native python modules for the
target sysroot.

Computing an incorrect prefix causes unintended build behavior,
especially on setuptools packages.  A setuptools package may declare
setup_requires dependencies in its setup.py.  setuptools makes sure
these setup_requires dependencies are available during do_compile.
The bitbake recipes for these setuptools packages also express these
setup_requires dependencies as DEPENDS.

Since python's sysconfig computes the prefix from where python-native
was compiled, setuptools only searches the native sysroot for packages
that satisfy its setup_requires dependencies, while bitbake satisfies
its DEPENDS for the packages by populating the target sysroot.  Since
setuptools was being mislead by prefix on where to look for its
dependencies, it would try to download pypi packages into the compiling
package's workdir when it didn't find them in the native sysroot.
Instead, prefix should instruct setuptools to look in the target sysroot
to satisfy its setup_requires dependencies so setuptools can take
advantage of the DEPENDS satisfied by bitbake.

Note that a similar approach has already been patched for the
distutils.sysconfig module in python-native, but sysconfig was moved out
of distutils in Python 2.7 and >= 3.2, which appears to be why the previous
patch does not impact setuptools.

Signed-off-by: Kyle Russell <bkyleruss...@gmail.com>
---
 ...g.py-prefix-should-be-inside-staging-area.patch | 32 ++
 .../recipes-devtools/python/python-native_2.7.9.bb |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 
meta/recipes-devtools/python/python-native/0001-sysconfig.py-prefix-should-be-inside-staging-area.patch

diff --git 
a/meta/recipes-devtools/python/python-native/0001-sysconfig.py-prefix-should-be-inside-staging-area.patch
 
b/meta/recipes-devtools/python/python-native/0001-sysconfig.py-prefix-should-be-inside-staging-area.patch
new file mode 100644
index 000..27f191f
--- /dev/null
+++ 
b/meta/recipes-devtools/python/python-native/0001-sysconfig.py-prefix-should-be-inside-staging-area.patch
@@ -0,0 +1,32 @@
+From 47e1df99c073ba50213f5b5f78ea36828668001f Mon Sep 17 00:00:00 2001
+From: Kyle Russell <bkyleruss...@gmail.com>
+Date: Thu, 28 Jul 2016 09:15:45 -0400
+Subject: [PATCH] sysconfig.py: prefix should be inside staging area
+
+Similar to the distutils fix for correct prefix handling for the sysroot
+layout, but applies to the sysconfig API moved out of distutils in
+Python 2.7 and >=3.2.
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ Lib/sysconfig.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index ffc55ba..1cb4107 100644
+--- a/Lib/sysconfig.py
 b/Lib/sysconfig.py
+@@ -89,8 +89,8 @@ _SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 
'platlib', 'include',
+ _PY_VERSION = sys.version.split()[0]
+ _PY_VERSION_SHORT = sys.version[:3]
+ _PY_VERSION_SHORT_NO_DOT = _PY_VERSION[0] + _PY_VERSION[2]
+-_PREFIX = os.path.normpath(sys.prefix)
+-_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
++_PREFIX = '/'.join(os.environ['STAGING_LIBDIR'].split('/')[:-1])
++_EXEC_PREFIX = '/'.join(os.environ['STAGING_LIBDIR'].split('/')[:-1])
+ _CONFIG_VARS = None
+ _USER_BASE = None
+ _PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
+-- 
+1.9.3
+
diff --git a/meta/recipes-devtools/python/python-native_2.7.9.bb 
b/meta/recipes-devtools/python/python-native_2.7.9.bb
index 34f5c29..6c668e7 100644
--- a/meta/recipes-devtools/python/python-native_2.7.9.bb
+++ b/meta/recipes-devtools/python/python-native_2.7.9.bb
@@ -18,6 +18,7 @@ SRC_URI += "\
 file://parallel-makeinst-create-bindir.patch \
 file://revert_use_of_sysconfigdata.patch \
 file://avoid_parallel_make_races_on_pgen.patch \
+
file://0001-sysconfig.py-prefix-should-be-inside-staging-area.patch \
"
 S = "${WORKDIR}/Python-${PV}"
 
-- 
1.9.1

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] prelink support

2016-06-22 Thread Kyle Russell
On Wed, Jun 22, 2016 at 10:57 AM, Mark Hatle 
wrote:

> What is the specific error you got?  This is the type of stuff I'd like to
> resolve.
>

I don't have the logs on me at the moment for the specific output, but
there were two errors (one for 'int scope_cnt' and the other for 'unsigned
int cnt') being declared in the for loop initialization, which isn't
supported until -std=c99.  I was able to move the declaration to the
beginning of _dl_show_scope just for testing and prelink finished compiling
successfully.

Are you using a branch and gcc that is part of OpenEmbedded?  If so, I need
> to
> know how to configure the system so I can attempt to reproduce and work
> around
> the issue.
>

I think we're using the gcc compiler that's included in poky.  I was
running poky at the following commit on jethro.

ddbc131 toasterconf.json: exclude releases Toaster can't build

The only configuration change that I'm aware of was setting GCCVERSION back
to "4.9%" as recommended in
http://www.yoctoproject.org/docs/2.1/mega-manual/mega-manual.html#migration-2.0-gcc-5

I had updated the SRCREV and branch in the prelink recipe to point to
cross_prelink_staging as you suggested.  It simply seems that the version
of dl-open.c on cross_prelink_staging just isn't compatible with gcc 4.9,
which seems to default to C90.

I can dig further into our setup and send specific steps tomorrow if you're
not able to get similar results.
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] prelink support

2016-06-22 Thread Kyle Russell
The cross_prelink_staging branch seems to work for our ARM Cortex-A53
configuration.

The only issue that I ran into was building src/rtld/dl-open.c.  I guess
the GCCVERSION we declared (4.9%) was defaulting to a language standard
that didn't support for loop initial declarations.

On Mon, Jun 20, 2016 at 9:15 AM, Mark Hatle <mark.ha...@windriver.com>
wrote:

> On 6/20/16 7:24 AM, Kyle Russell wrote:
> > It looks like the image-prelink support is still disabled in master
> because of
> > an issue with IFUNC symbol relocation.
> >
> >
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta-poky/conf/local.conf.sample?id=8debfea81e69d038bd2d56314b272cb74f5582ed
> >
> > Is there still a problem, or is it safe to reenable image-prelink?  I
> see a "Fix
> > ARM IFUNC support" in the prelink-cross repo, but that appears to have
> been
> > committed several months before image-prelink was disabled.  We'd like
> to enable
> > image-prelink on a build off jethro.
> >
> > Any help or links to a recent discussion thread would be helpful.
> Thanks!
> >
> >
>
> The ARM fix is for a different IFUNC problem.
>
> Disabling the prelinker was caused by a serious of problems that started
> with a
> fork failure traced back to shared library processing orders.
>
> (For comments below, I'm referring to the repository:
> http://git.yoctoproject.org/cgit/cgit.cgi/prelink-cross/)
>
> The initial problem, IFUNC processing, showed that processing order of the
> shared libraries could lead to a case where the wrong IFUNC was used.  We
> believe this particular issues was fixed in the staging tree.
>
> In the tree you'll see a cross_prelink_staging branch.  In that branch the
> fix
> is commit ID: "8f55afd84b3580b1f1d6af904e8c2a39221055b7"  This fixes the
> 'fork'
> issue by ensuring the proper sort order for shared library processing.
> (This
> was finally fixed in March.)
>
> However with that we determined there was at least one more issue related
> to
> section ordering.  The prelink test suite was failing due to various
> integrity
> checks showing that once we prelinked something, we could not reverse the
> process.  It has taken us months to identify the cause of the problem and
> the
> solution.  (Cause BTW was a change in binutils-2.22 that no longer ensured
> that
> the section order was sorted by offset order... a small amount of the
> prelink
> processing needed to be changed to deal with that behavior.  It's taken far
> longer to fix then we had ever expected.)
>
> See commit (33be255d62af533189f1f7bc66c06602b703980a) in the
> cross_prelink_staging branch.
>
> With this commit, I think the two major issues have been resolved.  I've
> got a
> small set of additional patches I need to put into place -- and then I
> have to
> finish going through the regression suite to verify everything is working
> properly.  (Seems like every time I get to this step, something else comes
> up
> and I'm not getting it done...)
>
> So if you've read this far, the point in all of this is that I THINK that
> the
> cross_prelink_staging branch and current top commit
> "33be255d62af533189f1f7bc66c06602b703980a" are working.  However, I've not
> completed testing so I'm not sure of that yet.
>
> If you can help with testing, you should modify your prelink recipe to use
> the
> 'cross_prelink_staging' branch, and the 33be255 commit.  Verify that this
> is
> working for your use cases.  If you are using glib or graphical
> environments pay
> particular attention to process startup messages that indicate failures.
>
> If this IS working for you, I'd like a reply back with the architecture and
> processor you are using so I can add that to my matrix.  (I'm traveling
> for the
> next couple of days, and then should be back in the officer where I hope to
> finish my regression testing, apply the last couple of patches from Gentoo
> developers, regression test again and prepare a release version.)
>
> Any help is appreciated, thanks for understanding why this is taking so
> long.
>
> --Mark
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] prelink support

2016-06-20 Thread Kyle Russell
Thanks, Mark and Richard.  Great update!  I'll try out the staging branch
and report back with results.

On Mon, Jun 20, 2016 at 9:15 AM, Mark Hatle <mark.ha...@windriver.com>
wrote:

> On 6/20/16 7:24 AM, Kyle Russell wrote:
> > It looks like the image-prelink support is still disabled in master
> because of
> > an issue with IFUNC symbol relocation.
> >
> >
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta-poky/conf/local.conf.sample?id=8debfea81e69d038bd2d56314b272cb74f5582ed
> >
> > Is there still a problem, or is it safe to reenable image-prelink?  I
> see a "Fix
> > ARM IFUNC support" in the prelink-cross repo, but that appears to have
> been
> > committed several months before image-prelink was disabled.  We'd like
> to enable
> > image-prelink on a build off jethro.
> >
> > Any help or links to a recent discussion thread would be helpful.
> Thanks!
> >
> >
>
> The ARM fix is for a different IFUNC problem.
>
> Disabling the prelinker was caused by a serious of problems that started
> with a
> fork failure traced back to shared library processing orders.
>
> (For comments below, I'm referring to the repository:
> http://git.yoctoproject.org/cgit/cgit.cgi/prelink-cross/)
>
> The initial problem, IFUNC processing, showed that processing order of the
> shared libraries could lead to a case where the wrong IFUNC was used.  We
> believe this particular issues was fixed in the staging tree.
>
> In the tree you'll see a cross_prelink_staging branch.  In that branch the
> fix
> is commit ID: "8f55afd84b3580b1f1d6af904e8c2a39221055b7"  This fixes the
> 'fork'
> issue by ensuring the proper sort order for shared library processing.
> (This
> was finally fixed in March.)
>
> However with that we determined there was at least one more issue related
> to
> section ordering.  The prelink test suite was failing due to various
> integrity
> checks showing that once we prelinked something, we could not reverse the
> process.  It has taken us months to identify the cause of the problem and
> the
> solution.  (Cause BTW was a change in binutils-2.22 that no longer ensured
> that
> the section order was sorted by offset order... a small amount of the
> prelink
> processing needed to be changed to deal with that behavior.  It's taken far
> longer to fix then we had ever expected.)
>
> See commit (33be255d62af533189f1f7bc66c06602b703980a) in the
> cross_prelink_staging branch.
>
> With this commit, I think the two major issues have been resolved.  I've
> got a
> small set of additional patches I need to put into place -- and then I
> have to
> finish going through the regression suite to verify everything is working
> properly.  (Seems like every time I get to this step, something else comes
> up
> and I'm not getting it done...)
>
> So if you've read this far, the point in all of this is that I THINK that
> the
> cross_prelink_staging branch and current top commit
> "33be255d62af533189f1f7bc66c06602b703980a" are working.  However, I've not
> completed testing so I'm not sure of that yet.
>
> If you can help with testing, you should modify your prelink recipe to use
> the
> 'cross_prelink_staging' branch, and the 33be255 commit.  Verify that this
> is
> working for your use cases.  If you are using glib or graphical
> environments pay
> particular attention to process startup messages that indicate failures.
>
> If this IS working for you, I'd like a reply back with the architecture and
> processor you are using so I can add that to my matrix.  (I'm traveling
> for the
> next couple of days, and then should be back in the officer where I hope to
> finish my regression testing, apply the last couple of patches from Gentoo
> developers, regression test again and prepare a release version.)
>
> Any help is appreciated, thanks for understanding why this is taking so
> long.
>
> --Mark
>
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] prelink support

2016-06-20 Thread Kyle Russell
It looks like the image-prelink support is still disabled in master because
of an issue with IFUNC symbol relocation.

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta-poky/conf/local.conf.sample?id=8debfea81e69d038bd2d56314b272cb74f5582ed

Is there still a problem, or is it safe to reenable image-prelink?  I see a
"Fix ARM IFUNC support" in the prelink-cross repo, but that appears to have
been committed several months before image-prelink was disabled.  We'd like
to enable image-prelink on a build off jethro.

Any help or links to a recent discussion thread would be helpful.  Thanks!
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-oracle-java][PATCH v2] oracle-jse-jdk: Don't use ${D} installing symlink target

2015-12-02 Thread Kyle Russell
When installed to the sysroot, this makes the symlink point to the
workdir, which is invalid in the sstate package.  Since we cd to
${D} before creating the symlink, this ensures the link is created
in the correct install location, so just point the link to the final
target so that the patch is correctly fixed up during populate_sysroot.

Signed-off-by: Kyle Russell <bkyleruss...@gmail.com>
---
 recipes-devtools/oracle-java/oracle-jse-jdk.inc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-devtools/oracle-java/oracle-jse-jdk.inc 
b/recipes-devtools/oracle-java/oracle-jse-jdk.inc
index 54e83b8..6f13125 100644
--- a/recipes-devtools/oracle-java/oracle-jse-jdk.inc
+++ b/recipes-devtools/oracle-java/oracle-jse-jdk.inc
@@ -16,7 +16,7 @@ do_install_class-native() {
 install -d -m 0755 ${D}${bindir}
 cp -a ${S}/${JDK_JRE}${PV}_${PV_UPDATE} ${D}${libdir}/
 for prog in java javac; do
-   ( cd ${D}${bindir} && ln -sf 
${D}${libdir}/${JDK_JRE}${PV}_${PV_UPDATE}/bin/$prog )
+   ( cd ${D}${bindir} && ln -sf 
${libdir}/${JDK_JRE}${PV}_${PV_UPDATE}/bin/$prog )
 done
 
 ( cd ${D}${libdir}/${JDK_JRE}${PV}_${PV_UPDATE}/bin ; \
-- 
1.7.9.5

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-oracle-java][PATCH] oracle-jse-jdk: Don't use ${D} installing symlink target

2015-11-13 Thread Kyle Russell
When installed to the sysroot, this makes the symlink point to the
workdir, which is invalid in the sstate package.  Since we cd to
${D} before creating the symlink, this ensures the link is created
in the correct install location, so just point the link to the final
target so that the patch is correctly fixed up during populate_sysroot.
---
 recipes-devtools/oracle-java/oracle-jse-jdk.inc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-devtools/oracle-java/oracle-jse-jdk.inc 
b/recipes-devtools/oracle-java/oracle-jse-jdk.inc
index 54e83b8..6f13125 100644
--- a/recipes-devtools/oracle-java/oracle-jse-jdk.inc
+++ b/recipes-devtools/oracle-java/oracle-jse-jdk.inc
@@ -16,7 +16,7 @@ do_install_class-native() {
 install -d -m 0755 ${D}${bindir}
 cp -a ${S}/${JDK_JRE}${PV}_${PV_UPDATE} ${D}${libdir}/
 for prog in java javac; do
-   ( cd ${D}${bindir} && ln -sf 
${D}${libdir}/${JDK_JRE}${PV}_${PV_UPDATE}/bin/$prog )
+   ( cd ${D}${bindir} && ln -sf 
${libdir}/${JDK_JRE}${PV}_${PV_UPDATE}/bin/$prog )
 done
 
 ( cd ${D}${libdir}/${JDK_JRE}${PV}_${PV_UPDATE}/bin ; \
-- 
1.7.9.5

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto