xref: /titanic_52/usr/src/lib/libc/i386/Makefile.com (revision a93a1f58a8763fa69172980b98e3d24720c1136e)
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 2007 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
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
86COMOBJS=			\
87	bcmp.o			\
88	bcopy.o			\
89	bsearch.o		\
90	bzero.o			\
91	ffs.o			\
92	qsort.o			\
93	strtol.o		\
94	strtoul.o
95
96DTRACEOBJS=			\
97	dtrace_data.o
98
99GENOBJS=			\
100	_div64.o		\
101	_divdi3.o		\
102	_getsp.o		\
103	_mul64.o		\
104	abs.o			\
105	alloca.o		\
106	byteorder.o		\
107	cuexit.o		\
108	ecvt.o			\
109	errlst.o		\
110	i386_data.o		\
111	ladd.o			\
112	ldivide.o		\
113	lexp10.o		\
114	llog10.o		\
115	lmul.o			\
116	lock.o			\
117	lshiftl.o		\
118	lsign.o			\
119	lsub.o			\
120	ltostr.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	__fcntl.o		\
165	__getloadavg.o		\
166	__rusagesys.o		\
167	__signotify.o		\
168	__sigrt.o		\
169	__time.o		\
170	_lgrp_home_fast.o	\
171	_lgrpsys.o		\
172	_nfssys.o		\
173	_portfs.o		\
174	_pset.o			\
175	_rename.o		\
176	_rpcsys.o		\
177	_sigaction.o		\
178	_so_accept.o		\
179	_so_bind.o		\
180	_so_connect.o		\
181	_so_getpeername.o	\
182	_so_getsockname.o	\
183	_so_getsockopt.o	\
184	_so_listen.o		\
185	_so_recv.o		\
186	_so_recvfrom.o		\
187	_so_recvmsg.o		\
188	_so_send.o		\
189	_so_sendmsg.o		\
190	_so_sendto.o		\
191	_so_setsockopt.o	\
192	_so_shutdown.o		\
193	_so_socket.o		\
194	_so_socketpair.o	\
195	_sockconfig.o		\
196	access.o		\
197	acct.o			\
198	acl.o			\
199	adjtime.o		\
200	alarm.o			\
201	brk.o			\
202	chdir.o			\
203	chmod.o			\
204	chown.o			\
205	chroot.o		\
206	cladm.o			\
207	close.o			\
208	creat.o			\
209	dup.o			\
210	execve.o		\
211	exit.o			\
212	facl.o			\
213	fchdir.o		\
214	fchmod.o		\
215	fchown.o		\
216	fchroot.o		\
217	fdsync.o		\
218	fpathconf.o		\
219	fstat.o			\
220	fstatfs.o		\
221	fstatvfs.o		\
222	getcpuid.o		\
223	getdents.o		\
224	getegid.o		\
225	geteuid.o		\
226	getgid.o		\
227	getgroups.o		\
228	gethrtime.o		\
229	getitimer.o		\
230	getmsg.o		\
231	getpagesizes.o		\
232	getpid.o		\
233	getpmsg.o		\
234	getppid.o		\
235	getrlimit.o		\
236	getuid.o		\
237	gtty.o			\
238	install_utrap.o		\
239	ioctl.o			\
240	kaio.o			\
241	kill.o			\
242	lchown.o		\
243	link.o			\
244	llseek.o		\
245	lseek.o			\
246	lstat.o			\
247	memcntl.o		\
248	mincore.o		\
249	mkdir.o			\
250	mknod.o			\
251	mmap.o			\
252	modctl.o		\
253	mount.o			\
254	mprotect.o		\
255	munmap.o		\
256	nice.o			\
257	ntp_adjtime.o		\
258	ntp_gettime.o		\
259	open.o			\
260	p_online.o		\
261	pathconf.o		\
262	pause.o			\
263	pcsample.o		\
264	pollsys.o		\
265	pread.o			\
266	priocntlset.o		\
267	processor_bind.o	\
268	processor_info.o	\
269	profil.o		\
270	putmsg.o		\
271	putpmsg.o		\
272	pwrite.o		\
273	read.o			\
274	readlink.o		\
275	readv.o			\
276	resolvepath.o		\
277	rmdir.o			\
278	seteguid.o		\
279	setgid.o		\
280	setgroups.o		\
281	setitimer.o		\
282	setreid.o		\
283	setrlimit.o		\
284	setuid.o		\
285	sigaltstk.o		\
286	sigprocmsk.o		\
287	sigsendset.o		\
288	sigsuspend.o		\
289	stat.o			\
290	statfs.o		\
291	statvfs.o		\
292	stty.o			\
293	symlink.o		\
294	sync.o			\
295	sysconfig.o		\
296	sysfs.o			\
297	sysinfo.o		\
298	syslwp.o		\
299	times.o			\
300	ulimit.o		\
301	umask.o			\
302	umount2.o		\
303	unlink.o		\
304	utime.o			\
305	utimes.o		\
306	utssys.o		\
307	uucopy.o		\
308	vhangup.o		\
309	waitid.o		\
310	write.o			\
311	writev.o		\
312	yield.o
313
314SYSOBJS=			\
315	__clock_gettime.o	\
316	__getcontext.o		\
317	__uadmin.o		\
318	_lwp_mutex_unlock.o	\
319	_stack_grow.o		\
320	door.o			\
321	forkx.o			\
322	forkallx.o		\
323	fxstat.o		\
324	getcontext.o		\
325	gettimeofday.o		\
326	lwp_private.o		\
327	lxstat.o		\
328	nuname.o		\
329	pipe.o			\
330	ptrace.o		\
331	syscall.o		\
332	sysi86.o		\
333	tls_get_addr.o		\
334	uadmin.o		\
335	umount.o		\
336	uname.o			\
337	vforkx.o		\
338	xmknod.o		\
339	xstat.o
340
341# objects under ../port which contain transitional large file interfaces
342PORTGEN64=			\
343	_xftw64.o		\
344	attropen64.o		\
345	ftw64.o			\
346	mkstemp64.o		\
347	nftw64.o		\
348	tell64.o		\
349	truncate64.o
350
351# objects from source under ../port
352PORTFP=				\
353	__flt_decim.o		\
354	__flt_rounds.o		\
355	__tbl_10_b.o		\
356	__tbl_10_h.o		\
357	__tbl_10_s.o		\
358	__tbl_2_b.o		\
359	__tbl_2_h.o		\
360	__tbl_2_s.o		\
361	__tbl_fdq.o		\
362	__tbl_tens.o		\
363	__x_power.o		\
364	_base_sup.o		\
365	aconvert.o		\
366	decimal_bin.o		\
367	double_decim.o		\
368	econvert.o		\
369	fconvert.o		\
370	file_decim.o		\
371	finite.o		\
372	fp_data.o		\
373	func_decim.o		\
374	gconvert.o		\
375	hex_bin.o		\
376	ieee_globals.o		\
377	pack_float.o		\
378	sigfpe.o		\
379	string_decim.o
380
381PORTGEN=			\
382	_env_data.o		\
383	_xftw.o			\
384	a64l.o			\
385	abort.o			\
386	addsev.o		\
387	assert.o		\
388	atof.o			\
389	atoi.o			\
390	atol.o			\
391	atoll.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	l64a.o			\
480	lckpwdf.o		\
481	lconstants.o		\
482	lfind.o			\
483	lfmt.o			\
484	lfmt_log.o		\
485	llabs.o			\
486	lldiv.o			\
487	lltostr.o		\
488	localtime.o		\
489	lsearch.o		\
490	madvise.o		\
491	malloc.o		\
492	memalign.o		\
493	mkdev.o			\
494	mkdtemp.o		\
495	mkfifo.o		\
496	mkstemp.o		\
497	mktemp.o		\
498	mlock.o			\
499	mlockall.o		\
500	mon.o			\
501	msync.o			\
502	munlock.o		\
503	munlockall.o		\
504	ndbm.o			\
505	nftw.o			\
506	nlspath_checks.o	\
507	nsparse.o		\
508	nss_common.o		\
509	nss_dbdefs.o		\
510	nss_deffinder.o		\
511	opendir.o		\
512	opt_data.o		\
513	perror.o		\
514	pfmt.o			\
515	pfmt_data.o		\
516	pfmt_print.o		\
517	plock.o			\
518	poll.o			\
519	priocntl.o		\
520	privlib.o		\
521	priv_str_xlate.o	\
522	psiginfo.o		\
523	psignal.o		\
524	pt.o			\
525	putpwent.o		\
526	putspent.o		\
527	raise.o			\
528	rand.o			\
529	random.o		\
530	rctlops.o		\
531	readdir.o		\
532	readdir_r.o		\
533	realpath.o		\
534	reboot.o		\
535	regexpr.o		\
536	rename.o		\
537	rewinddir.o		\
538	rindex.o		\
539	scandir.o		\
540	seekdir.o		\
541	select.o		\
542	select_large_fdset.o	\
543	setlabel.o		\
544	setpriority.o		\
545	settimeofday.o		\
546	sh_locks.o		\
547	sigflag.o		\
548	siglist.o		\
549	sigsend.o		\
550	sigsetops.o		\
551	ssignal.o		\
552	stack.o			\
553	str2sig.o		\
554	strcase_charmap.o	\
555	strcasecmp.o		\
556	strcspn.o		\
557	strdup.o		\
558	strerror.o		\
559	strlcat.o		\
560	strlcpy.o		\
561	strncasecmp.o		\
562	strpbrk.o		\
563	strsignal.o		\
564	strspn.o		\
565	strstr.o		\
566	strtod.o		\
567	strtoimax.o		\
568	strtok.o		\
569	strtok_r.o		\
570	strtoll.o		\
571	strtoull.o		\
572	strtoumax.o		\
573	swab.o			\
574	swapctl.o		\
575	sysconf.o		\
576	syslog.o		\
577	tcdrain.o		\
578	tcflow.o		\
579	tcflush.o		\
580	tcgetattr.o		\
581	tcgetpgrp.o		\
582	tcgetsid.o		\
583	tcsendbreak.o		\
584	tcsetattr.o		\
585	tcsetpgrp.o		\
586	tell.o			\
587	telldir.o		\
588	tfind.o			\
589	time_data.o		\
590	time_gdata.o		\
591	truncate.o		\
592	tsdalloc.o		\
593	tsearch.o		\
594	ttyname.o		\
595	ttyslot.o		\
596	ualarm.o		\
597	ucred.o			\
598	valloc.o		\
599	vlfmt.o			\
600	vpfmt.o			\
601	wait3.o			\
602	wait4.o			\
603	waitpid.o		\
604	walkstack.o		\
605	wdata.o			\
606	xgetwidth.o		\
607	xpg4.o			\
608	xpg6.o
609
610PORTPRINT_W=			\
611	doprnt_w.o
612
613PORTPRINT=			\
614	doprnt.o		\
615	fprintf.o		\
616	printf.o		\
617	snprintf.o		\
618	sprintf.o		\
619	vfprintf.o		\
620	vprintf.o		\
621	vsnprintf.o		\
622	vsprintf.o		\
623	vwprintf.o		\
624	wprintf.o
625
626# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
627PORTPRINT_C89=			\
628	vfprintf_c89.o		\
629	vprintf_c89.o		\
630	vsnprintf_c89.o		\
631	vsprintf_c89.o		\
632	vwprintf_c89.o
633
634PORTSTDIO_C89=			\
635	vscanf_c89.o		\
636	vwscanf_c89.o		\
637
638# portable stdio objects that contain large file interfaces.
639# Note: fopen64 is a special case, as we build it small.
640PORTSTDIO64=			\
641	fopen64.o		\
642	fpos64.o
643
644PORTSTDIO_W=			\
645	doscan_w.o
646
647PORTSTDIO=			\
648	__extensions.o		\
649	_endopen.o		\
650	_filbuf.o		\
651	_findbuf.o		\
652	_flsbuf.o		\
653	_wrtchk.o		\
654	clearerr.o		\
655	ctermid.o		\
656	ctermid_r.o		\
657	cuserid.o		\
658	data.o			\
659	doscan.o		\
660	fdopen.o		\
661	feof.o			\
662	ferror.o		\
663	fgetc.o			\
664	fgets.o			\
665	fileno.o		\
666	flockf.o		\
667	flush.o			\
668	fopen.o			\
669	fpos.o			\
670	fputc.o			\
671	fputs.o			\
672	fread.o			\
673	fseek.o			\
674	fseeko.o		\
675	ftell.o			\
676	ftello.o		\
677	fwrite.o		\
678	getc.o			\
679	getchar.o		\
680	getpass.o		\
681	gets.o			\
682	getw.o			\
683	mse.o			\
684	popen.o			\
685	putc.o			\
686	putchar.o		\
687	puts.o			\
688	putw.o			\
689	rewind.o		\
690	scanf.o			\
691	setbuf.o		\
692	setbuffer.o		\
693	setvbuf.o		\
694	system.o		\
695	tempnam.o		\
696	tmpfile.o		\
697	tmpnam_r.o		\
698	ungetc.o		\
699	vscanf.o		\
700	vwscanf.o		\
701	wscanf.o
702
703PORTI18N=			\
704	__fgetwc_xpg5.o		\
705	__fgetws_xpg5.o		\
706	__fputwc_xpg5.o		\
707	__fputws_xpg5.o		\
708	__ungetwc_xpg5.o	\
709	getwchar.o		\
710	putwchar.o		\
711	putws.o			\
712	strtows.o		\
713	wcsstr.o		\
714	wcstoimax.o		\
715	wcstol.o		\
716	wcstoul.o		\
717	wcswcs.o		\
718	wmemchr.o		\
719	wmemcmp.o		\
720	wmemcpy.o		\
721	wmemmove.o		\
722	wmemset.o		\
723	wscasecmp.o		\
724	wscat.o			\
725	wschr.o			\
726	wscmp.o			\
727	wscpy.o			\
728	wscspn.o		\
729	wsdup.o			\
730	wslen.o			\
731	wsncasecmp.o		\
732	wsncat.o		\
733	wsncmp.o		\
734	wsncpy.o		\
735	wspbrk.o		\
736	wsprintf.o		\
737	wsrchr.o		\
738	wsscanf.o		\
739	wsspn.o			\
740	wstod.o			\
741	wstok.o			\
742	wstol.o			\
743	wstoll.o		\
744	wsxfrm.o		\
745	gettext.o		\
746	gettext_gnu.o		\
747	gettext_real.o		\
748	gettext_util.o		\
749	plural_parser.o		\
750	wdresolve.o		\
751	_ctype.o		\
752	isascii.o		\
753	toascii.o
754
755PORTI18N_COND=			\
756	wcstol_longlong.o	\
757	wcstoul_longlong.o
758
759AIOOBJS=			\
760	aio.o			\
761	aio_alloc.o		\
762	posix_aio.o
763
764RTOBJS=				\
765	clock_timer.o		\
766	fallocate.o		\
767	mqueue.o		\
768	pos4obj.o		\
769	sched.o			\
770	sem.o			\
771	shm.o			\
772	sigev_thread.o
773
774TPOOLOBJS=			\
775	thread_pool.o
776
777THREADSOBJS=			\
778	alloc.o			\
779	assfail.o		\
780	cancel.o		\
781	door_calls.o		\
782	pthr_attr.o		\
783	pthr_barrier.o		\
784	pthr_cond.o		\
785	pthr_mutex.o		\
786	pthr_rwlock.o		\
787	pthread.o		\
788	rtsched.o		\
789	rwlock.o		\
790	scalls.o		\
791	sema.o			\
792	sigaction.o		\
793	spawn.o			\
794	synch.o			\
795	tdb_agent.o		\
796	thr.o			\
797	thread_interface.o	\
798	tls.o			\
799	tsd.o
800
801THREADSMACHOBJS=		\
802	machdep.o
803
804THREADSASMOBJS=			\
805	asm_subr.o
806
807UNICODEOBJS=			\
808	u8_textprep.o		\
809	uconv.o
810
811UNWINDMACHOBJS=			\
812	unwind.o
813
814UNWINDASMOBJS=			\
815	unwind_frame.o
816
817# objects that implement the transitional large file API
818PORTSYS64=			\
819	fstatat64.o		\
820	lockf64.o		\
821	openat64.o
822
823PORTSYS=			\
824	_autofssys.o		\
825	acctctl.o		\
826	bsd_signal.o		\
827	corectl.o		\
828	exacctsys.o		\
829	execl.o			\
830	execle.o		\
831	execv.o			\
832	faccessat.o		\
833	fcntl.o			\
834	fsmisc.o		\
835	fstatat.o		\
836	fsync.o			\
837	getpeerucred.o		\
838	inst_sync.o		\
839	issetugid.o		\
840	label.o			\
841	libc_link.o		\
842	libc_open.o		\
843	lockf.o			\
844	lwp.o			\
845	lwp_cond.o		\
846	lwp_rwlock.o		\
847	lwp_sigmask.o		\
848	meminfosys.o		\
849	msgsys.o		\
850	nfssys.o		\
851	openat.o		\
852	pgrpsys.o		\
853	posix_sigwait.o		\
854	ppriv.o			\
855	psetsys.o		\
856	rctlsys.o		\
857	sbrk.o			\
858	semsys.o		\
859	set_errno.o		\
860	sharefs.o		\
861	shmsys.o		\
862	sidsys.o		\
863	siginterrupt.o		\
864	signal.o		\
865	sigpending.o		\
866	sigstack.o		\
867	tasksys.o		\
868	time.o			\
869	time_util.o		\
870	ucontext.o		\
871	ustat.o			\
872	zone.o
873
874PORTREGEX=			\
875	glob.o			\
876	regcmp.o		\
877	regex.o			\
878	wordexp.o
879
880MOSTOBJS=			\
881	$(STRETS)		\
882	$(CRTOBJS)		\
883	$(DYNOBJS)		\
884	$(FPOBJS)		\
885	$(FPASMOBJS)		\
886	$(ATOMICOBJS)		\
887	$(COMOBJS)		\
888	$(DTRACEOBJS)		\
889	$(GENOBJS)		\
890	$(PORTFP)		\
891	$(PORTGEN)		\
892	$(PORTGEN64)		\
893	$(PORTI18N)		\
894	$(PORTI18N_COND)	\
895	$(PORTPRINT)		\
896	$(PORTPRINT_C89)	\
897	$(PORTPRINT_W)		\
898	$(PORTREGEX)		\
899	$(PORTSTDIO)		\
900	$(PORTSTDIO64)		\
901	$(PORTSTDIO_C89)	\
902	$(PORTSTDIO_W)		\
903	$(PORTSYS)		\
904	$(PORTSYS64)		\
905	$(AIOOBJS)		\
906	$(RTOBJS)		\
907	$(TPOOLOBJS)		\
908	$(THREADSOBJS)		\
909	$(THREADSMACHOBJS)	\
910	$(THREADSASMOBJS)	\
911	$(UNICODEOBJS)		\
912	$(UNWINDMACHOBJS)	\
913	$(UNWINDASMOBJS)	\
914	$(COMSYSOBJS)		\
915	$(SYSOBJS)		\
916	$(COMSYSOBJS64)		\
917	$(SYSOBJS64)		\
918	$(VALUES)
919
920TRACEOBJS=			\
921	plockstat.o
922
923# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
924# modules whose source is provided in the $(SRC)/lib/common directory.
925# This must be done because otherwise the Sun C compiler would insert
926# its own versions of these modules and those versions contain code
927# to call out to C++ initialization functions.  Such C++ initialization
928# functions can call back into libc before thread initialization is
929# complete and this leads to segmentation violations and other problems.
930# Since libc contains no C++ code, linking with the minimal crti.o and
931# crtn.o modules is safe and avoids the problems described above.
932OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
933CRTSRCS= ../../common/i386
934
935LDPASS_OFF=	$(POUND_SIGN)
936
937# include common library definitions
938include ../../Makefile.lib
939
940# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
941# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
942# need to be compatible with the ones for the libc stuff.  Whenever the changes
943# that affect the compilation conditions of libc happened, those for libc_i18n
944# also need to be updated.
945
946# we need to override the default SONAME here because we might
947# be building a variant object (still libc.so.1, but different filename)
948SONAME = libc.so.1
949
950CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
951
952# This is necessary to avoid problems with calling _ex_unwind().
953# We probably don't want any inlining anyway.
954XINLINE = -xinline=
955CFLAGS += $(XINLINE)
956
957# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
958# enables ASSERT() checking in the threads portion of the library.
959# This is automatically enabled for DEBUG builds, not for non-debug builds.
960THREAD_DEBUG =
961$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
962
963CFLAGS += $(THREAD_DEBUG)
964
965ALTPICS= $(TRACEOBJS:%=pics/%)
966
967$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
968$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(LDLIBS)
969
970MAPFILES =	../port/mapfile-vers ../i386/mapfile-vers
971
972#
973# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
974#
975CFLAGS +=	$(EXTN_CFLAGS)
976CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) \
977		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
978ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
979
980# Conditionally add support for making |wordexp()| check whether
981# /usr/bin/ksh is ksh93 or not
982include ../../../Makefile.ksh93switch
983CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
984
985# Inform the run-time linker about libc specialized initialization
986RTLDINFO =	-z rtldinfo=tls_rtldinfo
987DYNFLAGS +=	$(RTLDINFO)
988
989DYNFLAGS +=	-e __rtboot
990DYNFLAGS +=	$(EXTN_DYNFLAGS)
991
992# Inform the kernel about the initial DTrace area (in case
993# libc is being used as the interpreter / runtime linker).
994DTRACE_DATA =	-zdtrace=dtrace_data
995DYNFLAGS +=	$(DTRACE_DATA)
996
997# DTrace needs an executable data segment.
998MAPFILE.NED=
999
1000BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1001
1002# Override this top level flag so the compiler builds in its native
1003# C99 mode.  This has been enabled to support the complex arithmetic
1004# added to libc.
1005C99MODE=	$(C99_ENABLE)
1006
1007# libc method of building an archive
1008BUILD.AR= $(RM) $@ ; \
1009	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
1010
1011# extra files for the clean target
1012CLEANFILES=			\
1013	../port/gen/errlst.c	\
1014	../port/gen/new_list.c	\
1015	assym.h			\
1016	genassym		\
1017	crt/_rtld.s		\
1018	crt/_rtbootld.s		\
1019	pics/_rtbootld.o	\
1020	pics/crti.o		\
1021	pics/crtn.o		\
1022	$(ALTPICS)
1023
1024CLOBBERFILES +=	$(LIB_PIC)
1025
1026# list of C source for lint
1027SRCS=							\
1028	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1029	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1030	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1031	$(PORTFP:%.o=../port/fp/%.c)			\
1032	$(PORTGEN:%.o=../port/gen/%.c)			\
1033	$(PORTI18N:%.o=../port/i18n/%.c)		\
1034	$(PORTPRINT:%.o=../port/print/%.c)		\
1035	$(PORTREGEX:%.o=../port/regex/%.c)		\
1036	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1037	$(PORTSYS:%.o=../port/sys/%.c)			\
1038	$(AIOOBJS:%.o=../port/aio/%.c)			\
1039	$(RTOBJS:%.o=../port/rt/%.c)			\
1040	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
1041	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1042	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1043	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1044	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1045	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1046	$(LIBCBASE)/gen/ecvt.c				\
1047	$(LIBCBASE)/gen/lexp10.c			\
1048	$(LIBCBASE)/gen/llog10.c			\
1049	$(LIBCBASE)/gen/ltostr.c			\
1050	$(LIBCBASE)/gen/makectxt.c			\
1051	$(LIBCBASE)/gen/siginfolst.c			\
1052	$(LIBCBASE)/gen/siglongjmp.c			\
1053	$(LIBCBASE)/gen/strcmp.c			\
1054	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1055	$(LIBCBASE)/sys/ptrace.c			\
1056	$(LIBCBASE)/sys/uadmin.c
1057
1058# conditional assignments
1059$(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
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	rtsched.o		\
1085	rwlock.o		\
1086	scalls.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