xref: /illumos-gate/usr/src/lib/libc/i386/Makefile.com (revision 6ff4183c538023f1acb277f9d3b05296bb816e66)
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	explicit_bzero.o	\
108	memmem.o		\
109	qsort.o			\
110	strtol.o		\
111	strtoul.o		\
112	strtoll.o		\
113	strtoull.o
114
115DTRACEOBJS=			\
116	dtrace_data.o
117
118SECFLAGSOBJS=			\
119	secflags.o
120
121GENOBJS=			\
122	$(COMMPAGE_OBJS)	\
123	_div64.o		\
124	_divdi3.o		\
125	_getsp.o		\
126	_mul64.o		\
127	abs.o			\
128	alloca.o		\
129	arc4random.o		\
130	arc4random_uniform.o	\
131	byteorder.o		\
132	byteorder64.o		\
133	cuexit.o		\
134	ecvt.o			\
135	endian.o		\
136	errlst.o		\
137	i386_data.o		\
138	ladd.o			\
139	ldivide.o		\
140	lmul.o			\
141	lock.o			\
142	lshiftl.o		\
143	lsign.o			\
144	lsub.o			\
145	makectxt.o		\
146	memccpy.o		\
147	memchr.o		\
148	memcmp.o		\
149	memcpy.o		\
150	memset.o		\
151	new_list.o		\
152	setjmp.o		\
153	siginfolst.o		\
154	siglongjmp.o		\
155	strcat.o		\
156	strchr.o		\
157	strcmp.o		\
158	strcpy.o		\
159	strlen.o		\
160	strncat.o		\
161	strncmp.o		\
162	strncpy.o		\
163	strnlen.o		\
164	strrchr.o		\
165	sync_instruction_memory.o
166
167# sysobjs that contain large-file interfaces
168COMSYSOBJS64=			\
169	fstatvfs64.o		\
170	getdents64.o		\
171	getrlimit64.o		\
172	lseek64.o		\
173	mmap64.o		\
174	pread64.o		\
175	preadv64.o		\
176	pwrite64.o		\
177	pwritev64.o		\
178	setrlimit64.o		\
179	statvfs64.o
180
181SYSOBJS64=
182
183COMSYSOBJS=			\
184	__clock_timer.o		\
185	__getloadavg.o		\
186	__rusagesys.o		\
187	__signotify.o		\
188	__sigrt.o		\
189	__time.o		\
190	_lgrp_home_fast.o	\
191	_lgrpsys.o		\
192	_nfssys.o		\
193	_portfs.o		\
194	_pset.o			\
195	_rpcsys.o		\
196	_sigaction.o		\
197	_so_accept.o		\
198	_so_bind.o		\
199	_so_connect.o		\
200	_so_getpeername.o	\
201	_so_getsockname.o	\
202	_so_getsockopt.o	\
203	_so_listen.o		\
204	_so_recv.o		\
205	_so_recvfrom.o		\
206	_so_recvmsg.o		\
207	_so_send.o		\
208	_so_sendmsg.o		\
209	_so_sendto.o		\
210	_so_setsockopt.o	\
211	_so_shutdown.o		\
212	_so_socket.o		\
213	_so_socketpair.o	\
214	_sockconfig.o		\
215	acct.o			\
216	acl.o			\
217	adjtime.o		\
218	alarm.o			\
219	brk.o			\
220	chdir.o			\
221	chroot.o		\
222	cladm.o			\
223	close.o			\
224	execve.o		\
225	exit.o			\
226	facl.o			\
227	fchdir.o		\
228	fchroot.o		\
229	fdsync.o		\
230	fpathconf.o		\
231	fstatfs.o		\
232	fstatvfs.o		\
233	getcpuid.o		\
234	getdents.o		\
235	getegid.o		\
236	geteuid.o		\
237	getgid.o		\
238	getgroups.o		\
239	gethrtime.o		\
240	getitimer.o		\
241	getmsg.o		\
242	getpid.o		\
243	getpmsg.o		\
244	getppid.o		\
245	getrandom.o		\
246	getrlimit.o		\
247	getuid.o		\
248	gtty.o			\
249	install_utrap.o		\
250	ioctl.o			\
251	kaio.o			\
252	kill.o			\
253	llseek.o		\
254	lseek.o			\
255	mmapobjsys.o		\
256	memcntl.o		\
257	mincore.o		\
258	mmap.o			\
259	modctl.o		\
260	mount.o			\
261	mprotect.o		\
262	munmap.o		\
263	nice.o			\
264	ntp_adjtime.o		\
265	ntp_gettime.o		\
266	p_online.o		\
267	pathconf.o		\
268	pause.o			\
269	pcsample.o		\
270	pipe2.o			\
271	pollsys.o		\
272	pread.o			\
273	preadv.o		\
274	priocntlset.o		\
275	processor_bind.o	\
276	processor_info.o	\
277	profil.o		\
278	psecflagsset.o		\
279	putmsg.o		\
280	putpmsg.o		\
281	pwrite.o		\
282	pwritev.o		\
283	read.o			\
284	readv.o			\
285	resolvepath.o		\
286	seteguid.o		\
287	setgid.o		\
288	setgroups.o		\
289	setitimer.o		\
290	setreid.o		\
291	setrlimit.o		\
292	setuid.o		\
293	sigaltstk.o		\
294	sigprocmsk.o		\
295	sigsendset.o		\
296	sigsuspend.o		\
297	statfs.o		\
298	statvfs.o		\
299	stty.o			\
300	sync.o			\
301	sysconfig.o		\
302	sysfs.o			\
303	sysinfo.o		\
304	syslwp.o		\
305	times.o			\
306	ulimit.o		\
307	umask.o			\
308	umount2.o		\
309	upanic.o		\
310	utssys.o		\
311	uucopy.o		\
312	vhangup.o		\
313	waitid.o		\
314	write.o			\
315	writev.o		\
316	yield.o
317
318SYSOBJS=			\
319	__clock_gettime.o	\
320	__clock_gettime_sys.o	\
321	__getcontext.o		\
322	__uadmin.o		\
323	_lwp_mutex_unlock.o	\
324	_stack_grow.o		\
325	door.o			\
326	forkx.o			\
327	forkallx.o		\
328	getcontext.o		\
329	gettimeofday.o		\
330	lwp_private.o		\
331	nuname.o		\
332	ptrace.o		\
333	syscall.o		\
334	sysi86.o		\
335	tls_get_addr.o		\
336	uadmin.o		\
337	umount.o		\
338	uname.o			\
339	vforkx.o		\
340	xstat.o
341
342# objects under $(LIBCDIR)/port which contain transitional large file interfaces
343PORTGEN64=			\
344	_xftw64.o		\
345	attropen64.o		\
346	fts64.o			\
347	ftw64.o			\
348	mkstemp64.o		\
349	nftw64.o		\
350	tell64.o		\
351	truncate64.o
352
353# objects from source under $(LIBCDIR)/port
354PORTFP=				\
355	__flt_decim.o		\
356	__flt_rounds.o		\
357	__tbl_10_b.o		\
358	__tbl_10_h.o		\
359	__tbl_10_s.o		\
360	__tbl_2_b.o		\
361	__tbl_2_h.o		\
362	__tbl_2_s.o		\
363	__tbl_fdq.o		\
364	__tbl_tens.o		\
365	__x_power.o		\
366	_base_sup.o		\
367	aconvert.o		\
368	decimal_bin.o		\
369	double_decim.o		\
370	econvert.o		\
371	fconvert.o		\
372	file_decim.o		\
373	finite.o		\
374	fp_data.o		\
375	func_decim.o		\
376	gconvert.o		\
377	hex_bin.o		\
378	ieee_globals.o		\
379	pack_float.o		\
380	sigfpe.o		\
381	string_decim.o
382
383PORTGEN=			\
384	_env_data.o		\
385	_xftw.o			\
386	a64l.o			\
387	abort.o			\
388	addsev.o		\
389	ascii_strcasecmp.o	\
390	ascii_strncasecmp.o	\
391	assert.o		\
392	atexit.o		\
393	atfork.o		\
394	atof.o			\
395	atoi.o			\
396	atol.o			\
397	atoll.o			\
398	attrat.o		\
399	attropen.o		\
400	basename.o		\
401	calloc.o		\
402	catgets.o		\
403	catopen.o		\
404	cfgetispeed.o		\
405	cfgetospeed.o		\
406	cfree.o			\
407	cfsetispeed.o		\
408	cfsetospeed.o		\
409	cftime.o		\
410	clock.o			\
411	closedir.o		\
412	closefrom.o		\
413	confstr.o		\
414	crypt.o			\
415	csetlen.o		\
416	ctime.o			\
417	ctime_r.o		\
418	daemon.o		\
419	deflt.o			\
420	directio.o		\
421	dirname.o		\
422	div.o			\
423	drand48.o		\
424	dup.o			\
425	env_data.o		\
426	err.o			\
427	errno.o			\
428	euclen.o		\
429	event_port.o		\
430	execvp.o		\
431	fattach.o		\
432	fdetach.o		\
433	fdopendir.o		\
434	ffs.o			\
435	flock.o			\
436	fls.o			\
437	fmtmsg.o		\
438	freezero.o		\
439	ftime.o			\
440	ftok.o			\
441	fts.o			\
442	ftw.o			\
443	gcvt.o			\
444	get_nprocs.o		\
445	getauxv.o		\
446	getcwd.o		\
447	getdate_err.o		\
448	getdtblsize.o		\
449	getentropy.o		\
450	getenv.o		\
451	getexecname.o		\
452	getgrnam.o		\
453	getgrnam_r.o		\
454	gethostid.o		\
455	gethostname.o		\
456	gethz.o			\
457	getisax.o		\
458	getloadavg.o		\
459	getlogin.o		\
460	getmntent.o		\
461	getnetgrent.o		\
462	getopt.o		\
463	getopt_long.o		\
464	getpagesize.o		\
465	getpw.o			\
466	getpwnam.o		\
467	getpwnam_r.o		\
468	getrusage.o		\
469	getspent.o		\
470	getspent_r.o		\
471	getsubopt.o		\
472	gettxt.o		\
473	getusershell.o		\
474	getut.o			\
475	getutx.o		\
476	getvfsent.o		\
477	getwd.o			\
478	getwidth.o		\
479	getxby_door.o		\
480	gtxt.o			\
481	hsearch.o		\
482	iconv.o			\
483	imaxabs.o		\
484	imaxdiv.o		\
485	index.o			\
486	initgroups.o		\
487	insque.o		\
488	isaexec.o		\
489	isastream.o		\
490	isatty.o		\
491	killpg.o		\
492	klpdlib.o		\
493	l64a.o			\
494	lckpwdf.o		\
495	lconstants.o		\
496	lexp10.o		\
497	lfind.o			\
498	lfmt.o			\
499	lfmt_log.o		\
500	llabs.o			\
501	lldiv.o			\
502	llog10.o		\
503	lltostr.o		\
504	localtime.o		\
505	lsearch.o		\
506	madvise.o		\
507	malloc.o		\
508	memalign.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	fcntl.o			\
950	getpagesizes.o		\
951	getpeerucred.o		\
952	inst_sync.o		\
953	issetugid.o		\
954	label.o			\
955	link.o			\
956	lockf.o			\
957	lwp.o			\
958	lwp_cond.o		\
959	lwp_rwlock.o		\
960	lwp_sigmask.o		\
961	meminfosys.o		\
962	mkdir.o			\
963	mknod.o			\
964	msgsys.o		\
965	nfssys.o		\
966	open.o			\
967	pgrpsys.o		\
968	posix_sigwait.o		\
969	ppriv.o			\
970	psetsys.o		\
971	rctlsys.o		\
972	readlink.o		\
973	rename.o		\
974	sbrk.o			\
975	semsys.o		\
976	set_errno.o		\
977	sharefs.o		\
978	shmsys.o		\
979	sidsys.o		\
980	siginterrupt.o		\
981	signal.o		\
982	signalfd.o		\
983	sigpending.o		\
984	sigstack.o		\
985	stat.o			\
986	symlink.o		\
987	tasksys.o		\
988	time.o			\
989	time_util.o		\
990	timerfd.o		\
991	ucontext.o		\
992	unlink.o		\
993	ustat.o			\
994	utimesys.o		\
995	zone.o
996
997PORTREGEX=			\
998	glob.o			\
999	regcmp.o		\
1000	regcomp.o		\
1001	regerror.o		\
1002	regex.o			\
1003	regexec.o		\
1004	regfree.o		\
1005	wordexp.o
1006
1007PORTREGEX64=			\
1008	glob64.o
1009
1010MOSTOBJS=			\
1011	$(STRETS)		\
1012	$(CRTOBJS)		\
1013	$(DYNOBJS)		\
1014	$(FPOBJS)		\
1015	$(FPASMOBJS)		\
1016	$(ATOMICOBJS)		\
1017	$(CHACHAOBJS)		\
1018	$(XATTROBJS)		\
1019	$(COMOBJS)		\
1020	$(DTRACEOBJS)		\
1021	$(GENOBJS)		\
1022	$(PORTFP)		\
1023	$(PORTGEN)		\
1024	$(PORTGEN64)		\
1025	$(PORTI18N)		\
1026	$(PORTI18N_COND)	\
1027	$(PORTINET)		\
1028	$(PORTLOCALE)		\
1029	$(PORTPRINT)		\
1030	$(PORTPRINT_C89)	\
1031	$(PORTPRINT_W)		\
1032	$(PORTREGEX)		\
1033	$(PORTREGEX64)		\
1034	$(PORTSTDIO)		\
1035	$(PORTSTDIO64)		\
1036	$(PORTSTDIO_C89)	\
1037	$(PORTSTDIO_W)		\
1038	$(PORTSYS)		\
1039	$(PORTSYS64)		\
1040	$(AIOOBJS)		\
1041	$(RTOBJS)		\
1042	$(SECFLAGSOBJS)		\
1043	$(TPOOLOBJS)		\
1044	$(THREADSOBJS)		\
1045	$(THREADSMACHOBJS)	\
1046	$(THREADSASMOBJS)	\
1047	$(UNICODEOBJS)		\
1048	$(UNWINDMACHOBJS)	\
1049	$(UNWINDASMOBJS)	\
1050	$(COMSYSOBJS)		\
1051	$(SYSOBJS)		\
1052	$(COMSYSOBJS64)		\
1053	$(SYSOBJS64)		\
1054	$(VALUES)
1055
1056TRACEOBJS=			\
1057	plockstat.o
1058
1059# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
1060# modules whose source is provided in the $(SRC)/lib/crt directory.
1061# This must be done because otherwise the Sun C compiler would insert
1062# its own versions of these modules and those versions contain code
1063# to call out to C++ initialization functions.  Such C++ initialization
1064# functions can call back into libc before thread initialization is
1065# complete and this leads to segmentation violations and other problems.
1066# Since libc contains no C++ code, linking with the minimal crti.o and
1067# crtn.o modules is safe and avoids the problems described above.
1068OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1069CRTSRCS= ../../crt/i386
1070
1071LDPASS_OFF=	$(POUND_SIGN)
1072
1073# include common library definitions
1074include ../../Makefile.lib
1075
1076# we need to override the default SONAME here because we might
1077# be building a variant object (still libc.so.1, but different filename)
1078SONAME = libc.so.1
1079
1080CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
1081
1082# This is necessary to avoid problems with calling _ex_unwind().
1083# We probably don't want any inlining anyway.
1084XINLINE = -xinline=
1085CFLAGS += $(XINLINE)
1086
1087CERRWARN += -_gcc=-Wno-parentheses
1088CERRWARN += -_gcc=-Wno-switch
1089CERRWARN += $(CNOWARN_UNINIT)
1090CERRWARN += -_gcc=-Wno-unused-value
1091CERRWARN += -_gcc=-Wno-unused-label
1092CERRWARN += -_gcc=-Wno-unused-variable
1093CERRWARN += -_gcc=-Wno-type-limits
1094CERRWARN += -_gcc=-Wno-char-subscripts
1095CERRWARN += -_gcc=-Wno-clobbered
1096CERRWARN += -_gcc=-Wno-unused-function
1097CERRWARN += -_gcc=-Wno-address
1098
1099$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
1100
1101# not linted
1102SMATCH=off
1103
1104# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1105# enables ASSERT() checking in the threads portion of the library.
1106# This is automatically enabled for DEBUG builds, not for non-debug builds.
1107THREAD_DEBUG =
1108$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1109
1110# Make string literals read-only to save memory.
1111CFLAGS += $(XSTRCONST)
1112
1113ALTPICS= $(TRACEOBJS:%=pics/%)
1114
1115$(DYNLIB) := BUILD.SO = $(LD) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(ALTPICS) \
1116		$(EXTPICS) $(LDLIBS)
1117
1118MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1119
1120#
1121# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
1122#
1123CFLAGS +=	$(EXTN_CFLAGS)
1124CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
1125		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1126ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
1127
1128# As a favor to the dtrace syscall provider, libc still calls the
1129# old syscall traps that have been obsoleted by the *at() interfaces.
1130# Delete this to compile libc using only the new *at() system call traps
1131CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1132
1133# Inform the run-time linker about libc specialized initialization
1134RTLDINFO =	-z rtldinfo=tls_rtldinfo
1135DYNFLAGS +=	$(RTLDINFO)
1136
1137# Force libc's internal references to be resolved immediately upon loading
1138# in order to avoid critical region problems.  Since almost all libc symbols
1139# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1140DYNFLAGS +=	-znow
1141
1142DYNFLAGS +=	-e __rtboot
1143DYNFLAGS +=	$(EXTN_DYNFLAGS)
1144
1145# Inform the kernel about the initial DTrace area (in case
1146# libc is being used as the interpreter / runtime linker).
1147DTRACE_DATA =	-zdtrace=dtrace_data
1148DYNFLAGS +=	$(DTRACE_DATA)
1149
1150# DTrace needs an executable data segment.
1151MAPFILE.NED=
1152
1153BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1154
1155# Override this top level flag so the compiler builds in its native
1156# C99 mode.  This has been enabled to support the complex arithmetic
1157# added to libc.
1158CSTD=	$(CSTD_GNU99)
1159
1160# libc method of building an archive
1161# The "$(GREP) -v ' L '" part is necessary only until
1162# lorder is fixed to ignore thread-local variables.
1163BUILD.AR= $(RM) $@ ; \
1164	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1165
1166# extra files for the clean target
1167CLEANFILES +=			\
1168	$(LIBCDIR)/port/gen/errlst.c	\
1169	$(LIBCDIR)/port/gen/new_list.c	\
1170	assym.h			\
1171	genassym		\
1172	crt/_rtld.s		\
1173	crt/_rtbootld.s		\
1174	pics/_rtbootld.o	\
1175	pics/crti.o		\
1176	pics/crtn.o		\
1177	$(ALTPICS)
1178
1179CLOBBERFILES +=	$(LIB_PIC)
1180
1181# conditional assignments
1182$(DYNLIB) := CRTI = crti.o
1183$(DYNLIB) := CRTN = crtn.o
1184
1185# Files which need the threads .il inline template
1186TIL=				\
1187	aio.o			\
1188	alloc.o			\
1189	assfail.o		\
1190	atexit.o		\
1191	atfork.o		\
1192	cancel.o		\
1193	door_calls.o		\
1194	err.o			\
1195	errno.o			\
1196	lwp.o			\
1197	ma.o			\
1198	machdep.o		\
1199	posix_aio.o		\
1200	pthr_attr.o		\
1201	pthr_barrier.o		\
1202	pthr_cond.o		\
1203	pthr_mutex.o		\
1204	pthr_rwlock.o		\
1205	pthread.o		\
1206	rand.o			\
1207	rwlock.o		\
1208	scalls.o		\
1209	sched.o			\
1210	sema.o			\
1211	sigaction.o		\
1212	sigev_thread.o		\
1213	spawn.o			\
1214	stack.o			\
1215	synch.o			\
1216	tdb_agent.o		\
1217	thr.o			\
1218	thread_interface.o	\
1219	thread_pool.o		\
1220	tls.o			\
1221	tsd.o			\
1222	tmem.o			\
1223	unwind.o
1224
1225THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1226$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1227
1228# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1229
1230# large-file-aware components that should be built large
1231
1232$(COMSYSOBJS64:%=pics/%) := \
1233	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1234
1235$(SYSOBJS64:%=pics/%) := \
1236	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1237
1238$(PORTGEN64:%=pics/%) := \
1239	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1240
1241$(PORTREGEX64:%=pics/%) := \
1242	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1243
1244$(PORTSTDIO64:%=pics/%) := \
1245	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1246
1247$(PORTSYS64:%=pics/%) := \
1248	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1249
1250$(PORTSTDIO_W:%=pics/%) := \
1251	CPPFLAGS += -D_WIDE
1252
1253$(PORTPRINT_W:%=pics/%) := \
1254	CPPFLAGS += -D_WIDE
1255
1256$(PORTPRINT_C89:%=pics/%) := \
1257	CPPFLAGS += -D_C89_INTMAX32
1258
1259$(PORTSTDIO_C89:%=pics/%) := \
1260	CPPFLAGS += -D_C89_INTMAX32
1261
1262$(PORTI18N_COND:%=pics/%) := \
1263	CPPFLAGS += -D_WCS_LONGLONG
1264
1265pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1266
1267pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1268pics/gettimeofday.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1269
1270#
1271# Disable the stack protector due to issues with bootstrapping rtld. See
1272# cmd/sgs/rtld/Makefile.com for more information.
1273#
1274STACKPROTECT = none
1275
1276.KEEP_STATE:
1277
1278all: $(LIBS) $(LIB_PIC)
1279
1280# object files that depend on inline template
1281$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1282# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1283
1284# include common libc targets
1285include $(LIBCDIR)/Makefile.targ
1286
1287# We need to strip out all CTF and DOF data from the static library
1288$(LIB_PIC) := DIR = pics
1289$(LIB_PIC): pics $$(PICS)
1290	$(BUILD.AR)
1291	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1292	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1293	$(AR) -ts $@ > /dev/null
1294	$(POST_PROCESS_A)
1295
1296$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1297	$(CC) $($(MACH)_XARCH) $(CPPFLAGS) -_smatch=off $(CTF_FLAGS) -O -S \
1298	    $(C_PICFLAGS) $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1299	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1300	$(RM) $(LIBCBASE)/crt/_rtld.s
1301
1302# partially built from C source
1303pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1304	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1305	$(CTFCONVERT_O)
1306
1307ASSYMDEP_OBJS=			\
1308	_lwp_mutex_unlock.o	\
1309	_stack_grow.o		\
1310	getcontext.o		\
1311	setjmp.o		\
1312	tls_get_addr.o		\
1313	vforkx.o
1314
1315$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1316
1317$(ASSYMDEP_OBJS:%=pics/%): assym.h
1318
1319# assym.h build rules
1320
1321GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1322LDFLAGS.native = $(LDASSERTS) $(BDIRECT)
1323
1324genassym := NATIVE_LIBS += libc.so
1325
1326genassym: $(GENASSYM_C)
1327	$(NATIVECC) $(NATIVE_CFLAGS) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc	\
1328		-D__EXTENSIONS__ $(CPPFLAGS.native) $(LDFLAGS.native) \
1329		-o $@ $(GENASSYM_C)
1330
1331OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1332
1333assym.h: $(OFFSETS) genassym
1334	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1335	./genassym >>$@
1336
1337# derived C source and related explicit dependencies
1338$(LIBCDIR)/port/gen/errlst.c + \
1339$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1340	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1341
1342pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1343
1344pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1345