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