[lttng-dev] Babeltrace for MINGW32

Ikaheimonen, JP jp_ikaheimonen at mentor.com
Thu Feb 28 02:46:08 EST 2013


Hi,

I am interested in building a statically linked 32-bit Windows executable of babeltrace.
For that purpose, I have taken a shot at building babeltrace 1.0.3 with MinGW.
As for now, I've managed to build the main executable, which is all I'm interested about. Babeltrace-log and the test suite will not build right now.

MinGW is missing many library functions that babeltrace uses. I have written replacements for many of these. The replacement functions are not fully compliant with the original specifications, but they work well enough under babeltrace. This required some changed in the configure.ac file as well, so that my versions of uuid, fmemopen and open_memstream are correctly detected.

Occasionally, I have had to make changes to the babeltrace source code. As an example, MinGW cannot use directory file handles in any meaningful way, so functions such as openat() and dirfd() are out of the question. I have circumvented these problems by using open() instead of openat(). Also, MinGW seems to have a problem using pthread mutexes in a statically linked executable, so I'm just not using the float_mutex at all. I do not think that's a problem for me, as I'm using babeltrace as a single-threaded executable instead of a library.

I have flagged all source code changes with #ifdef __MINGW32__ .

Would these changes be of interest to the babeltrace community? How likely would they be accepted into the main sources?

Thank you,

JP Ikaheimonen
Mentor Graphics Embedded Systems Division
Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.




More information about the lttng-dev mailing list