From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7A0813858429 for ; Sat, 4 Dec 2021 13:03:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A0813858429 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-329-Bt_3GgLTOoelDkV-H74MnA-1; Sat, 04 Dec 2021 08:03:45 -0500 X-MC-Unique: Bt_3GgLTOoelDkV-H74MnA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53BF6835BC3; Sat, 4 Dec 2021 13:03:43 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CF4960BE5; Sat, 4 Dec 2021 13:03:41 +0000 (UTC) From: Florian Weimer To: Evgeny Vereshchagin Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH] build: allow turning off --no-undefined and -z,defs References: <20211203053705.969283-1-evvers@ya.ru> Date: Sat, 04 Dec 2021 14:03:39 +0100 In-Reply-To: <20211203053705.969283-1-evvers@ya.ru> (Evgeny Vereshchagin's message of "Fri, 3 Dec 2021 05:37:05 +0000") Message-ID: <87czmcv7x0.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham 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 13:03:56 -0000 * Evgeny Vereshchagin: > 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. > > Without this patch something like > > sed -i 's/^\(ZDEFS_LDFLAGS=\).*/\1/' configure.ac > find -name Makefile.am | xargs sed -i 's/,--no-undefined//' > > should be used to make elfutils compile. > > The patch was tested in https://github.com/evverx/elfutils/pull/24 by > compiling elfutils with both gcc and clang with and without ASan/UBsan > and running `make check && make distcheck`. --no-undefined and -z,defs > are still passed by default as expected. Why isn't this a bug in the compiler driver? Nowadays, GCC passes -lasan if -fsanitize=address is used. I think that's quite reasonable. Thanks, Florian