How is SDL-devel mingw binary built?

Hi folks. I’ve got an environment set up for cross-compiling for Win32 using
mingw32. Everything works great, but I noticed something peculiar. When I
use the cross-configure/cross-make scripts to build SDL itself, I end up
with a 1.7MB SDL.dll – or 1.5 if I carefully disable all the subsystems I’m
not using. Yet the SDL.dll in the binary SDL-devel mingw32 package on the
SDL web site is only 220K – a mere fraction of the size. Both DLLs appear
to work fine. What am I missing?

Thanks much!–
Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

Sounds like the dll has debug info inside… not sure though, I’m not
developing for win…

Matthew Miller wrote:> Hi folks. I’ve got an environment set up for cross-compiling for Win32 using

mingw32. Everything works great, but I noticed something peculiar. When I
use the cross-configure/cross-make scripts to build SDL itself, I end up
with a 1.7MB SDL.dll – or 1.5 if I carefully disable all the subsystems I’m
not using. Yet the SDL.dll in the binary SDL-devel mingw32 package on the
SDL web site is only 220K – a mere fraction of the size. Both DLLs appear
to work fine. What am I missing?

Thanks much!


Alexander Popov
Team Leader RTOS&JVM
ProSyst Bulgaria
s_popov at prosyst.bg
s_popov at prosyst.com
mobile: +35987663193
icq: 29207350

Very likely. Try compiling in Release mode

Pedro Remedios
Hail Storm Studios> ----- Original Message -----

From: s_popov@prosyst.bg (Alexander Popov)
To:
Sent: Thursday, May 09, 2002 5:06 PM
Subject: Re: [SDL] how is SDL-devel mingw binary built?

Sounds like the dll has debug info inside… not sure though, I’m not
developing for win…

Matthew Miller wrote:

Hi folks. I’ve got an environment set up for cross-compiling for Win32
using

mingw32. Everything works great, but I noticed something peculiar. When
I

use the cross-configure/cross-make scripts to build SDL itself, I end up
with a 1.7MB SDL.dll – or 1.5 if I carefully disable all the subsystems
I’m

not using. Yet the SDL.dll in the binary SDL-devel mingw32 package on
the

SDL web site is only 220K – a mere fraction of the size. Both DLLs
appear

to work fine. What am I missing?

Thanks much!


Alexander Popov
Team Leader RTOS&JVM
ProSyst Bulgaria
s_popov at prosyst.bg
s_popov at prosyst.com
mobile: +35987663193
icq: 29207350


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Which is done how?On Thu, May 09, 2002 at 03:15:37PM +0100, Pedro Remedios wrote:

Very likely. Try compiling in Release mode


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

Hmm. I gave the --disable-debug flag to cross-configure – makes no
difference.On Thu, May 09, 2002 at 05:06:11PM +0100, Alexander Popov wrote:

Sounds like the dll has debug info inside… not sure though, I’m not
developing for win…


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

Hi folks. I’ve got an environment set up for cross-compiling for Win32 using
mingw32. Everything works great, but I noticed something peculiar. When I
use the cross-configure/cross-make scripts to build SDL itself, I end up
with a 1.7MB SDL.dll – or 1.5 if I carefully disable all the subsystems I’m
not using. Yet the SDL.dll in the binary SDL-devel mingw32 package on the
SDL web site is only 220K – a mere fraction of the size. Both DLLs appear
to work fine. What am I missing?

Try stripping the DLL (‘strip’ command, or
i-whatever-is-your-arch-strip). This will remove debugging symbols,
although I’m not sure whether DLLs like being stripped - be sure to
check it after.

Alex.–
http://www.gnurou.org

Try stripping the DLL (‘strip’ command, or
i-whatever-is-your-arch-strip). This will remove debugging symbols,
although I’m not sure whether DLLs like being stripped - be sure to
check it after.

DLL’s which have been stripped don’t work on some versions of Windows.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Yeah, this was one of the first things I tried, and yeah, didn’t work on
Win98.On Thu, May 09, 2002 at 07:56:04AM -0700, Sam Lantinga wrote:

i-whatever-is-your-arch-strip). This will remove debugging symbols,
although I’m not sure whether DLLs like being stripped - be sure to
check it after.
DLL’s which have been stripped don’t work on some versions of Windows.


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

So anyway, given this doesn’t work, and I assume that you’re the one who
built the binary on the SDL site, what did you do to get it so small?On Thu, May 09, 2002 at 07:56:04AM -0700, Sam Lantinga wrote:

DLL’s which have been stripped don’t work on some versions of Windows.


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

I used Visual C++, which keeps debugging information in a separate file. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment> On Thu, May 09, 2002 at 07:56:04AM -0700, Sam Lantinga wrote:

DLL’s which have been stripped don’t work on some versions of Windows.

So anyway, given this doesn’t work, and I assume that you’re the one who
built the binary on the SDL site, what did you do to get it so small?

At 11:58 5/9/2002 -0400, you wrote:>On Thu, May 09, 2002 at 07:56:04AM -0700, Sam Lantinga wrote:

