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