xref: /titanic_44/usr/src/lib/libc/amd64/Makefile (revision d1c5dc47e23888b05d4095e8983ccf62acbc69fa)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright 2016 Joyent, Inc.
24#
25# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
26# Copyright 2013 Garrett D'Amore <garrett@damore.org>
27# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
28# Use is subject to license terms.
29#
30
31LIBCBASE=	.
32LIBCDIR=	$(SRC)/lib/libc
33LIBRARY=	libc.a
34LIB_PIC=	libc_pic.a
35VERS=		.1
36CPP=		/usr/lib/cpp
37TARGET_ARCH=	amd64
38
39# include comm page definitions
40include $(SRC)/lib/commpage/Makefile.shared.com
41include $(SRC)/lib/commpage/Makefile.shared.targ
42
43# objects are grouped by source directory
44
45# local objects
46STRETS=
47
48CRTOBJS=			\
49	cerror.o
50
51DYNOBJS=
52
53FPOBJS=				\
54	fpgetmask.o		\
55	fpgetround.o		\
56	fpsetmask.o		\
57	fpsetround.o		\
58	fpstart.o		\
59	ieee.o
60
61I386FPOBJS=			\
62	_D_cplx_div.o		\
63	_D_cplx_div_ix.o	\
64	_D_cplx_div_rx.o	\
65	_D_cplx_lr_div.o	\
66	_D_cplx_lr_div_ix.o	\
67	_D_cplx_lr_div_rx.o	\
68	_D_cplx_mul.o		\
69	_F_cplx_div.o		\
70	_F_cplx_div_ix.o	\
71	_F_cplx_div_rx.o	\
72	_F_cplx_lr_div.o	\
73	_F_cplx_lr_div_ix.o	\
74	_F_cplx_lr_div_rx.o	\
75	_F_cplx_mul.o		\
76	_X_cplx_div.o		\
77	_X_cplx_div_ix.o	\
78	_X_cplx_div_rx.o	\
79	_X_cplx_lr_div.o	\
80	_X_cplx_lr_div_ix.o	\
81	_X_cplx_lr_div_rx.o	\
82	_X_cplx_mul.o
83
84FPASMOBJS=			\
85	__xgetRD.o		\
86	_xtoll.o		\
87	_xtoull.o		\
88	_base_il.o		\
89	fpcw.o			\
90	fpgetsticky.o		\
91	fpsetsticky.o
92
93ATOMICOBJS=			\
94	atomic.o
95
96CHACHAOBJS=			\
97	chacha.o
98
99XATTROBJS=			\
100	xattr_common.o
101COMOBJS=			\
102	bcmp.o			\
103	bcopy.o			\
104	bsearch.o		\
105	bzero.o			\
106	qsort.o			\
107	strtol.o		\
108	strtoul.o		\
109	strtoll.o		\
110	strtoull.o
111
112GENOBJS=			\
113	$(COMMPAGE_OBJS)	\
114	_getsp.o		\
115	abs.o			\
116	alloca.o		\
117	arc4random.o		\
118	arc4random_uniform.o	\
119	attrat.o		\
120	byteorder.o		\
121	cuexit.o		\
122	ecvt.o			\
123	endian.o		\
124	errlst.o		\
125	amd64_data.o		\
126	ldivide.o		\
127	lock.o			\
128	makectxt.o		\
129	memccpy.o		\
130	memchr.o		\
131	memcmp.o		\
132	memcpy.o		\
133	memset.o		\
134	new_list.o		\
135	proc64_id.o		\
136	proc64_support.o	\
137	setjmp.o		\
138	siginfolst.o		\
139	siglongjmp.o		\
140	strcmp.o		\
141	strcpy.o		\
142	strlen.o		\
143	strncmp.o		\
144	strncpy.o		\
145	strnlen.o		\
146	sync_instruction_memory.o
147
148# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
149# This macro should ALWAYS be empty; native APIs are already 'large file'.
150COMSYSOBJS64=
151
152SYSOBJS64=
153
154COMSYSOBJS=			\
155	__clock_timer.o		\
156	__getloadavg.o		\
157	__rusagesys.o		\
158	__signotify.o		\
159	__sigrt.o		\
160	__time.o		\
161	_lgrp_home_fast.o	\
162	_lgrpsys.o		\
163	_nfssys.o		\
164	_portfs.o		\
165	_pset.o			\
166	_rpcsys.o		\
167	_sigaction.o		\
168	_so_accept.o		\
169	_so_bind.o		\
170	_so_connect.o		\
171	_so_getpeername.o	\
172	_so_getsockname.o	\
173	_so_getsockopt.o	\
174	_so_listen.o		\
175	_so_recv.o		\
176	_so_recvfrom.o		\
177	_so_recvmsg.o		\
178	_so_send.o		\
179	_so_sendmsg.o		\
180	_so_sendto.o		\
181	_so_setsockopt.o	\
182	_so_shutdown.o		\
183	_so_socket.o		\
184	_so_socketpair.o	\
185	_sockconfig.o		\
186	acct.o			\
187	acl.o			\
188	adjtime.o		\
189	alarm.o			\
190	brk.o			\
191	chdir.o			\
192	chroot.o		\
193	cladm.o			\
194	close.o			\
195	execve.o		\
196	exit.o			\
197	facl.o			\
198	fchdir.o		\
199	fchroot.o		\
200	fdsync.o		\
201	fpathconf.o		\
202	fstatfs.o		\
203	fstatvfs.o		\
204	getcpuid.o		\
205	getdents.o		\
206	getegid.o		\
207	geteuid.o		\
208	getgid.o		\
209	getgroups.o		\
210	gethrtime.o		\
211	getitimer.o		\
212	getmsg.o		\
213	getpid.o		\
214	getpmsg.o		\
215	getppid.o		\
216	getrandom.o		\
217	getrlimit.o		\
218	getuid.o		\
219	gtty.o			\
220	install_utrap.o		\
221	ioctl.o			\
222	kaio.o			\
223	kill.o			\
224	llseek.o		\
225	lseek.o			\
226	mmapobjsys.o		\
227	memcntl.o		\
228	mincore.o		\
229	mmap.o			\
230	modctl.o		\
231	mount.o			\
232	mprotect.o		\
233	munmap.o		\
234	nice.o			\
235	ntp_adjtime.o		\
236	ntp_gettime.o		\
237	p_online.o		\
238	pathconf.o		\
239	pause.o			\
240	pcsample.o		\
241	pipe2.o			\
242	pollsys.o		\
243	pread.o			\
244	preadv.o		\
245	priocntlset.o		\
246	processor_bind.o	\
247	processor_info.o	\
248	profil.o		\
249	putmsg.o		\
250	putpmsg.o		\
251	pwrite.o		\
252	pwritev.o		\
253	read.o			\
254	readv.o			\
255	resolvepath.o		\
256	seteguid.o		\
257	setgid.o		\
258	setgroups.o		\
259	setitimer.o		\
260	setreid.o		\
261	setrlimit.o		\
262	setuid.o		\
263	sigaltstk.o		\
264	sigprocmsk.o		\
265	sigsendset.o		\
266	sigsuspend.o		\
267	statfs.o		\
268	statvfs.o		\
269	stty.o			\
270	sync.o			\
271	sysconfig.o		\
272	sysfs.o			\
273	sysinfo.o		\
274	syslwp.o		\
275	times.o			\
276	ulimit.o		\
277	umask.o			\
278	umount2.o		\
279	utssys.o		\
280	uucopy.o		\
281	vhangup.o		\
282	waitid.o		\
283	write.o			\
284	writev.o		\
285	yield.o
286
287SYSOBJS=			\
288	__clock_gettime.o	\
289	__clock_gettime_sys.o	\
290	__getcontext.o		\
291	__uadmin.o		\
292	_lwp_mutex_unlock.o	\
293	_stack_grow.o		\
294	door.o			\
295	forkx.o			\
296	forkallx.o		\
297	getcontext.o		\
298	gettimeofday.o		\
299	lwp_private.o		\
300	nuname.o		\
301	syscall.o		\
302	sysi86.o		\
303	tls_get_addr.o		\
304	uadmin.o		\
305	umount.o		\
306	uname.o			\
307	vforkx.o
308
309# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
310# This macro should ALWAYS be empty; native APIs are already 'large file'.
311PORTGEN64=
312
313# objects from source under $(LIBCDIR)/port
314PORTFP=				\
315	__flt_decim.o		\
316	__flt_rounds.o		\
317	__tbl_10_b.o		\
318	__tbl_10_h.o		\
319	__tbl_10_s.o		\
320	__tbl_2_b.o		\
321	__tbl_2_h.o		\
322	__tbl_2_s.o		\
323	__tbl_fdq.o		\
324	__tbl_tens.o		\
325	__x_power.o		\
326	_base_sup.o		\
327	aconvert.o		\
328	decimal_bin.o		\
329	double_decim.o		\
330	econvert.o		\
331	fconvert.o		\
332	file_decim.o		\
333	finite.o		\
334	fp_data.o		\
335	func_decim.o		\
336	gconvert.o		\
337	hex_bin.o		\
338	ieee_globals.o		\
339	pack_float.o		\
340	sigfpe.o		\
341	string_decim.o
342
343PORTGEN=			\
344	_env_data.o		\
345	_xftw.o			\
346	a64l.o			\
347	abort.o			\
348	addsev.o		\
349	ascii_strcasecmp.o	\
350	ascii_strncasecmp.o	\
351	assert.o		\
352	atof.o			\
353	atoi.o			\
354	atol.o			\
355	atoll.o			\
356	attropen.o		\
357	atexit.o		\
358	atfork.o		\
359	basename.o		\
360	calloc.o		\
361	catgets.o		\
362	catopen.o		\
363	cfgetispeed.o		\
364	cfgetospeed.o		\
365	cfree.o			\
366	cfsetispeed.o		\
367	cfsetospeed.o		\
368	cftime.o		\
369	clock.o			\
370	closedir.o		\
371	closefrom.o		\
372	confstr.o		\
373	crypt.o			\
374	csetlen.o		\
375	ctime.o			\
376	ctime_r.o		\
377	daemon.o		\
378	deflt.o			\
379	directio.o		\
380	dirname.o		\
381	div.o			\
382	drand48.o		\
383	dup.o			\
384	env_data.o		\
385	err.o			\
386	errno.o			\
387	euclen.o		\
388	event_port.o		\
389	execvp.o		\
390	explicit_bzero.o	\
391	fattach.o		\
392	fdetach.o		\
393	fdopendir.o		\
394	ffs.o			\
395	fls.o			\
396	fmtmsg.o		\
397	ftime.o			\
398	ftok.o			\
399	ftw.o			\
400	gcvt.o			\
401	getauxv.o		\
402	getcwd.o		\
403	getdate_err.o		\
404	getdtblsize.o		\
405	getentropy.o		\
406	getenv.o		\
407	getexecname.o		\
408	getgrnam.o		\
409	getgrnam_r.o		\
410	gethostid.o		\
411	gethostname.o		\
412	gethz.o			\
413	getisax.o		\
414	getloadavg.o		\
415	getlogin.o		\
416	getmntent.o		\
417	getnetgrent.o		\
418	get_nprocs.o		\
419	getopt.o		\
420	getopt_long.o		\
421	getpagesize.o		\
422	getpw.o			\
423	getpwnam.o		\
424	getpwnam_r.o		\
425	getrusage.o		\
426	getspent.o		\
427	getspent_r.o		\
428	getsubopt.o		\
429	gettxt.o		\
430	getusershell.o		\
431	getut.o			\
432	getutx.o		\
433	getvfsent.o		\
434	getwd.o			\
435	getwidth.o		\
436	getxby_door.o		\
437	gtxt.o			\
438	hsearch.o		\
439	iconv.o			\
440	imaxabs.o		\
441	imaxdiv.o		\
442	index.o			\
443	initgroups.o		\
444	insque.o		\
445	isaexec.o		\
446	isastream.o		\
447	isatty.o		\
448	killpg.o		\
449	klpdlib.o		\
450	l64a.o			\
451	lckpwdf.o		\
452	lconstants.o		\
453	lexp10.o		\
454	lfind.o			\
455	lfmt.o			\
456	lfmt_log.o		\
457	lldiv.o			\
458	llog10.o		\
459	lltostr.o		\
460	lmath.o			\
461	localtime.o		\
462	lsearch.o		\
463	madvise.o		\
464	malloc.o		\
465	memalign.o		\
466	memmem.o		\
467	mkdev.o			\
468	mkdtemp.o		\
469	mkfifo.o		\
470	mkstemp.o		\
471	mktemp.o		\
472	mlock.o			\
473	mlockall.o		\
474	mon.o			\
475	msync.o			\
476	munlock.o		\
477	munlockall.o		\
478	ndbm.o			\
479	nftw.o			\
480	nlspath_checks.o	\
481	nsparse.o		\
482	nss_common.o		\
483	nss_dbdefs.o		\
484	nss_deffinder.o		\
485	opendir.o		\
486	opt_data.o		\
487	perror.o		\
488	pfmt.o			\
489	pfmt_data.o		\
490	pfmt_print.o		\
491	pipe.o			\
492	plock.o			\
493	poll.o			\
494	posix_fadvise.o		\
495	posix_fallocate.o	\
496	posix_madvise.o		\
497	posix_memalign.o	\
498	priocntl.o		\
499	privlib.o		\
500	priv_str_xlate.o	\
501	psiginfo.o		\
502	psignal.o		\
503	pt.o			\
504	putpwent.o		\
505	putspent.o		\
506	raise.o			\
507	rand.o			\
508	random.o		\
509	rctlops.o		\
510	readdir.o		\
511	readdir_r.o		\
512	realpath.o		\
513	reboot.o		\
514	regexpr.o		\
515	remove.o		\
516	rewinddir.o		\
517	rindex.o		\
518	scandir.o		\
519	seekdir.o		\
520	select.o		\
521	setlabel.o		\
522	setpriority.o		\
523	settimeofday.o		\
524	sh_locks.o		\
525	sigflag.o		\
526	siglist.o		\
527	sigsend.o		\
528	sigsetops.o		\
529	ssignal.o		\
530	stack.o			\
531	stpcpy.o		\
532	stpncpy.o		\
533	str2sig.o		\
534	strcase_charmap.o	\
535	strcat.o		\
536	strchr.o		\
537	strchrnul.o		\
538	strcspn.o		\
539	strdup.o		\
540	strerror.o		\
541	strlcat.o		\
542	strlcpy.o		\
543	strncat.o		\
544	strndup.o		\
545	strpbrk.o		\
546	strrchr.o		\
547	strsep.o		\
548	strsignal.o		\
549	strspn.o		\
550	strstr.o		\
551	strtod.o		\
552	strtoimax.o		\
553	strtok.o		\
554	strtok_r.o		\
555	strtoumax.o		\
556	swab.o			\
557	swapctl.o		\
558	sysconf.o		\
559	syslog.o		\
560	tcdrain.o		\
561	tcflow.o		\
562	tcflush.o		\
563	tcgetattr.o		\
564	tcgetpgrp.o		\
565	tcgetsid.o		\
566	tcsendbreak.o		\
567	tcsetattr.o		\
568	tcsetpgrp.o		\
569	tell.o			\
570	telldir.o		\
571	tfind.o			\
572	time_data.o		\
573	time_gdata.o		\
574	timespec_get.o		\
575	tls_data.o		\
576	truncate.o		\
577	tsdalloc.o		\
578	tsearch.o		\
579	ttyname.o		\
580	ttyslot.o		\
581	ualarm.o		\
582	ucred.o			\
583	valloc.o		\
584	vlfmt.o			\
585	vpfmt.o			\
586	waitpid.o		\
587	walkstack.o		\
588	wdata.o			\
589	xgetwidth.o		\
590	xpg4.o			\
591	xpg6.o
592
593PORTPRINT_W=			\
594	doprnt_w.o
595
596PORTPRINT=			\
597	asprintf.o		\
598	doprnt.o		\
599	fprintf.o		\
600	printf.o		\
601	snprintf.o		\
602	sprintf.o		\
603	vfprintf.o		\
604	vprintf.o		\
605	vsnprintf.o		\
606	vsprintf.o		\
607	vwprintf.o		\
608	wprintf.o
609
610# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
611# This macro should ALWAYS be empty; native APIs are already 'large file'.
612PORTSTDIO64=
613
614PORTSTDIO_W=			\
615	doscan_w.o
616
617PORTSTDIO=			\
618	__extensions.o		\
619	_endopen.o		\
620	_filbuf.o		\
621	_findbuf.o		\
622	_flsbuf.o		\
623	_wrtchk.o		\
624	clearerr.o		\
625	ctermid.o		\
626	ctermid_r.o		\
627	cuserid.o		\
628	data.o			\
629	doscan.o		\
630	fdopen.o		\
631	feof.o			\
632	ferror.o		\
633	fgetc.o			\
634	fgets.o			\
635	fileno.o		\
636	flockf.o		\
637	flush.o			\
638	fopen.o			\
639	fpos.o			\
640	fputc.o			\
641	fputs.o			\
642	fread.o			\
643	fseek.o			\
644	fseeko.o		\
645	ftell.o			\
646	ftello.o		\
647	fwrite.o		\
648	getc.o			\
649	getchar.o		\
650	getline.o		\
651	getpass.o		\
652	gets.o			\
653	getw.o			\
654	mse.o			\
655	popen.o			\
656	putc.o			\
657	putchar.o		\
658	puts.o			\
659	putw.o			\
660	rewind.o		\
661	scanf.o			\
662	setbuf.o		\
663	setbuffer.o		\
664	setvbuf.o		\
665	system.o		\
666	tempnam.o		\
667	tmpfile.o		\
668	tmpnam_r.o		\
669	ungetc.o		\
670	vscanf.o		\
671	vwscanf.o		\
672	wscanf.o
673
674PORTI18N=			\
675	getwchar.o		\
676	putwchar.o		\
677	putws.o			\
678	strtows.o		\
679	wcsnlen.o		\
680	wcsstr.o		\
681	wcstoimax.o		\
682	wcstol.o		\
683	wcstoul.o		\
684	wcswcs.o		\
685	wmemchr.o		\
686	wmemcmp.o		\
687	wmemcpy.o		\
688	wmemmove.o		\
689	wmemset.o		\
690	wscat.o			\
691	wschr.o			\
692	wscmp.o			\
693	wscpy.o			\
694	wscspn.o		\
695	wsdup.o			\
696	wslen.o			\
697	wsncat.o		\
698	wsncmp.o		\
699	wsncpy.o		\
700	wspbrk.o		\
701	wsprintf.o		\
702	wsrchr.o		\
703	wsscanf.o		\
704	wsspn.o			\
705	wstod.o			\
706	wstok.o			\
707	wstol.o			\
708	wstoll.o		\
709	wsxfrm.o		\
710	gettext.o		\
711	gettext_gnu.o		\
712	gettext_real.o		\
713	gettext_util.o		\
714	plural_parser.o		\
715	wdresolve.o		\
716	_ctype.o		\
717	isascii.o		\
718	toascii.o
719
720PORTI18N_COND=			\
721	wcstol_longlong.o	\
722	wcstoul_longlong.o
723
724PORTLOCALE=			\
725	big5.o			\
726	btowc.o			\
727	collate.o		\
728	collcmp.o		\
729	euc.o			\
730	fnmatch.o		\
731	fgetwc.o		\
732	fgetws.o		\
733	fix_grouping.o		\
734	fputwc.o		\
735	fputws.o		\
736	fwide.o			\
737	gb18030.o		\
738	gb2312.o		\
739	gbk.o			\
740	getdate.o		\
741	isdigit.o		\
742	iswctype.o		\
743	ldpart.o		\
744	lmessages.o		\
745	lnumeric.o		\
746	lmonetary.o		\
747	localeconv.o		\
748	localeimpl.o		\
749	mbftowc.o		\
750	mblen.o			\
751	mbrlen.o		\
752	mbrtowc.o		\
753	mbsinit.o		\
754	mbsnrtowcs.o		\
755	mbsrtowcs.o		\
756	mbstowcs.o		\
757	mbtowc.o		\
758	mskanji.o		\
759	nextwctype.o		\
760	nl_langinfo.o		\
761	none.o			\
762	regcomp.o		\
763	regfree.o		\
764	regerror.o		\
765	regexec.o		\
766	rune.o			\
767	runetype.o		\
768	setlocale.o		\
769	setrunelocale.o		\
770	strcasecmp.o		\
771	strcasestr.o		\
772	strcoll.o		\
773	strfmon.o		\
774	strftime.o		\
775	strncasecmp.o		\
776	strptime.o		\
777	strxfrm.o		\
778	table.o			\
779	timelocal.o		\
780	tolower.o		\
781	towlower.o		\
782	ungetwc.o		\
783	utf8.o			\
784	wcrtomb.o		\
785	wcscasecmp.o		\
786	wcscoll.o		\
787	wcsftime.o		\
788	wcsnrtombs.o		\
789	wcsrtombs.o		\
790	wcswidth.o		\
791	wcstombs.o		\
792	wcsxfrm.o		\
793	wctob.o			\
794	wctomb.o		\
795	wctrans.o		\
796	wctype.o		\
797	wcwidth.o		\
798	wscol.o
799
800AIOOBJS=			\
801	aio.o			\
802	aio_alloc.o		\
803	posix_aio.o
804
805RTOBJS=				\
806	clock_timer.o		\
807	mqueue.o		\
808	pos4obj.o		\
809	sched.o			\
810	sem.o			\
811	shm.o			\
812	sigev_thread.o
813
814TPOOLOBJS=			\
815	thread_pool.o
816
817THREADSOBJS=			\
818	alloc.o			\
819	assfail.o		\
820	c11_thr.o		\
821	cancel.o		\
822	door_calls.o		\
823	tmem.o			\
824	pthr_attr.o		\
825	pthr_barrier.o		\
826	pthr_cond.o		\
827	pthr_mutex.o		\
828	pthr_rwlock.o		\
829	pthread.o		\
830	rwlock.o		\
831	scalls.o		\
832	sema.o			\
833	sigaction.o		\
834	spawn.o			\
835	synch.o			\
836	tdb_agent.o		\
837	thr.o			\
838	thread_interface.o	\
839	tls.o			\
840	tsd.o
841
842THREADSMACHOBJS=		\
843	machdep.o
844
845THREADSASMOBJS=			\
846	asm_subr.o
847
848UNICODEOBJS=			\
849	u8_textprep.o		\
850	uconv.o
851
852UNWINDMACHOBJS=			\
853	call_frame_inst.o	\
854	eh_frame.o		\
855	thrp_unwind.o		\
856	unwind.o
857
858pics/unwind.o:= COPTFLAG64 =
859
860UNWINDASMOBJS=			\
861	unwind_frame.o
862
863# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
864# This macro should ALWAYS be empty; native APIs are already 'large file'.
865PORTSYS64=
866
867PORTSYS=			\
868	_autofssys.o		\
869	access.o		\
870	acctctl.o		\
871	bsd_signal.o		\
872	chmod.o			\
873	chown.o			\
874	corectl.o		\
875	exacctsys.o		\
876	execl.o			\
877	execle.o		\
878	execv.o			\
879	fcntl.o			\
880	getpagesizes.o		\
881	getpeerucred.o		\
882	inst_sync.o		\
883	issetugid.o		\
884	label.o			\
885	link.o			\
886	lockf.o			\
887	lwp.o			\
888	lwp_cond.o		\
889	lwp_rwlock.o		\
890	lwp_sigmask.o		\
891	meminfosys.o		\
892	mkdir.o			\
893	mknod.o			\
894	msgsys.o		\
895	nfssys.o		\
896	open.o			\
897	pgrpsys.o		\
898	posix_sigwait.o		\
899	ppriv.o			\
900	psetsys.o		\
901	rctlsys.o		\
902	readlink.o		\
903	rename.o		\
904	sbrk.o			\
905	semsys.o		\
906	set_errno.o		\
907	sharefs.o		\
908	shmsys.o		\
909	sidsys.o		\
910	siginterrupt.o		\
911	signal.o		\
912	sigpending.o		\
913	sigstack.o		\
914	stat.o			\
915	symlink.o		\
916	tasksys.o		\
917	time.o			\
918	time_util.o		\
919	ucontext.o		\
920	unlink.o		\
921	ustat.o			\
922	utimesys.o		\
923	zone.o
924
925PORTREGEX=			\
926	glob.o			\
927	regcmp.o		\
928	regex.o			\
929	wordexp.o
930
931VALUES=				\
932	values-Xa.o
933
934MOSTOBJS=			\
935	$(STRETS)		\
936	$(CRTOBJS)		\
937	$(DYNOBJS)		\
938	$(FPOBJS)		\
939	$(I386FPOBJS)		\
940	$(FPASMOBJS)		\
941	$(ATOMICOBJS)		\
942	$(CHACHAOBJS)		\
943	$(XATTROBJS)		\
944	$(COMOBJS)		\
945	$(GENOBJS)		\
946	$(PORTFP)		\
947	$(PORTGEN)		\
948	$(PORTGEN64)		\
949	$(PORTI18N)		\
950	$(PORTI18N_COND)	\
951	$(PORTLOCALE)		\
952	$(PORTPRINT)		\
953	$(PORTPRINT_W)		\
954	$(PORTREGEX)		\
955	$(PORTSTDIO)		\
956	$(PORTSTDIO64)		\
957	$(PORTSTDIO_W)		\
958	$(PORTSYS)		\
959	$(PORTSYS64)		\
960	$(AIOOBJS)		\
961	$(RTOBJS)		\
962	$(TPOOLOBJS)		\
963	$(THREADSOBJS)		\
964	$(THREADSMACHOBJS)	\
965	$(THREADSASMOBJS)	\
966	$(UNICODEOBJS)		\
967	$(UNWINDMACHOBJS)	\
968	$(UNWINDASMOBJS)	\
969	$(COMSYSOBJS)		\
970	$(SYSOBJS)		\
971	$(COMSYSOBJS64)		\
972	$(SYSOBJS64)		\
973	$(VALUES)
974
975TRACEOBJS=			\
976	plockstat.o
977
978# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
979# modules whose source is provided in the $(SRC)/lib/common directory.
980# This must be done because otherwise the Sun C compiler would insert
981# its own versions of these modules and those versions contain code
982# to call out to C++ initialization functions.  Such C++ initialization
983# functions can call back into libc before thread initialization is
984# complete and this leads to segmentation violations and other problems.
985# Since libc contains no C++ code, linking with the minimal crti.o and
986# crtn.o modules is safe and avoids the problems described above.
987OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
988CRTSRCS= ../../common/amd64
989
990# include common library definitions
991include ../../Makefile.lib
992include ../../Makefile.lib.64
993
994CFLAGS64 += $(CTF_FLAGS)
995
996# This is necessary to avoid problems with calling _ex_unwind().
997# We probably don't want any inlining anyway.
998CFLAGS64 += -xinline=
999
1000CERRWARN += -_gcc=-Wno-parentheses
1001CERRWARN += -_gcc=-Wno-switch
1002CERRWARN += -_gcc=-Wno-uninitialized
1003CERRWARN += -_gcc=-Wno-unused-value
1004CERRWARN += -_gcc=-Wno-unused-label
1005CERRWARN += -_gcc=-Wno-unused-variable
1006CERRWARN += -_gcc=-Wno-type-limits
1007CERRWARN += -_gcc=-Wno-char-subscripts
1008CERRWARN += -_gcc=-Wno-clobbered
1009CERRWARN += -_gcc=-Wno-unused-function
1010CERRWARN += -_gcc=-Wno-address
1011
1012# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1013# enables ASSERT() checking in the threads portion of the library.
1014# This is automatically enabled for DEBUG builds, not for non-debug builds.
1015THREAD_DEBUG =
1016$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1017
1018# Make string literals read-only to save memory
1019CFLAGS64 += $(XSTRCONST)
1020
1021ALTPICS= $(TRACEOBJS:%=pics/%)
1022
1023$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1024
1025MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1026
1027CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
1028		-I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1029ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
1030		$(amd64_AS_XARCH)
1031
1032# As a favor to the dtrace syscall provider, libc still calls the
1033# old syscall traps that have been obsoleted by the *at() interfaces.
1034# Delete this to compile libc using only the new *at() system call traps
1035CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1036
1037# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
1038pics/proc64_id.o	:= CFLAGS64 += -I$(SRC)/uts/intel
1039
1040# Inform the run-time linker about libc specialized initialization
1041RTLDINFO =	-z rtldinfo=tls_rtldinfo
1042DYNFLAGS +=	$(RTLDINFO)
1043
1044# Force libc's internal references to be resolved immediately upon loading
1045# in order to avoid critical region problems.  Since almost all libc symbols
1046# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1047DYNFLAGS +=	-znow
1048
1049BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1050
1051# Override this top level flag so the compiler builds in its native
1052# C99 mode.  This has been enabled to support the complex arithmetic
1053# added to libc.
1054C99MODE=	$(C99_ENABLE)
1055
1056# libc method of building an archive
1057# The "$(GREP) -v ' L '" part is necessary only until
1058# lorder is fixed to ignore thread-local variables.
1059BUILD.AR= $(RM) $@ ; \
1060	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1061
1062# extra files for the clean target
1063CLEANFILES +=			\
1064	$(LIBCDIR)/port/gen/errlst.c	\
1065	$(LIBCDIR)/port/gen/new_list.c	\
1066	assym.h			\
1067	genassym		\
1068	crt/_rtld.s		\
1069	pics/crti.o		\
1070	pics/crtn.o		\
1071	$(ALTPICS)
1072
1073CLOBBERFILES +=	$(LIB_PIC)
1074
1075# list of C source for lint
1076SRCS=							\
1077	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1078	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1079	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1080	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
1081	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
1082	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
1083	$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)		\
1084	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
1085	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
1086	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
1087	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1088	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1089	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1090	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1091	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1092	$(THREADSMACHOBJS:%.o=threads/%.c)		\
1093	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1094	$(UNWINDMACHOBJS:%.o=unwind/%.c)		\
1095	$(FPOBJS:%.o=fp/%.c)				\
1096	$(I386FPOBJS:%.o=$(LIBCDIR)/i386/fp/%.c)		\
1097	$(LIBCBASE)/gen/ecvt.c				\
1098	$(LIBCBASE)/gen/makectxt.c			\
1099	$(LIBCBASE)/gen/siginfolst.c			\
1100	$(LIBCBASE)/gen/siglongjmp.c			\
1101	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1102	$(LIBCBASE)/sys/uadmin.c
1103
1104# conditional assignments
1105# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1106$(DYNLIB) := CRTI = crti.o
1107$(DYNLIB) := CRTN = crtn.o
1108
1109# Files which need the threads .il inline template
1110TIL=				\
1111	aio.o			\
1112	alloc.o			\
1113	assfail.o		\
1114	atexit.o		\
1115	atfork.o		\
1116	cancel.o		\
1117	door_calls.o		\
1118	err.o			\
1119	errno.o			\
1120	lwp.o			\
1121	ma.o			\
1122	machdep.o		\
1123	posix_aio.o		\
1124	pthr_attr.o		\
1125	pthr_barrier.o		\
1126	pthr_cond.o		\
1127	pthr_mutex.o		\
1128	pthr_rwlock.o		\
1129	pthread.o		\
1130	rand.o			\
1131	rwlock.o		\
1132	scalls.o		\
1133	sched.o			\
1134	sema.o			\
1135	sigaction.o		\
1136	sigev_thread.o		\
1137	spawn.o			\
1138	stack.o			\
1139	synch.o			\
1140	tdb_agent.o		\
1141	thr.o			\
1142	thread_interface.o	\
1143	thread_pool.o		\
1144	thrp_unwind.o		\
1145	tls.o			\
1146	tmem.o			\
1147	tsd.o
1148
1149$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1150
1151# pics/mul64.o := CFLAGS64 += crt/mul64.il
1152
1153# large-file-aware components that should be built large
1154
1155#$(COMSYSOBJS64:%=pics/%) := \
1156#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1157
1158#$(SYSOBJS64:%=pics/%) := \
1159#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1160
1161#$(PORTGEN64:%=pics/%) := \
1162#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1163
1164#$(PORTSTDIO64:%=pics/%) := \
1165#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1166
1167#$(PORTSYS64:%=pics/%) := \
1168#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1169
1170$(PORTSTDIO_W:%=pics/%) := \
1171	CPPFLAGS += -D_WIDE
1172
1173$(PORTPRINT_W:%=pics/%) := \
1174	CPPFLAGS += -D_WIDE
1175
1176$(PORTPRINT_C89:%=pics/%) := \
1177	CPPFLAGS += -D_C89_INTMAX32
1178
1179$(PORTSTDIO_C89:%=pics/%) := \
1180	CPPFLAGS += -D_C89_INTMAX32
1181
1182$(PORTI18N_COND:%=pics/%) := \
1183	CPPFLAGS += -D_WCS_LONGLONG
1184
1185pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1186
1187pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1188
1189.KEEP_STATE:
1190
1191all: $(LIBS) $(LIB_PIC)
1192
1193lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1194lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1195lint	:=	LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1196
1197lint:
1198	@echo $(LINT.c) ... $(LDLIBS)
1199	@$(LINT.c) $(SRCS) $(LDLIBS)
1200
1201$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1202$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1203$(LINTLIB):= LINTFLAGS64=-nvx -m64
1204
1205# object files that depend on inline template
1206$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1207# pics/mul64.o: crt/mul64.il
1208
1209# include common libc targets
1210include ../Makefile.targ
1211
1212# We need to strip out all CTF data from the static library
1213$(LIB_PIC) := DIR = pics
1214$(LIB_PIC): pics $$(PICS)
1215	$(BUILD.AR)
1216	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1217	$(AR) -ts $@ > /dev/null
1218	$(POST_PROCESS_A)
1219
1220ASSYMDEP_OBJS=			\
1221	_lwp_mutex_unlock.o	\
1222	_stack_grow.o		\
1223	asm_subr.o		\
1224	getcontext.o		\
1225	setjmp.o		\
1226	tls_get_addr.o		\
1227	vforkx.o
1228
1229$(ASSYMDEP_OBJS:%=pics/%): assym.h
1230
1231# assym.h build rules
1232
1233GENASSYM_C = genassym.c
1234
1235genassym: $(GENASSYM_C)
1236	$(NATIVECC) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.native)	\
1237		-o $@ $(GENASSYM_C)
1238
1239OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1240
1241assym.h: $(OFFSETS) genassym
1242	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1243	./genassym >>$@
1244
1245# derived C source and related explicit dependencies
1246$(LIBCDIR)/port/gen/errlst.c + \
1247$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1248	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1249
1250pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1251
1252pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1253