EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Problems building EPICS base3.14.12.4 for i386 and armhf
From: Andrew Johnson <[email protected]>
To: <[email protected]>
Date: Wed, 7 Jan 2015 10:35:00 -0600
Hi Florian,

On 01/07/2015 03:30 AM, Florian Feldbauer wrote:
> I oriented myself by the Debian packages from Michael Davidsaver and
> added these compiler flags in my debian rules file for the build process:
> DEB_USR_CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
> DEB_USR_CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
> DEB_USR_CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
> DEB_USR_LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
> 
> The packages should be build for the architectures amd64, i386 and armhf.
> For amd64 everything works smoothly. But for the other two I got lots of
> warnings when compiling Cap5.c from base3.14.12.4 (see log below)
> Additionally the above compiler flags include "-Werror=format-security"
> which causes the compilation of Cap5.c to fail with an error.
> 
> Is there a way to fix this problem without removing the compiler flags?

The src/cap5 directory builds the CA bindings for Perl, which needs a
more complicated build as it has to use compiler flags from the Perl
installation as well as from Base itself. If you don't need the Perl CA
bindings you can just comment out the line
    DIRS += cap5
from the base/src/Makefile and not worry about these errors at all.

Jani's suggestion is the correct fix and has already been implemented in
the Base repository so will appear in future releases; I've attached a
patch which makes the necessary changes, taken from there, which I will
also add to the Known Problems page.

HTH,

- Andrew
-- 
People everywhere confuse what they read in newspapers with news.
-- A. J. Liebling
=== modified file 'src/cap5/Cap5.xs'
--- src/cap5/Cap5.xs	2014-10-17 20:19:00 +0000
+++ src/cap5/Cap5.xs	2014-12-02 17:03:16 +0000
@@ -462,7 +462,7 @@
         SvREFCNT_dec(ca_ref);
         if (pch->conn_sub)
             SvREFCNT_dec(pch->conn_sub);
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
 
     return ca_ref;
@@ -491,7 +491,7 @@
     Safefree(pch);
 
     if (status != ECA_NORMAL)
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
 }
 
 
@@ -516,7 +516,7 @@
     status = ca_change_connection_event(pch->chan, handler);
 
     if (status != ECA_NORMAL) {
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
 }
 
@@ -600,7 +600,7 @@
         Safefree(p.dbr);
     }
     if (status != ECA_NORMAL) {
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
     XSRETURN(0);
 }
@@ -695,7 +695,7 @@
     }
     if (status != ECA_NORMAL) {
         SvREFCNT_dec(put_sub);
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
     XSRETURN(0);
 }
@@ -736,7 +736,7 @@
         status = ca_put(DBR_PUT_ACKS, pch->chan, &acks);
 
     if (status != ECA_NORMAL)
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
 
     XSRETURN(0);
 }
@@ -760,7 +760,7 @@
         status = ca_put(DBR_PUT_ACKS, pch->chan, &ackt);
 
     if (status != ECA_NORMAL)
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
 
     XSRETURN(0);
 }
@@ -788,7 +788,7 @@
         status = ca_get(best_type(pch), pch->chan, &pch->data);
     }
     if (status != ECA_NORMAL) {
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
 }
 
@@ -869,7 +869,7 @@
 
 exit_croak:
     SvREFCNT_dec(get_sub);
-    croak(croak_msg);
+    croak("%s", croak_msg);
 }
 
 
@@ -953,7 +953,7 @@
 exit_croak:
     SvREFCNT_dec(mon_ref);
     SvREFCNT_dec(mon_sub);
-    croak(croak_msg);
+    croak("%s", croak_msg);
 }
 
 
@@ -970,7 +970,7 @@
     status = ca_clear_subscription(event);
 
     if (status != ECA_NORMAL) {
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
 }
 
@@ -980,7 +980,7 @@
 void CA_pend_io(const char *class, double timeout) {
     int status = ca_pend_io(timeout);
     if (status != ECA_NORMAL) {
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
 }
 
@@ -995,7 +995,7 @@
 void CA_pend_event(const char *class, double timeout) {
     int status = ca_pend_event(timeout);
     if (status != ECA_TIMEOUT) {
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
 }
 
@@ -1089,7 +1089,7 @@
     if (status != ECA_NORMAL) {
         SvREFCNT_dec(exception_sub);
         exception_sub = NULL;
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
 }
 
@@ -1147,7 +1147,7 @@
     if (status != ECA_NORMAL) {
         SvREFCNT_dec(printf_sub);
         printf_sub = NULL;
-        croak(get_error_msg(status));
+        croak("%s", get_error_msg(status));
     }
 }
 

=== modified file 'src/cap5/Makefile'
--- src/cap5/Makefile	2014-12-01 18:12:09 +0000
+++ src/cap5/Makefile	2014-12-02 17:03:16 +0000
@@ -53,7 +53,8 @@
 
 ifdef T_A
   EXTUTILS = $(shell $(PERL) ../perlConfig.pl privlib)/ExtUtils
-  XSUBPP = $(firstword $(wildcard /usr/bin/xsubpp $(EXTUTILS)/xsubpp))
+  PERLBIN = $(shell $(PERL) ../perlConfig.pl bin)
+  XSUBPP = $(firstword $(wildcard $(PERLBIN)/xsubpp $(EXTUTILS)/xsubpp))
 
   %.c: ../%.xs
 	$(RM) $@ $@_new


References:
Problems building EPICS base3.14.12.4 for i386 and armhf Florian Feldbauer

Navigate by Date:
Prev: Re: Problems building EPICS base3.14.12.4 for i386 and armhf Jani Hakala
Next: Re: Can't start CSS RDB archiver Lang, Keenan C.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Problems building EPICS base3.14.12.4 for i386 and armhf Jani Hakala
Next: Can't start CSS RDB archiver Zunbeltz Izaola
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·