Created attachment 178757 [details] proposed patch armv6 is similar to aarch64 in that it requires -fPIC when building shared libs.
As of 20170124 it seems to build on the cluster. Is this patch still needed for native builds?
Yes, it's still needed. By ARM EABI, shared library must be compiled with -fPIC. (In short, standard ARM object file may contain relocations which cannot be resolved by runtime linker, like R_ARM_MOVW_*, R_ARM_MOVT_*.) The port build fails if you have specified any 'higher' CPU type. With -mcpu=cortex-a15, the build fails with: (and I'm sorry, I did not realize that -mcpu is necessary for the exhibition of this problem) /bin/sh ../libtool --mode=link cc -pipe -munaligned-access -mcpu=cortex-a15 -fno-builtin-sin -fno-builtin-cos -fno-strict-aliasing -O -pipe -O2 -munaligned-access -fomit-frame-pointer -prefer-non-pic -o liba52.la -rpath /usr/local/lib -no-undefined bitstream.lo imdct.lo bit_allocate.lo parse.lo downmix.lo -lm rm -fr .libs/liba52.la .libs/liba52.* .libs/liba52.* cc -shared bitstream.lo imdct.lo bit_allocate.lo parse.lo downmix.lo -lm -Wl,-soname -Wl,liba52.so.0 -o .libs/liba52.so.0.0.0 /usr/bin/ld: imdct.lo(.text+0x90c): unresolvable R_ARM_MOVW_ABS_NC relocation against symbol `__stderrp@@FBSD_1.0' /usr/bin/ld: final link failed: Nonrepresentable section on output
This may not be the right commit; see https://lists.freebsd.org/pipermail/svn-ports-all/2017-February/144857.html .
This bug is still valid now (6 months later after initial report) and the attached patch did fix the build. Shall we commit it?
Created attachment 186114 [details] new version Yes, it is still valid. But due to upcoming armv7 architecture (see PR221894 ) I think that is better to also add it now. Thanks.
(In reply to Michal Meloun from comment #5) With this patch applied audio/liba52 built just fine. (I had reported my example of the issue to the lists and someone pointed me to this bugzilla report.) No longer does this bugzilla need to say "Affects Only Me" since I've another example. (But I do not have permission to change that status.)
Ping. Can you, please, commit it? Proposed fix is nop for all but armv6/7 and this bug blocks many qt5-* ports. Thanks.
(In reply to Michal Meloun from comment #7) I'm not sure that anyone with a committer status is significantly involved with this bugzilla yet. The "Assignee" is a generic multimedia@ one. Also: as far as I can tell a more proper fix is more likely to be something like: CFLAGS+= -fPIC instead of listing each architecture separately. (This presumes that the software ported does not have its own means requesting such handling. If it does then it might be preferred to use that technique of requesting it instead.) I think that is what comment #3 was about.
> CFLAGS_aarch64= -fPIC > CFLAGS_amd64= -fPIC > +CFLAGS_armv6= -fPIC > +CFLAGS_armv7= -fPIC > CFLAGS_powerpc= -fPIC Why not drop -prefer-non-pic instead? Maybe libtool maintainer has a clue. https://git.archlinux.org/svntogit/packages.git/tree/trunk/a52dec-0.7.4-build.patch?h=packages/a52dec https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/a52dec/files/a52dec-0.7.4-build.patch https://anonscm.debian.org/cgit/pkg-multimedia/a52dec.git/tree/debian/patches/01-enable-pic.diff
(In reply to Jan Beich from comment #9) Yes, those Linux patches are correct. You can remove CFLAGS_<arch>+=-fPIC from the port Makefile then.
A commit references this bug: Author: jbeich Date: Thu Sep 28 19:32:49 UTC 2017 New revision: 450863 URL: https://svnweb.freebsd.org/changeset/ports/450863 Log: audio/liba52: build PIC objects on all architectures PR: 215974 Reported by: mmel Inspired by: ArchLinux, Gentoo, Debian Reviewed by: tijl (implicit) Changes: head/audio/liba52/Makefile
A commit references this bug: Author: jbeich Date: Thu Sep 28 19:43:06 UTC 2017 New revision: 450864 URL: https://svnweb.freebsd.org/changeset/ports/450864 Log: MFH: r450863 audio/liba52: build PIC objects on all architectures PR: 215974 Reported by: mmel Inspired by: ArchLinux, Gentoo, Debian Reviewed by: tijl (implicit) Approved by: ports-secteam blanket Changes: _U branches/2017Q3/ branches/2017Q3/audio/liba52/Makefile