|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH 2/2] lib/ukboot: move weak main in separate sub-lib
Hello Yuri, I agree with the solution.Maybe it is wise to add an "EXPERIMENTAL" tag around the LTO Config.uk option. Thanks & Regards Sharan On 1/4/19 5:18 PM, Yuri Volchkov wrote: Link Time Optimization does not work well with incremental linking (ld -r), which is heavily used by Unikraft. The ukboot has a weak main() function, which is supposed to be called if no other library/application provided a proper main. However gcc resolves main() to whatever is available while linking the libukboot.ld.o. Which is the weak one. In the upcoming gcc v9 release a better support of incremental link optimization is announced. Which hopefully will fix this issue. But for now, let's fix it with a workaround. Let's create a sublib under the ukboot, containing only the weak main. This way we will leave no chance for the first "ld -r" to link with the wrong main. The next "ld -r" will have all the objects, so it will be able to make correct decision. Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx> --- lib/ukboot/Makefile.uk | 12 ++++++++++++ lib/ukboot/boot.c | 7 ------- lib/ukboot/weak_main.c | 9 +++++++++ 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 lib/ukboot/weak_main.c diff --git a/lib/ukboot/Makefile.uk b/lib/ukboot/Makefile.uk index 2b7f69f..55f205d 100644 --- a/lib/ukboot/Makefile.uk +++ b/lib/ukboot/Makefile.uk @@ -4,3 +4,15 @@ CINCLUDES-$(CONFIG_LIBUKBOOT) += -I$(LIBUKBOOT_BASE)/include CXXINCLUDES-$(CONFIG_LIBUKBOOT) += -I$(LIBUKBOOT_BASE)/includeLIBUKBOOT_SRCS-y += $(LIBUKBOOT_BASE)/boot.c _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |