From patchwork Fri Sep 9 23:18:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodger Combs X-Patchwork-Id: 501 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp553282vsd; Fri, 9 Sep 2016 16:19:06 -0700 (PDT) X-Received: by 10.28.144.5 with SMTP id s5mr491776wmd.39.1473463142478; Fri, 09 Sep 2016 16:19:02 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n132si4970195wmf.23.2016.09.09.16.18.59; Fri, 09 Sep 2016 16:19:02 -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=@gmail.com; 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=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 939DF689DD5; Sat, 10 Sep 2016 02:18:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7FE9A689D0D for ; Sat, 10 Sep 2016 02:18:41 +0300 (EEST) Received: by mail-oi0-f66.google.com with SMTP id s71so9482502oih.3 for ; Fri, 09 Sep 2016 16:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=jbqthBPG6m19GAUNZ/spu35pnVDoL6WSAK9fcNn5BCI=; b=dm0xlxYRLyqNvfYxq+8k2RcUbVAB1uuITwZ5E+zMTJm8pe3EotYegbUqkJgK1lBfzf Uoe9HyoTkdNAOflBlarLpOdTMjklgEEP4/vTdpUSX1ba4UwwX4he98nooIrXIhcWDVJS BZDu/8lQagAYYtNF1YW/q8fgdSCRl4Z3kizPZ3M6UgsnqD92f2zzEFHOHVcnNZ+4N89I 8bmkAm0fzvA5Zwz2KhEdfTUYVy8t9kzXwRY+TEO1BWiG6K/8KdYAKtHr6c+QWed93kUG G8cs66qBvlkXjBhXjySey4D/CB33+4TdfUmzU1MBcmHgFRrfHZxg/NPs5wWUUiHwDlUE 3X1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=jbqthBPG6m19GAUNZ/spu35pnVDoL6WSAK9fcNn5BCI=; b=eyIg80PdUCuZsCdgDzXF4PGuwjNst86RMYIcuxHZdKWQhYTgCLyV5i7DZr3kZ//HDu SBHClm0xgA4nlHB5MftWBxPvGVYhDjR4N/sNkD2EYE5ufGG8YrCYiiL3RvlNN6i7QwEW 00u2/PNrScElY83ibB3aNeWJ3bRBmsDaJiolMn3jXkUTw8Rz1TqJiYSoioktB1fFFbyH pxDdzNNK2Iz1u+O7+agTfhcD1DTS7HGlNofZhYtF7mMJ7xyOJIL5CjkjzadZwePtnLw5 oQFpDDl7MCy/FCKQFuMSpZsRsLEz5hvEAWAr7J8fDklUyIgOBzaDnqud4sr5ijyTqK/R gRKA== X-Gm-Message-State: AE9vXwMpyLEM3fvK0jXGDxM4axu4OgPtBFagN/gOYfIyixuNbIjytt0kphFxr07wPvDTog== X-Received: by 10.202.56.139 with SMTP id f133mr9770933oia.117.1473463131037; Fri, 09 Sep 2016 16:18:51 -0700 (PDT) Received: from Rodgers-MacBook-Pro.local.net (c-73-209-137-129.hsd1.il.comcast.net. [73.209.137.129]) by smtp.gmail.com with ESMTPSA id 74sm2833223itu.18.2016.09.09.16.18.50 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 09 Sep 2016 16:18:50 -0700 (PDT) From: Rodger Combs To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Sep 2016 18:18:47 -0500 Message-Id: <20160909231847.60881-1-rodger.combs@gmail.com> X-Mailer: git-send-email 2.10.0 Subject: [FFmpeg-devel] [PATCH] configure: add linker export script support on Darwin 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" This isn't a "version script" in the usual sense, since it doesn't set symbol versions directly. Instead, the version for the whole .dylib is set in the linker flags, and we generate a list of symbol patterns to export. This allows us to keep our local symbols (e.g. ff_*) local on the platform. The Darwin linker's exported_symbols_list format is a bit different than the one used by the GNU linker. It doesn't handle local symbols at all, since when a list is provided, all unlisted symbols are local by default; thus, we remove local sections. It doesn't handle per-version sections, so we remove the headers and brackets. It expects symbols to be prefixed with an underscore. It errors if a listed symbol with no wildcards is not present in the output, so we append an asterisk to any symbol that doesn't already end in one. --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index b11ca7f..29eb35b 100755 --- a/configure +++ b/configure @@ -4704,6 +4704,8 @@ case $target_os in { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; } check_header dispatch/dispatch.h && add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore' + version_script='-exported_symbols_list' + VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"' ;; msys*) die "Native MSYS builds are discouraged, please use the MINGW environment."