mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* Re: [ptxdist] [PATCH] Enable "strip" install option handling for libraries
@ 2015-07-21 12:04 Albert Antony
  2015-07-21 13:14 ` Juergen Borleis
  0 siblings, 1 reply; 9+ messages in thread
From: Albert Antony @ 2015-07-21 12:04 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 4035 bytes --]

Hi Michael,

Maybe I am not aware of the auto-detection feature. And from the looks of
it I misunderstand the use-case for the strip y|n option altogether. So let
me explain.

Our requirement here is to install debug versions of certain libraries on
the target, some of which are installed via install_lib, and some others
like libpthread which are installed via install_copy_toolchain_lib. Since
the strip y|n option to these calls seem to be getting ignored, I assumed
this might be a missing feature. This is what prompted the patch. If there
is a better way (maybe auto-detection?) to achieve the same then I guess
there is no need for it. Could you point me to where I can find out more
about auto-detection?

Cheers,
Albert.

On 21 July 2015 at 12:26, Michael Olbrich <m.olbrich@pengutronix.de> wrote:

> On Tue, Jul 21, 2015 at 12:09:38PM +0200, Albert Antony wrote:
> > The strip y|n option should now work for install_lib
> > and install_copy_toolchain_lib, just like it works
> > for install_copy.
>
> Why? What's the use-case for this? For install_copy it's still there for
> kernel modules and legacy stuff, but in general the auto detection should
> work.
>
> Michael
>
> > Signed-off-by: Albert Antony <albert@newtec.dk>
> > ---
> >  rules/post/install.make           | 3 ++-
> >  scripts/install_copy_toolchain.sh | 2 +-
> >  scripts/lib/ptxd_make_xpkg_pkg.sh | 3 ++-
> >  3 files changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/rules/post/install.make b/rules/post/install.make
> > index 7da3f04..9cde3d4 100644
> > --- a/rules/post/install.make
> > +++ b/rules/post/install.make
> > @@ -240,8 +240,9 @@ install_lib =                     \
> >       PER="$(strip $(4))";    \
> >       LIB=$(strip $(5));      \
> >       DST=$(strip $(6)); \
> > +     STRIP=$(strip $(7)); \
> >       $(call install_check, install_lib);     \
> > -     echo "ptxd_install_lib '$$LIB' '$$DST' '$$OWN' '$$GRP' '$$PER'" >>
> "$(STATEDIR)/$$XPKG.cmds"
> > +     echo "ptxd_install_lib '$$LIB' '$$DST' '$$OWN' '$$GRP' '$$PER'
> '$$STRIP'" >> "$(STATEDIR)/$$XPKG.cmds"
> >
> >  #
> >  # install_replace
> > diff --git a/scripts/install_copy_toolchain.sh
> b/scripts/install_copy_toolchain.sh
> > index 0cf4d31..0b70c12 100755
> > --- a/scripts/install_copy_toolchain.sh
> > +++ b/scripts/install_copy_toolchain.sh
> > @@ -170,7 +170,7 @@ ptxd_install_toolchain_lib() {
> >
> >               perm="$(stat -c %a "${lib_path}")"
> >
> > -             echo "ptxd_install_shared \"${lib_path}\" \"${prefix}\" 0
> 0 \"${perm}\"" >> "${STATEDIR}/${packet}.cmds"
> > +             echo "ptxd_install_shared \"${lib_path}\" \"${prefix}\" 0
> 0 \"${perm}\" \"${strip}\"" >> "${STATEDIR}/${packet}.cmds"
> >           fi
> >       else
> >           echo "error: found ${lib_path}, but neither file nor link" 2>&1
> > diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh
> b/scripts/lib/ptxd_make_xpkg_pkg.sh
> > index ae4c12f..a31e8fe 100644
> > --- a/scripts/lib/ptxd_make_xpkg_pkg.sh
> > +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
> > @@ -730,9 +730,10 @@ ptxd_install_shared() {
> >      local usr="$3"
> >      local grp="$4"
> >      local mod="$5"
> > +    local strip="$6"
> >      local filename="$(basename "${src}")"
> >
> > -    ptxd_install_file "${src}" "${dst}/${filename}" "${usr}" "${grp}"
> "${mod}" &&
> > +    ptxd_install_file "${src}" "${dst}/${filename}" "${usr}" "${grp}"
> "${mod}" "${strip}" &&
> >
> >      find -H "$(dirname "${src}")" -maxdepth 1 -type l | while read
> file; do
> >       if [ "$(basename "$(readlink -f "${file}")")" = "${filename}" ];
> then
> > --
> > 2.0.0
> >
> >
> > --
> > ptxdist mailing list
> > ptxdist@pengutronix.de
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>
> --
> ptxdist mailing list
> ptxdist@pengutronix.de
>

[-- Attachment #1.2: Type: text/html, Size: 5996 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] Enable "strip" install option handling for libraries
  2015-07-21 12:04 [ptxdist] [PATCH] Enable "strip" install option handling for libraries Albert Antony
@ 2015-07-21 13:14 ` Juergen Borleis
  2015-07-21 14:03   ` Albert Antony
  0 siblings, 1 reply; 9+ messages in thread
From: Juergen Borleis @ 2015-07-21 13:14 UTC (permalink / raw)
  To: ptxdist; +Cc: Albert Antony

Hi Albert,

On Tuesday 21 July 2015 14:04:02 Albert Antony wrote:
> Maybe I am not aware of the auto-detection feature. And from the looks of
> it I misunderstand the use-case for the strip y|n option altogether. So let
> me explain.
>
> Our requirement here is to install debug versions of certain libraries on
> the target, some of which are installed via install_lib, and some others
> like libpthread which are installed via install_copy_toolchain_lib. Since
> the strip y|n option to these calls seem to be getting ignored, I assumed
> this might be a missing feature. This is what prompted the patch. If there
> is a better way (maybe auto-detection?) to achieve the same then I guess
> there is no need for it. Could you point me to where I can find out more
> about auto-detection?

Why do you want to have libraries *with* debug information in your root 
filesystem?

Regards,
Juergen

-- 
Pengutronix e.K.                              | Juergen Borleis             |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] Enable "strip" install option handling for libraries
  2015-07-21 13:14 ` Juergen Borleis
