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