Re: Modernize regress/libexec/ld.so/constructor

2016-09-27 Thread Alexander Bluhm
On Tue, Sep 27, 2016 at 07:44:03PM +0200, Mark Kettenis wrote:
> > Date: Tue, 27 Sep 2016 18:01:51 +0200
> > From: Alexander Bluhm 
> > 
> > On Mon, Sep 26, 2016 at 11:39:29PM +0200, Mark Kettenis wrote:
> > > Since the tests succeed on amd64, and should succeed on other
> > > architectures, the diff re-enables this test.
> > 
> > When running with "make regress" the test fails as the regress
> > target does not build the libraries.
> > 
> > Usually I add an addidtional rule in such a case.
> > 
> > ok?
> 
> Other regress tests that build library solve this by having a
> 
> regress: all
> 
> target in the library Makefile.  See lib/libc/cxa-exit for example.
> 
> Here is a diff that does that.  As a bonus it sets NOPROFILE=yes to
> avoid building a profiled library and also adds $OpenBSD$ markers.
> 
> ok?

works for me; OK bluhm@

> 
> 
> Index: regress/libexec/ld.so/constructor/libaa/Makefile
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/libaa/Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile
> --- regress/libexec/ld.so/constructor/libaa/Makefile  1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/libaa/Makefile  27 Sep 2016 17:39:56 
> -
> @@ -1,3 +1,9 @@
> +# $OpenBSD$
> +
>  LIB=aa
>  SRCS= aa.C
> +NOPROFILE=yes
> +
> +regress: all
> +
>  .include 
> Index: regress/libexec/ld.so/constructor/libab/Makefile
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/Makefile,v
> retrieving revision 1.2
> diff -u -p -r1.2 Makefile
> --- regress/libexec/ld.so/constructor/libab/Makefile  27 Sep 2016 06:52:50 
> -  1.2
> +++ regress/libexec/ld.so/constructor/libab/Makefile  27 Sep 2016 17:40:25 
> -
> @@ -1,6 +1,12 @@
> +# $OpenBSD$
> +
>  LIB=ab
>  SRCS= ab.C
> +NOPROFILE=yes
>  CPPFLAGS=-I${.CURDIR}/../libaa
>  LDADD=-L../libaa
>  LDADD+=-laa
> +
> +regress: all
> +
>  .include 



Re: Modernize regress/libexec/ld.so/constructor

2016-09-27 Thread Mark Kettenis
> Date: Tue, 27 Sep 2016 18:01:51 +0200
> From: Alexander Bluhm 
> 
> On Mon, Sep 26, 2016 at 11:39:29PM +0200, Mark Kettenis wrote:
> > Since the tests succeed on amd64, and should succeed on other
> > architectures, the diff re-enables this test.
> 
> When running with "make regress" the test fails as the regress
> target does not build the libraries.
> 
> Usually I add an addidtional rule in such a case.
> 
> ok?

Other regress tests that build library solve this by having a

regress: all

target in the library Makefile.  See lib/libc/cxa-exit for example.

Here is a diff that does that.  As a bonus it sets NOPROFILE=yes to
avoid building a profiled library and also adds $OpenBSD$ markers.

ok?


Index: regress/libexec/ld.so/constructor/libaa/Makefile
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/libaa/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- regress/libexec/ld.so/constructor/libaa/Makefile1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/libaa/Makefile27 Sep 2016 17:39:56 
-
@@ -1,3 +1,9 @@
+# $OpenBSD$
+
 LIB=aa
 SRCS= aa.C
+NOPROFILE=yes
+
+regress: all
+
 .include 
Index: regress/libexec/ld.so/constructor/libab/Makefile
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- regress/libexec/ld.so/constructor/libab/Makefile27 Sep 2016 06:52:50 
-  1.2
+++ regress/libexec/ld.so/constructor/libab/Makefile27 Sep 2016 17:40:25 
-
@@ -1,6 +1,12 @@
+# $OpenBSD$
+
 LIB=ab
 SRCS= ab.C
+NOPROFILE=yes
 CPPFLAGS=-I${.CURDIR}/../libaa
 LDADD=-L../libaa
 LDADD+=-laa
+
+regress: all
+
 .include 



Re: Modernize regress/libexec/ld.so/constructor

