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