@ 2015-07-21 14:03   ` Albert Antony
  2015-07-21 14:34     ` Juergen Borleis
  0 siblings, 1 reply; 9+ messages in thread
From: Albert Antony @ 2015-07-21 14:03 UTC (permalink / raw)
  To: ptxdist

Hi Juergen,

On 21 July 2015 at 15:14, Juergen Borleis <jbe@pengutronix.de> wrote:
> Why do you want to have libraries *with* debug information in your root
> filesystem?

It just facilitates easier debugging in our case. We can run gdb on
the target directly, instead of via gdbserver.

Given that this may apply to other users as well, would it not be a
good idea to let the user have the choice of installing certain select
unstripped binaries in the rootfs if they so desire? Of course the
default option would still be to install stripped binaries. Let me
know what you think.

Cheers,
Albert.

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] Enable "strip" install option handling for libraries
  2015-07-21 14:03   ` Albert Antony
@ 2015-07-21 14:34     ` Juergen Borleis
  2015-07-22  8:31       ` Albert Antony
  0 siblings, 1 reply; 9+ messages in thread
From: Juergen Borleis @ 2015-07-21 14:34 UTC (permalink / raw)
  To: Albert Antony; +Cc: ptxdist

Hi Albert,

On Tuesday 21 July 2015 16:03:36 Albert Antony wrote:
> On 21 July 2015 at 15:14, Juergen Borleis <jbe@pengutronix.de> wrote:
> > Why do you want to have libraries *with* debug information in your root
> > filesystem?
>
> It just facilitates easier debugging in our case. We can run gdb on
> the target directly, instead of via gdbserver.
>
> Given that this may apply to other users as well, would it not be a
> good idea to let the user have the choice of installing certain select
> unstripped binaries in the rootfs if they so desire? Of course the
> default option would still be to install stripped binaries. Let me
> know what you think.

As an alternative to change PTXdist's behaviour you could mount the content 
of "platform-<yourplatform>/root-debug" instead and have all debug information 
available on the target.

Regards,
Juergen

-- 
Pengutronix e.K.                              | Juergen Borleis             |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] Enable "strip" install option handling for libraries
  2015-07-21 14:34     ` Juergen Borleis
