Blob Blame Raw
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 gcl (2.6.12-60) unstable; urgency=medium
 .
   * list_order.17
Author: Camm Maguire <camm@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: https://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: 2018-01-23

--- gcl-2.6.12.orig/cmpnew/gcl_cmpmain.lsp
+++ gcl-2.6.12/cmpnew/gcl_cmpmain.lsp
@@ -483,6 +483,12 @@ Cannot compile ~a.~%"
 
 (defvar *use-buggy* nil)
 
+(defun remove-flag (flag flags)
+  (let ((i (search flag flags)))
+    (if i
+	(concatenate 'string (subseq flags 0 i) (remove-flag flag (subseq flags (+ i (length flag)))))
+      flags)))
+
 (defun  compiler-command (&rest args &aux na )
   (declare (special *c-debug*))
   (let ((dirlist (pathname-directory (first args)))
@@ -493,7 +499,7 @@ Cannot compile ~a.~%"
     (setq na  (namestring
 	       (make-pathname :name name :type (pathname-type(first args)))))
    (format nil  "~a ~a -I~a ~a ~a -c ~a -o ~a ~a"
-	   *cc*
+	   (if *prof-p* (remove-flag "-fomit-frame-pointer" *cc*) *cc*)
 	   (if *prof-p* " -pg " "")
 	   (concatenate 'string si::*system-directory* "../h")
 	   (if (and (boundp '*c-debug*) *c-debug*) " -g " "")
--- gcl-2.6.12.orig/o/makefile
+++ gcl-2.6.12/o/makefile
@@ -34,7 +34,7 @@ boot.o: boot.c $(DECL) boot.h
 	$(CC) -c $(CFLAGS) $(DEFS) -fPIC $*.c $(AUX_INFO) 
 
 gprof.o: gprof.c $(DECL)
-	$(CC) -c $(CFLAGS) $(DEFS) -pg $*.c $(AUX_INFO)
+	$(CC) -c $(filter-out -fomit-frame-pointer,$(CFLAGS)) $(DEFS) -pg $*.c $(AUX_INFO)
 
 prelink.o: prelink.c $(DECL)
 	$(CC) -c $(filter-out -pg,$(CFLAGS)) -fPIE $(DEFS) $*.c $(AUX_INFO)