2016-09-27 Thread Alexander Bluhm
On Mon, Sep 26, 2016 at 11:39:29PM +0200, Mark Kettenis wrote:
> Since the tests succeed on amd64, and should succeed on other
> architectures, the diff re-enables this test.

When running with "make regress" the test fails as the regress
target does not build the libraries.

Usually I add an addidtional rule in such a case.

ok?

bluhm

Index: regress/libexec/ld.so/constructor/Makefile
===
RCS file: /mount/openbsd/cvs/src/regress/libexec/ld.so/constructor/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- regress/libexec/ld.so/constructor/Makefile  1 Feb 2003 19:56:17 -   
1.1
+++ regress/libexec/ld.so/constructor/Makefile  27 Sep 2016 15:41:24 -
@@ -1,3 +1,8 @@
 SUBDIR=libaa libab prog1 prog2
 
+regress: lib _SUBDIRUSE
+
+lib:
+   ${MAKE} libaa libab
+
 .include 



Re: Modernize regress/libexec/ld.so/constructor

2016-09-26 Thread Alexander Bluhm
On Tue, Sep 27, 2016 at 12:00:55AM +0200, Mark Kettenis wrote:
> > Date: Mon, 26 Sep 2016 23:54:46 +0200
> > From: Alexander Bluhm 
> > 
> > On Mon, Sep 26, 2016 at 11:39:29PM +0200, Mark Kettenis wrote:
> > > Diff below modernizes the C++ code a bit such that the test case
> > > compiles again without warnings.  It also uses CPPFLAGS instead of
> > > CFLAGS such that the c++ compiler actually stands a chance finding the
> > > header files.
> > > 
> > > Since the tests succeed on amd64, and should succeed on other
> > > architectures, the diff re-enables this test.
> > 
> > Also passes on i386.
> > You missed the #include "iostream.h" in constructor/libaa/aa.C .
> 
> Actually, that one can be removed.  New diff below.  Still ok?

passes on i386 and amd64; OK bluhm@

