GameHub icon indicating copy to clipboard operation
GameHub copied to clipboard

Override optimization cflags set by users or build systems

Open friday opened this issue 5 years ago • 5 comments

This overrides optimization CFLAGS set in build system, and possibly user settings.

Hopefully this can avoid #99 / #103 / #112 / #162 at least a bit.

Perhaps @neuromancer could verify this works for him too? I originally used your tip to unset cflags completely, but I think this way is better as a general advice.

friday avatar Jan 12 '19 00:01 friday

That should work. I'll wait for someone else to confirm it's working.

tkashkin avatar Jan 12 '19 10:01 tkashkin

I will test it it, but I'm not sure if I will be able to reproduce the original issue to check that the fix is doing something...

neuromancer avatar Jan 12 '19 17:01 neuromancer

@neuromancer Thanks :) If I run cat /etc/makepkg.conf | grep CFLAGS I get: CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"

Not sure if this is the default in Arch, but I think it is in Antergos (which I'm using).

I think -O0 either turns all the other options off or they are benign in this case.

Also the gamehub-git package was just updated so it unsets CFLAGS, so if you use that as a base, the unset statements should be removed for the test.

friday avatar Jan 12 '19 17:01 friday

I tested all the variations of the CFLAGS (including -O0, -O1 and -O2) only using -O0 works as expected. I feel very uncomfortable disabling all the optimizations in the rest of the compilation just for this issue, but we have no other choice. I think we should merge this until we found the real cause of #99.

neuromancer avatar Jan 20 '19 02:01 neuromancer

Yeah, I agree. Optimally this shouldn't be needed (but the issue is too serious not to do something)

friday avatar Jan 20 '19 07:01 friday