My favorites | Sign in
v8
Project Home Downloads Wiki Issues Source Code Search
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2: Fails to buld from source
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  christia...@gmail.com
Closed:  Sep 2008


Sign in to add a comment
 
Reported by florian....@gmail.com, Sep 2, 2008
When compiling svn trunk with g++ 4.3.1 I get the following error.

g++ -o obj/release/accessors.o -c -ansi -pedantic -Wall -Werror -W
-Wno-unused-parameter -fno-strict-aliasing -O2 -fno-rtti -fno-exceptions -ansi
 -pedantic -Wall -Werror -W -Wno-unused-parameter -fno-strict-aliasing -O2
-DENABLE_LOGGING_AND_PROFILING src/accessors.cc
In file included from src/v8.h:62,
                 from src/accessors.cc:28:
src/objects-inl.h:251: error: explicit template specialization cannot have
a storage class
src/objects-inl.h:298: error: explicit template specialization cannot have
a storage class

This seems to be fixed by the following patch, although I'm not quite sure
it's the right thing to do.

diff --git a/src/objects-inl.h b/src/objects-inl.h
index 3242e7a..4e6019d 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -246,7 +246,7 @@ bool Object::IsJSFunction() {
 }
 
 
-template <> static inline bool Is<JSFunction>(Object* obj) {
+template <> inline bool Is<JSFunction>(Object* obj) {
   return obj->IsJSFunction();
 }
 
@@ -293,7 +293,7 @@ bool Object::IsJSArray() {
 }
 
 
-template <> static inline bool Is<JSArray>(Object* obj) {
+template <> inline bool Is<JSArray>(Object* obj) {
   return obj->IsJSArray();
 }
 

After that being fixed, I get the following error:

g++ -o obj/release/platform-linux.o -c -ansi -pedantic -Wall -Werror -W
-Wno-unused-parameter -fno-strict-aliasing -O2 -fno-rtti -fno-exceptions
-ansi -pedantic -Wall -Werror -W -Wno-unused-parameter -fno-strict-aliasing
-O2 -DENABLE_LOGGING_AND_PROFILING src/platform-linux.cc
cc1plus: warnings being treated as errors
src/platform-linux.cc: In static member function 'static void
v8::internal::OS::LogSharedLibraryAddresses()':
src/platform-linux.cc:304: error: array subscript is above array bounds

which vanishes after applying

diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index 050375e..c1b3845 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -291,7 +291,7 @@ void OS::LogSharedLibraryAddresses() {
     if (addr_buffer[2] != '-') return;
     read(fd, addr_buffer + 2, 8);
     unsigned end = StringToLongLong(addr_buffer);
-    char buffer[MAP_LENGTH];
+    char buffer[MAP_LENGTH + 1];
     int bytes_read = -1;
     do {
       bytes_read++;


Both errors don't show up when using g++-4.2.
Sep 2, 2008
#1 matteo.a...@gmail.com
Reproduced the problem here (Debian Sid, g++ 4.3.1).

At the moment I'd prefer not to install the 4.2 release, so I'd like to know if the
above patches are correct. Thanks. :-)
Sep 3, 2008
Project Member #2 christia...@gmail.com
This has been fixed in the development branch.
Status: Fixed
Owner: christian.plesner.hansen
Sign in to add a comment

Powered by Google Project Hosting