Description: Workaround for #764573
 cbmc (4.9-4) unstable; urgency=low
 .
   * Work around binutils regression using ar rcf instead of ld -r. Thanks
     Matthias Klose for the suggestion. (Closes: #763228)
Author: Michael Tautschnig <mt@debian.org>
Bug-Debian: http://bugs.debian.org/763228

---
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.9.orig/src/common
+++ cbmc-4.9/src/common
@@ -45,7 +45,7 @@ ifeq ($(BUILD_ENV_),OSX_Universal)
   LINKFLAGS += -force_cpusubtype_ALL -arch i386 -arch x86_64
   LINKLIB = /usr/bin/libtool -static -o $@ $^
 else
-  LINKLIB = ld -r -o $@ $^
+  LINKLIB = ar rcf $@ $^
 endif
   LINKBIN = $(CXX) $(LINKFLAGS) -o $@ $^ $(LIBS)
   LINKNATIVE = $(HOSTCXX) -o $@ $^
--- cbmc-4.9.orig/src/goto-cc/Makefile
+++ cbmc-4.9/src/goto-cc/Makefile
@@ -5,15 +5,6 @@ SRC = goto_cc_main.cpp goto_cc_mode.cpp
       goto_cc_languages.cpp goto_cc_cmdline.cpp \
       ms_cl_mode.cpp armcc_mode.cpp cw_mode.cpp ld_mode.cpp
 
-OBJ += ../big-int/big-int$(LIBEXT) \
-      ../goto-programs/goto-programs$(LIBEXT) \
-      ../util/util$(LIBEXT) \
-      ../linking/linking$(LIBEXT) \
-      ../ansi-c/ansi-c$(LIBEXT) \
-      ../xmllang/xmllang$(LIBEXT) \
-      ../assembler/assembler$(LIBEXT) \
-      ../langapi/langapi$(LIBEXT)
-
 INCLUDES= -I ..
 
 LIBS =
@@ -30,6 +21,15 @@ ifneq ($(wildcard ../cpp/Makefile),)
   CP_CXXFLAGS += -D HAVE_CPP
 endif
 
+OBJ += ../goto-programs/goto-programs$(LIBEXT) \
+      ../ansi-c/ansi-c$(LIBEXT) \
+      ../linking/linking$(LIBEXT) \
+      ../xmllang/xmllang$(LIBEXT) \
+      ../assembler/assembler$(LIBEXT) \
+      ../langapi/langapi$(LIBEXT) \
+      ../util/util$(LIBEXT) \
+      ../big-int/big-int$(LIBEXT)
+
 ###############################################################################
 
 goto-cc$(EXEEXT): $(OBJ)
--- cbmc-4.9.orig/src/cbmc/Makefile
+++ cbmc-4.9/src/cbmc/Makefile
@@ -3,24 +3,6 @@ SRC = cbmc_main.cpp cbmc_parseoptions.cp
       bv_cbmc.cpp symex_bmc.cpp show_vcc.cpp cbmc_solvers.cpp \
       xml_interface.cpp cover.cpp all_claims.cpp      
 
-OBJ += ../ansi-c/ansi-c$(LIBEXT) \
-      ../linking/linking$(LIBEXT) \
-      ../big-int/big-int$(LIBEXT) \
-      ../goto-programs/goto-programs$(LIBEXT) \
-      ../goto-symex/goto-symex$(LIBEXT) \
-      ../pointer-analysis/value_set$(OBJEXT) \
-      ../pointer-analysis/value_set_dereference$(OBJEXT) \
-      ../pointer-analysis/dereference_callback$(OBJEXT) \
-      ../pointer-analysis/add_failed_symbols$(OBJEXT) \
-      ../pointer-analysis/rewrite_index$(OBJEXT) \
-      ../pointer-analysis/goto_program_dereference$(OBJEXT) \
-      ../analyses/analyses$(LIBEXT) \
-      ../langapi/langapi$(LIBEXT) \
-      ../xmllang/xmllang$(LIBEXT) \
-      ../assembler/assembler$(LIBEXT) \
-      ../solvers/solvers$(LIBEXT) \
-      ../util/util$(LIBEXT)
-
 INCLUDES= -I ..
 
 LIBS = -lminisat
@@ -57,6 +39,24 @@ ifneq ($(wildcard ../php/Makefile),)
   CP_CXXFLAGS += -DHAVE_PHP
 endif
 
+OBJ += ../goto-symex/goto-symex$(LIBEXT) \
+      ../goto-programs/goto-programs$(LIBEXT) \
+      ../ansi-c/ansi-c$(LIBEXT) \
+      ../linking/linking$(LIBEXT) \
+      ../pointer-analysis/value_set$(OBJEXT) \
+      ../pointer-analysis/value_set_dereference$(OBJEXT) \
+      ../pointer-analysis/dereference_callback$(OBJEXT) \
+      ../pointer-analysis/add_failed_symbols$(OBJEXT) \
+      ../pointer-analysis/rewrite_index$(OBJEXT) \
+      ../pointer-analysis/goto_program_dereference$(OBJEXT) \
+      ../analyses/analyses$(LIBEXT) \
+      ../langapi/langapi$(LIBEXT) \
+      ../xmllang/xmllang$(LIBEXT) \
+      ../assembler/assembler$(LIBEXT) \
+      ../solvers/solvers$(LIBEXT) \
+      ../util/util$(LIBEXT) \
+      ../big-int/big-int$(LIBEXT)
+
 ###############################################################################
 
 cbmc$(EXEEXT): $(OBJ)
--- cbmc-4.9.orig/src/goto-instrument/Makefile
+++ cbmc-4.9/src/goto-instrument/Makefile
@@ -21,18 +21,6 @@ SRC = goto_instrument_main.cpp goto_inst
       accelerate/path.cpp accelerate/acceleration_utils.cpp \
       count_eloc.cpp reachability_slicer.cpp
 
-OBJ += ../ansi-c/ansi-c$(LIBEXT) \
-      ../linking/linking$(LIBEXT) \
-      ../big-int/big-int$(LIBEXT) \
-      ../goto-programs/goto-programs$(LIBEXT) \
-      ../goto-symex/goto-symex$(LIBEXT) \
-      ../assembler/assembler$(LIBEXT) \
-      ../pointer-analysis/pointer-analysis$(LIBEXT) \
-      ../analyses/analyses$(LIBEXT) \
-      ../langapi/langapi$(LIBEXT) \
-      ../util/util$(LIBEXT) \
-      ../solvers/solvers$(LIBEXT)
-
 INCLUDES= -I ..
 
 LIBS = -lminisat
@@ -64,6 +52,18 @@ ifneq ($(wildcard ../php/Makefile),)
   CP_CXXFLAGS += -DHAVE_PHP
 endif
 
+OBJ += ../goto-programs/goto-programs$(LIBEXT) \
+      ../goto-symex/goto-symex$(LIBEXT) \
+      ../ansi-c/ansi-c$(LIBEXT) \
+      ../assembler/assembler$(LIBEXT) \
+      ../pointer-analysis/pointer-analysis$(LIBEXT) \
+      ../analyses/analyses$(LIBEXT) \
+      ../langapi/langapi$(LIBEXT) \
+      ../solvers/solvers$(LIBEXT) \
+      ../linking/linking$(LIBEXT) \
+      ../util/util$(LIBEXT) \
+      ../big-int/big-int$(LIBEXT)
+
 ###############################################################################
 
 goto-instrument$(EXEEXT): $(OBJ)
