Editing the ZDoom source code

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

In this context, "too big" means one megabyte larger than the Visual C++ version. I think it's caused by the lack of support for SEH, because Visual C++ uses that for its exception handling, but GCC has to place a lot of support code to make exceptions work. No, I didn't think to optimize for size, but I can't imagine it shaving an entire megabyte off the final size of the executable.
User avatar
timmie
Posts: 199
Joined: Tue Jul 15, 2003 3:44 pm
Location: Vancouver, BC
Contact:

Post by timmie »

Hirogen2 wrote:Heh. If it's still "too big" -- define big, as the Windows EXE is 1,6MB currently -- you can try using upx :) reduce to some 700KB, even making a test ZIP smaller.
I had tried using upx on zdoomgl before (since the exe is up to 1.73MB now), but it won't run after being compressed. It just gets an error about the self modifying code section. Too bad since it compresses down to 707kB.
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

Why care, it's the Linux version which has a meg more. He who likes ZDoom will go for that one meg (or 1/2 a meg if compressed). Still, this is something interesting.
Randy: Could you compare the sizes of the object files (*.o now), are they (Linux build) all together bigger than the Windows *.obj's ? If not, that'd be strange.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49238
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Chris wrote:
Many things that GCC treats as warnings are compile errors in MSVC.
The -Werror option should be mandatory on anything compiled on GCC. :P

Problem is that GCC also outputs so many warnings that it becomes useless!
User avatar
Chris
Posts: 2978
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

Graf Zahl wrote:Problem is that GCC also outputs so many warnings that it becomes useless!
Warnings are never useless. Fix them one at a time. Should've been more careful about writing the code in the first place. ;P
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Chris wrote:Warnings are never useless. Fix them one at a time. Should've been more careful about writing the code in the first place. ;P
There are certain warnings that arise as the result of perfectly valid commands, and may even be desirable to speed up program execution, etc. That's why they're called "warnings".
User avatar
Chris
Posts: 2978
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Post by Chris »

Fair point, although as a rule of thumb, especially for beginners(not talking 'bout you, Randy), a warning should be treated as an error. This is doubly true if you're gonna use more than one compiler, since it may make your code behave completely different. A warning is warning you about something, meaning there's something "not right", regardless of whether it works or not. Sometimes you can ignore them, sometimes you can get rid of them without affecting the code at all, sometimes not.
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

Chris wrote:Fair point, although as a rule of thumb, especially for beginners(not talking 'bout you, Randy), a warning should be treated as an error. This is doubly true if you're gonna use more than one compiler, since it may make your code behave completely different. A warning is warning you about something, meaning there's something "not right", regardless of whether it works or not. Sometimes you can ignore them, sometimes you can get rid of them without affecting the code at all, sometimes not.
Like comparison between signed and unsigned. Do you (Graf Zahl) think that's useless? It can bread valid parts and turn anything into hell.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49238
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Hirogen2 wrote:
Chris wrote:Fair point, although as a rule of thumb, especially for beginners(not talking 'bout you, Randy), a warning should be treated as an error. This is doubly true if you're gonna use more than one compiler, since it may make your code behave completely different. A warning is warning you about something, meaning there's something "not right", regardless of whether it works or not. Sometimes you can ignore them, sometimes you can get rid of them without affecting the code at all, sometimes not.
Like comparison between signed and unsigned. Do you (Graf Zahl) think that's useless? It can bread valid parts and turn anything into hell.
I think warnings can become useless when there are too many of them. In that case the important stuff can easily get lost. I've seen this happen with a compiler that didn't support redirection of its output into a file so you can imagine what a pain it was to find any error in there because the screen was cluttered with utterly pedantic warnings.
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

Graf Zahl wrote:I think warnings can become useless when there are too many of them. In that case the important stuff can easily get lost. I've seen this happen with a compiler that didn't support redirection of its output into a file so you can imagine what a pain it was to find any error in there because the screen was cluttered with utterly pedantic warnings.
Yeah, a ton of signed warnings really sucks, but hey, that's what the -Wno-signed option is for.
User avatar
IntergalacticWalrus
Posts: 31
Joined: Mon Sep 01, 2003 2:02 pm
Location: E2M2, among the many UAC boxes

Post by IntergalacticWalrus »

Hirogen2 wrote:BTW, Randy, I tried to compile ACC 1.30 for Linux and... it took a loooong time (I hit ^C before). Why? Because -O6 was turned on. Even on AXP2K+. I then re-tried with -O2 and it did. Just a note.
What the hell, -O6 ?? In modern versions of GCC there is no such thing. The highest optimization level is -O3, and then again it's only better than previous levels in rare cases. Personally, I recommend -Os anyway.
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

timmie wrote:
Hirogen2 wrote:Heh. If it's still "too big" -- define big, as the Windows EXE is 1,6MB currently -- you can try using upx :) reduce to some 700KB, even making a test ZIP smaller.
I had tried using upx on zdoomgl before (since the exe is up to 1.73MB now), but it won't run after being compressed. It just gets an error about the self modifying code section. Too bad since it compresses down to 707kB.
Worked for me -- with plain ZDoom (2.0.47i) at least.
Locked

Return to “Editing (Archive)”