Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch] fix cross-compile strip support #13998

Open
p5pRT opened this issue Jul 24, 2014 · 7 comments
Open

[patch] fix cross-compile strip support #13998

p5pRT opened this issue Jul 24, 2014 · 7 comments
Labels

Comments

@p5pRT
Copy link

p5pRT commented Jul 24, 2014

Migrated from rt.perl.org#122379 (status was 'open')

Searchable as RT122379$

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2014

From qd1qupwe.hs2@20minutemail.com

hi, subj
if applicable, please, apply my awersome patch :) (small fix Configure and installperl scripts)

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2014

From qd1qupwe.hs2@20minutemail.com

Configure.diff
diff --git a/Configure b/Configure
index 293ef61..868b584 100755
--- a/Configure
+++ b/Configure
@@ -320,6 +320,7 @@ RCSfile=''
 Revision=''
 Source=''
 State=''
+strip=''
 sysroot=''
 _a=''
 _exe=''
@@ -2441,6 +2442,7 @@ nm
 nroff
 perl
 pg
+strip
 test
 uname
 zip
@@ -2857,13 +2859,14 @@ $define|true|[yY]*)
 	    # leave out ld, choosing it is more complex
 	    nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
 	    ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
+	    strip=`$echo $cc|$sed 's/-g[c\+][c\+]/-strip/'`
 	    # We are in a weird spot. Just before us, some values
 	    # were 'saved', to be restored after the hints are
 	    # run.  This means that the changes we made to ar,
-	    # nm and ranlib will get reverted.
+	    # nm, ranlib and strip will get reverted.
 	    # To avoid that, we hijack the saving mechanism and
 	    # have it save our new values.
-	    for file in ar nm ranlib; do
+	    for file in ar nm ranlib strip; do
 		eval xxx=\$$file
 		eval $file=$xxx$_exe
 		eval _$file=$xxx
@@ -23872,6 +23875,7 @@ stdio_ptr='$stdio_ptr'
 stdio_stream_array='$stdio_stream_array'
 strerror_r_proto='$strerror_r_proto'
 strings='$strings'
+strip='$strip'
 submit='$submit'
 subversion='$subversion'
 sysman='$sysman'
diff --git a/installperl b/installperl
index 5acc06a..1ea56cd 100755
--- a/installperl
+++ b/installperl
@@ -820,7 +820,7 @@ sub strip
 		print " " if (@opts);
 		print "$file\n";
 	    }
-	    system("strip", @opts, $file);
+	    system(${Config::Config}{strip}, @opts, $file);
 	} else {
 	    print "# file '$file' skipped\n" if $opts{verbose};
 	}

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2014

From @Tux

On Wed, 23 Jul 2014 18​:19​:37 -0700, John Doe (via RT)
<perlbug-followup@​perl.org> wrote​:

# New Ticket Created by John Doe
# Please include the string​: [perl #122379]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122379 >

hi, subj
if applicable, please, apply my awersome patch :) (small fix Configure and installperl scripts)

I'd like to hear hugmeir's opinion
Looks fine to me. I'd add a comma in the comment's enumeration
and the regen will most likely reorder

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using perl5.00307 .. 5.19 porting perl5 on HP-UX, AIX, and openSUSE
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/
http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2014

From @Hugmeir

On Thu, Jul 24, 2014 at 10​:49 AM, H.Merijn Brand <h.m.brand@​xs4all.nl> wrote​:

On Wed, 23 Jul 2014 18​:19​:37 -0700, John Doe (via RT)
<perlbug-followup@​perl.org> wrote​:

# New Ticket Created by John Doe
# Please include the string​: [perl #122379]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122379 >

hi, subj
if applicable, please, apply my awersome patch :) (small fix Configure and installperl scripts)

I'd like to hear hugmeir's opinion
Looks fine to me. I'd add a comma in the comment's enumeration
and the regen will most likely reorder

Patch looks good to me, but it's missing updating the canned configs
to add strip="strip", just in case.
Also, four super safety, maybe modify installperl to use "strip" as a
default, in case $Config{strip} is somehow empty/undefined?

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2014

From qd1qupwe.hs2@20minutemail.com

On Thu Jul 24 06​:45​:55 2014, Hugmeir wrote​:

Patch looks good to me, but it's missing updating the canned configs
to add strip="strip", just in case.
Also, four super safety, maybe modify installperl to use "strip" as a
default, in case $Config{strip} is somehow empty/undefined?

Second fix

@​@​ -2441,6 +2442,7 @​@​
nm
nroff
perl
pg
+strip
test
uname
zip

add strip to `trylist'. Code block after `trlist' definition try to find utility from `trylist`. If strip utility exists in your system strip var will be set to 'strip'. I think it is good way.

Next fix redefine strip var only in cross-compile mode.

@​@​ -2857,13 +2859,14 @​@​ $define|true|[yY]*)
# leave out ld, choosing it is more complex
nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
strip=`$echo $cc|$sed 's/-g[c\+][c\+]/-strip/'`

In all other cases strip var will be `strip' if strip utility exists in your host system and installperl will call `strip' utility from your $PATH.

@p5pRT
Copy link
Author

p5pRT commented Feb 26, 2017

From @jkeenan

On Thu, 24 Jul 2014 14​:32​:10 GMT, qd1qupwe.hs2@​20minutemail.com wrote​:

On Thu Jul 24 06​:45​:55 2014, Hugmeir wrote​:

Patch looks good to me, but it's missing updating the canned configs
to add strip="strip", just in case.
Also, four super safety, maybe modify installperl to use "strip" as a
default, in case $Config{strip} is somehow empty/undefined?

Second fix

@​@​ -2441,6 +2442,7 @​@​
nm
nroff
perl
pg
+strip
test
uname
zip

add strip to `trylist'. Code block after `trlist' definition try to
find utility from `trylist`. If strip utility exists in your system
strip var will be set to 'strip'. I think it is good way.

Next fix redefine strip var only in cross-compile mode.

@​@​ -2857,13 +2859,14 @​@​ $define|true|[yY]*)
# leave out ld, choosing it is more complex
nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
strip=`$echo $cc|$sed 's/-g[c\+][c\+]/-strip/'`

In all other cases strip var will be `strip' if strip utility exists
in your host system and installperl will call `strip' utility from
your $PATH.

tux, hugmeir​: Can we get an update on the status of this RT?

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants