PF4Public / gentoo-overlay

Personal Gentoo overlay
80 stars 20 forks source link

www-client/ungoogled-chromium-122.0.6261.69: build fails with error: invalid argument '-fno-split-lto-unit' not allowed with '-fsanitize=cfi' #307

Closed neelchakrabrty closed 8 months ago

neelchakrabrty commented 9 months ago

I've been trying to compile the latest ungoogled-chromium release on my system, but the build fails throwing error: invalid argument '-fno-split-lto-unit' not allowed with '-fsanitize=cfi'

Here's my build log

Let me know if need to provide more information, I will be happy to do so.

PF4Public commented 9 months ago

Please don't use external services for file uploads, attach the file here. What are your USE flags for ungoogled-chromium?

I'd like to remind you that there are stable versions (121), which you can use if you don't want to debug the 122, which is not yet 100% ready.

0xC0ncord commented 9 months ago

I'm investigating this as well. This seems to be related: https://issues.chromium.org/issues/40189933

0xC0ncord commented 9 months ago

For reference I am seeing this with:

[ebuild     U  ] www-client/ungoogled-chromium-122.0.6261.69_p1::pf4public [119.0.6045.159_p1::pf4public] USE="X bluetooth cfi clang convert-dict cups custom-cflags hangouts libcxx%* official optimize-thinlto optimize-webui pgo proprietary-codecs pulseaudio screencast (selinux) thinlto vaapi wayland widevine -cromite% -debug -enable-driver -gtk4 -headless -hevc -kerberos -nvidia -override-data-dir -pax-kernel -qt5 -qt6 -system-abseil-cpp -system-av1 -system-brotli -system-crc32c -system-double-conversion -system-ffmpeg -system-harfbuzz -system-icu -system-jsoncpp -system-libevent -system-libusb -system-libvpx -system-openh264 -system-openjpeg -system-png -system-re2 -system-snappy -system-woff2 -system-zstd* (-uazo-bromite%)" L10N="-af -am -ar -bg -bn -ca -cs -da -de -el -en-GB -es -es-419 -et -fa -fi -fil -fr -gu -he -hi -hr -hu -id -it -ja -kn -ko -lt -lv -ml -mr -ms -nb -nl -pl -pt-BR -pt-PT -ro -ru -sk -sl -sr -sv -sw -ta -te -th -tr -uk -ur -vi -zh-CN -zh-TW" 0 KiB
PF4Public commented 9 months ago

Perhaps we should exclude this flag for cfi USE-case?

0xC0ncord commented 9 months ago

Perhaps we should exclude this flag for cfi USE-case?

I think that's exactly what needs to happen. I'm trying to find out whether upstream is doing this already but haven't found any such patch or issue on their tracker.

neelchakrabrty commented 9 months ago

My use flags are as follows www-client/ungoogled-chromium-121.0.6167.184_p1 USE="cfi clang hevc official optimize-thinlto pgo proprietary-codecs pulseaudio system-ffmpeg system-harfbuzz system-icu system-libevent system-libusb system-openh264 system-png system-zstd thinlto vaapi wayland -X -bluetooth -convert-dict -cromite -cups -custom-cflags -debug -enable-driver -gtk4 -hangouts -headless -kerberos -libcxx -nvidia -optimize-webui -override-data-dir -pax-kernel -qt5 -qt6 -screencast (-selinux) -system-abseil-cpp -system-av1 -system-brotli -system-crc32c -system-double-conversion -system-jsoncpp -system-libvpx -system-openjpeg -system-re2 -system-snappy -system-woff2 -widevine"

neelchakrabrty commented 9 months ago

And I want to help debug the testing version, if that's okay with you.

PF4Public commented 9 months ago

if that's okay with you.

Of course! I'm not using cfi on my machines.

I think that's exactly what needs to happen. I'm trying to find out whether upstream is doing this already but haven't found any such patch or issue on their tracker.

If we can get away with a mere sed that'd be great.

PF4Public commented 9 months ago

@0xC0ncord We get this flag from compiler patch: https://gitlab.com/Matt.Jolly/chromium-patches/-/commit/8c5f6e35addf98cd9318de96c1fe3ba05c5c4f22

