From 37828b0a33d48c26866707ebfc9d4d58f1e53423 Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 1 Jan 2015 02:12:43 +0000 Subject: [PATCH] MFC r274578,r274580: r274578: Add reachover Makefiles for contrib/netbsd-tests/lib/libpthread as lib/libthr/tests A variant of this code has been tested on amd64/i386 for some time by EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the code will remain off until it's proven it works on virtual hardware or real hardware on other architectures Original work by: pho Sponsored by: EMC / Isilon Storage Division r274580: Add reachover Makefiles for contrib/netbsd-tests/lib/librt A variant of this code has been tested on amd64/i386 for some time by EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the code will remain off until it's proven it works on virtual hardware or real hardware on other architectures Sponsored by: EMC / Isilon Storage Division git-svn-id: svn://svn.freebsd.org/base/stable/10@276492 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- etc/mtree/BSD.tests.dist | 6 +++ lib/librt/Makefile | 4 ++ lib/librt/Makefile.amd64 | 6 +++ lib/librt/Makefile.i386 | 6 +++ lib/librt/tests/Makefile | 17 ++++++++ lib/libthr/Makefile | 2 + lib/libthr/Makefile.amd64 | 6 +++ lib/libthr/Makefile.i386 | 6 +++ lib/libthr/tests/Makefile | 58 ++++++++++++++++++++++++++++ lib/libthr/tests/dlopen/Makefile | 30 ++++++++++++++ lib/libthr/tests/dlopen/dso/Makefile | 19 +++++++++ 11 files changed, 160 insertions(+) create mode 100644 lib/librt/Makefile.amd64 create mode 100644 lib/librt/Makefile.i386 create mode 100644 lib/librt/tests/Makefile create mode 100644 lib/libthr/Makefile.amd64 create mode 100644 lib/libthr/Makefile.i386 create mode 100644 lib/libthr/tests/Makefile create mode 100644 lib/libthr/tests/dlopen/Makefile create mode 100644 lib/libthr/tests/dlopen/dso/Makefile diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 42189e0de..3472a77ae 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -91,6 +91,12 @@ .. libmp .. + librt + .. + libthr + dlopen + .. + .. libutil .. .. diff --git a/lib/librt/Makefile b/lib/librt/Makefile index f624cf7b1..a2b7c5bd3 100644 --- a/lib/librt/Makefile +++ b/lib/librt/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB=rt SHLIB_MAJOR= 1 CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR} @@ -18,4 +20,6 @@ PRECIOUSLIB= VERSION_MAP= ${.CURDIR}/Version.map +.include + .include diff --git a/lib/librt/Makefile.amd64 b/lib/librt/Makefile.amd64 new file mode 100644 index 000000000..dd0f5b0cf --- /dev/null +++ b/lib/librt/Makefile.amd64 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + diff --git a/lib/librt/Makefile.i386 b/lib/librt/Makefile.i386 new file mode 100644 index 000000000..dd0f5b0cf --- /dev/null +++ b/lib/librt/Makefile.i386 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + diff --git a/lib/librt/tests/Makefile b/lib/librt/tests/Makefile new file mode 100644 index 000000000..224f52ea8 --- /dev/null +++ b/lib/librt/tests/Makefile @@ -0,0 +1,17 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H} +SRCTOP= ${.CURDIR:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/librt + +TESTSDIR= ${TESTSBASE}/lib/librt + +DPADD+= ${LIBRT} +LDADD+= -lrt + +NETBSD_ATF_TESTS_C= sched_test +NETBSD_ATF_TESTS_C+= sem_test + +.include + +.include diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index c4de29a4d..e13256c33 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -64,4 +64,6 @@ SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a CFLAGS+=-DSYSCALL_COMPAT .endif +.include + .include diff --git a/lib/libthr/Makefile.amd64 b/lib/libthr/Makefile.amd64 new file mode 100644 index 000000000..dd0f5b0cf --- /dev/null +++ b/lib/libthr/Makefile.amd64 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + diff --git a/lib/libthr/Makefile.i386 b/lib/libthr/Makefile.i386 new file mode 100644 index 000000000..dd0f5b0cf --- /dev/null +++ b/lib/libthr/Makefile.i386 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + diff --git a/lib/libthr/tests/Makefile b/lib/libthr/tests/Makefile new file mode 100644 index 000000000..50f07f07e --- /dev/null +++ b/lib/libthr/tests/Makefile @@ -0,0 +1,58 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H} +SRCTOP= ${.CURDIR:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread + +TESTSDIR= ${TESTSBASE}/lib/libthr + +# TODO: t_name (missing pthread_getname_np support in FreeBSD) +NETBSD_ATF_TESTS_C= barrier_test +NETBSD_ATF_TESTS_C+= cond_test +NETBSD_ATF_TESTS_C+= condwait_test +NETBSD_ATF_TESTS_C+= detach_test +NETBSD_ATF_TESTS_C+= equal_test +NETBSD_ATF_TESTS_C+= fork_test +NETBSD_ATF_TESTS_C+= fpu_test +NETBSD_ATF_TESTS_C+= join_test +NETBSD_ATF_TESTS_C+= kill_test +NETBSD_ATF_TESTS_C+= mutex_test +NETBSD_ATF_TESTS_C+= once_test +NETBSD_ATF_TESTS_C+= preempt_test +NETBSD_ATF_TESTS_C+= rwlock_test +NETBSD_ATF_TESTS_C+= sem_test +NETBSD_ATF_TESTS_C+= sigmask_test +NETBSD_ATF_TESTS_C+= sigsuspend_test +NETBSD_ATF_TESTS_C+= siglongjmp_test +NETBSD_ATF_TESTS_C+= sleep_test +NETBSD_ATF_TESTS_C+= swapcontext_test + +NETBSD_ATF_TESTS_SH= atexit_test +NETBSD_ATF_TESTS_SH+= cancel_test +NETBSD_ATF_TESTS_SH+= exit_test +NETBSD_ATF_TESTS_SH+= resolv_test + +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread +DPADD.fpu_test+= ${LIBM} +LDADD.fpu_test+= -lm +DPADD.sem_test+= ${LIBRT} +LDADD.sem_test+= -lrt + +BINDIR= ${TESTSDIR} + +PROGS= h_atexit +PROGS+= h_cancel +PROGS+= h_exit +PROGS+= h_resolv + +FILESDIR= ${TESTSDIR} +FILES= d_mach + +TESTS_SUBDIRS= dlopen + +.include + +CFLAGS.condwait_test+= -I${SRCTOP}/contrib/netbsd-tests/lib/libc/gen + +.include diff --git a/lib/libthr/tests/dlopen/Makefile b/lib/libthr/tests/dlopen/Makefile new file mode 100644 index 000000000..0764bfa15 --- /dev/null +++ b/lib/libthr/tests/dlopen/Makefile @@ -0,0 +1,30 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H:H} +SRCTOP= ${.CURDIR:H:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen + +.include + +TESTSDIR= ${TESTSBASE}/lib/libthr/dlopen + +CFLAGS+= -DTESTDIR=\"${TESTSDIR:Q}/\" +LDFLAGS+= -L${.OBJDIR}/dso -Wl,-rpath=${TESTDIR} + +.if !defined(NO_PIC) +SUBDIR+= dso + +NETBSD_ATF_TESTS_C= dlopen_test +NETBSD_ATF_TESTS_C+= main_pthread_create_test +# XXX: this blocks running the testcase +#NETBSD_ATF_TESTS_C+= dso_pthread_create_test + +.for t in dlopen_test main_pthread_create_test +DPADD.$t+= ${LIBPTHREAD} +LDADD.$t+= -lpthread +.endfor +.endif + +.include + +.include diff --git a/lib/libthr/tests/dlopen/dso/Makefile b/lib/libthr/tests/dlopen/dso/Makefile new file mode 100644 index 000000000..080dec941 --- /dev/null +++ b/lib/libthr/tests/dlopen/dso/Makefile @@ -0,0 +1,19 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H:H:H} +SRCTOP= ${.CURDIR:H:H:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen/dso + +SHLIB= h_pthread_dlopen +SHLIB_MAJOR= 1 +SHLIB_NAME= h_pthread_dlopen.so.${SHLIB_MAJOR} +SRCS= h_pthread_dlopen.c + +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread + +LIBDIR= ${TESTSBASE}/lib/libthr/dlopen + +.include + +.include -- 2.45.0