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