xref: /titanic_52/usr/src/lib/libc/amd64/Makefile (revision ccdeb6b6d71f3c9aa7e78b688f7b34fff109a817)
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	c16rtomb.o		\
729	c32rtomb.o		\
730	collate.o		\
731	collcmp.o		\
732	euc.o			\
733	fnmatch.o		\
734	fgetwc.o		\
735	fgetws.o		\
736	fix_grouping.o		\
737	fputwc.o		\
738	fputws.o		\
739	fwide.o			\
740	gb18030.o		\
741	gb2312.o		\
742	gbk.o			\
743	getdate.o		\
744	isdigit.o		\
745	iswctype.o		\
746	ldpart.o		\
747	lmessages.o		\
748	lnumeric.o		\
749	lmonetary.o		\
750	localeconv.o		\
751	localeimpl.o		\
752	mbftowc.o		\
753	mblen.o			\
754	mbrlen.o		\
755	mbrtoc16.o		\
756	mbrtoc32.o		\
757	mbrtowc.o		\
758	mbsinit.o		\
759	mbsnrtowcs.o		\
760	mbsrtowcs.o		\
761	mbstowcs.o		\
762	mbtowc.o		\
763	mskanji.o		\
764	nextwctype.o		\
765	nl_langinfo.o		\
766	none.o			\
767	regcomp.o		\
768	regfree.o		\
769	regerror.o		\
770	regexec.o		\
771	rune.o			\
772	runetype.o		\
773	setlocale.o		\
774	setrunelocale.o		\
775	strcasecmp.o		\
776	strcasestr.o		\
777	strcoll.o		\
778	strfmon.o		\
779	strftime.o		\
780	strncasecmp.o		\
781	strptime.o		\
782	strxfrm.o		\
783	table.o			\
784	timelocal.o		\
785	tolower.o		\
786	towlower.o		\
787	ungetwc.o		\
788	utf8.o			\
789	wcrtomb.o		\
790	wcscasecmp.o		\
791	wcscoll.o		\
792	wcsftime.o		\
793	wcsnrtombs.o		\
794	wcsrtombs.o		\
795	wcswidth.o		\
796	wcstombs.o		\
797	wcsxfrm.o		\
798	wctob.o			\
799	wctomb.o		\
800	wctrans.o		\
801	wctype.o		\
802	wcwidth.o		\
803	wscol.o
804
805AIOOBJS=			\
806	aio.o			\
807	aio_alloc.o		\
808	posix_aio.o
809
810RTOBJS=				\
811	clock_timer.o		\
812	mqueue.o		\
813	pos4obj.o		\
814	sched.o			\
815	sem.o			\
816	shm.o			\
817	sigev_thread.o
818
819TPOOLOBJS=			\
820	thread_pool.o
821
822THREADSOBJS=			\
823	alloc.o			\
824	assfail.o		\
825	c11_thr.o		\
826	cancel.o		\
827	door_calls.o		\
828	tmem.o			\
829	pthr_attr.o		\
830	pthr_barrier.o		\
831	pthr_cond.o		\
832	pthr_mutex.o		\
833	pthr_rwlock.o		\
834	pthread.o		\
835	rwlock.o		\
836	scalls.o		\
837	sema.o			\
838	sigaction.o		\
839	spawn.o			\
840	synch.o			\
841	tdb_agent.o		\
842	thr.o			\
843	thread_interface.o	\
844	tls.o			\
845	tsd.o
846
847THREADSMACHOBJS=		\
848	machdep.o
849
850THREADSASMOBJS=			\
851	asm_subr.o
852
853UNICODEOBJS=			\
854	u8_textprep.o		\
855	uconv.o
856
857UNWINDMACHOBJS=			\
858	call_frame_inst.o	\
859	eh_frame.o		\
860	thrp_unwind.o		\
861	unwind.o
862
863pics/unwind.o:= COPTFLAG64 =
864
865UNWINDASMOBJS=			\
866	unwind_frame.o
867
868# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
869# This macro should ALWAYS be empty; native APIs are already 'large file'.
870PORTSYS64=
871
872PORTSYS=			\
873	_autofssys.o		\
874	access.o		\
875	acctctl.o		\
876	bsd_signal.o		\
877	chmod.o			\
878	chown.o			\
879	corectl.o		\
880	epoll.o			\
881	exacctsys.o		\
882	execl.o			\
883	execle.o		\
884	execv.o			\
885	eventfd.o		\
886	fcntl.o			\
887	getpagesizes.o		\
888	getpeerucred.o		\
889	inst_sync.o		\
890	issetugid.o		\
891	label.o			\
892	link.o			\
893	lockf.o			\
894	lwp.o			\
895	lwp_cond.o		\
896	lwp_rwlock.o		\
897	lwp_sigmask.o		\
898	meminfosys.o		\
899	mkdir.o			\
900	mknod.o			\
901	msgsys.o		\
902	nfssys.o		\
903	open.o			\
904	pgrpsys.o		\
905	posix_sigwait.o		\
906	ppriv.o			\
907	psetsys.o		\
908	rctlsys.o		\
909	readlink.o		\
910	rename.o		\
911	sbrk.o			\
912	semsys.o		\
913	set_errno.o		\
914	sharefs.o		\
915	shmsys.o		\
916	sidsys.o		\
917	siginterrupt.o		\
918	signal.o		\
919	signalfd.o		\
920	sigpending.o		\
921	sigstack.o		\
922	stat.o			\
923	symlink.o		\
924	tasksys.o		\
925	time.o			\
926	time_util.o		\
927	timerfd.o		\
928	ucontext.o		\
929	unlink.o		\
930	ustat.o			\
931	utimesys.o		\
932	zone.o
933
934PORTREGEX=			\
935	glob.o			\
936	regcmp.o		\
937	regex.o			\
938	wordexp.o
939
940VALUES=				\
941	values-Xa.o
942
943MOSTOBJS=			\
944	$(STRETS)		\
945	$(CRTOBJS)		\
946	$(DYNOBJS)		\
947	$(FPOBJS)		\
948	$(I386FPOBJS)		\
949	$(FPASMOBJS)		\
950	$(ATOMICOBJS)		\
951	$(CHACHAOBJS)		\
952	$(XATTROBJS)		\
953	$(COMOBJS)		\
954	$(GENOBJS)		\
955	$(PORTFP)		\
956	$(PORTGEN)		\
957	$(PORTGEN64)		\
958	$(PORTI18N)		\
959	$(PORTI18N_COND)	\
960	$(PORTLOCALE)		\
961	$(PORTPRINT)		\
962	$(PORTPRINT_W)		\
963	$(PORTREGEX)		\
964	$(PORTSTDIO)		\
965	$(PORTSTDIO64)		\
966	$(PORTSTDIO_W)		\
967	$(PORTSYS)		\
968	$(PORTSYS64)		\
969	$(AIOOBJS)		\
970	$(RTOBJS)		\
971	$(TPOOLOBJS)		\
972	$(THREADSOBJS)		\
973	$(THREADSMACHOBJS)	\
974	$(THREADSASMOBJS)	\
975	$(UNICODEOBJS)		\
976	$(UNWINDMACHOBJS)	\
977	$(UNWINDASMOBJS)	\
978	$(COMSYSOBJS)		\
979	$(SYSOBJS)		\
980	$(COMSYSOBJS64)		\
981	$(SYSOBJS64)		\
982	$(VALUES)
983
984TRACEOBJS=			\
985	plockstat.o
986
987# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
988# modules whose source is provided in the $(SRC)/lib/crt directory.
989# This must be done because otherwise the Sun C compiler would insert
990# its own versions of these modules and those versions contain code
991# to call out to C++ initialization functions.  Such C++ initialization
992# functions can call back into libc before thread initialization is
993# complete and this leads to segmentation violations and other problems.
994# Since libc contains no C++ code, linking with the minimal crti.o and
995# crtn.o modules is safe and avoids the problems described above.
996OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
997CRTSRCS= ../../crt/amd64
998
999# include common library definitions
1000include ../../Makefile.lib
1001include ../../Makefile.lib.64
1002
1003CFLAGS64 += $(CTF_FLAGS)
1004
1005# This is necessary to avoid problems with calling _ex_unwind().
1006# We probably don't want any inlining anyway.
1007CFLAGS64 += -xinline=
1008
1009CERRWARN += -_gcc=-Wno-parentheses
1010CERRWARN += -_gcc=-Wno-switch
1011CERRWARN += -_gcc=-Wno-uninitialized
1012CERRWARN += -_gcc=-Wno-unused-value
1013CERRWARN += -_gcc=-Wno-unused-label
1014CERRWARN += -_gcc=-Wno-unused-variable
1015CERRWARN += -_gcc=-Wno-type-limits
1016CERRWARN += -_gcc=-Wno-char-subscripts
1017CERRWARN += -_gcc=-Wno-clobbered
1018CERRWARN += -_gcc=-Wno-unused-function
1019CERRWARN += -_gcc=-Wno-address
1020
1021# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1022# enables ASSERT() checking in the threads portion of the library.
1023# This is automatically enabled for DEBUG builds, not for non-debug builds.
1024THREAD_DEBUG =
1025$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1026
1027# Make string literals read-only to save memory
1028CFLAGS64 += $(XSTRCONST)
1029
1030ALTPICS= $(TRACEOBJS:%=pics/%)
1031
1032$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1033
1034MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1035
1036CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
1037		-I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1038ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
1039		$(amd64_AS_XARCH)
1040
1041# As a favor to the dtrace syscall provider, libc still calls the
1042# old syscall traps that have been obsoleted by the *at() interfaces.
1043# Delete this to compile libc using only the new *at() system call traps
1044CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1045
1046# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
1047pics/proc64_id.o	:= CFLAGS64 += -I$(SRC)/uts/intel
1048
1049# Inform the run-time linker about libc specialized initialization
1050RTLDINFO =	-z rtldinfo=tls_rtldinfo
1051DYNFLAGS +=	$(RTLDINFO)
1052
1053# Force libc's internal references to be resolved immediately upon loading
1054# in order to avoid critical region problems.  Since almost all libc symbols
1055# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1056DYNFLAGS +=	-znow
1057
1058BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1059
1060# Override this top level flag so the compiler builds in its native
1061# C99 mode.  This has been enabled to support the complex arithmetic
1062# added to libc.
1063C99MODE=	$(C99_ENABLE)
1064
1065# libc method of building an archive
1066# The "$(GREP) -v ' L '" part is necessary only until
1067# lorder is fixed to ignore thread-local variables.
1068BUILD.AR= $(RM) $@ ; \
1069	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1070
1071# extra files for the clean target
1072CLEANFILES +=			\
1073	$(LIBCDIR)/port/gen/errlst.c	\
1074	$(LIBCDIR)/port/gen/new_list.c	\
1075	assym.h			\
1076	genassym		\
1077	crt/_rtld.s		\
1078	pics/crti.o		\
1079	pics/crtn.o		\
1080	$(ALTPICS)
1081
1082CLOBBERFILES +=	$(LIB_PIC)
1083
1084# list of C source for lint
1085SRCS=							\
1086	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1087	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1088	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1089	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
1090	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
1091	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
1092	$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)		\
1093	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
1094	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
1095	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
1096	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1097	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1098	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1099	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1100	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1101	$(THREADSMACHOBJS:%.o=threads/%.c)		\
1102	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1103	$(UNWINDMACHOBJS:%.o=unwind/%.c)		\
1104	$(FPOBJS:%.o=fp/%.c)				\
1105	$(I386FPOBJS:%.o=$(LIBCDIR)/i386/fp/%.c)		\
1106	$(LIBCBASE)/gen/ecvt.c				\
1107	$(LIBCBASE)/gen/makectxt.c			\
1108	$(LIBCBASE)/gen/siginfolst.c			\
1109	$(LIBCBASE)/gen/siglongjmp.c			\
1110	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1111	$(LIBCBASE)/sys/uadmin.c
1112
1113# conditional assignments
1114# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1115$(DYNLIB) := CRTI = crti.o
1116$(DYNLIB) := CRTN = crtn.o
1117
1118# Files which need the threads .il inline template
1119TIL=				\
1120	aio.o			\
1121	alloc.o			\
1122	assfail.o		\
1123	atexit.o		\
1124	atfork.o		\
1125	cancel.o		\
1126	door_calls.o		\
1127	err.o			\
1128	errno.o			\
1129	lwp.o			\
1130	ma.o			\
1131	machdep.o		\
1132	posix_aio.o		\
1133	pthr_attr.o		\
1134	pthr_barrier.o		\
1135	pthr_cond.o		\
1136	pthr_mutex.o		\
1137	pthr_rwlock.o		\
1138	pthread.o		\
1139	rand.o			\
1140	rwlock.o		\
1141	scalls.o		\
1142	sched.o			\
1143	sema.o			\
1144	sigaction.o		\
1145	sigev_thread.o		\
1146	spawn.o			\
1147	stack.o			\
1148	synch.o			\
1149	tdb_agent.o		\
1150	thr.o			\
1151	thread_interface.o	\
1152	thread_pool.o		\
1153	thrp_unwind.o		\
1154	tls.o			\
1155	tmem.o			\
1156	tsd.o
1157
1158$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1159
1160# pics/mul64.o := CFLAGS64 += crt/mul64.il
1161
1162# large-file-aware components that should be built large
1163
1164#$(COMSYSOBJS64:%=pics/%) := \
1165#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1166
1167#$(SYSOBJS64:%=pics/%) := \
1168#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1169
1170#$(PORTGEN64:%=pics/%) := \
1171#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1172
1173#$(PORTSTDIO64:%=pics/%) := \
1174#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1175
1176#$(PORTSYS64:%=pics/%) := \
1177#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1178
1179$(PORTSTDIO_W:%=pics/%) := \
1180	CPPFLAGS += -D_WIDE
1181
1182$(PORTPRINT_W:%=pics/%) := \
1183	CPPFLAGS += -D_WIDE
1184
1185$(PORTPRINT_C89:%=pics/%) := \
1186	CPPFLAGS += -D_C89_INTMAX32
1187
1188$(PORTSTDIO_C89:%=pics/%) := \
1189	CPPFLAGS += -D_C89_INTMAX32
1190
1191$(PORTI18N_COND:%=pics/%) := \
1192	CPPFLAGS += -D_WCS_LONGLONG
1193
1194pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1195
1196pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1197
1198.KEEP_STATE:
1199
1200all: $(LIBS) $(LIB_PIC)
1201
1202lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1203lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1204lint	:=	LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1205
1206lint:
1207	@echo $(LINT.c) ... $(LDLIBS)
1208	@$(LINT.c) $(SRCS) $(LDLIBS)
1209
1210$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1211$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1212$(LINTLIB):= LINTFLAGS64=-nvx -m64
1213
1214# object files that depend on inline template
1215$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1216# pics/mul64.o: crt/mul64.il
1217
1218# include common libc targets
1219include ../Makefile.targ
1220
1221# We need to strip out all CTF data from the static library
1222$(LIB_PIC) := DIR = pics
1223$(LIB_PIC): pics $$(PICS)
1224	$(BUILD.AR)
1225	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1226	$(AR) -ts $@ > /dev/null
1227	$(POST_PROCESS_A)
1228
1229ASSYMDEP_OBJS=			\
1230	_lwp_mutex_unlock.o	\
1231	_stack_grow.o		\
1232	asm_subr.o		\
1233	getcontext.o		\
1234	setjmp.o		\
1235	tls_get_addr.o		\
1236	vforkx.o
1237
1238$(ASSYMDEP_OBJS:%=pics/%): assym.h
1239
1240# assym.h build rules
1241
1242GENASSYM_C = genassym.c
1243
1244genassym: $(GENASSYM_C)
1245	$(NATIVECC) $(NATIVE_CFLAGS) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.native) \
1246		-o $@ $(GENASSYM_C)
1247
1248OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1249
1250assym.h: $(OFFSETS) genassym
1251	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1252	./genassym >>$@
1253
1254# derived C source and related explicit dependencies
1255$(LIBCDIR)/port/gen/errlst.c + \
1256$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1257	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1258
1259pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1260
1261pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1262