qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4 0/3]  DTC as submodule
@ 2013-04-04  0:41 Peter Crosthwaite
  2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 1/3] configure: Put cross compile flags in EXTRA_CFLAGS Peter Crosthwaite
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Peter Crosthwaite @ 2013-04-04  0:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Peter Crosthwaite, dantesu, edgar.iglesias

These two patches add and use dtc as a submodule as per the RFC:

http://lists.gnu.org/archive/html/qemu-devel/2013-01/msg05000.html

There is a remaining action item to mandate libfdt for arm/microblaze and PPC
which is left as follow up work for after review of this series.

Also fixed the configure to properly build pixman when cross compiling.

changed since v3:
Rebase against recent configure devls.
changed since v2:
Fixed P1 implementation (PMM review)
Fixed CC/AR/LD quoting issue P3 (PMM review)
Addressed PMM review
changed since v1:
Fixed cross compilation of submodules (new P1)
Fixed passing of ARFLAGS to dtc submake


Peter Crosthwaite (3):
  configure: Put cross compile flags in EXTRA_CFLAGS
  dtc: add submodule
  configure/Make: Build libfdt from submodule DTC

 .gitmodules |    3 +++
 Makefile    |   10 ++++++++++
 configure   |   47 ++++++++++++++++++++++++++++++++++++-----------
 dtc         |    1 +
 4 files changed, 50 insertions(+), 11 deletions(-)
 create mode 160000 dtc

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

* [Qemu-devel] [PATCH v4 1/3] configure: Put cross compile flags in EXTRA_CFLAGS
  2013-04-04  0:41 [Qemu-devel] [PATCH v4 0/3] DTC as submodule Peter Crosthwaite
