X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; q=dns; s=default; b=uvYmL2G SBeHxF+bUtDqE8tTpyCwlFj01SYkU6MCexLkfDpocbvqqOclKOW9j6nHvyP4kHTe sa44jwFBLtT8uBr584hlhCqUPvHBXaarBHomAZMQEXnvQQnxef/n3xnKGt1xAN4z 3K93ehaA7yeoe+FY8886PI/6LrMuDHgXi2QA= 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:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; s=default; bh=cX58UvHMnyS/N Lidr/UDv+dG46w=; b=qTCYfIADhitHE/5JlFn2ALfHHIlOe2u4Mt1UeOO1ZY6FQ i8KHSDLnImw1QcUfrMSSufFHO9jsZn1BROs+n4tDR5HlPmshqbScWcKGDlWPBkE6 zz88e3yhS4uem71ibvdTPIAP6j65n2oUC2qIezS2WsGkPzDZxIssmVevc9Z4fE= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=brian X-HELO: mail-it0-f49.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=X0dH3kBPydeDGNuVKR1hE/9itlp2DPdeAeUKaPCutKQ=; b=X3JVoGmcS+EFN8u++WHPc5IMgxc4j7xJPTr0PJU7jy0G/i8gZH+bKE3HkyG7zr288a FGkebzGOtatAguSLVzbIGllk6RF6t+kADkt7GsSQmWT4JyImwjUXBfhhNiSy0zeXw1Zr 5eYC9nqsPRvlQQ4mIAjk8939iaipv9tpHlvfwBSskvnxhMIc3IUuQVY258psTJapIAzA wqB6/3+8QYIY5DwEw/+touH7/Dv+VwghTyF8dMQUCr2+Qt++jMcg/cvpp/JmD16uE3os UOuWMGUiTRh8krkb3rQvL09cjWrdASo6v/Eh1om6M/2WWW14IT4nBLaC/5It7UEoXrX0 17Ow== X-Gm-Message-State: AElRT7GER/ruQva42xoygOCjpBUnSwOHaIr7qZpW+QgQpPyV22KuLcYy trGlTEfVPo5GQP6gI64GrHMNcS5j9GXSi3xtgYc= X-Google-Smtp-Source: AIpwx49d7X1I9goZOeJt74fQP/jWThbz8K9ATiG0ycToSwwbsJ7wR+39fRYimKgfNh5yxJj40qTN5VS5LVSetmQrAIQ= X-Received: by 2002:a24:5c04:: with SMTP id q4-v6mr554412itb.69.1522178130447; Tue, 27 Mar 2018 12:15:30 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <92610c1d-1d3b-eb62-ad8e-d2bc611e572c@SystematicSw.ab.ca> References: <92610c1d-1d3b-eb62-ad8e-d2bc611e572c AT SystematicSw DOT ab DOT ca> From: Lee Date: Tue, 27 Mar 2018 15:15:29 -0400 Message-ID: Subject: Re: gcc -fsanitize => cannot find -lubsan To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes On 3/27/18, Brian Inglis wrote: > On 2018-03-27 11:39, Lee wrote: >> How do you figure out which package is missing from your install? >> $cat sbstrict.c >> int main () { >> return 0; >> } >> $i686-w64-mingw32-gcc -fsanitize=bounds-strict sbstrict.c >> /usr/lib/gcc/i686-w64-mingw32/6.4.0/../../../../i686-w64-mingw32/bin/ld: >> cannot find -lubsan >> collect2: error: ld returned 1 exit status >> $gcc -fsanitize=bounds-strict sbstrict.c >> /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: >> cannot find -lubsan >> collect2: error: ld returned 1 exit status >> I looked at >> https://cygwin.com/cgi-bin2/package-grep.cgi?grep=ubsan&arch=x86_64 >> and both >> gcc-debuginfo-6.4.0-5 >> mingw64-i686-gcc-debuginfo-6.4.0-1 >> have a ubsan.c, but ld wouldn't be looking for that. Right?? > > Implies that gcc includes support, but not supported as of 2015: > > https://sourceware.org/ml/cygwin/2015-10/msg00528.html > > - don't know why - or if since added. I dunno what version of gcc cygwin had in 2015 but it looks like it wasn't v6. https://www.gnu.org/software/gcc/gcc-6/ GCC 6.1 April 27, 2016 (there is no gcc 6.0 listed in the release history) -fsanitize=bounds-strict was added in gcc v6, which is the current cygwin & mingw gcc https://www.gnu.org/software/gcc/gcc-6/changes.html UndefinedBehaviorSanitizer gained a new sanitization option, -fsanitize=bounds-strict, which enables strict checking of array bounds. In particular, it enables -fsanitize=bounds as well as instrumentation of flexible array member-like arrays. $gcc --version gcc (GCC) 6.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $i686-w64-mingw32-gcc --version i686-w64-mingw32-gcc (GCC) 6.4.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Thanks, Lee -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple