Skip to contentSkip to conversation

compile flags overrides

DISCUSSION Jan Beulich 2 participants 3 messages Dec 7, 2012 – Jan 3, 2013

lore
Share & tools
lore
#0 lore raw

All,

looks like for the tools part of the tree, at least something has been done to that effect (via APPEND_CFLAGS).

I don't see how one is supposed to override (e.g. optimization level, or add to) CFLAGS for the hypervisor part of the build though.

Passing CFLAGS= as make option would suppress all += additions throughout the makefiles, as they're not being done with "override".

Passing CFLAGS through the environment accumulates the additions to the variable as the tree gets recursed through (i.e. at the second recursion level you end up having all flags specified three times). While that might not appear to be a problem, it really is (besides being rather odd in the first place) for the EFI build:
The tool chain capability detection passes $(CFLAGS) with $(CFLAGS-y) stripped off (in particular to suppress the use of "-MMD -MF -$(@F).d", as $@ and $(@F) are not defined in this context), thus leaving - from the upper recursion levels - .xen.d and .built_in.d as stray input files on the command line.

I don't think passing CFLAGS itself through either means is really to be supported (other than someone passing the _full_ set of them, suppressing _everything_ the build scripts do, say for build process debugging purposes). Instead, a separate variable intended for just that purpose ought to be introduced and then appended to CFLAGS. Question of course is whether that ought to be uniform for all subtrees, or separate for each of them.

Opinions, ideas?

Jan

#1 lore raw

Jan Beulich writes ("[Xen-devel] compile flags overrides"):

Quoted 2 lines

I don't see how one is supposed to override (e.g. optimization level, or add to) CFLAGS for the hypervisor part of the build though.

Why not APPEND_CFLAGS=-O0 or whatever ?

Ian.

#2 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Ian Jackson

Jan Beulich writes ("[Xen-devel] compile flags overrides"):

Quoted 2 lines

I don't see how one is supposed to override (e.g. optimization level, or add to) CFLAGS for the hypervisor part of the build though.

Why not APPEND_CFLAGS=-O0 or whatever ?

That would be the natural thing, yes, but it's not implemented, and I can't see any other method either. Hence the question.

Jan