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