From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4BD6943B4D for ; Thu, 14 Jul 2022 14:51:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 876A368B9A9; Thu, 14 Jul 2022 17:51:50 +0300 (EEST) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4FC0968B8FD for ; Thu, 14 Jul 2022 17:51:43 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 8A6E3200006 for ; Thu, 14 Jul 2022 14:51:42 +0000 (UTC) Date: Thu, 14 Jul 2022 16:51:41 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220714145141.GB2088045@pb2> References: <20220713211438.3134725-1-martin@martin.st> MIME-Version: 1.0 In-Reply-To: <20220713211438.3134725-1-martin@martin.st> Subject: Re: [FFmpeg-devel] [PATCH v2] libavcodec: Set hidden visibility on global symbols accessed from AArch64 assembly X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============1827629224331526935==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1827629224331526935== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 14, 2022 at 12:14:38AM +0300, Martin Storsj=C3=B6 wrote: > The AArch64 assembly accesses those symbols directly, without > indirection via e.g. the GOT on ELF. In order for this not to > require text relocations, those symbols need to be resolved fully > at link time, i.e. those symbols can't be interposable. >=20 > Normally, so far, this is achieved when linking shared libraries > in two ways; we have a version script (libavcodec/libavcodec.v) which > marks all symbols that don't start with av* as local. Additionally, > we try to add -Wl,-Bsymbolic to the linker options if supported, > making sure that such symbol references are resolved fully at link > time, instead of making them interposable. >=20 > When the libavcodec static library is linked into another shared > library, there's no guarantee that it uses similar options (even though > that would be favourable), which would end up requiring text relocations > in the AArch64 assembly. >=20 > Explicitly mark the symbols that are accessed from AArch64 assembly > as hidden, so that they are resolved fully at link time even without > the version script and -Wl,-Bsymbolic. >=20 > Signed-off-by: Martin Storsj=C3=B6 > --- > Moved the attribute to libavutil/internal.h, renamed to a different > namespace (not av_ prefixed), moved the attribute on ff_vp9_subpel_filters > to the header, as suggested. > --- > libavcodec/aacsbrdata.h | 2 +- > libavcodec/fft.h | 2 +- > libavcodec/vp9dsp.h | 2 +- > libavutil/internal.h | 6 ++++++ > 4 files changed, 9 insertions(+), 3 deletions(-) This seems to break build on linux x86-64, i guess iam missing something MAN doc/ffprobe-all.1 In file included from libavcodec/x86/vp9dsp_init_16bpp.c:26:0: =2E/libavcodec/vp9dsp.h:123:50: error: expected =E2=80=98=3D=E2=80=99, =E2= =80=98,=E2=80=99, =E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99 or =E2=80=98__= attribute__=E2=80=99 before =E2=80=98ff_vp9_subpel_filters=E2=80=99 extern const int16_t attribute_visibility_hidden ff_vp9_subpel_filters[3][= 16][8]; ^~~~~~~~~~~~~~~~~~~~~ ffbuild/common.mak:81: recipe for target 'libavcodec/x86/vp9dsp_init_16bpp.= o' failed make: *** [libavcodec/x86/vp9dsp_init_16bpp.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from libavcodec/x86/vp9dsp_init_16bpp_template.c:26:0, from libavcodec/x86/vp9dsp_init_12bpp.c:25: =2E/libavcodec/vp9dsp.h:123:50: error: expected =E2=80=98=3D=E2=80=99, =E2= =80=98,=E2=80=99, =E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99 or =E2=80=98__= attribute__=E2=80=99 before =E2=80=98ff_vp9_subpel_filters=E2=80=99 extern const int16_t attribute_visibility_hidden ff_vp9_subpel_filters[3][= 16][8]; ^~~~~~~~~~~~~~~~~~~~~ In file included from libavcodec/x86/vp9dsp_init_16bpp_template.c:26:0, from libavcodec/x86/vp9dsp_init_10bpp.c:25: =2E/libavcodec/vp9dsp.h:123:50: error: expected =E2=80=98=3D=E2=80=99, =E2= =80=98,=E2=80=99, =E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99 or =E2=80=98__= attribute__=E2=80=99 before =E2=80=98ff_vp9_subpel_filters=E2=80=99 extern const int16_t attribute_visibility_hidden ff_vp9_subpel_filters[3][= 16][8]; ^~~~~~~~~~~~~~~~~~~~~ ffbuild/common.mak:81: recipe for target 'libavcodec/x86/vp9dsp_init_12bpp.= o' failed make: *** [libavcodec/x86/vp9dsp_init_12bpp.o] Error 1 ffbuild/common.mak:81: recipe for target 'libavcodec/x86/vp9dsp_init_10bpp.= o' failed make: *** [libavcodec/x86/vp9dsp_init_10bpp.o] Error 1 In file included from libavcodec/x86/vp9dsp_init.c:26:0: =2E/libavcodec/vp9dsp.h:123:50: error: expected =E2=80=98=3D=E2=80=99, =E2= =80=98,=E2=80=99, =E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99 or =E2=80=98__= attribute__=E2=80=99 before =E2=80=98ff_vp9_subpel_filters=E2=80=99 extern const int16_t attribute_visibility_hidden ff_vp9_subpel_filters[3][= 16][8]; ^~~~~~~~~~~~~~~~~~~~~ ffbuild/common.mak:81: recipe for target 'libavcodec/x86/vp9dsp_init.o' fai= led make: *** [libavcodec/x86/vp9dsp_init.o] Error 1 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship: All citizens are under surveillance, all their steps and actions recorded, for the politicians to enforce control. Democracy: All politicians are under surveillance, all their steps and actions recorded, for the citizens to enforce control. --b5gNqxB1S1yM7hjW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYtAtegAKCRBhHseHBAsP q8O+AJ0aiI7ZqJZSB0YvGXP4J+VAGBvmbwCgnC1q1csq9qjtcGjVJ8RcdOgQjKk= =osJ5 -----END PGP SIGNATURE----- --b5gNqxB1S1yM7hjW-- --===============1827629224331526935== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============1827629224331526935==--