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

* Re: [ECOS] Pure trick for _inpure_ptr and modern toolchains
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Sergei Gavrikov @ 2007-10-18 21:40 UTC (permalink / raw)
  To: eCos discuss list

On Fri, Oct 19, 2007 at 12:34:08AM +0300, Sergei Gavrikov wrote:
> 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
                      ^^^^^^^^^^^^^
                                    It's 2.16 certainly :-)

> 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

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

* [ECOS]  Re: Pure trick for _inpure_ptr and modern toolchains
  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 ` Daniel Néri
  2007-10-19  9:24   ` Sergei Gavrikov
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Néri @ 2007-10-19  7:20 UTC (permalink / raw)
  To: ecos-discuss

Sergei Gavrikov <w3sg@SoftHome.net> writes:

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

Hmm, modern? All of those were released in 2005.

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

I'm currently using GCC 4.2.1 (arm-elf target), built with headers from
newlib 1.15.0.

I avoid the _impure_ptr dependency by passing --disable-hosted-libstdcxx
to the GCC configure script.


Regards,
-- 
Daniel Néri <daniel.neri@sigicom.se>
Sigicom AB, Stockholm, Sweden


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

* Re: [ECOS]  Re: Pure trick for _inpure_ptr and modern toolchains
  2007-10-19  7:20 ` [ECOS] " Daniel Néri
@ 2007-10-19  9:24   ` Sergei Gavrikov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Gavrikov @ 2007-10-19  9:24 UTC (permalink / raw)
  To: Daniel N?ri; +Cc: ecos-discuss

On Fri, Oct 19, 2007 at 09:19:26AM +0200, Daniel N?ri wrote:
> Sergei Gavrikov <w3sg@SoftHome.net> writes:
> 
> > Lasat 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.
> 
> Hmm, modern? All of those were released in 2005.

1) I wrote "a bit modern" because ecos newbies can download stuffs from
official site are dated 2002;

2) I did choose candidates greping eCos discuss-list because I wanted to
get "a bit modern" and still "stable" toolchain. BTW, eCosCentric offers
GCC3.4.4 for own customers;

3) If you remember Linux kernel developers used GCC-2.95 the very long
period, more that, in those days they did suggest us to use only this
compiler to rebuild the kernels;

> > 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.
> 
> I'm currently using GCC 4.2.1 (arm-elf target), built with headers from
> newlib 1.15.0.
         ^^^^^^ It's libgloss (arm related) has the bug.

According the points above, I wouldn't suggest all to use the freshmeats
are liked on things from www.gnuarm.org site. I got  "Internal compiler
error" with GCC-4 is built even for i?86-linux-gnu target :-). Should
the stable compiler produce it?

> I avoid the _impure_ptr dependency by passing --disable-hosted-libstdcxx
> to the GCC configure script.

Again, I dislike to cut any default settings from the build. Today eCos
C++ stuff doesn't use some features, but, tomorrow it would use the one.
I wouldn't want recompile GCC suite again for that. I can use my build
to link applications with the eCos stuff and without it, for example, if
I would want to build something using newlib only (no eCos).

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