openeuler-riscv / oerv-team

OERV 实习生工作中心
13 stars 44 forks source link

[Bonus] Chromium 编译问题 #255

Closed misaka00251 closed 7 months ago

misaka00251 commented 8 months ago

软件包信息

软件包名称: chromium

openEuler 仓库地址: 无

构建仓库地址: https://build.tarsier-infra.com/package/show/Factory:RISC-V:TH1520/chromium

说明

问题背景: 请查询本包的在线构建日志,出现了关于 ffmpeg 的 undefined reference,但实际上在 ffmpeg 源码内是存在的。已知 ffmpeg 的版本是在 5.1 和 6.x 之间。

所需技能:

其它: 这个 P1 任务会有 Bonus。

错误日志:

[24359s] [chrome:7162/54374] clang++ -MMD -MF obj/third_party/pdfium/core/fpdfapi/cmaps/cmaps/90pv-RKSJ-H_1.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 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DPNG_PREFIX -DPNG_USE_READ_MACROS -DOPJ_STATIC -DPDF_ENABLE_V8 -DPDF_ENABLE_XFA -DPDF_ENABLE_XFA_BMP -DPDF_ENABLE_XFA_GIF -DPDF_ENABLE_XFA_PNG -DPDF_ENABLE_XFA_TIFF -DFT_CONFIG_MODULES_H=\"freetype-custom/freetype/config/ftmodule.h\" -DFT_CONFIG_OPTIONS_H=\"freetype-custom/freetype/config/ftoption.h\" -DPDFIUM_REQUIRED_MODULES -DCHROMIUM_RESTRICT_VISIBILITY -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -I../.. -Igen -I../../third_party/pdfium -I../../third_party/freetype/include -I../../third_party/freetype/include/freetype-custom -I../../third_party/freetype/src/include -I../../third_party/harfbuzz-ng/src/src -I../../third_party/abseil-cpp -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -Wall -Wextra -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 -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off --target=riscv64-linux-gnu -mabi=lp64d -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointer -gdwarf-4 -g1 -gdwarf-aranges -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wc++11-narrowing -Wdeprecated-copy -Wtautological-unsigned-zero-compare -Wshadow -Wexit-time-destructors -Wglobal-constructors -Wshorten-64-to-32 -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -Wno-return-type -Wno-pedantic -Wno-unused-result -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations -Wno-return-type -Wno-parentheses -Wno-misleading-indentation -Wno-attributes -Wno-ignored-attributes -Wno-address -Wno-dangling-else -D_GNU_SOURCE -I/usr/include/wayland -I/usr/include/libxkbcommon -I/usr/include/opus -Wno-unused-command-line-argument -Wno-unknown-warning-option -c ../../third_party/pdfium/core/fpdfapi/cmaps/Japan1/90pv-RKSJ-H_1.cpp -o obj/third_party/pdfium/core/fpdfapi/cmaps/cmaps/90pv-RKSJ-H_1.o
[24359s] [chrome:7163/54374] touch obj/third_party/openscreen/src/util/base.stamp
[24359s] [chrome:7164/54374] python3 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="llvm-nm"  --sofile="./libffmpeg.so" --tocfile="./libffmpeg.so.TOC" --output="./libffmpeg.so" -- clang++ -shared -Wl,-soname="libffmpeg.so" -Wl,-Bsymbolic -L gen/third_party/ffmpeg -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--undefined-version -Wl,--no-call-graph-profile-sort --target=riscv64-linux-gnu -no-canonical-prefixes -Wl,-O2 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -Wl,-rpath=\$ORIGIN  -Wl,--build-id=sha1 -o "./libffmpeg.so" @"./libffmpeg.so.rsp" 
[24359s] FAILED: libffmpeg.so libffmpeg.so.TOC 
[24359s] python3 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="llvm-nm"  --sofile="./libffmpeg.so" --tocfile="./libffmpeg.so.TOC" --output="./libffmpeg.so" -- clang++ -shared -Wl,-soname="libffmpeg.so" -Wl,-Bsymbolic -L gen/third_party/ffmpeg -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--undefined-version -Wl,--no-call-graph-profile-sort --target=riscv64-linux-gnu -no-canonical-prefixes -Wl,-O2 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -Wl,-rpath=\$ORIGIN  -Wl,--build-id=sha1 -o "./libffmpeg.so" @"./libffmpeg.so.rsp" 
[24359s] ld.lld: error: undefined symbol: ff_get_pixels_16_rvi
[24359s] >>> referenced by pixblockdsp_init.c:46 (../../third_party/ffmpeg/libavcodec/riscv/pixblockdsp_init.c:46)
[24359s] >>>               obj/third_party/ffmpeg/ffmpeg_internal/pixblockdsp_init.o:(ff_pixblockdsp_init_riscv)
[24359s] 
[24359s] ld.lld: error: undefined symbol: ff_get_pixels_8_rvi
[24359s] >>> referenced by pixblockdsp_init.c:48 (../../third_party/ffmpeg/libavcodec/riscv/pixblockdsp_init.c:48)
[24359s] >>>               obj/third_party/ffmpeg/ffmpeg_internal/pixblockdsp_init.o:(ff_pixblockdsp_init_riscv)
[24359s] 
[24359s] ld.lld: error: undefined symbol: ff_vector_clipf_rvf
[24359s] >>> referenced by audiodsp_init.c:36 (../../third_party/ffmpeg/libavcodec/riscv/audiodsp_init.c:36)
[24359s] >>>               obj/third_party/ffmpeg/ffmpeg_internal/audiodsp_init.o:(ff_audiodsp_init_riscv)
[24359s] 
[24359s] ld.lld: error: undefined symbol: ff_bswap32_buf_rvb
[24359s] >>> referenced by bswapdsp_init.c:34 (../../third_party/ffmpeg/libavcodec/riscv/bswapdsp_init.c:34)
[24359s] >>>               obj/third_party/ffmpeg/ffmpeg_internal/bswapdsp_init.o:(ff_bswapdsp_init_riscv)
[24359s] clang++: error: linker command failed with exit code 1 (use -v to see invocation)

你可能需要 osc up -s instead of osc up -S。参考这里让这个指令工作起来。

本地编译可以将 build_headless 的参数改成 0,来跳过 headless 编译。实际使用的 patch 以下方的 %patch -Pxxx 为准。

不能删除 Patch5000、5001、5003 和 5004。不要升级 Chromium,但你可以做到搬运这几个 patch 的情况下除外,这也会有 Bonus。已知升级之后有问题的版本:120。

misaka00251 commented 7 months ago

Temporary close this