Build the csu tests on all architectures.

The tests haven't been run them, but this is enough to build them so I can
get feedback on if the various crt.h headers are correct.

MFC with:	r339738
Sponsored by:	DARPA, AFRL
This commit is contained in:
Andrew Turner 2018-10-30 14:44:12 +00:00
parent d59a162c11
commit 8522d140a5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339916
7 changed files with 100 additions and 4 deletions

View File

@ -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>

2
lib/csu/arm/crt.h Normal file
View File

@ -0,0 +1,2 @@
/* $FreeBSD$ */
/* Empty so we can include this unconditionally */

31
lib/csu/mips/crt.h Normal file
View File

@ -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

33
lib/csu/powerpc/crt.h Normal file
View File

@ -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

2
lib/csu/riscv/crt.h Normal file
View File

@ -0,0 +1,2 @@
/* $FreeBSD$ */
/* Empty so we can include this unconditionally */

31
lib/csu/sparc64/crt.h Normal file
View File

@ -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

View File

@ -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}