xref: /illumos-gate/usr/src/lib/libc/i386/Makefile.com (revision a07094369b21309434206d9b3601d162693466fc)
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 2006 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	_divdi3.o		\
103	_getsp.o		\
104	_mul64.o		\
105	abs.o			\
106	alloca.o		\
107	byteorder.o		\
108	cuexit.o		\
109	ecvt.o			\
110	errlst.o		\
111	i386_data.o		\
112	ladd.o			\
113	ldivide.o		\
114	lexp10.o		\
115	llog10.o		\
116	lmul.o			\
117	lock.o			\
118	lshiftl.o		\
119	lsign.o			\
120	lsub.o			\
121	ltostr.o		\
122	makectxt.o		\
123	memccpy.o		\
124	memchr.o		\
125	memcmp.o		\
126	memcpy.o		\
127	memset.o		\
128	new_list.o		\
129	setjmp.o		\
130	siginfolst.o		\
131	siglongjmp.o		\
132	strcat.o		\
133	strchr.o		\
134	strcmp.o		\
135	strcpy.o		\
136	strlen.o		\
137	strncat.o		\
138	strncmp.o		\
139	strncpy.o		\
140	strrchr.o		\
141	sync_instruction_memory.o
142
143# sysobjs that contain large-file interfaces
144COMSYSOBJS64=			\
145	creat64.o		\
146	fstat64.o		\
147	fstatvfs64.o		\
148	getdents64.o		\
149	getrlimit64.o		\
150	lseek64.o		\
151	lstat64.o		\
152	open64.o		\
153	pread64.o		\
154	pwrite64.o		\
155	setrlimit64.o		\
156	stat64.o		\
157	statvfs64.o
158
159SYSOBJS64=			\
160	mmap64.o
161
162COMSYSOBJS=			\
163	__clock_timer.o		\
164	__fcntl.o		\
165	__getloadavg.o		\
166	__rusagesys.o		\
167	__signotify.o		\
168	__sigrt.o		\
169	__time.o		\
170	_lgrp_home_fast.o	\
171	_lgrpsys.o		\
172	_nfssys.o		\
173	_portfs.o		\
174	_pset.o			\
175	_rename.o		\
176	_rpcsys.o		\
177	_sigaction.o		\
178	_so_accept.o		\
179	_so_bind.o		\
180	_so_connect.o		\
181	_so_getpeername.o	\
182	_so_getsockname.o	\
183	_so_getsockopt.o	\
184	_so_listen.o		\
185	_so_recv.o		\
186	_so_recvfrom.o		\
187	_so_recvmsg.o		\
188	_so_send.o		\
189	_so_sendmsg.o		\
190	_so_sendto.o		\
191	_so_setsockopt.o	\
192	_so_shutdown.o		\
193	_so_socket.o		\
194	_so_socketpair.o	\
195	_sockconfig.o		\
196	access.o		\
197	acct.o			\
198	acl.o			\
199	adjtime.o		\
200	alarm.o			\
201	brk.o			\
202	chdir.o			\
203	chmod.o			\
204	chown.o			\
205	chroot.o		\
206	cladm.o			\
207	close.o			\
208	creat.o			\
209	dup.o			\
210	execve.o		\
211	exit.o			\
212	facl.o			\
213	fchdir.o		\
214	fchmod.o		\
215	fchown.o		\
216	fchroot.o		\
217	fdsync.o		\
218	fpathconf.o		\
219	fstat.o			\
220	fstatfs.o		\
221	fstatvfs.o		\
222	getcpuid.o		\
223	getdents.o		\
224	getegid.o		\
225	geteuid.o		\
226	getgid.o		\
227	getgroups.o		\
228	gethrtime.o		\
229	getitimer.o		\
230	getmsg.o		\
231	getpagesizes.o		\
232	getpid.o		\
233	getpmsg.o		\
234	getppid.o		\
235	getrlimit.o		\
236	getuid.o		\
237	gtty.o			\
238	install_utrap.o		\
239	ioctl.o			\
240	kaio.o			\
241	kill.o			\
242	lchown.o		\
243	link.o			\
244	llseek.o		\
245	lseek.o			\
246	lstat.o			\
247	memcntl.o		\
248	mincore.o		\
249	mkdir.o			\
250	mknod.o			\
251	mmap.o			\
252	modctl.o		\
253	mount.o			\
254	mprotect.o		\
255	munmap.o		\
256	nice.o			\
257	ntp_adjtime.o		\
258	ntp_gettime.o		\
259	open.o			\
260	p_online.o		\
261	pathconf.o		\
262	pause.o			\
263	pcsample.o		\
264	pollsys.o		\
265	pread.o			\
266	priocntlset.o		\
267	processor_bind.o	\
268	processor_info.o	\
269	profil.o		\
270	putmsg.o		\
271	putpmsg.o		\
272	pwrite.o		\
273	read.o			\
274	readlink.o		\
275	readv.o			\
276	resolvepath.o		\
277	rmdir.o			\
278	seteguid.o		\
279	setgid.o		\
280	setgroups.o		\
281	setitimer.o		\
282	setreid.o		\
283	setrlimit.o		\
284	setuid.o		\
285	sigaltstk.o		\
286	sigprocmsk.o		\
287	sigsendset.o		\
288	sigsuspend.o		\
289	stat.o			\
290	statfs.o		\
291	statvfs.o		\
292	stty.o			\
293	symlink.o		\
294	sync.o			\
295	sysconfig.o		\
296	sysfs.o			\
297	sysinfo.o		\
298	syslwp.o		\
299	times.o			\
300	ulimit.o		\
301	umask.o			\
302	umount2.o		\
303	unlink.o		\
304	utime.o			\
305	utimes.o		\
306	utssys.o		\
307	vhangup.o		\
308	waitid.o		\
309	write.o			\
310	writev.o		\
311	yield.o
312
313SYSOBJS=			\
314	__clock_gettime.o	\
315	__getcontext.o		\
316	__uadmin.o		\
317	_lwp_mutex_unlock.o	\
318	_stack_grow.o		\
319	door.o			\
320	fork1.o			\
321	forkall.o		\
322	fxstat.o		\
323	getcontext.o		\
324	gettimeofday.o		\
325	lwp_private.o		\
326	lxstat.o		\
327	nuname.o		\
328	pipe.o			\
329	ptrace.o		\
330	syscall.o		\
331	sysi86.o		\
332	tls_get_addr.o		\
333	uadmin.o		\
334	umount.o		\
335	uname.o			\
336	vfork.o			\
337	xmknod.o		\
338	xstat.o
339
340# objects under ../port which contain transitional large file interfaces
341PORTGEN64=			\
342	_xftw64.o		\
343	attropen64.o		\
344	ftw64.o			\
345	mkstemp64.o		\
346	nftw64.o		\
347	tell64.o		\
348	truncate64.o
349
350# objects from source under ../port
351PORTFP=				\
352	__flt_decim.o		\
353	__flt_rounds.o		\
354	__tbl_10_b.o		\
355	__tbl_10_h.o		\
356	__tbl_10_s.o		\
357	__tbl_2_b.o		\
358	__tbl_2_h.o		\
359	__tbl_2_s.o		\
360	__tbl_fdq.o		\
361	__tbl_tens.o		\
362	__x_power.o		\
363	_base_sup.o		\
364	aconvert.o		\
365	decimal_bin.o		\
366	double_decim.o		\
367	econvert.o		\
368	fconvert.o		\
369	file_decim.o		\
370	finite.o		\
371	fp_data.o		\
372	func_decim.o		\
373	gconvert.o		\
374	hex_bin.o		\
375	ieee_globals.o		\
376	pack_float.o		\
377	sigfpe.o		\
378	string_decim.o
379
380PORTGEN=			\
381	_env_data.o		\
382	_xftw.o			\
383	a64l.o			\
384	abort.o			\
385	addsev.o		\
386	assert.o		\
387	atof.o			\
388	atoi.o			\
389	atol.o			\
390	atoll.o			\
391	attropen.o		\
392	atexit.o		\
393	atfork.o		\
394	basename.o		\
395	calloc.o		\
396	catgets.o		\
397	catopen.o		\
398	cfgetispeed.o		\
399	cfgetospeed.o		\
400	cfree.o			\
401	cfsetispeed.o		\
402	cfsetospeed.o		\
403	cftime.o		\
404	clock.o			\
405	closedir.o		\
406	closefrom.o		\
407	confstr.o		\
408	crypt.o			\
409	csetlen.o		\
410	ctime.o			\
411	ctime_r.o		\
412	directio.o		\
413	dirname.o		\
414	div.o			\
415	drand48.o		\
416	dup2.o			\
417	env_data.o		\
418	errno.o			\
419	euclen.o		\
420	event_port.o		\
421	execvp.o		\
422	fattach.o		\
423	fdetach.o		\
424	fdopendir.o		\
425	ffs.o			\
426	fmtmsg.o		\
427	ftime.o			\
428	ftok.o			\
429	ftw.o			\
430	gcvt.o			\
431	getauxv.o		\
432	getcwd.o		\
433	getdate_err.o		\
434	getdtblsize.o		\
435	getenv.o		\
436	getexecname.o		\
437	getgrnam.o		\
438	getgrnam_r.o		\
439	gethostid.o		\
440	gethostname.o		\
441	gethz.o			\
442	getisax.o		\
443	getloadavg.o		\
444	getlogin.o		\
445	getmntent.o		\
446	getnetgrent.o		\
447	getopt.o		\
448	getopt_long.o		\
449	getpagesize.o		\
450	getpw.o			\
451	getpwnam.o		\
452	getpwnam_r.o		\
453	getrusage.o		\
454	getspent.o		\
455	getspent_r.o		\
456	getsubopt.o		\
457	gettxt.o		\
458	getusershell.o		\
459	getut.o			\
460	getutx.o		\
461	getvfsent.o		\
462	getwd.o			\
463	getwidth.o		\
464	getxby_door.o		\
465	gtxt.o			\
466	hsearch.o		\
467	iconv.o			\
468	imaxabs.o		\
469	imaxdiv.o		\
470	index.o			\
471	initgroups.o		\
472	insque.o		\
473	isaexec.o		\
474	isastream.o		\
475	isatty.o		\
476	killpg.o		\
477	l64a.o			\
478	lckpwdf.o		\
479	lconstants.o		\
480	lfind.o			\
481	lfmt.o			\
482	lfmt_log.o		\
483	llabs.o			\
484	lldiv.o			\
485	lltostr.o		\
486	localtime.o		\
487	lsearch.o		\
488	madvise.o		\
489	malloc.o		\
490	memalign.o		\
491	mkdev.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