@ 2013-04-04  0:44 ` Peter Crosthwaite
  2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 2/3] dtc: add submodule Peter Crosthwaite
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Crosthwaite @ 2013-04-04  0:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Peter Crosthwaite, dantesu, edgar.iglesias

The cross compile CFLAGS are needed to properly build pixman (and any other
submodules). Only the EXTRA_CFLAGS set is passed to submodules not QEMU_CFLAGS,
so put the cross compile flags in EXTRA_CFLAGS instead.

Signed-off-by: Peter Crosthwaite peter.crosthwaite@xilinx.com>
---
Changed from v2:
Reverted first hunk to keep early CFLAGS settings (PMM review)
Pretty much a completely different implementation now.

 configure |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index fbea75e..f067c12 100755
--- a/configure
+++ b/configure
@@ -921,33 +921,36 @@ done
 case "$cpu" in
     sparc)
            LDFLAGS="-m32 $LDFLAGS"
-           QEMU_CFLAGS="-m32 -mcpu=ultrasparc $QEMU_CFLAGS"
+           CPU_CFLAGS="-m32 -mcpu=ultrasparc"
            ;;
     sparc64)
            LDFLAGS="-m64 $LDFLAGS"
-           QEMU_CFLAGS="-m64 -mcpu=ultrasparc $QEMU_CFLAGS"
+           CPU_CFLAGS="-m64 -mcpu=ultrasparc"
            ;;
     s390)
-           QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS"
+           CPU_CFLAGS="-m31 -march=z990"
            LDFLAGS="-m31 $LDFLAGS"
            ;;
     s390x)
-           QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS"
+           CPU_CFLAGS="-m64 -march=z990"
            LDFLAGS="-m64 $LDFLAGS"
            ;;
     i386)
-           QEMU_CFLAGS="-m32 $QEMU_CFLAGS"
+           CPU_CFLAGS="-m32"
            LDFLAGS="-m32 $LDFLAGS"
            cc_i386='$(CC) -m32'
            ;;
     x86_64)
-           QEMU_CFLAGS="-m64 $QEMU_CFLAGS"
+           CPU_CFLAGS="-m64"
            LDFLAGS="-m64 $LDFLAGS"
            cc_i386='$(CC) -m32'
            ;;
     # No special flags required for other host CPUs
 esac
 
+QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS"
+EXTRA_CFLAGS="$CPU_CFLAGS $EXTRA_CFLAGS"
+
 default_target_list=""
 
 # these targets are portable
-- 
1.7.0.4

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

* [Qemu-devel] [PATCH v4 2/3] dtc: add submodule
  2013-04-04  0:41 [Qemu-devel] [PATCH v4 0/3] DTC as submodule Peter Crosthwaite
  2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 1/3] configure: Put cross compile flags in EXTRA_CFLAGS Peter Crosthwaite
@ 2013-04-04  0:44 ` Peter Crosthwaite
  2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 3/3] configure/Make: Build libfdt from submodule DTC Peter Crosthwaite
  2013-04-09 17:20 ` [Qemu-devel] [PATCH v4 0/3] DTC as submodule Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Crosthwaite @ 2013-04-04  0:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Peter Crosthwaite, dantesu, edgar.iglesias

Add dtc submodule as a fallback for old distros.
Picking version 1.3.0. as this is the most recently tagged stable version.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 .gitmodules |    3 +++
 dtc         |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
 create mode 160000 dtc

diff --git a/.gitmodules b/.gitmodules
index cfa2af9..b426ea6 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -22,3 +22,6 @@
 [submodule "pixman"]
 	path = pixman
 	url = git://anongit.freedesktop.org/pixman
+[submodule "dtc"]
+	path = dtc
+	url = git://git.qemu.org/dtc.git
diff --git a/dtc b/dtc
new file mode 160000
index 0000000..bc895d6
--- /dev/null
+++ b/dtc
@@ -0,0 +1 @@
+Subproject commit bc895d6d09695d05ceb8b52486ffe861d6cfbdde
-- 
1.7.0.4

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

* [Qemu-devel] [PATCH v4 3/3] configure/Make: Build libfdt from submodule DTC
  2013-04-04  0:41 [Qemu-devel] [PATCH v4 0/3] DTC as submodule Peter Crosthwaite
  2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 1/3] configure: Put cross compile flags in EXTRA_CFLAGS Peter Crosthwaite
  2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 2/3] dtc: add submodule Peter Crosthwaite
@ 2013-04-04  0:44 ` Peter Crosthwaite
  2013-04-09 17:20 ` [Qemu-devel] [PATCH v4 0/3] DTC as submodule Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Crosthwaite @ 2013-04-04  0:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, Peter Crosthwaite, David Holsgrove, dantesu,
	edgar.iglesias

Configure to use the DTC submodule to build libfdt when no system libfdt
is found. Prompt to install the DTC submodule if --enable-fdt is set but
no DTC can be found.

DTC has no out-of-tree build capability, so the configure will symlink
the Makefile and scripts directory in the out of tree build directory
and pass in all the needed DTC arguments to make out of tree build happen.
Ideally we fix the DTC make to support out of tree, but did it this way to
avoid commits to DTC.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---
changed from v3:
Rebased against recent devls.
Fixed some cosmetics.
changed from v2:
Fixed quoting of Make arguments (PMM review)
Fixed comment styling and typos (PMM review)

 Makefile  |   10 ++++++++++
 configure |   32 +++++++++++++++++++++++++++-----
 2 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 80344d9..df53156 100644
--- a/Makefile
+++ b/Makefile
@@ -142,6 +142,15 @@ pixman/Makefile: $(SRC_PATH)/pixman/configure
 $(SRC_PATH)/pixman/configure:
 	(cd $(SRC_PATH)/pixman; autoreconf -v --install)
 
+DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
+DTC_CFLAGS=$(CFLAGS) $(extra_cflags) -I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
+
+subdir-dtc:dtc/libfdt dtc/tests
+	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt,)
+
+dtc/%:
+	mkdir -p $@
+
 $(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
 
 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
@@ -259,6 +268,7 @@ distclean: clean
 	rm -rf $$d || exit 1 ; \
         done
 	if test -f pixman/config.log; then make -C pixman distclean; fi
+	if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
 
 KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
diff --git a/configure b/configure
index f067c12..6549cf3 100755
--- a/configure
+++ b/configure
@@ -2435,17 +2435,35 @@ if test "$fdt" != "no" ; then
 int main(void) { return 0; }
 EOF
   if compile_prog "" "$fdt_libs" ; then
+    # system DTC is good - use it
     fdt=yes
-    libs_softmmu="$libs_softmmu $fdt_libs"
-  else
-    if test "$fdt" = "yes" ; then
-      feature_not_found "fdt"
+  elif test -d ${source_path}/dtc/libfdt ; then
+    # have submodule DTC - use it
+    fdt=yes
+    dtc_internal="yes"
+    mkdir -p dtc
+    if [ "$source_path" != `pwd` ] ; then
+       symlink "$source_path/dtc/Makefile" "dtc/Makefile"
+       symlink "$source_path/dtc/scripts" "dtc/scripts"
     fi
+    fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
+    fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
+  elif test "$fdt" = "yes" ; then
+    # have neither and want - prompt for system/submodule install
+    echo "ERROR: DTC not present. Your options:"
+    echo "  (1) Preferred: Install the DTC devel package"
+    echo "  (2) Fetch the DTC submodule, using:"
+    echo "      git submodule update --init dtc"
+    exit 1
+  else
+    # don't have and don't want
     fdt_libs=
     fdt=no
   fi
 fi
 
+libs_softmmu="$libs_softmmu $fdt_libs"
+
 ##########################################
 # GLX probe, used by milkymist-tmu2
 if test "$glx" != "no" ; then
@@ -3347,7 +3365,7 @@ if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
 fi
 
 # add pixman flags after all config tests are done
-QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags"
+QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags $fdt_cflags"
 libs_softmmu="$libs_softmmu $pixman_libs"
 
 echo "Install prefix    $prefix"
@@ -4402,6 +4420,10 @@ if [ "$pixman" = "internal" ]; then
   echo "config-host.h: subdir-pixman" >> $config_host_mak
 fi
 
+if [ "$dtc_internal" = "yes" ]; then
+  echo "config-host.h: subdir-dtc" >> $config_host_mak
+fi
+
 # build tree in object directory in case the source is not in the current directory
 DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32"
 DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas"
-- 
1.7.0.4

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

* Re: [Qemu-devel] [PATCH v4 0/3] DTC as submodule
  2013-04-04  0:41 [Qemu-devel] [PATCH v4 0/3] DTC as submodule Peter Crosthwaite
                   ` (2 preceding siblings ...)
  2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 3/3] configure/Make: Build libfdt from submodule DTC Peter Crosthwaite
