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