public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery
@ 2014-01-16 17:53 Luke A. Guest
  2014-01-16 18:13 ` Rolf Ebert
  2014-02-14 12:20 ` Brian Drummond
  0 siblings, 2 replies; 8+ messages in thread
From: Luke A. Guest @ 2014-01-16 17:53 UTC (permalink / raw)
  To: GCC ML

Hi,

I've been over this before and have got nowhere with it. As I've just
retried building the latest sources after a long break I'd thought I'd
add some further comment in the hope that someone somewhere cares enough
to fix this issue; this is over my head at this time.

Say you want to build an Ada compiler for embedded work, small
SBC/micro's/osdev/whatever, you will want to set target to <arch>-elf or
similar. You can do this, to a point. You can configure the build as:

../../../source/gcc-git-ro/configure --prefix=/home/laguest/opt/tinyada
--target=arm-none-eabi --enable-interwork --enable-multilib
--without-headers --disable-nls --disable-shared --disable-threads
--disable-lto --with-gnu-as --with-gnu-ld --enable-languages=c,ada
--disable-libssp --disable-cloog-version-check
--disable-isl-version-check --with-gmp=/home/laguest/opt/tinyada
--with-mpfr=/home/laguest/opt/tinyada
--with-mpc=/home/laguest/opt/tinyada
--with-isl=/home/laguest/opt/tinyada
--with-cloog=/home/laguest/opt/tinyada

You can build it with "make all-gcc" and install with "make install-gcc"
and you get a gnat1 and <target>-gnatbind, this is fine, you can use the
system tools, gnatmake, etc. along with these tools - I have done this
before.

But what about the gnattools? Not buildable. A message in the ml
archives states to build them with "make -C gcc gnattools," but this
fails:

make: Entering directory
`/home/laguest/src/mine/tinyada-new/build/arm-none-eabi/gcc2-built-with-git-ro/gcc'
make -C ada CC="gcc" CXX="g++" "ADA_CFLAGS=" "BISON=bison" "BISONFLAGS="
"CFLAGS=-g " "LDFLAGS=-static-libstdc++ -static-libgcc " "FLEX=flex"
"FLEXFLAGS=" "LN=ln" "LN_S=ln -s" "MAKEINFO=makeinfo
--split-size=5000000" "MAKEINFOFLAGS=--no-split" "MAKEOVERRIDES="
"SHELL=/bin/sh" "exeext=" "build_exeext=" "objext=.o"
"exec_prefix=/home/laguest/opt/tinyada"
"prefix=/home/laguest/opt/tinyada" "local_prefix=/usr/local"
"gxx_include_dir=/home/laguest/opt/tinyada/lib/gcc/arm-none-eabi/4.9.0/../../../../arm-none-eabi/include/c++/4.9.0" "build_tooldir=/home/laguest/opt/tinyada/arm-none-eabi" "gcc_tooldir=/home/laguest/opt/tinyada/lib/gcc/arm-none-eabi/4.9.0/../../../../arm-none-eabi" "bindir=/home/laguest/opt/tinyada/bin" "libexecsubdir=/home/laguest/opt/tinyada/libexec/gcc/arm-none-eabi/4.9.0" "datarootdir=/home/laguest/opt/tinyada/share" "datadir=/home/laguest/opt/tinyada/share" "localedir=/home/laguest/opt/tinyada/share/locale" "ADA_FOR_BUILD=" "ADA_INCLUDE_DIR=/home/laguest/opt/tinyada/lib/gcc/arm-none-eabi/4.9.0/adainclude" "ADA_RTL_OBJ_DIR=/home/laguest/opt/tinyada/lib/gcc/arm-none-eabi/4.9.0/adalib" "ADAFLAGS=-gnatpg -gnatwns -W -Wall" "ADA_FOR_TARGET=" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" ADA_INCLUDES="-I/home/laguest/opt/tinyada/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/adalib/../adainclude -I/home/laguest/opt/tinyada/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/adalib/" GNATMAKE="gnatmake" GNATBIND="gnatbind" GNATLINK="gnatlink" LIBGNAT="" gnattools1
make[1]: Entering directory
`/home/laguest/src/mine/tinyada-new/build/arm-none-eabi/gcc2-built-with-git-ro/gcc/ada'
touch ../stamp-tools
You must first build the GNAT library: make gnatlib
make[1]: *** [../stamp-gnatlib-rts] Error 1
make[1]: Leaving directory
`/home/laguest/src/mine/tinyada-new/build/arm-none-eabi/gcc2-built-with-git-ro/gcc/ada'
make: *** [gnattools] Error 2
make: Leaving directory
`/home/laguest/src/mine/tinyada-new/build/arm-none-eabi/gcc2-built-with-git-ro/gcc'

