From patchwork Thu Feb 7 16:56:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1038186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-99848-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="BoV4lBub"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43wPbj5mt4z9sLw for ; Fri, 8 Feb 2019 03:56:33 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=O/SP7dw4eYwPepritKnT+Oh7orYfl PkfK26v/LFL1FZM8tWWU7XjHOFRA9byzHYEJUMJ3RAHy9apMEqKdQCWwKt3LjA8Z JqWpm5G2h5SdNZkAR34sDnj465aTpErslccCSG3bYfqfeQju0XllXcU0lxLDzwT4 6uHB30ubLjOZes= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=y4gM/ofVEYPlWZMYjolS+itNkN0=; b=BoV 4lBubJas765IAOnBF0xKkR+d0Aamb4UAWoK4VdC2SIekSmHWVRFwOFMJA3ANrt1x qk+z4iKTg9GpjQwenyhiKUSqvi0zu/KhEeCJ6oM3ObsCbbutPFbv7sqiFt3XCizH JD2xV0bVu8Wti5achMsI67pxLOCcSDR4oUDmKXaw= Received: (qmail 19080 invoked by alias); 7 Feb 2019 16:56:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 19065 invoked by uid 89); 7 Feb 2019 16:56:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] rt: Turn forwards from librt to libc into compatibility symbols Date: Thu, 07 Feb 2019 17:56:23 +0100 Message-ID: <87r2cjv8p4.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Without this change, a typical configure check looking for a library that contains (say) clock_gettime will find and link against librt, even though nothing in the program might actually require librt after the move of clock_gettime from librt to libc. Tested on x86-64, with and without --disable-multi-arch. 2019-02-07 Florian Weimer * rt/clock-compat.c (COMPAT_REDIRECT): Turn librt forwarders into compatibility symbols. Reviewed-by: Carlos O'Donell diff --git a/rt/clock-compat.c b/rt/clock-compat.c index c603f40b69..d8ced3cdc1 100644 --- a/rt/clock-compat.c +++ b/rt/clock-compat.c @@ -30,14 +30,16 @@ #if HAVE_IFUNC # undef INIT_ARCH # define INIT_ARCH() -# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) +# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \ + compat_symbol (librt, name, name, GLIBC_2_2); #else # define COMPAT_REDIRECT(name, proto, arglist) \ int \ name proto \ { \ return __##name arglist; \ - } + } \ + compat_symbol (librt, name, name, GLIBC_2_2); #endif COMPAT_REDIRECT (clock_getres,