summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2017-08-04 18:23:52 +0000
committerkettenis <kettenis@openbsd.org>2017-08-04 18:23:52 +0000
commit1baba19217f7d3398f70716c64a5526798c65fd1 (patch)
treeef17362f413ea39fb4e00b93407e8f5e9341f3b6
parentThe in_pcbhashlookup() in in_pcbconnect() enforces that the 4 tupel (diff)
downloadwireguard-openbsd-1baba19217f7d3398f70716c64a5526798c65fd1.tar.xz
wireguard-openbsd-1baba19217f7d3398f70716c64a5526798c65fd1.zip
Use volatile to keep clang from optimizing things too much. Force linking
with the c++ command instead of cc by setting CC=${CXX}. This is a hack and a better solution is under development. Linking with c++ is necessary to make the shared libraries depend up libc++.so such that the iostream objects are constructed before we use them. ok bluhm@
-rw-r--r--regress/libexec/ld.so/constructor/libaa/aa.C4
-rw-r--r--regress/libexec/ld.so/constructor/libab/Makefile4
2 files changed, 5 insertions, 3 deletions
diff --git a/regress/libexec/ld.so/constructor/libaa/aa.C b/regress/libexec/ld.so/constructor/libaa/aa.C
index 530da6f32d0..524b0f49c28 100644
--- a/regress/libexec/ld.so/constructor/libaa/aa.C
+++ b/regress/libexec/ld.so/constructor/libaa/aa.C
@@ -1,11 +1,11 @@
/*
* Public Domain 2003 Dale Rahn
*
- * $OpenBSD: aa.C,v 1.2 2016/09/27 06:52:50 kettenis Exp $
+ * $OpenBSD: aa.C,v 1.3 2017/08/04 18:23:52 kettenis Exp $
*/
#include "aa.h"
-int a;
+volatile int a;
AA::AA(char *arg)
diff --git a/regress/libexec/ld.so/constructor/libab/Makefile b/regress/libexec/ld.so/constructor/libab/Makefile
index 5d70c990518..c255b8b9940 100644
--- a/regress/libexec/ld.so/constructor/libab/Makefile
+++ b/regress/libexec/ld.so/constructor/libab/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.3 2016/09/27 18:14:22 kettenis Exp $
+# $OpenBSD: Makefile,v 1.4 2017/08/04 18:23:52 kettenis Exp $
LIB=ab
SRCS= ab.C
@@ -7,6 +7,8 @@ CPPFLAGS=-I${.CURDIR}/../libaa
LDADD=-L../libaa
LDADD+=-laa
+CC=${CXX}
+
regress: all
.include <bsd.lib.mk>