aboutsummaryrefslogtreecommitdiff
path: root/lib/csu
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2018-10-30 14:44:12 +0000
committerAndrew Turner <andrew@FreeBSD.org>2018-10-30 14:44:12 +0000
commit8522d140a568be6044aad4288042c72e8d3b72a7 (patch)
tree404f70b26d164ca08eecac7c87a892fc54a48aac /lib/csu
parentd59a162c118b3e3befb4f0a46ecd1cf6e5bdf353 (diff)
Notes
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/Makefile3
-rw-r--r--lib/csu/arm/crt.h2
-rw-r--r--lib/csu/mips/crt.h31
-rw-r--r--lib/csu/powerpc/crt.h33
-rw-r--r--lib/csu/riscv/crt.h2
-rw-r--r--lib/csu/sparc64/crt.h31
-rw-r--r--lib/csu/tests/Makefile.tests2
7 files changed, 100 insertions, 4 deletions
diff --git a/lib/csu/Makefile b/lib/csu/Makefile
index 5c270d4c31a7..9b7d1beb76d6 100644
--- a/lib/csu/Makefile
+++ b/lib/csu/Makefile
@@ -8,10 +8,7 @@ SUBDIR+= ${MACHINE_ARCH}
SUBDIR+= ${MACHINE_CPUARCH}
.endif
-.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
- ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc64"
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
-.endif
.include <bsd.subdir.mk>
diff --git a/lib/csu/arm/crt.h b/lib/csu/arm/crt.h
new file mode 100644
index 000000000000..9f41c2fac0fe
--- /dev/null
+++ b/lib/csu/arm/crt.h
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+/* Empty so we can include this unconditionally */
diff --git a/lib/csu/mips/crt.h b/lib/csu/mips/crt.h
new file mode 100644
index 000000000000..509899b97b96
--- /dev/null
+++ b/lib/csu/mips/crt.h
@@ -0,0 +1,31 @@
+/*-
+ * SPDX-License-Identifier: BSD-1-Clause
+ *
+ * Copyright 2018 Andrew Turner
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _CRT_H_
+#define _CRT_H_
+
+#define HAVE_CTORS
+
+#endif
diff --git a/lib/csu/powerpc/crt.h b/lib/csu/powerpc/crt.h
new file mode 100644
index 000000000000..304db572c621
--- /dev/null
+++ b/lib/csu/powerpc/crt.h
@@ -0,0 +1,33 @@
+/*-
+ * SPDX-License-Identifier: BSD-1-Clause
+ *
+ * Copyright 2018 Andrew Turner
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _CRT_H_
+#define _CRT_H_
+
+#define HAVE_CTORS
+#define CTORS_CONSTRUCTORS
+#define INIT_CALL_SEQ(func) "bl " __STRING(func) "; nop"
+
+#endif
diff --git a/lib/csu/riscv/crt.h b/lib/csu/riscv/crt.h
new file mode 100644
index 000000000000..9f41c2fac0fe
--- /dev/null
+++ b/lib/csu/riscv/crt.h
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+/* Empty so we can include this unconditionally */
diff --git a/lib/csu/sparc64/crt.h b/lib/csu/sparc64/crt.h
new file mode 100644
index 000000000000..509899b97b96
--- /dev/null
+++ b/lib/csu/sparc64/crt.h
@@ -0,0 +1,31 @@
+/*-
+ * SPDX-License-Identifier: BSD-1-Clause
+ *
+ * Copyright 2018 Andrew Turner
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _CRT_H_
+#define _CRT_H_
+
+#define HAVE_CTORS
+
+#endif
diff --git a/lib/csu/tests/Makefile.tests b/lib/csu/tests/Makefile.tests
index 64b4227fe48e..fa99e787fbea 100644
--- a/lib/csu/tests/Makefile.tests
+++ b/lib/csu/tests/Makefile.tests
@@ -4,7 +4,7 @@ ATF_TESTS_C+= init_test
ATF_TESTS_C+= fini_test
ATF_TESTS_CXX+= cxx_constructors
-WARNS?= 5
+WARNS?= 3
.if exists(${.CURDIR:H:H}/${MACHINE_ARCH})
CFLAGS+= -I${.CURDIR:H:H}/${MACHINE_ARCH}