Description: Put $(LIBS) to end of linker command line
 cbmc (4.0-3) unstable; urgency=low
 .
   * Make sure $(LIBS) occurs at end of linker command line to fix Ubuntu build
     failures
 .
 The person named in the Author field signed this changelog entry.
Author: Michael Tautschnig <mt@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- cbmc-4.0.orig/src/config.inc
+++ cbmc-4.0/src/config.inc
@@ -15,7 +15,7 @@ EXEEXT =
 GCCFLAGS = -Wall -MMD -O2 -g
 #LINKFLAGS = -static
 LINKLIB = ld -r -o $@ $^
-LINKBIN = $(CXX) $(LINKFLAGS) -o $@ $(LIBS)
+LINKBIN = $(CXX) $(LINKFLAGS) -o $@
 
 # MacOS Fat Binaries
 # LIBEXT = .a
--- cbmc-4.0.orig/src/cbmc/Makefile
+++ cbmc-4.0/src/cbmc/Makefile
@@ -61,7 +61,7 @@ endif
 ###############################################################################
 
 cbmc$(EXEEXT): $(OBJ)
-	$(LINKBIN) $(OBJ)
+	$(LINKBIN) $(OBJ) $(LIBS)
 
 clean:
 	rm -f $(SRC:.cpp=$(OBJEXT)) cbmc$(EXEEXT)
--- cbmc-4.0.orig/src/goto-cc/Makefile
+++ cbmc-4.0/src/goto-cc/Makefile
@@ -38,7 +38,7 @@ endif
 ###############################################################################
 
 goto-cc$(EXEEXT): $(OBJ)
-	$(LINKBIN) $(OBJ)
+	$(LINKBIN) $(OBJ) $(LIBS)
 
 clean:
 	rm -f $(SRC:.cpp=$(OBJEXT)) $(SRC:.cpp=.d) goto-cc$(EXEEXT)
--- cbmc-4.0.orig/src/goto-instrument/Makefile
+++ cbmc-4.0/src/goto-instrument/Makefile
@@ -43,7 +43,7 @@ endif
 ###############################################################################
 
 goto-instrument$(EXEEXT): $(OBJ)
-	$(LINKBIN) $(OBJ)
+	$(LINKBIN) $(OBJ) $(LIBS)
 
 clean:
 	rm -f $(SRC:.cpp=$(OBJEXT)) goto-instrument$(EXEEXT)
