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