Skip to content

Commit

Permalink
linux-user: Create a hostdep.h for each host architecture
Browse files Browse the repository at this point in the history
In commit 4d330ce a new hostdep.h file was added, with the intent
that host architectures which needed one could provide it, and the
build system would automatically fall back to a generic version if
there was no version for the host architecture. Although this works,
it has a flaw: if a subsequent commit switches an architecture from
"uses generic/hostdep.h" to "uses its own hostdep.h" nothing in the
makefile dependencies notices this and so doing a rebuild without
a manual 'make clean' will fail.

So we drop the idea of having a 'generic' version in favour of
every architecture we support having its own hostdep.h, even if
it doesn't have anything in it. (There are only thirteen of these.)

If the dependency files claim that an object file depends on a
nonexistent file, our dependency system means that make will
rebuild the object file, and regenerate the dependencies in
the process. So moving between trees prior to this commit and
trees after this commit works without requiring a 'make clean'.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
  • Loading branch information
pm215 authored and Riku Voipio committed Jun 26, 2016
1 parent c567902 commit ba45378
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 10 deletions.
5 changes: 1 addition & 4 deletions Makefile.target
Expand Up @@ -108,11 +108,8 @@ obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal128.o

ifdef CONFIG_LINUX_USER

# Note that we only add linux-user/host/$ARCH if it exists, and
# that it must come before linux-user/host/generic in the search path.
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) \
$(patsubst %,-I%,$(wildcard $(SRC_PATH)/linux-user/host/$(ARCH))) \
-I$(SRC_PATH)/linux-user/host/generic \
-I$(SRC_PATH)/linux-user/host/$(ARCH) \
-I$(SRC_PATH)/linux-user

obj-y += linux-user/
Expand Down
@@ -1,6 +1,5 @@
/*
* hostdep.h : fallback generic version of header for things
* which are dependent on the host architecture
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
Expand All @@ -13,8 +12,4 @@
#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

/* This is the fallback header which is only used if the host
* architecture doesn't provide one in linux-user/host/$ARCH.
*/

#endif
15 changes: 15 additions & 0 deletions linux-user/host/arm/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/i386/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/ia64/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/mips/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/ppc/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/ppc64/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/s390/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/s390x/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/sparc/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/sparc64/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif
15 changes: 15 additions & 0 deletions linux-user/host/x32/hostdep.h
@@ -0,0 +1,15 @@
/*
* hostdep.h : things which are dependent on the host architecture
*
* * Written by Peter Maydell <peter.maydell@linaro.org>
*
* Copyright (C) 2016 Linaro Limited
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/

#ifndef QEMU_HOSTDEP_H
#define QEMU_HOSTDEP_H

#endif

0 comments on commit ba45378

Please sign in to comment.