You can't disable libada using the command line as that also disables
gnattools - I don't know the reason for requiring this behaviour.

So there are 3 ways to get this work:

1) Do what AVR-Ada (and MSP430 as they use the same patch) to knock out
the dependency of libada on gnattools, from configure:

if test "${ENABLE_LIBADA}" != "yes" ; then
  noconfigdirs="$noconfigdirs"
fi

This then breaks normal builds, i.e. hosted, so you can use the same
sources reliably to build a new host compiler and the cross compiler(s).

2) Do as shown above to get gnat1 and <target>-gnatbind and use these
through the host's system tools.

3) Patch the source up to build a custom and pointless RTS that will
just take up disk space and never get used as the user will be
implementing their own. Currently, I'm getting a bug box on my patches
for arm-none-eabi.

Given that the C compiler can be build for a freestanding environment,
as can the C++ compiler and I'm betting some of the others can too, I
can't see why the Ada compiler can't as it is supported, at least in the
source, just not in the build infrastructure.

The following (or similar) will need to be added to gnattools/configure
to enable this kind of build (under the "Per-target case statement"):

  *-*-elf* | *-*-eabi*)
    TOOLS_TARGET_PAIRS="\
    mlib-tgt-specific.adb<mlib-tgt-specific-xi.adb"
    ;;

Also, the above is still in the main makefile as well which causes a lot
of confusion and should be removed from there.

I am aware that "freestanding" is actually a C standard term and not
applicable to Ada, but this is figurative only. GNAT's equivalent term
is Zero Foot Print (ZFP).

I think that we need a configure flag to disable libada and not
gnattools for these bare board targets.

Thanks,
Luke.


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

* Re: gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery
  2014-01-16 17:53 gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery Luke A. Guest
@ 2014-01-16 18:13 ` Rolf Ebert
  2014-01-16 18:23   ` Luke A. Guest
  2014-02-14 12:20 ` Brian Drummond
  1 sibling, 1 reply; 8+ messages in thread
From: Rolf Ebert @ 2014-01-16 18:13 UTC (permalink / raw)
  To: Luke A. Guest, GCC ML

Am 16.01.2014 18:17, schrieb Luke A. Guest:

> But what about the gnattools? Not buildable. A message in the ml
> archives states to build them with "make -C gcc gnattools," but this
> fails:

This is PR19959, see comment #13. IMHO, this PR was incorrectly closed. 
That's why we use the mentioned build kludge in AVR-Ada.

     Rolf

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

* Re: gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery
  2014-01-16 18:13 ` Rolf Ebert
@ 2014-01-16 18:23   ` Luke A. Guest
  2014-01-16 22:49     ` Luke A. Guest
  0 siblings, 1 reply; 8+ messages in thread
From: Luke A. Guest @ 2014-01-16 18:23 UTC (permalink / raw)
  To: Rolf Ebert; +Cc: GCC ML

On Thu, 2014-01-16 at 18:53 +0100, Rolf Ebert wrote:
> Am 16.01.2014 18:17, schrieb Luke A. Guest:
> 
> > But what about the gnattools? Not buildable. A message in the ml
> > archives states to build them with "make -C gcc gnattools," but this
> > fails:
> 
> This is PR19959, see comment #13. IMHO, this PR was incorrectly closed. 
> That's why we use the mentioned build kludge in AVR-Ada.

