Igalia / chromium

Old repo. See https://crbug.com/578890 instead.
https://chromium.googlesource.com/chromium/src.git
BSD 3-Clause "New" or "Revised" License
115 stars 16 forks source link

Build fails on Arch #525

Closed hedgepigdaniel closed 5 years ago

hedgepigdaniel commented 5 years ago

I'm trying to build from a011df391c95d05da092c2468fe231c8911e5e82

[8967/32221] CXX obj/ui/gfx/gfx/color_utils.o
FAILED: obj/ui/gfx/gfx/color_utils.o 
/home/daniel/arch/aur/chromium-wayland-igalia/src/src/third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/ui/gfx/gfx/color_utils.o.d -DGFX_IMPLEMENTATION -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"352138-2\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_NO_PROTOTYPES -DUSING_SYSTEM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DUCHAR_TYPE=uint16_t -DU_IMPORT=U_EXPORT -DUSE_SYSTEM_ZLIB=1 -I../.. -Igen -Igen/shim_headers/zlib_shim -Igen/shim_headers/libwebp_shim -Igen/shim_headers/icuuc_shim -Igen/shim_headers/libdrm_shim -Igen/shim_headers/icui18n_shim -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/docs -I../../third_party/skia/include/effects -I../../third_party/skia/include/encode -I../../third_party/skia/include/gpu -I../../third_party/skia/include/pathops -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/vulkan/include -I../../third_party/skia/third_party/vulkanmemoryallocator -I../../third_party/skia/include/codec -I../../third_party/skia/src/gpu -I../../third_party/skia/src/sksl -I../../third_party/skia/modules/skottie/include -I../../third_party/vulkan/include -I../../third_party/ced/src -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -no-canonical-prefixes -flto=thin -fsplit-lto-unit -fwhole-program-vtables -m64 -march=x86-64 -Wall -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g2 -ggnu-pubnames -fsanitize=cfi-vcall -fsanitize-blacklist=../../tools/cfi/blacklist.txt -fsanitize=cfi-icall -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wshadow -Wexit-time-destructors -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi-3.2.1/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -std=c++14 -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -D_FORTIFY_SOURCE=2 -D__DATE__=  -D__TIME__=  -D__TIMESTAMP__= -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -g -Og -fdebug-prefix-map=/home/daniel/arch/aur/chromium-wayland-igalia/src=/usr/src/debug -Wno-builtin-macro-redefined -c ../../ui/gfx/color_utils.cc -o obj/ui/gfx/gfx/color_utils.o
../../ui/gfx/color_utils.cc:434:7: error: no member named 'sqrtf' in namespace 'std'; did you mean simply 'sqrtf'?
      std::sqrtf((dark_luminance + 0.05f) * (kWhiteLuminance + 0.05f)) - 0.05f;
      ^~~~~~~~~~
      sqrtf
/usr/include/bits/mathcalls.h:143:1: note: 'sqrtf' declared here
__MATHCALL (sqrt,, (_Mdouble_ __x));
^
/usr/include/math.h:273:3: note: expanded from macro '__MATHCALL'
  __MATHDECL (_Mdouble_,function,suffix, args)
  ^
/usr/include/math.h:275:3: note: expanded from macro '__MATHDECL'
  __MATHDECL_1(type, function,suffix, args); \
  ^
/usr/include/math.h:283:15: note: expanded from macro '__MATHDECL_1'
  extern type __MATH_PRECNAME(function,suffix) args __THROW
              ^
/usr/include/math.h:303:34: note: expanded from macro '__MATH_PRECNAME'
# define __MATH_PRECNAME(name,r) name##f##r
                                 ^
<scratch space>:345:1: note: expanded from here
sqrtf
^

Indeed, changing the std::sqrtf to just ::sqrtfdoes fix it, although I'm a bit confused as to why, since that file does include cmath (https://en.cppreference.com/w/cpp/numeric/math/sqrt)

The use of std:sqrtf was introduced recently in 4aad48c08d9d3. Not sure if bug or build configuration error.

My build flags:

'custom_toolchain="//build/toolchain/linux/unbundle:default"'
    'host_toolchain="//build/toolchain/linux/unbundle:default"'
    'clang_use_chrome_plugins=true'
    'is_official_build=true' # implies is_cfi=true on x86_64
    'treat_warnings_as_errors=false'
    'fieldtrial_testing_like_official_build=true'
    'ffmpeg_branding="Chrome"'
    'proprietary_codecs=true'
    'link_pulseaudio=true'
    'use_gnome_keyring=false'
    'use_sysroot=false'
    'linux_use_bundled_binutils=false'
    'use_custom_libcxx=false'
    'enable_hangout_services_extension=true'
    'enable_widevine=true'
    'enable_nacl=false'
    'enable_swiftshader=false'
    "google_api_key=\"${_google_api_key}\""
    "google_default_client_id=\"${_google_default_client_id}\""
    "google_default_client_secret=\"${_google_default_client_secret}\""
$ /home/daniel/arch/aur/chromium-wayland-igalia/src/src/third_party/llvm-build/Release+Asserts/bin/clang++ --version
clang version 9.0.0 (trunk 352138)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/daniel/arch/aur/chromium-wayland-igalia/src/src/third_party/llvm-build/Release+Asserts/bin
hedgepigdaniel commented 5 years ago

Another error:

[11505/16794] CXX obj/media/learning/impl/impl/random_tree_trainer.o
FAILED: obj/media/learning/impl/impl/random_tree_trainer.o 
ccache /home/daniel/arch/aur/chromium-wayland-igalia/src/src/third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/media/learning/impl/impl/random_tree_trainer.o.d -DIS_LEARNING_IMPL_IMPL -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"352138-2\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -I../.. -Igen -Igen/shim_headers/icui18n_shim -Igen/shim_headers/icuuc_shim -Igen/shim_headers/zlib_shim -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -no-canonical-prefixes -flto=thin -fsplit-lto-unit -fwhole-program-vtables -m64 -march=x86-64 -Wall -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g1 -fsanitize=cfi-vcall -fsanitize-blacklist=../../tools/cfi/blacklist.txt -fsanitize=cfi-icall -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi-3.2.1/include -std=c++14 -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -D_FORTIFY_SOURCE=2 -D__DATE__=  -D__TIME__=  -D__TIMESTAMP__= -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -g -Og -fdebug-prefix-map=/home/daniel/arch/aur/chromium-wayland-igalia/src=/usr/src/debug -Wno-builtin-macro-redefined -c ../../media/learning/impl/random_tree_trainer.cc -o obj/media/learning/impl/impl/random_tree_trainer.o
In file included from ../../media/learning/impl/random_tree_trainer.cc:11:
../../base/optional.h:348:61: error: no member named 'value' in 'std::is_constructible<media::learning::Value, const base::Optional<media::learning::Value> &>'
              std::is_constructible<T, const Optional<U>&>::value ||
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
../../base/optional.h:451:39: note: in instantiation of template class 'base::internal::IsConvertibleFromOptional<media::learning::Value, media::learning::Value>' requested here
                           !internal::IsConvertibleFromOptional<T, U>::value &&
                                      ^
../../base/optional.h:454:3: note: while substituting prior template arguments into non-type template parameter [with U = media::learning::Value]
  Optional(const Optional<U>& other) : internal::OptionalBase<T>(other) {}
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/type_traits:921:56: note: while substituting deduced template arguments into function template 'Optional' [with U = media::learning::Value, $1 = (no value)]
      : public __bool_constant<__is_constructible(_Tp, _Args...)>
                                                       ^
