Re: clang 6 fix security/steghide

2018-04-12 Thread Jeremie Courreges-Anglas
On Wed, Apr 11 2018, Matthew Martin  wrote:
> On Wed, Apr 11, 2018 at 01:48:29PM +0200, Jeremie Courreges-Anglas wrote:
>> On Wed, Apr 11 2018, Giovanni Bechis  wrote:
>> > On 04/11/18 05:16, Matthew Martin wrote:
>> >> On Tue, Apr 10, 2018 at 04:44:56PM +0200, Giovanni Bechis wrote:
>> >>> test.log run on 6.3 attached, does it differs from yours ?
>> >>>  Cheers
>> >>>   Giovanni
>> >> 
>> >> Not meaningfully. Thanks for the log.
>> >> 
>> >> - Matthew Martin
>> >> 
>> > Ok for me if it still works then.
>> > I cannot commit nor switch to clang6 before next week.
>> 
>> I would gladly commit it, but as-is the diff would break non-clang
>> platforms.  Maybe an ifdef check would be enough.
>
> How about this then? Just tell clang to compile as c++03.

Regarding the Makefile part:
- CXXFLAGS would be clobbered, which isn't good; we only want to
  add -std=... to CXXFLAGS
- the PROPERTIES test is wrong IMO, the check should be done against the
  compiler actually used.  But since there are lots of such checks
  already in the tree, let's at least be consistently wrong :)

Regarding the configure.in patch:
- the configure should *prepend* to CXXFLAGS, not append; the user's
  choices should be respected
- -O2 should not be hardcoded, let's just remove it.  Even if the ports
  tree didn't pass -O2, autotools would add it by default.

Updated patch below,


Index: Makefile
===
RCS file: /cvs/ports/security/steghide/Makefile,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile
--- Makefile21 Nov 2017 00:13:03 -  1.14
+++ Makefile12 Apr 2018 11:49:23 -
@@ -3,7 +3,7 @@
 COMMENT =  software able to hide data in various kind of files
 
 DISTNAME = steghide-0.5.1
-REVISION = 4
+REVISION = 5
 CATEGORIES =   security
 HOMEPAGE = http://steghide.sf.net/
 
@@ -20,9 +20,14 @@ LIB_DEPENDS =devel/gettext \
security/mhash \
graphics/jpeg
 WANTLIB =  c iconv intl jpeg m mhash mcrypt ${COMPILER_LIBCXX} z
-CONFIGURE_STYLE =  gnu
+CONFIGURE_STYLE =  autoconf
+AUTOCONF_VERSION = 2.57
 CONFIGURE_ENV =CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib -liconv -lintl"
 
+.include 
+.if ${PROPERTIES:Mclang}
+CXXFLAGS +=-std=c++03
+.endif
 
 .include 
Index: patches/patch-configure_in
===
RCS file: patches/patch-configure_in
diff -N patches/patch-configure_in
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-configure_in  12 Apr 2018 11:48:15 -
@@ -0,0 +1,31 @@
+$OpenBSD$
+
+Index: configure.in
+--- configure.in.orig
 configure.in