@ 2015-07-22  8:31       ` Albert Antony
  2015-07-22  9:29         ` Juergen Borleis
  0 siblings, 1 reply; 9+ messages in thread
From: Albert Antony @ 2015-07-22  8:31 UTC (permalink / raw)
  To: ptxdist, Juergen Borleis

Hi Juergen,

I am aware of the root-debug option, and indeed that is what we use
for in-house debugging. But we would like to be able to debug a target
that is out in the field, with only ssh access available to it. Having
an unstripped version of the application of interest makes the
debugging a lot easier in this case.

The intention here is not change PTXdist's current behaviour. Existing
build scripts should rightly continue to function as they used to.
What is proposed in the patch is an optional parameter that makes it
possible to install unstripped binaries for libraries. Since
install_copy and install_copy_toolchain_usr already support such an
option, it seemed like a natural extension to have install_lib and
install_copy_toolchain_lib support it as well.

Cheers,
Albert.


On 21 July 2015 at 16:34, Juergen Borleis <jbe@pengutronix.de> wrote:
> Hi Albert,
>
> On Tuesday 21 July 2015 16:03:36 Albert Antony wrote:
>> On 21 July 2015 at 15:14, Juergen Borleis <jbe@pengutronix.de> wrote:
>> > Why do you want to have libraries *with* debug information in your root
>> > filesystem?
>>
>> It just facilitates easier debugging in our case. We can run gdb on
>> the target directly, instead of via gdbserver.
>>
>> Given that this may apply to other users as well, would it not be a
>> good idea to let the user have the choice of installing certain select
>> unstripped binaries in the rootfs if they so desire? Of course the
>> default option would still be to install stripped binaries. Let me
>> know what you think.
>
> As an alternative to change PTXdist's behaviour you could mount the content
> of "platform-<yourplatform>/root-debug" instead and have all debug information
> available on the target.
>
> Regards,
> Juergen
>
> --
> Pengutronix e.K.                              | Juergen Borleis             |
> Industrial Linux Solutions                    | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] Enable "strip" install option handling for libraries
  2015-07-22  8:31       ` Albert Antony
@ 2015-07-22  9:29         ` Juergen Borleis
  2015-07-22 13:28           ` Albert Antony
  0 siblings, 1 reply; 9+ messages in thread
From: Juergen Borleis @ 2015-07-22  9:29 UTC (permalink / raw)
  To: ptxdist; +Cc: Albert Antony

Hi Albert,

On Wednesday 22 July 2015 10:31:45 Albert Antony wrote:
> I am aware of the root-debug option, and indeed that is what we use
> for in-house debugging. But we would like to be able to debug a target
> that is out in the field, with only ssh access available to it. Having
> an unstripped version of the application of interest makes the
> debugging a lot easier in this case.

Hmm, PTXdist is a tool which supports exactly this use case. You still can 
debug your target remotely even if it is already in the field.

But you rely on the root filesystem content in the target in the field is 
exactly the one which PTXdist has created (and can re-create on demand at any 
point of time).

Then you can run the 'gdbserver' on your target in the field, start your 
debugger locally and point it to the local "root-debug" directory. That's all. 
Everything runs on your target in the field, but the debugger still finds all 
relevant debug info locally on your host. There is no need for debug infos at 
the target side.

Regards,
Juergen

-- 
Pengutronix e.K.                              | Juergen Borleis             |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] Enable "strip" install option handling for libraries
  2015-07-22  9:29         ` Juergen Borleis
