Page MenuHomeFreeBSD

bhyve: Stop compiling with -O0.
ClosedPublic

Authored by markj on Apr 2 2019, 1:33 AM.
Tags
None
Referenced Files
F164829021: D19787.id55711.diff
Tue, Aug 4, 5:59 AM
F164794678: D19787.id55906.diff
Tue, Aug 4, 2:18 AM
Unknown Object (File)
Mon, Aug 3, 3:10 AM
Unknown Object (File)
Sun, Aug 2, 2:34 PM
Unknown Object (File)
Sat, Aug 1, 5:10 PM
Unknown Object (File)
Mon, Jul 27, 5:43 AM
Unknown Object (File)
Sat, Jul 25, 3:39 AM
Unknown Object (File)
Thu, Jul 23, 2:04 AM
Subscribers

Details

Summary

This appears to be accidental and came in with r243327. The bhyve
executable shrinks by over 30% with this change.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Does this variable get used by default? I saw this here and just ignored it as I thought it would only be invoked if I asked for a DEBUG build from a level above. If we are always adding DEBUG_FLAGS to our compiles perhaps it should be called something else?

This revision is now accepted and ready to land.Apr 2 2019, 1:54 AM

I think we should probably keep this, since by default EDK2 DEBUG builds are built with optimization enabled, which obviously makes debugging via gdb etc. irritating/difficult.
I always have to add -O0 to let me single step through the firmware.

I think we should probably keep this, since by default EDK2 DEBUG builds are built with optimization enabled, which obviously makes debugging via gdb etc. irritating/difficult.
I always have to add -O0 to let me single step through the firmware.

I'm not sure what you mean, and I don't understand the connection between EDK2 and the bhyve build. Are you requesting that we always set -O0, even in release builds? Or do you want to leave this line commented out?

Does this variable get used by default?

Yes, see bsd.prog.mk:

.if defined(DEBUG_FLAGS)                                                                                                                                  
CFLAGS+=${DEBUG_FLAGS}                                                                                                                                    
CXXFLAGS+=${DEBUG_FLAGS}                                                                                                                                  
...
.endif

I'm not sure what you mean, and I don't understand the connection between EDK2 and the bhyve build. Are you requesting that we always set -O0, even in release builds? Or do you want to leave this line commented out?

Sorry, wrong context. I was thinking of the uefi-edk2-bhyve port, which builds EDK2. This is different.

This revision was automatically updated to reflect the committed changes.