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