dlm: master - Fix linking order

David Teigland teigland at fedoraproject.org
Fri Nov 2 16:03:14 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=8b74fc075d10b3a6602c140b6a2bd62bbded9506
Commit:        8b74fc075d10b3a6602c140b6a2bd62bbded9506
Parent:        7b0b7b33b052fbd3a5b0cafd8dc134ce2ce713ec
Author:        Jacek Konieczny <jajcus at jajcus.net>
AuthorDate:    Fri Nov 2 16:39:48 2012 +0100
Committer:     David Teigland <teigland at redhat.com>
CommitterDate: Fri Nov 2 10:59:49 2012 -0500

Fix linking order

Objects should generally be listed before the libraries they require.
DLM building fails for me without these changes.

Signed-off-by: Jacek Konieczny <jajcus at jajcus.net>
---
 dlm_controld/Makefile |    4 ++--
 dlm_tool/Makefile     |    2 +-
 fence/Makefile        |    2 +-
 libdlm/Makefile       |    8 ++++----
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlm_controld/Makefile b/dlm_controld/Makefile
index d279b0d..f42a913 100644
--- a/dlm_controld/Makefile
+++ b/dlm_controld/Makefile
@@ -62,10 +62,10 @@ LIB_LDFLAGS += -Wl,-z,relro -pie
 all: $(LIB_TARGET) $(BIN_TARGET)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-	$(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@ -L.
+	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
 
 $(LIB_TARGET): $(LIB_SOURCE)
-	$(CC) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_SMAJOR) $^
+	$(CC) $^ $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared -fPIC -o $@ -Wl,-soname=$(LIB_SMAJOR)
 	ln -sf $(LIB_TARGET) $(LIB_SO)
 	ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
 
diff --git a/dlm_tool/Makefile b/dlm_tool/Makefile
index fe43677..c16d8f5 100644
--- a/dlm_tool/Makefile
+++ b/dlm_tool/Makefile
@@ -39,7 +39,7 @@ BIN_LDFLAGS += -lpthread -ldlm -ldlmcontrol
 all: $(BIN_TARGET)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-	$(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@
+	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@
 
 clean:
 	rm -f *.o *.so *.so.* $(BIN_TARGET)
diff --git a/fence/Makefile b/fence/Makefile
index 0f1a29c..b4c59dd 100644
--- a/fence/Makefile
+++ b/fence/Makefile
@@ -40,7 +40,7 @@ BIN_LDFLAGS += -ldl
 all: $(BIN_TARGET)
 
 $(BIN_TARGET): $(BIN_SOURCE)
-	$(CC) $(BIN_CFLAGS) $(BIN_LDFLAGS) $(BIN_SOURCE) -o $@ -L.
+	$(CC) $(BIN_SOURCE) $(BIN_CFLAGS) $(BIN_LDFLAGS) -o $@ -L.
 
 clean:
 	rm -f *.o *.so *.so.* $(BIN_TARGET)
diff --git a/libdlm/Makefile b/libdlm/Makefile
index 565a600..76d3504 100644
--- a/libdlm/Makefile
+++ b/libdlm/Makefile
@@ -86,18 +86,18 @@ LLT_LDFLAGS += $(LDFLAGS)
 all: $(LIB_TARGET) $(LLT_TARGET) $(LIB_PC) $(LLT_PC)
 
 $(LIB_O): $(SOURCE) 
-	$(CC) $(LIB_CFLAGS) -c -o $@ $<
+	$(CC) $< $(LIB_CFLAGS) -c -o $@
 
 $(LLT_O): $(SOURCE) 
-	$(CC) $(LLT_CFLAGS) -c -o $@ $<
+	$(CC) $< $(LLT_CFLAGS) -c -o $@
 
 $(LIB_TARGET): $(LIB_O)
-	$(CC) $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR) $^
+	$(CC) $^ $(LIB_LDFLAGS) -shared -o $@ -Wl,-soname=$(LIB_SMAJOR)
 	ln -sf $(LIB_TARGET) $(LIB_SO)
 	ln -sf $(LIB_TARGET) $(LIB_SMAJOR)
 
 $(LLT_TARGET): $(LLT_O)
-	$(CC) $(LLT_LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR) $^
+	$(CC) $^ $(LLT_LDFLAGS) -shared -o $@ -Wl,-soname=$(LLT_SMAJOR)
 	ln -sf $(LLT_TARGET) $(LLT_SO)
 	ln -sf $(LLT_TARGET) $(LLT_SMAJOR)
 


More information about the cluster-commits mailing list