@ 2013-04-09 17:20 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2013-04-09 17:20 UTC (permalink / raw)
  To: Peter Crosthwaite; +Cc: edgar.iglesias, qemu-devel, dantesu

On 4 April 2013 01:41, Peter Crosthwaite <peter.crosthwaite@xilinx.com> wrote:
> These two patches add and use dtc as a submodule as per the RFC:
>
> http://lists.gnu.org/archive/html/qemu-devel/2013-01/msg05000.html
>
> There is a remaining action item to mandate libfdt for arm/microblaze and PPC
> which is left as follow up work for after review of this series.
>
> Also fixed the configure to properly build pixman when cross compiling.

You should probably update the error message in configure
to use the new error_exit function. If you do that then:

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

PS: has your reply-to/threading broken again?

-- PMM

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

end of thread, other threads:[~2013-04-09 17:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04  0:41 [Qemu-devel] [PATCH v4 0/3] DTC as submodule Peter Crosthwaite
2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 1/3] configure: Put cross compile flags in EXTRA_CFLAGS Peter Crosthwaite
2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 2/3] dtc: add submodule Peter Crosthwaite
2013-04-04  0:44 ` [Qemu-devel] [PATCH v4 3/3] configure/Make: Build libfdt from submodule DTC Peter Crosthwaite
2013-04-09 17:20 ` [Qemu-devel] [PATCH v4 0/3] DTC as submodule Peter Maydell

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 NNTP newsgroup(s).