0xC0ncord commented 9 months ago

The linked PR gets past the initial compiler errors for me. Whether or not the build will be successful I will know in about 8 hours. :smile:

0xC0ncord commented 9 months ago

@0xC0ncord We get this flag from compiler patch: gitlab.com/Matt.Jolly/chromium-patches/-/commit/8c5f6e35addf98cd9318de96c1fe3ba05c5c4f22

I'm not too intimately familiar with these downstream Chromium patches. Maybe this should go up as well?

neelchakrabrty commented 9 months ago

ucbuildlog.txt I removed the cfi use flag, but the build still fails. I have attached the last 300 lines of the build log.

0xC0ncord commented 9 months ago

ucbuildlog.txt I removed the cfi use flag, but the build still fails. I have attached the last 300 lines of the build log.

FAILED: obj/media/filters/filters/ffmpeg_demuxer.o 
x86_64-pc-linux-gnu-clang++ -MMD -MF obj/media/filters/filters/ffmpeg_demuxer.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_
ENABLED=0 -DIS_MEDIA_IMPL -DUSE_PULSEAUDIO -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -DBASE_USE_PERFETTO_CLIENT_LIBRARY=1 -DSK_ENABLE_SKSL -DSK_UNTIL_CRBUG_1187654_IS_FIXED -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_WIN_FONTMGR_NO_SIMULATIONS -DSK_DISABLE_LEGACY_SKSURFACE_METHODS -DSK_DISABLE_LEGACY_GRAPHITE_IMAGE_FACT
ORIES -DSK_DISABLE_LEGACY_GRAPHITE_IMAGE_METHODS -DSK_DISABLE_LEGACY_SKSURFACE_FACTORIES -DSK_DISABLE_LEGACY_SKSURFACE_FLUSH -DSK_DISABLE_LEGACY_SKSURFACE_AS_IMAGE -DSK_DISABLE_LEGACY_SKSURFACE_DISPLAYLIST -DSK_DISABLE_LEGACY_IMAGE_SUBSET_METHODS -DSK_DISABLE_LEGACY_IMAGE_COLORSPACE_METHODS -DSK_DISABLE_LEGACY_IMAGE_RELEASE_PROCS -DSK_DISABLE_LEGACY_GL_BACKEND_SURFACE -DSK_DISABLE_LEGACY_I
NIT_DECODERS -DSK_DISABLE_LEGACY_GRDIRECTCONTEXT_FLUSH -DSK_DISABLE_LEGACY_GRDIRECTCONTEXT_BOOLS -DSK_DISABLE_LEGACY_GL_GRDIRECTCONTEXT_FACTORIES -DSK_DISABLE_LEGACY_PNG_WRITEBUFFER -DSK_SLUG_DISABLE_LEGACY_DESERIALIZE -DSK_DISABLE_LEGACY_VK_GRDIRECTCONTEXT_FACTORIES -DSK_DEFAULT_TYPEFACE_IS_EMPTY -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_GANESH -DSK_GP
U_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DSK_GL -DSK_VULKAN=1 -DSK_GRAPHITE -DVK_USE_PLATFORM_WAYLAND_KHR -DUSE_EGL -DLIBYUV_DISABLE_NEON -DUSING_SYSTEM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DU_IMPORT=U_EXPORT -DCRASHPAD_ZLIB_SOURCE_EXTERNAL -DUSE_SYSTEM_ZLIB=1 -DCONFIG_LOG=0 -DHAVE_PTHREAD_GETAFFINITY_NP=1 -DHAVE_PTHREAD_SETAFFINITY_NP=1 -DDAV1D_
API= -I../.. -Igen -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/zlib_shim -Igen/shim_headers/libevent_shim -Igen/shim_headers/icui18n_shim -Igen/shim_headers/icuuc_shim -I../../third_party/skia -Igen/third_party/skia -I../../third_party/wuffs/src/release/c -I../../third_party/vulkan/include -I../../third_party/vu
lkan-deps/vulkan-headers/src/include -I../../third_party/wayland/src/src -I../../third_party/wayland/include/src -Igen/shim_headers/libpng_shim -Igen/shim_headers/libwebp_shim -I../../net/third_party/quiche/overrides -I../../net/third_party/quiche/src/quiche/common/platform/default -I../../net/third_party/quiche/src -Igen/shim_headers/zstd_shim -Igen/third_party/dawn/include -I../../third_
party/dawn/include -I../../third_party/khronos -I../../gpu -I../../third_party/libyuv/include -Igen/shim_headers/ffmpeg_shim -Igen/shim_headers/openh264_shim -Igen/shim_headers/opus_shim -I../../base/allocator/partition_allocator/src -Igen/base/allocator/partition_allocator/src -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/p
rotoc_out -I../../third_party/mesa_headers -I../../third_party/ipcz/include -I../../third_party/ced/src -I../../third_party/crashpad/crashpad -I../../third_party/crashpad/crashpad/compat/linux -I../../third_party/crashpad/crashpad/compat/non_win -I../../third_party/libaom/source/libaom -I../../third_party/libvpx/source/libvpx -I../../third_party/dav1d/version -Wimplicit-fallthrough -Wextra
-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wno-invalid-offsetof -Wno-vla-extension -Wno-thread-safety-reference-return -Ws
hadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -flto=thin -fno-split-lto-unit -fwhole-program-vtables -no-canonical-prefixes -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-math-errno -fno
-omit-frame-pointer -g0 -fprofile-use=../../chrome/build/pgo_profiles/chrome-linux-6167-1706004111-41f78c57fb3a1fe49a5c549b16f0221465339af9.profdata -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date -Wno-backend-plugin -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -Wno-redundant-parens -Wno-redundant-parens -DPROTOBUF_ALLOW_DEPRECATED=1 -I/usr/include/opus -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -fvisibility-inlines-hidden  -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -march=znver4 -pipe -Wno-unknown-warning-option -Wno-builtin-macro-redefined -c ../../media/filters/ffmpeg_demuxer.cc -o obj/media/filters/filters/ffmpeg_demuxer.o
../../media/filters/ffmpeg_demuxer.cc:124:7: error: use of undeclared identifier 'av_stream_get_first_dts'; did you mean 'av_stream_get_end_pts'?
  124 |   if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
      |       ^~~~~~~~~~~~~~~~~~~~~~~
      |       av_stream_get_end_pts