I never liked this method, but it does work, to a point. But it is a
hack.

Ah, I tried looking but didn't find this, FYI
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19959 

As usual, there is a comment stating, see RTEMS on how to do it, which
never answers the question or fixes the issue.

Also, comment 14, is the apparent howto which fails as I mentioned in my
first post and I really don't understand Arnaud's comment at all there.
I just don't get the reasoning.

But this is not AVR specific, as he states in #16 and the following does
not work either, as he states: make -C gcc gnattools-cross or make
gnattools-cross as the rules don't exist, even tried -C gcc/ada.

Thanks,
Luke.


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

* Re: gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery
  2014-01-16 18:23   ` Luke A. Guest
@ 2014-01-16 22:49     ` Luke A. Guest
  0 siblings, 0 replies; 8+ messages in thread
From: Luke A. Guest @ 2014-01-16 22:49 UTC (permalink / raw)
  To: Rolf Ebert; +Cc: GCC ML

And to clarify:

$ make -C gnattools/ gnattools-cross
make: Entering directory
`/home/laguest/src/mine/tinyada-new/build/arm-none-eabi/gcc2-built-with-git-ro/gnattools'
# gnattools1-re
make -C ../gcc/ada/tools -f ../Makefile \
	  "CC=cc" "CXX=g++" "CFLAGS=-g -W -Wall" "LDFLAGS=" "ADAFLAGS=-gnatpg
-gnata" "ADA_CFLAGS=" "INCLUDES=-I. -I.. -I../..
-I/home/laguest/src/mine/tinyada-new/source/gcc-git-ro/gcc/ada
-I/home/laguest/src/mine/tinyada-new/source/gcc-git-ro/gcc/config
-I/home/laguest/src/mine/tinyada-new/source/gcc-git-ro/gcc/../include
-I/home/laguest/src/mine/tinyada-new/source/gcc-git-ro/gcc"
"ADA_INCLUDES=-I/home/laguest/opt/tinyada/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/adalib/../adainclude -I/home/laguest/opt/tinyada/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/adalib/ -I. -I/home/laguest/src/mine/tinyada-new/source/gcc-git-ro/gcc/ada" "exeext=" "fsrcdir=/home/laguest/src/mine/tinyada-new/source/gcc-git-ro/gcc" "srcdir=/home/laguest/src/mine/tinyada-new/source/gcc-git-ro/gcc" "GNATMAKE=gnatmake" "GNATLINK=gnatlink" "GNATBIND=gnatbind" "TOOLSCASE=cross" "LIBGNAT=" INCLUDES="" \
	  gnatmake-re gnatlink-re
make: Entering an unknown directory
make: *** ../gcc/ada/tools: No such file or directory.  Stop.
make: Leaving an unknown directory
make: *** [gnattools-cross] Error 2
make: Leaving directory
`/home/laguest/src/mine/tinyada-new/build/arm-none-eabi/gcc2-built-with-git-ro/gnattools'

Also fails.

Luke.


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

* Re: gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery
  2014-01-16 17:53 gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery Luke A. Guest
  2014-01-16 18:13 ` Rolf Ebert
@ 2014-02-14 12:20 ` Brian Drummond
  2014-02-14 14:01   ` Luke A. Guest
  2014-02-20 15:47   ` Luke A. Guest
  1 sibling, 2 replies; 8+ messages in thread
From: Brian Drummond @ 2014-02-14 12:20 UTC (permalink / raw)
  To: gcc

Luke A. Guest <laguest <at> archeia.com> writes:

> 
> Hi,
> 
> I've been over this before and have got nowhere with it. 

> Say you want to build an Ada compiler for embedded work, ...
> You can build it with "make all-gcc" and install with "make install-gcc"
> ...
> But what about the gnattools? Not buildable. A message in the ml
> archives states to build them with "make -C gcc gnattools," but this
> fails:
> ...
> You can't disable libada using the command line as that also disables
> gnattools - I don't know the reason for requiring this behaviour.
> 

