git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re: [PATCH 14/14] MINGW: config.mak.uname: auto-detect MinGW build from compiler

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 9, 2014, 07:04 UTC
Message-ID
<alpine.DEB.1.00.1410090848380.990@s15462909.onlinehome-server.info>
In-Reply-To
<20141009050318.GA17479@seldon>
Hi Marat,
On Thu, 9 Oct 2014, Marat Radchenko wrote:
Show 22 quoted lines
> On Wed, Oct 08, 2014 at 12:26:52PM -0700, Junio C Hamano wrote:
> > Marat Radchenko <marat@slonopotamus.org> writes:
> > 
> > > When crosscompiling, one cannot rely on `uname` from host system.
> > 
> > That may well be true, but is that limited to cross-compiling to
> > mingw?   Would it be generally true for any cross compilation,
> > wouldn't it?
> > 
> > What I am wondering is if it is a better solution to make it easier
> > to allow somebody who is cross compiling to express "Mr.  Makefile,
> > we know better than you and want you to do a MINGW build for us
> > without checking with `uname -?` yourself", i.e.
> > 
> > 	$ make uname_O=MINGW uname_S=MINGW
> > 
> > which would hopefully allow cross-compilation into other
> > environments, not just MINGW.
> 
> So, do you really want this patch to be changed from 5-liner into
> a full-blow system detection rewrite based on `cc -dumpmachine`
> instead of `uname`?

Junio's responsibility as a maintainer is to keep this project afloat for a broader audience than this patch series tries to reach. Keeping that in mind, a patch that fixes a broad issue (in this case, cross-compiling) *just* for one small use case (in this case, cross-compiling for Windows using MinGW) might need a very good argument to convince the maintainer that a broader solution is either not achievable or so much more complicated that it is completely outside of the scope of this patch series.

FWIW this is *exactly* what I pointed out here:
	https://github.com/dscho/git/commit/e31124d4e8ba4e48181306198648cdfe73ff9c30#comments
	Hmm. This is a very narrow solution to the underlying problem.
	Just think about cross-compiling for e.g. MacOSX. The solution
	presented in this commit works for MinGW, only for MinGW, and for
	MinGW alone. The commit message needs to do a much better job to
	make that clear.

And Junio actually pointed out that a broader solution is neither impossible nor complex: Junio hinted at the use of the conditional assignment "FOO ?= bar":

	https://www.gnu.org/software/make/manual/make.html#index-_003f_003d

IMHO it would make tons of sense to replace the := assignments in https://github.com/dscho/git/blob/e31124d4e8ba4e48181306198648cdfe73ff9c30/config.mak.uname#L3-L8 by ?= assignments.

Of course it is very obvious where the idea for the patch we are discussing here comes from: the current config.mak.uname has this:

	ifdef MSVC
		# avoid the MingW and Cygwin configuration sections
		uname_S := Windows
		uname_O := Windows
	endif

This could be cleaned up in the same run: to be assigned *before* the conditional assignments of uname_S. Likewise, the MINGW-specific part should be done by searching for "mingw" in CROSS_COMPILE, also before the block of the uname_* variable assignments.

Ciao, Johannes

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "Git for Windows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Previous: Marat RadchenkoNext: Junio C Hamano
Message 35 of 45 in “MinGW(-W64) compilation”
  1. MinGW(-W64) compilationMarat Radchenko, Oct 8, 2014
  2. 01/14 MINGW: compat/mingw.h: do not attempt to redefine lseek on mingw-w64Marat Radchenko, Oct 8, 2014
  3. Erik Faye-LundOct 9, 2014
  4. 02/14 MSVC: config.mak.uname: drop -D__USE_MINGW_ACCESS from CFLAGSMarat Radchenko, Oct 8, 2014
  5. 03/14 MINGW: compat/mingw.h: drop fork() definitionMarat Radchenko, Oct 8, 2014
  6. 04/14 MINGW: do not fail at redefining pid_t on MinGW-W64Marat Radchenko, Oct 8, 2014
  7. 05/14 MINGW: config.mak.uname: allow using cURL for non-msysGit buildsMarat Radchenko, Oct 8, 2014
  8. 06/14 MINGW: compat/winansi.c: do not redefine CONSOLE_FONT_INFOEXMarat Radchenko, Oct 8, 2014
  9. 07/14 Fix BASIC_LDFLAGS and COMPAT_CFLAGS for 64bit MinGW-w64Marat Radchenko, Oct 8, 2014
  10. Junio C HamanoOct 8, 2014
  11. Johannes SchindelinOct 9, 2014
  12. Ray DonnellyOct 9, 2014
  13. Johannes SchindelinOct 9, 2014
  14. Ray DonnellyOct 9, 2014
  15. Johannes SchindelinOct 10, 2014
  16. Johannes SchindelinOct 10, 2014
  17. Johannes SchindelinOct 11, 2014
  18. Marat RadchenkoOct 14, 2014
  19. 08/14 MINGW: git-compat-util.h: use inttypes.h for printf macrosMarat Radchenko, Oct 8, 2014
  20. Junio C HamanoOct 8, 2014
  21. 09/14 MINGW: config.mak.uname: reorganize MinGW settingsMarat Radchenko, Oct 8, 2014
  22. 10/14 Makefile: introduce CROSS_COMPILE variableMarat Radchenko, Oct 8, 2014
  23. Junio C HamanoOct 8, 2014
  24. 11/14 compat/nedmalloc/malloc.c.h: fix compilation under MinGW-W64Marat Radchenko, Oct 8, 2014
  25. 12/14 Fix pointer -> integer casts on IL32P64 systemsMarat Radchenko, Oct 8, 2014
  26. 13/14 git-compat-util.h: fix integer overflow on IL32P64 systemsMarat Radchenko, Oct 8, 2014
  27. Junio C HamanoOct 8, 2014
  28. Junio C HamanoOct 8, 2014
  29. Marat RadchenkoOct 9, 2014
  30. Junio C HamanoOct 9, 2014
  31. Johannes SchindelinOct 9, 2014
  32. 14/14 MINGW: config.mak.uname: auto-detect MinGW build from compilerMarat Radchenko, Oct 8, 2014
  33. Junio C HamanoOct 8, 2014
  34. Marat RadchenkoOct 9, 2014
  35. Johannes SchindelinOct 9, 2014
  36. Junio C HamanoOct 9, 2014
  37. Johannes SchindelinOct 9, 2014
  38. Marat RadchenkoOct 9, 2014
  39. Junio C HamanoOct 8, 2014
  40. Johannes SchindelinOct 9, 2014
  41. Marat RadchenkoOct 9, 2014
  42. Johannes SchindelinOct 9, 2014
  43. Johannes SchindelinOct 9, 2014
  44. Johannes SchindelinOct 9, 2014
  45. Johannes SchindelinOct 11, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.