From patchwork Sun Jun 24 18:25:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 9491 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:141:0:0:0:0:0 with SMTP id c62-v6csp3288311jad; Sun, 24 Jun 2018 11:33:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdhclWraaPsOlK3FC49uejI//LN3oTdxv9/qK2Pf73b+uWfw6+4cKMJKQJtt7w228n5dCcu X-Received: by 2002:a1c:c188:: with SMTP id r130-v6mr3370897wmf.67.1529865184826; Sun, 24 Jun 2018 11:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529865184; cv=none; d=google.com; s=arc-20160816; b=xksgppseE/uhGyTaRcqf7NrdPatphfTPo2xl20xlKs2lTQ7GvOwf1PJVsqoad4xImx +ZiLSO1IiWQpAgR0faI751S+J2y1ZJbJh/GhQLhpw2Ri0Ve9Slvi/h3wKJD4elFeeoCJ qUcgoQttXHwfcSChkQmjxmVlEl8bqJdV6f39xhMAJMIkv+Gd1pSL8w9GaDjXEDh6pltG +yCh+Ba3nXcGKQy00wRP3bsVq0ePhKlbA051wSL0G5FSReJ6ItNbd2M9qltex0VkVt/f EdM+StGnmWESpkQrP8VCDVjwZH7kyooQkXQdK1tL6UMcU/GqnKHJR32VesYhLHRvvDWM JS5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=jIvbFaG9ecrgig20ANcR6piGgr5fsjPUUEJJjWSQ63g=; b=gmFS1t2fDmPl3GLOS6WJSmSidoK9YpYhGTM8GomJEEm65uVcSz4yNJ6hPz2K4toWp+ kehohqNuNj90xBwYN7QC+vjdjuDgq+fSiwbEjICWPWeFBiw2NqLdUF2ONgW4CRi9H4Vh JEoJ3GgcjMeBywq+5iMlJkiFTkNqOPT9yqKag/bLAtB7Dia8eREQnN/BCjhvufcgoReB dMRUfvOgoL248wcYF0WrQ4Y6JIHl0VJAL7mqSXctncCAX017EMFuBgrlvIle4bmYq6VF DfNQIxIsAcj1CXyvP7QTfvn5lz73nVXHP8DRDDyXvPHuOkVw1hsCrtOOC4lj+isc7CCK XzqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=DxtJImvF; 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 b3-v6si8740854wrm.170.2018.06.24.11.33.04; Sun, 24 Jun 2018 11:33:04 -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=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=DxtJImvF; 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 5CFBF689B54; Sun, 24 Jun 2018 21:32:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F3C0689A9A for ; Sun, 24 Jun 2018 21:32:02 +0300 (EEST) Received: by mail-wr0-f177.google.com with SMTP id h10-v6so11355302wrq.8 for ; Sun, 24 Jun 2018 11:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=qaW7Iw9Ss8xLghbRBS/V2Q1vV4qGazRZ7eXpJ4KirdU=; b=DxtJImvFwvPwA+Ebsxff+xg7Me81aENcBDVC7IFfDgv6IOywJOaaUwnoU859u8WTs3 Q8+tN4Dbm14u7lSeLX8yYSjpjX25baaPUAcup97LjZbAc6JemLaznLopg9seU2xV0qDd W5MOlvNPi4E4JVkGMMc3O+8B3LcK8jyWXgIcN/nUs3f7gO5shF6X0beKDLTJDpU1OoF8 tHCyE8jybzYK7904eq/9R/35KELjIkJXjDMgh1u7YSE1P49jMl+6lpQ27Urj2cDgiSir k6uqHmBHx3sCjsXsyIjqeDhbm5rUG31NKMfw/LcT5fWri7xE1sF1jO+1zuGKY1Hzp7sV 5WJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=qaW7Iw9Ss8xLghbRBS/V2Q1vV4qGazRZ7eXpJ4KirdU=; b=BDpe3XiDDIQcVT3O1eWVrjDlmLk+1Nc4Y2qOFnLWlE4oDkCDaQqGns5RqJTYFWKL8D aL+9jS2msOCHKs3w0/ulFksgCAvEd+UMAI6vxDMeoOnJhGTqRgTKDbwLWAjcAJdoR+4v qMnPMfByHdi+RMe+42oOvle+je27HtqzVvp/JhJOHiLf7qmESfoNjnf7o6zETyxxW+ZV aky7q6L3K4Bpoxtol62f4Ic+CmRSRsS7tel4hKWF+U4+odEZQyz96Yf5G2Y2oXih4Ule /HshdMksN5tkAuzhcGlfhDc3Od/kvQTVF6npoJqXcnDpCDPyxG+jVOskF1iy7vH971I9 ybNw== X-Gm-Message-State: APt69E2oGVTxQcHJ5rESfq/0taMuaxi1pz+dzdcyg2Mu8b0Bbe41Tn3F S4WOhiKaYvHp2YXPoDlH0HSp7v57p4Y= X-Received: by 2002:a5d:45cb:: with SMTP id b11-v6mr7796171wrs.106.1529864747723; Sun, 24 Jun 2018 11:25:47 -0700 (PDT) Received: from lehr.home ([2a00:23c5:418a:8b00:5afb:84ff:fe66:bcaf]) by smtp.gmail.com with ESMTPSA id a2-v6sm5089929wmb.6.2018.06.24.11.25.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jun 2018 11:25:47 -0700 (PDT) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Sun, 24 Jun 2018 19:25:39 +0100 Message-Id: <20180624182539.32194-5-sw@jkqxz.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180624182539.32194-1-sw@jkqxz.net> References: <20180624182539.32194-1-sw@jkqxz.net> Subject: [FFmpeg-devel] [PATCH 5/5] fate: Add test for namespace prefixes in libraries 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Ensures that there are no external symbols in the built static libraries which do not have suitable namespace prefixes. --- Not sure whether this will actually work on all platforms? (Only tested with Linux/binutils.) tests/Makefile | 1 + tests/fate/namespace.mak | 20 ++++++++++++++++++++ tests/fate/namespace.sh | 17 +++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 tests/fate/namespace.mak create mode 100755 tests/fate/namespace.sh diff --git a/tests/Makefile b/tests/Makefile index e564279b0a..f09c57ac0f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -154,6 +154,7 @@ include $(SRC_PATH)/tests/fate/mpeg4.mak include $(SRC_PATH)/tests/fate/mpegps.mak include $(SRC_PATH)/tests/fate/mpegts.mak include $(SRC_PATH)/tests/fate/mxf.mak +include $(SRC_PATH)/tests/fate/namespace.mak include $(SRC_PATH)/tests/fate/opus.mak include $(SRC_PATH)/tests/fate/pcm.mak include $(SRC_PATH)/tests/fate/pixlet.mak diff --git a/tests/fate/namespace.mak b/tests/fate/namespace.mak new file mode 100644 index 0000000000..84a1fb17c6 --- /dev/null +++ b/tests/fate/namespace.mak @@ -0,0 +1,20 @@ + +define FATE_NAMESPACE +# (library_name, config_option) +FATE_NAMESPACE-$(call ALLYES, STATIC $(2)) += fate-namespace-$(1) +fate-namespace-$(1): lib$(1)/$(LIBPREF)$(1)$(LIBSUF) +fate-namespace-$(1): CMD = runlocal fate/namespace.sh "$(NM_CMD) lib$(1)/$(LIBPREF)$(1)$(LIBSUF)" +fate-namespace-$(1): CMP = null +endef + +$(eval $(call FATE_NAMESPACE,avutil, AVUTIL)) +$(eval $(call FATE_NAMESPACE,avcodec, AVCODEC)) +$(eval $(call FATE_NAMESPACE,avformat, AVFORMAT)) +$(eval $(call FATE_NAMESPACE,avfilter, AVFILTER)) +$(eval $(call FATE_NAMESPACE,avdevice, AVDEVICE)) +$(eval $(call FATE_NAMESPACE,swscale, SWSCALE)) +$(eval $(call FATE_NAMESPACE,swresample, SWRESAMPLE)) +$(eval $(call FATE_NAMESPACE,postproc, POSTPROC)) + +FATE += $(FATE_NAMESPACE-yes) +fate-namespace: $(FATE_NAMESPACE-yes) diff --git a/tests/fate/namespace.sh b/tests/fate/namespace.sh new file mode 100755 index 0000000000..5d43cc2916 --- /dev/null +++ b/tests/fate/namespace.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if $1 | + grep ' [TDB] ' | # Filter to all global text/data/bss symbols. + grep -v ' ff_' | # Internal-only globals. + grep -v ' av' | # libav* external API. + grep -v ' sws' | # libswscale external API. + grep -v ' swr' | # libswresample external API. + grep -v ' \(postproc\|pp\)_' | # libpostproc external API. + grep -v ' \(ffio\|ffurl\)_' | # Special-case internal ffio/ffurl APIs. + grep -v ' rgb2rgb_init_x86\| rgb\(12\|15\|16\|24\|32\|48\|64\)to' # Special-case RGB conversion functions in libswscale. +then + # Any output is an error. + exit 1 +else + exit 0 +fi