Revisiting the MSP430 as it's now an official gcc target, this is still a
problem here too, so there are at least 3 targets for which it's a problem.

Looking at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19959
and comparing comments #6 and #14, perhaps this command should be 
"make -C gcc gnattools-cross" ? I'll try to do a clean build and test this
today.

But it would be better if the build "just worked" so at

> if test "${ENABLE_LIBADA}" != "yes" ; then
>   noconfigdirs="$noconfigdirs"
> fi
we need a better test here (also checking for a crosscompiler build).

> I think that we need a configure flag to disable libada and not
> gnattools for these bare board targets.

Following comment #15 in bug 19959, perhaps it's time to open a bug against
--disable-libada.

- Brian




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

* Re: gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery
  2014-02-14 12:20 ` Brian Drummond
@ 2014-02-14 14:01   ` Luke A. Guest
       [not found]     ` <1392391977.17088.50.camel@Gannet.Four>
  2014-02-20 15:47   ` Luke A. Guest
  1 sibling, 1 reply; 8+ messages in thread
From: Luke A. Guest @ 2014-02-14 14:01 UTC (permalink / raw)
  To: Brian Drummond; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 2285 bytes --]

On Fri, 2014-02-14 at 12:11 +0000, Brian Drummond wrote:

> Revisiting the MSP430 as it's now an official gcc target, this is still a
> problem here too, so there are at least 3 targets for which it's a problem.

It's a problem for all targets.

> Looking at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19959
> and comparing comments #6 and #14, perhaps this command should be 
> "make -C gcc gnattools-cross" ? I'll try to do a clean build and test this
> today.
> 

It won't work, I've tried all those so called work arounds. They rely on
having libada built, it will complain to say that it can't be built
because there is no libada. See the attachments.

> But it would be better if the build "just worked" so at
> 
> > if test "${ENABLE_LIBADA}" != "yes" ; then
> >   noconfigdirs="$noconfigdirs"
> > fi
> we need a better test here (also checking for a crosscompiler build).

I have added one. It does work, sort of.

> > I think that we need a configure flag to disable libada and not
> > gnattools for these bare board targets.
> 
> Following comment #15 in bug 19959, perhaps it's time to open a bug against
> --disable-libada.

The attachments allow you to configure the toolchain for bare metal, no
RTS. This flag is --enable-cross-gnattools, it checks if this is a cross
compiler and if it is, disables libada, but not gnattools.

There is an issue and I don't know why it does this, but it won't allow
you to build the gnattools straight away. You have to use:

make all-gcc
make -C gnattools/ gnattools
rm gcc/stamp-tools
make -C gcc cross-gnattools
make install-gcc

This will then build.

I have not checked to see if you can still build gcc for normal hosted
with this patch, neither have I checked to make sure --disable-libada
works in hosted either.

I have built the following with these patches:

arm-none-eabi
mips-elf
msp430-elf
x86_64-elf

Not one installs libada and I have gnattools:

$ ls ~/opt/tinyada/lib/gcc/arm-none-eabi/4.9.0/
include  include-fixed  install-tools  plugin
$ ls ~/opt/tinyada/lib/gcc/mips-elf/4.9.0/
include  include-fixed  install-tools  plugin
$ ls ~/opt/tinyada/lib/gcc/msp430-elf/4.9.0/
include  include-fixed  install-tools  plugin
$ ls ~/opt/tinyada/lib/gcc/x86_64-elf/4.9.0/
include  include-fixed  install-tools  plugin

Luke.