../../base/optional.h:540:16: note: in instantiation of template class 'std::is_constructible<media::learning::Value, const base::Optional<media::learning::Value> &>' requested here
          std::is_constructible<T, U>::value &&
               ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/type_traits:1049:56: note: while substituting deduced template arguments into function template 'operator=' [with U = const base::Optional<media::learning::Value> &]
      : public __bool_constant<__is_assignable(_Tp, _Up)>
                                                       ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/type_traits:1061:14: note: (skipping 2 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
    : public is_assignable<_Tp&, const _Tp&>
             ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/stl_uninitialized.h:579:33: note: in instantiation of template class 'std::is_copy_assignable<base::Optional<media::learning::Value> >' requested here
      const bool __assignable = is_copy_assignable<_ValueType>::value;
                                ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/stl_uninitialized.h:645:19: note: in instantiation of function template specialization 'std::__uninitialized_default_n<base::Optional<media::learning::Value> *, unsigned long>' requested here
    { return std::__uninitialized_default_n(__first, __n); }
                  ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/vector.tcc:596:8: note: in instantiation of function template specialization 'std::__uninitialized_default_n_a<base::Optional<media::learning::Value> *, unsigned long, base::Optional<media::learning::Value> >' requested here
                std::__uninitialized_default_n_a(this->_M_impl._M_finish,
                     ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/stl_vector.h:827:4: note: in instantiation of member function 'std::vector<base::Optional<media::learning::Value>, std::allocator<base::Optional<media::learning::Value> > >::_M_default_append' requested here
          _M_default_append(__new_size - size());
          ^
../../media/learning/impl/random_tree_trainer.cc:190:18: note: in instantiation of member function 'std::vector<base::Optional<media::learning::Value>, std::allocator<base::Optional<media::learning::Value> > >::resize' requested here
  feature_values.resize(training_data[0].features.size());
                 ^
In file included from ../../media/learning/impl/random_tree_trainer.cc:11:
../../base/optional.h:360:44: error: no member named 'value' in 'base::internal::IsConvertibleFromOptional<media::learning::Value, media::learning::Value>'
          IsConvertibleFromOptional<T, U>::value ||
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
../../base/optional.h:552:31: note: in instantiation of template class 'base::internal::IsAssignableFromOptional<media::learning::Value, media::learning::Value>' requested here
  std::enable_if_t<!internal::IsAssignableFromOptional<T, U>::value &&
                              ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/type_traits:1049:56: note: while substituting deduced template arguments into function template 'operator=' [with U = media::learning::Value]
      : public __bool_constant<__is_assignable(_Tp, _Up)>
                                                       ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/type_traits:1061:14: note: in instantiation of template class 'std::is_assignable<base::Optional<media::learning::Value> &, const base::Optional<media::learning::Value> &>' requested here
    : public is_assignable<_Tp&, const _Tp&>
             ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/type_traits:1067:14: note: in instantiation of template class 'std::__is_copy_assignable_impl<base::Optional<media::learning::Value>, true>' requested here
    : public __is_copy_assignable_impl<_Tp>
             ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/stl_uninitialized.h:579:33: note: in instantiation of template class 'std::is_copy_assignable<base::Optional<media::learning::Value> >' requested here
      const bool __assignable = is_copy_assignable<_ValueType>::value;
                                ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/stl_uninitialized.h:645:19: note: in instantiation of function template specialization 'std::__uninitialized_default_n<base::Optional<media::learning::Value> *, unsigned long>' requested here
    { return std::__uninitialized_default_n(__first, __n); }
                  ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/vector.tcc:596:8: note: in instantiation of function template specialization 'std::__uninitialized_default_n_a<base::Optional<media::learning::Value> *, unsigned long, base::Optional<media::learning::Value> >' requested here
                std::__uninitialized_default_n_a(this->_M_impl._M_finish,
                     ^
/usr/lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/stl_vector.h:827:4: note: in instantiation of member function 'std::vector<base::Optional<media::learning::Value>, std::allocator<base::Optional<media::learning::Value> > >::_M_default_append' requested here
          _M_default_append(__new_size - size());
          ^
../../media/learning/impl/random_tree_trainer.cc:190:18: note: in instantiation of member function 'std::vector<base::Optional<media::learning::Value>, std::allocator<base::Optional<media::learning::Value> > >::resize' requested here
  feature_values.resize(training_data[0].features.size());
                 ^
2 errors generated.
msisov commented 5 years ago

I’m sorry, this issue is not about Wayland support, but rather about gcc support. Currently, chromium officially supports clang, but we and other guys from the community try to keep gcc builds also working, but it requires some time.

Please, switch to clang instead.

hedgepigdaniel commented 5 years ago

Well yes so far, although the reason I'm doing this is to try and put together a PKGBUILD for building chromium with wayland support on arch. My idea is to get the non-wayland build working first and then turn on the wayland flags.

I am already using clang, at least the second error error happens both with the bundled clang (9.0.0) and my system clang (7.0.0).

msisov commented 5 years ago

Please report about that issue to the upstream - crbug.com