[libav] unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `sin@@GLIBC_2.16'

Bug #1089933 reported by Marcin Juszkiewicz
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro AArch64 cross-distro work
Fix Released
Low
Mans Rullgard
Linaro OpenEmbedded
Fix Released
Undecided
Unassigned

Bug Description

| GEN libavcodec/sinewin_tables.h
| CC libavcodec/sinewin.o
| LD libavutil/libavutil.so.52
| /media/storage/devel/canonical/aarch64/CLEAN/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/aarch64-oe-linux/../../libexec/aarch64-oe-linux/gcc/aarch64-oe-linux/4.7.3/ld: libavutil/eval.o(.text+0x1010): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `sin@@GLIBC_2.16'
| /media/storage/devel/canonical/aarch64/CLEAN/build/tmp-eglibc/sysroots/x86_64-linux/usr/bin/aarch64-oe-linux/../../libexec/aarch64-oe-linux/gcc/aarch64-oe-linux/4.7.3/ld: final link failed: Nonrepresentable section on output
| collect2: error: ld returned 1 exit status
| make: *** [libavutil/libavutil.so.52] Error 1
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (see /home/hrw/HDD/devel/canonical/aarch64/CLEAN/build/tmp-eglibc/work/aarch64-oe-linux/libav/0.8.99+git2+6d5b0092678b2a95dfe209a207550bd2fe9ef646-r6.0/temp/log.do_compile.20175 for further information)

14:54 hrw@puchatek:build$ ./tmp-eglibc/sysroots/x86_64-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-ld --version
GNU ld (GNU Binutils) 2.23.51.20121130

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

| /tmp/OE/tmp/sysroots/x86_64-linux/usr/bin/aarch64-oe-linux/../../libexec/aarch64-oe-linux/gcc/aarch64-oe-linux/4.7.3/ld: libavutil/eval.o(.text+0xfa0): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `sin@@GLIBC_2.17'

binutils 2.23.51.20130109 and eglibc 2.17 - still fail.

We need toolchain developer for it probably.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Steps to reproduce:

mkdir openembedded
cd openembedded
git clone git://git.linaro.org/openembedded/meta-aarch64.git
bash meta-aarch64/scripts/init.sh
cd openembedded/openembedded-core
. oe-init-build-env ../build
bitbake libav

After some time (up to 3h) it should get to fail point.

Marcin Juszkiewicz (hrw)
Changed in linaro-oe:
assignee: nobody → Matthew Gretton-Dann (matthew-gretton-dann)
Revision history for this message
Marcus Shawcroft (marcus-shawcroft) wrote :

The test case needs reducing a tad.

R_AARCH64_ADR_PREL_PG_HI21 is used by the small absolute memory model, given that the failing link appears to be producing ject my first question would be did eval.o get compiled with -fPIC ??

Revision history for this message
Marcus Shawcroft (marcus-shawcroft) wrote :

Ooops, sticky fingers. My last comment should have read "given that the failing link appears to be producing a shared object, my first question...."

Revision history for this message
Marcus Shawcroft (marcus-shawcroft) wrote :

Digging a bit further confirms my suspicion, libav is trying to build shared objects without the requesting -fPIC. I've hacked the Makefile and can successfully run "bitbake libav". Marcin, I leave it to you to fix the libav Makefile properly.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

diff --git a/Makefile b/Makefile
index 19b8df4..9cca3a2 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale

 IFLAGS := -I. -I$(SRC_PATH)
 CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
-CFLAGS += $(ECFLAGS)
+CFLAGS += $(ECFLAGS) -fPIC
 CCFLAGS = $(CFLAGS)
 YASMFLAGS += $(IFLAGS) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
 HOSTCFLAGS += $(IFLAGS)

And it built.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Thanks Marcus.

Marcin Juszkiewicz (hrw)
Changed in linaro-oe:
assignee: Matthew Gretton-Dann (matthew-gretton-dann) → nobody
Changed in linaro-aarch64:
assignee: nobody → Mans Rullgard (mansr)
Revision history for this message
Mans Rullgard (mansr) wrote : Re: [Bug 1089933] [NEW] [libav] unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `sin@@GLIBC_2.16'

Does adding --enable-pic to the configure flags fix it? If so, it's missing
that requirement for aarch64.

--
Mans Rullgard / mru

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Mans: this patch solves problem.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Yes, adding --enable-pic fixes that.

Marcin Juszkiewicz (hrw)
Changed in linaro-aarch64:
status: New → In Progress
Changed in linaro-oe:
status: New → In Progress
Revision history for this message
Mans Rullgard (mansr) wrote :

The patch looks correct, forwarding to libav-devel.

Revision history for this message
Mans Rullgard (mansr) wrote :
Changed in linaro-aarch64:
status: In Progress → Fix Committed
Marcin Juszkiewicz (hrw)
Changed in linaro-oe:
status: In Progress → Fix Released
Marcin Juszkiewicz (hrw)
Changed in linaro-oe:
milestone: none → 13.01
Changed in linaro-aarch64:
importance: Undecided → Low
Changed in linaro-aarch64:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.