@ 2015-07-22 13:28           ` Albert Antony
  0 siblings, 0 replies; 9+ messages in thread
From: Albert Antony @ 2015-07-22 13:28 UTC (permalink / raw)
  To: Juergen Borleis; +Cc: ptxdist

Hi Juergen,

I agree with everything you say there. On our side, what the few
unstripped binaries help us avoid is re-creating a matching rootfs
(which as you know can take anywhere from a few seconds to a few
hours). Since the slight extra storage space is not an issue on our
target platform, unstripped application-specific binaries with
in-target gdb work out to be a simple solution for our needs.

But of course you guys are way more experienced with build systems :)
If you see our requirement as one-off and not in line with the
customary approach, then we don't have to merge the patch in. I just
thought it was better to let the user have a say in the
stripped-vs-unstripped install, with the default of course being a
stripped install.

Cheers,
Albert.

On 22 July 2015 at 11:29, Juergen Borleis <jbe@pengutronix.de> wrote:
> Hi Albert,
>
> On Wednesday 22 July 2015 10:31:45 Albert Antony wrote:
>> I am aware of the root-debug option, and indeed that is what we use
>> for in-house debugging. But we would like to be able to debug a target
>> that is out in the field, with only ssh access available to it. Having
>> an unstripped version of the application of interest makes the
>> debugging a lot easier in this case.
>
> Hmm, PTXdist is a tool which supports exactly this use case. You still can
> debug your target remotely even if it is already in the field.
>
> But you rely on the root filesystem content in the target in the field is
> exactly the one which PTXdist has created (and can re-create on demand at any
> point of time).
>
> Then you can run the 'gdbserver' on your target in the field, start your
> debugger locally and point it to the local "root-debug" directory. That's all.
> Everything runs on your target in the field, but the debugger still finds all
> relevant debug info locally on your host. There is no need for debug infos at
> the target side.
>
> Regards,
> Juergen
>
> --
> Pengutronix e.K.                              | Juergen Borleis             |
> Industrial Linux Solutions                    | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ptxdist] [PATCH] Enable "strip" install option handling for libraries
  2015-07-21 10:09 Albert Antony
@ 2015-07-21 10:26 ` Michael Olbrich
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Olbrich @ 2015-07-21 10:26 UTC (permalink / raw)
  To: ptxdist

On Tue, Jul 21, 2015 at 12:09:38PM +0200, Albert Antony wrote:
> The strip y|n option should now work for install_lib
> and install_copy_toolchain_lib, just like it works
> for install_copy.

Why? What's the use-case for this? For install_copy it's still there for
kernel modules and legacy stuff, but in general the auto detection should
work.

Michael

