On Sun, Oct 1, 2017 at 5:00 AM, Rick Payne <ri...@rossfell.co.uk> wrote:
> Hi, > > I’m still having to apply this patch to get OSv to work on my Ubuntu 16.10 > box. Without it, the produced image fails to start even for the initial > cpio phase. Its clearly some optimisation issue with gcc 6.2 (gcc version > 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12)), so just in case anyone else is > having a problem, this is what I use to fix it: > Thanks, I missed your original mail on this last year. I now opened an issue about this, with your suggested workaround: https://github.com/cloudius-systems/osv/issues/913 Given the vast number of compiler versions that people use, it's not surprising that once in a while we get a miscompiled and non-working OSv from one of them. Recently I worked around (see commit c38806f49cd2d0610227b62ee7170983684c6987) a bug which caused the round() function to hang in an infinite loop (which also caused the VM to hang while using all the CPU). It would be nice if you could try whether other optimization options (e.g., -O1) are enough to prevent this bug or -O0 is really needed. With some experimentation/printouts/debugging I guess you can also figure out what hangs, but I don't know how difficult it would be. In your original patch (see issue 913) you changed only one source file to be compiled without -O2, but in your latest patch, you changed more source files - was this necessary? In your original patch, you only changed compilation of lzloader.cc; This is a trivial source file, and I don't mind at all to permanently compile this specific file without optimization. However, the newer patch also changes the compilation of the uncompression implementation - this can have effect in boot performance, so if needed to change that too, we would need to measure its effect on boot speed. Thanks, Nadav. > > Cheers, > Rick > > diff --git a/Makefile b/Makefile > index 8372cd8..50fb396 100644 > --- a/Makefile > +++ b/Makefile > @@ -446,11 +446,11 @@ $(out)/arch/x64/boot32.o: $(out)/loader.elf > > $(out)/fastlz/fastlz.o: > $(makedir) > - $(call quiet, $(CXX) $(CXXFLAGS) -O2 -m32 > -fno-instrument-functions -o $@ -c fastlz/fastlz.cc, CXX fastlz/fastlz > .cc) > + $(call quiet, $(CXX) $(CXXFLAGS) -O0 -g -m32 > -fno-instrument-functions -o $@ -c fastlz/fastlz.cc, CXX fastlz/fas > tlz.cc) > > $(out)/fastlz/lz: fastlz/fastlz.cc fastlz/lz.cc | generated-headers > $(makedir) > - $(call quiet, $(CXX) $(CXXFLAGS) -O2 -o $@ $(filter %.cc, $^), CXX > $@) > + $(call quiet, $(CXX) $(CXXFLAGS) -O0 -g -o $@ $(filter %.cc, $^), > CXX $@) > > $(out)/loader-stripped.elf.lz.o: $(out)/loader-stripped.elf > $(out)/fastlz/lz > $(call quiet, $(out)/fastlz/lz $(out)/loader-stripped.elf, LZ > loader-stripped.elf) > @@ -459,7 +459,7 @@ $(out)/loader-stripped.elf.lz.o: > $(out)/loader-stripped.elf $(out)/fastlz/lz > $(out)/fastlz/lzloader.o: fastlz/lzloader.cc | generated-headers > $(makedir) > #$(call quiet, $(CXX) $(CXXFLAGS) -O2 -m32 > -fno-instrument-functions -o $@ -c fastlz/lzloader.cc, CXX $<) > - $(call quiet, $(CXX) $(CXXFLAGS) -g -m32 -fno-instrument-functions > -o $@ -c fastlz/lzloader.cc, CXX $<) > + $(call quiet, $(CXX) $(CXXFLAGS) -O0 -g -m32 > -fno-instrument-functions -o $@ -c fastlz/lzloader.cc, CXX $<) > > $(out)/lzloader.elf: $(out)/loader-stripped.elf.lz.o > $(out)/fastlz/lzloader.o arch/x64/lzloader.ld \ > $(out)/fastlz/fastlz.o > > -- > You received this message because you are subscribed to the Google Groups > "OSv Development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to osv-dev+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.