1. Post #41
    iNova's Avatar
    November 2008
    1,045 Posts
    Why did everyone suddenly decide TCC is the best compiler for demos / size optimized executables? It's not!
    Everyone? It's only me using it!
    Everyone else is suggesting me to use other compilers with full size optimization and stuff, but I'm just that retarded and confused that I stick to TCC

  2. Post #42
    Gold Member
    Darwin226's Avatar
    January 2009
    4,158 Posts
    But... but... IT'S TINY!
    Reply With Quote Edit / Delete Reply Croatia Show Events Agree Agree x 1 (list)

  3. Post #43
    iNova's Avatar
    November 2008
    1,045 Posts
    But... but... IT'S TINY!
    I don't know why zeeky said it's probably not meant to optimize size.. that's one of its goals.
    Reply With Quote Edit / Delete Reply Estonia Show Events Dumb Dumb x 1 (list)

  4. Post #44
    Richy19's Avatar
    May 2010
    5,411 Posts
    Why did everyone suddenly decide TCC is the best compiler for demos / size optimized executables? It's not!
    Its the easiest to use tho, I just tried compiling hello world with gcc and the commands -Os -fno-inline -nostdinc -fomit-frame-pointer as told in the WDYNHW thread and it says it cant fint stdio.h
    using -Os only made the exe 19kb while tcc makes it 1.2kb

  5. Post #45
    Gold Member
    ThePuska's Avatar
    October 2005
    3,450 Posts
    If you included -s in that list of commands, or ran strip yourself after gcc, you would notice that the filesize drops significantly. GCC gave me something like 6kb without much work on my part, the same as Visual C++ without any extra work. Replacing Visual C++'s linker with Crinkler dropped the filesize below 1kb.


    edit:

    This without any previous experience with GCC or Visual C++ or even the C language
    Reply With Quote Edit / Delete Reply Finland Show Events Winner Winner x 1 (list)

  6. Post #46
    iNova's Avatar
    November 2008
    1,045 Posts
    Its the easiest to use tho, I just tried compiling hello world with gcc and the commands -Os -fno-inline -nostdinc -fomit-frame-pointer as told in the WDYNHW thread and it says it cant fint stdio.h
    using -Os only made the exe 19kb while tcc makes it 1.2kb
    -nostdinc
    it cant fint stdio.h
    lol

    Edited:

    if you don't get the hint, -nostdinc means no standard library inclusion meaning it's not supposed to find stdio.h with that option.
    Reply With Quote Edit / Delete Reply Estonia Show Events Funny Funny x 6Agree Agree x 1Zing Zing x 1 (list)

  7. Post #47
    Richy19's Avatar
    May 2010
    5,411 Posts
    lol

    Edited:

    if you don't get the hint, -nostdinc means no standard library inclusion meaning it's not supposed to find stdio.h with that option.
    Haha yea i got that, but in that case its a pointles command. Most if not all programs would use the standard library somewhere.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Disagree Disagree x 1Dumb Dumb x 1 (list)

  8. Post #48
    Gold Member
    Darwin226's Avatar
    January 2009
    4,158 Posts
    Which is perfect for this kind of competition isn't it?
    Reply With Quote Edit / Delete Reply Croatia Show Events Agree Agree x 1 (list)

  9. Post #49
    q3k
    Gold Member
    q3k's Avatar
    October 2009
    921 Posts
    Its the easiest to use tho, I just tried compiling hello world with gcc and the commands -Os -fno-inline -nostdinc -fomit-frame-pointer as told in the WDYNHW thread and it says it cant fint stdio.h
    using -Os only made the exe 19kb while tcc makes it 1.2kb
    Code:
    sergeb@megusta ~/src/sizetest $ cat test.c
    #include "stdio.h"
    
    int main(int argc, char **argv)
    {
            printf("Hello I'm %s called with %i arguments.\n", argv[0], argc);
            return 0;
    }
    sergeb@megusta ~/src/sizetest $ gcc test.c -Os -s -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -m32 -o testgcc
    sergeb@megusta ~/src/sizetest $ tcc test.c -o testtcc
    sergeb@megusta ~/src/sizetest $ wc -c testtcc
    3376 testtcc
    sergeb@megusta ~/src/sizetest $ wc -c testgcc
    3212 testgcc
    sergeb@megusta ~/src/sizetest $ ./testtcc
    Hello I'm ./testtcc called with 1 arguments.
    sergeb@megusta ~/src/sizetest $ ./testgcc
    Hello I'm ./testgcc called with 1 arguments.

  10. Post #50
    iNova's Avatar
    November 2008
    1,045 Posts
    Code:
    sergeb@megusta ~/src/sizetest $ cat test.c
    #include "stdio.h"
    
    int main(int argc, char **argv)
    {
            printf("Hello I'm %s called with %i arguments.\n", argv[0], argc);
            return 0;
    }
    sergeb@megusta ~/src/sizetest $ gcc test.c -Os -s -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -m32 -o testgcc
    sergeb@megusta ~/src/sizetest $ tcc test.c -o testtcc
    sergeb@megusta ~/src/sizetest $ wc -c testtcc
    3376 testtcc
    sergeb@megusta ~/src/sizetest $ wc -c testgcc
    3212 testgcc
    sergeb@megusta ~/src/sizetest $ ./testtcc
    Hello I'm ./testtcc called with 1 arguments.
    sergeb@megusta ~/src/sizetest $ ./testgcc
    Hello I'm ./testgcc called with 1 arguments.
    Add a how-to-crinkler on top of that and I'm switching over

  11. Post #51
    q3k
    Gold Member
    q3k's Avatar
    October 2009
    921 Posts
    Add a how-to-crinkler on top of that and I'm switching over
    Crinkler is Windows-only.
    Reply With Quote Edit / Delete Reply Poland Show Events Informative Informative x 1 (list)

  12. Post #52
    Dennab
    February 2011
    732 Posts
    Haha yea i got that, but in that case its a pointles command. Most if not all programs would use the standard library somewhere.
    operating system kernels
    Reply With Quote Edit / Delete Reply Australia Show Events Agree Agree x 5 (list)

  13. Post #53
    Gold Member
    Spoco's Avatar
    February 2005
    348 Posts
    I'm more interested in 64k demos and demos without size limits.

    I'm sure I've posted ASD Lifeforce before in some WAYWO, but here it is anyway, because I love it; especially the music:
    http://www.pouet.net/prod.php?which=31571
    Other demos by ASD are also very nice.

    My personal favorite from last year:
    This is one that you might want to watch on your own hardware, if you've got a high-end graphics card with a lot of memory that is.
    http://www.pouet.net/prod.php?which=55558

    And one of my favorite 64k's:
    If you watch this one on your own PC, beware of false anti-virus positives. I assume it's because the packer it uses has been used to pack malware in the past.
    http://www.pouet.net/prod.php?which=25776
    Reply With Quote Edit / Delete Reply Show Events Artistic Artistic x 2 (list)

  14. Post #54
    Richy19's Avatar
    May 2010
    5,411 Posts
    Crinkler is Windows-only.
    where on windows, unless you mean VC++ only
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Dumb Dumb x 2 (list)

  15. Post #55
    iNova's Avatar
    November 2008
    1,045 Posts
    where on windows, unless you mean VC++ only
    ...
    He's not running windows, not us.
    Reply With Quote Edit / Delete Reply Estonia Show Events Agree Agree x 1 (list)

  16. Post #56
    Richy19's Avatar
    May 2010
    5,411 Posts
    ...
    He's not running windows, not us.
    He might still know how to use it
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Dumb Dumb x 2 (list)

  17. Post #57
    iNova's Avatar
    November 2008
    1,045 Posts
    gcc Demo.c -Os -s -ffunction-sections -fdata-sections
    -fomit-frame-pointer -fno-inline -m32 -lopengl32 -lgdi32 -o demo_gcc

    tcc Demo.c -lopengl32 -lgdi32 -o demo_tcc.exe

    demo_gcc = 11KB
    demo_tcc = 4KB

    Hmm..
    Reply With Quote Edit / Delete Reply Estonia Show Events Agree Agree x 1 (list)

  18. Post #58
    q3k
    Gold Member
    q3k's Avatar
    October 2009
    921 Posts
    gcc Demo.c -Os -s -ffunction-sections -fdata-sections
    -fomit-frame-pointer -fno-inline -m32 -lopengl32 -lgdi32 -o demo_gcc

    tcc Demo.c -lopengl32 -lgdi32 -o demo_tcc.exe

    demo_gcc = 11KB
    demo_tcc = 4KB

    Hmm..
    Blame Cygwin. You're better of using MSVC++ on Windows.
    Reply With Quote Edit / Delete Reply Poland Show Events Agree Agree x 1 (list)

  19. Post #59
    iNova's Avatar
    November 2008
    1,045 Posts
    Blame Cygwin. You're better of using MSVC++ on Windows.
    Cygwin? Where? I'm using Mingw32

  20. Post #60
    q3k
    Gold Member
    q3k's Avatar
    October 2009
    921 Posts
    Cygwin? Where? I'm using Mingw32
    Well, blame mingw then.

  21. Post #61
    deloc's Avatar
    January 2008
    1,148 Posts
    wtf just use vc++

    Edited:

    also, anyone know how i can make a .net assembly as small as possible without compressing it? i'm shoving assemblies into object files to see how crinkler handles them. i took a small winforms app and managed to compress the cil from 9436 to 3972 with metadata intact.

    eventually i want to figure out how to invoke the clr on it.

  22. Post #62
    Dennab
    November 2010
    4,519 Posts
    Everyone with an Amiga had this demo..

    Still do, it was only a floppy provided with my Amiga.

  23. Post #63
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    -nevermind, seems like I shouldn't use the standard library-
    Reply With Quote Edit / Delete Reply Netherlands Show Events Artistic Artistic x 1 (list)

  24. Post #64
    yumi_cheese's Avatar
    February 2011
    166 Posts
    Those are the hottest old school silhouette boobs I have EVER seen!
    Reply With Quote Edit / Delete Reply Australia Show Events Agree Agree x 1 (list)

  25. Post #65
    Gold Member
    Chandler's Avatar
    February 2006
    1,406 Posts
    Finally decided to read this thread. For those of you on Windows trying to get the smallest executable, take a look at this

    It's done in the same spirit as the tiny elf (for Linux and FreeBSD) and the tiny mach-o (For Darwin based operating systems) projects.

    You'll learn a lot, I promise. :)

    Edited:

    You may also find these pdfs interesting.
    (Yes I realize the Mach-O link is to html. just go with it)
    Reply With Quote Edit / Delete Reply United States Show Events Useful Useful x 5 (list)

  26. Post #66
    deloc's Avatar
    January 2008
    1,148 Posts
    Finally decided to read this thread. For those of you on Windows trying to get the smallest executable, take a look at [url=http://www.phreedom.org/solar/code/tinype/]this[/url
    crinkler does all of this for you, along with other pe abuse.
    Reply With Quote Edit / Delete Reply Canada Show Events Agree Agree x 2 (list)

  27. Post #67
    I will huff and puff and FLIP YOUR FUCKING TABLES
    Lyokanthrope's Avatar
    October 2005
    7,189 Posts
    This thread is awesome.
    I love how this shit started with the cracker scene (Razor, Skidrow, etc) and evolved into it's own scene.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 3 (list)

  28. Post #68
    Gold Member
    Metroid48's Avatar
    February 2007
    1,020 Posts
    If anyone's looking for resources on making small demos, iq (from Elevated) has a lot:

    http://www.iquilezles.org/www/
    Reply With Quote Edit / Delete Reply Canada Show Events Useful Useful x 2 (list)

  29. Post #69
    deloc's Avatar
    January 2008
    1,148 Posts
    bumping this thread because within the next couple days i'm going to be working on a 4k intro, which i will hopefully eventually post about.
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Winner Winner x 2 (list)

  30. Post #70
    Gold Member

    March 2005
    3,028 Posts
    If anyone's looking for resources on making small demos, iq (from Elevated) has a lot:

    http://www.iquilezles.org/www/
    Is his use of "what" a valid English dialect somewhere, or does he just have some vendetta against the word "which"?

  31. Post #71
    Gold Member
    Darwin226's Avatar
    January 2009
    4,158 Posts
    It says he's not a native English speaker right there on the first page.
    Reply With Quote Edit / Delete Reply Windows 7 Croatia Show Events Informative Informative x 1 (list)

  32. Post #72
    Gold Member

    March 2005
    3,028 Posts
    Not sure how I missed that.

  33. Post #73
    I wasted a dollar on a stupid title.
    nikomo's Avatar
    September 2007
    17,098 Posts
    Went to Assembly Summer last year, biggest demoscene/lan party in Finland. Going there again this year.

    Demos are nice, but they're even nicer on a big-ass fucking screen that's measured in meters instead of inches.
    (Note: they're not nice on the big screen if you're in the audience trying to fucking sleep).

  34. Post #74
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Informative Informative x 2 (list)

  35. Post #75
    Gold Member
    ThePuska's Avatar
    October 2005
    3,450 Posts
    The Finnish indie game industry and demoscene is small. There's some overlap between the makers of Zen Bondage and Zen Bound.