Skip to contentSkip to conversation

tools/xenmon/Makefile: Move LDFLAGS after $<

PATCH New Robert Buchholz 1 participant 1 message Aug 27, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xenmon/Makefile: Move LDFLAGS after $<

Hello,

gcc expects libraries needed for object files to be specified after the object. Linking usually does not fail, unless it is optimized (for instance, using -Wl,-as-needed). See the attached build log for details.

The offending Makefile is tools/xenmon/Makefile, and patches for 3.3 and 3.0/3.1/3.2 are attached.

The related Gentoo bug is 135145 [ https://bugs.gentoo.org/135145 ].

Regards,
Robert

tools/xenmon/Makefile +2 -2
diff -rpuN xen-3.0.4_1-src.orig/tools/xenmon/Makefile xen-3.0.4_1-src/tools/xenmon/Makefile
@@ -42,6 +42,6 @@ clean:
 
 
 %: %.c Makefile
-	$(CC) $(CFLAGS) $(LDFLAGS) -lxenctrl -o $@ $<
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lxenctrl
 xentrace_%: %.c Makefile
-	$(CC) $(CFLAGS) $(LDFLAGS) -lxenctrl -o $@ $<
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lxenctrl
tools/xenmon/Makefile +2 -2
Index: xen-3.3.0/tools/xenmon/Makefile
===================================================================
@@ -42,6 +42,6 @@ clean:
 
 
 %: %.c Makefile
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+	$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
 xentrace_%: %.c Makefile
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+	$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel