xref: /titanic_50/usr/src/lib/libc/amd64/Makefile (revision f3e7f55e73a39377d55a030f124cc86b3b66a9cc)
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	flock.o			\
396	fls.o			\
397	fmtmsg.o		\
398	ftime.o			\
399	ftok.o			\
400	ftw.o			\
401	gcvt.o			\
402	getauxv.o		\
403	getcwd.o		\
404	getdate_err.o		\
405	getdtblsize.o		\
406	getentropy.o		\
407	getenv.o		\
408	getexecname.o		\
409	getgrnam.o		\
410	getgrnam_r.o		\
411	gethostid.o		\
412	gethostname.o		\
413	gethz.o			\
414	getisax.o		\
415	getloadavg.o		\
416	getlogin.o		\
417	getmntent.o		\
418	getnetgrent.o		\
419	get_nprocs.o		\
420	getopt.o		\
421	getopt_long.o		\
422	getpagesize.o		\
423	getpw.o			\
424	getpwnam.o		\
425	getpwnam_r.o		\
426	getrusage.o		\
427	getspent.o		\
428	getspent_r.o		\
429	getsubopt.o		\
430	gettxt.o		\
431	getusershell.o		\
432	getut.o			\
433	getutx.o		\
434	getvfsent.o		\
435	getwd.o			\
436	getwidth.o		\
437	getxby_door.o		\
438	gtxt.o			\
439	hsearch.o		\
440	iconv.o			\
441	imaxabs.o		\
442	imaxdiv.o		\
443	index.o			\
444	initgroups.o		\
445	insque.o		\
446	isaexec.o		\
447	isastream.o		\
448	isatty.o		\
449	killpg.o		\
450	klpdlib.o		\
451	l64a.o			\
452	lckpwdf.o		\
453	lconstants.o		\
454	lexp10.o		\
455	lfind.o			\
456	lfmt.o			\
457	lfmt_log.o		\
458	lldiv.o			\
459	llog10.o		\
460	lltostr.o		\
461	lmath.o			\
462	localtime.o		\
463	lsearch.o		\
464	madvise.o		\
465	malloc.o		\
466	memalign.o		\
467	memmem.o		\
468	mkdev.o			\
469	mkdtemp.o		\
470	mkfifo.o		\
471	mkstemp.o		\
472	mktemp.o		\
473	mlock.o			\
474	mlockall.o		\
475	mon.o			\
476	msync.o			\
477	munlock.o		\
478	munlockall.o		\
479	ndbm.o			\
480	nftw.o			\
481	nlspath_checks.o	\
482	nsparse.o		\
483	nss_common.o		\
484	nss_dbdefs.o		\
485	nss_deffinder.o		\
486	opendir.o		\
487	opt_data.o		\
488	perror.o		\
489	pfmt.o			\
490	pfmt_data.o		\
491	pfmt_print.o		\
492	pipe.o			\
493	plock.o			\
494	poll.o			\
495	posix_fadvise.o		\
496	posix_fallocate.o	\
497	posix_madvise.o		\
498	posix_memalign.o	\
499	priocntl.o		\
500	privlib.o		\
501	priv_str_xlate.o	\
502	psiginfo.o		\
503	psignal.o		\
504	pt.o			\
505	putpwent.o		\
506	putspent.o		\
507	raise.o			\
508	rand.o			\
509	random.o		\
510	rctlops.o		\
511	readdir.o		\
512	readdir_r.o		\
513	realpath.o		\
514	reboot.o		\
515	regexpr.o		\
516	remove.o		\
517	rewinddir.o		\
518	rindex.o		\
519	scandir.o		\
520	seekdir.o		\
521	select.o		\
522	setlabel.o		\
523	setpriority.o		\
524	settimeofday.o		\
525	sh_locks.o		\
526	sigflag.o		\
527	siglist.o		\
528	sigsend.o		\
529	sigsetops.o		\
530	ssignal.o		\
531	stack.o			\
532	stpcpy.o		\
533	stpncpy.o		\
534	str2sig.o		\
535	strcase_charmap.o	\
536	strcat.o		\
537	strchr.o		\
538	strchrnul.o		\
539	strcspn.o		\
540	strdup.o		\
541	strerror.o		\
542	strlcat.o		\
543	strlcpy.o		\
544	strncat.o		\
545	strndup.o		\
546	strpbrk.o		\
547	strrchr.o		\
548	strsep.o		\
549	strsignal.o		\
550	strspn.o		\
551	strstr.o		\
552	strtod.o		\
553	strtoimax.o		\
554	strtok.o		\
555	strtok_r.o		\
556	strtoumax.o		\
557	swab.o			\
558	swapctl.o		\
559	sysconf.o		\
560	syslog.o		\
561	tcdrain.o		\
562	tcflow.o		\
563	tcflush.o		\
564	tcgetattr.o		\
565	tcgetpgrp.o		\
566	tcgetsid.o		\
567	tcsendbreak.o		\
568	tcsetattr.o		\
569	tcsetpgrp.o		\
570	tell.o			\
571	telldir.o		\
572	tfind.o			\
573	time_data.o		\
574	time_gdata.o		\
575	timespec_get.o		\
576	tls_data.o		\
577	truncate.o		\
578	tsdalloc.o		\
579	tsearch.o		\
580	ttyname.o		\
581	ttyslot.o		\
582	ualarm.o		\
583	ucred.o			\
584	valloc.o		\
585	vlfmt.o			\
586	vpfmt.o			\
587	waitpid.o		\
588	walkstack.o		\
589	wdata.o			\
590	xgetwidth.o		\
591	xpg4.o			\
592	xpg6.o
593
594PORTPRINT_W=			\
595	doprnt_w.o
596
597PORTPRINT=			\
598	asprintf.o		\
599	doprnt.o		\
600	fprintf.o		\
601	printf.o		\
602	snprintf.o		\
603	sprintf.o		\
604	vfprintf.o		\
605	vprintf.o		\
606	vsnprintf.o		\
607	vsprintf.o		\
608	vwprintf.o		\
609	wprintf.o
610
611# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
612# This macro should ALWAYS be empty; native APIs are already 'large file'.
613PORTSTDIO64=
614
615PORTSTDIO_W=			\
616	doscan_w.o
617
618PORTSTDIO=			\
619	__extensions.o		\
620	_endopen.o		\
621	_filbuf.o		\
622	_findbuf.o		\
623	_flsbuf.o		\
624	_wrtchk.o		\
625	clearerr.o		\
626	ctermid.o		\
627	ctermid_r.o		\
628	cuserid.o		\
629	data.o			\
630	doscan.o		\
631	fdopen.o		\
632	feof.o			\
633	ferror.o		\
634	fgetc.o			\
635	fgets.o			\
636	fileno.o		\
637	flockf.o		\
638	flush.o			\
639	fopen.o			\
640	fpos.o			\
641	fputc.o			\
642	fputs.o			\
643	fread.o			\
644	fseek.o			\
645	fseeko.o		\
646	ftell.o			\
647	ftello.o		\
648	fwrite.o		\
649	getc.o			\
650	getchar.o		\
651	getline.o		\
652	getpass.o		\
653	gets.o			\
654	getw.o			\
655	mse.o			\
656	popen.o			\
657	putc.o			\
658	putchar.o		\
659	puts.o			\
660	putw.o			\
661	rewind.o		\
662	scanf.o			\
663	setbuf.o		\
664	setbuffer.o		\
665	setvbuf.o		\
666	system.o		\
667	tempnam.o		\
668	tmpfile.o		\
669	tmpnam_r.o		\
670	ungetc.o		\
671	vscanf.o		\
672	vwscanf.o		\
673	wscanf.o
674
675PORTI18N=			\
676	getwchar.o		\
677	putwchar.o		\
678	putws.o			\
679	strtows.o		\
680	wcsnlen.o		\
681	wcsstr.o		\
682	wcstoimax.o		\
683	wcstol.o		\
684	wcstoul.o		\
685	wcswcs.o		\
686	wmemchr.o		\
687	wmemcmp.o		\
688	wmemcpy.o		\
689	wmemmove.o		\
690	wmemset.o		\
691	wscat.o			\
692	wschr.o			\
693	wscmp.o			\
694	wscpy.o			\
695	wscspn.o		\
696	wsdup.o			\
697	wslen.o			\
698	wsncat.o		\
699	wsncmp.o		\
700	wsncpy.o		\
701	wspbrk.o		\
702	wsprintf.o		\
703	wsrchr.o		\
704	wsscanf.o		\
705	wsspn.o			\
706	wstod.o			\
707	wstok.o			\
708	wstol.o			\
709	wstoll.o		\
710	wsxfrm.o		\
711	gettext.o		\
712	gettext_gnu.o		\
713	gettext_real.o		\
714	gettext_util.o		\
715	plural_parser.o		\
716	wdresolve.o		\
717	_ctype.o		\
718	isascii.o		\
719	toascii.o
720
721PORTI18N_COND=			\
722	wcstol_longlong.o	\
723	wcstoul_longlong.o
724
725PORTLOCALE=			\
726	big5.o			\
727	btowc.o			\
728	collate.o		\
729	collcmp.o		\
730	euc.o			\
731	fnmatch.o		\
732	fgetwc.o		\
733	fgetws.o		\
734	fix_grouping.o		\
735	fputwc.o		\
736	fputws.o		\
737	fwide.o			\
738	gb18030.o		\
739	gb2312.o		\
740	gbk.o			\
741	getdate.o		\
742	isdigit.o		\
743	iswctype.o		\
744	ldpart.o		\
745	lmessages.o		\
746	lnumeric.o		\
747	lmonetary.o		\
748	localeconv.o		\
749	localeimpl.o		\
750	mbftowc.o		\
751	mblen.o			\
752	mbrlen.o		\
753	mbrtowc.o		\
754	mbsinit.o		\
755	mbsnrtowcs.o		\
756	mbsrtowcs.o		\
757	mbstowcs.o		\
758	mbtowc.o		\
759	mskanji.o		\
760	nextwctype.o		\
761	nl_langinfo.o		\
762	none.o			\
763	regcomp.o		\
764	regfree.o		\
765	regerror.o		\
766	regexec.o		\
767	rune.o			\
768	runetype.o		\
769	setlocale.o		\
770	setrunelocale.o		\
771	strcasecmp.o		\
772	strcasestr.o		\
773	strcoll.o		\
774	strfmon.o		\
775	strftime.o		\
776	strncasecmp.o		\
777	strptime.o		\
778	strxfrm.o		\
779	table.o			\
780	timelocal.o		\
781	tolower.o		\
782	towlower.o		\
783	ungetwc.o		\
784	utf8.o			\
785	wcrtomb.o		\
786	wcscasecmp.o		\
787	wcscoll.o		\
788	wcsftime.o		\
789	wcsnrtombs.o		\
790	wcsrtombs.o		\
791	wcswidth.o		\
792	wcstombs.o		\
793	wcsxfrm.o		\
794	wctob.o			\
795	wctomb.o		\
796	wctrans.o		\
797	wctype.o		\
798	wcwidth.o		\
799	wscol.o
800
801AIOOBJS=			\
802	aio.o			\
803	aio_alloc.o		\
804	posix_aio.o
805
806RTOBJS=				\
807	clock_timer.o		\
808	mqueue.o		\
809	pos4obj.o		\
810	sched.o			\
811	sem.o			\
812	shm.o			\
813	sigev_thread.o
814
815TPOOLOBJS=			\
816	thread_pool.o
817
818THREADSOBJS=			\
819	alloc.o			\
820	assfail.o		\
821	c11_thr.o		\
822	cancel.o		\
823	door_calls.o		\
824	tmem.o			\
825	pthr_attr.o		\
826	pthr_barrier.o		\
827	pthr_cond.o		\
828	pthr_mutex.o		\
829	pthr_rwlock.o		\
830	pthread.o		\
831	rwlock.o		\
832	scalls.o		\
833	sema.o			\
834	sigaction.o		\
835	spawn.o			\
836	synch.o			\
837	tdb_agent.o		\
838	thr.o			\
839	thread_interface.o	\
840	tls.o			\
841	tsd.o
842
843THREADSMACHOBJS=		\
844	machdep.o
845
846THREADSASMOBJS=			\
847	asm_subr.o
848
849UNICODEOBJS=			\
850	u8_textprep.o		\
851	uconv.o
852
853UNWINDMACHOBJS=			\
854	call_frame_inst.o	\
855	eh_frame.o		\
856	thrp_unwind.o		\
857	unwind.o
858
859pics/unwind.o:= COPTFLAG64 =
860
861UNWINDASMOBJS=			\
862	unwind_frame.o
863
864# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
865# This macro should ALWAYS be empty; native APIs are already 'large file'.
866PORTSYS64=
867
868PORTSYS=			\
869	_autofssys.o		\
870	access.o		\
871	acctctl.o		\
872	bsd_signal.o		\
873	chmod.o			\
874	chown.o			\
875	corectl.o		\
876	epoll.o			\
877	exacctsys.o		\
878	execl.o			\
879	execle.o		\
880	execv.o			\
881	eventfd.o		\
882	fcntl.o			\
883	getpagesizes.o		\
884	getpeerucred.o		\
885	inst_sync.o		\
886	issetugid.o		\
887	label.o			\
888	link.o			\
889	lockf.o			\
890	lwp.o			\
891	lwp_cond.o		\
892	lwp_rwlock.o		\
893	lwp_sigmask.o		\
894	meminfosys.o		\
895	mkdir.o			\
896	mknod.o			\
897	msgsys.o		\
898	nfssys.o		\
899	open.o			\
900	pgrpsys.o		\
901	posix_sigwait.o		\
902	ppriv.o			\
903	psetsys.o		\
904	rctlsys.o		\
905	readlink.o		\
906	rename.o		\
907	sbrk.o			\
908	semsys.o		\
909	set_errno.o		\
910	sharefs.o		\
911	shmsys.o		\
912	sidsys.o		\
913	siginterrupt.o		\
914	signal.o		\
915	signalfd.o		\
916	sigpending.o		\
917	sigstack.o		\
918	stat.o			\
919	symlink.o		\
920	tasksys.o		\
921	time.o			\
922	time_util.o		\
923	timerfd.o		\
924	ucontext.o		\
925	unlink.o		\
926	ustat.o			\
927	utimesys.o		\
928	zone.o
929
930PORTREGEX=			\
931	glob.o			\
932	regcmp.o		\
933	regex.o			\
934	wordexp.o
935
936VALUES=				\
937	values-Xa.o
938
939MOSTOBJS=			\
940	$(STRETS)		\
941	$(CRTOBJS)		\
942	$(DYNOBJS)		\
943	$(FPOBJS)		\
944	$(I386FPOBJS)		\
945	$(FPASMOBJS)		\
946	$(ATOMICOBJS)		\
947	$(CHACHAOBJS)		\
948	$(XATTROBJS)		\
949	$(COMOBJS)		\
950	$(GENOBJS)		\
951	$(PORTFP)		\
952	$(PORTGEN)		\
953	$(PORTGEN64)		\
954	$(PORTI18N)		\
955	$(PORTI18N_COND)	\
956	$(PORTLOCALE)		\
957	$(PORTPRINT)		\
958	$(PORTPRINT_W)		\
959	$(PORTREGEX)		\
960	$(PORTSTDIO)		\
961	$(PORTSTDIO64)		\
962	$(PORTSTDIO_W)		\
963	$(PORTSYS)		\
964	$(PORTSYS64)		\
965	$(AIOOBJS)		\
966	$(RTOBJS)		\
967	$(TPOOLOBJS)		\
968	$(THREADSOBJS)		\
969	$(THREADSMACHOBJS)	\
970	$(THREADSASMOBJS)	\
971	$(UNICODEOBJS)		\
972	$(UNWINDMACHOBJS)	\
973	$(UNWINDASMOBJS)	\
974	$(COMSYSOBJS)		\
975	$(SYSOBJS)		\
976	$(COMSYSOBJS64)		\
977	$(SYSOBJS64)		\
978	$(VALUES)
979
980TRACEOBJS=			\
981	plockstat.o
982
983# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
984# modules whose source is provided in the $(SRC)/lib/crt directory.
985# This must be done because otherwise the Sun C compiler would insert
986# its own versions of these modules and those versions contain code
987# to call out to C++ initialization functions.  Such C++ initialization
988# functions can call back into libc before thread initialization is
989# complete and this leads to segmentation violations and other problems.
990# Since libc contains no C++ code, linking with the minimal crti.o and
991# crtn.o modules is safe and avoids the problems described above.
992OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
993CRTSRCS= ../../crt/amd64
994
995# include common library definitions
996include ../../Makefile.lib
997include ../../Makefile.lib.64
998
999CFLAGS64 += $(CTF_FLAGS)
1000
1001# This is necessary to avoid problems with calling _ex_unwind().
1002# We probably don't want any inlining anyway.
1003CFLAGS64 += -xinline=
1004
1005CERRWARN += -_gcc=-Wno-parentheses
1006CERRWARN += -_gcc=-Wno-switch
1007CERRWARN += -_gcc=-Wno-uninitialized
1008CERRWARN += -_gcc=-Wno-unused-value
1009CERRWARN += -_gcc=-Wno-unused-label
1010CERRWARN += -_gcc=-Wno-unused-variable
1011CERRWARN += -_gcc=-Wno-type-limits
1012CERRWARN += -_gcc=-Wno-char-subscripts
1013CERRWARN += -_gcc=-Wno-clobbered
1014CERRWARN += -_gcc=-Wno-unused-function
1015CERRWARN += -_gcc=-Wno-address
1016
1017# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1018# enables ASSERT() checking in the threads portion of the library.
1019# This is automatically enabled for DEBUG builds, not for non-debug builds.
1020THREAD_DEBUG =
1021$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1022
1023# Make string literals read-only to save memory
1024CFLAGS64 += $(XSTRCONST)
1025
1026ALTPICS= $(TRACEOBJS:%=pics/%)
1027
1028$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1029
1030MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1031
1032CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
1033		-I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1034ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
1035		$(amd64_AS_XARCH)
1036
1037# As a favor to the dtrace syscall provider, libc still calls the
1038# old syscall traps that have been obsoleted by the *at() interfaces.
1039# Delete this to compile libc using only the new *at() system call traps
1040CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1041
1042# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
1043pics/proc64_id.o	:= CFLAGS64 += -I$(SRC)/uts/intel
1044
1045# Inform the run-time linker about libc specialized initialization
1046RTLDINFO =	-z rtldinfo=tls_rtldinfo
1047DYNFLAGS +=	$(RTLDINFO)
1048
1049# Force libc's internal references to be resolved immediately upon loading
1050# in order to avoid critical region problems.  Since almost all libc symbols
1051# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1052DYNFLAGS +=	-znow
1053
1054BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1055
1056# Override this top level flag so the compiler builds in its native
1057# C99 mode.  This has been enabled to support the complex arithmetic
1058# added to libc.
1059C99MODE=	$(C99_ENABLE)
1060
1061# libc method of building an archive
1062# The "$(GREP) -v ' L '" part is necessary only until
1063# lorder is fixed to ignore thread-local variables.
1064BUILD.AR= $(RM) $@ ; \
1065	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1066
1067# extra files for the clean target
1068CLEANFILES +=			\
1069	$(LIBCDIR)/port/gen/errlst.c	\
1070	$(LIBCDIR)/port/gen/new_list.c	\
1071	assym.h			\
1072	genassym		\
1073	crt/_rtld.s		\
1074	pics/crti.o		\
1075	pics/crtn.o		\
1076	$(ALTPICS)
1077
1078CLOBBERFILES +=	$(LIB_PIC)
1079
1080# list of C source for lint
1081SRCS=							\
1082	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1083	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1084	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1085	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
1086	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
1087	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
1088	$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)		\
1089	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
1090	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
1091	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
1092	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1093	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1094	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1095	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1096	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1097	$(THREADSMACHOBJS:%.o=threads/%.c)		\
1098	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1099	$(UNWINDMACHOBJS:%.o=unwind/%.c)		\
1100	$(FPOBJS:%.o=fp/%.c)				\
1101	$(I386FPOBJS:%.o=$(LIBCDIR)/i386/fp/%.c)		\
1102	$(LIBCBASE)/gen/ecvt.c				\
1103	$(LIBCBASE)/gen/makectxt.c			\
1104	$(LIBCBASE)/gen/siginfolst.c			\
1105	$(LIBCBASE)/gen/siglongjmp.c			\
1106	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1107	$(LIBCBASE)/sys/uadmin.c
1108
1109# conditional assignments
1110# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1111$(DYNLIB) := CRTI = crti.o
1112$(DYNLIB) := CRTN = crtn.o
1113
1114# Files which need the threads .il inline template
1115TIL=				\
1116	aio.o			\
1117	alloc.o			\
1118	assfail.o		\
1119	atexit.o		\
1120	atfork.o		\
1121	cancel.o		\
1122	door_calls.o		\
1123	err.o			\
1124	errno.o			\
1125	lwp.o			\
1126	ma.o			\
1127	machdep.o		\
1128	posix_aio.o		\
1129	pthr_attr.o		\
1130	pthr_barrier.o		\
1131	pthr_cond.o		\
1132	pthr_mutex.o		\
1133	pthr_rwlock.o		\
1134	pthread.o		\
1135	rand.o			\
1136	rwlock.o		\
1137	scalls.o		\
1138	sched.o			\
1139	sema.o			\
1140	sigaction.o		\
1141	sigev_thread.o		\
1142	spawn.o			\
1143	stack.o			\
1144	synch.o			\
1145	tdb_agent.o		\
1146	thr.o			\
1147	thread_interface.o	\
1148	thread_pool.o		\
1149	thrp_unwind.o		\
1150	tls.o			\
1151	tmem.o			\
1152	tsd.o
1153
1154$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1155
1156# pics/mul64.o := CFLAGS64 += crt/mul64.il
1157
1158# large-file-aware components that should be built large
1159
1160#$(COMSYSOBJS64:%=pics/%) := \
1161#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1162
1163#$(SYSOBJS64:%=pics/%) := \
1164#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1165
1166#$(PORTGEN64:%=pics/%) := \
1167#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1168
1169#$(PORTSTDIO64:%=pics/%) := \
1170#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1171
1172#$(PORTSYS64:%=pics/%) := \
1173#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1174
1175$(PORTSTDIO_W:%=pics/%) := \
1176	CPPFLAGS += -D_WIDE
1177
1178$(PORTPRINT_W:%=pics/%) := \
1179	CPPFLAGS += -D_WIDE
1180
1181$(PORTPRINT_C89:%=pics/%) := \
1182	CPPFLAGS += -D_C89_INTMAX32
1183
1184$(PORTSTDIO_C89:%=pics/%) := \
1185	CPPFLAGS += -D_C89_INTMAX32
1186
1187$(PORTI18N_COND:%=pics/%) := \
1188	CPPFLAGS += -D_WCS_LONGLONG
1189
1190pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1191
1192pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1193
1194.KEEP_STATE:
1195
1196all: $(LIBS) $(LIB_PIC)
1197
1198lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1199lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1200lint	:=	LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1201
1202lint:
1203	@echo $(LINT.c) ... $(LDLIBS)
1204	@$(LINT.c) $(SRCS) $(LDLIBS)
1205
1206$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1207$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1208$(LINTLIB):= LINTFLAGS64=-nvx -m64
1209
1210# object files that depend on inline template
1211$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1212# pics/mul64.o: crt/mul64.il
1213
1214# include common libc targets
1215include ../Makefile.targ
1216
1217# We need to strip out all CTF data from the static library
1218$(LIB_PIC) := DIR = pics
1219$(LIB_PIC): pics $$(PICS)
1220	$(BUILD.AR)
1221	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1222	$(AR) -ts $@ > /dev/null
1223	$(POST_PROCESS_A)
1224
1225ASSYMDEP_OBJS=			\
1226	_lwp_mutex_unlock.o	\
1227	_stack_grow.o		\
1228	asm_subr.o		\
1229	getcontext.o		\
1230	setjmp.o		\
1231	tls_get_addr.o		\
1232	vforkx.o
1233
1234$(ASSYMDEP_OBJS:%=pics/%): assym.h
1235
1236# assym.h build rules
1237
1238GENASSYM_C = genassym.c
1239
1240genassym: $(GENASSYM_C)
1241	$(NATIVECC) $(NATIVE_CFLAGS) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.native) \
1242		-o $@ $(GENASSYM_C)
1243
1244OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1245
1246assym.h: $(OFFSETS) genassym
1247	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1248	./genassym >>$@
1249
1250# derived C source and related explicit dependencies
1251$(LIBCDIR)/port/gen/errlst.c + \
1252$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1253	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1254
1255pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1256
1257pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1258