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