> 
> Index: regress/libexec/ld.so/constructor/libaa/aa.C
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/libaa/aa.C,v
> retrieving revision 1.1
> diff -u -p -r1.1 aa.C
> --- regress/libexec/ld.so/constructor/libaa/aa.C  1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/libaa/aa.C  26 Sep 2016 21:59:21 
> -
> @@ -4,7 +4,6 @@
>   * $OpenBSD: aa.C,v 1.1 2003/02/01 19:56:17 drahn Exp $
>   */
>  
> -#include "iostream.h"
>  #include "aa.h"
>  int a;
>  
> Index: regress/libexec/ld.so/constructor/libab/Makefile
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile
> --- regress/libexec/ld.so/constructor/libab/Makefile  1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/libab/Makefile  26 Sep 2016 21:59:21 
> -
> @@ -1,6 +1,6 @@
>  LIB=ab
>  SRCS= ab.C
> -CFLAGS=-I${.CURDIR}/../libaa
> +CPPFLAGS=-I${.CURDIR}/../libaa
>  LDADD=-L../libaa
>  LDADD+=-laa
>  .include 
> Index: regress/libexec/ld.so/constructor/libab/ab.C
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/ab.C,v
> retrieving revision 1.2
> diff -u -p -r1.2 ab.C
> --- regress/libexec/ld.so/constructor/libab/ab.C  18 Feb 2003 13:14:42 
> -  1.2
> +++ regress/libexec/ld.so/constructor/libab/ab.C  26 Sep 2016 21:59:21 
> -
> @@ -4,9 +4,11 @@
>   * $OpenBSD: ab.C,v 1.2 2003/02/18 13:14:42 jmc Exp $
>   */
>  
> -#include "iostream.h"
> +#include 
>  #include "aa.h"
>  #include "ab.h"
> +
> +using namespace std;
>  
>  extern int a;
>  
> Index: regress/libexec/ld.so/constructor/prog1/Makefile
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog1/Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile
> --- regress/libexec/ld.so/constructor/prog1/Makefile  1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/prog1/Makefile  26 Sep 2016 21:59:21 
> -
> @@ -22,7 +22,7 @@ AB_OBJDIR!=if [ -d $(AB_DIR)/${__obj
>  
>  
>  
> -CFLAGS=-I${.CURDIR}/../libab
> +CPPFLAGS=-I${.CURDIR}/../libab
>  LDADD=
>  LDADD+=-lab
>  LDADD+=-laa
> Index: regress/libexec/ld.so/constructor/prog1/prog1.C
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog1/prog1.C,v
> retrieving revision 1.1
> diff -u -p -r1.1 prog1.C
> --- regress/libexec/ld.so/constructor/prog1/prog1.C   1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/prog1/prog1.C   26 Sep 2016 21:59:21 
> -
> @@ -3,8 +3,11 @@
>   *
>   * $OpenBSD: prog1.C,v 1.1 2003/02/01 19:56:17 drahn Exp $
>   */
> -#include "iostream.h"
> +#include 
>  #include "ab.h"
> +
> +using namespace std;
> +
>  BB BBmain("main");
>  
>  int a;
> Index: regress/libexec/ld.so/constructor/prog2/Makefile
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog2/Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile
> --- regress/libexec/ld.so/constructor/prog2/Makefile  1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/prog2/Makefile  26 Sep 2016 21:59:21 
> -
> @@ -22,7 +22,7 @@ AB_OBJDIR!=if [ -d $(AB_DIR)/${__obj
>  
>  
>  
> -CFLAGS=-I${.CURDIR}/../libab
> +CPPFLAGS=-I${.CURDIR}/../libab
>  LDADD=
>  LDADD+=-laa
>  LDADD+=-lab
> Index: regress/libexec/ld.so/constructor/prog2/prog2.C
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog2/prog2.C,v
> retrieving revision 1.1
> diff -u -p -r1.1 prog2.C
> --- regress/libexec/ld.so/constructor/prog2/prog2.C   1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/prog2/prog2.C   26 Sep 2016 21:59:21 
> -
> @@ -3,8 +3,11 @@
>   *
>   * $OpenBSD: prog2.C,v 1.1 2003/02/01 19:56:17 drahn 

Re: Modernize regress/libexec/ld.so/constructor

2016-09-26 Thread Mark Kettenis
> Date: Mon, 26 Sep 2016 23:54:46 +0200
> From: Alexander Bluhm 
> 
> On Mon, Sep 26, 2016 at 11:39:29PM +0200, Mark Kettenis wrote:
> > Diff below modernizes the C++ code a bit such that the test case
> > compiles again without warnings.  It also uses CPPFLAGS instead of
> > CFLAGS such that the c++ compiler actually stands a chance finding the
> > header files.
> > 
> > Since the tests succeed on amd64, and should succeed on other
> > architectures, the diff re-enables this test.
> 
> Also passes on i386.
> You missed the #include "iostream.h" in constructor/libaa/aa.C .

Actually, that one can be removed.  New diff below.  Still ok?

Index: regress/libexec/ld.so/constructor/libaa/aa.C
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/libaa/aa.C,v
retrieving revision 1.1
diff -u -p -r1.1 aa.C
--- regress/libexec/ld.so/constructor/libaa/aa.C1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/libaa/aa.C26 Sep 2016 21:59:21 
-
@@ -4,7 +4,6 @@
  * $OpenBSD: aa.C,v 1.1 2003/02/01 19:56:17 drahn Exp $
  */
 
-#include "iostream.h"
 #include "aa.h"
 int a;
 
Index: regress/libexec/ld.so/constructor/libab/Makefile
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- regress/libexec/ld.so/constructor/libab/Makefile1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/libab/Makefile26 Sep 2016 21:59:21 
-
@@ -1,6 +1,6 @@
 LIB=ab
 SRCS= ab.C
-CFLAGS=-I${.CURDIR}/../libaa
+CPPFLAGS=-I${.CURDIR}/../libaa
 LDADD=-L../libaa
 LDADD+=-laa
 .include 
Index: regress/libexec/ld.so/constructor/libab/ab.C
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/ab.C,v
retrieving revision 1.2
diff -u -p -r1.2 ab.C
--- regress/libexec/ld.so/constructor/libab/ab.C18 Feb 2003 13:14:42 
-  1.2
+++ regress/libexec/ld.so/constructor/libab/ab.C26 Sep 2016 21:59:21 
-
@@ -4,9 +4,11 @@
  * $OpenBSD: ab.C,v 1.2 2003/02/18 13:14:42 jmc Exp $
  */
 
-#include "iostream.h"
+#include 
 #include "aa.h"
 #include "ab.h"
+
+using namespace std;
 
 extern int a;
 
Index: regress/libexec/ld.so/constructor/prog1/Makefile
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog1/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- regress/libexec/ld.so/constructor/prog1/Makefile1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/prog1/Makefile26 Sep 2016 21:59:21 
-
@@ -22,7 +22,7 @@ AB_OBJDIR!=if [ -d $(AB_DIR)/${__obj
 
 
 
-CFLAGS=-I${.CURDIR}/../libab
+CPPFLAGS=-I${.CURDIR}/../libab
 LDADD=
 LDADD+=-lab
 LDADD+=-laa
Index: regress/libexec/ld.so/constructor/prog1/prog1.C
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog1/prog1.C,v
retrieving revision 1.1
diff -u -p -r1.1 prog1.C
--- regress/libexec/ld.so/constructor/prog1/prog1.C 1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/prog1/prog1.C 26 Sep 2016 21:59:21 
-
@@ -3,8 +3,11 @@
  *
  * $OpenBSD: prog1.C,v 1.1 2003/02/01 19:56:17 drahn Exp $
  */
-#include "iostream.h"
+#include 
 #include "ab.h"
+
+using namespace std;
+
 BB BBmain("main");
 
 int a;
Index: regress/libexec/ld.so/constructor/prog2/Makefile
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog2/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- regress/libexec/ld.so/constructor/prog2/Makefile1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/prog2/Makefile26 Sep 2016 21:59:21 
-
@@ -22,7 +22,7 @@ AB_OBJDIR!=if [ -d $(AB_DIR)/${__obj
 
 
 
-CFLAGS=-I${.CURDIR}/../libab
+CPPFLAGS=-I${.CURDIR}/../libab
 LDADD=
 LDADD+=-laa
 LDADD+=-lab
Index: regress/libexec/ld.so/constructor/prog2/prog2.C
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog2/prog2.C,v
retrieving revision 1.1
diff -u -p -r1.1 prog2.C
--- regress/libexec/ld.so/constructor/prog2/prog2.C 1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/prog2/prog2.C 26 Sep 2016 21:59:21 
-
@@ -3,8 +3,11 @@
  *
  * $OpenBSD: prog2.C,v 1.1 2003/02/01 19:56:17 drahn Exp $
  */
-#include "iostream.h"
+#include 
 #include "ab.h"
+
+using namespace std;
+
 BB BBmain("main");
 
 int a;



Re: Modernize regress/libexec/ld.so/constructor

2016-09-26 Thread Alexander Bluhm
On Mon, Sep 26, 2016 at 11:39:29PM +0200, Mark Kettenis wrote:
> Diff below modernizes the C++ code a bit such that the test case
> compiles again without warnings.  It also uses CPPFLAGS instead of
> CFLAGS such that the c++ compiler actually stands a chance finding the
> header files.
> 
> Since the tests succeed on amd64, and should succeed on other
> architectures, the diff re-enables this test.

Also passes on i386.
You missed the #include "iostream.h" in constructor/libaa/aa.C .

> ok?

with that, OK bluhm@

> 
> 
> Index: regress/libexec/ld.so/Makefile
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/Makefile,v
> retrieving revision 1.16
> diff -u -p -r1.16 Makefile
> --- regress/libexec/ld.so/Makefile20 Mar 2016 05:13:22 -  1.16
> +++ regress/libexec/ld.so/Makefile26 Sep 2016 21:35:45 -
> @@ -1,7 +1,7 @@
>  #$OpenBSD: Makefile,v 1.16 2016/03/20 05:13:22 guenther Exp $
>  
>  SUBDIR+= elf hidden weak dlsym dlopen dlclose lazy
> -#SUBDIR+= constructor 
> +SUBDIR+= constructor 
>  SUBDIR+= link-order edgecases initfirst
>  SUBDIR+= df_1_noopen randomdata subst dependencies
>  SUBDIR+= init-env
> Index: regress/libexec/ld.so/constructor/libab/Makefile
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile
> --- regress/libexec/ld.so/constructor/libab/Makefile  1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/libab/Makefile  26 Sep 2016 21:35:45 
> -
> @@ -1,6 +1,6 @@
>  LIB=ab
>  SRCS= ab.C
> -CFLAGS=-I${.CURDIR}/../libaa
> +CPPFLAGS=-I${.CURDIR}/../libaa
>  LDADD=-L../libaa
>  LDADD+=-laa
>  .include 
> Index: regress/libexec/ld.so/constructor/libab/ab.C
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/ab.C,v
> retrieving revision 1.2
> diff -u -p -r1.2 ab.C
> --- regress/libexec/ld.so/constructor/libab/ab.C  18 Feb 2003 13:14:42 
> -  1.2
> +++ regress/libexec/ld.so/constructor/libab/ab.C  26 Sep 2016 21:35:45 
> -
> @@ -4,9 +4,11 @@
>   * $OpenBSD: ab.C,v 1.2 2003/02/18 13:14:42 jmc Exp $
>   */
>  
> -#include "iostream.h"
> +#include 
>  #include "aa.h"
>  #include "ab.h"
> +
> +using namespace std;
>  
>  extern int a;
>  
> Index: regress/libexec/ld.so/constructor/prog1/Makefile
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog1/Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile
> --- regress/libexec/ld.so/constructor/prog1/Makefile  1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/prog1/Makefile  26 Sep 2016 21:35:45 
> -
> @@ -22,7 +22,7 @@ AB_OBJDIR!=if [ -d $(AB_DIR)/${__obj
>  
>  
>  
> -CFLAGS=-I${.CURDIR}/../libab
> +CPPFLAGS=-I${.CURDIR}/../libab
>  LDADD=
>  LDADD+=-lab
>  LDADD+=-laa
> Index: regress/libexec/ld.so/constructor/prog1/prog1.C
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog1/prog1.C,v
> retrieving revision 1.1
> diff -u -p -r1.1 prog1.C
> --- regress/libexec/ld.so/constructor/prog1/prog1.C   1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/prog1/prog1.C   26 Sep 2016 21:35:45 
> -
> @@ -3,8 +3,11 @@
>   *
>   * $OpenBSD: prog1.C,v 1.1 2003/02/01 19:56:17 drahn Exp $
>   */
> -#include "iostream.h"
> +#include 
>  #include "ab.h"
> +
> +using namespace std;
> +
>  BB BBmain("main");
>  
>  int a;
> Index: regress/libexec/ld.so/constructor/prog2/Makefile
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog2/Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile
> --- regress/libexec/ld.so/constructor/prog2/Makefile  1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/prog2/Makefile  26 Sep 2016 21:35:45 
> -
> @@ -22,7 +22,7 @@ AB_OBJDIR!=if [ -d $(AB_DIR)/${__obj
>  
>  
>  
> -CFLAGS=-I${.CURDIR}/../libab
> +CPPFLAGS=-I${.CURDIR}/../libab
>  LDADD=
>  LDADD+=-laa
>  LDADD+=-lab
> Index: regress/libexec/ld.so/constructor/prog2/prog2.C
> ===
> RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog2/prog2.C,v
> retrieving revision 1.1
> diff -u -p -r1.1 prog2.C
> --- regress/libexec/ld.so/constructor/prog2/prog2.C   1 Feb 2003 19:56:17 
> -   1.1
> +++ regress/libexec/ld.so/constructor/prog2/prog2.C   26 Sep 2016 21:35:45 
> -
> @@ -3,8 +3,11 @@
>   *
>   * $OpenBSD: prog2.C,v 1.1 2003/02/01 19:56:17 drahn Exp $
>   */
> -#include "iostream.h"
> +#include 
>  #include "ab.h"
> +
> +using namespace std;
> +
>  BB BBmain("main");
>  
>  int a;



Modernize regress/libexec/ld.so/constructor

2016-09-26 Thread Mark Kettenis
Diff below modernizes the C++ code a bit such that the test case
compiles again without warnings.  It also uses CPPFLAGS instead of
CFLAGS such that the c++ compiler actually stands a chance finding the
header files.

Since the tests succeed on amd64, and should succeed on other
architectures, the diff re-enables this test.

ok?


Index: regress/libexec/ld.so/Makefile
===
RCS file: /cvs/src/regress/libexec/ld.so/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- regress/libexec/ld.so/Makefile  20 Mar 2016 05:13:22 -  1.16
+++ regress/libexec/ld.so/Makefile  26 Sep 2016 21:35:45 -
@@ -1,7 +1,7 @@
 #  $OpenBSD: Makefile,v 1.16 2016/03/20 05:13:22 guenther Exp $
 
 SUBDIR+= elf hidden weak dlsym dlopen dlclose lazy
-#SUBDIR+= constructor 
+SUBDIR+= constructor 
 SUBDIR+= link-order edgecases initfirst
 SUBDIR+= df_1_noopen randomdata subst dependencies
 SUBDIR+= init-env
Index: regress/libexec/ld.so/constructor/libab/Makefile
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- regress/libexec/ld.so/constructor/libab/Makefile1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/libab/Makefile26 Sep 2016 21:35:45 
-
@@ -1,6 +1,6 @@
 LIB=ab
 SRCS= ab.C
-CFLAGS=-I${.CURDIR}/../libaa
+CPPFLAGS=-I${.CURDIR}/../libaa
 LDADD=-L../libaa
 LDADD+=-laa
 .include 
Index: regress/libexec/ld.so/constructor/libab/ab.C
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/libab/ab.C,v
retrieving revision 1.2
diff -u -p -r1.2 ab.C
--- regress/libexec/ld.so/constructor/libab/ab.C18 Feb 2003 13:14:42 
-  1.2
+++ regress/libexec/ld.so/constructor/libab/ab.C26 Sep 2016 21:35:45 
-
@@ -4,9 +4,11 @@
  * $OpenBSD: ab.C,v 1.2 2003/02/18 13:14:42 jmc Exp $
  */
 
-#include "iostream.h"
+#include 
 #include "aa.h"
 #include "ab.h"
+
+using namespace std;
 
 extern int a;
 
Index: regress/libexec/ld.so/constructor/prog1/Makefile
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog1/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- regress/libexec/ld.so/constructor/prog1/Makefile1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/prog1/Makefile26 Sep 2016 21:35:45 
-
@@ -22,7 +22,7 @@ AB_OBJDIR!=if [ -d $(AB_DIR)/${__obj
 
 
 
-CFLAGS=-I${.CURDIR}/../libab
+CPPFLAGS=-I${.CURDIR}/../libab
 LDADD=
 LDADD+=-lab
 LDADD+=-laa
Index: regress/libexec/ld.so/constructor/prog1/prog1.C
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog1/prog1.C,v
retrieving revision 1.1
diff -u -p -r1.1 prog1.C
--- regress/libexec/ld.so/constructor/prog1/prog1.C 1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/prog1/prog1.C 26 Sep 2016 21:35:45 
-
@@ -3,8 +3,11 @@
  *
  * $OpenBSD: prog1.C,v 1.1 2003/02/01 19:56:17 drahn Exp $
  */
-#include "iostream.h"
+#include 
 #include "ab.h"
+
+using namespace std;
+
 BB BBmain("main");
 
 int a;
Index: regress/libexec/ld.so/constructor/prog2/Makefile
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog2/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- regress/libexec/ld.so/constructor/prog2/Makefile1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/prog2/Makefile26 Sep 2016 21:35:45 
-
@@ -22,7 +22,7 @@ AB_OBJDIR!=if [ -d $(AB_DIR)/${__obj
 
 
 
-CFLAGS=-I${.CURDIR}/../libab
+CPPFLAGS=-I${.CURDIR}/../libab
 LDADD=
 LDADD+=-laa
 LDADD+=-lab
Index: regress/libexec/ld.so/constructor/prog2/prog2.C
===
RCS file: /cvs/src/regress/libexec/ld.so/constructor/prog2/prog2.C,v
retrieving revision 1.1
diff -u -p -r1.1 prog2.C
--- regress/libexec/ld.so/constructor/prog2/prog2.C 1 Feb 2003 19:56:17 
-   1.1
+++ regress/libexec/ld.so/constructor/prog2/prog2.C 26 Sep 2016 21:35:45 
-
@@ -3,8 +3,11 @@
  *
  * $OpenBSD: prog2.C,v 1.1 2003/02/01 19:56:17 drahn Exp $
  */
-#include "iostream.h"
+#include 
 #include "ab.h"
+
+using namespace std;
+
 BB BBmain("main");
 
 int a;