@@ -157,11 +157,23 @@ parser.add_option("--enable-vtune-profiling",
157157 " JavaScript code executed in nodejs. This feature is only available "
158158 " for x32, x86, and x64 architectures." )
159159
160+ parser.add_option(" --enable-pgo-generate" ,
161+ action=" store_true" ,
162+ dest=" enable_pgo_generate" ,
163+ help=" Enable profiling with pgo of a binary. This feature is only available "
164+ " on linux with gcc and g++ 5.4.1 or newer." )
165+
166+ parser.add_option(" --enable-pgo-use" ,
167+ action=" store_true" ,
168+ dest=" enable_pgo_use" ,
169+ help=" Enable use of the profile generated with --enable-pgo-generate. This "
170+ " feature is only available on linux with gcc and g++ 5.4.1 or newer." )
171+
160172parser.add_option(" --enable-lto" ,
161173 action=" store_true" ,
162174 dest=" enable_lto" ,
163175 help=" Enable compiling with lto of a binary. This feature is only available "
164- " on linux with gcc and g++." )
176+ " on linux with gcc and g++ 5.4.1 or newer ." )
165177
166178parser.add_option(" --link-module" ,
167179 action=" append" ,
@@ -488,6 +500,11 @@ parser.add_option('--without-npm',
488500 dest=' without_npm' ,
489501 help=' do not install the bundled npm (package manager)' )
490502
503+ parser.add_option(' --without-node-report' ,
504+ action=' store_true' ,
505+ dest=' without_node_report' ,
506+ help=' build without node-report' ),
507+
491508parser.add_option(' --without-perfctr' ,
492509 action=' store_true' ,
493510 dest=' without_perfctr' ,
@@ -898,11 +915,22 @@ def configure_mips(o):
898915 o[' variables' ][' mips_fpu_mode' ] = options.mips_fpu_mode
899916
900917
918+ def gcc_version_ge(version_checked):
919+ for compiler in [(CC, ' c' ), (CXX, ' c++' )]:
920+ ok, is_clang, clang_version, compiler_version = \
921+ try_check_compiler(compiler[0], compiler[1])
922+ compiler_version_num = tuple(map(int, compiler_version))
923+ if is_clang or compiler_version_num < version_checked:
924+ return False
925+ return True
926+
927+
901928def configure_node(o):
902929 if options.dest_os == ' android' :
903930 o[' variables' ][' OS' ] = ' android'
904931 o[' variables' ][' node_prefix' ] = options.prefix
905932 o[' variables' ][' node_install_npm' ] = b(not options.without_npm)
933+ o[' variables' ][' node_report' ] = b(not options.without_node_report)
906934 o[' default_configuration' ] = ' Debug' if options.debug else ' Release'
907935
908936 host_arch = host_arch_win () if os.name == ' nt' else host_arch_cc ()
@@ -942,22 +970,41 @@ def configure_node(o):
942970 else:
943971 o[' variables' ][' node_enable_v8_vtunejit' ] = ' false'
944972
973+ if flavor ! = ' linux' and (options.enable_pgo_generate or options.enable_pgo_use):
974+ raise Exception(
975+ ' The pgo option is supported only on linux.' )
976+
977+ if flavor == ' linux' :
978+ if options.enable_pgo_generate or options.enable_pgo_use:
979+ version_checked = (5, 4, 1)
980+ if not gcc_version_ge(version_checked):
981+ version_checked_str = " ." .join(map(str, version_checked))
982+ raise Exception(
983+ ' The options --enable-pgo-generate and --enable-pgo-use '
984+ ' are supported for gcc and gxx %s or newer only.' % (version_checked_str))
985+
986+ if options.enable_pgo_generate and options.enable_pgo_use:
987+ raise Exception(
988+ ' Only one of the --enable-pgo-generate or --enable-pgo-use options '
989+ ' can be specified at a time. You would like to use '
990+ ' --enable-pgo-generate first, profile node, and then recompile '
991+ ' with --enable-pgo-use' )
992+
993+ o[' variables' ][' enable_pgo_generate' ] = b(options.enable_pgo_generate)
994+ o[' variables' ][' enable_pgo_use' ] = b(options.enable_pgo_use)
995+
945996 if flavor ! = ' linux' and (options.enable_lto):
946997 raise Exception(
947998 ' The lto option is supported only on linux.' )
948999
9491000 if flavor == ' linux' :
9501001 if options.enable_lto:
9511002 version_checked = (5, 4, 1)
952- for compiler in [(CC, ' c' ), (CXX, ' c++' )]:
953- ok, is_clang, clang_version, compiler_version = \
954- try_check_compiler(compiler[0], compiler[1])
955- compiler_version_num = tuple(map(int, compiler_version))
956- if is_clang or compiler_version_num < version_checked:
957- version_checked_str = " ." .join(map(str, version_checked))
958- raise Exception(
959- ' The option --enable-lto is supported for gcc and gxx %s'
960- ' or newer only.' % (version_checked_str))
1003+ if not gcc_version_ge(version_checked):
1004+ version_checked_str = " ." .join(map(str, version_checked))
1005+ raise Exception(
1006+ ' The option --enable-lto is supported for gcc and gxx %s'
1007+ ' or newer only.' % (version_checked_str))
9611008
9621009 o[' variables' ][' enable_lto' ] = b(options.enable_lto)
9631010
0 commit comments