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