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