public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* uSTL 1.4 update
@ 2010-06-25 14:33 Simon Kallweit
  2010-06-28  8:32 ` John Dallaway
  2010-06-28  9:19 ` John Dallaway
  0 siblings, 2 replies; 13+ messages in thread
From: Simon Kallweit @ 2010-06-25 14:33 UTC (permalink / raw)
  To: ecos-patches

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

Hi

This patch will update uSTL to the newest 1.4 sources. Minor updates.

Simon

[-- Attachment #2: ustl-1.4.patch --]
[-- Type: text/x-patch, Size: 11241 bytes --]

diff --git a/packages/language/cxx/ustl/current/ChangeLog b/packages/language/cxx/ustl/current/ChangeLog
index 7fdc5de..88c1d5c 100644
--- a/packages/language/cxx/ustl/current/ChangeLog
+++ b/packages/language/cxx/ustl/current/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-25  Simon Kallweit <simon.kallweit@intefo.ch>
+
+	* include/*:
+	* tests/*:
+	* HISTORY:
+	* LICENSE: Updated to uSTL 1.4 sources.
+
 2009-10-06  Uwe Kindler <uwe_kindler@web.de>
 
 	* doc/ustl.sgml: Removed cout.flush() from example and from note.
diff --git a/packages/language/cxx/ustl/current/HISTORY b/packages/language/cxx/ustl/current/HISTORY
index f7177a1..3540e89 100644
--- a/packages/language/cxx/ustl/current/HISTORY
+++ b/packages/language/cxx/ustl/current/HISTORY
@@ -1,3 +1,9 @@
+2010-03-21 Release 1.4
+	* Fixed crash in destructor of empty vector, introduced by 1.3
+	* Fixed list merge, which previously did not compile
+	* Some portability changes to configure so it will work with dash
+	    when escape char processing bug is fixed (Ubuntu bug #268929)
+
 2009-08-04 Release 1.3
 	* Some API changes to comply with the current C++ standard
 	    binary_search algo returns true, not the found iterator
diff --git a/packages/language/cxx/ustl/current/LICENSE b/packages/language/cxx/ustl/current/LICENSE
index e80e7a8..857a9b4 100644
--- a/packages/language/cxx/ustl/current/LICENSE
+++ b/packages/language/cxx/ustl/current/LICENSE
@@ -1,24 +1,22 @@
 
 			The MIT License
 
-Copyright (C) 2005 by Mike Sharov <msharov@users.sourceforge.net>
+Copyright (c) 2005-2009 by Mike Sharov <msharov@users.sourceforge.net>
 
 Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included
 in all copies or substantial portions of the Software.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/packages/language/cxx/ustl/current/include/ustl/sistream.h b/packages/language/cxx/ustl/current/include/ustl/sistream.h
index 08e86e0..13fbf4b 100644
--- a/packages/language/cxx/ustl/current/include/ustl/sistream.h
+++ b/packages/language/cxx/ustl/current/include/ustl/sistream.h
@@ -8,6 +8,9 @@
 
 #include "mistream.h"
 #include "ustring.h"
+#ifndef EOF
+#define EOF (-1)
+#endif
 
 namespace ustl {
 
@@ -38,7 +41,7 @@ public:
     inline string		str (void) const	{ string s; s.link (*this); return (s); }
     inline istringstream&	str (const string& s)	{ link (s); return (*this); }
     inline istringstream&	get (char& c)	{ return (read (&c, sizeof(c))); }
-    inline int			get (void)	{ char c; get(c); return (c); }
+    inline int			get (void)	{ char c = EOF; get(c); return (c); }
     istringstream&		get (char* p, size_type n, char delim = '\n');
     istringstream&		get (string& s, char delim = '\n');
     istringstream&		getline (char* p, size_type n, char delim = '\n');
@@ -137,9 +140,6 @@ ISTRSTREAM_CAST_OPERATOR (char,		int8_t)
 ISTRSTREAM_CAST_OPERATOR (uint64_t,	int64_t)
 #endif
 #if SIZE_OF_LONG == SIZE_OF_INT
-// This works only properly if stdint.h typedefs int to int32_t. If stdint.h
-// typedefs long to int32_t then this causes compiler errors. So make shure
-// that your stdint.h file typedefs int to int32_t.
 ISTRSTREAM_CAST_OPERATOR (long,		int)
 ISTRSTREAM_CAST_OPERATOR (unsigned long,int)
 #endif
diff --git a/packages/language/cxx/ustl/current/include/ustl/uctrstrm.h b/packages/language/cxx/ustl/current/include/ustl/uctrstrm.h
index 62735cb..2a39766 100644
--- a/packages/language/cxx/ustl/current/include/ustl/uctrstrm.h
+++ b/packages/language/cxx/ustl/current/include/ustl/uctrstrm.h
@@ -117,7 +117,7 @@ istream& container_read (istream& is, Container& v)
     written_size_type n = 0;
     is >> n;
     const size_t expectedSize = n * stream_size_of(value_type());
-    if (!is.verify_remaining ("read", USTL_TYPENAME(v), expectedSize))
+    if (!is.verify_remaining ("read", typeid(v).name(), expectedSize))
 	return (is);
     if (alignof(NullValue<value_type>()) > alignof(n))
 	is >> ios::talign<value_type>();
diff --git a/packages/language/cxx/ustl/current/include/ustl/ulist.h b/packages/language/cxx/ustl/current/include/ustl/ulist.h
index eedf632..97de7a9 100644
--- a/packages/language/cxx/ustl/current/include/ustl/ulist.h
+++ b/packages/language/cxx/ustl/current/include/ustl/ulist.h
@@ -50,9 +50,8 @@ public:
 template <typename T>
 void list<T>::merge (list& l)
 {
-    list<T>::resize (size() + l.size());
-    iterator me = merge (begin(), end(), l.begin(), l.end(), begin());
-    list<T>::resize (distance (begin(), me));
+    insert_space (begin(), l.size());
+    ::ustl::merge (iat(l.size()), end(), l.begin(), l.end(), begin());
 }
 
 /// Moves the range [first, last) from \p l to this list at \p ip.
diff --git a/packages/language/cxx/ustl/current/include/ustl/umemory.h b/packages/language/cxx/ustl/current/include/ustl/umemory.h
index 238f5d3..05e8c34 100644
--- a/packages/language/cxx/ustl/current/include/ustl/umemory.h
+++ b/packages/language/cxx/ustl/current/include/ustl/umemory.h
@@ -75,8 +75,10 @@ template <typename ForwardIterator>
 inline void construct (ForwardIterator first, ForwardIterator last)
 {
     typedef typename iterator_traits<ForwardIterator>::value_type value_type;
-    if (!numeric_limits<value_type>::is_integral && first)
-	for (--last; first <= last; ++first)
+    if (numeric_limits<value_type>::is_integral)
+	memset (first, 0, distance(first,last)*sizeof(value_type));
+    else
+	for (--last; intptr_t(first) <= intptr_t(last); ++first)
 	    construct (&*first);
 }
 
@@ -101,7 +103,7 @@ inline void destroy (T* p) throw()
 // Helper templates to not instantiate anything for integral types.
 template <typename T>
 void dtors (T first, T last) throw()
-    { for (--last; first <= last; ++first) destroy (&*first); }
+    { for (--last; intptr_t(first) <= intptr_t(last); ++first) destroy (&*first); }
 template <typename T, bool bIntegral>
 struct Sdtorsr {
     inline void operator()(T first, T last) throw() { dtors (first, last); }
diff --git a/packages/language/cxx/ustl/current/include/ustl/uutility.h b/packages/language/cxx/ustl/current/include/ustl/uutility.h
index 40567dd..0e222a8 100644
--- a/packages/language/cxx/ustl/current/include/ustl/uutility.h
+++ b/packages/language/cxx/ustl/current/include/ustl/uutility.h
@@ -145,11 +145,13 @@ UNVOID_DISTANCE(const,)
 #undef UNVOID_DISTANCE
 #endif
 
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
 // The compiler issues a warning if an unsigned type is compared to 0.
 template <typename T, bool IsSigned> struct __is_negative { inline bool operator()(const T& v) { return (v < 0); } };
 template <typename T> struct __is_negative<T,false> { inline bool operator()(const T&) { return (false); } };
 /// Warning-free way to check if \p v is negative, even if for unsigned types.
 template <typename T> inline bool is_negative (const T& v) { return (__is_negative<T,numeric_limits<T>::is_signed>()(v)); }
+#endif
 
 /// \brief Returns the absolute value of \p v
 /// Unlike the stdlib functions, this is inline and works with all types.
@@ -339,6 +341,16 @@ inline bool TestAndSet (int* pm)
 #endif
 }
 
+inline uint32_t NextPow2 (uint32_t v)
+{
+    asm("dec\t%1\n\t"
+	"mov\t$1,%0\n\t"
+	"bsr\t%1,%1\n\t"
+	"inc\t%1\n\t"
+	"rol\t%b1,%0":"=&r"(v):"c"(v));
+    return (v);
+}
+
 /// \brief This template is to be used for dereferencing a type-punned pointer without a warning.
 ///
 /// When casting a local variable to an unrelated type through a pointer (for
diff --git a/packages/language/cxx/ustl/current/include/ustl/uvector.h b/packages/language/cxx/ustl/current/include/ustl/uvector.h
index 5acbfdf..fb50e40 100644
--- a/packages/language/cxx/ustl/current/include/ustl/uvector.h
+++ b/packages/language/cxx/ustl/current/include/ustl/uvector.h
@@ -98,7 +98,7 @@ public:
     inline void			write (ostream& os) const		{ container_write (os, *this); }
     inline void			text_write (ostringstream& os) const	{ container_text_write (os, *this); }
     inline size_t		stream_size (void) const		{ return (container_stream_size (*this)); }
-private:
+protected:
     inline iterator		insert_space (iterator ip, size_type n);
 private:
     memblock			m_Data;	///< Raw element data, consecutively stored.
diff --git a/packages/language/cxx/ustl/current/tests/bvt21.cpp b/packages/language/cxx/ustl/current/tests/bvt21.cpp
index 051bbe4..48b96fa 100644
--- a/packages/language/cxx/ustl/current/tests/bvt21.cpp
+++ b/packages/language/cxx/ustl/current/tests/bvt21.cpp
@@ -33,6 +33,12 @@ void TestUtility (void)
     cout << "Align(17,7) = " << Align(17,7) << endl;
     cout << "Align(14,7) = " << Align(14,7) << endl;
     cout << endl;
+    cout << "NextPow2(0) = " << NextPow2(0) << endl;
+    cout << "NextPow2(1) = " << NextPow2(1) << endl;
+    cout << "NextPow2(4) = " << NextPow2(4) << endl;
+    cout << "NextPow2(3827) = " << NextPow2(3827) << endl;
+    cout << "NextPow2(0xFFFFFFF0) = " << NextPow2(0xFFFFFFF0) << endl;
+    cout << endl;
     cout << "advance(42,0) = " << advance(42,0) << endl;
     cout << "advance(42,3) = " << advance(42,3) << endl;
     const void *cvp = (const void*) 0x1234;
diff --git a/packages/language/cxx/ustl/current/tests/bvt21.std b/packages/language/cxx/ustl/current/tests/bvt21.std
index 7c60a5d..82b15a2 100644
--- a/packages/language/cxx/ustl/current/tests/bvt21.std
+++ b/packages/language/cxx/ustl/current/tests/bvt21.std
@@ -7,6 +7,12 @@ Align(5,2) = 6
 Align(17,7) = 21
 Align(14,7) = 14
 
+NextPow2(0) = 1
+NextPow2(1) = 2
+NextPow2(4) = 4
+NextPow2(3827) = 4096
+NextPow2(0xFFFFFFF0) = 1
+
 advance(42,0) = 42
 advance(42,3) = 45
 cvp = 1234

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

* Re: uSTL 1.4 update
  2010-06-25 14:33 uSTL 1.4 update Simon Kallweit
@ 2010-06-28  8:32 ` John Dallaway
  2010-06-28  9:19 ` John Dallaway
  1 sibling, 0 replies; 13+ messages in thread
From: John Dallaway @ 2010-06-28  8:32 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: eCos Patches List

Simon Kallweit wrote:

> This patch will update uSTL to the newest 1.4 sources. Minor updates.

Thank you, Simon. I will take a look at this today...

John Dallaway
eCos maintainer

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

* Re: uSTL 1.4 update
  2010-06-25 14:33 uSTL 1.4 update Simon Kallweit
  2010-06-28  8:32 ` John Dallaway
@ 2010-06-28  9:19 ` John Dallaway
  2010-06-28  9:34   ` Simon Kallweit
  1 sibling, 1 reply; 13+ messages in thread
From: John Dallaway @ 2010-06-28  9:19 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: ecos-patches, Uwe Kindler

Hi Simon

Simon Kallweit wrote:

> This patch will update uSTL to the newest 1.4 sources. Minor updates.

It seems that uSTL 1.4 has introduced a portability issue. Building the
tests for target "m5272c3" (for example):

> m68k-elf-gcc -c  -I/var/tmp/ustl-test/install/include -I/var/local/cvs/ecos/packages/language/cxx/ustl/current -I/var/local/cvs/ecos/packages/language/cxx/ustl/current/src -I/var/local/cvs/ecos/packages/language/cxx/ustl/current/tests -I. -I/var/local/cvs/ecos/packages/language/cxx/ustl/current/tests/ -finline-limit=7000 -Wall -Wpointer-arith  -Woverloaded-virtual -Wno-write-strings -mcpu=5272 -malign-int -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fomit-frame-pointer -I/var/tmp/ustl-test/install/include/ustl -Wp,-MD,tests/bvt21.tmp -o tests/bvt21.o /var/local/cvs/ecos/packages/language/cxx/ustl/current/tests/bvt21.cpp
> /var/tmp/ustl-test/install/include/ustl/uutility.h: In function ‘void TestUtility()’:
> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
> make[1]: *** [tests/bvt21.d] Error 1
> make[1]: Leaving directory `/var/tmp/ustl-test/language/cxx/ustl/current'
> make: *** [tests] Error 2

Are you able to provide a portable implementation of NextPow2() and
submit upstream?

Note also that your patch to include/ustl/uctrstrm.h prevents building
uSTL with "-fno-rtti" and should be omitted.

I'm copying Uwe Kindler to ensure he's aware of your contribution.

John Dallaway
eCos maintainers

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

* Re: uSTL 1.4 update
  2010-06-28  9:19 ` John Dallaway
@ 2010-06-28  9:34   ` Simon Kallweit
  2010-06-28 12:09     ` Simon Kallweit
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Kallweit @ 2010-06-28  9:34 UTC (permalink / raw)
  To: John Dallaway; +Cc: ecos-patches, Uwe Kindler

Hi John

Sorry, that was pretty bad testing on my side ;) only did some tests on 
the synth target. The shortcomings are pretty obvious!

I'll fix the mistakes and post an updated patch.

Simon

On 06/28/2010 11:19 AM, John Dallaway wrote:
> Hi Simon
>
> Simon Kallweit wrote:
>
>> This patch will update uSTL to the newest 1.4 sources. Minor updates.
>
> It seems that uSTL 1.4 has introduced a portability issue. Building the
> tests for target "m5272c3" (for example):
>
>> m68k-elf-gcc -c  -I/var/tmp/ustl-test/install/include -I/var/local/cvs/ecos/packages/language/cxx/ustl/current -I/var/local/cvs/ecos/packages/language/cxx/ustl/current/src -I/var/local/cvs/ecos/packages/language/cxx/ustl/current/tests -I. -I/var/local/cvs/ecos/packages/language/cxx/ustl/current/tests/ -finline-limit=7000 -Wall -Wpointer-arith  -Woverloaded-virtual -Wno-write-strings -mcpu=5272 -malign-int -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fomit-frame-pointer -I/var/tmp/ustl-test/install/include/ustl -Wp,-MD,tests/bvt21.tmp -o tests/bvt21.o /var/local/cvs/ecos/packages/language/cxx/ustl/current/tests/bvt21.cpp
>> /var/tmp/ustl-test/install/include/ustl/uutility.h: In function ‘void TestUtility()’:
>> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
>> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
>> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
>> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
>> /var/tmp/ustl-test/install/include/ustl/uutility.h:350: error: impossible constraint in ‘asm’
>> make[1]: *** [tests/bvt21.d] Error 1
>> make[1]: Leaving directory `/var/tmp/ustl-test/language/cxx/ustl/current'
>> make: *** [tests] Error 2
>
> Are you able to provide a portable implementation of NextPow2() and
> submit upstream?
>
> Note also that your patch to include/ustl/uctrstrm.h prevents building
> uSTL with "-fno-rtti" and should be omitted.
>
> I'm copying Uwe Kindler to ensure he's aware of your contribution.
>
> John Dallaway
> eCos maintainers

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

* Re: uSTL 1.4 update
  2010-06-28  9:34   ` Simon Kallweit
@ 2010-06-28 12:09     ` Simon Kallweit
  2010-06-28 12:59       ` John Dallaway
  2010-06-29  8:05       ` John Dallaway
  0 siblings, 2 replies; 13+ messages in thread
From: Simon Kallweit @ 2010-06-28 12:09 UTC (permalink / raw)
  To: John Dallaway; +Cc: ecos-patches, Uwe Kindler

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

On 06/28/2010 11:34 AM, Simon Kallweit wrote:
> Hi John
>
> Sorry, that was pretty bad testing on my side ;) only did some tests on
> the synth target. The shortcomings are pretty obvious!
>
> I'll fix the mistakes and post an updated patch.

Here is the updated patch.

Added a generic implementation for the NextPow2, which is currently 
suboptimal but mimics what the x86 implementation is doing. Also removed 
the introduced change in include/ustl/uctrstrm.h so it should build 
again with -fno-rtti.

Simon

[-- Attachment #2: ustl-1.4.patch --]
[-- Type: text/x-patch, Size: 10763 bytes --]

diff --git a/packages/language/cxx/ustl/current/ChangeLog b/packages/language/cxx/ustl/current/ChangeLog
index 7fdc5de..88c1d5c 100644
--- a/packages/language/cxx/ustl/current/ChangeLog
+++ b/packages/language/cxx/ustl/current/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-25  Simon Kallweit <simon.kallweit@intefo.ch>
+
+	* include/*:
+	* tests/*:
+	* HISTORY:
+	* LICENSE: Updated to uSTL 1.4 sources.
+
 2009-10-06  Uwe Kindler <uwe_kindler@web.de>
 
 	* doc/ustl.sgml: Removed cout.flush() from example and from note.
diff --git a/packages/language/cxx/ustl/current/HISTORY b/packages/language/cxx/ustl/current/HISTORY
index f7177a1..3540e89 100644
--- a/packages/language/cxx/ustl/current/HISTORY
+++ b/packages/language/cxx/ustl/current/HISTORY
@@ -1,3 +1,9 @@
+2010-03-21 Release 1.4
+	* Fixed crash in destructor of empty vector, introduced by 1.3
+	* Fixed list merge, which previously did not compile
+	* Some portability changes to configure so it will work with dash
+	    when escape char processing bug is fixed (Ubuntu bug #268929)
+
 2009-08-04 Release 1.3
 	* Some API changes to comply with the current C++ standard
 	    binary_search algo returns true, not the found iterator
diff --git a/packages/language/cxx/ustl/current/LICENSE b/packages/language/cxx/ustl/current/LICENSE
index e80e7a8..857a9b4 100644
--- a/packages/language/cxx/ustl/current/LICENSE
+++ b/packages/language/cxx/ustl/current/LICENSE
@@ -1,24 +1,22 @@
 
 			The MIT License
 
-Copyright (C) 2005 by Mike Sharov <msharov@users.sourceforge.net>
+Copyright (c) 2005-2009 by Mike Sharov <msharov@users.sourceforge.net>
 
 Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included
 in all copies or substantial portions of the Software.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/packages/language/cxx/ustl/current/include/ustl/sistream.h b/packages/language/cxx/ustl/current/include/ustl/sistream.h
index 08e86e0..13fbf4b 100644
--- a/packages/language/cxx/ustl/current/include/ustl/sistream.h
+++ b/packages/language/cxx/ustl/current/include/ustl/sistream.h
@@ -8,6 +8,9 @@
 
 #include "mistream.h"
 #include "ustring.h"
+#ifndef EOF
+#define EOF (-1)
+#endif
 
 namespace ustl {
 
@@ -38,7 +41,7 @@ public:
     inline string		str (void) const	{ string s; s.link (*this); return (s); }
     inline istringstream&	str (const string& s)	{ link (s); return (*this); }
     inline istringstream&	get (char& c)	{ return (read (&c, sizeof(c))); }
-    inline int			get (void)	{ char c; get(c); return (c); }
+    inline int			get (void)	{ char c = EOF; get(c); return (c); }
     istringstream&		get (char* p, size_type n, char delim = '\n');
     istringstream&		get (string& s, char delim = '\n');
     istringstream&		getline (char* p, size_type n, char delim = '\n');
@@ -137,9 +140,6 @@ ISTRSTREAM_CAST_OPERATOR (char,		int8_t)
 ISTRSTREAM_CAST_OPERATOR (uint64_t,	int64_t)
 #endif
 #if SIZE_OF_LONG == SIZE_OF_INT
-// This works only properly if stdint.h typedefs int to int32_t. If stdint.h
-// typedefs long to int32_t then this causes compiler errors. So make shure
-// that your stdint.h file typedefs int to int32_t.
 ISTRSTREAM_CAST_OPERATOR (long,		int)
 ISTRSTREAM_CAST_OPERATOR (unsigned long,int)
 #endif
diff --git a/packages/language/cxx/ustl/current/include/ustl/ulist.h b/packages/language/cxx/ustl/current/include/ustl/ulist.h
index eedf632..97de7a9 100644
--- a/packages/language/cxx/ustl/current/include/ustl/ulist.h
+++ b/packages/language/cxx/ustl/current/include/ustl/ulist.h
@@ -50,9 +50,8 @@ public:
 template <typename T>
 void list<T>::merge (list& l)
 {
-    list<T>::resize (size() + l.size());
-    iterator me = merge (begin(), end(), l.begin(), l.end(), begin());
-    list<T>::resize (distance (begin(), me));
+    insert_space (begin(), l.size());
+    ::ustl::merge (iat(l.size()), end(), l.begin(), l.end(), begin());
 }
 
 /// Moves the range [first, last) from \p l to this list at \p ip.
diff --git a/packages/language/cxx/ustl/current/include/ustl/umemory.h b/packages/language/cxx/ustl/current/include/ustl/umemory.h
index 238f5d3..05e8c34 100644
--- a/packages/language/cxx/ustl/current/include/ustl/umemory.h
+++ b/packages/language/cxx/ustl/current/include/ustl/umemory.h
@@ -75,8 +75,10 @@ template <typename ForwardIterator>
 inline void construct (ForwardIterator first, ForwardIterator last)
 {
     typedef typename iterator_traits<ForwardIterator>::value_type value_type;
-    if (!numeric_limits<value_type>::is_integral && first)
-	for (--last; first <= last; ++first)
+    if (numeric_limits<value_type>::is_integral)
+	memset (first, 0, distance(first,last)*sizeof(value_type));
+    else
+	for (--last; intptr_t(first) <= intptr_t(last); ++first)
 	    construct (&*first);
 }
 
@@ -101,7 +103,7 @@ inline void destroy (T* p) throw()
 // Helper templates to not instantiate anything for integral types.
 template <typename T>
 void dtors (T first, T last) throw()
-    { for (--last; first <= last; ++first) destroy (&*first); }
+    { for (--last; intptr_t(first) <= intptr_t(last); ++first) destroy (&*first); }
 template <typename T, bool bIntegral>
 struct Sdtorsr {
     inline void operator()(T first, T last) throw() { dtors (first, last); }
diff --git a/packages/language/cxx/ustl/current/include/ustl/uutility.h b/packages/language/cxx/ustl/current/include/ustl/uutility.h
index 40567dd..7cb5139 100644
--- a/packages/language/cxx/ustl/current/include/ustl/uutility.h
+++ b/packages/language/cxx/ustl/current/include/ustl/uutility.h
@@ -145,11 +145,13 @@ UNVOID_DISTANCE(const,)
 #undef UNVOID_DISTANCE
 #endif
 
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
 // The compiler issues a warning if an unsigned type is compared to 0.
 template <typename T, bool IsSigned> struct __is_negative { inline bool operator()(const T& v) { return (v < 0); } };
 template <typename T> struct __is_negative<T,false> { inline bool operator()(const T&) { return (false); } };
 /// Warning-free way to check if \p v is negative, even if for unsigned types.
 template <typename T> inline bool is_negative (const T& v) { return (__is_negative<T,numeric_limits<T>::is_signed>()(v)); }
+#endif
 
 /// \brief Returns the absolute value of \p v
 /// Unlike the stdlib functions, this is inline and works with all types.
@@ -339,6 +341,26 @@ inline bool TestAndSet (int* pm)
 #endif
 }
 
+inline uint32_t NextPow2 (uint32_t v)
+{
+#if __i386__ || __x86_64__
+	asm("dec\t%1\n\t"
+	"mov\t$1,%0\n\t"
+	"bsr\t%1,%1\n\t"
+	"inc\t%1\n\t"
+	"rol\t%b1,%0":"=&r"(v):"c"(v));
+    return (v);
+#else
+    // The following code is sub-optimal but mimics the x86 implementation
+    int i = 31;
+    v--;
+    while (!(v & (1 << i)) && i > 0) i--;
+    if (i == 31)
+    	return 1;
+    return (1 << (i + 1));
+#endif
+}
+
 /// \brief This template is to be used for dereferencing a type-punned pointer without a warning.
 ///
 /// When casting a local variable to an unrelated type through a pointer (for
diff --git a/packages/language/cxx/ustl/current/include/ustl/uvector.h b/packages/language/cxx/ustl/current/include/ustl/uvector.h
index 5acbfdf..fb50e40 100644
--- a/packages/language/cxx/ustl/current/include/ustl/uvector.h
+++ b/packages/language/cxx/ustl/current/include/ustl/uvector.h
@@ -98,7 +98,7 @@ public:
     inline void			write (ostream& os) const		{ container_write (os, *this); }
     inline void			text_write (ostringstream& os) const	{ container_text_write (os, *this); }
     inline size_t		stream_size (void) const		{ return (container_stream_size (*this)); }
-private:
+protected:
     inline iterator		insert_space (iterator ip, size_type n);
 private:
     memblock			m_Data;	///< Raw element data, consecutively stored.
diff --git a/packages/language/cxx/ustl/current/tests/bvt21.cpp b/packages/language/cxx/ustl/current/tests/bvt21.cpp
index 051bbe4..48b96fa 100644
--- a/packages/language/cxx/ustl/current/tests/bvt21.cpp
+++ b/packages/language/cxx/ustl/current/tests/bvt21.cpp
@@ -33,6 +33,12 @@ void TestUtility (void)
     cout << "Align(17,7) = " << Align(17,7) << endl;
     cout << "Align(14,7) = " << Align(14,7) << endl;
     cout << endl;
+    cout << "NextPow2(0) = " << NextPow2(0) << endl;
+    cout << "NextPow2(1) = " << NextPow2(1) << endl;
+    cout << "NextPow2(4) = " << NextPow2(4) << endl;
+    cout << "NextPow2(3827) = " << NextPow2(3827) << endl;
+    cout << "NextPow2(0xFFFFFFF0) = " << NextPow2(0xFFFFFFF0) << endl;
+    cout << endl;
     cout << "advance(42,0) = " << advance(42,0) << endl;
     cout << "advance(42,3) = " << advance(42,3) << endl;
     const void *cvp = (const void*) 0x1234;
diff --git a/packages/language/cxx/ustl/current/tests/bvt21.std b/packages/language/cxx/ustl/current/tests/bvt21.std
index 7c60a5d..82b15a2 100644
--- a/packages/language/cxx/ustl/current/tests/bvt21.std
+++ b/packages/language/cxx/ustl/current/tests/bvt21.std
@@ -7,6 +7,12 @@ Align(5,2) = 6
 Align(17,7) = 21
 Align(14,7) = 14
 
+NextPow2(0) = 1
+NextPow2(1) = 2
+NextPow2(4) = 4
+NextPow2(3827) = 4096
+NextPow2(0xFFFFFFF0) = 1
+
 advance(42,0) = 42
 advance(42,3) = 45
 cvp = 1234

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

* Re: uSTL 1.4 update
  2010-06-28 12:09     ` Simon Kallweit
@ 2010-06-28 12:59       ` John Dallaway
  2010-06-28 13:15         ` Simon Kallweit
  2010-06-29  8:05       ` John Dallaway
  1 sibling, 1 reply; 13+ messages in thread
From: John Dallaway @ 2010-06-28 12:59 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: ecos-patches, Uwe Kindler

Hi Simon

Simon Kallweit wrote:

> Here is the updated patch.
> 
> Added a generic implementation for the NextPow2, which is currently
> suboptimal but mimics what the x86 implementation is doing. Also removed
> the introduced change in include/ustl/uctrstrm.h so it should build
> again with -fno-rtti.

Thank you. Tests are now building fine for M5272C3 but there's an error
building for the synthetic target on my CentOS 5 (32-bit) box:

> gcc -L/var/tmp/ustl-test/install/lib -Ttarget.ld -o /var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23 tests/bvt23.o -g -nostdlib -Wl,--gc-sections -Wl,-static 
> tests/bvt23.o: In function `ustl::simd::fround<double, int>::operator()(double const&) const':
> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference to `lrint'
> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference to `lrint'
> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference to `lrint'
> tests/bvt23.o: In function `ustl::simd::fround<float, int>::operator()(float const&) const':
> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference to `lrintf'
> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference to `lrintf'
> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference to `lrintf'
> collect2: ld returned 1 exit status
> make[1]: *** [/var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23] Error 1
> make[1]: Leaving directory `/var/tmp/ustl-test/language/cxx/ustl/current'
> make: *** [tests] Error 2

Are you seeing this error?

John Dallaway
eCos maintainer

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

* Re: uSTL 1.4 update
  2010-06-28 12:59       ` John Dallaway
@ 2010-06-28 13:15         ` Simon Kallweit
  2010-06-28 13:51           ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Kallweit @ 2010-06-28 13:15 UTC (permalink / raw)
  To: John Dallaway; +Cc: ecos-patches, Uwe Kindler

On 06/28/2010 02:59 PM, John Dallaway wrote:
> Hi Simon
>
> Simon Kallweit wrote:
>
>> Here is the updated patch.
>>
>> Added a generic implementation for the NextPow2, which is currently
>> suboptimal but mimics what the x86 implementation is doing. Also removed
>> the introduced change in include/ustl/uctrstrm.h so it should build
>> again with -fno-rtti.
>
> Thank you. Tests are now building fine for M5272C3 but there's an error
> building for the synthetic target on my CentOS 5 (32-bit) box:
>
>> gcc -L/var/tmp/ustl-test/install/lib -Ttarget.ld -o /var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23 tests/bvt23.o -g -nostdlib -Wl,--gc-sections -Wl,-static
>> tests/bvt23.o: In function `ustl::simd::fround<double, int>::operator()(double const&) const':
>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference to `lrint'
>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference to `lrint'
>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference to `lrint'
>> tests/bvt23.o: In function `ustl::simd::fround<float, int>::operator()(float const&) const':
>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference to `lrintf'
>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference to `lrintf'
>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference to `lrintf'
>> collect2: ld returned 1 exit status
>> make[1]: *** [/var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23] Error 1
>> make[1]: Leaving directory `/var/tmp/ustl-test/language/cxx/ustl/current'
>> make: *** [tests] Error 2
>
> Are you seeing this error?

It builds fine on my Ubuntu 10.04 LTS 32-bit :/

Simon

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

* Re: uSTL 1.4 update
  2010-06-28 13:15         ` Simon Kallweit
@ 2010-06-28 13:51           ` Sergei Gavrikov
  2010-06-28 19:21             ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2010-06-28 13:51 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: John Dallaway, ecos-patches, Uwe Kindler

On Mon, 28 Jun 2010, Simon Kallweit wrote:

> On 06/28/2010 02:59 PM, John Dallaway wrote:
>> Hi Simon
>> 
>> Simon Kallweit wrote:
>> 
>>> Here is the updated patch.
>>> 
>>> Added a generic implementation for the NextPow2, which is currently
>>> suboptimal but mimics what the x86 implementation is doing. Also removed
>>> the introduced change in include/ustl/uctrstrm.h so it should build
>>> again with -fno-rtti.
>> 
>> Thank you. Tests are now building fine for M5272C3 but there's an error
>> building for the synthetic target on my CentOS 5 (32-bit) box:
>> 
>>> gcc -L/var/tmp/ustl-test/install/lib -Ttarget.ld -o 
>>> /var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23 
>>> tests/bvt23.o -g -nostdlib -Wl,--gc-sections -Wl,-static
>>> tests/bvt23.o: In function `ustl::simd::fround<double, 
>>> int>::operator()(double const&) const':
>>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference to 
>>> `lrint'
>>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference to 
>>> `lrint'
>>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference to 
>>> `lrint'
>>> tests/bvt23.o: In function `ustl::simd::fround<float, 
>>> int>::operator()(float const&) const':
>>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference to 
>>> `lrintf'
>>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference to 
>>> `lrintf'
>>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference to 
>>> `lrintf'
>>> collect2: ld returned 1 exit status
>>> make[1]: *** 
>>> [/var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23] 
>>> Error 1
>>> make[1]: Leaving directory `/var/tmp/ustl-test/language/cxx/ustl/current'
>>> make: *** [tests] Error 2
>> 
>> Are you seeing this error?
>
> It builds fine on my Ubuntu 10.04 LTS 32-bit :/

Hi Simon
and John,

I built successfully uSTL tests using the Simon's latest patch for
arm7tdmi, i386 pc (i386-elf-gcc from eCosCentric) targets.

But, when I tried to build it for i386linux target I got the same error
likes John got.

Simon, I often run update-manager :-( and my stuff is

$ uname -r
2.6.32-22-generic

$ /lib/libc.so.6 | head -1
GNU C Library (Ubuntu EGLIBC 2.11.1-0ubuntu7.1) stable release version 2.11.1, by Roland McGrath et al.

$ gcc -v 2>&1 | grep ^gcc
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)

$ lsb_release -c -r -d
Description:	Ubuntu 10.04 LTS
Release:	10.04
Codename:	lucid

$ make -s -C language/cxx/ustl/* tests 2>&1
tests/bvt23.o: In function `ustl::simd::fround<float, int>::operator()(float const&) const':
/tmp/ustl_synth/install/include/ustl/simd.h:107: undefined reference to `lrintf'
/tmp/ustl_synth/install/include/ustl/simd.h:107: undefined reference to `lrintf'
/tmp/ustl_synth/install/include/ustl/simd.h:107: undefined reference to `lrintf'
tests/bvt23.o: In function `ustl::simd::fround<double, int>::operator()(double const&) const':
/tmp/ustl_synth/install/include/ustl/simd.h:109: undefined reference to `lrint'
/tmp/ustl_synth/install/include/ustl/simd.h:109: undefined reference to `lrint'
/tmp/ustl_synth/install/include/ustl/simd.h:109: undefined reference to `lrint'
collect2: ld returned 1 exit status
make: *** [/tmp/ustl_synth/install/tests/language/cxx/ustl/current/tests/bvt23] Error 1

It seems for me we have to try something is suggested here (for example)
http://lists.busybox.net/pipermail/uclibc-cvs/2005-December/007852.html

Though I did not grep much the NET for the issue...

I will try to investigate in the issue tonight.

Sergei

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

* Re: uSTL 1.4 update
  2010-06-28 13:51           ` Sergei Gavrikov
@ 2010-06-28 19:21             ` Sergei Gavrikov
  2010-06-29  6:34               ` Sergei Gavrikov
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2010-06-28 19:21 UTC (permalink / raw)
  To: John Dallaway; +Cc: Simon Kallweit, eCos Patches, Uwe Kindler

On Mon, 28 Jun 2010, Sergei Gavrikov wrote:

> On Mon, 28 Jun 2010, Simon Kallweit wrote:
>
>> On 06/28/2010 02:59 PM, John Dallaway wrote:
>>> Hi Simon
>>> 
>>> Simon Kallweit wrote:
>>> 
>>>> Here is the updated patch.
>>>> 
>>>> Added a generic implementation for the NextPow2, which is currently
>>>> suboptimal but mimics what the x86 implementation is doing. Also removed
>>>> the introduced change in include/ustl/uctrstrm.h so it should build
>>>> again with -fno-rtti.
>>> 
>>> Thank you. Tests are now building fine for M5272C3 but there's an error
>>> building for the synthetic target on my CentOS 5 (32-bit) box:
>>> 
>>>> gcc -L/var/tmp/ustl-test/install/lib -Ttarget.ld -o 
>>>> /var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23 
>>>> tests/bvt23.o -g -nostdlib -Wl,--gc-sections -Wl,-static
>>>> tests/bvt23.o: In function `ustl::simd::fround<double, 
>>>> int>::operator()(double const&) const':
>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference 
>>>> to `lrint'
>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference 
>>>> to `lrint'
>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference 
>>>> to `lrint'
>>>> tests/bvt23.o: In function `ustl::simd::fround<float, 
>>>> int>::operator()(float const&) const':
>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference 
>>>> to `lrintf'
>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference 
>>>> to `lrintf'
>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference 
>>>> to `lrintf'
>>>> collect2: ld returned 1 exit status
>>>> make[1]: *** 
>>>> [/var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23] 
>>>> Error 1
>>>> make[1]: Leaving directory `/var/tmp/ustl-test/language/cxx/ustl/current'
>>>> make: *** [tests] Error 2
>>> 
>>> Are you seeing this error?
>> 
>> It builds fine on my Ubuntu 10.04 LTS 32-bit :/
>
> Hi Simon
> and John,
>
> I built successfully uSTL tests using the Simon's latest patch for
> arm7tdmi, i386 pc (i386-elf-gcc from eCosCentric) targets.
>
> But, when I tried to build it for i386linux target I got the same error
> likes John got.
>
> Simon, I often run update-manager :-( and my stuff is

[snip]

> I will try to investigate in the issue tonight.

Hi

I could not understand why a build with native GCC wanted 'lrint'
http://www.opengroup.org/onlinepubs/009695399/functions/lrint.html

I tried a hack (added libm.a to linker GROUP), and that helped...

$ sed -i 's,libgcc_eh.a,& libm.a,' install/lib/target.ld

$ grep GROUP install/lib/target.ld
GROUP(libtarget.a libgcc.a libsupc++.a libgcc_eh.a libm.a)

Well, this was brutal hack, but it was possible to build all tests on my
Linux box. Should we implement 'lrint' in eCos libm?

Sergei

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

* Re: uSTL 1.4 update
  2010-06-28 19:21             ` Sergei Gavrikov
@ 2010-06-29  6:34               ` Sergei Gavrikov
  2010-06-29  7:17                 ` John Dallaway
  0 siblings, 1 reply; 13+ messages in thread
From: Sergei Gavrikov @ 2010-06-29  6:34 UTC (permalink / raw)
  To: John Dallaway; +Cc: Simon Kallweit, eCos Patches

Hi

Now I see that is not uSTL *1.4* issue. I tried to build 'bvt23' using a
prepatched version of uSTL (1.3) for synthetic target and I got that
stop too!

IMO, the linking error on sythetic cannot stop the uSTL updating. May be
we have to register the linking issue on Bugzilla instead?

John, can you confirm the linking issue with uSTL 1.3 for synthetic in
your Linux environment?

Sergei

On Mon, 28 Jun 2010, Sergei Gavrikov wrote:

> On Mon, 28 Jun 2010, Sergei Gavrikov wrote:
>
>> On Mon, 28 Jun 2010, Simon Kallweit wrote:
>> 
>>> On 06/28/2010 02:59 PM, John Dallaway wrote:
>>>> Hi Simon
>>>> 
>>>> Simon Kallweit wrote:
>>>> 
>>>>> Here is the updated patch.
>>>>> 
>>>>> Added a generic implementation for the NextPow2, which is currently
>>>>> suboptimal but mimics what the x86 implementation is doing. Also removed
>>>>> the introduced change in include/ustl/uctrstrm.h so it should build
>>>>> again with -fno-rtti.
>>>> 
>>>> Thank you. Tests are now building fine for M5272C3 but there's an error
>>>> building for the synthetic target on my CentOS 5 (32-bit) box:
>>>> 
>>>>> gcc -L/var/tmp/ustl-test/install/lib -Ttarget.ld -o 
>>>>> /var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23 
>>>>> tests/bvt23.o -g -nostdlib -Wl,--gc-sections -Wl,-static
>>>>> tests/bvt23.o: In function `ustl::simd::fround<double, 
>>>>> int>::operator()(double const&) const':
>>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference 
>>>>> to `lrint'
>>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference 
>>>>> to `lrint'
>>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:109: undefined reference 
>>>>> to `lrint'
>>>>> tests/bvt23.o: In function `ustl::simd::fround<float, 
>>>>> int>::operator()(float const&) const':
>>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference 
>>>>> to `lrintf'
>>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference 
>>>>> to `lrintf'
>>>>> /var/tmp/ustl-test/install/include/ustl/simd.h:107: undefined reference 
>>>>> to `lrintf'
>>>>> collect2: ld returned 1 exit status
>>>>> make[1]: *** 
>>>>> [/var/tmp/ustl-test/install/tests/language/cxx/ustl/current/tests/bvt23] 
>>>>> Error 1
>>>>> make[1]: Leaving directory 
>>>>> `/var/tmp/ustl-test/language/cxx/ustl/current'
>>>>> make: *** [tests] Error 2
>>>> 
>>>> Are you seeing this error?
>>> 
>>> It builds fine on my Ubuntu 10.04 LTS 32-bit :/
>> 
>> Hi Simon
>> and John,
>> 
>> I built successfully uSTL tests using the Simon's latest patch for
>> arm7tdmi, i386 pc (i386-elf-gcc from eCosCentric) targets.
>> 
>> But, when I tried to build it for i386linux target I got the same error
>> likes John got.
>> 
>> Simon, I often run update-manager :-( and my stuff is
>
> [snip]
>
>> I will try to investigate in the issue tonight.
>
> Hi
>
> I could not understand why a build with native GCC wanted 'lrint'
> http://www.opengroup.org/onlinepubs/009695399/functions/lrint.html
>
> I tried a hack (added libm.a to linker GROUP), and that helped...
>
> $ sed -i 's,libgcc_eh.a,& libm.a,' install/lib/target.ld
>
> $ grep GROUP install/lib/target.ld
> GROUP(libtarget.a libgcc.a libsupc++.a libgcc_eh.a libm.a)
>
> Well, this was brutal hack, but it was possible to build all tests on my
> Linux box. Should we implement 'lrint' in eCos libm?
>
> Sergei
>

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

* Re: uSTL 1.4 update
  2010-06-29  6:34               ` Sergei Gavrikov
@ 2010-06-29  7:17                 ` John Dallaway
  2010-06-29  7:23                   ` Simon Kallweit
  0 siblings, 1 reply; 13+ messages in thread
From: John Dallaway @ 2010-06-29  7:17 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: Simon Kallweit, eCos Patches

Hi Sergei

Sergei Gavrikov wrote:

> Now I see that is not uSTL *1.4* issue. I tried to build 'bvt23' using a
> prepatched version of uSTL (1.3) for synthetic target and I got that
> stop too!

Yes.

> IMO, the linking error on sythetic cannot stop the uSTL updating. May be
> we have to register the linking issue on Bugzilla instead?

I agree. I will check-in Simon's update shortly.

John Dallaway
eCos maintainer

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

* Re: uSTL 1.4 update
  2010-06-29  7:17                 ` John Dallaway
@ 2010-06-29  7:23                   ` Simon Kallweit
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Kallweit @ 2010-06-29  7:23 UTC (permalink / raw)
  To: John Dallaway; +Cc: Sergei Gavrikov, eCos Patches

On 06/29/2010 09:16 AM, John Dallaway wrote:
> Hi Sergei
>
> Sergei Gavrikov wrote:
>
>> Now I see that is not uSTL *1.4* issue. I tried to build 'bvt23' using a
>> prepatched version of uSTL (1.3) for synthetic target and I got that
>> stop too!
>
> Yes.

Is the same on my (now updated) system.

>
>> IMO, the linking error on sythetic cannot stop the uSTL updating. May be
>> we have to register the linking issue on Bugzilla instead?
>
> I agree. I will check-in Simon's update shortly.

Great!

Simon

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

* Re: uSTL 1.4 update
  2010-06-28 12:09     ` Simon Kallweit
  2010-06-28 12:59       ` John Dallaway
@ 2010-06-29  8:05       ` John Dallaway
  1 sibling, 0 replies; 13+ messages in thread
From: John Dallaway @ 2010-06-29  8:05 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: ecos-patches, Uwe Kindler

Hi Simon

Simon Kallweit wrote:

> Added a generic implementation for the NextPow2, which is currently
> suboptimal but mimics what the x86 implementation is doing. Also removed
> the introduced change in include/ustl/uctrstrm.h so it should build
> again with -fno-rtti.

Now checked in. Thank you for the contribution.

I recommend that you submit your portable NextPow2 implementation to
Mike Sharov as a patch for inclusion in the uSTL master repository.

John Dallaway
eCos maintainer

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

end of thread, other threads:[~2010-06-29  8:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-25 14:33 uSTL 1.4 update Simon Kallweit
2010-06-28  8:32 ` John Dallaway
2010-06-28  9:19 ` John Dallaway
2010-06-28  9:34   ` Simon Kallweit
2010-06-28 12:09     ` Simon Kallweit
2010-06-28 12:59       ` John Dallaway
2010-06-28 13:15         ` Simon Kallweit
2010-06-28 13:51           ` Sergei Gavrikov
2010-06-28 19:21             ` Sergei Gavrikov
2010-06-29  6:34               ` Sergei Gavrikov
2010-06-29  7:17                 ` John Dallaway
2010-06-29  7:23                   ` Simon Kallweit
2010-06-29  8:05       ` John Dallaway

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