Cross Compiler in Cygwin without Cygwin DLL?
Cross Compiler in Cygwin without Cygwin DLL?
I've been searching for a while now for any information on how to build GCC and binutils in Cygwin without linking against the Cygwin DLL. I don't really plan on downloading MinGW and setting up all of that but will if I have to. I've read about a -mno-cygwin option but I've also read it won't work. Any information or links would be greatly appreciated.
I can and have built a cross compiler in cygwin for building ELF files but it is linked against the Cygwin DLL.
Thanks.
I can and have built a cross compiler in cygwin for building ELF files but it is linked against the Cygwin DLL.
Thanks.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Cross Compiler in Cygwin without Cygwin DLL?
Why don't you want it linked against the Cygwin DLL?
Re: Cross Compiler in Cygwin without Cygwin DLL?
I think he's just looking to reduce the dependencies which result in users having to put the cygwin1.dll in the working directory or in the system32 folder. I'm interested in this as well, but fear there is pretty much no alternative since Cygwin stuff needs to be linked in (unless Cygwin can use some sort of static library instead of the dynamic one, which also has its disadvantages).
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
Re: Cross Compiler in Cygwin without Cygwin DLL?
Yes thank you, but that option is mainly for single binaries. Will it work with GCC and Binutils and how would I go about adding that option to the GCC and Binutils compile process? I'm not all that familiar with the ./configure make process.
Can GCC even be compiled unpatched without a POSIX emulation layer below it?
Like Creature said I don't want the Cygwin .dll dependency hanging around. I don't want to have to move the cygwin install around to other computers.pcmattman wrote:Why don't you want it linked against the Cygwin DLL?
Re: Cross Compiler in Cygwin without Cygwin DLL?
Am I understanding you to say that you want to compile GCC/binutils to run as DOS apps in DOS windows?
Re: Cross Compiler in Cygwin without Cygwin DLL?
I want them to run on windows as console programs that don't depend on the Cygwin dlls.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: Cross Compiler in Cygwin without Cygwin DLL?
MinGW+MSYS might be able to compile binutils and GCC.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Cross Compiler in Cygwin without Cygwin DLL?
Yes thank you, but that option is mainly for single binaries. Will it work with GCC and Binutils and how would I go about adding that option to the GCC and Binutils compile process? I'm not all that familiar with the ./configure make process.
Code: Select all
$ export CFLAGS="-mno-cygwin -O2"
$ ./configure <arguments>
Re: Cross Compiler in Cygwin without Cygwin DLL?
I've taken a look at this myself and tried that as well, but it will sadly fail to compile (at least with binutils 2.19.1). The reason is that if you don't use Cygwin, it will automatically try and use MinGW, but MinGW is missing the 'alloca.h' header which binutils apparently has need for. I could also be missing something here, of course but as said before, I think the easiest would be to simply download MinGW/MSYS and do it with that.pcmattman wrote:Yes thank you, but that option is mainly for single binaries. Will it work with GCC and Binutils and how would I go about adding that option to the GCC and Binutils compile process? I'm not all that familiar with the ./configure make process.Code: Select all
$ export CFLAGS="-mno-cygwin -O2" $ ./configure <arguments>
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Cross Compiler in Cygwin without Cygwin DLL?
MinGW lacks the alloca.h header file, instead you should use malloc.h. However, patching up the source may not be your idea of fun. Worst case, create alloca.h (in the standard include directory) and make its only contents "#include <malloc.h>". I can't promise it'll work, but it's worth a shot...