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