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