--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 94EB3431FBC\r
+ for <notmuch@notmuchmail.org>; Tue, 28 Oct 2014 14:32:36 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id NB2mmMHQy7Nb for <notmuch@notmuchmail.org>;\r
+ Tue, 28 Oct 2014 14:32:29 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 665F5431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 28 Oct 2014 14:32:29 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 933CB100051;\r
+ Tue, 28 Oct 2014 23:32:11 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] test: use LDFLAGS in test/Makefile.local\r
+In-Reply-To: <1413817401-6058-1-git-send-email-jani@nikula.org>\r
+References: <1413817401-6058-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.18.1+130~ga61922f (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Tue, 28 Oct 2014 23:32:11 +0200\r
+Message-ID: <m2ioj3dgo4.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 28 Oct 2014 21:32:36 -0000\r
+\r
+On Mon, Oct 20 2014, Jani Nikula wrote:\r
+\r
+> Apparently the test binaries are built with minimal LDFLAGS, only\r
+> adding dependency specific LDFLAGS as needed. However because some of\r
+> the test binaries incorporate notmuch object files, it is necessary to\r
+> use the same link flags as notmuch. For example user provided\r
+> CFLAGS/CXXFLAGS/LDFLAGS with -fsanitize=undefined fails to build the\r
+> test binaries if the flags differ.\r
+>\r
+> ---\r
+>\r
+> With this I could do\r
+>\r
+> CFLAGS="-fsanitize=undefined -g" CXXFLAGS="-fsanitize=undefined -g" LDFLAGS="-fsanitize=undefined -g" ./configure\r
+>\r
+> to try ubsan with gcc 4.9. No problems found while running make test\r
+> (and it did find an UB I planted to ensure I had it all set up right).\r
+> ---\r
+> test/Makefile.local | 14 +++++++-------\r
+> 1 file changed, 7 insertions(+), 7 deletions(-)\r
+>\r
+> diff --git a/test/Makefile.local b/test/Makefile.local\r
+> index a2d58fc1a1b0..2331ceb15e33 100644\r
+> --- a/test/Makefile.local\r
+> +++ b/test/Makefile.local\r
+> @@ -13,10 +13,10 @@ smtp_dummy_srcs = \\r
+> smtp_dummy_modules = $(smtp_dummy_srcs:.c=.o)\r
+> \r
+> $(dir)/arg-test: $(dir)/arg-test.o command-line-arguments.o util/libutil.a\r
+> - $(call quiet,CC) $^ -o $@\r
+> + $(call quiet,CC) $^ -o $@ $(LDFLAGS)\r
+> \r
+> $(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o util/libutil.a\r
+> - $(call quiet,CC) $^ $(TALLOC_LDFLAGS) -o $@\r
+> + $(call quiet,CC) $^ -o $@ $(LDFLAGS) $(TALLOC_LDFLAGS)\r
+\r
+LGTM; especially the above change which moves all *LDFLAGS after -o $@...\r
+\r
+Tomi\r
+\r
+> \r
+> random_corpus_deps = $(dir)/random-corpus.o $(dir)/database-test.o \\r
+> notmuch-config.o command-line-arguments.o \\r
+> @@ -24,19 +24,19 @@ random_corpus_deps = $(dir)/random-corpus.o $(dir)/database-test.o \\r
+> parse-time-string/libparse-time-string.a\r
+> \r
+> $(dir)/random-corpus: $(random_corpus_deps)\r
+> - $(call quiet,CXX) $(CFLAGS_FINAL) $^ -o $@ $(CONFIGURE_LDFLAGS)\r
+> + $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(CONFIGURE_LDFLAGS)\r
+> \r
+> $(dir)/smtp-dummy: $(smtp_dummy_modules)\r
+> - $(call quiet,CC) $^ -o $@\r
+> + $(call quiet,CC) $^ -o $@ $(LDFLAGS)\r
+> \r
+> $(dir)/symbol-test: $(dir)/symbol-test.o lib/$(LINKER_NAME)\r
+> - $(call quiet,CXX) $^ -o $@ -Llib -lnotmuch $(XAPIAN_LDFLAGS)\r
+> + $(call quiet,CXX) $^ -o $@ $(LDFLAGS) -Llib -lnotmuch $(XAPIAN_LDFLAGS)\r
+> \r
+> $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o\r
+> - $(call quiet,CC) $^ -o $@\r
+> + $(call quiet,CC) $^ -o $@ $(LDFLAGS)\r
+> \r
+> $(dir)/make-db-version: $(dir)/make-db-version.o\r
+> - $(call quiet,CXX) $^ -o $@ $(XAPIAN_LDFLAGS)\r
+> + $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)\r
+> \r
+> .PHONY: test check\r
+> \r
+> -- \r
+> 2.1.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r