glsl-optimizer icon indicating copy to clipboard operation
glsl-optimizer copied to clipboard

Fix cmake build issues and gcc hang

Open neomantra opened this issue 10 years ago • 4 comments

There were both compiler and linker errors using CMake on both Linux and OSX. This changeset fixes them. Compiles, builds, and tests successfully on OSX (cmake and Xcode). Compiles and builds on Linux.

neomantra avatar Mar 18 '15 19:03 neomantra

I also found the problem that was causing #44. All tests pass in release mode on Linux. All these changesets build and test on OSX, but I do get some test failures that I get without this changeset as well.

neomantra avatar Mar 19 '15 07:03 neomantra

Hangs and segfaults can happen all over the place (depending on compiler version and optimization options) because old C tricks in list.h break the assumptions made by modern compilers. So, although basically on the right track, the third commit only fixes one of many symptoms of an underlying problem addressed by #104.

tschw avatar Jul 13 '15 01:07 tschw

@tschw After one of my most epic debugging adventures in many years, I was just orbiting the solution. That change makes so much sense, thank you for it. I will test it out this week.

neomantra avatar Jul 13 '15 14:07 neomantra

Hahaha! Although the patch reads so nice and simple, I too had some fun debugging: When it comes to optimized executables, you have no choice but to strainfully trace the program at assembly level. In my case, the crash actually happened in the second iteration of a loop - one I could step through four times at source level.

tschw avatar Jul 13 '15 16:07 tschw