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