diff mbox

Fix to btrfs-progs to avoid "underlinking"

Message ID BANLkTikPLUU=3bG0-S9X9a5oDQsKCD9E5Q@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joe Peterson June 5, 2011, 4:41 p.m. 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]
diff mbox

Patch

--- 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)