%/: FORCE
$(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in.o built_in_bin.o
-build-intermediate = $(eval $(call build-intermediate-closure,$(1)))
-define build-intermediate-closure
-$(1): FORCE
- $(MAKE) -f $(BASEDIR)/Rules.mk -C $$(@D) $$(@F)
-endef
-
-$(foreach base,arch/x86/mm/guest_walk_% \
- arch/x86/mm/hap/guest_walk_%level \
- arch/x86/mm/shadow/guest_%, \
- $(foreach ext,o i s,$(call build-intermediate,$(base).$(ext))))
-
.PHONY: cloc
cloc:
$(eval tmpfile := $(shell mktemp))
# Calculation of flags, first the generic flags, then the arch specific flags,
# and last the flags modified for a target or a directory.
-c_flags = -MMD -MP -MF $(@D)/.$(@F).d $(XEN_CFLAGS) '-D__OBJECT_FILE__="$@"'
+c_flags = -MMD -MP -MF $(@D)/.$(@F).d $(XEN_CFLAGS)
a_flags = -MMD -MP -MF $(@D)/.$(@F).d $(XEN_AFLAGS)
include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
obj-y += p2m.o
obj-$(CONFIG_HVM) += p2m-ept.o p2m-pod.o p2m-pt.o
obj-y += paging.o
-
-guest_walk_%.o: guest_walk.c Makefile
- $(CC) $(c_flags) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
-
-guest_walk_%.i: guest_walk.c Makefile
- $(CPP) $(call cpp_flags,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
-
-guest_walk_%.s: guest_walk.c Makefile
- $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@
* along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
-/* Allow uniquely identifying static symbols in the 3 generated objects. */
-asm(".file \"" __OBJECT_FILE__ "\"");
-
#include <xen/types.h>
#include <xen/mm.h>
#include <xen/paging.h>
--- /dev/null
+#define GUEST_PAGING_LEVELS 2
+#include "guest_walk.c"
--- /dev/null
+#define GUEST_PAGING_LEVELS 3
+#include "guest_walk.c"
--- /dev/null
+#define GUEST_PAGING_LEVELS 4
+#include "guest_walk.c"
obj-y += hap.o
-obj-y += guest_walk_2level.o
-obj-y += guest_walk_3level.o
-obj-y += guest_walk_4level.o
+obj-y += guest_walk_2.o
+obj-y += guest_walk_3.o
+obj-y += guest_walk_4.o
obj-y += nested_hap.o
obj-y += nested_ept.o
-
-guest_walk_%level.o: guest_walk.c Makefile
- $(CC) $(c_flags) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
-
-guest_walk_%level.i: guest_walk.c Makefile
- $(CPP) $(call cpp_flags,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
-
-guest_walk_%level.s: guest_walk.c Makefile
- $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@
* this program; If not, see <http://www.gnu.org/licenses/>.
*/
-/* Allow uniquely identifying static symbols in the 3 generated objects. */
-asm(".file \"" __OBJECT_FILE__ "\"");
-
#include <xen/domain_page.h>
#include <xen/paging.h>
#include <xen/sched.h>
--- /dev/null
+#define GUEST_PAGING_LEVELS 2
+#include "guest_walk.c"
--- /dev/null
+#define GUEST_PAGING_LEVELS 3
+#include "guest_walk.c"
--- /dev/null
+#define GUEST_PAGING_LEVELS 4
+#include "guest_walk.c"
else
obj-y += none.o
endif
-
-guest_%.o: multi.c Makefile
- $(CC) $(c_flags) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
-
-guest_%.i: multi.c Makefile
- $(CPP) $(call cpp_flags,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
-
-guest_%.s: multi.c Makefile
- $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@
--- /dev/null
+#define GUEST_PAGING_LEVELS 2
+#include "multi.c"
--- /dev/null
+#define GUEST_PAGING_LEVELS 3
+#include "multi.c"
--- /dev/null
+#define GUEST_PAGING_LEVELS 4
+#include "multi.c"
* along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
-/* Allow uniquely identifying static symbols in the 3 generated objects. */
-asm(".file \"" __OBJECT_FILE__ "\"");
-
#include <xen/types.h>
#include <xen/mm.h>
#include <xen/trace.h>
{
char str[500], type[20] = "";
char *sym, stype;
- static enum { symbol, single_source, multi_source } last;
static char *filename;
int rc = -1;
*/
input_format == fmt_sysv && !*type && stype == '?' && sym &&
sym[1] && strchr("cSsoh", sym[1]) && !sym[2])) {
- /*
- * gas prior to binutils commit fbdf9406b0 (expected to appear
- * in 2.27) outputs symbol table entries resulting from .file
- * in reverse order. If we get two consecutive file symbols,
- * prefer the first one if that names an object file or has a
- * directory component (to cover multiply compiled files).
- */
- bool multi = strchr(str, '/') || (sym && sym[1] == 'o');
-
- if (multi || last != multi_source) {
- free(filename);
- filename = *str ? strdup(str) : NULL;
- }
- last = multi ? multi_source : single_source;
+ free(filename);
+ filename = *str ? strdup(str) : NULL;
goto skip_tail;
}
- last = symbol;
rc = -1;
sym = str;