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

Re: [PATCH v2] Embed an application manifest on MinGW

From
Cesar Eduardo Barros <cesarb@cesarb.net>
Date
Jun 2, 2011, 22:56 UTC
Message-ID
<4DE8152F.3010903@cesarb.net>
In-Reply-To
<7vfwnsdwqf.fsf@alter.siamese.dyndns.org>
Em 02-06-2011 13:27, Junio C Hamano escreveu:
> Does the output from $WINDRES define any external symbol the rest of the
> code can refer to?  If so, you could throw resource.o into one of the .a
> file and make sure that the symbol is referred to from main(); perhaps the
> definition of main in compat/mingw.h can refer to it.
Unfortunately no:

$ i686-pc-mingw32-nm compat/win32/resource.o 00000000 d .rsrc

The only thing it has is the .rsrc section.

I could perhaps create a dummy C file with a dummy variable, compile it, and use incremental linking (ld -r) to bolt both object files together. I am not sure this hack wouldn't be uglier than the Makefile changes.

Another possibility would be a linker script (like /usr/lib/libc.so on modern distributions). This might be the most elegant option if it works. I will have to take a look on how it works to see if it is a viable alternative.

> If you can do that, you wouldn't need any change to the Makefile other
> than the rule to build compat/win32/resource.o and conditionally add that
> object to LIB_OBJS, perhaps like this (obviously untested as I do not have
> access to windows boxes).

You do not need access to Windows boxes, you can always use Wine ;-) (msysgit even has a script to open a shell under Wine with everything set up).

-- 
Cesar Eduardo Barros
cesarb@cesarb.net
cesar.barros@gmail.com
Previous: Junio C Hamano
Message 4 of 4 in “Embed an application manifest on MinGW”
  1. Embed an application manifest on MinGWCesar Eduardo Barros, Jun 2, 2011
  2. Johannes SchindelinJun 2, 2011
  3. Junio C HamanoJun 2, 2011
  4. Cesar Eduardo BarrosJun 2, 2011

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.