/usr/include/libavformat/avformat.h:1019:12: note: 'av_stream_get_end_pts' declared here
 1019 | int64_t    av_stream_get_end_pts(const AVStream *st);
      |            ^
../../media/filters/ffmpeg_demuxer.cc:124:7: warning: 'av_stream_get_end_pts' is deprecated [-Wdeprecated-declarations]
  124 |   if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
      |       ^
/usr/include/libavformat/avformat.h:1018:1: note: 'av_stream_get_end_pts' has been explicitly marked deprecated here
 1018 | attribute_deprecated
      | ^
/usr/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
  100 | #    define attribute_deprecated __attribute__((deprecated))
      |                                                 ^
../../media/filters/ffmpeg_demuxer.cc:129:48: error: use of undeclared identifier 'av_stream_get_first_dts'; did you mean 'av_stream_get_end_pts'?
  129 |         ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                av_stream_get_end_pts
/usr/include/libavformat/avformat.h:1019:12: note: 'av_stream_get_end_pts' declared here
 1019 | int64_t    av_stream_get_end_pts(const AVStream *st);
      |            ^
../../media/filters/ffmpeg_demuxer.cc:129:48: warning: 'av_stream_get_end_pts' is deprecated [-Wdeprecated-declarations]
  129 |         ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
      |                                                ^
/usr/include/libavformat/avformat.h:1018:1: note: 'av_stream_get_end_pts' has been explicitly marked deprecated here
 1018 | attribute_deprecated
      | ^
/usr/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
  100 | #    define attribute_deprecated __attribute__((deprecated))
      |                                                 ^
../../media/filters/ffmpeg_demuxer.cc:1656:9: error: use of undeclared identifier 'av_stream_get_first_dts'; did you mean 'av_stream_get_end_pts'?
 1656 |     if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         av_stream_get_end_pts
