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