Skip to contentSkip to conversation

prelink: Added prelink-20100106, which works on ARM.

PATCH In review James Limbouris 4 participants 6 messages Jun 14, 2011 – Jun 15, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 prelink: Added prelink-20100106, which works on ARM.

This version of prelink, together with a patch by Carsten Munk <[email protected]>, taken from MeeGo, fixes an ARM incompatibility with 20090925.

---
 .../prelink-20100106-arm-fix.patch                 |   86 ++++++++++++++++++++
 recipes/prelink/prelink_20100106.bb                |   53 ++++++++++++
 2 files changed, 139 insertions(+), 0 deletions(-)
 create mode 100755 recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch
 create mode 100644 recipes/prelink/prelink_20100106.bb
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +86 -0
new file mode 100755
index 0000000..a694541
@@ -0,0 +1,86 @@
+diff -ru prelink-old/src/arch-arm.c prelink/src/arch-arm.c
+--- prelink-old/src/arch-arm.c	2009-06-15 07:37:50.000000000 -0400
++++ prelink/src/arch-arm.c	2010-08-17 03:35:05.000000000 -0400
+@@ -832,7 +832,7 @@
+   .R_COPY = R_ARM_COPY,
+   .R_RELATIVE = R_ARM_RELATIVE,
+   .rtype_class_valid = RTYPE_CLASS_VALID,
+-  .dynamic_linker = "/lib/ld-linux.so.2",
++  .dynamic_linker = "/lib/ld-linux.so.3",
+   .adjust_dyn = arm_adjust_dyn,
+   .adjust_rel = arm_adjust_rel,
+   .adjust_rela = arm_adjust_rela,
+diff -ru prelink-old/src/execle_open.c prelink/src/execle_open.c
+--- prelink-old/src/execle_open.c	2006-08-13 11:18:17.000000000 -0400
++++ prelink/src/execle_open.c	2010-08-18 03:52:51.000000000 -0400
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
++#include <stdlib.h>
+ 
+ static pid_t pid;
+ 
+@@ -32,6 +33,7 @@
+ 
+   if (f != NULL)
+     fclose (f);
++    
+   while ((p = waitpid (pid, &status, 0)) == -1 && errno == EINTR);
+   if (p == -1 || ! WIFEXITED (status))
+     return -1;
+@@ -50,7 +52,7 @@
+       return NULL;
+     }
+ 
+-  switch (vfork ())
++  switch (pid=fork ())
+     {
+     case -1:
+       error (0, errno, "Could not run %s", path);
+@@ -63,7 +65,9 @@
+ 	  close (p[1]);
+ 	}
+       dup2 (1, 2);
+-      execve (path, argv, envp);
++      while (*envp) 
++        putenv(*envp++);
++      execv (path, argv);
+       _exit (127);
+     }
+ 
+diff -ru prelink-old/src/gather.c prelink/src/gather.c
+--- prelink-old/src/gather.c	2008-10-09 16:31:03.000000000 -0400
++++ prelink/src/gather.c	2010-08-17 04:45:53.000000000 -0400
+@@ -208,7 +208,8 @@
+ 		      goto error_out;
+ 		    }
+ 		}
+-	      error (0, 0, "%s: Could not parse `%s'", ent->filename, line);
++	      /* This is not an error situation: error (0, 0, "%s: Could7 not parse `%s'", ent->filename, line); */
++	      continue;
+ 	    }
+ 	  goto error_out;
+ 	}
+diff -ru prelink-old/src/get.c prelink/src/get.c
+--- prelink-old/src/get.c	2009-06-12 08:01:48.000000000 -0400
++++ prelink/src/get.c	2010-08-17 04:29:14.000000000 -0400
+@@ -30,6 +30,7 @@
+ is_ldso_soname (const char *soname)
+ {
+   if (! strcmp (soname, "ld-linux.so.2")
++      || ! strcmp (soname, "ld-linux.so.3")
+       || ! strcmp (soname, "ld.so.1")
+       || ! strcmp (soname, "ld-linux-ia64.so.2")
+       || ! strcmp (soname, "ld-linux-x86-64.so.2")
+diff -ru prelink-old/testsuite/movelibs.sh prelink/testsuite/movelibs.sh
+--- prelink-old/testsuite/movelibs.sh	2009-12-16 06:57:31.000000000 -0500
++++ prelink/testsuite/movelibs.sh	2010-08-18 03:10:19.000000000 -0400
+@@ -6,6 +6,7 @@
+ > syslib.list
+ > syslnk.list
+ for i in `LD_TRACE_PRELINKING=1 LD_WARN= LD_TRACE_LOADED_OBJECTS=1 ./movelibs \
++	  | grep " => " \
+ 	  | awk '$1 !~ /^\.\/movelibs/ { print $3 } '`; do
+   k=`basename $i`
+   if [ -L $i ]; then
recipes/prelink/prelink_20100106.bb new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 18 lines · James Limbouris

This version of prelink, together with a patch by Carsten Munk <[email protected]>, taken from MeeGo, fixes an ARM incompatibility with 20090925.

---
 .../prelink-20100106-arm-fix.patch                 |   86 ++++++++++++++++++++
 recipes/prelink/prelink_20100106.bb                |   53 ++++++++++++
 2 files changed, 139 insertions(+), 0 deletions(-)
 create mode 100755 recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch
 create mode 100644 recipes/prelink/prelink_20100106.bb
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +0 -0
new file mode 100755
index 0000000..a694541

recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch line 9

Quoted 9 lines
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +9 -0
@@ -0,0 +1,86 @@
+diff -ru prelink-old/src/arch-arm.c prelink/src/arch-arm.c
+--- prelink-old/src/arch-arm.c	2009-06-15 07:37:50.000000000 -0400
++++ prelink/src/arch-arm.c	2010-08-17 03:35:05.000000000 -0400
+@@ -832,7 +832,7 @@
+   .R_COPY = R_ARM_COPY,
+   .R_RELATIVE = R_ARM_RELATIVE,
+   .rtype_class_valid = RTYPE_CLASS_VALID,
+-  .dynamic_linker = "/lib/ld-linux.so.2",
++  .dynamic_linker = "/lib/ld-linux.so.3",

That looks like it's going to break OABI binaries. I'm not sure to what extent we care about those anymore, but I'm not sure I would describe this as a "fix" exactly.

Quoted 4 lines
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +4 -0
+-  switch (vfork ())
++  switch (pid=fork ())
+     {
+     case -1:

recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch line 49

Quoted 10 lines
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +10 -0
+       error (0, errno, "Could not run %s", path);
+@@ -63,7 +65,9 @@
+ 	  close (p[1]);
+ 	}
+       dup2 (1, 2);
+-      execve (path, argv, envp);
++      while (*envp) 
++        putenv(*envp++);
++      execv (path, argv);
+       _exit (127);

What's that about?

p.

#2 lore raw
Quoted 49 lines · Phil Blundell
Quoted 20 lines · James Limbouris

This version of prelink, together with a patch by Carsten Munk <[email protected]>, taken from MeeGo, fixes an ARM incompatibility with 20090925.

---
 .../prelink-20100106-arm-fix.patch                 |   86 ++++++++++++++++++++
 recipes/prelink/prelink_20100106.bb                |   53 ++++++++++++
 2 files changed, 139 insertions(+), 0 deletions(-)  create mode
100755 recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch
 create mode 100644 recipes/prelink/prelink_20100106.bb

diff --git a/recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch b/recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file mode 100755
index 0000000..a694541

recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch line 9

Quoted 9 lines
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +9 -0
@@ -0,0 +1,86 @@
+diff -ru prelink-old/src/arch-arm.c prelink/src/arch-arm.c
+--- prelink-old/src/arch-arm.c	2009-06-15 07:37:50.000000000 -0400
++++ prelink/src/arch-arm.c	2010-08-17 03:35:05.000000000 -0400
+@@ -832,7 +832,7 @@
+   .R_COPY = R_ARM_COPY,
+   .R_RELATIVE = R_ARM_RELATIVE,
+   .rtype_class_valid = RTYPE_CLASS_VALID,
+-  .dynamic_linker = "/lib/ld-linux.so.2",
++  .dynamic_linker = "/lib/ld-linux.so.3",

That looks like it's going to break OABI binaries. I'm not sure to what extent we care about those anymore, but I'm not sure I would describe this as a "fix" exactly.

recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch line 49

Quoted 13 lines
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +13 -0
+-  switch (vfork ())
++  switch (pid=fork ())
+     {
+     case -1:
+       error (0, errno, "Could not run %s", path); @@ -63,7 +65,9 @@
+ 	  close (p[1]);
+ 	}
+       dup2 (1, 2);
+-      execve (path, argv, envp);
++      while (*envp)
++        putenv(*envp++);
++      execv (path, argv);
+       _exit (127);
Quoted 3 lines

What's that about?

p.

Hi,

I believe the vfork() changes are for qemu compatibility - I don't know what the issue was exactly.

I didn't realise the linker version was for EABI/OABI compatibility - I guess prelink should determine the ABI and choose accordingly... But I don't have any OABI binaries on my system at all...
So we can:
1. Fix it properly
2. Switch from OABI only to EABI only
3. Make a prelink-eabi recipe.

I don't really have the patience for 1., since I have no OABI binaries. Does anyone have any preferences here?

Regards,
James

#3 lore raw

Have you looked at:

http://git.yoctoproject.org/cgit/cgit.cgi/prelink-cross/

As far as I'm aware, this version works properly for all of the expected targets, including ARM.

If it doesn't work, someone should submit a patch to the maintainer (me) and we'll get things resolved.

The Yocto prelinker contains both local (on-target) as well as cross-prelinking support... (This is already integrated into oe-core)

--Mark

Quoted 75 lines · James Limbouris
Quoted 49 lines · Phil Blundell
Quoted 20 lines · James Limbouris

This version of prelink, together with a patch by Carsten Munk <[email protected]>, taken from MeeGo, fixes an ARM incompatibility with 20090925.

---
 .../prelink-20100106-arm-fix.patch                 |   86 ++++++++++++++++++++
 recipes/prelink/prelink_20100106.bb                |   53 ++++++++++++
 2 files changed, 139 insertions(+), 0 deletions(-)  create mode
100755 recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch
 create mode 100644 recipes/prelink/prelink_20100106.bb

diff --git a/recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch b/recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file mode 100755
index 0000000..a694541

recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch line 9

Quoted 9 lines
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +9 -0
@@ -0,0 +1,86 @@
+diff -ru prelink-old/src/arch-arm.c prelink/src/arch-arm.c
+--- prelink-old/src/arch-arm.c	2009-06-15 07:37:50.000000000 -0400
++++ prelink/src/arch-arm.c	2010-08-17 03:35:05.000000000 -0400
+@@ -832,7 +832,7 @@
+   .R_COPY = R_ARM_COPY,
+   .R_RELATIVE = R_ARM_RELATIVE,
+   .rtype_class_valid = RTYPE_CLASS_VALID,
+-  .dynamic_linker = "/lib/ld-linux.so.2",
++  .dynamic_linker = "/lib/ld-linux.so.3",

That looks like it's going to break OABI binaries. I'm not sure to what extent we care about those anymore, but I'm not sure I would describe this as a "fix" exactly.

recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch line 49

Quoted 13 lines
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +13 -0
+-  switch (vfork ())
++  switch (pid=fork ())
+     {
+     case -1:
+       error (0, errno, "Could not run %s", path); @@ -63,7 +65,9 @@
+ 	  close (p[1]);
+ 	}
+       dup2 (1, 2);
+-      execve (path, argv, envp);
++      while (*envp)
++        putenv(*envp++);
++      execv (path, argv);
+       _exit (127);
Quoted 3 lines

What's that about?

p.

Hi,

I believe the vfork() changes are for qemu compatibility - I don't know what the issue was exactly.

I didn't realise the linker version was for EABI/OABI compatibility - I guess prelink should determine the ABI and choose accordingly... But I don't have any OABI binaries on my system at all...
So we can:
1. Fix it properly
2. Switch from OABI only to EABI only
3. Make a prelink-eabi recipe.

I don't really have the patience for 1., since I have no OABI binaries. Does anyone have any preferences here?

Regards,
James

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#4 lore raw
Quoted 4 lines · Mark Hatle

Have you looked at:

http://git.yoctoproject.org/cgit/cgit.cgi/prelink-cross/

Quoted 8 lines

As far as I'm aware, this version works properly for all of the expected targets, including ARM.

If it doesn't work, someone should submit a patch to the maintainer (me) and we'll get things resolved.

The Yocto prelinker contains both local (on-target) as well as cross-prelinking support... (This is already integrated into oe-core)

Forgot to note, look at the cross_prelink branch. This is the head of tree for the embedded items. The "master" is a mirror of the current SVN tree from Jakub Jelinek.

The ld-linux... patch hunk is already there, and in a better shape then the one proposed. Both the ld-linux.so.2 and ld-linux.so.3 are supported.

Quoted 84 lines

--Mark

Quoted 67 lines · James Limbouris
Quoted 49 lines · Phil Blundell
Quoted 20 lines · James Limbouris

This version of prelink, together with a patch by Carsten Munk <[email protected]>, taken from MeeGo, fixes an ARM incompatibility with 20090925.

---
 .../prelink-20100106-arm-fix.patch                 |   86 ++++++++++++++++++++
 recipes/prelink/prelink_20100106.bb                |   53 ++++++++++++
 2 files changed, 139 insertions(+), 0 deletions(-)  create mode
100755 recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch
 create mode 100644 recipes/prelink/prelink_20100106.bb

diff --git a/recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch b/recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file mode 100755
index 0000000..a694541

recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch line 9

Quoted 9 lines
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +9 -0
@@ -0,0 +1,86 @@
+diff -ru prelink-old/src/arch-arm.c prelink/src/arch-arm.c
+--- prelink-old/src/arch-arm.c	2009-06-15 07:37:50.000000000 -0400
++++ prelink/src/arch-arm.c	2010-08-17 03:35:05.000000000 -0400
+@@ -832,7 +832,7 @@
+   .R_COPY = R_ARM_COPY,
+   .R_RELATIVE = R_ARM_RELATIVE,
+   .rtype_class_valid = RTYPE_CLASS_VALID,
+-  .dynamic_linker = "/lib/ld-linux.so.2",
++  .dynamic_linker = "/lib/ld-linux.so.3",

That looks like it's going to break OABI binaries. I'm not sure to what extent we care about those anymore, but I'm not sure I would describe this as a "fix" exactly.

recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch line 49

Quoted 13 lines
recipes/prelink/prelink-20100106/prelink-20100106-arm-fix.patch new file +13 -0
+-  switch (vfork ())
++  switch (pid=fork ())
+     {
+     case -1:
+       error (0, errno, "Could not run %s", path); @@ -63,7 +65,9 @@
+ 	  close (p[1]);
+ 	}
+       dup2 (1, 2);
+-      execve (path, argv, envp);
++      while (*envp)
++        putenv(*envp++);
++      execv (path, argv);
+       _exit (127);
Quoted 3 lines

What's that about?

p.

Hi,

I believe the vfork() changes are for qemu compatibility - I don't know what the issue was exactly.

I didn't realise the linker version was for EABI/OABI compatibility - I guess prelink should determine the ABI and choose accordingly... But I don't have any OABI binaries on my system at all...
So we can:
1. Fix it properly
2. Switch from OABI only to EABI only
3. Make a prelink-eabi recipe.

I don't really have the patience for 1., since I have no OABI binaries. Does anyone have any preferences here?

Quoted 8 lines

Regards,
James

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#5 lore raw
In reply to James Limbouris

Am Dienstag, den 14.06.2011, 15:49 +0800 schrieb James Limbouris:

Quoted 5 lines

This version of prelink, together with a patch by Carsten Munk <[email protected]>, taken from MeeGo, fixes an ARM incompatibility with 20090925.

What build configuration do you use for testing? Using angstrom-2010.x or minimal{,-uclibc} for MACHINE = "beagleboard" elfutils_0.143.bb does not even compile.

With Ȧngström the error is the following.

| strip.c: In function 'process_file':
| strip.c:301:7: error: implicit declaration of function 'stat64'
| strip.c:335:3: error: implicit declaration of function 'fstat64'
| strip.c:356:63: error: 'ACCESSPERMS' undeclared (first use in this function)
| strip.c:356:63: note: each undeclared identifier is reported only once for each function it appears in
| strip.c: In function 'handle_elf':
| strip.c:1641:4: error: implicit declaration of function 'fchmod'
| make[2]: *** [strip.o] Error 1

Thanks,

Paul