[-- Attachment #2: 0001-Set-the-target-for-a-bare-metal-environment.patch --]
[-- Type: text/x-patch, Size: 1607 bytes --]

From f8c74c16b9f7ef3be02a9a7d3480baf88d09efd6 Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" <laguest@archeia.com>
Date: Fri, 14 Feb 2014 13:53:27 +0000
Subject: [PATCH 1/2] Set the target for a bare metal environment.

---
 gnattools/configure    | 9 +++++++++
 gnattools/configure.ac | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/gnattools/configure b/gnattools/configure
index 883b705..b5bf03d 100755
--- a/gnattools/configure
+++ b/gnattools/configure
@@ -2090,6 +2090,15 @@ case "${target}" in
     indepsw.adb<indepsw-mingw.adb"
     EXTRA_GNATTOOLS='../../gnatdll$(exeext)'
     ;;
+  # Any bare machine stuff can go here, i.e. mips-elf, arm-elf,
+  # arm-none-eabi-elf, etc.
+  #
+  # This file just enables the ability to build static libs with gnatmake and
+  # project files.
+  *-*-elf* | *-*-eabi*)
+    TOOLS_TARGET_PAIRS="\
+    mlib-tgt-specific.adb<mlib-tgt-specific-xi.adb"
+    ;;
 esac
 
 # From user or toplevel makefile.
diff --git a/gnattools/configure.ac b/gnattools/configure.ac
index 5edaadf..dbdc958 100644
--- a/gnattools/configure.ac
+++ b/gnattools/configure.ac
@@ -130,6 +130,15 @@ case "${target}" in
     indepsw.adb<indepsw-mingw.adb"
     EXTRA_GNATTOOLS='../../gnatdll$(exeext)'
     ;;
+  # Any bare machine stuff can go here, i.e. mips-elf, arm-elf,
+  # arm-none-eabi-elf, etc.
+  #
+  # This file just enables the ability to build static libs with gnatmake and
+  # project files.
+  *-*-elf* | *-*-eabi*)
+    TOOLS_TARGET_PAIRS="\
+    mlib-tgt-specific.adb<mlib-tgt-specific-xi.adb"
+    ;;
 esac
 
 # From user or toplevel makefile.
-- 
1.8.5.3


[-- Attachment #3: 0002-Added-enable-cross-gnattools-flag-for-bare-metal-env.patch --]
[-- Type: text/x-patch, Size: 10032 bytes --]

From a2b4516f93f4d99e5ddae4c1eed78f2014f0875b Mon Sep 17 00:00:00 2001
From: "Luke A. Guest" <laguest@archeia.com>
Date: Fri, 14 Feb 2014 13:54:29 +0000
Subject: [PATCH 2/2] Added --enable-cross-gnattools flag for bare metal
 environment.

---
 configure    | 25 ++++++++++++++++++++++--
 configure.ac | 63 ++++++++++++++++++++++++++++++++++++------------------------
 2 files changed, 61 insertions(+), 27 deletions(-)

diff --git a/configure b/configure
index 749a35e..c0d706d 100755
--- a/configure
+++ b/configure
@@ -749,6 +749,7 @@ enable_ld
 enable_libquadmath
 enable_libquadmath_support
 enable_libada
+enable_cross_gnattools
 enable_libssp
 enable_libstdcxx
 enable_static_libjava
@@ -1466,6 +1467,10 @@ Optional Features:
   --disable-libquadmath-support
                           disable libquadmath support for Fortran
   --enable-libada         build libada directory
+  --enable-cross-gnattools
+                          Enable cross gnattools for cross-compiler for
+                          freestanding environment, --disable-libada is set
+                          automatically
   --enable-libssp         build libssp directory
   --disable-libstdcxx     do not build libstdc++-v3 directory
   --enable-static-libjava[=ARG]
@@ -3068,8 +3073,24 @@ else
   ENABLE_LIBADA=yes
 fi
 
-if test "${ENABLE_LIBADA}" != "yes" ; then
-  noconfigdirs="$noconfigdirs gnattools"
+
+# Check whether --enable-cross-gnattools was given.
+if test "${enable_cross_gnattools+set}" = set; then :
+  enableval=$enable_cross_gnattools; ENABLE_CROSS_GNATTOOLS=$enableval
+else
+  ENABLE_CROSS_GNATTOOLS=yes
+fi
+
+
+if test "${is_cross_compiler}" = "yes" && test "${ENABLE_CROSS_GNATTOOLS}" = "yes" ; then
+  if test "${target_vendor}" = "none" || test "${target_vendor}" = "unknown" ; then
+    enable_libada=no
+    ENABLE_LIBADA=$enable_libada
+  fi
+else
+  if test "${ENABLE_LIBADA}" != "yes" ; then
+    noconfigdirs="$noconfigdirs gnattools"
+  fi
 fi
 
 # Check whether --enable-libssp was given.
diff --git a/configure.ac b/configure.ac
index b24b33d..4fcac1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -113,11 +113,11 @@ extra_host_args=
 ### or a host dependent tool.  Then put it into the appropriate list
 ### (library or tools, host or target), doing a dependency sort.
 
-# Subdirs will be configured in the order listed in build_configdirs, 
+# Subdirs will be configured in the order listed in build_configdirs,
 # configdirs, or target_configdirs; see the serialization section below.
 
-# Dependency sorting is only needed when *configuration* must be done in 
-# a particular order.  In all cases a dependency should be specified in 
+# Dependency sorting is only needed when *configuration* must be done in
+# a particular order.  In all cases a dependency should be specified in
 # the Makefile, whether or not it's implicitly specified here.
 
 # Double entries in build_configdirs, configdirs, or target_configdirs may
@@ -214,7 +214,7 @@ if test x"${host}" = x"${target}" ; then
   is_cross_compiler=no
 else
   is_cross_compiler=yes
-fi	
+fi
 
 # Find the build and target subdir names.
 GCC_TOPLEV_SUBDIRS
@@ -250,7 +250,7 @@ if test x$with_system_zlib = xyes ; then
   noconfigdirs="$noconfigdirs zlib"
 fi
 
-# some tools are so dependent upon X11 that if we're not building with X, 
+# some tools are so dependent upon X11 that if we're not building with X,
 # it's not even worth trying to configure, much less build, that tool.
 
 case ${with_x} in
@@ -258,7 +258,7 @@ case ${with_x} in
   no)
     skipdirs="${skipdirs} tk itcl libgui"
     # We won't be able to build gdbtk without X.
