uSTL Template

Sergei Gavrikov sergei.gavrikov@gmail.com
Fri Aug 21 13:05:00 GMT 2009


On Fri, Aug 21, 2009 at 11:04:53AM +0200, cetoni GmbH - Uwe Kindler wrote:
> Hi John,
>
> o.k. you are right.
>
> But then it would be good to state somewhere, that the user should start  
> from the default package and then add File I/O and uSTL package. I will  
> try to provide a little piece of SGML documentation for uSTL package  
> that gives some hints for first use and then refers to the online uSTL  
> documentation.
>
> Regards, Uwe

Hello

They did break my phone line (=ADSL=internet=mail=ecos-lists) :-) So, I
missed the interesting things which occured these days (ustl, lwip).

Uwe, just now I tried uSTL package on synthetic target using latest CVS.
Unfortunately, I ran in that old linkage issue.

The uSTL's bktrace.cpp has

#if linux
#include <execinfo.h>
#else
...

i.e. for Linux synthetic build gcc includes host's header and then we'll
get a few unresolved externals on the linkage stage. My old proposal was
wrap that check with !__ECOS__ for example and add something like this
-D__ECOS__=1 in the package's CFLAGS, but, in fact, it would enough
scribble '#if 0' for that linux check in bktrace.cpp and do not make a
mess of things in CDL. The choice is yours.

Off-topic. Just curiously enough, why eCos cannot identify itself via
CPP? We know some CPP definitions for other OSes (environments), like
bsd, linux, cygwin, mingw, win32, mingw, djgpp, etc. I grep eCos tree
for __ECOS and found differrent variants of the own-identification :-)
What's about global definition and standard for eCos build? It would
arange a porting style.

Well, the eCos libraries with uSTL were built with i386-elf-gcc (4.3.2)
from eCosCentric. Host: Ubuntu 8.04.3 LTS. eCos: updated CVS tree. The
below is a description of the results.

Appendix

i. Synopsis of my test drive (cut from bash history and commented a bit)

##
# My eCos from scratch
##

echo $ECOS_REPOSITORY
/opt/trunk/devo/ecos/packages

# clean up my ecos repo
rm -r /opt/trunk/devo

# use clean CVS copy
cp -a /opt/trunk/clean /opt/trunk/devo

##
# Build
##

mkdir tests ; cd tests

# configure ecos as
ecosconfig new linux
ecosconfig add fileio ustl

# use stable, well tested toolchain from eCosCentric
ecosconfig import /dev/stdin << EOT
cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
    user_value i386-elf
};
EOT

ecosconfig tree
make -s headers

# First, check uSTL build itself, I expect to see no warnings
make -s -C language/cxx/ustl/current

I saw 1 warning with GCC 4.3.2.

/opt/trunk/devo/ecos/packages/language/cxx/ustl/current/src/uexception.cpp: In member function 'virtual void ustl::exception::read(ustl::istream&)':
/opt/trunk/devo/ecos/packages/language/cxx/ustl/current/src/uexception.cpp:38: warning: 'stmSize' may be used uninitialized in this function

I attached that uexception.cpp.patch. Well, that's minor thing.

# make libraries
make -s

# workaround for an absent libgcc_eh.a
sed -i 's,libgcc_eh.a,,' install/lib/target.ld

# Try to build bvts
make -s -C language/cxx/ustl/current tests TESTS=tests/bvt00
/opt/home/sg/Desktop/ustl_test/install/lib/libtarget.a(language_cxx_ustl_bktrace.o): In function `ustl::CBacktrace::GetSymbols()':
/opt/trunk/devo/ecos/packages/language/cxx/ustl/current/src/bktrace.cpp:73: undefined reference to `backtrace_symbols'
/opt/home/sg/Desktop/ustl_test/install/lib/libtarget.a(language_cxx_ustl_bktrace.o): In function `CBacktrace':
/opt/trunk/devo/ecos/packages/language/cxx/ustl/current/src/bktrace.cpp:24: undefined reference to `backtrace'
collect2: ld returned 1 exit status
make: *** [/opt/home/sg/Desktop/ustl_test/install/tests/language/cxx/ustl/current/tests/bvt00] Error 1

Ooops, it's that <execinfo.h>'s deal. I applied that attached
bktrace.cpp.patch and repeat all the above from scratch. Then
it was possible to run all without any issues.

##
# Batch
##

# try run bvts, all should pass, but bvt25 (no fs)
for t in install/tests/language/cxx/ustl/current/tests/bvt??
do
	echo $t ; $t -nw -io ;
done | tee bvt.log

All passed successfully, but bvt25.

Note: all as the above was repeated from scratch, but, for uSTL build
without fileio

cdl_component CYGCLS_USTL_FSTREAMS {
    inferred_value 0
};

i.e.

ecosconfig new linux
ecosconfig add ustl

to be sure that __cxa_pure_virtual issue went away from the infra's
sprintfs tests. I did not observe the issue.

Other issue(s)

I could not link bvt23 using host gcc-4.2.4 (Ubuntu 8.04.3 LTS). I'm
sorry, I cannot investigate in that. I use and used i386-elf-gcc from
eCosCentric for the testing as I do it as well.

Foreigners ;-)

grep -rl '^M' language
language/cxx/ustl/current/README
language/cxx/ustl/current/cdl/ustl.cdl
language/cxx/ustl/current/src/twothreads.cpp
language/cxx/ustl/current/src/ustlecos.cpp
language/cxx/ustl/current/include/config.h
language/cxx/ustl/current/include/ustlecos.h
language/cxx/ustl/current/ChangeLog

Well, Uwe, that was my brief look. Thank you for distribution.

Regards,

Sergei



-------------- next part --------------
A non-text attachment was scrubbed...
Name: bktrace.cpp.patch
Type: text/x-diff
Size: 797 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-patches/attachments/20090821/a7c1a31a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uexception.cpp.patch
Type: text/x-diff
Size: 908 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-patches/attachments/20090821/a7c1a31a/attachment-0001.bin>


More information about the Ecos-patches mailing list