Build V8 on linux with GCC and system headers

410 views
Skip to first unread message

Georgi Sotirov

unread,
Jul 31, 2017, 12:49:15 PM7/31/17
to v8-users
Is there a way to build V8 natively on linux with system's compiler (GCC), library and headers? How to make the build use GCC, system headers from /usr/include, instead of /usr/src/v8/build/linux/debian_jessie_i386-sysroot/usr/?

$ time make ia32.release
PYTHONPATH
="/usr/src/v8/tools/generate_shim_headers:/usr/src/v8/gypfiles::/usr/src/v8/tools/gyp/pylib:" \
GYP_GENERATORS
=make \
tools
/gyp/gyp --generator-output="out" gypfiles/all.gyp \
             
-Igypfiles/standalone.gypi --depth=. \
             
-Dv8_target_arch=ia32 \
               
-Dtarget_arch=ia32 \
               
\
             
-S.ia32.release  -Dv8_enable_backtrace=1 -Darm_fpu=default -Darm_float_abi=default
make
[1]: Entering directory '/usr/src/v8/out'
  ACTION
Generating inspector protocol sources from protocol json definition /usr/src/v8/out/ia32.release/obj/gen/src/js_protocol.stamp
  TOUCH
/usr/src/v8/out/ia32.release/obj.target/src/inspector/protocol_compatibility.stamp
  TOUCH bdc92efe44eca1954fdff70fd086c7e138d0fbb1
.intermediate
  ACTION
Generating inspector protocol sources from protocol json bdc92efe44eca1954fdff70fd086c7e138d0fbb1.intermediate
  TOUCH
/usr/src/v8/out/ia32.release/obj.target/src/inspector/protocol_generated_sources.stamp
  ACTION src_inspector_inspector_gyp_inspector_injected_script_target_convert_js_to_cpp_char_array
/usr/src/v8/out/ia32.release/obj/gen/src/inspector/injected-script-source.h
  TOUCH
/usr/src/v8/out/ia32.release/obj.target/src/inspector/inspector_injected_script.stamp
  ACTION src_inspector_inspector_gyp_inspector_debugger_script_target_convert_js_to_cpp_char_array
/usr/src/v8/out/ia32.release/obj/gen/src/inspector/debugger-script.h
  TOUCH
/usr/src/v8/out/ia32.release/obj.target/src/inspector/inspector_debugger_script.stamp
  CXX
(target) /usr/src/v8/out/ia32.release/obj.target/v8_base/gen/src/inspector/protocol/Protocol.o
In file included from /usr/src/v8/out/ia32.release/obj/gen/src/inspector/protocol/Protocol.cpp:7:
In file included from /usr/src/v8/out/ia32.release/obj/gen/src/inspector/protocol/Protocol.h:8:
In file included from /usr/src/v8/out/ia32.release/obj/gen/src/inspector/protocol/Forward.h:8:
In file included from .././src/inspector/string-util.h:8:
In file included from /usr/src/v8/build/linux/debian_jessie_i386-sysroot/usr/lib/gcc/i586-linux-gnu/4.8/../../../../include/c++/4.8/memory:72:
In file included from /usr/src/v8/build/linux/debian_jessie_i386-sysroot/usr/lib/gcc/i586-linux-gnu/4.8/../../../../include/c++/4.8/iosfwd:40:
In file included from /usr/src/v8/build/linux/debian_jessie_i386-sysroot/usr/lib/gcc/i586-linux-gnu/4.8/../../../../include/c++/4.8/bits/postypes.h:40:
In file included from /usr/src/v8/build/linux/debian_jessie_i386-sysroot/usr/lib/gcc/i586-linux-gnu/4.8/../../../../include/c++/4.8/cwchar:44:
/usr/src/v8/build/linux/debian_jessie_i386-sysroot/usr/include/wchar.h:39:11: fatal error: 'stdarg.h' file not found
# include <stdarg.h>
         
^~~~~~~~~~
1 error generated.
make
[1]: *** [src/v8_base.target.ia32.release.mk:725: /usr/src/v8/out/ia32.release/obj.target/v8_base/gen/src/inspector/protocol/Protocol.o] Error 1
rm bdc92efe44eca1954fdff70fd086c7e138d0fbb1
.intermediate
make
[1]: Leaving directory '/usr/src/v8/out'
make
: *** [Makefile:315: ia32.release] Error 2

For information I'm trying to build on Slackware Linux.