-    enable_gdbtk=no 
+    enable_gdbtk=no
     ;;
   *)  echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;;
 esac
@@ -384,7 +384,7 @@ esac
 # Only spaces may be used in this macro; not newlines or tabs.
 unsupported_languages=
 
-# Remove more programs from consideration, based on the host or 
+# Remove more programs from consideration, based on the host or
 # target this usually means that a port of the program doesn't
 # exist yet.
 
@@ -420,8 +420,21 @@ AC_ARG_ENABLE(libada,
 [AS_HELP_STRING([--enable-libada], [build libada directory])],
 ENABLE_LIBADA=$enableval,
 ENABLE_LIBADA=yes)
-if test "${ENABLE_LIBADA}" != "yes" ; then
-  noconfigdirs="$noconfigdirs gnattools"
+
+AC_ARG_ENABLE(cross-gnattools,
+[AS_HELP_STRING([--enable-cross-gnattools], [Enable cross gnattools for cross-compiler for freestanding environment, --disable-libada is set automatically])],
+ENABLE_CROSS_GNATTOOLS=$enableval,
+ENABLE_CROSS_GNATTOOLS=yes)
+
+if test "${is_cross_compiler}" = "yes" && test "${ENABLE_CROSS_GNATTOOLS}" = "yes" ; then
+  if test "${target_vendor}" = "none" || test "${target_vendor}" = "unknown" ; then
+    enable_libada=no
+    ENABLE_LIBADA=$enable_libada
+  fi
+else
+  if test "${ENABLE_LIBADA}" != "yes" ; then
+    noconfigdirs="$noconfigdirs gnattools"
+  fi
 fi
 
 AC_ARG_ENABLE(libssp,
@@ -768,7 +781,7 @@ case "${target}" in
     ;;
   *-*-lynxos*)
     noconfigdirs="$noconfigdirs ${libgcj}"
