From patchwork Wed Jul 27 12:00:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Guillem X-Patchwork-Id: 37004 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp303308pzb; Wed, 27 Jul 2022 05:01:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tT+Zv4K83pL9JR4MyLx7Z6x3es9Qb5h/B9pJNhaDsaPwSg8Gp6DQlfg/7ZWU6g4XWFRutO X-Received: by 2002:a17:906:9b0a:b0:72e:e524:180a with SMTP id eo10-20020a1709069b0a00b0072ee524180amr17669916ejc.131.1658923287699; Wed, 27 Jul 2022 05:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658923287; cv=none; d=google.com; s=arc-20160816; b=VB3Q58MUF80FxXnnLen1q3OWiW75wOLjmjNjqIONUPudBFrtj2S8G5C0U62gxb4LXO doCd8pefO4CBB+ETox4dv66EHgSLPE41J8sRmQIY2cGKvCKMQcRxcU18RUcCFPiYSmBe 93Le8at4XvfFPbhcqyj/QYe+7Uz7oLlzhDH1Puc7nLLtQahKw8H5cY+sPWQ1k+mCn+RF Du/RZEmlViTDGGpLJyhcAggS1Akurq5Su3/o2hqCOKAP7TYV4gu4nXAFT2qtsKWs0Due taEpKLIENSby8KXXxG3B0IKRhcDJb9phQp3oAS6LyXYRJlG+O/zX1tWW4RcElmayXaB6 ZWCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from:feedback-id :dkim-signature:dkim-signature:delivered-to; bh=tOhK4LuMoGHvXY1+ru0gz67OD4VhuWKoIpKBYY7LGUM=; b=nebsDELEnC9Rdfo53R1Q5B2ATUjPF0H7tSn17Rw03+K/+I8TcG+013t8I3qS4k6oLm Ey5gDKQpiPO4zRhd9BAcu1MEJGIidQfA5mlcBwq9TXx3gLDH7kC8noJUVg67QbJdgpxE HNMe75GADvfB9JlcYoiz1BuLGRkM/OH6oS9LHT6H/ic2CHyJMlJynhfP6Esy31ogoRns ZnjSs/FsDAFz37NYQlWWJOAB3/URglRgFeVzKzV4nIlP7tpTpC0HQSyCLOQZkVZeiijC Br2tfRW5oIezt5O4r/NmIhO85E+mWXQzHld7tTi6pCrtF4NsZ3c0tLl5gtlk3p4ixhl/ APxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gllm.fr header.s=fm2 header.b=fiKERXuk; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm3 header.b=VEZXdBjG; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gllm.fr Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o1-20020a056402444100b0043cc65ce7c5si631081edb.502.2022.07.27.05.01.23; Wed, 27 Jul 2022 05:01:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gllm.fr header.s=fm2 header.b=fiKERXuk; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm3 header.b=VEZXdBjG; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gllm.fr Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 75F3168B962; Wed, 27 Jul 2022 15:01:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0858E68B840 for ; Wed, 27 Jul 2022 15:01:13 +0300 (EEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 4FF3C320047A for ; Wed, 27 Jul 2022 08:01:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 27 Jul 2022 08:01:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gllm.fr; h=cc :content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1658923267; x=1659009667; bh=+T8Jw3lSjL9WW9tYXTBhrzR8G Uzrq0JBk5Q73v8t4eo=; b=fiKERXukHE+R/kFlcX0LYY8dJOb1Y+SI2o3EdPPxg +PYBHsMyXvgJKIqqsbYGb1LS88n2XbA9AW4b4+defoM2qkJPt50qD0zQ62SzaOct kgmkU7GIR1z3/hn+W/+6yClx7dlIvcR1MDGYX8BmylL9EUaNfcx8D/vbjhbeGSk4 BSKctb05SWmnUr1zxshoQseELEtQ5n6n4YBegZkugIHseLGx25OcuQSQHHtvG47a UpIfda4NMzdGKOyZhMQoMF30SRVnmWASIyMVkwcze2xeOWaM6F05rgjx0zyDIpXt kwEuM70pGFPsy6A66SnqLnDZeoPvZbmfNXMwZnpL3rr2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1658923267; x=1659009667; bh=+T8Jw3lSjL9WW9tYXTBhrzR8GUzrq0JBk5Q 73v8t4eo=; b=VEZXdBjGS7Lvaq5t3ipJZnaCqjZDmQYAKOJOamIVHPvLgVPfJse HcTIQN5ohoS2bHIMUsbpu0YI00j0Y1nSMjhlqW0Y2TpxXsHyFfBJiyW3FbO7jJka 4QkAnamfzVGsd710iJ2SULMPMoZ32TG4yGxVp+oZsdhX8sHAvqN34YWaDxDH4J7g 2SSYBFjkc/w+7BJEQ6aY5TXIQb3kaK8Xw7Cb/AwZEm33ISxlKrgdTXZmUWcrwJcw 9zbaITVATX2wtrtsUcNnykvGFxK+kQqgWfOWWfw670aNhyjz1s41jVFB4McQzp/H RKFyR2DO3tTHODoSJnLMw8twzcJvOWVXsJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdduvddggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepvfhhohhmrghsucfiuhhilhhlvghmuceothhhohhmrghssehglhhl mhdrfhhrqeenucggtffrrghtthgvrhhnpefgtdelgfevtddtledufeetgfefjeehgefhvd evffevgfdtvedtkeejieekvefgjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehthhhomhgrshesghhllhhmrdhfrh X-ME-Proxy: Feedback-ID: i239440f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 27 Jul 2022 08:01:06 -0400 (EDT) From: Thomas Guillem To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Jul 2022 14:00:00 +0200 Message-Id: <20220727120000.3596575-1-thomas@gllm.fr> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] libavcodec: Set hidden visibility on global symbols accessed from x86_64 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ePO8v8BsWRZv DECLARE_ALIGNED, DECLARE_ASM_ALIGNED, and DECLARE_ASM_CONST will include attribute_visibility_hidden. ld: error: relocation R_X86_64_PC32 cannot be used against symbol 'ff_h264_cabac_tables'; recompile with -fPIC >>> defined in /home/tom/work/git/vlc-android/vlc/contrib/x86_64-linux-android/lib/libavcodec.a(cabac.o) >>> referenced by cabac.h:187 (libavcodec/x86/cabac.h:187) >>> h264_cabac.o:(ff_h264_decode_mb_cabac) in archive /home/tom/work/git/vlc-android/vlc/contrib/x86_64-linux-android/lib/libavcodec.a --- libavcodec/ac3dsp.h | 3 +- libavcodec/cabac.h | 3 +- libavcodec/h263dsp.h | 3 +- libavcodec/x86/constants.h | 81 +++++++++++++++++++------------------- libavutil/mem.h | 6 +-- libswscale/x86/rgb2rgb.c | 2 +- 6 files changed, 51 insertions(+), 47 deletions(-) diff --git a/libavcodec/ac3dsp.h b/libavcodec/ac3dsp.h index a23b11526e..f8c03a7c23 100644 --- a/libavcodec/ac3dsp.h +++ b/libavcodec/ac3dsp.h @@ -23,12 +23,13 @@ #define AVCODEC_AC3DSP_H #include +#include "libavutil/internal.h" /** * Number of mantissa bits written for each bap value. * bap values with fractional bits are set to 0 and are calculated separately. */ -extern const uint16_t ff_ac3_bap_bits[16]; +extern const uint16_t attribute_visibility_hidden ff_ac3_bap_bits[16]; typedef struct AC3DSPContext { /** diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h index 38d06b2842..356aa368d0 100644 --- a/libavcodec/cabac.h +++ b/libavcodec/cabac.h @@ -28,8 +28,9 @@ #define AVCODEC_CABAC_H #include +#include "libavutil/internal.h" -extern const uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63]; +extern const uint8_t attribute_visibility_hidden ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63]; #define H264_NORM_SHIFT_OFFSET 0 #define H264_LPS_RANGE_OFFSET 512 #define H264_MLPS_STATE_OFFSET 1024 diff --git a/libavcodec/h263dsp.h b/libavcodec/h263dsp.h index 1abea3ca8c..514a148fb1 100644 --- a/libavcodec/h263dsp.h +++ b/libavcodec/h263dsp.h @@ -20,8 +20,9 @@ #define AVCODEC_H263DSP_H #include +#include "libavutil/internal.h" -extern const uint8_t ff_h263_loop_filter_strength[32]; +extern const uint8_t attribute_visibility_hidden ff_h263_loop_filter_strength[32]; typedef struct H263DSPContext { void (*h263_h_loop_filter)(uint8_t *src, int stride, int qscale); diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h index 85da38b7b9..c84b0d4324 100644 --- a/libavcodec/x86/constants.h +++ b/libavcodec/x86/constants.h @@ -22,51 +22,52 @@ #define AVCODEC_X86_CONSTANTS_H #include +#include "libavutil/internal.h" #include "libavutil/x86/asm.h" -extern const ymm_reg ff_pw_1; -extern const ymm_reg ff_pw_2; -extern const xmm_reg ff_pw_3; -extern const ymm_reg ff_pw_4; -extern const xmm_reg ff_pw_5; -extern const xmm_reg ff_pw_8; -extern const xmm_reg ff_pw_9; -extern const uint64_t ff_pw_15; -extern const xmm_reg ff_pw_16; -extern const xmm_reg ff_pw_18; -extern const xmm_reg ff_pw_20; -extern const xmm_reg ff_pw_32; -extern const uint64_t ff_pw_42; -extern const uint64_t ff_pw_53; -extern const xmm_reg ff_pw_64; -extern const uint64_t ff_pw_96; -extern const uint64_t ff_pw_128; -extern const ymm_reg ff_pw_255; -extern const ymm_reg ff_pw_256; -extern const ymm_reg ff_pw_512; -extern const ymm_reg ff_pw_1023; -extern const ymm_reg ff_pw_1024; -extern const ymm_reg ff_pw_2048; -extern const ymm_reg ff_pw_4095; -extern const ymm_reg ff_pw_4096; -extern const ymm_reg ff_pw_8192; -extern const ymm_reg ff_pw_m1; +extern const ymm_reg attribute_visibility_hidden ff_pw_1; +extern const ymm_reg attribute_visibility_hidden ff_pw_2; +extern const xmm_reg attribute_visibility_hidden ff_pw_3; +extern const ymm_reg attribute_visibility_hidden ff_pw_4; +extern const xmm_reg attribute_visibility_hidden ff_pw_5; +extern const xmm_reg attribute_visibility_hidden ff_pw_8; +extern const xmm_reg attribute_visibility_hidden ff_pw_9; +extern const uint64_t attribute_visibility_hidden ff_pw_15; +extern const xmm_reg attribute_visibility_hidden ff_pw_16; +extern const xmm_reg attribute_visibility_hidden ff_pw_18; +extern const xmm_reg attribute_visibility_hidden ff_pw_20; +extern const xmm_reg attribute_visibility_hidden ff_pw_32; +extern const uint64_t attribute_visibility_hidden ff_pw_42; +extern const uint64_t attribute_visibility_hidden ff_pw_53; +extern const xmm_reg attribute_visibility_hidden ff_pw_64; +extern const uint64_t attribute_visibility_hidden ff_pw_96; +extern const uint64_t attribute_visibility_hidden ff_pw_128; +extern const ymm_reg attribute_visibility_hidden ff_pw_255; +extern const ymm_reg attribute_visibility_hidden ff_pw_256; +extern const ymm_reg attribute_visibility_hidden ff_pw_512; +extern const ymm_reg attribute_visibility_hidden ff_pw_1023; +extern const ymm_reg attribute_visibility_hidden ff_pw_1024; +extern const ymm_reg attribute_visibility_hidden ff_pw_2048; +extern const ymm_reg attribute_visibility_hidden ff_pw_4095; +extern const ymm_reg attribute_visibility_hidden ff_pw_4096; +extern const ymm_reg attribute_visibility_hidden ff_pw_8192; +extern const ymm_reg attribute_visibility_hidden ff_pw_m1; -extern const ymm_reg ff_pb_0; -extern const ymm_reg ff_pb_1; -extern const ymm_reg ff_pb_2; -extern const ymm_reg ff_pb_3; -extern const ymm_reg ff_pb_80; -extern const ymm_reg ff_pb_FE; -extern const uint64_t ff_pb_FC; +extern const ymm_reg attribute_visibility_hidden ff_pb_0; +extern const ymm_reg attribute_visibility_hidden ff_pb_1; +extern const ymm_reg attribute_visibility_hidden ff_pb_2; +extern const ymm_reg attribute_visibility_hidden ff_pb_3; +extern const ymm_reg attribute_visibility_hidden ff_pb_80; +extern const ymm_reg attribute_visibility_hidden ff_pb_FE; +extern const uint64_t attribute_visibility_hidden ff_pb_FC; -extern const xmm_reg ff_ps_neg; +extern const xmm_reg attribute_visibility_hidden ff_ps_neg; -extern const ymm_reg ff_pd_1; -extern const ymm_reg ff_pd_16; -extern const ymm_reg ff_pd_32; -extern const ymm_reg ff_pd_8192; -extern const ymm_reg ff_pd_65535; +extern const ymm_reg attribute_visibility_hidden ff_pd_1; +extern const ymm_reg attribute_visibility_hidden ff_pd_16; +extern const ymm_reg attribute_visibility_hidden ff_pd_32; +extern const ymm_reg attribute_visibility_hidden ff_pd_8192; +extern const ymm_reg attribute_visibility_hidden ff_pd_65535; #endif /* AVCODEC_X86_CONSTANTS_H */ diff --git a/libavutil/mem.h b/libavutil/mem.h index d91174196c..88fea4bfe7 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -113,9 +113,9 @@ #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v #elif defined(__GNUC__) || defined(__clang__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v + #define DECLARE_ALIGNED(n,t,v) attribute_visibility_hidden t __attribute__ ((aligned (n))) v + #define DECLARE_ASM_ALIGNED(n,t,v) attribute_visibility_hidden t av_used __attribute__ ((aligned (n))) v + #define DECLARE_ASM_CONST(n,t,v) attribute_visibility_hidden static const t av_used __attribute__ ((aligned (n))) v #elif defined(_MSC_VER) #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index b325e5dbd5..100f608d04 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -70,7 +70,7 @@ DECLARE_ASM_CONST(8, uint64_t, mul15_hi) = 0x0210021002100210ULL; DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL; DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2YOffset); -DECLARE_ALIGNED(8, extern const uint64_t, ff_w1111); +attribute_visibility_hidden DECLARE_ALIGNED(8, extern const uint64_t, ff_w1111); DECLARE_ALIGNED(8, extern const uint64_t, ff_bgr2UVOffset); #define BY ((int)( 0.098*(1<