[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [PATCH ARM v9 1/3] mini-os: fix compiling with debug=n



Ian Campbell, le Fri 26 Jun 2015 08:22:53 +0100, a écrit :
> On Thu, 2015-06-25 at 18:03 +0100, Anil Madhavapeddy wrote:
> > On 25 Jun 2015, at 16:49, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> > >
> > > On Thu, 2015-06-25 at 14:48 +0100, Thomas Leonard wrote:
> > >> Without -fno-tree-loop-distribute-patterns, gcc -O3 recognises that our
> > >> "memset" is doing a memset operation and tries to make it call the
> > >> standard "memset", creating a loop.
> > >
> > > Isn't this what -nostdlib and such like are for?

-nostdlib only has effect at link time.

-ffreestanding would probably have that effect, but we are actually
hosted really. string.c could however be built with -ffreestanding,
since that part is not "hosted" actually.

> > > In any case if we are to go down this route I think we'd be better off
> > > applying it only to lib/string.c or even better just to the memset
> > > function, if there is a way to do that.
> >
> > I think -nostdlib is distinct from -fno-builtins.  If the issue is
> > convincing GCC to not replace the memset with a builtin one, would
> > -fno-builtin-memset be more appropriate here?

Actually we already have -fno-builtin in minios.mk...

> Ideally the tweak would be applied with the smallest possible scope,
> such that when compiling application code gcc can spot memset
> opportunities and call the "builtin" which is actually the one provided
> by mini-os.

Yes.

> If it's more complicated than
> __attribute__((no-builtin-memset)) on the function then it's probably
> not worth losing too much sleep over though.

This does have the proper scope.  I don't know whether -ffreestanding
does fix the issue at stake.

diff --git a/minios.mk b/minios.mk
index b0d9f71..9958554 100644
--- a/minios.mk
+++ b/minios.mk
@@ -12,6 +12,8 @@ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
 DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
 DEF_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)

+$(OBJ_DIR)/lib/string.o: CFLAGS += -ffreestanding
+
 DEF_ASFLAGS += -D__ASSEMBLY__
 DEF_LDFLAGS +=


Samuel

Attachment: patch
Description: Text document

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.