-    ;; 
+    ;;
 esac
 
 # Disable libgo for some systems where it is known to not work.
@@ -873,7 +886,7 @@ case "${target}" in
     ;;
   *-*-lynxos*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;; 
+    ;;
   *-*-mingw*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
@@ -1183,7 +1196,7 @@ case "${host}" in
   hppa*-hp-hpux*)
     host_makefile_frag="config/mh-pa"
     ;;
-  hppa*-*)	
+  hppa*-*)
     host_makefile_frag="config/mh-pa"
     ;;
   *-*-darwin*)
@@ -1857,7 +1870,7 @@ if test -d ${srcdir}/gcc; then
       # an apparent bug in bash 1.12 on linux.
       ${srcdir}/gcc/[[*]]/config-lang.in) ;;
       *)
-        # From the config-lang.in, get $language, $target_libs, 
+        # From the config-lang.in, get $language, $target_libs,
         # $lang_dirs, $boot_language, and $build_by_default
         language=
         target_libs=
@@ -2110,7 +2123,7 @@ done
 build_configdirs_all="$build_configdirs"
 build_configdirs=
 for i in ${build_configdirs_all} ; do
-  j=`echo $i | sed -e s/build-//g` 
+  j=`echo $i | sed -e s/build-//g`
   if test -f ${srcdir}/$j/configure ; then
     build_configdirs="${build_configdirs} $i"
   fi
@@ -2127,7 +2140,7 @@ done
 target_configdirs_all="$target_configdirs"
 target_configdirs=
 for i in ${target_configdirs_all} ; do
-  j=`echo $i | sed -e s/target-//g` 
+  j=`echo $i | sed -e s/target-//g`
   if test -f ${srcdir}/$j/configure ; then
     target_configdirs="${target_configdirs} $i"
   fi
@@ -2178,7 +2191,7 @@ ACX_TOOL_DIRS
 
 copy_dirs=
 
