xref: /titanic_52/usr/src/lib/libc/amd64/Makefile (revision fe494262fb30ffb29de20a9ce15e8033bf704750)
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 (c) 2015, Joyent, Inc. All rights reserved.
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	errlst.o		\
124	amd64_data.o		\
125	ldivide.o		\
126	lock.o			\
127	makectxt.o		\
128	memccpy.o		\
129	memchr.o		\
130	memcmp.o		\
131	memcpy.o		\
132	memset.o		\
133	new_list.o		\
134	proc64_id.o		\
135	proc64_support.o	\
136	setjmp.o		\
137	siginfolst.o		\
138	siglongjmp.o		\
139	strcmp.o		\
140	strcpy.o		\
141	strlen.o		\
142	strncmp.o		\
143	strncpy.o		\
144	strnlen.o		\
145	sync_instruction_memory.o
146
147# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
148# This macro should ALWAYS be empty; native APIs are already 'large file'.
149COMSYSOBJS64=
150
151SYSOBJS64=
152
153COMSYSOBJS=			\
154	__clock_timer.o		\
155	__getloadavg.o		\
156	__rusagesys.o		\
157	__signotify.o		\
158	__sigrt.o		\
159	__time.o		\
160	_lgrp_home_fast.o	\
161	_lgrpsys.o		\
162	_nfssys.o		\
163	_portfs.o		\
164	_pset.o			\
165	_rpcsys.o		\
166	_sigaction.o		\
167	_so_accept.o		\
168	_so_bind.o		\
169	_so_connect.o		\
170	_so_getpeername.o	\
171	_so_getsockname.o	\
172	_so_getsockopt.o	\
173	_so_listen.o		\
174	_so_recv.o		\
175	_so_recvfrom.o		\
176	_so_recvmsg.o		\
177	_so_send.o		\
178	_so_sendmsg.o		\
179	_so_sendto.o		\
180	_so_setsockopt.o	\
181	_so_shutdown.o		\
182	_so_socket.o		\
183	_so_socketpair.o	\
184	_sockconfig.o		\
185	acct.o			\
186	acl.o			\
187	adjtime.o		\
188	alarm.o			\
189	brk.o			\
190	chdir.o			\
191	chroot.o		\
192	cladm.o			\
193	close.o			\
194	execve.o		\
195	exit.o			\
196	facl.o			\
197	fchdir.o		\
198	fchroot.o		\
199	fdsync.o		\
200	fpathconf.o		\
201	fstatfs.o		\
202	fstatvfs.o		\
203	getcpuid.o		\
204	getdents.o		\
205	getegid.o		\
206	geteuid.o		\
207	getgid.o		\
208	getgroups.o		\
209	gethrtime.o		\
210	getitimer.o		\
211	getmsg.o		\
212	getpid.o		\
213	getpmsg.o		\
214	getppid.o		\
215	getrandom.o		\
216	getrlimit.o		\
217	getuid.o		\
218	gtty.o			\
219	install_utrap.o		\
220	ioctl.o			\
221	kaio.o			\
222	kill.o			\
223	llseek.o		\
224	lseek.o			\
225	mmapobjsys.o		\
226	memcntl.o		\
227	mincore.o		\
228	mmap.o			\
229	modctl.o		\
230	mount.o			\
231	mprotect.o		\
232	munmap.o		\
233	nice.o			\
234	ntp_adjtime.o		\
235	ntp_gettime.o		\
236	p_online.o		\
237	pathconf.o		\
238	pause.o			\
239	pcsample.o		\
240	pipe2.o			\
241	pollsys.o		\
242	pread.o			\
243	preadv.o		\
244	priocntlset.o		\
245	processor_bind.o	\
246	processor_info.o	\
247	profil.o		\
248	putmsg.o		\
249	putpmsg.o		\
250	pwrite.o		\
251	pwritev.o		\
252	read.o			\
253	readv.o			\
254	resolvepath.o		\
255	seteguid.o		\
256	setgid.o		\
257	setgroups.o		\
258	setitimer.o		\
259	setreid.o		\
260	setrlimit.o		\
261	setuid.o		\
262	sigaltstk.o		\
263	sigprocmsk.o		\
264	sigsendset.o		\
265	sigsuspend.o		\
266	statfs.o		\
267	statvfs.o		\
268	stty.o			\
269	sync.o			\
270	sysconfig.o		\
271	sysfs.o			\
272	sysinfo.o		\
273	syslwp.o		\
274	times.o			\
275	ulimit.o		\
276	umask.o			\
277	umount2.o		\
278	utssys.o		\
279	uucopy.o		\
280	vhangup.o		\
281	waitid.o		\
282	write.o			\
283	writev.o		\
284	yield.o
285
286SYSOBJS=			\
287	__clock_gettime.o	\
288	__clock_gettime_sys.o	\
289	__getcontext.o		\
290	__uadmin.o		\
291	_lwp_mutex_unlock.o	\
292	_stack_grow.o		\
293	door.o			\
294	forkx.o			\
295	forkallx.o		\
296	getcontext.o		\
297	gettimeofday.o		\
298	lwp_private.o		\
299	nuname.o		\
300	syscall.o		\
301	sysi86.o		\
302	tls_get_addr.o		\
303	uadmin.o		\
304	umount.o		\
305	uname.o			\
306	vforkx.o
307
308# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
309# This macro should ALWAYS be empty; native APIs are already 'large file'.
310PORTGEN64=
311
312# objects from source under $(LIBCDIR)/port
313PORTFP=				\
314	__flt_decim.o		\
315	__flt_rounds.o		\
316	__tbl_10_b.o		\
317	__tbl_10_h.o		\
318	__tbl_10_s.o		\
319	__tbl_2_b.o		\
320	__tbl_2_h.o		\
321	__tbl_2_s.o		\
322	__tbl_fdq.o		\
323	__tbl_tens.o		\
324	__x_power.o		\
325	_base_sup.o		\
326	aconvert.o		\
327	decimal_bin.o		\
328	double_decim.o		\
329	econvert.o		\
330	fconvert.o		\
331	file_decim.o		\
332	finite.o		\
333	fp_data.o		\
334	func_decim.o		\
335	gconvert.o		\
336	hex_bin.o		\
337	ieee_globals.o		\
338	pack_float.o		\
339	sigfpe.o		\
340	string_decim.o
341
342PORTGEN=			\
343	_env_data.o		\
344	_xftw.o			\
345	a64l.o			\
346	abort.o			\
347	addsev.o		\
348	ascii_strcasecmp.o	\
349	ascii_strncasecmp.o	\
350	assert.o		\
351	atof.o			\
352	atoi.o			\
353	atol.o			\
354	atoll.o			\
355	attropen.o		\
356	atexit.o		\
357	atfork.o		\
358	basename.o		\
359	calloc.o		\
360	catgets.o		\
361	catopen.o		\
362	cfgetispeed.o		\
363	cfgetospeed.o		\
364	cfree.o			\
365	cfsetispeed.o		\
366	cfsetospeed.o		\
367	cftime.o		\
368	clock.o			\
369	closedir.o		\
370	closefrom.o		\
371	confstr.o		\
372	crypt.o			\
373	csetlen.o		\
374	ctime.o			\
375	ctime_r.o		\
376	daemon.o		\
377	deflt.o			\
378	directio.o		\
379	dirname.o		\
380	div.o			\
381	drand48.o		\
382	dup.o			\
383	env_data.o		\
384	err.o			\
385	errno.o			\
386	euclen.o		\
387	event_port.o		\
388	execvp.o		\
389	explicit_bzero.o	\
390	fattach.o		\
391	fdetach.o		\
392	fdopendir.o		\
393	ffs.o			\
394	flock.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	tls_data.o		\
575	truncate.o		\
576	tsdalloc.o		\
577	tsearch.o		\
578	ttyname.o		\
579	ttyslot.o		\
580	ualarm.o		\
581	ucred.o			\
582	valloc.o		\
583	vlfmt.o			\
584	vpfmt.o			\
585	waitpid.o		\
586	walkstack.o		\
587	wdata.o			\
588	xgetwidth.o		\
589	xpg4.o			\
590	xpg6.o
591
592PORTPRINT_W=			\
593	doprnt_w.o
594
595PORTPRINT=			\
596	asprintf.o		\
597	doprnt.o		\
598	fprintf.o		\
599	printf.o		\
600	snprintf.o		\
601	sprintf.o		\
602	vfprintf.o		\
603	vprintf.o		\
604	vsnprintf.o		\
605	vsprintf.o		\
606	vwprintf.o		\
607	wprintf.o
608
609# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
610# This macro should ALWAYS be empty; native APIs are already 'large file'.
611PORTSTDIO64=
612
613PORTSTDIO_W=			\
614	doscan_w.o
615
616PORTSTDIO=			\
617	__extensions.o		\
618	_endopen.o		\
619	_filbuf.o		\
620	_findbuf.o		\
621	_flsbuf.o		\
622	_wrtchk.o		\
623	clearerr.o		\
624	ctermid.o		\
625	ctermid_r.o		\
626	cuserid.o		\
627	data.o			\
628	doscan.o		\
629	fdopen.o		\
630	feof.o			\
631	ferror.o		\
632	fgetc.o			\
633	fgets.o			\
634	fileno.o		\
635	flockf.o		\
636	flush.o			\
637	fopen.o			\
638	fpos.o			\
639	fputc.o			\
640	fputs.o			\
641	fread.o			\
642	fseek.o			\
643	fseeko.o		\
644	ftell.o			\
645	ftello.o		\
646	fwrite.o		\
647	getc.o			\
648	getchar.o		\
649	getline.o		\
650	getpass.o		\
651	gets.o			\
652	getw.o			\
653	mse.o			\
654	popen.o			\
655	putc.o			\
656	putchar.o		\
657	puts.o			\
658	putw.o			\
659	rewind.o		\
660	scanf.o			\
661	setbuf.o		\
662	setbuffer.o		\
663	setvbuf.o		\
664	system.o		\
665	tempnam.o		\
666	tmpfile.o		\
667	tmpnam_r.o		\
668	ungetc.o		\
669	vscanf.o		\
670	vwscanf.o		\
671	wscanf.o
672
673PORTI18N=			\
674	getwchar.o		\
675	putwchar.o		\
676	putws.o			\
677	strtows.o		\
678	wcsnlen.o		\
679	wcsstr.o		\
680	wcstoimax.o		\
681	wcstol.o		\
682	wcstoul.o		\
683	wcswcs.o		\
684	wmemchr.o		\
685	wmemcmp.o		\
686	wmemcpy.o		\
687	wmemmove.o		\
688	wmemset.o		\
689	wscat.o			\
690	wschr.o			\
691	wscmp.o			\
692	wscpy.o			\
693	wscspn.o		\
694	wsdup.o			\
695	wslen.o			\
696	wsncat.o		\
697	wsncmp.o		\
698	wsncpy.o		\
699	wspbrk.o		\
700	wsprintf.o		\
701	wsrchr.o		\
702	wsscanf.o		\
703	wsspn.o			\
704	wstod.o			\
705	wstok.o			\
706	wstol.o			\
707	wstoll.o		\
708	wsxfrm.o		\
709	gettext.o		\
710	gettext_gnu.o		\
711	gettext_real.o		\
712	gettext_util.o		\
713	plural_parser.o		\
714	wdresolve.o		\
715	_ctype.o		\
716	isascii.o		\
717	toascii.o
718
719PORTI18N_COND=			\
720	wcstol_longlong.o	\
721	wcstoul_longlong.o
722
723PORTLOCALE=			\
724	big5.o			\
725	btowc.o			\
726	collate.o		\
727	collcmp.o		\
728	euc.o			\
729	fnmatch.o		\
730	fgetwc.o		\
731	fgetws.o		\
732	fix_grouping.o		\
733	fputwc.o		\
734	fputws.o		\
735	fwide.o			\
736	gb18030.o		\
737	gb2312.o		\
738	gbk.o			\
739	getdate.o		\
740	isdigit.o		\
741	iswctype.o		\
742	ldpart.o		\
743	lmessages.o		\
744	lnumeric.o		\
745	lmonetary.o		\
746	localeconv.o		\
747	localeimpl.o		\
748	mbftowc.o		\
749	mblen.o			\
750	mbrlen.o		\
751	mbrtowc.o		\
752	mbsinit.o		\
753	mbsnrtowcs.o		\
754	mbsrtowcs.o		\
755	mbstowcs.o		\
756	mbtowc.o		\
757	mskanji.o		\
758	nextwctype.o		\
759	nl_langinfo.o		\
760	none.o			\
761	regcomp.o		\
762	regfree.o		\
763	regerror.o		\
764	regexec.o		\
765	rune.o			\
766	runetype.o		\
767	setlocale.o		\
768	setrunelocale.o		\
769	strcasecmp.o		\
770	strcasestr.o		\
771	strcoll.o		\
772	strfmon.o		\
773	strftime.o		\
774	strncasecmp.o		\
775	strptime.o		\
776	strxfrm.o		\
777	table.o			\
778	timelocal.o		\
779	tolower.o		\
780	towlower.o		\
781	ungetwc.o		\
782	utf8.o			\
783	wcrtomb.o		\
784	wcscasecmp.o		\
785	wcscoll.o		\
786	wcsftime.o		\
787	wcsnrtombs.o		\
788	wcsrtombs.o		\
789	wcswidth.o		\
790	wcstombs.o		\
791	wcsxfrm.o		\
792	wctob.o			\
793	wctomb.o		\
794	wctrans.o		\
795	wctype.o		\
796	wcwidth.o		\
797	wscol.o
798
799AIOOBJS=			\
800	aio.o			\
801	aio_alloc.o		\
802	posix_aio.o
803
804RTOBJS=				\
805	clock_timer.o		\
806	mqueue.o		\
807	pos4obj.o		\
808	sched.o			\
809	sem.o			\
810	shm.o			\
811	sigev_thread.o
812
813TPOOLOBJS=			\
814	thread_pool.o
815
816THREADSOBJS=			\
817	alloc.o			\
818	assfail.o		\
819	cancel.o		\
820	door_calls.o		\
821	tmem.o			\
822	pthr_attr.o		\
823	pthr_barrier.o		\
824	pthr_cond.o		\
825	pthr_mutex.o		\
826	pthr_rwlock.o		\
827	pthread.o		\
828	rwlock.o		\
829	scalls.o		\
830	sema.o			\
831	sigaction.o		\
832	spawn.o			\
833	synch.o			\
834	tdb_agent.o		\
835	thr.o			\
836	thread_interface.o	\
837	tls.o			\
838	tsd.o
839
840THREADSMACHOBJS=		\
841	machdep.o
842
843THREADSASMOBJS=			\
844	asm_subr.o
845
846UNICODEOBJS=			\
847	u8_textprep.o		\
848	uconv.o
849
850UNWINDMACHOBJS=			\
851	call_frame_inst.o	\
852	eh_frame.o		\
853	thrp_unwind.o		\
854	unwind.o
855
856pics/unwind.o:= COPTFLAG64 =
857
858UNWINDASMOBJS=			\
859	unwind_frame.o
860
861# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
862# This macro should ALWAYS be empty; native APIs are already 'large file'.
863PORTSYS64=
864
865PORTSYS=			\
866	_autofssys.o		\
867	access.o		\
868	acctctl.o		\
869	bsd_signal.o		\
870	chmod.o			\
871	chown.o			\
872	corectl.o		\
873	epoll.o			\
874	exacctsys.o		\
875	execl.o			\
876	execle.o		\
877	execv.o			\
878	eventfd.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	signalfd.o		\
913	sigpending.o		\
914	sigstack.o		\
915	stat.o			\
916	symlink.o		\
917	tasksys.o		\
918	time.o			\
919	time_util.o		\
920	timerfd.o		\
921	ucontext.o		\
922	unlink.o		\
923	ustat.o			\
924	utimesys.o		\
925	zone.o
926
927PORTREGEX=			\
928	glob.o			\
929	regcmp.o		\
930	regex.o			\
931	wordexp.o
932
933VALUES=				\
934	values-Xa.o
935
936MOSTOBJS=			\
937	$(STRETS)		\
938	$(CRTOBJS)		\
939	$(DYNOBJS)		\
940	$(FPOBJS)		\
941	$(I386FPOBJS)		\
942	$(FPASMOBJS)		\
943	$(ATOMICOBJS)		\
944	$(CHACHAOBJS)		\
945	$(XATTROBJS)		\
946	$(COMOBJS)		\
947	$(GENOBJS)		\
948	$(PORTFP)		\
949	$(PORTGEN)		\
950	$(PORTGEN64)		\
951	$(PORTI18N)		\
952	$(PORTI18N_COND)	\
953	$(PORTLOCALE)		\
954	$(PORTPRINT)		\
955	$(PORTPRINT_W)		\
956	$(PORTREGEX)		\
957	$(PORTSTDIO)		\
958	$(PORTSTDIO64)		\
959	$(PORTSTDIO_W)		\
960	$(PORTSYS)		\
961	$(PORTSYS64)		\
962	$(AIOOBJS)		\
963	$(RTOBJS)		\
964	$(TPOOLOBJS)		\
965	$(THREADSOBJS)		\
966	$(THREADSMACHOBJS)	\
967	$(THREADSASMOBJS)	\
968	$(UNICODEOBJS)		\
969	$(UNWINDMACHOBJS)	\
970	$(UNWINDASMOBJS)	\
971	$(COMSYSOBJS)		\
972	$(SYSOBJS)		\
973	$(COMSYSOBJS64)		\
974	$(SYSOBJS64)		\
975	$(VALUES)
976
977TRACEOBJS=			\
978	plockstat.o
979
980# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
981# modules whose source is provided in the $(SRC)/lib/common directory.
982# This must be done because otherwise the Sun C compiler would insert
983# its own versions of these modules and those versions contain code
984# to call out to C++ initialization functions.  Such C++ initialization
985# functions can call back into libc before thread initialization is
986# complete and this leads to segmentation violations and other problems.
987# Since libc contains no C++ code, linking with the minimal crti.o and
988# crtn.o modules is safe and avoids the problems described above.
989OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
990CRTSRCS= ../../common/amd64
991
992# include common library definitions
993include ../../Makefile.lib
994include ../../Makefile.lib.64
995
996CFLAGS64 += $(CTF_FLAGS)
997
998# This is necessary to avoid problems with calling _ex_unwind().
999# We probably don't want any inlining anyway.
1000CFLAGS64 += -xinline=
1001
1002CERRWARN += -_gcc=-Wno-parentheses
1003CERRWARN += -_gcc=-Wno-switch
1004CERRWARN += -_gcc=-Wno-uninitialized
1005CERRWARN += -_gcc=-Wno-unused-value
1006CERRWARN += -_gcc=-Wno-unused-label
1007CERRWARN += -_gcc=-Wno-unused-variable
1008CERRWARN += -_gcc=-Wno-type-limits
1009CERRWARN += -_gcc=-Wno-char-subscripts
1010CERRWARN += -_gcc=-Wno-clobbered
1011CERRWARN += -_gcc=-Wno-unused-function
1012CERRWARN += -_gcc=-Wno-address
1013
1014# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1015# enables ASSERT() checking in the threads portion of the library.
1016# This is automatically enabled for DEBUG builds, not for non-debug builds.
1017THREAD_DEBUG =
1018$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1019
1020# Make string literals read-only to save memory
1021CFLAGS64 += $(XSTRCONST)
1022
1023ALTPICS= $(TRACEOBJS:%=pics/%)
1024
1025$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1026
1027MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1028
1029CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
1030		-I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1031ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
1032		$(amd64_AS_XARCH)
1033
1034# As a favor to the dtrace syscall provider, libc still calls the
1035# old syscall traps that have been obsoleted by the *at() interfaces.
1036# Delete this to compile libc using only the new *at() system call traps
1037CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1038
1039# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
1040pics/proc64_id.o	:= CFLAGS64 += -I$(SRC)/uts/intel
1041
1042# Inform the run-time linker about libc specialized initialization
1043RTLDINFO =	-z rtldinfo=tls_rtldinfo
1044DYNFLAGS +=	$(RTLDINFO)
1045
1046# Force libc's internal references to be resolved immediately upon loading
1047# in order to avoid critical region problems.  Since almost all libc symbols
1048# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1049DYNFLAGS +=	-znow
1050
1051BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1052
1053# Override this top level flag so the compiler builds in its native
1054# C99 mode.  This has been enabled to support the complex arithmetic
1055# added to libc.
1056C99MODE=	$(C99_ENABLE)
1057
1058# libc method of building an archive
1059# The "$(GREP) -v ' L '" part is necessary only until
1060# lorder is fixed to ignore thread-local variables.
1061BUILD.AR= $(RM) $@ ; \
1062	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1063
1064# extra files for the clean target
1065CLEANFILES +=			\
1066	$(LIBCDIR)/port/gen/errlst.c	\
1067	$(LIBCDIR)/port/gen/new_list.c	\
1068	assym.h			\
1069	genassym		\
1070	crt/_rtld.s		\
1071	pics/crti.o		\
1072	pics/crtn.o		\
1073	$(ALTPICS)
1074
1075CLOBBERFILES +=	$(LIB_PIC)
1076
1077# list of C source for lint
1078SRCS=							\
1079	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1080	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1081	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1082	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
1083	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
1084	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
1085	$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)		\
1086	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
1087	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
1088	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
1089	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1090	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1091	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1092	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1093	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1094	$(THREADSMACHOBJS:%.o=threads/%.c)		\
1095	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1096	$(UNWINDMACHOBJS:%.o=unwind/%.c)		\
1097	$(FPOBJS:%.o=fp/%.c)				\
1098	$(I386FPOBJS:%.o=$(LIBCDIR)/i386/fp/%.c)		\
1099	$(LIBCBASE)/gen/ecvt.c				\
1100	$(LIBCBASE)/gen/makectxt.c			\
1101	$(LIBCBASE)/gen/siginfolst.c			\
1102	$(LIBCBASE)/gen/siglongjmp.c			\
1103	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1104	$(LIBCBASE)/sys/uadmin.c
1105
1106# conditional assignments
1107# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1108$(DYNLIB) := CRTI = crti.o
1109$(DYNLIB) := CRTN = crtn.o
1110
1111# Files which need the threads .il inline template
1112TIL=				\
1113	aio.o			\
1114	alloc.o			\
1115	assfail.o		\
1116	atexit.o		\
1117	atfork.o		\
1118	cancel.o		\
1119	door_calls.o		\
1120	err.o			\
1121	errno.o			\
1122	lwp.o			\
1123	ma.o			\
1124	machdep.o		\
1125	posix_aio.o		\
1126	pthr_attr.o		\
1127	pthr_barrier.o		\
1128	pthr_cond.o		\
1129	pthr_mutex.o		\
1130	pthr_rwlock.o		\
1131	pthread.o		\
1132	rand.o			\
1133	rwlock.o		\
1134	scalls.o		\
1135	sched.o			\
1136	sema.o			\
1137	sigaction.o		\
1138	sigev_thread.o		\
1139	spawn.o			\
1140	stack.o			\
1141	synch.o			\
1142	tdb_agent.o		\
1143	thr.o			\
1144	thread_interface.o	\
1145	thread_pool.o		\
1146	thrp_unwind.o		\
1147	tls.o			\
1148	tmem.o			\
1149	tsd.o
1150
1151$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1152
1153# pics/mul64.o := CFLAGS64 += crt/mul64.il
1154
1155# large-file-aware components that should be built large
1156
1157#$(COMSYSOBJS64:%=pics/%) := \
1158#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1159
1160#$(SYSOBJS64:%=pics/%) := \
1161#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1162
1163#$(PORTGEN64:%=pics/%) := \
1164#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1165
1166#$(PORTSTDIO64:%=pics/%) := \
1167#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1168
1169#$(PORTSYS64:%=pics/%) := \
1170#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1171
1172$(PORTSTDIO_W:%=pics/%) := \
1173	CPPFLAGS += -D_WIDE
1174
1175$(PORTPRINT_W:%=pics/%) := \
1176	CPPFLAGS += -D_WIDE
1177
1178$(PORTPRINT_C89:%=pics/%) := \
1179	CPPFLAGS += -D_C89_INTMAX32
1180
1181$(PORTSTDIO_C89:%=pics/%) := \
1182	CPPFLAGS += -D_C89_INTMAX32
1183
1184$(PORTI18N_COND:%=pics/%) := \
1185	CPPFLAGS += -D_WCS_LONGLONG
1186
1187pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1188
1189pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1190
1191.KEEP_STATE:
1192
1193all: $(LIBS) $(LIB_PIC)
1194
1195lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1196lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1197lint	:=	LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1198
1199lint:
1200	@echo $(LINT.c) ... $(LDLIBS)
1201	@$(LINT.c) $(SRCS) $(LDLIBS)
1202
1203$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1204$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1205$(LINTLIB):= LINTFLAGS64=-nvx -m64
1206
1207# object files that depend on inline template
1208$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1209# pics/mul64.o: crt/mul64.il
1210
1211# include common libc targets
1212include ../Makefile.targ
1213
1214# We need to strip out all CTF data from the static library
1215$(LIB_PIC) := DIR = pics
1216$(LIB_PIC): pics $$(PICS)
1217	$(BUILD.AR)
1218	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1219	$(AR) -ts $@ > /dev/null
1220	$(POST_PROCESS_A)
1221
1222ASSYMDEP_OBJS=			\
1223	_lwp_mutex_unlock.o	\
1224	_stack_grow.o		\
1225	asm_subr.o		\
1226	getcontext.o		\
1227	setjmp.o		\
1228	tls_get_addr.o		\
1229	vforkx.o
1230
1231$(ASSYMDEP_OBJS:%=pics/%): assym.h
1232
1233# assym.h build rules
1234
1235GENASSYM_C = genassym.c
1236
1237genassym: $(GENASSYM_C)
1238	$(NATIVECC) $(NATIVE_CFLAGS) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.native) \
1239		-o $@ $(GENASSYM_C)
1240
1241OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1242
1243assym.h: $(OFFSETS) genassym
1244	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1245	./genassym >>$@
1246
1247# derived C source and related explicit dependencies
1248$(LIBCDIR)/port/gen/errlst.c + \
1249$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1250	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1251
1252pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1253
1254pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1255