Tonight I cleaned up my toolchains and dump everything into one kind of integrated package, a porting kit I would say. Formerly it just a small set of MSYS and TDM's GCC, slowly it grew up by adding some tools for packaging/deployment. Recently I even build my own GCC (i686-w64-mingw32 multilib) based on 4.6.2 version due to TDM's GCC multilib have default 64bit target which not so parallel with the spirit of 32-bitness of this blog fu fu fu... so I compile GCC multilib that do the opposite (32-bit by default and optionally targeting 64-bit). Furthermore as with MinGW-W64 get matured but not fully compatible with MinGW32 I made alternate GCC mimicking official MinGW32 which migrated to dwarf2 based exceptions and switch between them as needed.
CompilerPack 0.4d 48.2MB
MD5: ee755f186ce134fc94c27faebac2e56f
MSYS Environment 0.4f 54.1MB
MD5: ee8af39bdbc769aa6b849af1b0984857
Changelog (26 Feb, 2012)
- now installable in a path containing spaces
- junc, gw works with path containing spaces
- new: browse, openw
- added: ipython - fix: sh as default shell not bash, MSYS thene now activated when using msysdev, radare2 lookup path
Changelog (19 Feb, 2012)
- removed excessive gui tools: regshot, winapioverride32, scylla, processhacker
- added: xml2po (for translation), texi2html
- replaced possibly broken: msys xmllint -> mingw static binary, jscore -> rebuild
Changelog (12 Feb, 2012)
- added: wxhexeditor, regshot, winapioverride32, drmemory, scylla, processhacker, jscore, lua, mingw-w64 dwarf-2 (for mingw32 compatibility)
- removed: qemu
- fix: incorrect shebang on bzr,hg, make gdb python support portable, many changes on msys.bat & /etc/profile, make openal autostatic, make tcl/tk static build, missing python26.dll (64bit) for gdb (64bit), autoselect 64bit tools in Windows 64bit, setgcc works with spawn
- update: gdb 7.4 with experimental gdbtui (need to unset TERM first before use), binutils 2.22.52
- gcc rebuild
- put some docs in readme, include patches for gcc, gdb, binutils
- many files have been moved around please delete previous version before install this one
0.4c
Changelog (5 Feb, 2012)
- added: static build bochs (since qemu can't run windows properly), radare2 0.9, postw32 (from freepascal), console2, msysdev, hyperdbg (hdbg), mingw-get (not sure if it usable here, use with caution!), protoc, ldd
- fix: lots of changes in msys.bat loader, pkg-config now run properly outside msys, qemu no longer spit stderror.txt, spawn now works with other shells as it should, wget now look for curl's ca-bundle by default
- new: console2 integration in portable way (spawn -console), msysdev mode (spawn msys), portable singleuser mode
- update: qemu 1.0.50.0git and removed i386 version because x86_64 is the superset of it, mintty, openssl 1.0.0g
- removed: msys-here since I have my own msys-here
I think I will stop updating unless new gcc/clang/msys released I'm quite comfortable with this version
0.4b
Changelog (2 Feb, 2012)
- added: sphinx, chmcmd (chm compiler from freepascal), static build qemu 1.0, fasm, objconv, distorm
- fix: specs80, specs90, junc, spawn
- update: ca-bundle-crt
0.4a
Changelog (26 Jan, 2012)
- added: old version but standalone winmerge 2.4.10 (merge), cpuc
- new: junc (create/view/delete junction), spawn (spawn instance of msys with current directory and environment variables), spawnc, spawnp, spawnw
- some msysgit cleanups and license files update
0.4
Changelog (22 Jan, 2012)
- added: Bazaar, Mercurial, Fossil, nsinstall, ffts (non-GPL FFT from Japan), gmp, mpfr, mpc, qd, intl, zlib, xz, scite (tabbed text editor)
- replaced: msys-xz -> xz, msys-wget -> my wget build
- removed: msys-bsdtar
- experimental: adding msysGIT (some components has been re-build to make it smaller)
- fix: missing pth configurator, make winpthreads autostatic, make TRE a Gnu Regex ABI compatible, restructure directories
- new: msys here (explorer context menu), pkg-config has default search path : [gcc]/mingw/lib/pkgconfig even when PKG_CONFIG_PATH not defined
- updates: intl-tool 0.50.0
0.3.b
CompilerPack 39.1MB
MD5: f50bc0a2f10360425c338ed959529e5f
MSYS Environment 31.6MB
MD5: 99dbd6ef37411260787c1b65b6abc67a
Changelog (15 Jan, 2012)
- added: OpenGL headers from Mesa and khronos, perl module xml::simple, xsltproc, ragel
- replaced: shared lib openAL -> static lib, pthread-w32(mingw-w64) -> winpthreads r4378,
- experimental: enable std::thread for mingw-w64
- updates: mingw-w64 2.0.1
0.3.a
Changelog (30 Dec, 2011)
- added: autostatic GLUT and GLEW libraries, OpenCL and OpenAL libraries
- replaced: GNU Regex with static lib TRE
- now include license information
- minor cleanup and updates
0.3
Changelog
- added: clang 3.0 (preconfigured with mingw-w64, to use it set CC=clang CXX=clang++), tcc, locales and docs
- removed: strawberry perl, wix (can use python to generate msi), pywin32
- enabling localization for gcc and binutils in portable way
- change the way switching gcc that do not block multi session
- added specs templates and experimental auto-manifest for msvcr8 and 9
- rebuild : gcc, cmake (now smaller)
- bundling gcc's dependencies so users can rebuild/update gcc/clang easily
- installation: create hardlinks in post-install
- packages updates: gdb, upx, nasm, yasm, mingw-make
0.2 (68.8MB)
MD5: ec7d3da61672ba14ed409a6e5dc7af08
Changelog (2 Dec,2011)
- cosmetic work to mimick Windows Powershell
- fix: pkgconfig which return CR newline instead of CRLF causing configure to failed
- integration: Windows SDK detection, GrepWin, Notepad2
- fix: invalid PATH insertion
- added pywin32, removed junction.exe
- load default GCC and Perl at startup
Tips for complete noob (to be continued..)
- to install just run the self extracting installer, it will extract to [current folder]\MSYS, once finished run msys.bat (it is portable installation)
- to see compilers and gdb manual use "info" or "man"
- in msys "/" is the [current folder]\MSYS above and all driveletters mounted after "/" e.g "D:" = "/d", therefor "/" also equal to "/[current driveletter]/[path]/MSYS" see details by type "mount"
- to compile a source package usually we "cd"ing (change directory) into the root of source's folder then type "configure" and then "make"
- the recommended way to compile however is to create a "build folder" outside (better one) or inside source folder then from "build folder" type
../[source folder]/configure or ../configure- to cleanup compilation files use
make clean, for total cleanup use make distclean (need re-configure)- to install use
make install which by default goes to /local folder- to change default install location use --prefix="[install folder]" to configure line
- we can pause operations in msys by drawing mouse into console (like when we select area), I often do this when my CPU rang overheated during compile and to continue right click on the console. This also equal to copying the content of selected area.
- to redirect compilation messages into file, we can use the usual ">logs.txt" way
- to force verbose compilation when it was suppressed use
make V=1- there is "cp" -> "copy", "rm" -> "del", "mv" -> "ren", or we can use
alias copy=cp if that bothersome- like most console program we may switch into "DOS" mode by typing cmd, there all environment variables will automatically converted to windows style once we're done type exit.
- path auto-completion only works in unix style e.g /path/path/file
- when unix style path feed to non msys program it will be converted to windows path style albeit with "/" instead of "\" separator
- msys is semi-case-sensitive environment where path and file are case-insensitive and most of the rest including variable name are case-sensitive
- to define global variable e.g compiler flags use
export varname="value"- in windows arguments can be represented as %1 %2 %3... similarly in msys $1 $2 $3... and for %errorlevel% in msys this is most likely $?, too bad no %~[x][varname] expansion there
- unlike windows, most command options are begin with "--" or "-" instead of "/" e.g <code>configure --help
- if we get source snapshot tarball with no configure available use "autogen.sh"
- if source packages do not use autotools (configure), try look for makefile or makefile.gcc file then use
make -f [makefile] to compile. Other possibilities SConstruct (scons), CMakeLists.txt (cmake)- to define compiler's flags while overriding global compiler's flags, feed the configure line e.g
configure CFLAGS="someflags"- to change default libtool's dll naming we may modify soname_spec variable (usually inside libtool file after configure done)
- to build an orphaned library (a library required by only a library) as static lib, use
--enable-static --disable-shared in configure line- when throwing python in compilation inside msys, things will get very ugly: path will be mixed between "\\", "\" and "/" separator and most likely fail the process. The easy fix is to actually edit bundled python's ntpath.py and change with sep="/"
- when compiling 32bit binaries I suggest use mingw32 simply because either some packages may need adjustment for mingw-w64 or mingw-w64 is not too similar to mingw32
- according to mingw project, dwarf2 is the future and it's not recommended to mix between mingw32, mingw-w64, dwarf2 and sjlj even if it's possible, so be warned
- a library usually has .a(static lib) or .dll.a(impor lib) extension, although this is just naming convention gcc will prefer .dll.a (dynamic linking) over .a file by default. More precisely: libfoo.dll.a, foo.dll.a, libfoo.a and at last foo.lib.
- if we get undefined error during linking and we find the missing function in library xyz then we can:
re-configure by append LIBS=-lxyz to configure line or
edit suspected makefile and add -lxyz to LIBS declaration or
issue manual make command with the missing -lxyz
- if we still get undefined error maybe we're linking to incorrect static library? maybe we forgot to define something like -DSTATIC_LIBXYZ? or sort of declspec stuff in the suspected lib
- to generate smallest executable (for .exe only) use
CC="gcc -flto", CFLAGS=-Os and LDFLAGS="-Wl,-s " but lto (gimple) isn't matured yet and you may encountered ICE
Wonderful! You have done some great porting. I must check out your porting kit!
ReplyDeleteAndre
Nice build with a lot of additional libraries.
ReplyDeleteHowever, compared to other builds:
No thread support built in (for c++0x)?
GMP, GMPXX, MPFR, MPC dynamic only?
Isn't c++0x std::threads still experimental?
ReplyDeleteif not I will enable it in 0.3b, thanks for inform me
The reason for GMP, GMPXX, MPFR, MPC being dynamic build is it make compiler executables (cc1.exe and friends) much smaller :D, after all it's just compiler dependencies, unless you mean that your program need them? I only supply them so the users can rebuild the compiler
thanks for trying!
I am not sure about how experimental is std::thread, as I have used boost::thread before (and WinAPI threads before that) and after gcc-4.6.2 was released I have started using std::thread. I haven't used all the features yet but the things I used do work for me.
ReplyDeleteThe reason I was trying your build of compiler, is that the build I use (from code.google.com/p/mingw-builds/downloads/list which has std::thread support) is having problems with long double numbers (i.e. by assigning -1. the value stored in long double variable is -0.).
It is just much easier to learn all that new features of new standard C++11 (which is of course not fully implemented yet) by having everything you need in compiler.
I do actually use GMP, GMPXX, MPFR libraries in calculations as the precision of standard types is simply not enough, but that is not a big problem, as I can copy static libraries from other build and use them in yours as long as the version of the compiler is the same (I do hope :) ).
Thank you for Your input into open source tools popularity.
I have re-read some mailing-list and std::thread is still not supported in mingw/cygwin due to incomplete feature in pthread-win32, personally I have tried gcc from code.google.com/p/mingw-builds but its (patched?) pthread.h cause trouble to some packages (won't even compile)...
ReplyDeletecorrection: it seems not pthread-win32 but winpthreads http://mingw-users.1079350.n2.nabble.com/enable-std-thread-experimental-patch-td6733978.html
ReplyDeleteand the reason why some package failed is pthread_t are different. Anyway it still experimental.
About your usage of gmp and friends, please note that all of them use march=core2 flag
Looks like you are right, it is still experimental...
ReplyDeletemarch=core2 is not a problem as all my multi-threaded applications are executed on multi-core processors. :)
Thank you for clarification of the situation.