<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Allegro 5 for Windows - Proposal for release builds</title>
		<link>http://www.allegro.cc/forums/view/604565</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 12 Jul 2010 18:27:55 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello,</p><p>Due to the problems with preparing builds for Windows I had decided to get rid of that. Few days of work bring me to quite satisfying results. I created Code::Blocks project file generator, which allow to quickly setup library with various configurations. There are result binaries:
</p><ul><li><p><a href="http://77.55.66.239/thedmd/ss/allegro-4.9.21-msvc8-bin.7z"><tt>allegro-4.9.21-msvc8-bin.7z</tt></a> - Microsoft Visual C++ 2005</p></li><li><p><a href="http://77.55.66.239/thedmd/ss/allegro-4.9.21-msvc9-bin.7z"><tt>allegro-4.9.21-msvc9-bin.7z</tt></a> - Microsoft Visual C++ 2008</p></li><li><p><a href="http://77.55.66.239/thedmd/ss/allegro-4.9.21-msvc10-bin.7z"><tt>allegro-4.9.21-msvc10-bin.7z</tt></a> - Microsoft Visual C++ 2010</p></li><li><p><a href="http://77.55.66.239/thedmd/ss/allegro-4.9.21-mingw-bin.7z"><tt>allegro-4.9.21-mingw-bin.7z</tt></a> - MinGW GCC 4.4.1 TDM-2</p></li></ul><p>

Visual C++ binaries comes with shared and static libraries compiled with shared or static run-time. This give four different versions at the moment. Next, both debug and release configuration are available. This give eight combinations. Example:
</p><ul><li><p><tt>allegro-4.9.21-mt.dll              - Shared, Static Run-Time, Release</tt></p></li><li><p><tt>allegro-4.9.21-mt-debug.dll        - Shared, Static Run-Time, Debug</tt></p></li><li><p><tt>allegro-4.9.21-md.dll              - Shared, Shared Run-Time, Release</tt></p></li><li><p><tt>allegro-4.9.21-md-debug.dll        - Shared, Shared Run-Time, Debug</tt></p></li><li><p><tt>allegro-4.9.21-static-mt.lib       - Static, Static Run-Time, Release</tt></p></li><li><p><tt>allegro-4.9.21-static-mt-debug.lib - Static, Static Run-Time, Debug</tt></p></li><li><p><tt>allegro-4.9.21-static-md.lib       - Static, Shared Run-Time, Release</tt></p></li><li><p><tt>allegro-4.9.21-static-md-debug.lib - Static, Shared Run-Time, Debug</tt></p></li></ul><p>
Those variations are available for every Allegro plugin. Monolith build is also available (plugins compiled in).</p><p>MinGW binaries do not differentiate between static and shared run-time, so there are only four permutations.</p><p>As an extra static version of all dependencies are also included. While linking to Allegro using static version those have to be available.</p><p>Headers are provided for Allegro and PhysFS. All remaining libraries do not have public interface, so there is no way to use them directly.</p><p>PhysFS header was modified to honor ALLEGRO_STATICLINK definition.<br />This is the only change which affect public interface.</p><p>If may builds will make you happy, I will provide them for every next Allegro release. There is also a slight chance for monolithic builds for other platforms.</p><p>Any critique and comments are welcome.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Sat, 10 Jul 2010 03:20:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sounds good to me. If you want to start making the allegro5.org binaries that would be sweet. I think these are better than what I offer presently. How is compatibility between TDM and official MinGW? The monolith builds are very nice.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 10 Jul 2010 03:26:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>As far as I know TDM is not compatibile with official MinGW GCC binaries due to changes in exception model (at least). I can prepare binaries using any version of GCC. Is there any specific one which is required?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Sat, 10 Jul 2010 05:10:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well I personally prefer the official mingw builds... and I think most people use those still. 4.4 is good, though if you don&#39;t link libstd++ statically it requires an additional dll. 4.2.1 was never an official stable release, but it&#39;s the one I&#39;ve used the most and trust the most other than maybe 4.4. I think 4.4 would be ideal, but the dll requirement might bug some people. It doesn&#39;t bother me, however. There&#39;s 4.5 but last I tried it it didn&#39;t produce correct code... So it&#39;s between 4.4 and 4.2.1 if you ask me. Either one is ok I guess, and they&#39;re compatible.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sat, 10 Jul 2010 05:13:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This is very helpful. Thank you for doing this <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (IonBlade)</author>
		<pubDate>Sat, 10 Jul 2010 07:10:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Are the 2005 and 2008 built with SP1?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Sat, 10 Jul 2010 09:04:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OK. I have following versions of MinGW:<br />3.4.5 (default)<br />4.2.1-sjlj<br />4.4.0<br />4.5.0</p><p>I will setup configuration for those.</p><p>Shoud I use -shared-libgcc, -static-libgcc switches (which I think may be equivalent to /MD, /MT switches for MSVC)?</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/604565/874782#target">Matthew Leverton</a> said:</div><div class="quote"><p>Are the 2005 and 2008 built with SP1?</p></div></div><p>
