From patchwork Sun Jun 5 16:41:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Peterson X-Patchwork-Id: 849952 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p55GjAJN031963 for ; Sun, 5 Jun 2011 16:45:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414Ab1FEQm3 (ORCPT ); Sun, 5 Jun 2011 12:42:29 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:42968 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752533Ab1FEQm2 (ORCPT ); Sun, 5 Jun 2011 12:42:28 -0400 Received: by wwa36 with SMTP id 36so3087881wwa.1 for ; Sun, 05 Jun 2011 09:42:27 -0700 (PDT) Received: by 10.216.230.105 with SMTP id i83mr1512078weq.43.1307292147460; Sun, 05 Jun 2011 09:42:27 -0700 (PDT) Received: from mail-ww0-f44.google.com (mail-ww0-f44.google.com [74.125.82.44]) by mx.google.com with ESMTPS id o75sm1856654weq.16.2011.06.05.09.42.25 (version=SSLv3 cipher=OTHER); Sun, 05 Jun 2011 09:42:26 -0700 (PDT) Received: by wwa36 with SMTP id 36so3087858wwa.1 for ; Sun, 05 Jun 2011 09:42:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.39.82 with SMTP id c60mr1680189web.30.1307292075158; Sun, 05 Jun 2011 09:41:15 -0700 (PDT) Received: by 10.216.35.146 with HTTP; Sun, 5 Jun 2011 09:41:15 -0700 (PDT) X-Originating-IP: [67.40.138.82] Date: Sun, 5 Jun 2011 10:41:15 -0600 Message-ID: Subject: Fix to btrfs-progs to avoid "underlinking" From: Joe Peterson To: linux-btrfs@vger.kernel.org Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 05 Jun 2011 16:45:11 +0000 (UTC) Attached is a simple patch to the makefile line that builds "convert". It explicitly includes libcom_err, which is implicitly pulled in by libext2fs. This fixes a what is called "underlinking" in this blog post: http://blog.flameeyes.eu/2010/11/26/it-s-not-all-gold-that-shines-why-underlinking-is-a-bad-thing Apparently, this condition causes links to fail using the "gold link editor", and it can cause future library version incompatibilities to not be detected (so that affected programs can be rebuilt). -Joe [Note: please CC my email address in any responses] --- btrfs-progs-0.19/Makefile~ 2011-06-05 10:21:04.000000000 -0600 +++ btrfs-progs-0.19/Makefile 2011-06-05 10:21:46.000000000 -0600 @@ -75,7 +75,7 @@ quick-test: $(objects) quick-test.o gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS) convert: $(objects) convert.o - gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS) + gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs -lcom_err $(LDFLAGS) $(LIBS) ioctl-test: $(objects) ioctl-test.o gcc $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS)