[v2] Fix install-strip for cross-compilation

Message ID 20191231184222.34267-1-ssbssa@yahoo.de
State New, archived
Headers

Commit Message

Terekhov, Mikhail via Gdb-patches Dec. 31, 2019, 6:42 p.m. UTC
  The variable INSTALL_PROGRAM_ENV sets up STRIPPROG for the cross-compiler.

If this is not done, the host 'strip' is used, and fails:

/bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
  /gdb/gdb64-git/bin/$transformed_name.exe
strip.exe:C:/gdb/gdb64-git/bin/_inst.33599_: file format not recognized

With this change, it's fine:

STRIPPROG='x86_64-w64-mingw32-strip' \
  /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
  /gdb/gdb64-git/bin/$transformed_name.exe

gdb/ChangeLog:

2019-12-30  Hannes Domani  <ssbssa@yahoo.de>

	* Makefile.in: Use INSTALL_PROGRAM_ENV.

gdb/gdbserver/ChangeLog:

2019-12-30  Hannes Domani  <ssbssa@yahoo.de>

	* Makefile.in: Use INSTALL_PROGRAM_ENV.
---
 gdb/Makefile.in           | 4 ++--
 gdb/gdbserver/Makefile.in | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
  

Comments

Simon Marchi Dec. 31, 2019, 6:50 p.m. UTC | #1
On 2019-12-31 1:42 p.m., Hannes Domani via gdb-patches wrote:
> The variable INSTALL_PROGRAM_ENV sets up STRIPPROG for the cross-compiler.
> 
> If this is not done, the host 'strip' is used, and fails:
> 
> /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
>   /gdb/gdb64-git/bin/$transformed_name.exe
> strip.exe:C:/gdb/gdb64-git/bin/_inst.33599_: file format not recognized
> 
> With this change, it's fine:
> 
> STRIPPROG='x86_64-w64-mingw32-strip' \
>   /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
>   /gdb/gdb64-git/bin/$transformed_name.exe

Thanks for updating the change log, this LGTM.  I believe you don't have write access
to the repo, is that right?  Would you like me to push the patch on your behalf, or
would you like to get a write access (useful if you plan on sending patches regularly)?

Simon
  
Terekhov, Mikhail via Gdb-patches Dec. 31, 2019, 7:05 p.m. UTC | #2
Am Dienstag, 31. Dezember 2019, 19:50:47 MEZ hat Simon Marchi <simark@simark.ca> Folgendes geschrieben:

> On 2019-12-31 1:42 p.m., Hannes Domani via gdb-patches wrote:
>
> > The variable INSTALL_PROGRAM_ENV sets up STRIPPROG for the cross-compiler.
> >
> > If this is not done, the host 'strip' is used, and fails:
> >
> > /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
> >  /gdb/gdb64-git/bin/$transformed_name.exe
> > strip.exe:C:/gdb/gdb64-git/bin/_inst.33599_: file format not recognized
> >
> > With this change, it's fine:
> >
> > STRIPPROG='x86_64-w64-mingw32-strip' \
> >  /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
> >  /gdb/gdb64-git/bin/$transformed_name.exe
>
>
> Thanks for updating the change log, this LGTM.  I believe you don't have write access
> to the repo, is that right?  Would you like me to push the patch on your behalf, or
> would you like to get a write access (useful if you plan on sending patches regularly)?

Yes, I don't have write access, and I do plan to send more patches in the future.

With write access, is there more to it than just push the patch?


Regards
Hannes Domani
  
Simon Marchi Dec. 31, 2019, 8:12 p.m. UTC | #3
On 2019-12-31 2:05 p.m., Hannes Domani via gdb-patches wrote:
>  Am Dienstag, 31. Dezember 2019, 19:50:47 MEZ hat Simon Marchi <simark@simark.ca> Folgendes geschrieben:
> 
>> On 2019-12-31 1:42 p.m., Hannes Domani via gdb-patches wrote:
>>
>>> The variable INSTALL_PROGRAM_ENV sets up STRIPPROG for the cross-compiler.
>>>
>>> If this is not done, the host 'strip' is used, and fails:
>>>
>>> /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
>>>   /gdb/gdb64-git/bin/$transformed_name.exe
>>> strip.exe:C:/gdb/gdb64-git/bin/_inst.33599_: file format not recognized
>>>
>>> With this change, it's fine:
>>>
>>> STRIPPROG='x86_64-w64-mingw32-strip' \
>>>   /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
>>>   /gdb/gdb64-git/bin/$transformed_name.exe
>>
>>
>> Thanks for updating the change log, this LGTM.  I believe you don't have write access
>> to the repo, is that right?  Would you like me to push the patch on your behalf, or
>> would you like to get a write access (useful if you plan on sending patches regularly)?
> 
> Yes, I don't have write access, and I do plan to send more patches in the future.
> 
> With write access, is there more to it than just push the patch?

Ok, if you do not yet have a Sourceware account, please fill this form to get one:

