xref: /illumos-gate/usr/src/lib/libc/i386/Makefile.com (revision 374ae87f60894937d3c6e53ec4a739188e702ea5)
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# 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	_rtbootld.o
46
47FPOBJS=				\
48	_D_cplx_div.o		\
49	_D_cplx_div_ix.o	\
50	_D_cplx_div_rx.o	\
51	_D_cplx_lr_div.o	\
52	_D_cplx_lr_div_ix.o	\
53	_D_cplx_lr_div_rx.o	\
54	_D_cplx_mul.o		\
55	_F_cplx_div.o		\
56	_F_cplx_div_ix.o	\
57	_F_cplx_div_rx.o	\
58	_F_cplx_lr_div.o	\
59	_F_cplx_lr_div_ix.o	\
60	_F_cplx_lr_div_rx.o	\
61	_F_cplx_mul.o		\
62	_X_cplx_div.o		\
63	_X_cplx_div_ix.o	\
64	_X_cplx_div_rx.o	\
65	_X_cplx_lr_div.o	\
66	_X_cplx_lr_div_ix.o	\
67	_X_cplx_lr_div_rx.o	\
68	_X_cplx_mul.o		\
69	_base_il.o		\
70	fpgetmask.o		\
71	fpgetround.o		\
72	fpgetsticky.o		\
73	fpsetmask.o		\
74	fpsetround.o		\
75	fpsetsticky.o		\
76	fpstart.o
77
78FPASMOBJS=			\
79	__xgetRD.o		\
80	_xtoll.o		\
81	_xtoull.o		\
82	fpcw.o
83
84ATOMICOBJS=			\
85	atomic.o
86
87XATTROBJS=			\
88	xattr_common.o
89
90COMOBJS=			\
91	bcmp.o			\
92	bcopy.o			\
93	bsearch.o		\
94	bzero.o			\
95	ffs.o			\
96	qsort.o			\
97	strtol.o		\
98	strtoul.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	cuexit.o		\
112	ecvt.o			\
113	errlst.o		\
114	i386_data.o		\
115	ladd.o			\
116	ldivide.o		\
117	lexp10.o		\
118	llog10.o		\
119	lmul.o			\
120	lock.o			\
121	lshiftl.o		\
122	lsign.o			\
123	lsub.o			\
124	ltostr.o		\
125	makectxt.o		\
126	memccpy.o		\
127	memchr.o		\
128	memcmp.o		\
129	memcpy.o		\
130	memset.o		\
131	new_list.o		\
132	setjmp.o		\
133	siginfolst.o		\
134	siglongjmp.o		\
135	strcat.o		\
136	strchr.o		\
137	strcmp.o		\
138	strcpy.o		\
139	strlen.o		\
140	strncat.o		\
141	strncmp.o		\
142	strncpy.o		\
143	strnlen.o		\
144	strrchr.o		\
145	sync_instruction_memory.o
146
147# sysobjs that contain large-file interfaces
148COMSYSOBJS64=			\
149	creat64.o		\
150	fstat64.o		\
151	fstatvfs64.o		\
152	getdents64.o		\
153	getrlimit64.o		\
154	lseek64.o		\
155	lstat64.o		\
156	open64.o		\
157	pread64.o		\
158	pwrite64.o		\
159	setrlimit64.o		\
160	stat64.o		\
161	statvfs64.o
162
163SYSOBJS64=			\
164	mmap64.o
165
166COMSYSOBJS=			\
167	__clock_timer.o		\
168	__getloadavg.o		\
169	__rusagesys.o		\
170	__signotify.o		\
171	__sigrt.o		\
172	__time.o		\
173	_lgrp_home_fast.o	\
174	_lgrpsys.o		\
175	_nfssys.o		\
176	_portfs.o		\
177	_pset.o			\
178	_rpcsys.o		\
179	_sigaction.o		\
180	_so_accept.o		\
181	_so_bind.o		\
182	_so_connect.o		\
183	_so_getpeername.o	\
184	_so_getsockname.o	\
185	_so_getsockopt.o	\
186	_so_listen.o		\
187	_so_recv.o		\
188	_so_recvfrom.o		\
189	_so_recvmsg.o		\
190	_so_send.o		\
191	_so_sendmsg.o		\
192	_so_sendto.o		\
193	_so_setsockopt.o	\
194	_so_shutdown.o		\
195	_so_socket.o		\
196	_so_socketpair.o	\
197	_sockconfig.o		\
198	access.o		\
199	acct.o			\
200	acl.o			\
201	adjtime.o		\
202	alarm.o			\
203	brk.o			\
204	chdir.o			\
205	chmod.o			\
206	chown.o			\
207	chroot.o		\
208	cladm.o			\
209	close.o			\
210	creat.o			\
211	dup.o			\
212	execve.o		\
213	exit.o			\
214	facl.o			\
215	fchdir.o		\
216	fchmod.o		\
217	fchown.o		\
218	fchroot.o		\
219	fcntl.o			\
220	fdsync.o		\
221	fpathconf.o		\
222	fstat.o			\
223	fstatfs.o		\
224	fstatvfs.o		\
225	getcpuid.o		\
226	getdents.o		\
227	getegid.o		\
228	geteuid.o		\
229	getgid.o		\
230	getgroups.o		\
231	gethrtime.o		\
232	getitimer.o		\
233	getmsg.o		\
234	getpid.o		\
235	getpmsg.o		\
236	getppid.o		\
237	getrlimit.o		\
238	getuid.o		\
239	gtty.o			\
240	install_utrap.o		\
241	ioctl.o			\
242	kaio.o			\
243	kill.o			\
244	lchown.o		\
245	link.o			\
246	llseek.o		\
247	lseek.o			\
248	lstat.o			\
249	memcntl.o		\
250	mincore.o		\
251	mkdir.o			\
252	mknod.o			\
253	mmap.o			\
254	modctl.o		\
255	mount.o			\
256	mprotect.o		\
257	munmap.o		\
258	nice.o			\
259	ntp_adjtime.o		\
260	ntp_gettime.o		\
261	open.o			\
262	p_online.o		\
263	pathconf.o		\
264	pause.o			\
265	pcsample.o		\
266	pollsys.o		\
267	pread.o			\
268	priocntlset.o		\
269	processor_bind.o	\
270	processor_info.o	\
271	profil.o		\
272	putmsg.o		\
273	putpmsg.o		\
274	pwrite.o		\
275	read.o			\
276	readlink.o		\
277	readv.o			\
278	rename.o		\
279	resolvepath.o		\
280	rmdir.o			\
281	seteguid.o		\
282	setgid.o		\
283	setgroups.o		\
284	setitimer.o		\
285	setreid.o		\
286	setrlimit.o		\
287	setuid.o		\
288	sigaltstk.o		\
289	sigprocmsk.o		\
290	sigsendset.o		\
291	sigsuspend.o		\
292	stat.o			\
293	statfs.o		\
294	statvfs.o		\
295	stty.o			\
296	symlink.o		\
297	sync.o			\
298	sysconfig.o		\
299	sysfs.o			\
300	sysinfo.o		\
301	syslwp.o		\
302	times.o			\
303	ulimit.o		\
304	umask.o			\
305	umount2.o		\
306	unlink.o		\
307	utime.o			\
308	utimes.o		\
309	utssys.o		\
310	uucopy.o		\
311	vhangup.o		\
312	waitid.o		\
313	write.o			\
314	writev.o		\
315	yield.o
316
317SYSOBJS=			\
318	__clock_gettime.o	\
319	__getcontext.o		\
320	__uadmin.o		\
321	_lwp_mutex_unlock.o	\
322	_stack_grow.o		\
323	door.o			\
324	forkx.o			\
325	forkallx.o		\
326	fxstat.o		\
327	getcontext.o		\
328	gettimeofday.o		\
329	lwp_private.o		\
330	lxstat.o		\
331	nuname.o		\
332	pipe.o			\
333	ptrace.o		\
334	syscall.o		\
335	sysi86.o		\
336	tls_get_addr.o		\
337	uadmin.o		\
338	umount.o		\
339	uname.o			\
340	vforkx.o		\
341	xmknod.o		\
342	xstat.o
343
344# objects under ../port which contain transitional large file interfaces
345PORTGEN64=			\
346	_xftw64.o		\
347	attropen64.o		\
348	ftw64.o			\
349	mkstemp64.o		\
350	nftw64.o		\
351	tell64.o		\
352	truncate64.o
353
354# objects from source under ../port
355PORTFP=				\
356	__flt_decim.o		\
357	__flt_rounds.o		\
358	__tbl_10_b.o		\
359	__tbl_10_h.o		\
360	__tbl_10_s.o		\
361	__tbl_2_b.o		\
362	__tbl_2_h.o		\
363	__tbl_2_s.o		\
364	__tbl_fdq.o		\
365	__tbl_tens.o		\
366	__x_power.o		\
367	_base_sup.o		\
368	aconvert.o		\
369	decimal_bin.o		\
370	double_decim.o		\
371	econvert.o		\
372	fconvert.o		\
373	file_decim.o		\
374	finite.o		\
375	fp_data.o		\
376	func_decim.o		\
377	gconvert.o		\
378	hex_bin.o		\
379	ieee_globals.o		\
380	pack_float.o		\
381	sigfpe.o		\
382	string_decim.o
383
384PORTGEN=			\
385	_env_data.o		\
386	_xftw.o			\
387	a64l.o			\
388	abort.o			\
389	addsev.o		\
390	assert.o		\
391	atof.o			\
392	atoi.o			\
393	atol.o			\
394	atoll.o			\
395	attrat.o		\
396	attropen.o		\
397	atexit.o		\
398	atfork.o		\
399	basename.o		\
400	calloc.o		\
401	catgets.o		\
402	catopen.o		\
403	cfgetispeed.o		\
404	cfgetospeed.o		\
405	cfree.o			\
406	cfsetispeed.o		\
407	cfsetospeed.o		\
408	cftime.o		\
409	clock.o			\
410	closedir.o		\
411	closefrom.o		\
412	confstr.o		\
413	crypt.o			\
414	csetlen.o		\
415	ctime.o			\
416	ctime_r.o		\
417	deflt.o			\
418	directio.o		\
419	dirname.o		\
420	div.o			\
421	drand48.o		\
422	dup2.o			\
423	env_data.o		\
424	err.o			\
425	errno.o			\
426	euclen.o		\
427	event_port.o		\
428	execvp.o		\
429	fattach.o		\
430	fdetach.o		\
431	fdopendir.o		\
432	fmtmsg.o		\
433	ftime.o			\
434	ftok.o			\
435	ftw.o			\
436	gcvt.o			\
437	getauxv.o		\
438	getcwd.o		\
439	getdate_err.o		\
440	getdtblsize.o		\
441	getenv.o		\
442	getexecname.o		\
443	getgrnam.o		\
444	getgrnam_r.o		\
445	gethostid.o		\
446	gethostname.o		\
447	gethz.o			\
448	getisax.o		\
449	getloadavg.o		\
450	getlogin.o		\
451	getmntent.o		\
452	getnetgrent.o		\
453	getopt.o		\
454	getopt_long.o		\
455	getpagesize.o		\
456	getpw.o			\
457	getpwnam.o		\
458	getpwnam_r.o		\
459	getrusage.o		\
460	getspent.o		\
461	getspent_r.o		\
462	getsubopt.o		\
463	gettxt.o		\
464	getusershell.o		\
465	getut.o			\
466	getutx.o		\
467	getvfsent.o		\
468	getwd.o			\
469	getwidth.o		\
470	getxby_door.o		\
471	gtxt.o			\
472	hsearch.o		\
473	iconv.o			\
474	imaxabs.o		\
475	imaxdiv.o		\
476	index.o			\
477	initgroups.o		\
478	insque.o		\
479	isaexec.o		\
480	isastream.o		\
481	isatty.o		\
482	killpg.o		\
483	klpdlib.o		\
484	l64a.o			\
485	lckpwdf.o		\
486	lconstants.o		\
487	lfind.o			\
488	lfmt.o			\
489	lfmt_log.o		\
490	llabs.o			\
491	lldiv.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	priocntl.o		\
525	privlib.o		\
526	priv_str_xlate.o	\
527	psiginfo.o		\
528	psignal.o		\
529	pt.o			\
530	putpwent.o		\
531	putspent.o		\
532	raise.o			\
533	rand.o			\
534	random.o		\
535	rctlops.o		\
536	readdir.o		\
537	readdir_r.o		\
538	realpath.o		\
539	reboot.o		\
540	regexpr.o		\
541	remove.o		\
542	rewinddir.o		\
543	rindex.o		\
544	scandir.o		\
545	seekdir.o		\
546	select.o		\
547	select_large_fdset.o	\
548	setlabel.o		\
549	setpriority.o		\
550	settimeofday.o		\
551	sh_locks.o		\
552	sigflag.o		\
553	siglist.o		\
554	sigsend.o		\
555	sigsetops.o		\
556	ssignal.o		\
557	stack.o			\
558	str2sig.o		\
559	strcase_charmap.o	\
560	strcasecmp.o		\
561	strcspn.o		\
562	strdup.o		\
563	strerror.o		\
564	strlcat.o		\
565	strlcpy.o		\
566	strncasecmp.o		\
567	strpbrk.o		\
568	strsignal.o		\
569	strspn.o		\
570	strstr.o		\
571	strtod.o		\
572	strtoimax.o		\
573	strtok.o		\
574	strtok_r.o		\
575	strtoll.o		\
576	strtoull.o		\
577	strtoumax.o		\
578	swab.o			\
579	swapctl.o		\
580	sysconf.o		\
581	syslog.o		\
582	tcdrain.o		\
583	tcflow.o		\
584	tcflush.o		\
585	tcgetattr.o		\
586	tcgetpgrp.o		\
587	tcgetsid.o		\
588	tcsendbreak.o		\
589	tcsetattr.o		\
590	tcsetpgrp.o		\
591	tell.o			\
592	telldir.o		\
593	tfind.o			\
594	time_data.o		\
595	time_gdata.o		\
596	truncate.o		\
597	tsdalloc.o		\
598	tsearch.o		\
599	ttyname.o		\
600	ttyslot.o		\
601	ualarm.o		\
602	ucred.o			\
603	valloc.o		\
604	vlfmt.o			\
605	vpfmt.o			\
606	waitpid.o		\
607	walkstack.o		\
608	wdata.o			\
609	xgetwidth.o		\
610	xpg4.o			\
611	xpg6.o
612
613PORTPRINT_W=			\
614	doprnt_w.o
615
616PORTPRINT=			\
617	doprnt.o		\
618	fprintf.o		\
619	printf.o		\
620	snprintf.o		\
621	sprintf.o		\
622	vfprintf.o		\
623	vprintf.o		\
624	vsnprintf.o		\
625	vsprintf.o		\
626	vwprintf.o		\
627	wprintf.o
628
629# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
630PORTPRINT_C89=			\
631	vfprintf_c89.o		\
632	vprintf_c89.o		\
633	vsnprintf_c89.o		\
634	vsprintf_c89.o		\
635	vwprintf_c89.o
636
637PORTSTDIO_C89=			\
638	vscanf_c89.o		\
639	vwscanf_c89.o		\
640
641# portable stdio objects that contain large file interfaces.
642# Note: fopen64 is a special case, as we build it small.
643PORTSTDIO64=			\
644	fopen64.o		\
645	fpos64.o
646
647PORTSTDIO_W=			\
648	doscan_w.o
649
650PORTSTDIO=			\
651	__extensions.o		\
652	_endopen.o		\
653	_filbuf.o		\
654	_findbuf.o		\
655	_flsbuf.o		\
656	_wrtchk.o		\
657	clearerr.o		\
658	ctermid.o		\
659	ctermid_r.o		\
660	cuserid.o		\
661	data.o			\
662	doscan.o		\
663	fdopen.o		\
664	feof.o			\
665	ferror.o		\
666	fgetc.o			\
667	fgets.o			\
668	fileno.o		\
669	flockf.o		\
670	flush.o			\
671	fopen.o			\
672	fpos.o			\
673	fputc.o			\
674	fputs.o			\
675	fread.o			\
676	fseek.o			\
677	fseeko.o		\
678	ftell.o			\
679	ftello.o		\
680	fwrite.o		\
681	getc.o			\
682	getchar.o		\
683	getpass.o		\
684	gets.o			\
685	getw.o			\
686	mse.o			\
687	popen.o			\
688	putc.o			\
689	putchar.o		\
690	puts.o			\
691	putw.o			\
692	rewind.o		\
693	scanf.o			\
694	setbuf.o		\
695	setbuffer.o		\
696	setvbuf.o		\
697	system.o		\
698	tempnam.o		\
699	tmpfile.o		\
700	tmpnam_r.o		\
701	ungetc.o		\
702	vscanf.o		\
703	vwscanf.o		\
704	wscanf.o
705
706PORTI18N=			\
707	__fgetwc_xpg5.o		\
708	__fgetws_xpg5.o		\
709	__fputwc_xpg5.o		\
710	__fputws_xpg5.o		\
711	__ungetwc_xpg5.o	\
712	getwchar.o		\
713	putwchar.o		\
714	putws.o			\
715	strtows.o		\
716	wcsstr.o		\
717	wcstoimax.o		\
718	wcstol.o		\
719	wcstoul.o		\
720	wcswcs.o		\
721	wmemchr.o		\
722	wmemcmp.o		\
723	wmemcpy.o		\
724	wmemmove.o		\
725	wmemset.o		\
726	wscasecmp.o		\
727	wscat.o			\
728	wschr.o			\
729	wscmp.o			\
730	wscpy.o			\
731	wscspn.o		\
732	wsdup.o			\
733	wslen.o			\
734	wsncasecmp.o		\
735	wsncat.o		\
736	wsncmp.o		\
737	wsncpy.o		\
738	wspbrk.o		\
739	wsprintf.o		\
740	wsrchr.o		\
741	wsscanf.o		\
742	wsspn.o			\
743	wstod.o			\
744	wstok.o			\
745	wstol.o			\
746	wstoll.o		\
747	wsxfrm.o		\
748	gettext.o		\
749	gettext_gnu.o		\
750	gettext_real.o		\
751	gettext_util.o		\
752	plural_parser.o		\
753	wdresolve.o		\
754	_ctype.o		\
755	isascii.o		\
756	toascii.o
757
758PORTI18N_COND=			\
759	wcstol_longlong.o	\
760	wcstoul_longlong.o
761
762AIOOBJS=			\
763	aio.o			\
764	aio_alloc.o		\
765	posix_aio.o
766
767RTOBJS=				\
768	clock_timer.o		\
769	fallocate.o		\
770	mqueue.o		\
771	pos4obj.o		\
772	sched.o			\
773	sem.o			\
774	shm.o			\
775	sigev_thread.o
776
777TPOOLOBJS=			\
778	thread_pool.o
779
780THREADSOBJS=			\
781	alloc.o			\
782	assfail.o		\
783	cancel.o		\
784	door_calls.o		\
785	pthr_attr.o		\
786	pthr_barrier.o		\
787	pthr_cond.o		\
788	pthr_mutex.o		\
789	pthr_rwlock.o		\
790	pthread.o		\
791	rtsched.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
967CFLAGS += $(THREAD_DEBUG)
968
969ALTPICS= $(TRACEOBJS:%=pics/%)
970
971$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
972$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(LDLIBS)
973
974MAPFILES =	../port/mapfile-vers ../i386/mapfile-vers
975
976#
977# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
978#
979CFLAGS +=	$(EXTN_CFLAGS)
980CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) \
981		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
982ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
983
984# Conditionally add support for making |wordexp()| check whether
985# /usr/bin/ksh is ksh93 or not
986include ../../../Makefile.ksh93switch
987CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
988
989# Inform the run-time linker about libc specialized initialization
990RTLDINFO =	-z rtldinfo=tls_rtldinfo
991DYNFLAGS +=	$(RTLDINFO)
992
993DYNFLAGS +=	-e __rtboot
994DYNFLAGS +=	$(EXTN_DYNFLAGS)
995
996# Inform the kernel about the initial DTrace area (in case
997# libc is being used as the interpreter / runtime linker).
998DTRACE_DATA =	-zdtrace=dtrace_data
999DYNFLAGS +=	$(DTRACE_DATA)
1000
1001# DTrace needs an executable data segment.
1002MAPFILE.NED=
1003
1004BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1005
1006# Override this top level flag so the compiler builds in its native
1007# C99 mode.  This has been enabled to support the complex arithmetic
1008# added to libc.
1009C99MODE=	$(C99_ENABLE)
1010
1011# libc method of building an archive
1012BUILD.AR= $(RM) $@ ; \
1013	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
1014
1015# extra files for the clean target
1016CLEANFILES=			\
1017	../port/gen/errlst.c	\
1018	../port/gen/new_list.c	\
1019	assym.h			\
1020	genassym		\
1021	crt/_rtld.s		\
1022	crt/_rtbootld.s		\
1023	pics/_rtbootld.o	\
1024	pics/crti.o		\
1025	pics/crtn.o		\
1026	$(ALTPICS)
1027
1028CLOBBERFILES +=	$(LIB_PIC)
1029
1030# list of C source for lint
1031SRCS=							\
1032	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1033	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1034	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1035	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1036	$(PORTFP:%.o=../port/fp/%.c)			\
1037	$(PORTGEN:%.o=../port/gen/%.c)			\
1038	$(PORTI18N:%.o=../port/i18n/%.c)		\
1039	$(PORTPRINT:%.o=../port/print/%.c)		\
1040	$(PORTREGEX:%.o=../port/regex/%.c)		\
1041	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1042	$(PORTSYS:%.o=../port/sys/%.c)			\
1043	$(AIOOBJS:%.o=../port/aio/%.c)			\
1044	$(RTOBJS:%.o=../port/rt/%.c)			\
1045	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
1046	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1047	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1048	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1049	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1050	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1051	$(LIBCBASE)/gen/ecvt.c				\
1052	$(LIBCBASE)/gen/lexp10.c			\
1053	$(LIBCBASE)/gen/llog10.c			\
1054	$(LIBCBASE)/gen/ltostr.c			\
1055	$(LIBCBASE)/gen/makectxt.c			\
1056	$(LIBCBASE)/gen/siginfolst.c			\
1057	$(LIBCBASE)/gen/siglongjmp.c			\
1058	$(LIBCBASE)/gen/strcmp.c			\
1059	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1060	$(LIBCBASE)/sys/ptrace.c			\
1061	$(LIBCBASE)/sys/uadmin.c
1062
1063# conditional assignments
1064$(DYNLIB) := CRTI = crti.o
1065$(DYNLIB) := CRTN = crtn.o
1066
1067# Files which need the threads .il inline template
1068TIL=				\
1069	aio.o			\
1070	alloc.o			\
1071	assfail.o		\
1072	atexit.o		\
1073	atfork.o		\
1074	cancel.o		\
1075	door_calls.o		\
1076	errno.o			\
1077	lwp.o			\
1078	ma.o			\
1079	machdep.o		\
1080	posix_aio.o		\
1081	pthr_attr.o		\
1082	pthr_barrier.o		\
1083	pthr_cond.o		\
1084	pthr_mutex.o		\
1085	pthr_rwlock.o		\
1086	pthread.o		\
1087	rand.o			\
1088	rtsched.o		\
1089	rwlock.o		\
1090	scalls.o		\
1091	sema.o			\
1092	sigaction.o		\
1093	sigev_thread.o		\
1094	spawn.o			\
1095	stack.o			\
1096	synch.o			\
1097	tdb_agent.o		\
1098	thr.o			\
1099	thread_interface.o	\
1100	thread_pool.o		\
1101	tls.o			\
1102	tsd.o			\
1103	unwind.o
1104
1105THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1106$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1107
1108# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1109
1110# large-file-aware components that should be built large
1111
1112$(COMSYSOBJS64:%=pics/%) := \
1113	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1114
1115$(SYSOBJS64:%=pics/%) := \
1116	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1117
1118$(PORTGEN64:%=pics/%) := \
1119	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1120
1121$(PORTSTDIO64:%=pics/%) := \
1122	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1123
1124$(PORTSYS64:%=pics/%) := \
1125	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1126
1127$(PORTSTDIO_W:%=pics/%) := \
1128	CPPFLAGS += -D_WIDE
1129
1130$(PORTPRINT_W:%=pics/%) := \
1131	CPPFLAGS += -D_WIDE
1132
1133$(PORTPRINT_C89:%=pics/%) := \
1134	CPPFLAGS += -D_C89_INTMAX32
1135
1136$(PORTSTDIO_C89:%=pics/%) := \
1137	CPPFLAGS += -D_C89_INTMAX32
1138
1139$(PORTI18N_COND:%=pics/%) := \
1140	CPPFLAGS += -D_WCS_LONGLONG
1141
1142.KEEP_STATE:
1143
1144all: $(LIBS) $(LIB_PIC)
1145
1146lint	:=	CPPFLAGS += -I../$(MACH)/fp
1147lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1148lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1149
1150lint:
1151	@echo $(LINT.c) ...
1152	@$(LINT.c) $(SRCS) $(LDLIBS)
1153
1154$(LINTLIB):= SRCS=../port/llib-lc
1155$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1156$(LINTLIB):= LINTFLAGS=-nvx
1157
1158# object files that depend on inline template
1159$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1160# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1161
1162# include common libc targets
1163include ../Makefile.targ
1164
1165# We need to strip out all CTF and DOF data from the static library
1166$(LIB_PIC) := DIR = pics
1167$(LIB_PIC): pics $$(PICS)
1168	$(BUILD.AR)
1169	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1170	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1171	$(AR) -ts $@ > /dev/null
1172	$(POST_PROCESS_A)
1173
1174$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1175	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1176	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1177	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1178	$(RM) $(LIBCBASE)/crt/_rtld.s
1179
1180# partially built from C source
1181pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1182	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1183	$(CTFCONVERT_O)
1184
1185ASSYMDEP_OBJS=			\
1186	_lwp_mutex_unlock.o	\
1187	_stack_grow.o		\
1188	getcontext.o		\
1189	tls_get_addr.o		\
1190	vforkx.o
1191
1192$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1193
1194$(ASSYMDEP_OBJS:%=pics/%): assym.h
1195
1196# assym.h build rules
1197
1198GENASSYM_C = ../$(MACH)/genassym.c
1199
1200# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1201#	live in Makefile.master
1202
1203CPPFLAGS.genassym = \
1204	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1205
1206genassym: $(GENASSYM_C)
1207	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc	\
1208		-D__EXTENSIONS__ $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1209
1210OFFSETS = ../$(MACH)/offsets.in
1211
1212assym.h: $(OFFSETS) genassym
1213	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1214	./genassym >>$@
1215
1216# derived C source and related explicit dependencies
1217../port/gen/errlst.c + \
1218../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1219	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1220
1221pics/errlst.o: ../port/gen/errlst.c
1222
1223pics/new_list.o: ../port/gen/new_list.c
1224