From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id A50AF3858C2C for ; Sat, 4 Dec 2021 20:26:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A50AF3858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x0b.wildebeest.org [172.31.17.141]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 092F13000F0A; Sat, 4 Dec 2021 21:26:40 +0100 (CET) Received: by reform (Postfix, from userid 1000) id B26412E805DB; Sat, 4 Dec 2021 21:26:39 +0100 (CET) Date: Sat, 4 Dec 2021 21:26:39 +0100 From: Mark Wielaard To: Evgeny Vereshchagin Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH v2] build: allow turning off --no-undefined and -z,defs Message-ID: References: <87czmcv7x0.fsf@oldenburg.str.redhat.com> <20211203141721.987169-1-evvers@ya.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211203141721.987169-1-evvers@ya.ru> X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2021 20:26:47 -0000 Hi Evgeny, On Fri, Dec 03, 2021 at 02:17:21PM +0000, Evgeny Vereshchagin wrote: > ASan, UBSan and MSan provided by clang aren't compatible with --no-undefined and -z,defs: > https://clang.llvm.org/docs/AddressSanitizer.html#usage > https://github.com/google/sanitizers/issues/380 > so to build elfutils with clang with the sanitizers it should be possible > to turn them off. I have to agree with Florian, this really is a bug in the compiler you are using. Adding -fsanitize=address to CFLAGS/CXXFLAGS works just fine with gcc. I have been using it in the past in combination with the afl fuzzer (32bit only). It doesn't work together with --enable-valgrind though. That said, I really would like to add address sanitizer support. It would be great to add this to our buildbot CI to catch more issues early. We already support --enable-sanitize-undefined and --enable-valgrind. But sadly we have to disable valgrind in a couple of testcases, specifically when testing the debuginfod server. I just testing with gcc (Debian 10.2.1-6) 10.2.1 20210110 on arm64 and it actually found some issues. I'll post patches for those. There is one issue with the test-nlist test because we use special CFLAGS for that. But if we introduce an --enable-sanitize-address we could work around that. If clang really cannot be fixed then your patch in combination with an --enable-sanitize-address might be a good idea. But I don't think it makes sense as a standalone option. In the past we made the mistake of adding configure options to disable some necessary flags, like --disable-symbol-versioning, which was a mistake. There are now distros shipping elfutils libraries with broken abis while using the same SONAMEs. Cheers, Mark