From patchwork Mon Oct 30 19:17:57 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: 5765 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp3057499jah; Mon, 30 Oct 2017 12:26:28 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RQzu0ncnMNFdwT972WOEZU6e1t46rH1J1GA6lq9wZR6ZxfxeeIkHPalSwpYkzqheMgfNAb X-Received: by 10.28.31.76 with SMTP id f73mr4934523wmf.139.1509391588065; Mon, 30 Oct 2017 12:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509391588; cv=none; d=google.com; s=arc-20160816; b=UmWZ58gpbyfiPmyUXVymhzmyuMPPOlHz/uLIRaqx/+PqM/WlSl+x2OKPigBS4QbAr2 d1qxx+U4ysvtSnTqHzV39d/wZNpE+8EzK7a67F75IBwzhoLICdqzp/FEhmPP1oXObaCY DUj5/K1feP7m0Is8K9DkAIB/negZ6QTOz1bCwdCWIsL5967VqBVUaivT8tepBeGzw/yl U2EkfdFkuYWT2f+miojSQqPg5ttXgD5wfTnsErCL8/+6Q22lxczMaGhbcD07+QzeoxA5 bmr50orpBW+VDCXvuWfR8alAa8YjHJY3uqBLX1yIy2SipaK6Sc9xyIV2QbwBKtT6Ohre 9Jbw== 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:mime-version :dkim-signature:delivered-to:arc-authentication-results; bh=YdDxKLX1htO5kEJ+k41pRN37K4mOBuRhCQtrLl+LDB0=; b=fYQFqIJ8ojonzplPhFUrkrCih5lNtr/zKMZFRA6gtPcRKCTihqcdISGPT90UFOytpK TCqTDu4YOA/JGGoVQZmHJFiWweqP4BYIDmTi0cOjkbQiC+38oB08rGYcETPWNeQ6Od0K 1TsiPucRJ3VKOuSsNUe3zFC+EEL519x4GMOrCBmaozufGN64TZJwNmsUqakmgE70PRgH Pp+9FWFPDMqzKqyeB/qq6rYAP6hMGAGniUlyoXQFzAGkB/stJXekys+130lvsscYZSz6 jAuSEWGDCXFLRdAqUNgFKS5H1h31CWhq5Q27PFBES8zNCFMLaJRHn1piF08eBCiEjWyL yJYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=JZHhXexX; 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 j19si9138326wrb.367.2017.10.30.12.26.27; Mon, 30 Oct 2017 12:26:28 -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=JZHhXexX; 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 2D5286898CF; Mon, 30 Oct 2017 21:26:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io0-f196.google.com (mail-io0-f196.google.com [209.85.223.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B2897689886 for ; Mon, 30 Oct 2017 21:26:09 +0200 (EET) Received: by mail-io0-f196.google.com with SMTP id p186so29709929ioe.12 for ; Mon, 30 Oct 2017 12:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=gu5f+za6VTxhc1MKpbfhTSoJwbJbhW2qHtcuVWG65Wg=; b=JZHhXexX3vrsQHMaifl+aoZMUXom69AGpo/zwD4/M0HvvyUDYGHb7oq9pAPe/B8oWl YaOExA7ZTm/rf90NilpKQATXCsgDso9qpqlQbqNnKD1PUFR9QYbU/4w4JzeghoXpfGnQ l26ZfLWMOZTzlUJ50OCVSw+ikNxn3p/3cLMGfdyepr3aZkUvto30QvapspAciKo1tOF6 j1Tn+lTiLR/620bXlScud6BznCFL2+VXySsbzoDlU9r+WtlfwwVpxxZ1sGjf6MxvQkOI cPjwb0BHZH6vJkrg9YGhR+8Jt9XbysMs8q2CjDiM8Nyd37Jmr+SvX6HFWRUO/TjA81tb 27Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gu5f+za6VTxhc1MKpbfhTSoJwbJbhW2qHtcuVWG65Wg=; b=b0jIGDNWoPezxj7Z/M3EgDd2BSscpCGHICmW3eFHXcmaos1hRsyH3xWV5qZLIdK6hh gt1q7tfYGTpkKJpPdd5Y3skC3NP4Fhg8Jh8t3mmrP5a7FL1Jlb/J2kHfU4QVLVvVR+WW 13H7KxVjDTbknHby45Dk5T0rZirE/Y6b0zEUmYJ9s216YHo0Ugnm/YWAFosAyu8Yj6xV 4snUWH8/PCLUMGHfmoMLMH4GXZafycKW/DIiqzxBI6gAMHsSVyllnfGSbvA9/pRlIRr9 wedAQvmV0QjFlFBtclkwHnBB+iSdMbEFjzSU5oM9tIaItspA80Otytkzk/Ne9bsbstCc sbdA== X-Gm-Message-State: AMCzsaWSciCsY/mODQo3P/PhBgJNWhxdR4kB2DKMXk8q/2N8y1Su+s7A jZT3Vewtkgn91s9rMoUR3XqJSqsxMulUOeWKxDoXVAk6hvo= X-Received: by 10.36.122.1 with SMTP id a1mr7729862itc.30.1509391094499; Mon, 30 Oct 2017 12:18:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.150.17 with HTTP; Mon, 30 Oct 2017 12:17:57 -0700 (PDT) From: =?UTF-8?Q?Thomas_K=C3=B6ppe?= Date: Mon, 30 Oct 2017 19:17:57 +0000 Message-ID: To: ffmpeg-devel@ffmpeg.org X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [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" 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(-) __attribute__ ((aligned (FFMIN(n, 16)))) v #elif defined(__GNUC__) || defined(__clang__) #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v 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..db06e109be 100644 --- a/libavutil/mem.h +++ b/libavutil/mem.h @@ -98,7 +98,7 @@ AV_PRAGMA(DATA_ALIGN(v,n)) \ static const t __attribute__((aligned(n))) v #elif defined(__DJGPP__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v + #define DECLARE_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