Jakob Kummerow

unread,
Jul 31, 2017, 1:00:49 PM7/31/17
to v8-users
To use the system compiler, try:

$ make ia32.release GYPFLAGS=-Dclang=0

I don't know whether it will also use system headers though.

(Also note that the make/GYP-based build is deprecated. The new hotness is "gn"; see the wiki for instructions. tools/dev/gm.py gives you an experience that's very similar to the Makefile.)


--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Georgi Sotirov

unread,
Jul 31, 2017, 2:05:23 PM7/31/17
to v8-users
To use the system compiler, try:

$ make ia32.release GYPFLAGS=-Dclang=0

I don't know whether it will also use system headers though.


Thanks! It works and build is in progress... are these flags described somewhere?
 
(Also note that the make/GYP-based build is deprecated. The new hotness is "gn"; see the wiki for instructions. tools/dev/gm.py gives you an experience that's very similar to the Makefile.

Yes, I'll try it later, but for now I prefer something that I'm more familiar with like make :-)

Georgi Sotirov

unread,
Jul 31, 2017, 2:06:41 PM7/31/17
to v8-users
Arghhhh... Any way to disable turning of warnings to errors?

  g++ '-DV8_GYP_BUILD' '-DCR_CLANG_REVISION=308728-3' '-DV8_TARGET_ARCH_IA32' '-DENABLE_GDB_JIT_INTERFACE' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DV8_INTL_SUPPORT' '-DV8_USE_EXTERNAL_STARTUP_DATA' '-DV8_CHECK_MICROTASKS_SCOPES_CONSISTENCY' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE' '-DU_USING_ICU_NAMESPACE=0' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION' '-DENABLE_HANDLE_ZAPPING' -I../. -I/usr/src/v8/out/ia32.release/obj/gen -I../include -I../third_party/icu/source/i18n -I../third_party/icu/source/common  -Wall -Werror -Wno-unused-parameter -pthread -Wmissing-field-initializers -Wno-strict-overflow -fno-strict-aliasing -fvisibility=hidden -Wno-uninitialized -B/usr/src/v8/third_party/binutils/Linux_ia32/Release/bin -msse2 -mfpmath=sse -mmmx -B/usr/src/v8/third_party/binutils/Linux_ia32/Release/bin -msse2 -mfpmath=sse -mmmx -m32 -m32 -fdata-sections -ffunction-sections -O3 -fdata-sections -ffunction-sections -O3 -Wnon-virtual-dtor -fno-exceptions -fno-rtti -std=gnu++11 -MMD -MF /usr/src/v8/out/ia32.release/.deps//usr/src/v8/out/ia32.release/obj.target/v8_base/src/compiler/store-store-elimination.o.d.raw   -c -o /usr/src/v8/out/ia32.release/obj.target/v8_base/src/compiler/store-store-elimination.o ../src/compiler/store-store-elimination.cc
../src/compiler/store-store-elimination.cc:555:6: error: 'bool v8::internal::compiler::{anonymous}::UnobservableStore::operator!=(v8::internal::compiler::{anonymous}::UnobservableStore) const' defined but not used [-Werror=unused-function]
 
bool UnobservableStore::operator!=(const UnobservableStore other) const {
     
^~~~~~~~~~~~~~~~~
../src/compiler/store-store-elimination.cc:254:6: error: 'static bool v8::internal::compiler::{anonymous}::RedundantStoreFinder::IsEffectful(v8::internal::compiler::Node*)' defined but not used [-Werror=unused-function]
 
bool RedundantStoreFinder::IsEffectful(Node* node) {
     
^~~~~~~~~~~~~~~~~~~~
cc1plus
: all warnings being treated as errors
make
[1]: *** [src/v8_base.target.ia32.release.mk:696: /usr/src/v8/out/ia32.release/obj.target/v8_base/src/compiler/store-store-elimination.o] Error 1

Georgi Sotirov

unread,
Jul 31, 2017, 2:24:48 PM7/31/17
to v8-users
Arghhhh... Any way to disable turning of warnings to errors?

Found it myself :-)

make ia32.release GYPFLAGS='-Dclang=0 -Dwerror='

Jakob Kummerow

unread,
Jul 31, 2017, 5:17:10 PM7/31/17
to v8-users
...or simply: make ia32.release werror=no

are these flags described somewhere?

Yes, in the Makefile :-)

Reply all
Reply to author
Forward
0 new messages