-AC_ARG_WITH([build-sysroot], 
+AC_ARG_WITH([build-sysroot],
   [AS_HELP_STRING([--with-build-sysroot=SYSROOT],
 		  [use sysroot as the system root during the build])],
   [if test x"$withval" != x ; then
@@ -2269,11 +2282,11 @@ fi
 # This is done by determining whether or not the appropriate directory
 # is available, and by checking whether or not specific configurations
 # have requested that this magic not happen.
-# 
-# The command line options always override the explicit settings in 
+#
+# The command line options always override the explicit settings in
 # configure.in, and the settings in configure.in override this magic.
 #
-# If the default for a toolchain is to use GNU as and ld, and you don't 
+# If the default for a toolchain is to use GNU as and ld, and you don't
 # want to do that, then you should use the --without-gnu-as and
 # --without-gnu-ld options for the configure script.  Similarly, if
 # the default is to use the included zlib and you don't want to do that,
@@ -2374,7 +2387,7 @@ case "${target}" in
     target_makefile_frag="config/mt-gnu"
     ;;
   *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*)
-    # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm 
+    # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm
     # commands to handle both 32-bit and 64-bit objects.  These flags are
     # harmless if we're using GNU nm or ar.
     extra_arflags_for_target=" -X32_64"
@@ -2444,7 +2457,7 @@ if test $? = 0 ; then
   if test -s conftest || test -s conftest.exe ; then
     we_are_ok=yes
   fi
-fi 
+fi
 case $we_are_ok in
   no)
     echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
@@ -2824,7 +2837,7 @@ baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
 # --program-suffix have been applied to it.  Autoconf has already
 # doubled dollar signs and backslashes in program_transform_name; we want
 # the backslashes un-doubled, and then the entire thing wrapped in single
-# quotes, because this will be expanded first by make and then by the shell. 
+# quotes, because this will be expanded first by make and then by the shell.
 # Also, because we want to override the logic in subdir configure scripts to
 # choose program_transform_name, replace any s,x,x, with s,y,y,.
 sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" <<EOF_SED > conftestsed.out
@@ -2891,7 +2904,7 @@ case "$target:$have_compiler:$host:$target:$enable_multilib" in
       if test -s conftest || test -s conftest.exe ; then
 	dev64=yes
       fi
-    fi 
+    fi
     rm -f conftest*
     if test x${dev64} != xyes ; then
       AC_MSG_ERROR([I suspect your system does not have 32-bit developement libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.])
@@ -3169,7 +3182,7 @@ AC_SUBST(CFLAGS)
 AC_SUBST(CXXFLAGS)
 
 # Target tools.
-AC_ARG_WITH([build-time-tools], 
+AC_ARG_WITH([build-time-tools],
   [AS_HELP_STRING([--with-build-time-tools=PATH],
 		  [use given path to find target tools during the build])],
   [case x"$withval" in
@@ -3274,7 +3287,7 @@ if test "$USE_MAINTAINER_MODE" = yes; then
 else
   MAINTAINER_MODE_TRUE='#'
   MAINTAINER_MODE_FALSE=
-fi	
+fi
 MAINT=$MAINTAINER_MODE_TRUE
 AC_SUBST(MAINT)dnl
 
-- 
1.8.5.3


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

* Re: gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery
       [not found]     ` <1392391977.17088.50.camel@Gannet.Four>
@ 2014-02-14 15:42       ` Luke A. Guest
  0 siblings, 0 replies; 8+ messages in thread
From: Luke A. Guest @ 2014-02-14 15:42 UTC (permalink / raw)
  To: brian; +Cc: gcc

On Fri, 2014-02-14 at 15:32 +0000, Brian Drummond wrote:

> OK I'll take a look.
> Too many make and install targets; I have no idea how this process
> interacts with the process specified here:
> https://sourceforge.net/apps/mediawiki/mspgcc/index.php?title=Install:redhat
> for the msp430, using (in short)

Well, like I've said before that process won't work when you enable Ada,
my patches will make it work, but you need to add the extra/new flag to
configure.

> make all-host
> sudo make install-host
> (Configure and build Newlib for MSP430)
> make all-target
> sudo make install-target
> 
> Maybe that split build process actually resolves your issue...
> But who can tell? : I can't say I've found adequate documentation.

It really doesn't. 

> With the original (avr/msp430) patch/hack, gnattools were automatically
> built and installed by make all-host, make install-host.

Yes, but that hack is from avr-ada which, if you look back in this ml, I
specifically state that it breaks normal builds. My patches, in theory,
should not.

Trust me, I've been trying to build these style tools for around 10
years, on and off, and they have never built correctly for these targets
and any attempt to put in a bug report about it is a waste of time as
someone comes along states it works and closes it, even though it
doesn't.

Luke.


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

* Re: gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery
  2014-02-14 12:20 ` Brian Drummond
  2014-02-14 14:01   ` Luke A. Guest
@ 2014-02-20 15:47   ` Luke A. Guest
  1 sibling, 0 replies; 8+ messages in thread
From: Luke A. Guest @ 2014-02-20 15:47 UTC (permalink / raw)
  To: Brian Drummond; +Cc: gcc

Hi,

I've uploaded a prebuilt arm cross compiler for Linux x86_64, built on
Debian Jessie, should work fine, crosses fingers :D

https://www.dropbox.com/s/273e1pbez0qgqkp/tinyada-arm-none-eabi-4.9.0-20140122.tbz

Thanks,
Luke.


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

end of thread, other threads:[~2014-02-20 15:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-16 17:53 gnattools cannot be built for freestanding/bare metal environment without hacking up the build machinery Luke A. Guest
2014-01-16 18:13 ` Rolf Ebert
2014-01-16 18:23   ` Luke A. Guest
2014-01-16 22:49     ` Luke A. Guest
2014-02-14 12:20 ` Brian Drummond
2014-02-14 14:01   ` Luke A. Guest
     [not found]     ` <1392391977.17088.50.camel@Gannet.Four>
2014-02-14 15:42       ` Luke A. Guest
2014-02-20 15:47   ` Luke A. Guest

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).