New issue
Advanced search Search tips

Issue 782040 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Fuchsia
Pri: 3
Type: Bug

Blocking:
issue 707031



Sign in to add a comment

ffmpeg build in .so failing on Fuchsia in cast targets due to relocations

Project Member Reported by scottmg@chromium.org, Nov 7 2017

Issue description

[fuchsia-arm64-pic] scottmg@around:/work/cr/src$ gn gen out/test --args='is_debug = false
dcheck_always_on = true
is_component_build = false
target_os = "fuchsia"
use_goma = true
symbol_level = 1
target_cpu = "arm64"
is_chromecast = true
is_cast_audio_only = true
'
Done. Made 4829 targets from 896 files in 1167ms
[fuchsia-arm64-pic] scottmg@around:/work/cr/src$ ninja -C out/test cast_audio_backend_unittests
ninja: Entering directory `out/test'
[0->1/1 ~1] Regenerating ninja files
[5->1/7 ~2] SOLINK ./libcast_saturated_gain_1.0.so
FAILED: libcast_saturated_gain_1.0.so libcast_saturated_gain_1.0.so.TOC 
python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --sofile="./libcast_saturated_gain_1.0.so" --tocfile="./libcast_saturated_gain_1.0.so.TOC" --output="./libcast_saturated_gain_1.0.so"  -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--no-as-needed -lpthread -Wl,--as-needed -fuse-ld=lld -Wl,--icf=all --target=aarch64-fuchsia -resource-dir ../../third_party/fuchsia-sdk/toolchain_libs/clang/6.0.0 -Wl,-z,stack-size=0x800000 -Wl,--no-as-needed -lfdio -Wl,--as-needed -Werror -Wl,-O1 -Wl,--gc-sections -nostdlib++ --sysroot=../../third_party/fuchsia-sdk/sysroot/aarch64-fuchsia -o "./libcast_saturated_gain_1.0.so" -Wl,-soname="libcast_saturated_gain_1.0.so" @"./libcast_saturated_gain_1.0.so.rsp"
/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_dc_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:364 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:364)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add16_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:365 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:365)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add16_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_dc_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:391 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:391)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add16intra_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:392 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:392)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add16intra_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_dc_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:418 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:418)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add8_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:419 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:419)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add8_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct8_dc_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:633 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:633)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct8_add4_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct8_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:634 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:634)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct8_add4_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a
clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)
[5->2/7 ~1] SOLINK ./libcast_governor_1.0.so
FAILED: libcast_governor_1.0.so libcast_governor_1.0.so.TOC 
python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --sofile="./libcast_governor_1.0.so" --tocfile="./libcast_governor_1.0.so.TOC" --output="./libcast_governor_1.0.so"  -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--no-as-needed -lpthread -Wl,--as-needed -fuse-ld=lld -Wl,--icf=all --target=aarch64-fuchsia -resource-dir ../../third_party/fuchsia-sdk/toolchain_libs/clang/6.0.0 -Wl,-z,stack-size=0x800000 -Wl,--no-as-needed -lfdio -Wl,--as-needed -Werror -Wl,-O1 -Wl,--gc-sections -nostdlib++ --sysroot=../../third_party/fuchsia-sdk/sysroot/aarch64-fuchsia -o "./libcast_governor_1.0.so" -Wl,-soname="libcast_governor_1.0.so" @"./libcast_governor_1.0.so.rsp"
/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_dc_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:364 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:364)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add16_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:365 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:365)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add16_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_dc_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:391 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:391)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add16intra_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:392 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:392)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add16intra_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_dc_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:418 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:418)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add8_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:419 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:419)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct_add8_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct8_dc_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:633 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:633)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct8_add4_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a

/usr/local/google/work/cr/src/out/test/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: can't create dynamic relocation R_AARCH64_ADD_ABS_LO12_NC against symbol: ff_h264_idct8_add_neon in readonly segment; recompile object files with -fPIC
>>> defined in obj/third_party/ffmpeg/libffmpeg_internal.a(autorename_libavcodec_aarch64_h264idct_neon.o)
>>> referenced by asm.S:634 (../../third_party/ffmpeg/libavutil/aarch64/asm.S:634)
>>>               autorename_libavcodec_aarch64_h264idct_neon.o:(ff_h264_idct8_add4_neon) in archive obj/third_party/ffmpeg/libffmpeg_internal.a
clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1ff8654cb2647b511cb32dae4ffea9f7929b1ed9

commit 1ff8654cb2647b511cb32dae4ffea9f7929b1ed9
Author: Scott Graham <scottmg@chromium.org>
Date: Tue Nov 07 03:43:18 2017

fuchsia arm64: fix PIC-related errors in ffmpeg .S

The ffmpeg build uses this when is_component_ffmpeg is set, but that's
not generally on for non-is_component_mode=true builds like the cast
build. Add this flag to make test .sos (libcast_saturated_gain_1.0.so
and libcast_governor_1.0.so) that reference ffmpeg link. See linked
bug for errors.

xref: https://cs.chromium.org/chromium/src/third_party/ffmpeg/BUILD.gn?q=third_party/ffmpeg/build.gn+Bsymbolic&sq=package:chromium&l=421

Bug:  782040 
Change-Id: I6640899642db13759fbd427facebbc8da69b77f4
Reviewed-on: https://chromium-review.googlesource.com/756185
Reviewed-by: Stephen Lanham <slan@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514377}
[modify] https://crrev.com/1ff8654cb2647b511cb32dae4ffea9f7929b1ed9/chromecast/media/cma/backend/BUILD.gn

Status: Fixed (was: Started)

Sign in to add a comment