[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / tests / libexec / ld.elf_so

File: [cvs.NetBSD.org] / src / tests / libexec / ld.elf_so / Makefile (download)

Revision 1.9, Tue Jul 11 15:21:36 2017 UTC (3 years, 3 months ago) by joerg
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646
Branch point for: phil-wifi
Changes since 1.8: +6 -3 lines

Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.

If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.

Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.

# $NetBSD: Makefile,v 1.9 2017/07/11 15:21:36 joerg Exp $
#

NOMAN=		# defined

.include <bsd.own.mk>

.if ${MKPIC} != "no"

SUBDIR+=	helper_dso1 helper_dso3 .WAIT helper_dso2 .WAIT \
		helper_ifunc_dso \
		helper_symver_dso0 .WAIT helper_symver_dso1 .WAIT \
		helper_symver_dso2 .WAIT \
		data

TESTSDIR=	${TESTSBASE}/libexec/ld.elf_so

TESTS_C+=	t_dlerror-cleared t_dlerror-false t_dlinfo t_dlvsym t_ifunc

LDADD.t_dlerror-false=	-Wl,-rpath,/var/nonexistent/lib
LDADD.t_dlvsym=		-Wl,-rpath,${TESTSDIR}/h_helper_symver_dso2
LDADD.t_ifunc=		-Wl,-rpath,${TESTSDIR} -lutil
DPADD.t_ifunc=		${LIBUTIL}

TESTS_SH+=		t_df_1_noopen t_dl_symver t_thread_local_dtor

BINDIR=			${TESTSDIR}
PROGS+=			h_df_1_noopen1
SRCS.h_df_1_noopen1=	h_df_1_noopen.c

PROGS+=			h_df_1_noopen2
SRCS.h_df_1_noopen2=	h_df_1_noopen.c
LDADD.h_df_1_noopen2=	-lpthread

PROGS+=			h_thread_local_dtor
LDADD.h_thread_local_dtor=	-Wl,-rpath,${TESTSDIR}  -lpthread

PROGS+=			h_ifunc
SRCS.h_ifunc=		h_ifunc.c
IFUNCDIR!=		cd ${.CURDIR}/helper_ifunc_dso && ${PRINTOBJDIR}
LDADD.h_ifunc=		-Wl,-rpath,${TESTSDIR} -L${IFUNCDIR} -lh_helper_ifunc_dso

PROGS+=			h_locking
SRCS.h_locking=		h_locking.c
LDADD.h_locking=	-lpthread -Wl,--export-dynamic -Wl,-rpath,${TESTSDIR}

PROGS+=			h_dl_symver_v0
SRCS.h_dl_symver_v0=	h_dl_symver.c
V0ODIR!=		cd ${.CURDIR}/helper_symver_dso0 && ${PRINTOBJDIR}
LDADD.h_dl_symver_v0=	-L${V0ODIR} -lh_helper_symver_dso

PROGS+=			h_dl_symver_v1
SRCS.h_dl_symver_v1=	h_dl_symver.c
V1ODIR!=		cd ${.CURDIR}/helper_symver_dso1 && ${PRINTOBJDIR}
LDADD.h_dl_symver_v1=	-L${V1ODIR} -lh_helper_symver_dso

PROGS+=			h_dl_symver_v2
SRCS.h_dl_symver_v2=	h_dl_symver.c
V2ODIR!=		cd ${.CURDIR}/helper_symver_dso2 && ${PRINTOBJDIR}
LDADD.h_dl_symver_v2=	-L${V2ODIR} -lh_helper_symver_dso

.include <bsd.test.mk>

.else

NOPROG=	# defined
.include <bsd.prog.mk>

.endif