Patchwork [U-Boot,RFC,v2,13/20] sandbox: Add OS dependent layer

login
register
mail settings
Submitter Mike Frysinger
Date Sept. 26, 2011, 5:16 a.m.
Message ID <201109260116.10005.vapier@gentoo.org>
Download mbox | patch
Permalink /patch/116356/
State Not Applicable
Headers show

Comments

Mike Frysinger - Sept. 26, 2011, 5:16 a.m.
On Friday, September 23, 2011 12:22:15 Simon Glass wrote:
>  arch/sandbox/cpu/sandbox/Makefile |    7 ++++-
>  arch/sandbox/cpu/sandbox/os.c     |   49

you don't need to follow the "SoC" convention.  arch/sandbox/cpu/*.c should 
work fine ...

> --- a/arch/sandbox/cpu/sandbox/Makefile
> +++ b/arch/sandbox/cpu/sandbox/Makefile
> 
> +# I want to do this, but it doesn't seem to work
> +CFLAGS_arch/sandbox/cpu/sandbox/os.o += -I/usr/include

seems to work for me ...
CFLAGS_arch/blackfin/lib/board.o = -ffoo

if you edit config.mk like so, does that help you figure out what is wrong ?


> --- /dev/null
> +++ b/arch/sandbox/cpu/sandbox/os.c
> 
> +int os_open(const char *pathname, int flags)
> +{
> +	return open(pathname, flags);
> +}

i guess since u-boot can't really create files, we don't need to support the 
3rd arg (mode) ... what about creating file-backed flash devices on the fly ?
-mike
Simon Glass - Sept. 26, 2011, 9:04 p.m.
Hi Mike,

On Sun, Sep 25, 2011 at 10:16 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Friday, September 23, 2011 12:22:15 Simon Glass wrote:
>>  arch/sandbox/cpu/sandbox/Makefile |    7 ++++-
>>  arch/sandbox/cpu/sandbox/os.c     |   49
>
> you don't need to follow the "SoC" convention.  arch/sandbox/cpu/*.c should
> work fine ...

OK, will do.

>
>> --- a/arch/sandbox/cpu/sandbox/Makefile
>> +++ b/arch/sandbox/cpu/sandbox/Makefile
>>
>> +# I want to do this, but it doesn't seem to work
>> +CFLAGS_arch/sandbox/cpu/sandbox/os.o += -I/usr/include
>
> seems to work for me ...
> CFLAGS_arch/blackfin/lib/board.o = -ffoo

That is not a -I flag, though. If you try -I I think you will get a
failure. Looking a bit closer it is because the dependency stuff uses
CPPFLAGS which doesn't support per file/dir flags.

>
> if you edit config.mk like so, does that help you figure out what is wrong ?
>
> --- a/config.mk
> +++ b/config.mk
> @@ -280,6 +280,8 @@
>  $(obj)%.s:     %.S
>        $(CPP) $(ALL_AFLAGS) -o $@ $<
>  $(obj)%.o:     %.S
> +       echo $(BCURDIR)/$(@F)
> +       echo $(ALL_CFLAGS)
>        $(CC)  $(ALL_AFLAGS) -o $@ $< -c
>  $(obj)%.o:     %.c
>        $(CC)  $(ALL_CFLAGS) -o $@ $< -c
>
>> --- /dev/null
>> +++ b/arch/sandbox/cpu/sandbox/os.c
>>
>> +int os_open(const char *pathname, int flags)
>> +{
>> +     return open(pathname, flags);
>> +}
>
> i guess since u-boot can't really create files, we don't need to support the
> 3rd arg (mode) ... what about creating file-backed flash devices on the fly ?
> -mike
>

Who would ever want that? :-) Even if we do it's not clear that we
want to set the mode, so would prefer to leave this bit for now.

Regards,
Simon

Patch

--- a/config.mk
+++ b/config.mk
@@ -280,6 +280,8 @@ 
 $(obj)%.s:	%.S
 	$(CPP) $(ALL_AFLAGS) -o $@ $<
 $(obj)%.o:	%.S
+	echo $(BCURDIR)/$(@F)
+	echo $(ALL_CFLAGS)
 	$(CC)  $(ALL_AFLAGS) -o $@ $< -c
 $(obj)%.o:	%.c
 	$(CC)  $(ALL_CFLAGS) -o $@ $< -c