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