From patchwork Mon Oct 30 20:31:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Thomas_K=C3=B6ppe?= X-Patchwork-Id: 5766 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp3117658jah; Mon, 30 Oct 2017 13:32:16 -0700 (PDT) X-Google-Smtp-Source: ABhQp+T9errC68QUgOTo21VMSIqf/FbBBiIs29p63jrOF/3hPPsx3g4A9WOWPjwRg71Se6ElcVhA X-Received: by 10.223.200.132 with SMTP id k4mr8482860wrh.215.1509395536150; Mon, 30 Oct 2017 13:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509395536; cv=none; d=google.com; s=arc-20160816; b=aPiMNRb7WZLz39PoMgTRhw1kWqJRr6OmBfubvsveaxnYYjGwPmasu9aK1lySHfQ8d6 LIaVMcYCP2LsqsWjPHWWfuC7IVxlE7N+cEoipMrJghPm0DygMNJ3juMWlcxm2bQHsgTV Pyx40strBmPbWChPbz3ROAoVFnjUNvYi1hAtJNaQ+/m+6fcZXFHnKNCxysAijUpMRaz2 NHSah+noz9qXD55OlnLz6nlWdclMY78Dnm0NRCy7hN3ZKxYyvB4cBjABv4682dsrv6fu PT4+EW5/Tn7G3OZybgDW40T3lCCDCN8RMDdDgR9w+ow41wKUojv+LU0r4Steh4Q+VFEv ezyA== 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:to:message-id:date:from:references:in-reply-to :mime-version:dkim-signature:delivered-to:arc-authentication-results; bh=H75PoxHcPy6vmaKfksDfd6gtZ4SZa+mOrwVtQBbVgwY=; b=nQEEGmY5EUYbuGePJf+lZL1AMWxPjPcdGNWTy/mMVZ2uy4F3Bv3xzkLxn1A9W2ccxM s5qzyGEPkqkcVbZFvr6tuZnsBpV6aKk0t8kuCVGAR4khyNGV5Z9+OHXgnV1Ta6NynL1p mR0Zx+I7MwzAcoCBEhlIodyrVW7Grh22o0lUYJqphQeyX+HvQwBnTvwZUx5m9/zoEKRb ZhULzm+vsTwuvxXMQgnZlSUMw6nzigkXhyItLrt+8R8cXugDoz4MgxET7/0okPjNS7Vu uanc5sO1mPi8FOMD3sLZCM8xc8T0qeu1af/vsOqioqPqmYzr6gtepjl/2MDvFosQ127h 8Mkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=S2q3Cyq6; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p13si9048727wre.405.2017.10.30.13.32.15; Mon, 30 Oct 2017 13:32:16 -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=@google.com header.s=20161025 header.b=S2q3Cyq6; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 73CE1689B49; Mon, 30 Oct 2017 22:32:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io0-f195.google.com (mail-io0-f195.google.com [209.85.223.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 06B506800C9 for ; Mon, 30 Oct 2017 22:31:58 +0200 (EET) Received: by mail-io0-f195.google.com with SMTP id m81so30134157ioi.13 for ; Mon, 30 Oct 2017 13:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=+H610oIVoIDlWTdFNcZzr/ZzQTIM9fMQDKaihM59KHI=; b=S2q3Cyq6qJKwef6WgxklspDBnZc852lHEn/cPZsjDtJTMtv1KrQ5ZwHZyJk7RSekxk JvGpcr0MhqFTNCEJ4VPOhUR84buXHnSgt0XC8f9A1V7WxhMtXPJzkamASADTGhqSa9PE 3FozrWU9TDQVpsdhIr3Eag1kDW/63PnIqsHX80nndGrEg10cdapvzkYkePrJEpGRs5Mq mAWfR0nzj5MG3qZWxvC9dZ5YI2kDF5ZvEysjjwv7L6hGn1n5e+YvCapmNfYQUBq50+aV 0cemnkPh9LHgAvxmYG1YmPMnq3fs1t84yMVIrY2w3PHbRbp+iL+lTgFSMo9f1Qzp3MAn f8FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=+H610oIVoIDlWTdFNcZzr/ZzQTIM9fMQDKaihM59KHI=; b=WXMZdUEIcXV8UGbcCMAvbskClcAttUyFDq9DPFfmwsYTO/4CoGfCR3sqh92ssOkl4l XSMAXq+sH3FCMXvTl2NfmR3WPSRKET0CU50brqozXF0nEGAkFLNmM7DiYn0r0qBYrLDG KTIWg3DoxV7ZZ3f76X+FmmsIGlcikdbeHzkd6/K5G5jvg8oe1vTmFcZ6EYnjvJllJO8V qchimzJRERGWmbbtEkheJHeUqtAFy6I92Oi8frdVeUCH/3ifjqDa7KfBfiH7v7JUVUvQ qMhemF15oVmtkPgjKPGSxYWpS2oZLU1Lnk2GuXihW86z/2mxfW+j9K8UUQs9HvH4XXdL re7g== X-Gm-Message-State: AMCzsaUzIIGzlyyzh/Mr//12MiU8vOVOW8N7ITISBvkP5P+2+Fa6ckcG IlQH3cpe+OdOO/+jmLa6RpQx9zgx5vZI4ILUfRU4QkRnn7w= X-Received: by 10.36.80.11 with SMTP id m11mr24344itb.6.1509395525913; Mon, 30 Oct 2017 13:32:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.150.17 with HTTP; Mon, 30 Oct 2017 13:31:50 -0700 (PDT) In-Reply-To: References: <891adff0-0649-d42b-8b4a-5fc158064aa4@gmail.com> From: =?UTF-8?Q?Thomas_K=C3=B6ppe?= Date: Mon, 30 Oct 2017 20:31:50 +0000 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [PATCH] Fix missing used attribute for inline assembly variables X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Please find below the actual patch: #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v #elif defined(_MSC_VER) #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v ============== Variables used in inline assembly need to be marked with attribute((used)). Static constants already were, via the define of DECLARE_ASM_CONST. But DECLARE_ALIGNED does not add this attribute, and some of the variables defined with it are const only used in inline assembly, and therefore appeared dead. This change makes FFMPEG linkable with Clang's ThinLTO. --- libavcodec/cabac.c | 2 +- libavutil/mem.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c index dd2b057c6d..7321b48901 100644 --- a/libavcodec/cabac.c +++ b/libavcodec/cabac.c @@ -32,7 +32,7 @@ #include "cabac.h" #include "cabac_functions.h" -const uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63] = { +DECLARE_ALIGNED(1, const uint8_t, ff_h264_cabac_tables)[512 + 4*2*64 + 4*64 + 63] = { 9,8,7,7,6,6,6,6,5,5,5,5,5,5,5,5, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, diff --git a/libavutil/mem.h b/libavutil/mem.h index 527cd03191..c4ee11af58 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -101,7 +101,7 @@ #define DECLARE_ALIGNED(n,t,v) t __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_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v