From: Duft M. <Mar...@sa...> - 2006-10-10 13:23:06
|
Hi! I wrote wgcc with the main intention to get native windows binaries that are plain win32 and have nothing to do anymore with any unix subsystem or something, since this gave lots of problems, especially with debugging. For example try to build wgcc debuggable with gcc and debug with gdb -> it's really impossible ;o) Debugging with visual studio is really cool only when building really native (linking with link.exe) maybe the best woulb be building with gcc and linking with link.exe. If you look at the source code of wgcc it would be not a big problem implementing alternative compiler/linker tasks, since everything is really modular. At the moment i don't have enough time to work on this, but i will take a look at it in the near future, since it sounds promising and desirable to make wgcc able of using the interix tools too. This would make wgcc the most powerfull build tool for interix around (and most configurable one)... I played around with wgcc and ld, and it seems to work for a small hello world.... Really cool would have been beeing able of using msvcrt libc when linking with ld, but there seem to be some restriction, since i can't seem to be able to execute the resulting binary (but link goes ok without even a warning)... As far as i now see, using either ld or gcc forces the use of the interix libc & co. This is for our (company) current situation not really desireable as i allready said, but since wgcc is an open source project i'm willing to spend some time in implementing this anyway - when i got some time ;o) As far as building bash & co. With cl.exe is concerned: be aware of compiler capability differences... For example gcc uses __atribute__(...) and MS uses __declspec(...) which each other don't understand. So the sources will most likely not build. One more thing is, that you would have to first port libtermcap or libncurses or so to cl.exe, which as far as i know would be _really much_ work... Have Fun ;o) Markus -----Original Message----- From: Martin Koeppe [mailto:mk...@gm...]=20 Sent: Tuesday, October 10, 2006 3:02 PM To: Duft Markus Cc: int...@li... Subject: RE: wgcc does not build Hi Markus, On Tue, 10 Oct 2006, Duft Markus wrote: > First: I'm really really glad to get some feedback at last ;o) please=20 > direct your mails to the int...@li...=20 > so the mails get archived... I'll in any case CC you if you don't want > to subscribe. ok, and please cc me. > The last lines are less interesting than the first errors ;o) could=20 > you send me a complete output? How are you building, have you read the > INSTALL file? You could also attach the output from env. Which version > of Interix are you using, and which version of Windows. ok, of course. I only took the last lines of the terminal. Now I tried 2.0.3 too: $ uname -X System =3D Interix Node =3D interix3 Release =3D 3.5 Version =3D SP-8.0.1969.45 Machine =3D x86 Processor =3D Intel_x86_Family15_Model2_Stepping8 HostSystem =3D Windows HostRelease =3D SP4 HostVersion =3D 5.0 build was successful this time, I had some bad libs in CPPFLAGS / LDFLAGS / LIBS, which I cleared now before building. It was my fault. > I did never try to link with wgcc output with ld, why would you like=20 > to do this? If it works, this could really be worth an extension. Does > the resulting binary depend on the microsoft runtime, or the interix=20 > runtime. Can i use the windows api, and more important, can i use the=20 > microsoft debugger (visual studio). This works, at least for a simple hello program. Even in both directions, i.e. within interix: interix$ cc -c hello.c interix$ gcc hello.o The other direction would be: interix$ gcc -c hello.c win32> link.exe (with several options I currently don't have available, but I can search them later) But both gave valid interix (i.e. POSIX CUI) executables. The intension here is to explicitely not use the VC runtime, but the=20 interix runtime and libc and all other libs available there. Therefore=20 the Windows API is not and for me should not be available. I don't=20 know about debugging support, but I read that it would be possible to=20 debug plain POSIX apps with VS. Debugging is not that important for me, as I currently want to build=20 well known apps as bash, gnu make, gnu find etc. with cl.exe, just to=20 verify that it works, and to be able to use cl.exe's warnings in=20 comparison to gcc's warnings, just to possibly get the code more=20 clean. I think it's better when it even works with several compilers. Linking with gcc/ld is necessary for .so libs. > Many questions ;o) maybe you want to try (after wgcc works ;o)) to only > compile with wgcc, and manually link with ld and gather some experience > in this direction.... I will try too! Ok, will try with wgcc, too. Martin |