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