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