public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* True Static Linking
@ 2002-04-16 21:31 Westley Weimer
  2002-04-16 22:09 ` Sam Edge
  2002-04-17  2:23 ` David Starks-Browning
  0 siblings, 2 replies; 4+ messages in thread
From: Westley Weimer @ 2002-04-16 21:31 UTC (permalink / raw)
  To: cygwin; +Cc: weimer

I am using gcc under cygwin and I would like to ship hello.exe to a friend
who does not have cygwin1.dll on his computer.

	$ gcc -v
	Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
	gcc version 2.95.3-5 (cygwin special)
	$ gcc hello.c -o hello.exe -static

Unfortunately, this does not work because cygwin1.dll is not present on the
target computer. You can simulate the problem as follows:

	$ PATH= ./hello.exe
	[ Windows Error Box:
	    The dynamic link library cygwin1.dll cannot be found in the
	    path C:\WINNT ... ]

I am willing to have "hello.exe" be fairly large, but shipping all of
cygwin1.dll (700K) is not allowed. If this were linux I would pull all of
the .o files out of cygwin1.a (or whatever) and link against a subset of
them manually. I have no idea how to do this under cygwin.

(1) Is there a "-static" switch that statically links in cygwin1.dll?
(2) If not, how else can I solve this problem?

Thanks!

	- Wes


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread
* RE: True Static Linking
@ 2002-04-16 22:43 Robert Collins
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Collins @ 2002-04-16 22:43 UTC (permalink / raw)
  To: Westley Weimer, cygwin; +Cc: weimer



> -----Original Message-----
> From: Westley Weimer [mailto:weimer@EECS.Berkeley.EDU] 
> Sent: Wednesday, April 17, 2002 1:50 PM

> I am willing to have "hello.exe" be fairly large, but 
> shipping all of cygwin1.dll (700K) is not allowed. If this 
> were linux I would pull all of the .o files out of cygwin1.a 
> (or whatever) and link against a subset of them manually. I 
> have no idea how to do this under cygwin.

You can't under linux you would have to ship the vmlinuz file as well -
which is what cygwin1.dll is closest to in this environment.
 

Rob

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-04-17  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-16 21:31 True Static Linking Westley Weimer
2002-04-16 22:09 ` Sam Edge
2002-04-17  2:23 ` David Starks-Browning
2002-04-16 22:43 Robert Collins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).