Yes. I my compilers are up to date.</p><p><b>Edit</b>:<br />New build is available for download. Any comments are welcome.<br /><a href="http://77.55.66.239/thedmd/allegro/allegro-4.9.21-mingw-3.4.5-bin.7z">allegro-4.9.21-mingw-3.4.5-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/allegro-4.9.21-mingw-4.2.1-sjlj-bin.7z">allegro-4.9.21-mingw-4.2.1-sjlj-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/allegro-4.9.21-mingw-4.4.0-bin.7z">allegro-4.9.21-mingw-4.4.0-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/allegro-4.9.21-mingw-4.5.0-bin.7z">allegro-4.9.21-mingw-4.5.0-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/allegro-4.9.21-msvc-10.0-bin.7z">allegro-4.9.21-msvc-10.0-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/allegro-4.9.21-msvc-8.0-bin.7z">allegro-4.9.21-msvc-8.0-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/allegro-4.9.21-msvc-9.0-bin.7z">allegro-4.9.21-msvc-9.0-bin.7z</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Sun, 11 Jul 2010 00:40:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I just tried 4.4, but found I had the problem I described on [AD] a little while back about TLS not working. I don&#39;t recall if it was 4.4 related or not. If it is, I guess it should be built with WANT_DLL_TLS enabled. I&#39;m going to try 4.2.1 now.</p><p>Edit: I have more info. Apparently, MinGW GCC 4.4 doesn&#39;t support thread local storage with __thread. Nothing prior to it does either. With version 4 of gcc they apparently just stopped throwing an error when it is used, which made me think it was actually working. Instead, all threads share the same state. I don&#39;t know about GCC 4.5, it just doesn&#39;t seem to work at all for me. Applications just won&#39;t launch.</p><p>So I think the only thing we can do for now is to use -DWANT_DLL_TLS... I&#39;ve tested it, a while back, and it does work unlike __thread. The downside is, Allegro must be compiled as a DLL for it to work. So that rules out static linking completely unless you use only 1 thread.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sun, 11 Jul 2010 03:00:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Could you post link to discussion about TLS? Reading the TLS code I noticed that GCC 3.x require TLS implementation thought DllMain. For all 4.x everything should work. WANT_DLL_TSL may indeed fix problem for shared Allegro builds, but what with static ones?</p><p>I noticed that Allegro still have issues with finalization. D3D driver crashes if I manually shut down primitives addon before destroying display. At least one primitive have to be drawn on the screen. Without that addon is not entirely initialized.</p><p>MSVC debug builds does not contain debug info, that&#39;s a bug in project setup. It will be fixed in next iteration of builds.</p><p>Edit:<br />I see. I will enable DLL_TSL for 4.4.0 builds.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Sun, 11 Jul 2010 04:08:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This is the discussion I learned about this from:<br /><a href="http://lists.freedesktop.org/archives/pixman/2010-May/000187.html">http://lists.freedesktop.org/archives/pixman/2010-May/000187.html</a></p><p>I know the code is set up to use __thread for MinGW 4+, but it&#39;s wrong, it needs to be fixed. There nothing that can be done for static versions, unfortunately. We didn&#39;t support static builds on 3.4.5, we can&#39;t on 4.4 either (still not sure about 4.5).</p><p>The primitives crash sounds like a legitimate bug. As for drawing one primitive, you are now technically required to call al_init_primitives_addon for things to work.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sun, 11 Jul 2010 04:14:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>To summarize TLS problem:<br /> - 3.4.5 - use DLL, does not have __thread<br /> - 4.2.1 - use __thread<br /> - 4.4.0 - use DLL, __thread do not work<br /> - 4.5.0 - unknown, most likely __thread is still broken</p><p>It this right?</p><p>About primitives. I call init and shutdown for all used addons. Crash occur only for Direct3D at the moment.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Sun, 11 Jul 2010 04:26:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>No, it&#39;s use DLL for ALL versions of MinGW except possibly 4.5.0.</p><p>About your crash, can you post some code, maybe an example?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sun, 11 Jul 2010 04:34:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I see. According to <a href="http://comments.gmane.org/gmane.comp.gnu.mingw.devel/3550">this</a> thread, MinGW 4.5.0 have TLS support. This is also the case for TDM GCC 4.4.* releases.</p><p>I just enable TLS_DLL for all GCC &lt; 4.5.0.</p><p>There is simplest example:
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">int</span> main<span class="k2">(</span><span class="k1">int</span> argc, <span class="k1">const</span> <span class="k1">char</span><span class="k3">*</span> argv<span class="k2">[</span><span class="k2">]</span><span class="k2">)</span>
<span class="k2">{</span>
  al_init<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  ALLEGRO_DISPLAY<span class="k3">*</span> display <span class="k3">=</span> al_create_display<span class="k2">(</span><span class="n">1440</span>, <span class="n">900</span><span class="k2">)</span><span class="k2">;</span>
  al_init_primitives_addon<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  al_draw_line<span class="k2">(</span><span class="n">0</span>, <span class="n">0</span>, <span class="n">100</span>, <span class="n">100</span>, al_map_rgb<span class="k2">(</span><span class="n">255</span>, <span class="n">255</span>, <span class="n">255</span><span class="k2">)</span>, <span class="n">1</span>.<span class="n">0f</span><span class="k2">)</span><span class="k2">;</span>
  al_shutdown_primitives_addon<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  al_destroy_display<span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
  al_uninstall_system<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
  <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Sun, 11 Jul 2010 05:04:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/604565/874913#target">Michał Cichoń</a> said:</div><div class="quote"><p>
I see. According to this [comments.gmane.org] thread, MinGW 4.5.0 have TLS support. This is also the case for TDM GCC 4.4.* releases.</p><p>I just enable TLS_DLL for all GCC &lt; 4.5.0.
</p></div></div><p>

Sounds good.</p><p>I believe the bug your reported is fixed in svn. Could you please verify?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sun, 11 Jul 2010 05:44:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yap, fix works. The crash is no more. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>Which version of build you need for testing? Building everything from ground up takes almost three hours, building specific version take a few minutes.</p><p>I think I will prepare for you monolith builds for all supported GCC version.</p><p>Notice, that even GCC 3.4.5 now have static version of Allegro. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Sun, 11 Jul 2010 12:59:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/604565/874950#target">Michał Cichoń</a> said:</div><div class="quote"><p>Notice, that even GCC 3.4.5 now have static version of Allegro. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p></div></div><p>But do they work properly? AFAIK TLS doesn&#39;t work in most versions of mingw with static libs.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 11 Jul 2010 13:31:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, that&#39;s the problem. The may compile and appear to work, but actually fail when you use multiple threads. As a test, write a program that sets some TLS state, spawn a thread and set the same TLS state in the thread, and check the value in the main thread. It&#39;s likely to have changed.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sun, 11 Jul 2010 18:58:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You have right. TLS doesn&#39;t work at all in static version of Allegro compiled with MinGW &lt; 4.5.0. Sad.<br />Because of that fact I just do not compile those.</p><p>New MinGW binaries are compiling right now. They will be available in next hour.</p><p>Edit:<br />I don&#39;t have to write specific test cases. Creation of display use TLS, so if it is not working, creation will fail with segmentation fault.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Sun, 11 Jul 2010 19:14:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks Michał. I&#39;ll test the 4.2.1 binaries.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sun, 11 Jul 2010 19:16:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Is there something we can do to make TLS work? Since there exists a pthreads for Windows it must be possible to set TLS data (without a DLL).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Sun, 11 Jul 2010 20:02:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Brand new MinGW binaries:<br /><a href="http://77.55.66.239/thedmd/allegro/v2/allegro-4.9.21-mingw-3.4.5-bin.7z">allegro-4.9.21-mingw-3.4.5-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/v2/allegro-4.9.21-mingw-4.2.1-sjlj-bin.7z">allegro-4.9.21-mingw-4.2.1-sjlj-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/v2/allegro-4.9.21-mingw-4.4.0-bin.7z">allegro-4.9.21-mingw-4.4.0-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/v2/allegro-4.9.21-mingw-4.5.0-bin.7z">allegro-4.9.21-mingw-4.5.0-bin.7z</a></p><p>Edit:<br />I&#39;m still uploading those files, please wait a few minutes if link do not work.</p><p>Archives contain only monolithic shared version of Allegro, except 4.5.0. This one have both shared and static version available.</p><p>Trent, if you require any other version, let me know. I&#39;m compiling only parts because GCC is horribly slow under Windows. There is also hot and my CPU don&#39;t like to work in such &quot;extreme&quot; environments. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Elias, I do not know any universal method. I think TLS from WinAPI could be used, with assumption that user create threads trough Allegro API (TLS can be explictly initialized/finalized for thread).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Sun, 11 Jul 2010 20:20:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If the user can only use Allegro threads, it may be possible. I think the issue we had before was that we had no threading api, thus there was no way to clean up TLS data after a user thread exited.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Sun, 11 Jul 2010 21:50:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Good news. Examples working fine for all MinGW builds. A few do not compile: ex_curl, ex_gp2xwiz, ex_iphone, ex_d3d, ex_ogre3d. Fail reason for first three is obvious. ex_d3d complains for missing d3dx9.h, which is not in my SDK. ex_ogre3d fail because I do not have Ogre.</p><p>ex_audio_props crash from unknown reason after creation of window.</p><p>GCC 4.5 did the job. I did not encounter any weird crash. I guess compiled code is fine for Allegro.</p><p>About TLS, I will wait for Elias opinion. I do not have knowledge about design of such Allegro API part.</p><p>Edit:<br />There is most current release, revision 13457.</p><p>All found bugs were removed. Builds now work as expected (at least for me <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />). All comments are welcome.</p><p>Compilation time: 154 minutes, 43 seconds <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p><a href="http://77.55.66.239/thedmd/allegro/v3/allegro-4.9.21-mingw-3.4.5-bin.7z">allegro-4.9.21-mingw-3.4.5-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/v3/allegro-4.9.21-mingw-4.2.1-sjlj-bin.7z">allegro-4.9.21-mingw-4.2.1-sjlj-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/v3/allegro-4.9.21-mingw-4.4.0-bin.7z">allegro-4.9.21-mingw-4.4.0-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/v3/allegro-4.9.21-mingw-4.5.0-bin.7z">allegro-4.9.21-mingw-4.5.0-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/v3/allegro-4.9.21-msvc-10.0-bin.7z">allegro-4.9.21-msvc-10.0-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/v3/allegro-4.9.21-msvc-8.0-bin.7z">allegro-4.9.21-msvc-8.0-bin.7z</a><br /><a href="http://77.55.66.239/thedmd/allegro/v3/allegro-4.9.21-msvc-9.0-bin.7z">
allegro-4.9.21-msvc-9.0-bin.7z</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michał Cichoń)</author>
		<pubDate>Mon, 12 Jul 2010 18:27:55 +0000</pubDate>
	</item>
</rss>
