[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#753079: c++11 mode in GCC is still marked as experimental (although armel needs work)



Hi

On Sat, Jul 12, 2014 at 02:00:35PM +0200, Matthias Klose wrote:
> I would rather drop any package which does use c++11 features without any
> reflection. 

I now understand the problem.  Thanks.

On Sat, Jul 12, 2014 at 01:10:52PM +0200, Julien Cristau wrote:
> No, just because some random c++11 thing doesn't work on armel doesn't
> mean we drop the arch.  
>
> What it means is packages get to work without it until it's fixed.

Yes, I see.  (I was wrong.)

https://bugs.debian.org/727621
There seems to be some issue related to ATOMIC_type_LOCK_FREE.  (I have
no clue but it is related to type.)

I also see FEDORA applied attached arm patch changing float to double
and doing the alignment computing for mapped file.

Is this patch something which work around the issue on armel?

Also, as I see the upstream git repo, just after his release of this
tar, he is commiting 
     5c274357ceaaff941b91e12d3f2f4714df0ecd16
to revert CMakeLists.txt of oldscheool branch as:

-if(UNIX)
-  add_definitions("-std=c++11")
-endif(UNIX)

Then recent commit has
+ if(NOT BOOST_USE_CXX11)
+   add_definitions("-DBOOST_NO_CXX11_SCOPED_ENUMS")
+ endif()

Are these kind of updates needed?

Guo Yixuan,

Can you talk to the upstream on this issue and what oldschool devel
branches mean?

Osamu

Index: librime/include/rime/dict/mapped_file.h
===================================================================
--- librime.orig/include/rime/dict/mapped_file.h
+++ librime/include/rime/dict/mapped_file.h
@@ -133,7 +133,9 @@ template <class T>
 T* MappedFile::Allocate(size_t count) {
   if (!IsOpen())
     return NULL;
-  size_t used_space = size_;
+
+  /* do the alignment computing for mapped file. */
+  size_t used_space = (size_ + __alignof__(T) - 1) & ~(__alignof__(T) - 1);
   size_t required_space = sizeof(T) * count;
   size_t file_size = capacity();
   if (used_space + required_space > file_size) {
@@ -141,13 +143,11 @@ T* MappedFile::Allocate(size_t count) {
     size_t new_size = (std::max)(used_space + required_space, file_size * 2);
     if(!Resize(new_size) || !OpenReadWrite())
       return NULL;
-    // note that size_ has been reset after the file was closed for resizing
-    // now lets restore it to the saved value
-    size_ = used_space;
   }
+
   T* ptr = reinterpret_cast<T*>(address() + used_space);
   std::memset(ptr, 0, required_space);
-  size_ += required_space;
+  size_ = used_space + required_space;
   return ptr;
 }
 
Index: librime/include/rime/dict/table.h
===================================================================
--- librime.orig/include/rime/dict/table.h
+++ librime/include/rime/dict/table.h
@@ -29,7 +29,7 @@ using Code = List<SyllableId>;
 
 struct Entry {
   String text;
-  float weight;
+  double weight;
 };
 
 struct HeadIndexNode {
Index: librime/src/dict/table.cc
===================================================================
--- librime.orig/src/dict/table.cc
+++ librime/src/dict/table.cc
@@ -410,7 +410,7 @@ bool Table::BuildEntry(const DictEntry&
                << "'; file size: " << file_size();
     return false;
   }
-  entry->weight = static_cast<float>(dict_entry.weight);
+  entry->weight = static_cast<double>(dict_entry.weight);
   return true;
 }
 

Reply to: