Editing the ZDoom source code
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.
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.
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.
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.Hirogen2 wrote:Heh. If it's still "too big" -- define big, as the Windows EXE is 1,6MB currently -- you can try using upxreduce to some 700KB, even making a test ZIP smaller.
- 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:
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.
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.
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".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
- Chris
- Posts: 2978
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
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.
- 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:
Like comparison between signed and unsigned. Do you (Graf Zahl) think that's useless? It can bread valid parts and turn anything into hell.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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49238
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
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.Hirogen2 wrote:Like comparison between signed and unsigned. Do you (Graf Zahl) think that's useless? It can bread valid parts and turn anything into hell.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.
- 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:
Yeah, a ton of signed warnings really sucks, but hey, that's what the -Wno-signed option is for.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.
- IntergalacticWalrus
- Posts: 31
- Joined: Mon Sep 01, 2003 2:02 pm
- Location: E2M2, among the many UAC boxes
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.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.
- 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:
Worked for me -- with plain ZDoom (2.0.47i) at least.timmie wrote: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.Hirogen2 wrote:Heh. If it's still "too big" -- define big, as the Windows EXE is 1,6MB currently -- you can try using upxreduce to some 700KB, even making a test ZIP smaller.