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