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