From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79298 invoked by alias); 11 Jan 2016 18:37:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 79287 invoked by uid 89); 11 Jan 2016 18:37:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Hx-languages-length:1331 X-HELO: smtp.fgznet.ch Received: from smtp.fgznet.ch (HELO smtp.fgznet.ch) (157.161.14.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 11 Jan 2016 18:37:35 +0000 Received: from [192.168.225.14] (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPS id 312E4C35C8; Mon, 11 Jan 2016 19:37:31 +0100 (CET) Subject: Re: [patch] libsanitizer To: Bernd Schmidt , GCC Patches References: <5642691B.1040803@fgznet.ch> <5693F45B.7090009@redhat.com> From: Andreas Tobler Message-ID: <5693F66A.5040806@fgznet.ch> Date: Mon, 11 Jan 2016 18:37:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <5693F45B.7090009@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00640.txt.bz2 Hi Bernd, On 11.01.16 19:28, Bernd Schmidt wrote: > On 11/10/2015 11:00 PM, Andreas Tobler wrote: >> the attached patch removes the hard-coded requirement for the link >> operation with -ldl. On FreeBSD we do not need that, it breaks compilation. >> >> >> # Common libraries that we need to link against for all sanitizer libs. >> -link_sanitizer_common='-lpthread -ldl -lm' >> +link_sanitizer_common='-lpthread -lm' >> >> # At least for glibc, shm_open is in librt. But don't pull that >> # in if it still doesn't give us the function we want. This >> @@ -130,6 +130,12 @@ >> # Other sanitizers do not override clock_* API >> ]) >> >> +# Do a configure time check for -ldl >> +AC_CHECK_LIB(dl, dlsym, >> + [link_libasan="-ldl $link_libasan" >> +link_libtsan="-ldl $link_libtsan" >> +]) >> + > > Why not add this to link_sanitizer_common, just after the similar check > for shm_open? I'm not entirely sure how libsanitizer is structured, but > I see references to dlsym inside the sanitizer_common directory. Hm, looks simpler, yes. @@ -104,6 +104,10 @@ AC_CHECK_LIB(rt, shm_open, [link_sanitizer_common="-lrt $link_sanitizer_common"]) +# Do a configure time check for -ldl +AC_CHECK_LIB(dl, dlsym, + [link_sanitizer_common="-lrt $link_sanitizer_common"]) + I'll give it a test run. Thanks, Andreas