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