This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling Cygwin on Linux


Thanks again,
I managed to get clean cygwin binaries hosted by x86_64-linux using the existing cygwin binaries (w/headers). Additional binaries, libiconv and w32api, needed to be installed into the sysroot directory to get compilation to work. Furthemore, w32api's libs and includes needed to be copied out of their subdirectories into the main include and lib directories. Winsup also had some source problems that I corrected.


~/cygwin-1.5.25-11/winsup/cygwin/winsup.h:276
-extern bool wsock_started;
+extern "C" bool wsock_started;

~/cygwin-1.5.25-11/winsup/cygwin/winsup.h:156
-extern int __api_fatal_exit_val;
+extern "C" int __api_fatal_exit_val;

~/cygwin-1.5.25-11/winsup/cygwin/environ.h:46
-extern char **__cygwin_environ, ***main_environ;
+extern "C" char **__cygwin_environ, ***main_environ;

~/cygwin-1.5.25-11/winsup/cygwin/syscall.cc:3238
Uses goto's which breaks the build with gcc4.3. I rewrote the function to use if statements.


~Robert

Brian Dessent wrote:
Robert Eckhoff wrote:

/*rant
I've been trying to boot strap a cygwin/gcc system for essentially 3 weeks now. I am _frustrated_. I have copied files around, linked directories from gcc into cygwin, linked directories from cygwin into gcc. I have copied include files from various places into other various places. I have flat out removed lines of code that seem to be keeping cygwin from building.
*/rant

Is this supposed to make us want to help you more? You're doing something bizarre and silly and as a consequence you're finding it difficult. I can assure you that many of us cross compile Cygwin on Linux regularly without having to worry about any of this -- in fact there's a fair chance that every Cygwin DLL on every mirror for the last decade or so has been crosscompiled, because it's so much faster, and it just plain works. The difference is that nobody tries to bootstrap from scratch, you first create a working toolchain using existing sysroot files, then you use that to rebuild Cygwin.

config.log says that i686-pc-cygwin-gcc is complaining that crt0.o is
not available. A compiled cygwin is supposed to have crt0.o. Therefore
shouldn't require crt0.o to compile. This is a chicken and the egg
problem. What are the right commands to pass to the cygwin source tree
(configure/make) to compile and install crt0.o, and all other startup
files? As an aside, with all my attempts, newlib seems to always
compile fine, it is winsup that has issues.

I don't understand why you assume that this should work. You need a working compiler that can link executables in order to run the configure tests. In order to link executables you need startup objects, which are part of Cygwin. So, yes, chicken and egg. But Cygwin is quite old and stable, there is no scarcity of binary packages, and there are virtually no adjustable knobs or config variables to tune (unlike, say, linux embedded systems), so the need to bootstrap from nothing is essentially nonexistant unless you just like being pedantic or are feeling masochistic. Certainly we don't support it. For $deity's sake just use a sysroot; the Cygwin binary package conveniently provides everything necessary in one simple wget-able tarball that unpacks to the perfect directory structure. There's even a step by step tutorial on the website. If you want to feel like you built everything yourself you can delete it after the first time and repopulate it with the copy you just built.

You can probably get around the link tests by supplying the cached
answers (ac_cv_*) when invoking configure.  This assumes you know the
correct answers beforehand, as from a previous run.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]