+@@ -15,6 +15,9 @@ AC_CHECK_FUNCS(strchr)
+ AM_GNU_GETTEXT
+ AM_CONDITIONAL(USE_INTLDIR, test "$nls_cv_use_gnu_gettext" = yes)
+ 
++dnl compiler warnings
++CXXFLAGS="-Wall $CXXFLAGS"
++
+ dnl check if debugging support is requested
+ AC_MSG_CHECKING([wether to enable debugging])
+ AC_ARG_ENABLE(debug,[  --enable-debug  enable debugging],
+@@ -22,14 +25,12 @@ AC_ARG_ENABLE(debug,[  --enable-debug  enable 
+   then
+   AC_MSG_RESULT([yes])
+   AC_DEFINE(DEBUG,1,[enable code used only for debugging])
+-  CXXFLAGS="-O2 -Wall -g"
++  CXXFLAGS="-g $CXXFLAGS"
+   else
+   AC_MSG_RESULT([no])
+-  CXXFLAGS="-O2 -Wall"
+   fi
+   ,
+   AC_MSG_RESULT([no])
+-  CXXFLAGS="-O2 -Wall"
+ )
+ 
+ dnl check if randomness should be disabled


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: clang 6 fix security/steghide

2018-04-11 Thread Matthew Martin
On Wed, Apr 11, 2018 at 01:48:29PM +0200, Jeremie Courreges-Anglas wrote:
> On Wed, Apr 11 2018, Giovanni Bechis  wrote:
> > On 04/11/18 05:16, Matthew Martin wrote:
> >> On Tue, Apr 10, 2018 at 04:44:56PM +0200, Giovanni Bechis wrote:
> >>> test.log run on 6.3 attached, does it differs from yours ?
> >>>  Cheers
> >>>   Giovanni
> >> 
> >> Not meaningfully. Thanks for the log.
> >> 
> >> - Matthew Martin
> >> 
> > Ok for me if it still works then.
> > I cannot commit nor switch to clang6 before next week.
> 
> I would gladly commit it, but as-is the diff would break non-clang
> platforms.  Maybe an ifdef check would be enough.

How about this then? Just tell clang to compile as c++03.

- Matthew Martin


diff --git Makefile Makefile
index 78a8c328b25..b1135d6771e 100644
--- Makefile
+++ Makefile
@@ -3,7 +3,7 @@
 COMMENT =  software able to hide data in various kind of files
 
 DISTNAME = steghide-0.5.1
-REVISION = 4
+REVISION = 5
 CATEGORIES =   security
 HOMEPAGE = http://steghide.sf.net/
 
@@ -20,9 +20,14 @@ LIB_DEPENDS =devel/gettext \
security/mhash \
graphics/jpeg
 WANTLIB =  c iconv intl jpeg m mhash mcrypt ${COMPILER_LIBCXX} z
-CONFIGURE_STYLE =  gnu
+CONFIGURE_STYLE =  autoconf
+AUTOCONF_VERSION = 2.57
 CONFIGURE_ENV =CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib -liconv -lintl"
 
+.include 
+.if ${PROPERTIES:Mclang}
+CONFIGURE_ENV += CXXFLAGS=-std=c++03
+.endif
 
 .include 
diff --git patches/patch-configure_in patches/patch-configure_in
new file mode 100644
index 000..b68f1db01ee
--- /dev/null
+++ patches/patch-configure_in
@@ -0,0 +1,23 @@
+$OpenBSD$
+
+Index: configure.in
+--- configure.in.orig
 configure.in
+@@ -22,14 +22,14 @@ AC_ARG_ENABLE(debug,[  --enable-debug  enable 
+   then
+   AC_MSG_RESULT([yes])
+   AC_DEFINE(DEBUG,1,[enable code used only for debugging])
+-  CXXFLAGS="-O2 -Wall -g"
++  CXXFLAGS="$CXXFLAGS -O2 -Wall -g"
+   else
+   AC_MSG_RESULT([no])
+-  CXXFLAGS="-O2 -Wall"
++  CXXFLAGS="$CXXFLAGS -O2 -Wall"
+   fi
+   ,
+   AC_MSG_RESULT([no])
+-  CXXFLAGS="-O2 -Wall"
++  CXXFLAGS="$CXXFLAGS -O2 -Wall"
+ )
+ 
+ dnl check if randomness should be disabled



Re: clang 6 fix security/steghide

2018-04-11 Thread Jeremie Courreges-Anglas
On Wed, Apr 11 2018, Giovanni Bechis  wrote:
> On 04/11/18 05:16, Matthew Martin wrote:
>> On Tue, Apr 10, 2018 at 04:44:56PM +0200, Giovanni Bechis wrote:
>>> test.log run on 6.3 attached, does it differs from yours ?
>>>  Cheers
>>>   Giovanni
>> 
>> Not meaningfully. Thanks for the log.
>> 
>> - Matthew Martin
>> 
> Ok for me if it still works then.
> I cannot commit nor switch to clang6 before next week.

I would gladly commit it, but as-is the diff would break non-clang
platforms.  Maybe an ifdef check would be enough.

===>  Building for steghide-0.5.1p5
make  all-recursive
Making all in m4
Making all in intl
Making all in po
rm -f es.gmo && /usr/local/bin/msgfmt -c --statistics -o es.gmo es.po
es.po:6: warning: header field 'Language' missing in header
185 translated messages.
rm -f de.gmo && /usr/local/bin/msgfmt -c --statistics -o de.gmo de.po
de.po:7: warning: header field 'Language' missing in header
185 translated messages.
rm -f fr.gmo && /usr/local/bin/msgfmt -c --statistics -o fr.gmo fr.po
fr.po:8: warning: header field 'Language' missing in header
185 translated messages.
rm -f ro.gmo && /usr/local/bin/msgfmt -c --statistics -o ro.gmo ro.po
ro.po:6: warning: header field 'Language' missing in header
185 translated messages.
Making all in doc
Making all in src
if g++ -DHAVE_CONFIG_H -I. -I. -I..   -DLOCALEDIR=\"/usr/local/share/locale\" 
-I/usr/local/include  -O2 -Wall -MT Arg.o -MD -MP -MF ".deps/Arg.Tpo"  -c -o 
Arg.o `test -f 'Arg.cc' || echo './'`Arg.cc;  then mv ".deps/Arg.Tpo" 
".deps/Arg.Po";  else rm -f ".deps/Arg.Tpo"; exit 1;  fi
if g++ -DHAVE_CONFIG_H -I. -I. -I..   -DLOCALEDIR=\"/usr/local/share/locale\" 
-I/usr/local/include  -O2 -Wall -MT Arguments.o -MD -MP -MF 
".deps/Arguments.Tpo"  -c -o Arguments.o `test -f 'Arguments.cc' || echo 
'./'`Arguments.cc;  then mv ".deps/Arguments.Tpo" ".deps/Arguments.Po";  else 
rm -f ".deps/Arguments.Tpo"; exit 1;  fi
In file included from common.h:101,
 from MCryptPP.h:21,
 from Arguments.cc:25:
Arguments.h:103: error: ISO C++ forbids declaration of 'constexpr' with no type
Arguments.h:103: error: expected ';' before 'float'
Arguments.cc: In member function 'void Arguments::setDefaults()':
Arguments.cc:809: error: 'Default_Goal' was not declared in this scope
*** Error 1 in src (Makefile:399 'Arguments.o')
*** Error 1 in . (Makefile:268 'all-recursive')
*** Error 1 in /usr/ports/pobj/steghide-0.5.1/steghide-0.5.1 (Makefile:190 
'all')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2740 
'/usr/ports/pobj/steghide-0.5.1/.build_done')
*** Error 1 in /usr/ports/security/steghide 
(/usr/ports/infrastructure/mk/bsd.port.mk:2417 'all')
russell /usr/ports/security/steghide$


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: clang 6 fix security/steghide

2018-04-11 Thread Giovanni Bechis
On 04/11/18 05:16, Matthew Martin wrote:
> On Tue, Apr 10, 2018 at 04:44:56PM +0200, Giovanni Bechis wrote:
>> test.log run on 6.3 attached, does it differs from yours ?
>>  Cheers
>>   Giovanni
> 
> Not meaningfully. Thanks for the log.
> 
> - Matthew Martin
> 
Ok for me if it still works then.
I cannot commit nor switch to clang6 before next week.
 Cheers
  Giovanni



Re: clang 6 fix security/steghide

2018-04-10 Thread Matthew Martin
On Tue, Apr 10, 2018 at 04:44:56PM +0200, Giovanni Bechis wrote:
> test.log run on 6.3 attached, does it differs from yours ?
>  Cheers
>   Giovanni

Not meaningfully. Thanks for the log.

- Matthew Martin



Re: clang 6 fix security/steghide

2018-04-10 Thread Giovanni Bechis
test.log run on 6.3 attached, does it differs from yours ?
 Cheers
  Giovanni

On 04/10/18 15:16, Matthew Martin wrote:
> Seems easier to make the C++11 fixes rather than patch the makefiles to
> compile for C++03. There's a test failure, but I don't know if it's new.
> 
> - Matthew Martin
> 
> 
> diff --git Makefile Makefile
> index 78a8c328b25..2cc5016be00 100644
> --- Makefile
> +++ Makefile
> @@ -3,7 +3,7 @@
>  COMMENT =software able to hide data in various kind of files
>  
>  DISTNAME =   steghide-0.5.1
> -REVISION =   4
> +REVISION =   5
>  CATEGORIES = security
>  HOMEPAGE =   http://steghide.sf.net/
>  
> diff --git patches/patch-src_Arguments_h patches/patch-src_Arguments_h
> new file mode 100644
> index 000..189f313f3c0
> --- /dev/null
> +++ patches/patch-src_Arguments_h
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: src/Arguments.h
> +--- src/Arguments.h.orig
>  src/Arguments.h
> +@@ -100,7 +100,7 @@ class Arguments {
> + static const VERBOSITY  Default_Verbosity = NORMAL ;
> + static const unsigned long  Default_Radius = 0 ; // there is no 
> default radius for all file formats
> + static const unsigned int   Max_Algorithm = 3 ;
> +-static const float  Default_Goal = 100.0 ;
> ++static constexpr float  Default_Goal = 100.0 ;
> + static const DEBUGCOMMAND   Default_DebugCommand = NONE ;
> + static const bool   Default_Check = false ;
> + static const unsigned int   Default_DebugLevel = 0 ;
> diff --git patches/patch-src_ProgressOutput_h 
> patches/patch-src_ProgressOutput_h
> new file mode 100644
> index 000..133e2b781ca
> --- /dev/null
> +++ patches/patch-src_ProgressOutput_h
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: src/ProgressOutput.h
> +--- src/ProgressOutput.h.orig
>  src/ProgressOutput.h
> +@@ -64,7 +64,7 @@ class ProgressOutput {
> +  **/
> + void done (float rate, float avgweight = NoAvgWeight) const ;
> + 
> +-static const float NoAvgWeight = -1.0 ;
> ++static constexpr float NoAvgWeight = -1.0 ;
> + 
> + protected:
> + std::string vcompose (const char *msgfmt, va_list ap) const ;
> 

Making check in m4
Making check in intl
Making check in po
Making check in doc
Making check in src
Making check in tests
Making check in data
make  unittests
if c++ -DHAVE_CONFIG_H -I. -I. -I..   -I../src -I/usr/local/include  -O2 -Wall -MT AuFileTest.o -MD -MP -MF ".deps/AuFileTest.Tpo"  -c -o AuFileTest.o `test -f 'AuFileTest.cc' || echo './'`AuFileTest.cc;  then mv ".deps/AuFileTest.Tpo" ".deps/AuFileTest.Po";  else rm -f ".deps/AuFileTest.Tpo"; exit 1;  fi
In file included from AuFileTest.cc:21:
In file included from ../src/AuSampleValues.h:24:
In file included from ../src/AudioSampleValue.h:24:
In file included from ../src/CvrStgFile.h:28:
In file included from ../src/BinaryIO.h:27:
In file included from ../src/common.h:101:
../src/Arguments.h:103:22: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init]
static const float  Default_Goal = 100.0 ;
^  ~
In file included from AuFileTest.cc:21:
In file included from ../src/AuSampleValues.h:24:
In file included from ../src/AudioSampleValue.h:25:
In file included from ../src/SampleValue.h:27:
In file included from ../src/wrapper_hash_set.h:32:
/usr/include/c++/v1/ext/hash_set:205:5: warning: Use of the header  is deprecated.  Migrate to  [-W#warnings]
#   warning Use of the header  is deprecated.  Migrate to 
^
AuFileTest.cc:29:2: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
ADDTESTCATEGORY (AuFileTest, testReadWrite) ;
^
./UnitTest.h:36:63: note: expanded from macro 'ADDTESTCATEGORY'
addTestCategory (new TestCategoryCaller (strip_test(#CMETHOD), getSuite(), this, &UTCLASS::CMETHOD))
 ^
:479:1: note: expanded from here
"testReadWrite"
^
AuFileTest.cc:30:2: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
ADDTESTCATEGORY (AuFileTest, testReadEmbedExtract) ;
^
./UnitTest.h:36:63: note: expanded from macro 'ADDTESTCATEGORY'
addTestCategory (new TestCategoryCaller (strip_test(#CMETHOD), getSuite(), this, &UTCLASS::CMETHOD))
 ^
:480:1: note: expanded from here
"testReadEmbedExtract"
^
AuFileTest.cc:31:2: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
ADDTESTCATEGORY (AuFileTest, testReadEmbedWriteReadExtract) ;
^
./UnitTest.h:36:63: note: expanded from macro 'ADDTESTCATEGORY'
addTestCategory (new TestCategoryCaller (strip_test(#CMETHOD), getSuit