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