xref: /illumos-gate/usr/src/lib/libc/amd64/Makefile (revision f343451914d0efaf2d6fc84d8818a16246b223dc)
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 (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
25# Copyright 2013 Garrett D'Amore <garrett@damore.org>
26# Copyright 2018 Nexenta Systems, Inc.
27# Copyright 2019 Joyent, Inc.
28# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
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	atexit.o		\
354	atfork.o		\
355	atof.o			\
356	atoi.o			\
357	atol.o			\
358	atoll.o			\
359	attropen.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	freezero.o		\
400	ftime.o			\
401	ftok.o			\
402	fts.o			\
403	ftw.o			\
404	gcvt.o			\
405	get_nprocs.o		\
406	getauxv.o		\
407	getcwd.o		\
408	getdate_err.o		\
409	getdtblsize.o		\
410	getentropy.o		\
411	getenv.o		\
412	getexecname.o		\
413	getgrnam.o		\
414	getgrnam_r.o		\
415	gethostid.o		\
416	gethostname.o		\
417	gethz.o			\
418	getisax.o		\
419	getloadavg.o		\
420	getlogin.o		\
421	getmntent.o		\
422	getnetgrent.o		\
423	getopt.o		\
424	getopt_long.o		\
425	getpagesize.o		\
426	getpw.o			\
427	getpwnam.o		\
428	getpwnam_r.o		\
429	getrusage.o		\
430	getspent.o		\
431	getspent_r.o		\
432	getsubopt.o		\
433	gettxt.o		\
434	getusershell.o		\
435	getut.o			\
436	getutx.o		\
437	getvfsent.o		\
438	getwd.o			\
439	getwidth.o		\
440	getxby_door.o		\
441	gtxt.o			\
442	hsearch.o		\
443	iconv.o			\
444	imaxabs.o		\
445	imaxdiv.o		\
446	index.o			\
447	initgroups.o		\
448	insque.o		\
449	isaexec.o		\
450	isastream.o		\
451	isatty.o		\
452	killpg.o		\
453	klpdlib.o		\
454	l64a.o			\
455	lckpwdf.o		\
456	lconstants.o		\
457	lexp10.o		\
458	lfind.o			\
459	lfmt.o			\
460	lfmt_log.o		\
461	lldiv.o			\
462	llog10.o		\
463	lltostr.o		\
464	lmath.o			\
465	localtime.o		\
466	lsearch.o		\
467	madvise.o		\
468	malloc.o		\
469	memalign.o		\
470	memmem.o		\
471	memset_s.o		\
472	mkdev.o			\
473	mkdtemp.o		\
474	mkfifo.o		\
475	mkstemp.o		\
476	mktemp.o		\
477	mlock.o			\
478	mlockall.o		\
479	mon.o			\
480	msync.o			\
481	munlock.o		\
482	munlockall.o		\
483	ndbm.o			\
484	nftw.o			\
485	nlspath_checks.o	\
486	nsparse.o		\
487	nss_common.o		\
488	nss_dbdefs.o		\
489	nss_deffinder.o		\
490	opendir.o		\
491	opt_data.o		\
492	perror.o		\
493	pfmt.o			\
494	pfmt_data.o		\
495	pfmt_print.o		\
496	pipe.o			\
497	plock.o			\
498	poll.o			\
499	posix_fadvise.o		\
500	posix_fallocate.o	\
501	posix_madvise.o		\
502	posix_memalign.o	\
503	priocntl.o		\
504	priv_str_xlate.o	\
505	privlib.o		\
506	psecflags.o		\
507	psiginfo.o		\
508	psignal.o		\
509	pt.o			\
510	putpwent.o		\
511	putspent.o		\
512	raise.o			\
513	rand.o			\
514	random.o		\
515	rctlops.o		\
516	readdir.o		\
517	readdir_r.o		\
518	reallocarray.o		\
519	reallocf.o		\
520	recallocarray.o		\
521	realpath.o		\
522	reboot.o		\
523	regexpr.o		\
524	remove.o		\
525	rewinddir.o		\
526	rindex.o		\
527	scandir.o		\
528	seekdir.o		\
529	select.o		\
530	set_constraint_handler_s.o \
531	setlabel.o		\
532	setpriority.o		\
533	settimeofday.o		\
534	sh_locks.o		\
535	sigflag.o		\
536	siglist.o		\
537	sigsend.o		\
538	sigsetops.o		\
539	ssignal.o		\
540	stack.o			\
541	stpcpy.o		\
542	stpncpy.o		\
543	str2sig.o		\
544	strcase_charmap.o	\
545	strcat.o		\
546	strchr.o		\
547	strchrnul.o		\
548	strcspn.o		\
549	strdup.o		\
550	strerror.o		\
551	strlcat.o		\
552	strlcpy.o		\
553	strncat.o		\
554	strndup.o		\
555	strpbrk.o		\
556	strrchr.o		\
557	strsep.o		\
558	strsignal.o		\
559	strspn.o		\
560	strstr.o		\
561	strtod.o		\
562	strtoimax.o		\
563	strtok.o		\
564	strtok_r.o		\
565	strtonum.o		\
566	strtoumax.o		\
567	swab.o			\
568	swapctl.o		\
569	sysconf.o		\
570	syslog.o		\
571	tcdrain.o		\
572	tcflow.o		\
573	tcflush.o		\
574	tcgetattr.o		\
575	tcgetpgrp.o		\
576	tcgetsid.o		\
577	tcsendbreak.o		\
578	tcsetattr.o		\
579	tcsetpgrp.o		\
580	tell.o			\
581	telldir.o		\
582	tfind.o			\
583	time_data.o		\
584	time_gdata.o		\
585	timespec_get.o		\
586	tls_data.o		\
587	truncate.o		\
588	tsdalloc.o		\
589	tsearch.o		\
590	ttyname.o		\
591	ttyslot.o		\
592	ualarm.o		\
593	ucred.o			\
594	valloc.o		\
595	vlfmt.o			\
596	vpfmt.o			\
597	waitpid.o		\
598	walkstack.o		\
599	wdata.o			\
600	xgetwidth.o		\
601	xpg4.o			\
602	xpg6.o
603
604PORTINET=			\
605	inet_lnaof.o		\
606	inet_makeaddr.o		\
607	inet_network.o		\
608	inet_ntoa.o		\
609	inet_ntop.o		\
610	inet_pton.o
611
612PORTPRINT_W=			\
613	doprnt_w.o
614
615PORTPRINT=			\
616	asprintf.o		\
617	doprnt.o		\
618	fprintf.o		\
619	printf.o		\
620	snprintf.o		\
621	sprintf.o		\
622	vfprintf.o		\
623	vprintf.o		\
624	vsnprintf.o		\
625	vsprintf.o		\
626	vwprintf.o		\
627	wprintf.o
628
629# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
630# This macro should ALWAYS be empty; native APIs are already 'large file'.
631PORTSTDIO64=
632
633PORTSTDIO_W=			\
634	doscan_w.o
635
636PORTSTDIO=			\
637	__extensions.o		\
638	_endopen.o		\
639	_filbuf.o		\
640	_findbuf.o		\
641	_flsbuf.o		\
642	_stdio_flags.o		\
643	_wrtchk.o		\
644	clearerr.o		\
645	ctermid.o		\
646	ctermid_r.o		\
647	cuserid.o		\
648	data.o			\
649	doscan.o		\
650	fdopen.o		\
651	feof.o			\
652	ferror.o		\
653	fgetc.o			\
654	fgets.o			\
655	fileno.o		\
656	flockf.o		\
657	flush.o			\
658	fmemopen.o		\
659	fopen.o			\
660	fpos.o			\
661	fputc.o			\
662	fputs.o			\
663	fread.o			\
664	fseek.o			\
665	fseeko.o		\
666	ftell.o			\
667	ftello.o		\
668	fwrite.o		\
669	getc.o			\
670	getchar.o		\
671	getline.o		\
672	getpass.o		\
673	gets.o			\
674	getw.o			\
675	mse.o			\
676	open_memstream.o	\
677	open_wmemstream.o	\
678	popen.o			\
679	putc.o			\
680	putchar.o		\
681	puts.o			\
682	putw.o			\
683	rewind.o		\
684	scanf.o			\
685	setbuf.o		\
686	setbuffer.o		\
687	setvbuf.o		\
688	system.o		\
689	tempnam.o		\
690	tmpfile.o		\
691	tmpnam_r.o		\
692	ungetc.o		\
693	vscanf.o		\
694	vwscanf.o		\
695	wscanf.o
696
697PORTI18N=			\
698	getwchar.o		\
699	putwchar.o		\
700	putws.o			\
701	strtows.o		\
702	wcsnlen.o		\
703	wcsstr.o		\
704	wcstoimax.o		\
705	wcstol.o		\
706	wcstoul.o		\
707	wcswcs.o		\
708	wmemchr.o		\
709	wmemcmp.o		\
710	wmemcpy.o		\
711	wmemmove.o		\
712	wmemset.o		\
713	wscat.o			\
714	wschr.o			\
715	wscmp.o			\
716	wscpy.o			\
717	wscspn.o		\
718	wsdup.o			\
719	wslen.o			\
720	wsncat.o		\
721	wsncmp.o		\
722	wsncpy.o		\
723	wspbrk.o		\
724	wsprintf.o		\
725	wsrchr.o		\
726	wsscanf.o		\
727	wsspn.o			\
728	wstod.o			\
729	wstok.o			\
730	wstol.o			\
731	wstoll.o		\
732	wsxfrm.o		\
733	gettext.o		\
734	gettext_gnu.o		\
735	gettext_real.o		\
736	gettext_util.o		\
737	plural_parser.o		\
738	wdresolve.o		\
739	_ctype.o		\
740	isascii.o		\
741	toascii.o
742
743PORTI18N_COND=			\
744	wcstol_longlong.o	\
745	wcstoul_longlong.o
746
747PORTLOCALE=			\
748	big5.o			\
749	btowc.o			\
750	collate.o		\
751	collcmp.o		\
752	euc.o			\
753	fnmatch.o		\
754	fgetwc.o		\
755	fgetws.o		\
756	fix_grouping.o		\
757	fputwc.o		\
758	fputws.o		\
759	fwide.o			\
760	gb18030.o		\
761	gb2312.o		\
762	gbk.o			\
763	getdate.o		\
764	isdigit.o		\
765	iswctype.o		\
766	ldpart.o		\
767	lmessages.o		\
768	lnumeric.o		\
769	lmonetary.o		\
770	localeconv.o		\
771	localeimpl.o		\
772	mbftowc.o		\
773	mblen.o			\
774	mbrlen.o		\
775	mbrtowc.o		\
776	mbsinit.o		\
777	mbsnrtowcs.o		\
778	mbsrtowcs.o		\
779	mbstowcs.o		\
780	mbtowc.o		\
781	mskanji.o		\
782	nextwctype.o		\
783	nl_langinfo.o		\
784	none.o			\
785	rune.o			\
786	runetype.o		\
787	setlocale.o		\
788	setrunelocale.o		\
789	strcasecmp.o		\
790	strcasestr.o		\
791	strcoll.o		\
792	strfmon.o		\
793	strftime.o		\
794	strncasecmp.o		\
795	strptime.o		\
796	strxfrm.o		\
797	table.o			\
798	timelocal.o		\
799	tolower.o		\
800	towlower.o		\
801	ungetwc.o		\
802	utf8.o			\
803	wcrtomb.o		\
804	wcscasecmp.o		\
805	wcscoll.o		\
806	wcsftime.o		\
807	wcsnrtombs.o		\
808	wcsrtombs.o		\
809	wcswidth.o		\
810	wcstombs.o		\
811	wcsxfrm.o		\
812	wctob.o			\
813	wctomb.o		\
814	wctrans.o		\
815	wctype.o		\
816	wcwidth.o		\
817	wscol.o
818
819AIOOBJS=			\
820	aio.o			\
821	aio_alloc.o		\
822	posix_aio.o
823
824RTOBJS=				\
825	clock_timer.o		\
826	mqueue.o		\
827	pos4obj.o		\
828	sched.o			\
829	sem.o			\
830	shm.o			\
831	sigev_thread.o
832
833SECFLAGSOBJS=			\
834	secflags.o
835
836TPOOLOBJS=			\
837	thread_pool.o
838
839THREADSOBJS=			\
840	alloc.o			\
841	assfail.o		\
842	c11_thr.o		\
843	cancel.o		\
844	door_calls.o		\
845	tmem.o			\
846	pthr_attr.o		\
847	pthr_barrier.o		\
848	pthr_cond.o		\
849	pthr_mutex.o		\
850	pthr_rwlock.o		\
851	pthread.o		\
852	rwlock.o		\
853	scalls.o		\
854	sema.o			\
855	sigaction.o		\
856	spawn.o			\
857	synch.o			\
858	tdb_agent.o		\
859	thr.o			\
860	thread_interface.o	\
861	tls.o			\
862	tsd.o
863
864THREADSMACHOBJS=		\
865	machdep.o
866
867THREADSASMOBJS=			\
868	asm_subr.o
869
870UNICODEOBJS=			\
871	u8_textprep.o		\
872	uconv.o
873
874UNWINDMACHOBJS=			\
875	call_frame_inst.o	\
876	eh_frame.o		\
877	thrp_unwind.o		\
878	unwind.o
879
880pics/unwind.o:= COPTFLAG64 =
881
882UNWINDASMOBJS=			\
883	unwind_frame.o
884
885# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
886# This macro should ALWAYS be empty; native APIs are already 'large file'.
887PORTSYS64=
888
889PORTSYS=			\
890	_autofssys.o		\
891	access.o		\
892	acctctl.o		\
893	bsd_signal.o		\
894	chmod.o			\
895	chown.o			\
896	corectl.o		\
897	epoll.o			\
898	exacctsys.o		\
899	execl.o			\
900	execle.o		\
901	execv.o			\
902	eventfd.o		\
903	fcntl.o			\
904	getpagesizes.o		\
905	getpeerucred.o		\
906	inst_sync.o		\
907	issetugid.o		\
908	label.o			\
909	link.o			\
910	lockf.o			\
911	lwp.o			\
912	lwp_cond.o		\
913	lwp_rwlock.o		\
914	lwp_sigmask.o		\
915	meminfosys.o		\
916	mkdir.o			\
917	mknod.o			\
918	msgsys.o		\
919	nfssys.o		\
920	open.o			\
921	pgrpsys.o		\
922	posix_sigwait.o		\
923	ppriv.o			\
924	psetsys.o		\
925	rctlsys.o		\
926	readlink.o		\
927	rename.o		\
928	sbrk.o			\
929	semsys.o		\
930	set_errno.o		\
931	sharefs.o		\
932	shmsys.o		\
933	sidsys.o		\
934	siginterrupt.o		\
935	signal.o		\
936	signalfd.o		\
937	sigpending.o		\
938	sigstack.o		\
939	stat.o			\
940	symlink.o		\
941	tasksys.o		\
942	time.o			\
943	time_util.o		\
944	timerfd.o		\
945	ucontext.o		\
946	unlink.o		\
947	ustat.o			\
948	utimesys.o		\
949	zone.o
950
951PORTREGEX=			\
952	glob.o			\
953	regcmp.o		\
954	regcomp.o		\
955	regerror.o		\
956	regex.o			\
957	regexec.o		\
958	regfree.o		\
959	wordexp.o
960
961VALUES=				\
962	values-Xa.o
963
964MOSTOBJS=			\
965	$(STRETS)		\
966	$(CRTOBJS)		\
967	$(DYNOBJS)		\
968	$(FPOBJS)		\
969	$(I386FPOBJS)		\
970	$(FPASMOBJS)		\
971	$(ATOMICOBJS)		\
972	$(CHACHAOBJS)		\
973	$(XATTROBJS)		\
974	$(COMOBJS)		\
975	$(GENOBJS)		\
976	$(PORTFP)		\
977	$(PORTGEN)		\
978	$(PORTGEN64)		\
979	$(PORTI18N)		\
980	$(PORTI18N_COND)	\
981	$(PORTINET)		\
982	$(PORTLOCALE)		\
983	$(PORTPRINT)		\
984	$(PORTPRINT_W)		\
985	$(PORTREGEX)		\
986	$(PORTSTDIO)		\
987	$(PORTSTDIO64)		\
988	$(PORTSTDIO_W)		\
989	$(PORTSYS)		\
990	$(PORTSYS64)		\
991	$(AIOOBJS)		\
992	$(RTOBJS)		\
993	$(SECFLAGSOBJS)		\
994	$(TPOOLOBJS)		\
995	$(THREADSOBJS)		\
996	$(THREADSMACHOBJS)	\
997	$(THREADSASMOBJS)	\
998	$(UNICODEOBJS)		\
999	$(UNWINDMACHOBJS)	\
1000	$(UNWINDASMOBJS)	\
1001	$(COMSYSOBJS)		\
1002	$(SYSOBJS)		\
1003	$(COMSYSOBJS64)		\
1004	$(SYSOBJS64)		\
1005	$(VALUES)
1006
1007TRACEOBJS=			\
1008	plockstat.o
1009
1010# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
1011# modules whose source is provided in the $(SRC)/lib/crt directory.
1012# This must be done because otherwise the Sun C compiler would insert
1013# its own versions of these modules and those versions contain code
1014# to call out to C++ initialization functions.  Such C++ initialization
1015# functions can call back into libc before thread initialization is
1016# complete and this leads to segmentation violations and other problems.
1017# Since libc contains no C++ code, linking with the minimal crti.o and
1018# crtn.o modules is safe and avoids the problems described above.
1019OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1020CRTSRCS= ../../crt/amd64
1021
1022# include common library definitions
1023include ../../Makefile.lib
1024include ../../Makefile.lib.64
1025
1026CFLAGS64 += $(CTF_FLAGS)
1027
1028# This is necessary to avoid problems with calling _ex_unwind().
1029# We probably don't want any inlining anyway.
1030CFLAGS64 += -xinline=
1031
1032CERRWARN += -_gcc=-Wno-parentheses
1033CERRWARN += -_gcc=-Wno-switch
1034CERRWARN += $(CNOWARN_UNINIT)
1035CERRWARN += -_gcc=-Wno-unused-value
1036CERRWARN += -_gcc=-Wno-unused-label
1037CERRWARN += -_gcc=-Wno-unused-variable
1038CERRWARN += -_gcc=-Wno-type-limits
1039CERRWARN += -_gcc=-Wno-char-subscripts
1040CERRWARN += -_gcc=-Wno-clobbered
1041CERRWARN += -_gcc=-Wno-unused-function
1042CERRWARN += -_gcc=-Wno-address
1043
1044$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
1045
1046# not linted
1047SMATCH=off
1048
1049# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1050# enables ASSERT() checking in the threads portion of the library.
1051# This is automatically enabled for DEBUG builds, not for non-debug builds.
1052THREAD_DEBUG =
1053$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1054
1055# Make string literals read-only to save memory
1056CFLAGS64 += $(XSTRCONST)
1057
1058ALTPICS= $(TRACEOBJS:%=pics/%)
1059
1060$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1061
1062MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1063
1064CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
1065		-I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1066ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
1067		$(amd64_AS_XARCH)
1068
1069# As a favor to the dtrace syscall provider, libc still calls the
1070# old syscall traps that have been obsoleted by the *at() interfaces.
1071# Delete this to compile libc using only the new *at() system call traps
1072CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1073
1074# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
1075pics/proc64_id.o	:= CFLAGS64 += -I$(SRC)/uts/intel
1076
1077# Inform the run-time linker about libc specialized initialization
1078RTLDINFO =	-z rtldinfo=tls_rtldinfo
1079DYNFLAGS +=	$(RTLDINFO)
1080
1081# Force libc's internal references to be resolved immediately upon loading
1082# in order to avoid critical region problems.  Since almost all libc symbols
1083# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1084DYNFLAGS +=	-znow
1085
1086BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1087
1088# Override this top level flag so the compiler builds in its native
1089# C99 mode.  This has been enabled to support the complex arithmetic
1090# added to libc.
1091CSTD=	$(CSTD_GNU99)
1092
1093# libc method of building an archive
1094# The "$(GREP) -v ' L '" part is necessary only until
1095# lorder is fixed to ignore thread-local variables.
1096BUILD.AR= $(RM) $@ ; \
1097	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1098
1099# extra files for the clean target
1100CLEANFILES +=			\
1101	$(LIBCDIR)/port/gen/errlst.c	\
1102	$(LIBCDIR)/port/gen/new_list.c	\
1103	assym.h			\
1104	genassym		\
1105	crt/_rtld.s		\
1106	pics/crti.o		\
1107	pics/crtn.o		\
1108	$(ALTPICS)
1109
1110CLOBBERFILES +=	$(LIB_PIC)
1111
1112# conditional assignments
1113# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1114$(DYNLIB) := CRTI = crti.o
1115$(DYNLIB) := CRTN = crtn.o
1116
1117# Files which need the threads .il inline template
1118TIL=				\
1119	aio.o			\
1120	alloc.o			\
1121	assfail.o		\
1122	atexit.o		\
1123	atfork.o		\
1124	cancel.o		\
1125	door_calls.o		\
1126	err.o			\
1127	errno.o			\
1128	lwp.o			\
1129	ma.o			\
1130	machdep.o		\
1131	posix_aio.o		\
1132	pthr_attr.o		\
1133	pthr_barrier.o		\
1134	pthr_cond.o		\
1135	pthr_mutex.o		\
1136	pthr_rwlock.o		\
1137	pthread.o		\
1138	rand.o			\
1139	rwlock.o		\
1140	scalls.o		\
1141	sched.o			\
1142	sema.o			\
1143	sigaction.o		\
1144	sigev_thread.o		\
1145	spawn.o			\
1146	stack.o			\
1147	synch.o			\
1148	tdb_agent.o		\
1149	thr.o			\
1150	thread_interface.o	\
1151	thread_pool.o		\
1152	thrp_unwind.o		\
1153	tls.o			\
1154	tmem.o			\
1155	tsd.o
1156
1157$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1158
1159# pics/mul64.o := CFLAGS64 += crt/mul64.il
1160
1161# large-file-aware components that should be built large
1162
1163#$(COMSYSOBJS64:%=pics/%) := \
1164#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1165
1166#$(SYSOBJS64:%=pics/%) := \
1167#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1168
1169#$(PORTGEN64:%=pics/%) := \
1170#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1171
1172#$(PORTSTDIO64:%=pics/%) := \
1173#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1174
1175#$(PORTSYS64:%=pics/%) := \
1176#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1177
1178$(PORTSTDIO_W:%=pics/%) := \
1179	CPPFLAGS += -D_WIDE
1180
1181$(PORTPRINT_W:%=pics/%) := \
1182	CPPFLAGS += -D_WIDE
1183
1184$(PORTPRINT_C89:%=pics/%) := \
1185	CPPFLAGS += -D_C89_INTMAX32
1186
1187$(PORTSTDIO_C89:%=pics/%) := \
1188	CPPFLAGS += -D_C89_INTMAX32
1189
1190$(PORTI18N_COND:%=pics/%) := \
1191	CPPFLAGS += -D_WCS_LONGLONG
1192
1193pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1194
1195pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1196pics/gettimeofday.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1197
1198.KEEP_STATE:
1199
1200all: $(LIBS) $(LIB_PIC)
1201
1202# object files that depend on inline template
1203$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1204# pics/mul64.o: crt/mul64.il
1205
1206# include common libc targets
1207include ../Makefile.targ
1208
1209# We need to strip out all CTF data from the static library
1210$(LIB_PIC) := DIR = pics
1211$(LIB_PIC): pics $$(PICS)
1212	$(BUILD.AR)
1213	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1214	$(AR) -ts $@ > /dev/null
1215	$(POST_PROCESS_A)
1216
1217ASSYMDEP_OBJS=			\
1218	_lwp_mutex_unlock.o	\
1219	_stack_grow.o		\
1220	asm_subr.o		\
1221	getcontext.o		\
1222	setjmp.o		\
1223	tls_get_addr.o		\
1224	vforkx.o
1225
1226$(ASSYMDEP_OBJS:%=pics/%): assym.h
1227
1228# assym.h build rules
1229
1230GENASSYM_C = genassym.c
1231LDFLAGS.native = $(LDASSERTS) $(ZASSERTDEFLIB)=libc.so $(BDIRECT)
1232
1233genassym: $(GENASSYM_C)
1234	$(NATIVECC) $(NATIVE_CFLAGS) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.native) \
1235		$(LDFLAGS.native) -o $@ $(GENASSYM_C)
1236
1237OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1238
1239assym.h: $(OFFSETS) genassym
1240	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1241	./genassym >>$@
1242
1243# derived C source and related explicit dependencies
1244$(LIBCDIR)/port/gen/errlst.c + \
1245$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1246	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1247
1248pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1249
1250pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1251