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