xref: /titanic_52/usr/src/lib/libc/i386/Makefile.com (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# lib/libc/Makefile.com
29#
30
31LIB_PIC= libc_pic.a
32VERS=	.1
33CPP=	/usr/lib/cpp
34TARGET_ARCH=	i386
35
36# values deliverables
37VALUES=	values-Xa.o values-Xc.o values-Xs.o values-Xt.o values-xpg4.o \
38	values-xpg6.o
39
40# objects are grouped by source directory
41
42# local objects
43STRETS=
44
45CRTOBJS=			\
46	cerror.o		\
47	cerror64.o
48
49DYNOBJS=
50
51FPOBJS=				\
52	_D_cplx_div.o		\
53	_D_cplx_div_ix.o	\
54	_D_cplx_div_rx.o	\
55	_D_cplx_lr_div.o	\
56	_D_cplx_lr_div_ix.o	\
57	_D_cplx_lr_div_rx.o	\
58	_D_cplx_mul.o		\
59	_F_cplx_div.o		\
60	_F_cplx_div_ix.o	\
61	_F_cplx_div_rx.o	\
62	_F_cplx_lr_div.o	\
63	_F_cplx_lr_div_ix.o	\
64	_F_cplx_lr_div_rx.o	\
65	_F_cplx_mul.o		\
66	_X_cplx_div.o		\
67	_X_cplx_div_ix.o	\
68	_X_cplx_div_rx.o	\
69	_X_cplx_lr_div.o	\
70	_X_cplx_lr_div_ix.o	\
71	_X_cplx_lr_div_rx.o	\
72	_X_cplx_mul.o		\
73	_base_il.o		\
74	fpgetmask.o		\
75	fpgetround.o		\
76	fpgetsticky.o		\
77	fpsetmask.o		\
78	fpsetround.o		\
79	fpsetsticky.o		\
80	fpstart.o
81
82FPASMOBJS=			\
83	__xgetRD.o		\
84	_xtoll.o		\
85	_xtoull.o		\
86	fpcw.o
87
88ATOMICOBJS=			\
89	atomic.o
90
91COMOBJS=			\
92	bcmp.o			\
93	bcopy.o			\
94	bsearch.o		\
95	bzero.o			\
96	qsort.o			\
97	strtol.o		\
98	strtoul.o
99
100GENOBJS=			\
101	_div64.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	mkfifo.o		\
492	mkstemp.o		\
493	mktemp.o		\
494	mlock.o			\
495	mlockall.o		\
496	mon.o			\
497	msync.o			\
498	munlock.o		\
499	munlockall.o		\
500	ndbm.o			\
501	nftw.o			\
502	nlspath_checks.o	\
503	nsparse.o		\
504	nss_common.o		\
505	nss_dbdefs.o		\
506	nss_deffinder.o		\
507	opendir.o		\
508	opt_data.o		\
509	perror.o		\
510	pfmt.o			\
511	pfmt_data.o		\
512	pfmt_print.o		\
513	plock.o			\
514	poll.o			\
515	priocntl.o		\
516	privlib.o		\
517	priv_str_xlate.o	\
518	psiginfo.o		\
519	psignal.o		\
520	pt.o			\
521	putpwent.o		\
522	putspent.o		\
523	raise.o			\
524	rand.o			\
525	random.o		\
526	rctlops.o		\
527	readdir.o		\
528	readdir_r.o		\
529	realpath.o		\
530	reboot.o		\
531	regexpr.o		\
532	rename.o		\
533	rewinddir.o		\
534	rindex.o		\
535	scandir.o		\
536	seekdir.o		\
537	select.o		\
538	select_large_fdset.o	\
539	setlabel.o		\
540	setpriority.o		\
541	settimeofday.o		\
542	sh_locks.o		\
543	sigflag.o		\
544	siglist.o		\
545	sigsend.o		\
546	sigsetops.o		\
547	ssignal.o		\
548	stack.o			\
549	str2sig.o		\
550	strcase_charmap.o	\
551	strcasecmp.o		\
552	strcspn.o		\
553	strdup.o		\
554	strerror.o		\
555	strlcat.o		\
556	strlcpy.o		\
557	strncasecmp.o		\
558	strpbrk.o		\
559	strsignal.o		\
560	strspn.o		\
561	strstr.o		\
562	strtod.o		\
563	strtoimax.o		\
564	strtok.o		\
565	strtok_r.o		\
566	strtoll.o		\
567	strtoull.o		\
568	strtoumax.o		\
569	swab.o			\
570	swapctl.o		\
571	sysconf.o		\
572	syslog.o		\
573	tcdrain.o		\
574	tcflow.o		\
575	tcflush.o		\
576	tcgetattr.o		\
577	tcgetpgrp.o		\
578	tcgetsid.o		\
579	tcsendbreak.o		\
580	tcsetattr.o		\
581	tcsetpgrp.o		\
582	tell.o			\
583	telldir.o		\
584	tfind.o			\
585	time_data.o		\
586	time_gdata.o		\
587	truncate.o		\
588	tsdalloc.o		\
589	tsearch.o		\
590	ttyname.o		\
591	ttyslot.o		\
592	ualarm.o		\
593	ucred.o			\
594	valloc.o		\
595	vlfmt.o			\
596	vpfmt.o			\
597	wait3.o			\
598	wait4.o			\
599	waitpid.o		\
600	walkstack.o		\
601	wdata.o			\
602	xgetwidth.o		\
603	xpg4.o			\
604	xpg6.o
605
606PORTPRINT_W=			\
607	doprnt_w.o
608
609PORTPRINT=			\
610	doprnt.o		\
611	fprintf.o		\
612	printf.o		\
613	snprintf.o		\
614	sprintf.o		\
615	vfprintf.o		\
616	vprintf.o		\
617	vsnprintf.o		\
618	vsprintf.o		\
619	vwprintf.o		\
620	wprintf.o
621
622# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
623PORTPRINT_C89=			\
624	vfprintf_c89.o		\
625	vprintf_c89.o		\
626	vsnprintf_c89.o		\
627	vsprintf_c89.o		\
628	vwprintf_c89.o
629
630PORTSTDIO_C89=			\
631	vscanf_c89.o		\
632	vwscanf_c89.o		\
633
634# portable stdio objects that contain large file interfaces.
635# Note: fopen64 is a special case, as we build it small.
636PORTSTDIO64=			\
637	fopen64.o		\
638	fpos64.o
639
640PORTSTDIO_W=			\
641	doscan_w.o
642
643PORTSTDIO=			\
644	__extensions.o		\
645	_endopen.o		\
646	_filbuf.o		\
647	_findbuf.o		\
648	_flsbuf.o		\
649	_wrtchk.o		\
650	clearerr.o		\
651	ctermid.o		\
652	ctermid_r.o		\
653	cuserid.o		\
654	data.o			\
655	doscan.o		\
656	fdopen.o		\
657	feof.o			\
658	ferror.o		\
659	fgetc.o			\
660	fgets.o			\
661	fileno.o		\
662	flockf.o		\
663	flush.o			\
664	fopen.o			\
665	fpos.o			\
666	fputc.o			\
667	fputs.o			\
668	fread.o			\
669	fseek.o			\
670	fseeko.o		\
671	ftell.o			\
672	ftello.o		\
673	fwrite.o		\
674	getc.o			\
675	getchar.o		\
676	getpass.o		\
677	gets.o			\
678	getw.o			\
679	mse.o			\
680	popen.o			\
681	putc.o			\
682	putchar.o		\
683	puts.o			\
684	putw.o			\
685	rewind.o		\
686	scanf.o			\
687	setbuf.o		\
688	setbuffer.o		\
689	setvbuf.o		\
690	system.o		\
691	tempnam.o		\
692	tmpfile.o		\
693	tmpnam_r.o		\
694	ungetc.o		\
695	vscanf.o		\
696	vwscanf.o		\
697	wscanf.o
698
699PORTI18N=			\
700	__fgetwc_xpg5.o		\
701	__fgetws_xpg5.o		\
702	__fputwc_xpg5.o		\
703	__fputws_xpg5.o		\
704	__ungetwc_xpg5.o	\
705	getwchar.o		\
706	putwchar.o		\
707	putws.o			\
708	strtows.o		\
709	wcsstr.o		\
710	wcstoimax.o		\
711	wcstol.o		\
712	wcstoul.o		\
713	wcswcs.o		\
714	wmemchr.o		\
715	wmemcmp.o		\
716	wmemcpy.o		\
717	wmemmove.o		\
718	wmemset.o		\
719	wscasecmp.o		\
720	wscat.o			\
721	wschr.o			\
722	wscmp.o			\
723	wscpy.o			\
724	wscspn.o		\
725	wsdup.o			\
726	wslen.o			\
727	wsncasecmp.o		\
728	wsncat.o		\
729	wsncmp.o		\
730	wsncpy.o		\
731	wspbrk.o		\
732	wsprintf.o		\
733	wsrchr.o		\
734	wsscanf.o		\
735	wsspn.o			\
736	wstod.o			\
737	wstok.o			\
738	wstol.o			\
739	wstoll.o		\
740	wsxfrm.o		\
741	gettext.o		\
742	gettext_gnu.o		\
743	gettext_real.o		\
744	gettext_util.o		\
745	plural_parser.o		\
746	wdresolve.o		\
747	_ctype.o		\
748	isascii.o		\
749	toascii.o
750
751PORTI18N_COND=			\
752	wcstol_longlong.o	\
753	wcstoul_longlong.o
754
755THREADSOBJS=			\
756	alloc.o			\
757	assfail.o		\
758	cancel.o		\
759	door_calls.o		\
760	pthr_attr.o		\
761	pthr_barrier.o		\
762	pthr_cond.o		\
763	pthr_mutex.o		\
764	pthr_rwlock.o		\
765	pthread.o		\
766	rtsched.o		\
767	rwlock.o		\
768	scalls.o		\
769	sema.o			\
770	sigaction.o		\
771	spawn.o			\
772	synch.o			\
773	tdb_agent.o		\
774	thr.o			\
775	thread_interface.o	\
776	tls.o			\
777	tsd.o
778
779THREADSMACHOBJS=		\
780	machdep.o
781
782THREADSASMOBJS=			\
783	inlines.o		\
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=
920$(__GNUC)XINLINE =
921CFLAGS += $(XINLINE)
922
923# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
924# enables ASSERT() checking in the threads portion of the library.
925# This is automatically enabled for DEBUG builds, not for non-debug builds.
926THREAD_DEBUG =
927$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
928
929CFLAGS += $(THREAD_DEBUG)
930
931ALTPICS= $(TRACEOBJS:%=pics/%)
932
933$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
934$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(LDLIBS)
935
936#
937# XX64 Don't know why ctf fails.  Remove when it is fixed.
938#
939$(__GNUC)$(DYNLIB) := CTFMERGE_POST =
940
941MAPDIR=		../spec/i386
942MAPFILE=	$(MAPDIR)/mapfile
943
944#
945# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
946#
947CFLAGS +=	$(EXTN_CFLAGS)
948CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) \
949		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
950ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS)
951
952# Inform the run-time linker about libc specialized initialization
953RTLDINFO =	-z rtldinfo=tls_rtldinfo
954
955DYNFLAGS =	$(HSONAME) $(ZTEXT) $(ZDEFS) $(ZCOMBRELOC)
956DYNFLAGS +=	$(SPECMAPFILE:%=-M %) $(PGA_MAPFILE:%=-M %) $(NX_MAP:%=-M%) \
957		-e __rtboot -M $(MAPFILE) $(RTLDINFO)
958DYNFLAGS +=	$(EXTN_DYNFLAGS)
959
960# special case for fp/fpsetsticky.s
961$(__GNUC)pics/fpsetsticky.o := \
962	ASFLAGS += --no-warn
963
964BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
965
966# Override this top level flag so the compiler builds in its native
967# C99 mode.  This has been enabled to support the complex arithmetic
968# added to libc.
969C99MODE=	$(C99_ENABLE)
970
971# libc method of building an archive
972BUILD.AR= $(RM) $@ ; \
973	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
974
975# extra files for the clean target
976CLEANFILES=			\
977	../port/gen/errlst.c	\
978	../port/gen/new_list.c	\
979	assym.h			\
980	genassym		\
981	crt/_rtld.s		\
982	crt/_rtbootld.s		\
983	pics/_rtbootld.o	\
984	pics/crti.o		\
985	pics/crtn.o		\
986	pics/values-Xa.o	\
987	$(VALUES)		\
988	$(ALTPICS)
989
990CLOBBERFILES +=	$(MAPFILE) $(LIB_PIC)
991
992# list of C source for lint
993SRCS=							\
994	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
995	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
996	$(PORTFP:%.o=../port/fp/%.c)			\
997	$(PORTGEN:%.o=../port/gen/%.c)			\
998	$(PORTI18N:%.o=../port/i18n/%.c)		\
999	$(PORTPRINT:%.o=../port/print/%.c)		\
1000	$(PORTREGEX:%.o=../port/regex/%.c)		\
1001	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1002	$(PORTSYS:%.o=../port/sys/%.c)			\
1003	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1004	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1005	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1006	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1007	$(LIBCBASE)/gen/ecvt.c				\
1008	$(LIBCBASE)/gen/lexp10.c			\
1009	$(LIBCBASE)/gen/llog10.c			\
1010	$(LIBCBASE)/gen/ltostr.c			\
1011	$(LIBCBASE)/gen/makectxt.c			\
1012	$(LIBCBASE)/gen/siginfolst.c			\
1013	$(LIBCBASE)/gen/siglongjmp.c			\
1014	$(LIBCBASE)/gen/strcmp.c			\
1015	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1016	$(LIBCBASE)/sys/ptrace.c			\
1017	$(LIBCBASE)/sys/uadmin.c
1018
1019# conditional assignments
1020$(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1021$(DYNLIB) := CRTI = crti.o values-Xa.o
1022$(DYNLIB) := CRTN = crtn.o
1023
1024$(DYNLIB):	$(MAPFILE)
1025
1026$(MAPFILE):
1027	@cd $(MAPDIR); $(MAKE) mapfile
1028
1029# Files which need the threads .il inline template
1030TIL=				\
1031	alloc.o			\
1032	assfail.o		\
1033	atexit.o		\
1034	atfork.o		\
1035	cancel.o		\
1036	door_calls.o		\
1037	errno.o			\
1038	lwp.o			\
1039	machdep.o		\
1040	pthr_attr.o		\
1041	pthr_barrier.o		\
1042	pthr_cond.o		\
1043	pthr_mutex.o		\
1044	pthr_rwlock.o		\
1045	pthread.o		\
1046	rand.o			\
1047	rtsched.o		\
1048	rwlock.o		\
1049	scalls.o		\
1050	sema.o			\
1051	sigaction.o		\
1052	spawn.o			\
1053	stack.o			\
1054	synch.o			\
1055	tdb_agent.o		\
1056	thr.o			\
1057	thread_interface.o	\
1058	tls.o			\
1059	tsd.o			\
1060	unwind.o
1061
1062THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1063$(__GNUC)THREADS_INLINES =
1064$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1065
1066# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1067
1068# large-file-aware components that should be built large
1069
1070$(COMSYSOBJS64:%=pics/%) := \
1071	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1072
1073$(SYSOBJS64:%=pics/%) := \
1074	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1075
1076$(PORTGEN64:%=pics/%) := \
1077	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1078
1079$(PORTSTDIO64:%=pics/%) := \
1080	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1081
1082$(PORTSYS64:%=pics/%) := \
1083	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1084
1085$(PORTSTDIO_W:%=pics/%) := \
1086	CPPFLAGS += -D_WIDE
1087
1088$(PORTPRINT_W:%=pics/%) := \
1089	CPPFLAGS += -D_WIDE
1090
1091$(PORTPRINT_C89:%=pics/%) := \
1092	CPPFLAGS += -D_C89_INTMAX32
1093
1094$(PORTSTDIO_C89:%=pics/%) := \
1095	CPPFLAGS += -D_C89_INTMAX32
1096
1097$(PORTI18N_COND:%=pics/%) := \
1098	CPPFLAGS += -D_WCS_LONGLONG
1099
1100.KEEP_STATE:
1101
1102all: $(LIBS) $(LIB_PIC) values
1103
1104lint	:=	CPPFLAGS += -I../$(MACH)/fp
1105lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1106lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1107
1108lint:
1109	@echo $(LINT.c) ...
1110	@$(LINT.c) $(SRCS) $(LDLIBS)
1111
1112values: $(VALUES)
1113
1114# these aren't listed as $(PICS), so we need to force CTF
1115$(VALUES) := CTFCONVERT_POST = $(CTFCONVERT_O)
1116pics/values-Xa.o := CTFCONVERT_POST = $(CTFCONVERT_O)
1117
1118$(LINTLIB):= SRCS=../port/llib-lc
1119$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1120$(LINTLIB):= LINTFLAGS=-nvx
1121
1122# object files that depend on inline template
1123$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1124# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1125
1126# include common libc targets
1127include ../Makefile.targ
1128
1129# We need to strip out all CTF and DOF data from the static library
1130$(LIB_PIC) := DIR = pics
1131$(LIB_PIC): pics $$(PICS)
1132	$(BUILD.AR)
1133	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1134	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1135	$(AR) -ts $@ > /dev/null
1136	$(POST_PROCESS_A)
1137
1138$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1139	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1140	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1141	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1142	$(RM) $(LIBCBASE)/crt/_rtld.s
1143
1144# partially built from C source
1145pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1146	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1147	$(CTFCONVERT_O)
1148
1149ASSYMDEP_OBJS=			\
1150	_lwp_mutex_unlock.o	\
1151	_stack_grow.o		\
1152	getcontext.o		\
1153	tls_get_addr.o		\
1154	vfork.o
1155
1156$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1157
1158$(ASSYMDEP_OBJS:%=pics/%): assym.h
1159
1160# assym.h build rules
1161
1162GENASSYM_C = ../$(MACH)/genassym.c
1163
1164# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1165#	live in Makefile.master
1166
1167CPPFLAGS.genassym = \
1168	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1169
1170genassym: $(GENASSYM_C)
1171	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc	\
1172		-D__EXTENSIONS__ $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1173
1174OFFSETS = ../$(MACH)/offsets.in
1175
1176assym.h: $(OFFSETS) genassym
1177	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1178	./genassym >>$@
1179
1180# derived C source and related explicit dependencies
1181../port/gen/errlst.c + \
1182../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1183	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1184
1185pics/errlst.o: ../port/gen/errlst.c
1186
1187pics/new_list.o: ../port/gen/new_list.c
1188