/usr/include/libavformat/avformat.h:1019:12: note: 'av_stream_get_end_pts' declared here
 1019 | int64_t    av_stream_get_end_pts(const AVStream *st);
      |            ^
../../media/filters/ffmpeg_demuxer.cc:1656:9: warning: 'av_stream_get_end_pts' is deprecated [-Wdeprecated-declarations]
 1656 |     if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
      |         ^
/usr/include/libavformat/avformat.h:1018:1: note: 'av_stream_get_end_pts' has been explicitly marked deprecated here
 1018 | attribute_deprecated
      | ^
/usr/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
  100 | #    define attribute_deprecated __attribute__((deprecated))
      |                                                 ^
../../media/filters/ffmpeg_demuxer.cc:1677:9: error: use of undeclared identifier 'av_stream_get_first_dts'; did you mean 'av_stream_get_end_pts'?
 1677 |     if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         av_stream_get_end_pts
/usr/include/libavformat/avformat.h:1019:12: note: 'av_stream_get_end_pts' declared here
 1019 | int64_t    av_stream_get_end_pts(const AVStream *st);
      |            ^
../../media/filters/ffmpeg_demuxer.cc:1677:9: warning: 'av_stream_get_end_pts' is deprecated [-Wdeprecated-declarations]
 1677 |     if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
      |         ^
/usr/include/libavformat/avformat.h:1018:1: note: 'av_stream_get_end_pts' has been explicitly marked deprecated here
 1018 | attribute_deprecated
      | ^
/usr/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
  100 | #    define attribute_deprecated __attribute__((deprecated))
      |                                                 ^
4 warnings and 4 errors generated.

This looks like a separate issue.

neelchakrabrty commented 9 months ago

Should I open a new issue then?

0xC0ncord commented 9 months ago

Should I open a new issue then?

Yes. It looks like it may be system-ffmpeg-related.

neelchakrabrty commented 9 months ago

I have opened a new issue. #309

0xC0ncord commented 9 months ago

Happy to report that with the linked PR applied, it fixes the CFI build for me.

www-client/ungoogled-chromium-122.0.6261.69_p1::pf4public was built with the following:
USE="X bluetooth cfi clang convert-dict cups custom-cflags hangouts libcxx official optimize-thinlto optimize-webui pgo proprietary-codecs pulseaudio screencast (selinux) thinlto vaapi wayland widevine -cromite -debug -enable-driver -gtk4 -headless -hevc -kerberos -nvidia -override-data-dir -pax-kernel -qt5 -qt6 -system-abseil-cpp -system-av1 -system-brotli -system-crc32c -system-double-conversion -system-ffmpeg -system-harfbuzz -system-icu -system-jsoncpp -system-libevent -system-libusb -system-libvpx -system-openh264 -system-openjpeg -system-png -system-re2 -system-snappy -system-woff2 -system-zstd" ABI_X86="(64)" L10N="-af -am -ar -bg -bn -ca -cs -da -de -el -en-GB -es -es-419 -et -fa -fi -fil -fr -gu -he -hi -hr -hu -id -it -ja -kn -ko -lt -lv -ml -mr -ms -nb -nl -pl -pt-BR -pt-PT -ro -ru -sk -sl -sr -sv -sw -ta -te -th -tr -uk -ur -vi -zh-CN -zh-TW"
CFLAGS="-O2 -pipe -fPIC -Wno-unknown-warning-option -Wno-builtin-macro-redefined"
CXXFLAGS="-O2 -pipe -fPIC -Wno-unknown-warning-option -Wno-builtin-macro-redefined"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--thinlto-jobs=13"
PF4Public commented 9 months ago

Happy to report that with the linked PR applied, it fixes the CFI build for me.

So it builds and runs at the very least with libc++? Thanks!

0xC0ncord commented 9 months ago

So it builds and runs at the very least with libc++? Thanks!

Yep. I've been running 122.0.6261.69 since last night and so far I haven't noticed any issues.

PF4Public commented 9 months ago

Thanks for letting me know. I'll need to test your PR before merging as Matt was apparently trying to fix LTO. If that's only for Rust, then your changes should not harm ungoogled-chromium :)