xref: /illumos-gate/usr/src/lib/libc/i386/Makefile.com (revision 528737823843346cf95a4a701612f82089135554)
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	_wrtchk.o		\
690	clearerr.o		\
691	ctermid.o		\
692	ctermid_r.o		\
693	cuserid.o		\
694	data.o			\
695	doscan.o		\
696	fdopen.o		\
697	feof.o			\
698	ferror.o		\
699	fgetc.o			\
700	fgets.o			\
701	fileno.o		\
702	flockf.o		\
703	flush.o			\
704	fopen.o			\
705	fpos.o			\
706	fputc.o			\
707	fputs.o			\
708	fread.o			\
709	fseek.o			\
710	fseeko.o		\
711	ftell.o			\
712	ftello.o		\
713	fwrite.o		\
714	getc.o			\
715	getchar.o		\
716	getline.o		\
717	getpass.o		\
718	gets.o			\
719	getw.o			\
720	mse.o			\
721	popen.o			\
722	putc.o			\
723	putchar.o		\
724	puts.o			\
725	putw.o			\
726	rewind.o		\
727	scanf.o			\
728	setbuf.o		\
729	setbuffer.o		\
730	setvbuf.o		\
731	system.o		\
732	tempnam.o		\
733	tmpfile.o		\
734	tmpnam_r.o		\
735	ungetc.o		\
736	vscanf.o		\
737	vwscanf.o		\
738	wscanf.o
739
740PORTI18N=			\
741	getwchar.o		\
742	putwchar.o		\
743	putws.o			\
744	strtows.o		\
745	wcsnlen.o		\
746	wcsstr.o		\
747	wcstoimax.o		\
748	wcstol.o		\
749	wcstoul.o		\
750	wcswcs.o		\
751	wmemchr.o		\
752	wmemcmp.o		\
753	wmemcpy.o		\
754	wmemmove.o		\
755	wmemset.o		\
756	wscat.o			\
757	wschr.o			\
758	wscmp.o			\
759	wscpy.o			\
760	wscspn.o		\
761	wsdup.o			\
762	wslen.o			\
763	wsncat.o		\
764	wsncmp.o		\
765	wsncpy.o		\
766	wspbrk.o		\
767	wsprintf.o		\
768	wsrchr.o		\
769	wsscanf.o		\
770	wsspn.o			\
771	wstod.o			\
772	wstok.o			\
773	wstol.o			\
774	wstoll.o		\
775	wsxfrm.o		\
776	gettext.o		\
777	gettext_gnu.o		\
778	gettext_real.o		\
779	gettext_util.o		\
780	plural_parser.o		\
781	wdresolve.o		\
782	_ctype.o		\
783	isascii.o		\
784	toascii.o
785
786PORTI18N_COND=			\
787	wcstol_longlong.o	\
788	wcstoul_longlong.o
789
790PORTLOCALE=			\
791	big5.o			\
792	btowc.o			\
793	collate.o		\
794	collcmp.o		\
795	euc.o			\
796	fnmatch.o		\
797	fgetwc.o		\
798	fgetws.o		\
799	fix_grouping.o		\
800	fputwc.o		\
801	fputws.o		\
802	fwide.o			\
803	gb18030.o		\
804	gb2312.o		\
805	gbk.o			\
806	getdate.o		\
807	isdigit.o		\
808	iswctype.o		\
809	ldpart.o		\
810	lmessages.o		\
811	lnumeric.o		\
812	lmonetary.o		\
813	localeconv.o		\
814	localeimpl.o		\
815	mbftowc.o		\
816	mblen.o			\
817	mbrlen.o		\
818	mbrtowc.o		\
819	mbsinit.o		\
820	mbsnrtowcs.o		\
821	mbsrtowcs.o		\
822	mbstowcs.o		\
823	mbtowc.o		\
824	mskanji.o		\
825	nextwctype.o		\
826	nl_langinfo.o		\
827	none.o			\
828	rune.o			\
829	runetype.o		\
830	setlocale.o		\
831	setrunelocale.o		\
832	strcasecmp.o		\
833	strcasestr.o		\
834	strcoll.o		\
835	strfmon.o		\
836	strftime.o		\
837	strncasecmp.o		\
838	strptime.o		\
839	strxfrm.o		\
840	table.o			\
841	timelocal.o		\
842	tolower.o		\
843	towlower.o		\
844	ungetwc.o		\
845	utf8.o			\
846	wcrtomb.o		\
847	wcscasecmp.o		\
848	wcscoll.o		\
849	wcsftime.o		\
850	wcsnrtombs.o		\
851	wcsrtombs.o		\
852	wcswidth.o		\
853	wcstombs.o		\
854	wcsxfrm.o		\
855	wctob.o			\
856	wctomb.o		\
857	wctrans.o		\
858	wctype.o		\
859	wcwidth.o		\
860	wscol.o
861
862AIOOBJS=			\
863	aio.o			\
864	aio_alloc.o		\
865	posix_aio.o
866
867RTOBJS=				\
868	clock_timer.o		\
869	mqueue.o		\
870	pos4obj.o		\
871	sched.o			\
872	sem.o			\
873	shm.o			\
874	sigev_thread.o
875
876TPOOLOBJS=			\
877	thread_pool.o
878
879THREADSOBJS=			\
880	alloc.o			\
881	assfail.o		\
882	cancel.o		\
883	c11_thr.o		\
884	door_calls.o		\
885	tmem.o			\
886	pthr_attr.o		\
887	pthr_barrier.o		\
888	pthr_cond.o		\
889	pthr_mutex.o		\
890	pthr_rwlock.o		\
891	pthread.o		\
892	rwlock.o		\
893	scalls.o		\
894	sema.o			\
895	sigaction.o		\
896	spawn.o			\
897	synch.o			\
898	tdb_agent.o		\
899	thr.o			\
900	thread_interface.o	\
901	tls.o			\
902	tsd.o
903
904THREADSMACHOBJS=		\
905	machdep.o
906
907THREADSASMOBJS=			\
908	asm_subr.o
909
910UNICODEOBJS=			\
911	u8_textprep.o		\
912	uconv.o
913
914UNWINDMACHOBJS=			\
915	unwind.o
916
917UNWINDASMOBJS=			\
918	unwind_frame.o
919
920# objects that implement the transitional large file API
921PORTSYS64=			\
922	lockf64.o		\
923	stat64.o
924
925PORTSYS=			\
926	_autofssys.o		\
927	access.o		\
928	acctctl.o		\
929	bsd_signal.o		\
930	chmod.o			\
931	chown.o			\
932	corectl.o		\
933	epoll.o			\
934	eventfd.o		\
935	exacctsys.o		\
936	execl.o			\
937	execle.o		\
938	execv.o			\
939	fcntl.o			\
940	getpagesizes.o		\
941	getpeerucred.o		\
942	inst_sync.o		\
943	issetugid.o		\
944	label.o			\
945	link.o			\
946	lockf.o			\
947	lwp.o			\
948	lwp_cond.o		\
949	lwp_rwlock.o		\
950	lwp_sigmask.o		\
951	meminfosys.o		\
952	mkdir.o			\
953	mknod.o			\
954	msgsys.o		\
955	nfssys.o		\
956	open.o			\
957	pgrpsys.o		\
958	posix_sigwait.o		\
959	ppriv.o			\
960	psetsys.o		\
961	rctlsys.o		\
962	readlink.o		\
963	rename.o		\
964	sbrk.o			\
965	semsys.o		\
966	set_errno.o		\
967	sharefs.o		\
968	shmsys.o		\
969	sidsys.o		\
970	siginterrupt.o		\
971	signal.o		\
972	signalfd.o		\
973	sigpending.o		\
974	sigstack.o		\
975	stat.o			\
976	symlink.o		\
977	tasksys.o		\
978	time.o			\
979	time_util.o		\
980	timerfd.o		\
981	ucontext.o		\
982	unlink.o		\
983	ustat.o			\
984	utimesys.o		\
985	zone.o
986
987PORTREGEX=			\
988	glob.o			\
989	regcmp.o		\
990	regcomp.o		\
991	regerror.o		\
992	regex.o			\
993	regexec.o		\
994	regfree.o		\
995	wordexp.o
996
997PORTREGEX64=			\
998	glob64.o
999
1000MOSTOBJS=			\
1001	$(STRETS)		\
1002	$(CRTOBJS)		\
1003	$(DYNOBJS)		\
1004	$(FPOBJS)		\
1005	$(FPASMOBJS)		\
1006	$(ATOMICOBJS)		\
1007	$(CHACHAOBJS)		\
1008	$(XATTROBJS)		\
1009	$(COMOBJS)		\
1010	$(DTRACEOBJS)		\
1011	$(GENOBJS)		\
1012	$(PORTFP)		\
1013	$(PORTGEN)		\
1014	$(PORTGEN64)		\
1015	$(PORTI18N)		\
1016	$(PORTI18N_COND)	\
1017	$(PORTINET)		\
1018	$(PORTLOCALE)		\
1019	$(PORTPRINT)		\
1020	$(PORTPRINT_C89)	\
1021	$(PORTPRINT_W)		\
1022	$(PORTREGEX)		\
1023	$(PORTREGEX64)		\
1024	$(PORTSTDIO)		\
1025	$(PORTSTDIO64)		\
1026	$(PORTSTDIO_C89)	\
1027	$(PORTSTDIO_W)		\
1028	$(PORTSYS)		\
1029	$(PORTSYS64)		\
1030	$(AIOOBJS)		\
1031	$(RTOBJS)		\
1032	$(SECFLAGSOBJS)		\
1033	$(TPOOLOBJS)		\
1034	$(THREADSOBJS)		\
1035	$(THREADSMACHOBJS)	\
1036	$(THREADSASMOBJS)	\
1037	$(UNICODEOBJS)		\
1038	$(UNWINDMACHOBJS)	\
1039	$(UNWINDASMOBJS)	\
1040	$(COMSYSOBJS)		\
1041	$(SYSOBJS)		\
1042	$(COMSYSOBJS64)		\
1043	$(SYSOBJS64)		\
1044	$(VALUES)
1045
1046TRACEOBJS=			\
1047	plockstat.o
1048
1049# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
1050# modules whose source is provided in the $(SRC)/lib/crt directory.
1051# This must be done because otherwise the Sun C compiler would insert
1052# its own versions of these modules and those versions contain code
1053# to call out to C++ initialization functions.  Such C++ initialization
1054# functions can call back into libc before thread initialization is
1055# complete and this leads to segmentation violations and other problems.
1056# Since libc contains no C++ code, linking with the minimal crti.o and
1057# crtn.o modules is safe and avoids the problems described above.
1058OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1059CRTSRCS= ../../crt/i386
1060
1061LDPASS_OFF=	$(POUND_SIGN)
1062
1063# include common library definitions
1064include ../../Makefile.lib
1065
1066# we need to override the default SONAME here because we might
1067# be building a variant object (still libc.so.1, but different filename)
1068SONAME = libc.so.1
1069
1070CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
1071
1072# This is necessary to avoid problems with calling _ex_unwind().
1073# We probably don't want any inlining anyway.
1074XINLINE = -xinline=
1075CFLAGS += $(XINLINE)
1076
1077CERRWARN += -_gcc=-Wno-parentheses
1078CERRWARN += -_gcc=-Wno-switch
1079CERRWARN += $(CNOWARN_UNINIT)
1080CERRWARN += -_gcc=-Wno-unused-value
1081CERRWARN += -_gcc=-Wno-unused-label
1082CERRWARN += -_gcc=-Wno-unused-variable
1083CERRWARN += -_gcc=-Wno-type-limits
1084CERRWARN += -_gcc=-Wno-char-subscripts
1085CERRWARN += -_gcc=-Wno-clobbered
1086CERRWARN += -_gcc=-Wno-unused-function
1087CERRWARN += -_gcc=-Wno-address
1088
1089$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
1090
1091# not linted
1092SMATCH=off
1093
1094# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1095# enables ASSERT() checking in the threads portion of the library.
1096# This is automatically enabled for DEBUG builds, not for non-debug builds.
1097THREAD_DEBUG =
1098$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1099
1100# Make string literals read-only to save memory.
1101CFLAGS += $(XSTRCONST)
1102
1103ALTPICS= $(TRACEOBJS:%=pics/%)
1104
1105$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) \
1106		$(EXTPICS) $(LDLIBS)
1107
1108MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1109
1110#
1111# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
1112#
1113CFLAGS +=	$(EXTN_CFLAGS)
1114CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
1115		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1116ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
1117
1118# As a favor to the dtrace syscall provider, libc still calls the
1119# old syscall traps that have been obsoleted by the *at() interfaces.
1120# Delete this to compile libc using only the new *at() system call traps
1121CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1122
1123# Inform the run-time linker about libc specialized initialization
1124RTLDINFO =	-z rtldinfo=tls_rtldinfo
1125DYNFLAGS +=	$(RTLDINFO)
1126
1127# Force libc's internal references to be resolved immediately upon loading
1128# in order to avoid critical region problems.  Since almost all libc symbols
1129# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1130DYNFLAGS +=	-znow
1131
1132DYNFLAGS +=	-e __rtboot
1133DYNFLAGS +=	$(EXTN_DYNFLAGS)
1134
1135# Inform the kernel about the initial DTrace area (in case
1136# libc is being used as the interpreter / runtime linker).
1137DTRACE_DATA =	-zdtrace=dtrace_data
1138DYNFLAGS +=	$(DTRACE_DATA)
1139
1140# DTrace needs an executable data segment.
1141MAPFILE.NED=
1142
1143BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1144
1145# Override this top level flag so the compiler builds in its native
1146# C99 mode.  This has been enabled to support the complex arithmetic
1147# added to libc.
1148CSTD=	$(CSTD_GNU99)
1149
1150# libc method of building an archive
1151# The "$(GREP) -v ' L '" part is necessary only until
1152# lorder is fixed to ignore thread-local variables.
1153BUILD.AR= $(RM) $@ ; \
1154	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1155
1156# extra files for the clean target
1157CLEANFILES +=			\
1158	$(LIBCDIR)/port/gen/errlst.c	\
1159	$(LIBCDIR)/port/gen/new_list.c	\
1160	assym.h			\
1161	genassym		\
1162	crt/_rtld.s		\
1163	crt/_rtbootld.s		\
1164	pics/_rtbootld.o	\
1165	pics/crti.o		\
1166	pics/crtn.o		\
1167	$(ALTPICS)
1168
1169CLOBBERFILES +=	$(LIB_PIC)
1170
1171# conditional assignments
1172$(DYNLIB) := CRTI = crti.o
1173$(DYNLIB) := CRTN = crtn.o
1174
1175# Files which need the threads .il inline template
1176TIL=				\
1177	aio.o			\
1178	alloc.o			\
1179	assfail.o		\
1180	atexit.o		\
1181	atfork.o		\
1182	cancel.o		\
1183	door_calls.o		\
1184	err.o			\
1185	errno.o			\
1186	lwp.o			\
1187	ma.o			\
1188	machdep.o		\
1189	posix_aio.o		\
1190	pthr_attr.o		\
1191	pthr_barrier.o		\
1192	pthr_cond.o		\
1193	pthr_mutex.o		\
1194	pthr_rwlock.o		\
1195	pthread.o		\
1196	rand.o			\
1197	rwlock.o		\
1198	scalls.o		\
1199	sched.o			\
1200	sema.o			\
1201	sigaction.o		\
1202	sigev_thread.o		\
1203	spawn.o			\
1204	stack.o			\
1205	synch.o			\
1206	tdb_agent.o		\
1207	thr.o			\
1208	thread_interface.o	\
1209	thread_pool.o		\
1210	tls.o			\
1211	tsd.o			\
1212	tmem.o			\
1213	unwind.o
1214
1215THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1216$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1217
1218# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1219
1220# large-file-aware components that should be built large
1221
1222$(COMSYSOBJS64:%=pics/%) := \
1223	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1224
1225$(SYSOBJS64:%=pics/%) := \
1226	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1227
1228$(PORTGEN64:%=pics/%) := \
1229	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1230
1231$(PORTREGEX64:%=pics/%) := \
1232	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1233
1234$(PORTSTDIO64:%=pics/%) := \
1235	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1236
1237$(PORTSYS64:%=pics/%) := \
1238	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1239
1240$(PORTSTDIO_W:%=pics/%) := \
1241	CPPFLAGS += -D_WIDE
1242
1243$(PORTPRINT_W:%=pics/%) := \
1244	CPPFLAGS += -D_WIDE
1245
1246$(PORTPRINT_C89:%=pics/%) := \
1247	CPPFLAGS += -D_C89_INTMAX32
1248
1249$(PORTSTDIO_C89:%=pics/%) := \
1250	CPPFLAGS += -D_C89_INTMAX32
1251
1252$(PORTI18N_COND:%=pics/%) := \
1253	CPPFLAGS += -D_WCS_LONGLONG
1254
1255pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1256
1257pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1258pics/gettimeofday.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1259
1260.KEEP_STATE:
1261
1262all: $(LIBS) $(LIB_PIC)
1263
1264# object files that depend on inline template
1265$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1266# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1267
1268# include common libc targets
1269include $(LIBCDIR)/Makefile.targ
1270
1271# We need to strip out all CTF and DOF data from the static library
1272$(LIB_PIC) := DIR = pics
1273$(LIB_PIC): pics $$(PICS)
1274	$(BUILD.AR)
1275	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1276	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1277	$(AR) -ts $@ > /dev/null
1278	$(POST_PROCESS_A)
1279
1280$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1281	$(CC) $($(MACH)_XARCH) $(CPPFLAGS) -_smatch=off $(CTF_FLAGS) -O -S \
1282	    $(C_PICFLAGS) $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1283	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1284	$(RM) $(LIBCBASE)/crt/_rtld.s
1285
1286# partially built from C source
1287pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1288	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1289	$(CTFCONVERT_O)
1290
1291ASSYMDEP_OBJS=			\
1292	_lwp_mutex_unlock.o	\
1293	_stack_grow.o		\
1294	getcontext.o		\
1295	setjmp.o		\
1296	tls_get_addr.o		\
1297	vforkx.o
1298
1299$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1300
1301$(ASSYMDEP_OBJS:%=pics/%): assym.h
1302
1303# assym.h build rules
1304
1305GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1306LDFLAGS.native = $(LDASSERTS) $(ZASSERTDEFLIB)=libc.so $(BDIRECT)
1307
1308genassym: $(GENASSYM_C)
1309	$(NATIVECC) $(NATIVE_CFLAGS) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc	\
1310		-D__EXTENSIONS__ $(CPPFLAGS.native) $(LDFLAGS.native) \
1311		-o $@ $(GENASSYM_C)
1312
1313OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1314
1315assym.h: $(OFFSETS) genassym
1316	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1317	./genassym >>$@
1318
1319# derived C source and related explicit dependencies
1320$(LIBCDIR)/port/gen/errlst.c + \
1321$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1322	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1323
1324pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1325
1326pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1327