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