https://sourceware.org/cgi-bin/pdw/ps_form.cgi

You can mention me as your sponsor.  If you already have an account, you need to contact
the Sourceware overseers mailing list so they can adjust the permissions to give you write
access to binutils-gdb.

To push a patch, it's indeed just a matter of pushing the git commit.  However, you need
to insert the ChangeLog entries in the actual ChangeLog files and amend your commit before
pushing.  Also, it's good to triple check that there is only what you intend to push in the
branch you are about to push.

Once you have write access, you can add yourself to the MAINTAINERS file, in the "write after
approval" section and then send a "FYI" patch to this list, that gives you a chance to practice.

I won't push this patch, I'll let you do it once you have your account.

Also, I see that you already have a copyright assignment files with the FSF, that's perfect.

Simon
  
Terekhov, Mikhail via Gdb-patches Jan. 1, 2020, 8:59 p.m. UTC | #4
Am Dienstag, 31. Dezember 2019, 21:12:21 MEZ hat Simon Marchi <simark@simark.ca> Folgendes geschrieben:

> On 2019-12-31 2:05 p.m., Hannes Domani via gdb-patches wrote:
> >  Am Dienstag, 31. Dezember 2019, 19:50:47 MEZ hat Simon Marchi <simark@simark.ca> Folgendes geschrieben:
> >
> >> On 2019-12-31 1:42 p.m., Hannes Domani via gdb-patches wrote:
> >>
> >>> The variable INSTALL_PROGRAM_ENV sets up STRIPPROG for the cross-compiler.
> >>>
> >>> If this is not done, the host 'strip' is used, and fails:
> >>>
> >>> /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
> >>>   /gdb/gdb64-git/bin/$transformed_name.exe
> >>> strip.exe:C:/gdb/gdb64-git/bin/_inst.33599_: file format not recognized
> >>>
> >>> With this change, it's fine:
> >>>
> >>> STRIPPROG='x86_64-w64-mingw32-strip' \
> >>>   /bin/sh /c/src/repos/binutils-gdb.git/install-sh -c -s gdb.exe \
> >>>   /gdb/gdb64-git/bin/$transformed_name.exe
> >>
> >>
> >> Thanks for updating the change log, this LGTM.  I believe you don't have write access
> >> to the repo, is that right?  Would you like me to push the patch on your behalf, or
> >> would you like to get a write access (useful if you plan on sending patches regularly)?
> >
> > Yes, I don't have write access, and I do plan to send more patches in the future.
> >
> > With write access, is there more to it than just push the patch?
>
> Ok, if you do not yet have a Sourceware account, please fill this form to get one:
>
> https://sourceware.org/cgi-bin/pdw/ps_form.cgi
>
> You can mention me as your sponsor.  If you already have an account, you need to contact
> the Sourceware overseers mailing list so they can adjust the permissions to give you write
> access to binutils-gdb.
>
> To push a patch, it's indeed just a matter of pushing the git commit.  However, you need
> to insert the ChangeLog entries in the actual ChangeLog files and amend your commit before
> pushing.  Also, it's good to triple check that there is only what you intend to push in the
> branch you are about to push.
>
> Once you have write access, you can add yourself to the MAINTAINERS file, in the "write after
> approval" section and then send a "FYI" patch to this list, that gives you a chance to practice.
>
> I won't push this patch, I'll let you do it once you have your account.
>
> Also, I see that you already have a copyright assignment files with the FSF, that's perfect.

I've now added myself to the MAINTAINERS file, and committed this patch.


Regards
Hannes Domani
  

Patch

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index fa5c820b91..4a7ff6a454 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1779,7 +1779,7 @@  install-only: $(CONFIG_INSTALL)
 		  true ; \
 		fi ; \
 		$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
-		$(INSTALL_PROGRAM) gdb$(EXEEXT) \
+		$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gdb$(EXEEXT) \
 			$(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
 		$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(includedir)/gdb ; \
 		$(INSTALL_DATA) jit-reader.h $(DESTDIR)$(includedir)/gdb/jit-reader.h
@@ -2517,7 +2517,7 @@  install-gdbtk:
 	  true ; \
 	fi ; \
 	$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \
-	$(INSTALL_PROGRAM) insight$(EXEEXT) \
+	$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) insight$(EXEEXT) \
 		$(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
 	$(SHELL) $(srcdir)/../mkinstalldirs \
 		$(DESTDIR)$(GDBTK_LIBRARY) ; \
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 9e8c213472..bcbcf94c51 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -381,10 +381,10 @@  install-only:
 	if [ x$$n = x ]; then n=gdbserver; else true; fi; \
 	if [ x"$(IPA_DEPFILES)" != x ]; then \
 		$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir); \
-		$(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
+		$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
 	fi; \
 	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
-	$(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
+	$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
 	# Note that we run install and not install-only, as the latter
 	# is not part of GNU standards and in particular not provided
 	# in libiberty.