DLL’s which have been stripped don’t work on some versions of Windows.

So anyway, given this doesn’t work, and I assume that you’re the one who
built the binary on the SDL site, what did you do to get it so small?

Depends on your compiler, build options (don’t build a debug version)
and don’t forget to use an exe/dll packer. I personally prefer
aspack(.com) but it’s not freeware, most prefer upx (upx.sourceforge.net)

Regards,
Dimitri

Ah, I see. Anyone know if this is possible at all with mingw32? I’m not
finding anything via google.On Thu, May 09, 2002 at 09:04:03AM -0700, Sam Lantinga wrote:

I used Visual C++, which keeps debugging information in a separate file. :slight_smile:


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

  • Matthew Miller on Thu, May 09, 2002:

Hmm. I gave the --disable-debug flag to cross-configure – makes no
difference.

Try adding -s to your CFLAGS when configuring:

$ CFLAGS="-s" ./configure …

or

$ make CFLAGS="$(CFLAGS) -s"

I’m not so sure that the make command will work. This should hopefully
strip all object files when they’re first compiled, so the final link
should only happen with stripped objects. In general you can also use
LDFLAGS="-s", and that shouldn’t have any effect on the resultant .DLL (it
doesn’t in other libtool-enabled projects). Using LDFLAGS will just make
sure that all of your executables are stripped.

M. R.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020509/c7f4d463/attachment.pgp

Ahh, very nice. Still 50% bigger than the version on the sdl site, but hey,
that’s better than 800%. A few hundred K I don’t care so much about – a meg
and a half is a different story!

Haven’t actually tested it yet… that’ll havta wait until I get home. But
looks promising – thanks!On Thu, May 09, 2002 at 12:19:27PM -0500, M. R. Brown wrote:

Try adding -s to your CFLAGS when configuring:


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

  • Matthew Miller on Thu, May 09, 2002:

Hmm. I gave the --disable-debug flag to cross-configure – makes no
difference.

Try adding -s to your CFLAGS when configuring:

$ CFLAGS="-s" ./configure …

or

$ make CFLAGS="$(CFLAGS) -s"

I’m not so sure that the make command will work. This should hopefully
strip all object files when they’re first compiled, so the final link
should only happen with stripped objects. In general you can also use
LDFLAGS="-s", and that shouldn’t have any effect on the resultant .DLL (it
doesn’t in other libtool-enabled projects). Using LDFLAGS will just make
sure that all of your executables are stripped.

Again, don’t do anything that strips the DLL, or it won’t work on some
versions of Win98.

Is there any particular reason you need to rebuild the SDL DLL?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Again, don’t do anything that strips the DLL, or it won’t work on some
versions of Win98.

Ah, drat. I was hoping that doing it this way would somehow sidestep that
problem. Oh well.

Is there any particular reason you need to rebuild the SDL DLL?

I like the entire project to be buildable with a free software toolchain. I
guess it doesn’t really matter so much for the win32 version – someone
can rebuild it with mingw32; just not as nicely.

I also want to build SDL_mixer and SDL_image (and maybe SDL_net), and I’d
like those to be as small as possible. You don’t have mingw32 binary
tarballs of those on their web pages – can I just pull the DLLs out of the
VC6 zips?On Thu, May 09, 2002 at 10:41:20AM -0700, Sam Lantinga wrote:


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

And by “the project”, I mean “my project”. I’m glad you’ve chosen to make
yours available under a free license, but you can do whatever you want. :)On Thu, May 09, 2002 at 02:00:13PM -0400, Matthew Miller wrote:

I like the entire project to be buildable with a free software toolchain. I


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

  • Matthew Miller on Thu, May 09, 2002:> On Thu, May 09, 2002 at 10:41:20AM -0700, Sam Lantinga wrote:

Again, don’t do anything that strips the DLL, or it won’t work on some
versions of Win98.

Ah, drat. I was hoping that doing it this way would somehow sidestep that
problem. Oh well.

Note that adding -s to the gcc commandline does not inhibit the final
DLL in any way. When you use “gcc -s -c myfile.c -o myfile.o”, only myfile.o
is stripped, it has nothing to do with the entire linking step that creates
the DLL. It’s when you run strip or use ld -s on the DLL linking step
that you run into issues.

I guess we’ll wait for you to test it out :), but it should work fine.

M. R.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020509/9e5c3f91/attachment.pgp

Note that adding -s to the gcc commandline does not inhibit the final
DLL in any way. When you use “gcc -s -c myfile.c -o myfile.o”, only myfile.o
is stripped, it has nothing to do with the entire linking step that creates
the DLL. It’s when you run strip or use ld -s on the DLL linking step
that you run into issues.

That’s correct. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I also want to build SDL_mixer and SDL_image (and maybe SDL_net), and I’d
like those to be as small as possible. You don’t have mingw32 binary
tarballs of those on their web pages – can I just pull the DLLs out of the
VC6 zips?

Yes, you can.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment