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