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