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