public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Remove a CFLAG for one .c file (How to compile only one file in no-thumb mode)
@ 2012-05-28 11:06 Martin Laabs
  2012-05-28 13:16 ` [ECOS] " John Dallaway
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Laabs @ 2012-05-28 11:06 UTC (permalink / raw)
  To: eCos Discuss

Hello,

i have one (inline asm intensive) file in my arm hal package that I do not 
want to convert to thumb mode. (This is IMHO for some i.e. cache 
functionality even impossible.)
Since I have thumb-interwork enabled I wanna compile this file in arm mode 
and the rest of the kernel in thumb mode.
For the whole file I could use the CFLAG_REMOVE functionality from cdl. 
However - I'd like to remove the -mthumb flag only for one file.

I could use the make { ... } function from cdl. But to stay consistent wit 
the rest I would like to use the gcc flags that are configured in the 
configtool. So just make the object with hardcorded flags is one but a 
unattractive option.

So I would like something like this in my cdl file:

{
CFLAGS_REMOVE="-mthumb
compile cstx01_misc.c
}

Do you have an idea how to accomplish this?

Thank you,
  Martin Laabs


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ECOS] Re: Remove a CFLAG for one .c file (How to compile only one file in no-thumb mode)
  2012-05-28 11:06 [ECOS] Remove a CFLAG for one .c file (How to compile only one file in no-thumb mode) Martin Laabs
@ 2012-05-28 13:16 ` John Dallaway
  2012-05-31  9:13   ` Martin Laabs
  0 siblings, 1 reply; 3+ messages in thread
From: John Dallaway @ 2012-05-28 13:16 UTC (permalink / raw)
  To: Martin Laabs; +Cc: eCos Discuss

Hi Martin

Martin Laabs wrote:

> i have one (inline asm intensive) file in my arm hal package that I do
> not want to convert to thumb mode. (This is IMHO for some i.e. cache
> functionality even impossible.)
> Since I have thumb-interwork enabled I wanna compile this file in arm
> mode and the rest of the kernel in thumb mode.
> For the whole file I could use the CFLAG_REMOVE functionality from cdl.
> However - I'd like to remove the -mthumb flag only for one file.
> 
> I could use the make { ... } function from cdl. But to stay consistent
> wit the rest I would like to use the gcc flags that are configured in
> the configtool. So just make the object with hardcorded flags is one but
> a unattractive option.
> 
> So I would like something like this in my cdl file:
> 
> {
> CFLAGS_REMOVE="-mthumb
> compile cstx01_misc.c
> }
> 
> Do you have an idea how to accomplish this?

You should be able to build the file using a CDL make_object rule as
follows (untested):

> make_object {
>   cstx01_misc.o : cstx01_misc.c
>   $(CC) $(INCLUDE_FLAGS) $(filter-out -mthumb, $(ACTUAL_CFLAGS)) -c -o $@ $<
> }

You will need to remove the file from the regular CDL "compile" list.

I hope this helps...

John Dallaway
eCos maintainer
http://www.dallaway.org.uk/john

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] Re: Remove a CFLAG for one .c file (How to compile only one file in no-thumb mode)
  2012-05-28 13:16 ` [ECOS] " John Dallaway
@ 2012-05-31  9:13   ` Martin Laabs
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Laabs @ 2012-05-31  9:13 UTC (permalink / raw)
  To: ecos-discuss

Hello,

thank you for your hint. The real working solution I build out of this is
the following (Just for the archive):


compile       cstx01_misc.c

make_object {
src/cstx01_misco.d: $(REPOSITORY)/$(PACKAGE/src/cstx01_misc.c
$(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(filter-out -mthumb, \
$(ACTUAL_CFLAGS)) -Wp,-MD,$(@:.o.d=.tmp) -o $(dir \
$@)$(OBJECT_PREFIX)_$(notdir $(@:.o.d=.o)) $<
@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.o.d=.tmp) > $@
@rm $(@:.o.d=.tmp)
}

Best regards,
 Martin L.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-31  9:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-28 11:06 [ECOS] Remove a CFLAG for one .c file (How to compile only one file in no-thumb mode) Martin Laabs
2012-05-28 13:16 ` [ECOS] " John Dallaway
2012-05-31  9:13   ` Martin Laabs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).