xref: /illumos-gate/usr/src/lib/libc/i386/Makefile.com (revision 148434206d3ba623dff65e4b591dffc0ddadebf3)
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
37VALUES=		values-Xa.o
38
39# objects are grouped by source directory
40
41# local objects
42STRETS=
43
44CRTOBJS=			\
45	cerror.o		\
46	cerror64.o
47
48DYNOBJS=			\
49	_rtbootld.o
50
51FPOBJS=				\
52	_D_cplx_div.o		\
53	_D_cplx_div_ix.o	\
54	_D_cplx_div_rx.o	\
55	_D_cplx_lr_div.o	\
56	_D_cplx_lr_div_ix.o	\
57	_D_cplx_lr_div_rx.o	\
58	_D_cplx_mul.o		\
59	_F_cplx_div.o		\
60	_F_cplx_div_ix.o	\
61	_F_cplx_div_rx.o	\
62	_F_cplx_lr_div.o	\
63	_F_cplx_lr_div_ix.o	\
64	_F_cplx_lr_div_rx.o	\
65	_F_cplx_mul.o		\
66	_X_cplx_div.o		\
67	_X_cplx_div_ix.o	\
68	_X_cplx_div_rx.o	\
69	_X_cplx_lr_div.o	\
70	_X_cplx_lr_div_ix.o	\
71	_X_cplx_lr_div_rx.o	\
72	_X_cplx_mul.o		\
73	fpgetmask.o		\
74	fpgetround.o		\
75	fpgetsticky.o		\
76	fpsetmask.o		\
77	fpsetround.o		\
78	fpsetsticky.o		\
79	fpstart.o		\
80	ieee.o
81
82FPASMOBJS=			\
83	__xgetRD.o		\
84	_base_il.o		\
85	_xtoll.o		\
86	_xtoull.o		\
87	fpcw.o
88
89ATOMICOBJS=			\
90	atomic.o
91
92CHACHAOBJS=			\
93	chacha.o
94
95XATTROBJS=			\
96	xattr_common.o
97
98COMOBJS=			\
99	bcmp.o			\
100	bcopy.o			\
101	bsearch.o		\
102	bzero.o			\
103	qsort.o			\
104	strtol.o		\
105	strtoul.o		\
106	strtoll.o		\
107	strtoull.o
108
109DTRACEOBJS=			\
110	dtrace_data.o
111
112SECFLAGSOBJS=			\
113	secflags.o
114
115GENOBJS=			\
116	_div64.o		\
117	_divdi3.o		\
118	_getsp.o		\
119	_mul64.o		\
120	abs.o			\
121	alloca.o		\
122	arc4random.o		\
123	arc4random_uniform.o	\
124	byteorder.o		\
125	byteorder64.o		\
126	cuexit.o		\
127	ecvt.o			\
128	endian.o		\
129	errlst.o		\
130	i386_data.o		\
131	ladd.o			\
132	ldivide.o		\
133	lmul.o			\
134	lock.o			\
135	lshiftl.o		\
136	lsign.o			\
137	lsub.o			\
138	makectxt.o		\
139	memccpy.o		\
140	memchr.o		\
141	memcmp.o		\
142	memcpy.o		\
143	memset.o		\
144	new_list.o		\
145	setjmp.o		\
146	siginfolst.o		\
147	siglongjmp.o		\
148	strcat.o		\
149	strchr.o		\
150	strcmp.o		\
151	strcpy.o		\
152	strlen.o		\
153	strncat.o		\
154	strncmp.o		\
155	strncpy.o		\
156	strnlen.o		\
157	strrchr.o		\
158	sync_instruction_memory.o
159
160# sysobjs that contain large-file interfaces
161COMSYSOBJS64=			\
162	fstatvfs64.o		\
163	getdents64.o		\
164	getrlimit64.o		\
165	lseek64.o		\
166	mmap64.o		\
167	pread64.o		\
168	preadv64.o		\
169	pwrite64.o		\
170	pwritev64.o		\
171	setrlimit64.o		\
172	statvfs64.o
173
174SYSOBJS64=
175
176COMSYSOBJS=			\
177	__clock_timer.o		\
178	__getloadavg.o		\
179	__rusagesys.o		\
180	__signotify.o		\
181	__sigrt.o		\
182	__time.o		\
183	_lgrp_home_fast.o	\
184	_lgrpsys.o		\
185	_nfssys.o		\
186	_portfs.o		\
187	_pset.o			\
188	_rpcsys.o		\
189	_sigaction.o		\
190	_so_accept.o		\
191	_so_bind.o		\
192	_so_connect.o		\
193	_so_getpeername.o	\
194	_so_getsockname.o	\
195	_so_getsockopt.o	\
196	_so_listen.o		\
197	_so_recv.o		\
198	_so_recvfrom.o		\
199	_so_recvmsg.o		\
200	_so_send.o		\
201	_so_sendmsg.o		\
202	_so_sendto.o		\
203	_so_setsockopt.o	\
204	_so_shutdown.o		\
205	_so_socket.o		\
206	_so_socketpair.o	\
207	_sockconfig.o		\
208	acct.o			\
209	acl.o			\
210	adjtime.o		\
211	alarm.o			\
212	brk.o			\
213	chdir.o			\
214	chroot.o		\
215	cladm.o			\
216	close.o			\
217	execve.o		\
218	exit.o			\
219	facl.o			\
220	fchdir.o		\
221	fchroot.o		\
222	fdsync.o		\
223	fpathconf.o		\
224	fstatfs.o		\
225	fstatvfs.o		\
226	getcpuid.o		\
227	getdents.o		\
228	getegid.o		\
229	geteuid.o		\
230	getgid.o		\
231	getgroups.o		\
232	gethrtime.o		\
233	getitimer.o		\
234	getmsg.o		\
235	getpid.o		\
236	getpmsg.o		\
237	getppid.o		\
238	getrandom.o		\
239	getrlimit.o		\
240	getuid.o		\
241	gtty.o			\
242	install_utrap.o		\
243	ioctl.o			\
244	kaio.o			\
245	kill.o			\
246	llseek.o		\
247	lseek.o			\
248	mmapobjsys.o		\
249	memcntl.o		\
250	mincore.o		\
251	mmap.o			\
252	modctl.o		\
253	mount.o			\
254	mprotect.o		\
255	munmap.o		\
256	nice.o			\
257	ntp_adjtime.o		\
258	ntp_gettime.o		\
259	p_online.o		\
260	pathconf.o		\
261	pause.o			\
262	pcsample.o		\
263	pipe2.o			\
264	pollsys.o		\
265	pread.o			\
266	preadv.o		\
267	priocntlset.o		\
268	processor_bind.o	\
269	processor_info.o	\
270	profil.o		\
271	psecflagsset.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	__getcontext.o		\
313	__uadmin.o		\
314	_lwp_mutex_unlock.o	\
315	_stack_grow.o		\
316	door.o			\
317	forkx.o			\
318	forkallx.o		\
319	getcontext.o		\
320	gettimeofday.o		\
321	lwp_private.o		\
322	nuname.o		\
323	ptrace.o		\
324	syscall.o		\
325	sysi86.o		\
326	tls_get_addr.o		\
327	uadmin.o		\
328	umount.o		\
329	uname.o			\
330	vforkx.o		\
331	xstat.o
332
333# objects under $(LIBCDIR)/port which contain transitional large file interfaces
334PORTGEN64=			\
335	_xftw64.o		\
336	attropen64.o		\
337	ftw64.o			\
338	mkstemp64.o		\
339	nftw64.o		\
340	tell64.o		\
341	truncate64.o
342
343# objects from source under $(LIBCDIR)/port
344PORTFP=				\
345	__flt_decim.o		\
346	__flt_rounds.o		\
347	__tbl_10_b.o		\
348	__tbl_10_h.o		\
349	__tbl_10_s.o		\
350	__tbl_2_b.o		\
351	__tbl_2_h.o		\
352	__tbl_2_s.o		\
353	__tbl_fdq.o		\
354	__tbl_tens.o		\
355	__x_power.o		\
356	_base_sup.o		\
357	aconvert.o		\
358	decimal_bin.o		\
359	double_decim.o		\
360	econvert.o		\
361	fconvert.o		\
362	file_decim.o		\
363	finite.o		\
364	fp_data.o		\
365	func_decim.o		\
366	gconvert.o		\
367	hex_bin.o		\
368	ieee_globals.o		\
369	pack_float.o		\
370	sigfpe.o		\
371	string_decim.o
372
373PORTGEN=			\
374	_env_data.o		\
375	_xftw.o			\
376	a64l.o			\
377	abort.o			\
378	addsev.o		\
379	ascii_strcasecmp.o	\
380	ascii_strncasecmp.o	\
381	assert.o		\
382	atof.o			\
383	atoi.o			\
384	atol.o			\
385	atoll.o			\
386	attrat.o		\
387	attropen.o		\
388	atexit.o		\
389	atfork.o		\
390	basename.o		\
391	calloc.o		\
392	catgets.o		\
393	catopen.o		\
394	cfgetispeed.o		\
395	cfgetospeed.o		\
396	cfree.o			\
397	cfsetispeed.o		\
398	cfsetospeed.o		\
399	cftime.o		\
400	clock.o			\
401	closedir.o		\
402	closefrom.o		\
403	confstr.o		\
404	crypt.o			\
405	csetlen.o		\
406	ctime.o			\
407	ctime_r.o		\
408	daemon.o		\
409	deflt.o			\
410	directio.o		\
411	dirname.o		\
412	div.o			\
413	drand48.o		\
414	dup.o			\
415	env_data.o		\
416	err.o			\
417	errno.o			\
418	euclen.o		\
419	event_port.o		\
420	execvp.o		\
421	explicit_bzero.o	\
422	fattach.o		\
423	fdetach.o		\
424	fdopendir.o		\
425	ffs.o			\
426	flock.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	psecflags.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	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	timespec_get.o		\
604	tls_data.o		\
605	truncate.o		\
606	tsdalloc.o		\
607	tsearch.o		\
608	ttyname.o		\
609	ttyslot.o		\
610	ualarm.o		\
611	ucred.o			\
612	valloc.o		\
613	vlfmt.o			\
614	vpfmt.o			\
615	waitpid.o		\
616	walkstack.o		\
617	wdata.o			\
618	xgetwidth.o		\
619	xpg4.o			\
620	xpg6.o
621
622PORTPRINT_W=			\
623	doprnt_w.o
624
625PORTPRINT=			\
626	asprintf.o		\
627	doprnt.o		\
628	fprintf.o		\
629	printf.o		\
630	snprintf.o		\
631	sprintf.o		\
632	vfprintf.o		\
633	vprintf.o		\
634	vsnprintf.o		\
635	vsprintf.o		\
636	vwprintf.o		\
637	wprintf.o
638
639# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
640PORTPRINT_C89=			\
641	vfprintf_c89.o		\
642	vprintf_c89.o		\
643	vsnprintf_c89.o		\
644	vsprintf_c89.o		\
645	vwprintf_c89.o
646
647PORTSTDIO_C89=			\
648	vscanf_c89.o		\
649	vwscanf_c89.o		\
650
651# portable stdio objects that contain large file interfaces.
652# Note: fopen64 is a special case, as we build it small.
653PORTSTDIO64=			\
654	fopen64.o		\
655	fpos64.o
656
657PORTSTDIO_W=			\
658	doscan_w.o
659
660PORTSTDIO=			\
661	__extensions.o		\
662	_endopen.o		\
663	_filbuf.o		\
664	_findbuf.o		\
665	_flsbuf.o		\
666	_wrtchk.o		\
667	clearerr.o		\
668	ctermid.o		\
669	ctermid_r.o		\
670	cuserid.o		\
671	data.o			\
672	doscan.o		\
673	fdopen.o		\
674	feof.o			\
675	ferror.o		\
676	fgetc.o			\
677	fgets.o			\
678	fileno.o		\
679	flockf.o		\
680	flush.o			\
681	fopen.o			\
682	fpos.o			\
683	fputc.o			\
684	fputs.o			\
685	fread.o			\
686	fseek.o			\
687	fseeko.o		\
688	ftell.o			\
689	ftello.o		\
690	fwrite.o		\
691	getc.o			\
692	getchar.o		\
693	getline.o		\
694	getpass.o		\
695	gets.o			\
696	getw.o			\
697	mse.o			\
698	popen.o			\
699	putc.o			\
700	putchar.o		\
701	puts.o			\
702	putw.o			\
703	rewind.o		\
704	scanf.o			\
705	setbuf.o		\
706	setbuffer.o		\
707	setvbuf.o		\
708	system.o		\
709	tempnam.o		\
710	tmpfile.o		\
711	tmpnam_r.o		\
712	ungetc.o		\
713	vscanf.o		\
714	vwscanf.o		\
715	wscanf.o
716
717PORTI18N=			\
718	getwchar.o		\
719	putwchar.o		\
720	putws.o			\
721	strtows.o		\
722	wcsnlen.o		\
723	wcsstr.o		\
724	wcstoimax.o		\
725	wcstol.o		\
726	wcstoul.o		\
727	wcswcs.o		\
728	wmemchr.o		\
729	wmemcmp.o		\
730	wmemcpy.o		\
731	wmemmove.o		\
732	wmemset.o		\
733	wscat.o			\
734	wschr.o			\
735	wscmp.o			\
736	wscpy.o			\
737	wscspn.o		\
738	wsdup.o			\
739	wslen.o			\
740	wsncat.o		\
741	wsncmp.o		\
742	wsncpy.o		\
743	wspbrk.o		\
744	wsprintf.o		\
745	wsrchr.o		\
746	wsscanf.o		\
747	wsspn.o			\
748	wstod.o			\
749	wstok.o			\
750	wstol.o			\
751	wstoll.o		\
752	wsxfrm.o		\
753	gettext.o		\
754	gettext_gnu.o		\
755	gettext_real.o		\
756	gettext_util.o		\
757	plural_parser.o		\
758	wdresolve.o		\
759	_ctype.o		\
760	isascii.o		\
761	toascii.o
762
763PORTI18N_COND=			\
764	wcstol_longlong.o	\
765	wcstoul_longlong.o
766
767PORTLOCALE=			\
768	big5.o			\
769	btowc.o			\
770	collate.o		\
771	collcmp.o		\
772	euc.o			\
773	fnmatch.o		\
774	fgetwc.o		\
775	fgetws.o		\
776	fix_grouping.o		\
777	fputwc.o		\
778	fputws.o		\
779	fwide.o			\
780	gb18030.o		\
781	gb2312.o		\
782	gbk.o			\
783	getdate.o		\
784	isdigit.o		\
785	iswctype.o		\
786	ldpart.o		\
787	lmessages.o		\
788	lnumeric.o		\
789	lmonetary.o		\
790	localeconv.o		\
791	localeimpl.o		\
792	mbftowc.o		\
793	mblen.o			\
794	mbrlen.o		\
795	mbrtowc.o		\
796	mbsinit.o		\
797	mbsnrtowcs.o		\
798	mbsrtowcs.o		\
799	mbstowcs.o		\
800	mbtowc.o		\
801	mskanji.o		\
802	nextwctype.o		\
803	nl_langinfo.o		\
804	none.o			\
805	regcomp.o		\
806	regfree.o		\
807	regerror.o		\
808	regexec.o		\
809	rune.o			\
810	runetype.o		\
811	setlocale.o		\
812	setrunelocale.o		\
813	strcasecmp.o		\
814	strcasestr.o		\
815	strcoll.o		\
816	strfmon.o		\
817	strftime.o		\
818	strncasecmp.o		\
819	strptime.o		\
820	strxfrm.o		\
821	table.o			\
822	timelocal.o		\
823	tolower.o		\
824	towlower.o		\
825	ungetwc.o		\
826	utf8.o			\
827	wcrtomb.o		\
828	wcscasecmp.o		\
829	wcscoll.o		\
830	wcsftime.o		\
831	wcsnrtombs.o		\
832	wcsrtombs.o		\
833	wcswidth.o		\
834	wcstombs.o		\
835	wcsxfrm.o		\
836	wctob.o			\
837	wctomb.o		\
838	wctrans.o		\
839	wctype.o		\
840	wcwidth.o		\
841	wscol.o
842
843AIOOBJS=			\
844	aio.o			\
845	aio_alloc.o		\
846	posix_aio.o
847
848RTOBJS=				\
849	clock_timer.o		\
850	mqueue.o		\
851	pos4obj.o		\
852	sched.o			\
853	sem.o			\
854	shm.o			\
855	sigev_thread.o
856
857TPOOLOBJS=			\
858	thread_pool.o
859
860THREADSOBJS=			\
861	alloc.o			\
862	assfail.o		\
863	cancel.o		\
864	c11_thr.o		\
865	door_calls.o		\
866	tmem.o			\
867	pthr_attr.o		\
868	pthr_barrier.o		\
869	pthr_cond.o		\
870	pthr_mutex.o		\
871	pthr_rwlock.o		\
872	pthread.o		\
873	rwlock.o		\
874	scalls.o		\
875	sema.o			\
876	sigaction.o		\
877	spawn.o			\
878	synch.o			\
879	tdb_agent.o		\
880	thr.o			\
881	thread_interface.o	\
882	tls.o			\
883	tsd.o
884
885THREADSMACHOBJS=		\
886	machdep.o
887
888THREADSASMOBJS=			\
889	asm_subr.o
890
891UNICODEOBJS=			\
892	u8_textprep.o		\
893	uconv.o
894
895UNWINDMACHOBJS=			\
896	unwind.o
897
898UNWINDASMOBJS=			\
899	unwind_frame.o
900
901# objects that implement the transitional large file API
902PORTSYS64=			\
903	lockf64.o		\
904	stat64.o
905
906PORTSYS=			\
907	_autofssys.o		\
908	access.o		\
909	acctctl.o		\
910	bsd_signal.o		\
911	chmod.o			\
912	chown.o			\
913	corectl.o		\
914	epoll.o			\
915	eventfd.o		\
916	exacctsys.o		\
917	execl.o			\
918	execle.o		\
919	execv.o			\
920	fcntl.o			\
921	getpagesizes.o		\
922	getpeerucred.o		\
923	inst_sync.o		\
924	issetugid.o		\
925	label.o			\
926	link.o			\
927	lockf.o			\
928	lwp.o			\
929	lwp_cond.o		\
930	lwp_rwlock.o		\
931	lwp_sigmask.o		\
932	meminfosys.o		\
933	mkdir.o			\
934	mknod.o			\
935	msgsys.o		\
936	nfssys.o		\
937	open.o			\
938	pgrpsys.o		\
939	posix_sigwait.o		\
940	ppriv.o			\
941	psetsys.o		\
942	rctlsys.o		\
943	readlink.o		\
944	rename.o		\
945	sbrk.o			\
946	semsys.o		\
947	set_errno.o		\
948	sharefs.o		\
949	shmsys.o		\
950	sidsys.o		\
951	siginterrupt.o		\
952	signal.o		\
953	signalfd.o		\
954	sigpending.o		\
955	sigstack.o		\
956	stat.o			\
957	symlink.o		\
958	tasksys.o		\
959	time.o			\
960	time_util.o		\
961	timerfd.o		\
962	ucontext.o		\
963	unlink.o		\
964	ustat.o			\
965	utimesys.o		\
966	zone.o
967
968PORTREGEX=			\
969	glob.o			\
970	regcmp.o		\
971	regex.o			\
972	wordexp.o
973
974PORTREGEX64=			\
975	glob64.o
976
977MOSTOBJS=			\
978	$(STRETS)		\
979	$(CRTOBJS)		\
980	$(DYNOBJS)		\
981	$(FPOBJS)		\
982	$(FPASMOBJS)		\
983	$(ATOMICOBJS)		\
984	$(CHACHAOBJS)		\
985	$(XATTROBJS)		\
986	$(COMOBJS)		\
987	$(DTRACEOBJS)		\
988	$(GENOBJS)		\
989	$(PORTFP)		\
990	$(PORTGEN)		\
991	$(PORTGEN64)		\
992	$(PORTI18N)		\
993	$(PORTI18N_COND)	\
994	$(PORTLOCALE)		\
995	$(PORTPRINT)		\
996	$(PORTPRINT_C89)	\
997	$(PORTPRINT_W)		\
998	$(PORTREGEX)		\
999	$(PORTREGEX64)		\
1000	$(PORTSTDIO)		\
1001	$(PORTSTDIO64)		\
1002	$(PORTSTDIO_C89)	\
1003	$(PORTSTDIO_W)		\
1004	$(PORTSYS)		\
1005	$(PORTSYS64)		\
1006	$(AIOOBJS)		\
1007	$(RTOBJS)		\
1008	$(SECFLAGSOBJS)		\
1009	$(TPOOLOBJS)		\
1010	$(THREADSOBJS)		\
1011	$(THREADSMACHOBJS)	\
1012	$(THREADSASMOBJS)	\
1013	$(UNICODEOBJS)		\
1014	$(UNWINDMACHOBJS)	\
1015	$(UNWINDASMOBJS)	\
1016	$(COMSYSOBJS)		\
1017	$(SYSOBJS)		\
1018	$(COMSYSOBJS64)		\
1019	$(SYSOBJS64)		\
1020	$(VALUES)
1021
1022TRACEOBJS=			\
1023	plockstat.o
1024
1025# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
1026# modules whose source is provided in the $(SRC)/lib/common directory.
1027# This must be done because otherwise the Sun C compiler would insert
1028# its own versions of these modules and those versions contain code
1029# to call out to C++ initialization functions.  Such C++ initialization
1030# functions can call back into libc before thread initialization is
1031# complete and this leads to segmentation violations and other problems.
1032# Since libc contains no C++ code, linking with the minimal crti.o and
1033# crtn.o modules is safe and avoids the problems described above.
1034OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1035CRTSRCS= ../../common/i386
1036
1037LDPASS_OFF=	$(POUND_SIGN)
1038
1039# include common library definitions
1040include ../../Makefile.lib
1041
1042# we need to override the default SONAME here because we might
1043# be building a variant object (still libc.so.1, but different filename)
1044SONAME = libc.so.1
1045
1046CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
1047
1048# This is necessary to avoid problems with calling _ex_unwind().
1049# We probably don't want any inlining anyway.
1050XINLINE = -xinline=
1051CFLAGS += $(XINLINE)
1052
1053CERRWARN += -_gcc=-Wno-parentheses
1054CERRWARN += -_gcc=-Wno-switch
1055CERRWARN += -_gcc=-Wno-uninitialized
1056CERRWARN += -_gcc=-Wno-unused-value
1057CERRWARN += -_gcc=-Wno-unused-label
1058CERRWARN += -_gcc=-Wno-unused-variable
1059CERRWARN += -_gcc=-Wno-type-limits
1060CERRWARN += -_gcc=-Wno-char-subscripts
1061CERRWARN += -_gcc=-Wno-clobbered
1062CERRWARN += -_gcc=-Wno-unused-function
1063CERRWARN += -_gcc=-Wno-address
1064
1065# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1066# enables ASSERT() checking in the threads portion of the library.
1067# This is automatically enabled for DEBUG builds, not for non-debug builds.
1068THREAD_DEBUG =
1069$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1070
1071# Make string literals read-only to save memory.
1072CFLAGS += $(XSTRCONST)
1073
1074ALTPICS= $(TRACEOBJS:%=pics/%)
1075
1076$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) \
1077		$(EXTPICS) $(LDLIBS)
1078
1079MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1080
1081#
1082# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
1083#
1084CFLAGS +=	$(EXTN_CFLAGS)
1085CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
1086		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1087ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
1088
1089# As a favor to the dtrace syscall provider, libc still calls the
1090# old syscall traps that have been obsoleted by the *at() interfaces.
1091# Delete this to compile libc using only the new *at() system call traps
1092CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1093
1094# Inform the run-time linker about libc specialized initialization
1095RTLDINFO =	-z rtldinfo=tls_rtldinfo
1096DYNFLAGS +=	$(RTLDINFO)
1097
1098# Force libc's internal references to be resolved immediately upon loading
1099# in order to avoid critical region problems.  Since almost all libc symbols
1100# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1101DYNFLAGS +=	-znow
1102
1103DYNFLAGS +=	-e __rtboot
1104DYNFLAGS +=	$(EXTN_DYNFLAGS)
1105
1106# Inform the kernel about the initial DTrace area (in case
1107# libc is being used as the interpreter / runtime linker).
1108DTRACE_DATA =	-zdtrace=dtrace_data
1109DYNFLAGS +=	$(DTRACE_DATA)
1110
1111# DTrace needs an executable data segment.
1112MAPFILE.NED=
1113
1114BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1115
1116# Override this top level flag so the compiler builds in its native
1117# C99 mode.  This has been enabled to support the complex arithmetic
1118# added to libc.
1119C99MODE=	$(C99_ENABLE)
1120
1121# libc method of building an archive
1122# The "$(GREP) -v ' L '" part is necessary only until
1123# lorder is fixed to ignore thread-local variables.
1124BUILD.AR= $(RM) $@ ; \
1125	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1126
1127# extra files for the clean target
1128CLEANFILES=			\
1129	$(LIBCDIR)/port/gen/errlst.c	\
1130	$(LIBCDIR)/port/gen/new_list.c	\
1131	assym.h			\
1132	genassym		\
1133	crt/_rtld.s		\
1134	crt/_rtbootld.s		\
1135	pics/_rtbootld.o	\
1136	pics/crti.o		\
1137	pics/crtn.o		\
1138	$(ALTPICS)
1139
1140CLOBBERFILES +=	$(LIB_PIC)
1141
1142# list of C source for lint
1143SRCS=							\
1144	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1145	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1146	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1147	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1148	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
1149	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
1150	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
1151	$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)		\
1152	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
1153	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
1154	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
1155	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1156	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1157	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1158	$(SECFLAGSOBJS:%.o=$(SRC)/common/secflags/%.c)		\
1159	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1160	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1161	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
1162	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1163	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
1164	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
1165	$(LIBCBASE)/gen/ecvt.c				\
1166	$(LIBCBASE)/gen/makectxt.c			\
1167	$(LIBCBASE)/gen/siginfolst.c			\
1168	$(LIBCBASE)/gen/siglongjmp.c			\
1169	$(LIBCBASE)/gen/strcmp.c			\
1170	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1171	$(LIBCBASE)/sys/ptrace.c			\
1172	$(LIBCBASE)/sys/uadmin.c
1173
1174# conditional assignments
1175$(DYNLIB) := CRTI = crti.o
1176$(DYNLIB) := CRTN = crtn.o
1177
1178# Files which need the threads .il inline template
1179TIL=				\
1180	aio.o			\
1181	alloc.o			\
1182	assfail.o		\
1183	atexit.o		\
1184	atfork.o		\
1185	cancel.o		\
1186	door_calls.o		\
1187	err.o			\
1188	errno.o			\
1189	lwp.o			\
1190	ma.o			\
1191	machdep.o		\
1192	posix_aio.o		\
1193	pthr_attr.o		\
1194	pthr_barrier.o		\
1195	pthr_cond.o		\
1196	pthr_mutex.o		\
1197	pthr_rwlock.o		\
1198	pthread.o		\
1199	rand.o			\
1200	rwlock.o		\
1201	scalls.o		\
1202	sched.o			\
1203	sema.o			\
1204	sigaction.o		\
1205	sigev_thread.o		\
1206	spawn.o			\
1207	stack.o			\
1208	synch.o			\
1209	tdb_agent.o		\
1210	thr.o			\
1211	thread_interface.o	\
1212	thread_pool.o		\
1213	tls.o			\
1214	tsd.o			\
1215	tmem.o			\
1216	unwind.o
1217
1218THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1219$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1220
1221# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1222
1223# large-file-aware components that should be built large
1224
1225$(COMSYSOBJS64:%=pics/%) := \
1226	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1227
1228$(SYSOBJS64:%=pics/%) := \
1229	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1230
1231$(PORTGEN64:%=pics/%) := \
1232	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1233
1234$(PORTREGEX64:%=pics/%) := \
1235	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1236
1237$(PORTSTDIO64:%=pics/%) := \
1238	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1239
1240$(PORTSYS64:%=pics/%) := \
1241	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1242
1243$(PORTSTDIO_W:%=pics/%) := \
1244	CPPFLAGS += -D_WIDE
1245
1246$(PORTPRINT_W:%=pics/%) := \
1247	CPPFLAGS += -D_WIDE
1248
1249$(PORTPRINT_C89:%=pics/%) := \
1250	CPPFLAGS += -D_C89_INTMAX32
1251
1252$(PORTSTDIO_C89:%=pics/%) := \
1253	CPPFLAGS += -D_C89_INTMAX32
1254
1255$(PORTI18N_COND:%=pics/%) := \
1256	CPPFLAGS += -D_WCS_LONGLONG
1257
1258pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1259
1260.KEEP_STATE:
1261
1262all: $(LIBS) $(LIB_PIC)
1263
1264lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1265lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1266lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1267
1268lint:
1269	@echo $(LINT.c) ...
1270	@$(LINT.c) $(SRCS) $(LDLIBS)
1271
1272$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1273$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1274$(LINTLIB):= LINTFLAGS=-nvx
1275
1276# object files that depend on inline template
1277$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1278# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1279
1280# include common libc targets
1281include $(LIBCDIR)/Makefile.targ
1282
1283# We need to strip out all CTF and DOF data from the static library
1284$(LIB_PIC) := DIR = pics
1285$(LIB_PIC): pics $$(PICS)
1286	$(BUILD.AR)
1287	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1288	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1289	$(AR) -ts $@ > /dev/null
1290	$(POST_PROCESS_A)
1291
1292$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1293	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1294	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1295	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1296	$(RM) $(LIBCBASE)/crt/_rtld.s
1297
1298# partially built from C source
1299pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1300	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1301	$(CTFCONVERT_O)
1302
1303ASSYMDEP_OBJS=			\
1304	_lwp_mutex_unlock.o	\
1305	_stack_grow.o		\
1306	getcontext.o		\
1307	setjmp.o		\
1308	tls_get_addr.o		\
1309	vforkx.o
1310
1311$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1312
1313$(ASSYMDEP_OBJS:%=pics/%): assym.h
1314
1315# assym.h build rules
1316
1317GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1318
1319genassym: $(GENASSYM_C)
1320	$(NATIVECC) $(NATIVE_CFLAGS) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc	\
1321		-D__EXTENSIONS__ $(CPPFLAGS.native) -o $@ $(GENASSYM_C)
1322
1323OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1324
1325assym.h: $(OFFSETS) genassym
1326	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1327	./genassym >>$@
1328
1329# derived C source and related explicit dependencies
1330$(LIBCDIR)/port/gen/errlst.c + \
1331$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1332	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1333
1334pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1335
1336pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1337