Thread (2 messages) 2 messages, 2 authors, 2016-06-15

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

flat view

From: Cesar Eduardo Barros <hidden>
Date: 2016-06-15 22:51:22

Possibly related (same subject, not in this thread)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help