> Signed-off-by: Albert Antony <albert@newtec.dk>
> ---
>  rules/post/install.make           | 3 ++-
>  scripts/install_copy_toolchain.sh | 2 +-
>  scripts/lib/ptxd_make_xpkg_pkg.sh | 3 ++-
>  3 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/rules/post/install.make b/rules/post/install.make
> index 7da3f04..9cde3d4 100644
> --- a/rules/post/install.make
> +++ b/rules/post/install.make
> @@ -240,8 +240,9 @@ install_lib =			\
>  	PER="$(strip $(4))";	\
>  	LIB=$(strip $(5));	\
>  	DST=$(strip $(6)); \
> +	STRIP=$(strip $(7)); \
>  	$(call install_check, install_lib);	\
> -	echo "ptxd_install_lib '$$LIB' '$$DST' '$$OWN' '$$GRP' '$$PER'" >> "$(STATEDIR)/$$XPKG.cmds"
> +	echo "ptxd_install_lib '$$LIB' '$$DST' '$$OWN' '$$GRP' '$$PER' '$$STRIP'" >> "$(STATEDIR)/$$XPKG.cmds"
>  
>  #
>  # install_replace
> diff --git a/scripts/install_copy_toolchain.sh b/scripts/install_copy_toolchain.sh
> index 0cf4d31..0b70c12 100755
> --- a/scripts/install_copy_toolchain.sh
> +++ b/scripts/install_copy_toolchain.sh
> @@ -170,7 +170,7 @@ ptxd_install_toolchain_lib() {
>  
>  		perm="$(stat -c %a "${lib_path}")"
>  
> -		echo "ptxd_install_shared \"${lib_path}\" \"${prefix}\" 0 0 \"${perm}\"" >> "${STATEDIR}/${packet}.cmds"
> +		echo "ptxd_install_shared \"${lib_path}\" \"${prefix}\" 0 0 \"${perm}\" \"${strip}\"" >> "${STATEDIR}/${packet}.cmds"
>  	    fi
>  	else
>  	    echo "error: found ${lib_path}, but neither file nor link" 2>&1
> diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
> index ae4c12f..a31e8fe 100644
> --- a/scripts/lib/ptxd_make_xpkg_pkg.sh
> +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
> @@ -730,9 +730,10 @@ ptxd_install_shared() {
>      local usr="$3"
>      local grp="$4"
>      local mod="$5"
> +    local strip="$6"
>      local filename="$(basename "${src}")"
>  
> -    ptxd_install_file "${src}" "${dst}/${filename}" "${usr}" "${grp}" "${mod}" &&
> +    ptxd_install_file "${src}" "${dst}/${filename}" "${usr}" "${grp}" "${mod}" "${strip}" &&
>  
>      find -H "$(dirname "${src}")" -maxdepth 1 -type l | while read file; do
>  	if [ "$(basename "$(readlink -f "${file}")")" = "${filename}" ]; then
> -- 
> 2.0.0
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ptxdist] [PATCH] Enable "strip" install option handling for libraries
@ 2015-07-21 10:09 Albert Antony
  2015-07-21 10:26 ` Michael Olbrich
  0 siblings, 1 reply; 9+ messages in thread
From: Albert Antony @ 2015-07-21 10:09 UTC (permalink / raw)
  To: ptxdist; +Cc: Albert Antony

The strip y|n option should now work for install_lib
and install_copy_toolchain_lib, just like it works
for install_copy.

Signed-off-by: Albert Antony <albert@newtec.dk>
---
 rules/post/install.make           | 3 ++-
 scripts/install_copy_toolchain.sh | 2 +-
 scripts/lib/ptxd_make_xpkg_pkg.sh | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/rules/post/install.make b/rules/post/install.make
index 7da3f04..9cde3d4 100644
--- a/rules/post/install.make
+++ b/rules/post/install.make
@@ -240,8 +240,9 @@ install_lib =			\
 	PER="$(strip $(4))";	\
 	LIB=$(strip $(5));	\
 	DST=$(strip $(6)); \
+	STRIP=$(strip $(7)); \
 	$(call install_check, install_lib);	\
-	echo "ptxd_install_lib '$$LIB' '$$DST' '$$OWN' '$$GRP' '$$PER'" >> "$(STATEDIR)/$$XPKG.cmds"
+	echo "ptxd_install_lib '$$LIB' '$$DST' '$$OWN' '$$GRP' '$$PER' '$$STRIP'" >> "$(STATEDIR)/$$XPKG.cmds"
 
 #
 # install_replace
diff --git a/scripts/install_copy_toolchain.sh b/scripts/install_copy_toolchain.sh
index 0cf4d31..0b70c12 100755
--- a/scripts/install_copy_toolchain.sh
+++ b/scripts/install_copy_toolchain.sh
@@ -170,7 +170,7 @@ ptxd_install_toolchain_lib() {
 
 		perm="$(stat -c %a "${lib_path}")"
 
-		echo "ptxd_install_shared \"${lib_path}\" \"${prefix}\" 0 0 \"${perm}\"" >> "${STATEDIR}/${packet}.cmds"
+		echo "ptxd_install_shared \"${lib_path}\" \"${prefix}\" 0 0 \"${perm}\" \"${strip}\"" >> "${STATEDIR}/${packet}.cmds"
 	    fi
 	else
 	    echo "error: found ${lib_path}, but neither file nor link" 2>&1
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
index ae4c12f..a31e8fe 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -730,9 +730,10 @@ ptxd_install_shared() {
     local usr="$3"
     local grp="$4"
     local mod="$5"
+    local strip="$6"
     local filename="$(basename "${src}")"
 
-    ptxd_install_file "${src}" "${dst}/${filename}" "${usr}" "${grp}" "${mod}" &&
+    ptxd_install_file "${src}" "${dst}/${filename}" "${usr}" "${grp}" "${mod}" "${strip}" &&
 
     find -H "$(dirname "${src}")" -maxdepth 1 -type l | while read file; do
 	if [ "$(basename "$(readlink -f "${file}")")" = "${filename}" ]; then
-- 
2.0.0


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-07-22 11:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-21 12:04 [ptxdist] [PATCH] Enable "strip" install option handling for libraries Albert Antony
2015-07-21 13:14 ` Juergen Borleis
2015-07-21 14:03   ` Albert Antony
2015-07-21 14:34     ` Juergen Borleis
2015-07-22  8:31       ` Albert Antony
2015-07-22  9:29         ` Juergen Borleis
2015-07-22 13:28           ` Albert Antony
  -- strict thread matches above, loose matches on Subject: below --
2015-07-21 10:09 Albert Antony
2015-07-21 10:26 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox