public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Pure trick for _inpure_ptr and modern toolchains
@ 2007-10-18 21:34 Sergei Gavrikov
  2007-10-18 21:40 ` Sergei Gavrikov
  2007-10-19  7:20 ` [ECOS] " Daniel Néri
  0 siblings, 2 replies; 4+ messages in thread
From: Sergei Gavrikov @ 2007-10-18 21:34 UTC (permalink / raw)
  To: eCos discuss list

Hi,

Last days I built a few a bit modern toolchains for eCos and played with
them. The stuff was binutils-1.16, newlib-1.14, gcc-*-3.4.4. And I found
that for such test builds you can easy resolve the '_impure_ptr issue'
in a bloodless manner just using the <target>-ar. Well, I had disliked to
mess up the toolchain or eCos sources to keep the peace.

SYNOPSIS

Build eCos "as is" using modern toolchain

ecosconfig new pid
ecosconfig tree
make -s
headers finished
build finished
make -s tests TESTS=tests/cxxsup -C infra/current
/gnutools/arm-elf/lib/gcc/arm-elf/3.4.4/../../../../arm-elf/lib/libsupc++.a(vterminate.o): In function `__gnu_cxx::__verbose_terminate_handler()':
/test/src/gcc-3.4.4/libstdc++-v3/libsupc++/vterminate.cc:94: undefined reference to `_impure_ptr'
collect2: ld returned 1 exit status
make: *** [/tmp/build/install/tests/infra/current/tests/cxxsupp] Error 1


"Tricked" eCos build (use extra commands <target>-gcc, <target>-ar)

ecosconfig new pid
ecosconfig tree
make -s
headers finished
build finished
cat <<_EOF >impure.c
void *_impure_ptr;
_EOF
arm-elf-gcc -c impure.c
arm-elf-ar q install/lib/libtarget.a impure.o
make -s tests TESTS=tests/cxxsup -C infra/current

Silent GCC... Yep, I like it!

For pedants, that "impure.c" can be like the below.

--------------------------------------------------------------->8
#include <sys/reent.h>
#include <stdio.h>

static struct _reent __impure_data = _REENT_INIT (__impure_data);
struct _reent  *_impure_ptr = &__impure_data;

--------------------------------------------------------------->8

Note: <target>-gcc knows where to find newlib headers.

Playing a bit with GCC-3.4.4 (arm-elf, i386-elf, powerpc-eabi) I found
what it doesn't know more about -mno-short-load-words flag. It seems,
you can quite replace that by -mno-alignment-traps flag.

And when I tried to make all eCos tests with new GCC-3.4.4 I got the
warnings "inlining failed" at <include/cyg/libc/signals/signal.inl>. I
have got no warnings using stable eCos compiler (GCC-3.2.1). But, the
medicine was just to specify '--param inline-unit-growth=150'. It was
strange, because man page arm-elf-gcc.1 from GCC-3.4.4 suite said: The
default value is 150.

If this is interesting for community, I can attach new patches and
simple bash script to get the same toolchains.

One note: I won't be able to manage your experiences and success.  Host
system to build the toolchains was just a "home" Linux distro -- Ubuntu
Feisty Fawn.

Between you and me, it would seem what eCos official guide how to build
own toolchain (http://ecos.sourceware.org/build-toolchain.html) is an
obsolete document. No, it isn't. I was guided this HOWTO only.


--
Sergei


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2007-10-19  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-18 21:34 [ECOS] Pure trick for _inpure_ptr and modern toolchains Sergei Gavrikov
2007-10-18 21:40 ` Sergei Gavrikov
2007-10-19  7:20 ` [ECOS] " Daniel Néri
2007-10-19  9:24   ` Sergei Gavrikov

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