xref: /illumos-gate/usr/src/lib/libc/amd64/Makefile (revision d7e2bdfa66e3574ffcce3665a4cd1136fc6cb6a1)
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 2020 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	explicit_bzero.o	\
107	memmem.o		\
108	qsort.o			\
109	strtol.o		\
110	strtoul.o		\
111	strtoll.o		\
112	strtoull.o
113
114GENOBJS=			\
115	$(COMMPAGE_OBJS)	\
116	_getsp.o		\
117	abs.o			\
118	alloca.o		\
119	arc4random.o		\
120	arc4random_uniform.o	\
121	attrat.o		\
122	byteorder.o		\
123	cuexit.o		\
124	ecvt.o			\
125	endian.o		\
126	errlst.o		\
127	amd64_data.o		\
128	ldivide.o		\
129	lock.o			\
130	makectxt.o		\
131	memccpy.o		\
132	memchr.o		\
133	memcmp.o		\
134	memcpy.o		\
135	memset.o		\
136	new_list.o		\
137	proc64_id.o		\
138	proc64_support.o	\
139	setjmp.o		\
140	siginfolst.o		\
141	siglongjmp.o		\
142	strcmp.o		\
143	strcpy.o		\
144	strlen.o		\
145	strncmp.o		\
146	strncpy.o		\
147	strnlen.o		\
148	sync_instruction_memory.o
149
150# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
151# This macro should ALWAYS be empty; native APIs are already 'large file'.
152COMSYSOBJS64=
153
154SYSOBJS64=
155
156COMSYSOBJS=			\
157	__clock_timer.o		\
158	__getloadavg.o		\
159	__rusagesys.o		\
160	__signotify.o		\
161	__sigrt.o		\
162	__time.o		\
163	_lgrp_home_fast.o	\
164	_lgrpsys.o		\
165	_nfssys.o		\
166	_portfs.o		\
167	_pset.o			\
168	_rpcsys.o		\
169	_sigaction.o		\
170	_so_accept.o		\
171	_so_bind.o		\
172	_so_connect.o		\
173	_so_getpeername.o	\
174	_so_getsockname.o	\
175	_so_getsockopt.o	\
176	_so_listen.o		\
177	_so_recv.o		\
178	_so_recvfrom.o		\
179	_so_recvmsg.o		\
180	_so_send.o		\
181	_so_sendmsg.o		\
182	_so_sendto.o		\
183	_so_setsockopt.o	\
184	_so_shutdown.o		\
185	_so_socket.o		\
186	_so_socketpair.o	\
187	_sockconfig.o		\
188	acct.o			\
189	acl.o			\
190	adjtime.o		\
191	alarm.o			\
192	brk.o			\
193	chdir.o			\
194	chroot.o		\
195	cladm.o			\
196	close.o			\
197	execve.o		\
198	exit.o			\
199	facl.o			\
200	fchdir.o		\
201	fchroot.o		\
202	fdsync.o		\
203	fpathconf.o		\
204	fstatfs.o		\
205	fstatvfs.o		\
206	getcpuid.o		\
207	getdents.o		\
208	getegid.o		\
209	geteuid.o		\
210	getgid.o		\
211	getgroups.o		\
212	gethrtime.o		\
213	getitimer.o		\
214	getmsg.o		\
215	getpid.o		\
216	getpmsg.o		\
217	getppid.o		\
218	getrandom.o		\
219	getrlimit.o		\
220	getuid.o		\
221	gtty.o			\
222	install_utrap.o		\
223	ioctl.o			\
224	kaio.o			\
225	kill.o			\
226	llseek.o		\
227	lseek.o			\
228	mmapobjsys.o		\
229	memcntl.o		\
230	mincore.o		\
231	mmap.o			\
232	modctl.o		\
233	mount.o			\
234	mprotect.o		\
235	munmap.o		\
236	nice.o			\
237	ntp_adjtime.o		\
238	ntp_gettime.o		\
239	p_online.o		\
240	pathconf.o		\
241	pause.o			\
242	pcsample.o		\
243	pipe2.o			\
244	pollsys.o		\
245	pread.o			\
246	preadv.o		\
247	priocntlset.o		\
248	processor_bind.o	\
249	processor_info.o	\
250	profil.o		\
251	psecflagsset.o		\
252	putmsg.o		\
253	putpmsg.o		\
254	pwrite.o		\
255	pwritev.o		\
256	read.o			\
257	readv.o			\
258	resolvepath.o		\
259	seteguid.o		\
260	setgid.o		\
261	setgroups.o		\
262	setitimer.o		\
263	setreid.o		\
264	setrlimit.o		\
265	setuid.o		\
266	sigaltstk.o		\
267	sigprocmsk.o		\
268	sigsendset.o		\
269	sigsuspend.o		\
270	statfs.o		\
271	statvfs.o		\
272	stty.o			\
273	sync.o			\
274	sysconfig.o		\
275	sysfs.o			\
276	sysinfo.o		\
277	syslwp.o		\
278	times.o			\
279	ulimit.o		\
280	umask.o			\
281	umount2.o		\
282	utssys.o		\
283	uucopy.o		\
284	vhangup.o		\
285	waitid.o		\
286	write.o			\
287	writev.o		\
288	yield.o
289
290SYSOBJS=			\
291	__clock_gettime.o	\
292	__clock_gettime_sys.o	\
293	__getcontext.o		\
294	__uadmin.o		\
295	_lwp_mutex_unlock.o	\
296	_stack_grow.o		\
297	door.o			\
298	forkx.o			\
299	forkallx.o		\
300	getcontext.o		\
301	gettimeofday.o		\
302	lwp_private.o		\
303	nuname.o		\
304	syscall.o		\
305	sysi86.o		\
306	tls_get_addr.o		\
307	uadmin.o		\
308	umount.o		\
309	uname.o			\
310	vforkx.o
311
312# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
313# This macro should ALWAYS be empty; native APIs are already 'large file'.
314PORTGEN64=
315
316# objects from source under $(LIBCDIR)/port
317PORTFP=				\
318	__flt_decim.o		\
319	__flt_rounds.o		\
320	__tbl_10_b.o		\
321	__tbl_10_h.o		\
322	__tbl_10_s.o		\
323	__tbl_2_b.o		\
324	__tbl_2_h.o		\
325	__tbl_2_s.o		\
326	__tbl_fdq.o		\
327	__tbl_tens.o		\
328	__x_power.o		\
329	_base_sup.o		\
330	aconvert.o		\
331	decimal_bin.o		\
332	double_decim.o		\
333	econvert.o		\
334	fconvert.o		\
335	file_decim.o		\
336	finite.o		\
337	fp_data.o		\
338	func_decim.o		\
339	gconvert.o		\
340	hex_bin.o		\
341	ieee_globals.o		\
342	pack_float.o		\
343	sigfpe.o		\
344	string_decim.o
345
346PORTGEN=			\
347	_env_data.o		\
348	_xftw.o			\
349	a64l.o			\
350	abort.o			\
351	addsev.o		\
352	ascii_strcasecmp.o	\
353	ascii_strncasecmp.o	\
354	assert.o		\
355	atexit.o		\
356	atfork.o		\
357	atof.o			\
358	atoi.o			\
359	atol.o			\
360	atoll.o			\
361	attropen.o		\
362	basename.o		\
363	calloc.o		\
364	catgets.o		\
365	catopen.o		\
366	cfgetispeed.o		\
367	cfgetospeed.o		\
368	cfree.o			\
369	cfsetispeed.o		\
370	cfsetospeed.o		\
371	cftime.o		\
372	clock.o			\
373	closedir.o		\
374	closefrom.o		\
375	confstr.o		\
376	crypt.o			\
377	csetlen.o		\
378	ctime.o			\
379	ctime_r.o		\
380	daemon.o		\
381	deflt.o			\
382	directio.o		\
383	dirname.o		\
384	div.o			\
385	drand48.o		\
386	dup.o			\
387	env_data.o		\
388	err.o			\
389	errno.o			\
390	euclen.o		\
391	event_port.o		\
392	execvp.o		\
393	fattach.o		\
394	fdetach.o		\
395	fdopendir.o		\
396	ffs.o			\
397	flock.o			\
398	fls.o			\
399	fmtmsg.o		\
400	freezero.o		\
401	ftime.o			\
402	ftok.o			\
403	fts.o			\
404	ftw.o			\
405	gcvt.o			\
406	get_nprocs.o		\
407	getauxv.o		\
408	getcwd.o		\
409	getdate_err.o		\
410	getdtblsize.o		\
411	getentropy.o		\
412	getenv.o		\
413	getexecname.o		\
414	getgrnam.o		\
415	getgrnam_r.o		\
416	gethostid.o		\
417	gethostname.o		\
418	gethz.o			\
419	getisax.o		\
420	getloadavg.o		\
421	getlogin.o		\
422	getmntent.o		\
423	getnetgrent.o		\
424	getopt.o		\
425	getopt_long.o		\
426	getpagesize.o		\
427	getpw.o			\
428	getpwnam.o		\
429	getpwnam_r.o		\
430	getrusage.o		\
431	getspent.o		\
432	getspent_r.o		\
433	getsubopt.o		\
434	gettxt.o		\
435	getusershell.o		\
436	getut.o			\
437	getutx.o		\
438	getvfsent.o		\
439	getwd.o			\
440	getwidth.o		\
441	getxby_door.o		\
442	gtxt.o			\
443	hsearch.o		\
444	iconv.o			\
445	imaxabs.o		\
446	imaxdiv.o		\
447	index.o			\
448	initgroups.o		\
449	insque.o		\
450	isaexec.o		\
451	isastream.o		\
452	isatty.o		\
453	killpg.o		\
454	klpdlib.o		\
455	l64a.o			\
456	lckpwdf.o		\
457	lconstants.o		\
458	lexp10.o		\
459	lfind.o			\
460	lfmt.o			\
461	lfmt_log.o		\
462	lldiv.o			\
463	llog10.o		\
464	lltostr.o		\
465	lmath.o			\
466	localtime.o		\
467	lsearch.o		\
468	madvise.o		\
469	malloc.o		\
470	memalign.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	c16rtomb.o		\
751	c32rtomb.o		\
752	collate.o		\
753	collcmp.o		\
754	euc.o			\
755	fnmatch.o		\
756	fgetwc.o		\
757	fgetws.o		\
758	fix_grouping.o		\
759	fputwc.o		\
760	fputws.o		\
761	fwide.o			\
762	gb18030.o		\
763	gb2312.o		\
764	gbk.o			\
765	getdate.o		\
766	isdigit.o		\
767	iswctype.o		\
768	ldpart.o		\
769	lmessages.o		\
770	lnumeric.o		\
771	lmonetary.o		\
772	localeconv.o		\
773	localeimpl.o		\
774	mbftowc.o		\
775	mblen.o			\
776	mbrlen.o		\
777	mbrtoc16.o		\
778	mbrtoc32.o		\
779	mbrtowc.o		\
780	mbsinit.o		\
781	mbsnrtowcs.o		\
782	mbsrtowcs.o		\
783	mbstowcs.o		\
784	mbtowc.o		\
785	mskanji.o		\
786	nextwctype.o		\
787	nl_langinfo.o		\
788	none.o			\
789	rune.o			\
790	runetype.o		\
791	setlocale.o		\
792	setrunelocale.o		\
793	strcasecmp.o		\
794	strcasestr.o		\
795	strcoll.o		\
796	strfmon.o		\
797	strftime.o		\
798	strncasecmp.o		\
799	strptime.o		\
800	strxfrm.o		\
801	table.o			\
802	timelocal.o		\
803	tolower.o		\
804	towlower.o		\
805	ungetwc.o		\
806	utf8.o			\
807	wcrtomb.o		\
808	wcscasecmp.o		\
809	wcscoll.o		\
810	wcsftime.o		\
811	wcsnrtombs.o		\
812	wcsrtombs.o		\
813	wcswidth.o		\
814	wcstombs.o		\
815	wcsxfrm.o		\
816	wctob.o			\
817	wctomb.o		\
818	wctrans.o		\
819	wctype.o		\
820	wcwidth.o		\
821	wscol.o
822
823AIOOBJS=			\
824	aio.o			\
825	aio_alloc.o		\
826	posix_aio.o
827
828RTOBJS=				\
829	clock_timer.o		\
830	mqueue.o		\
831	pos4obj.o		\
832	sched.o			\
833	sem.o			\
834	shm.o			\
835	sigev_thread.o
836
837SECFLAGSOBJS=			\
838	secflags.o
839
840TPOOLOBJS=			\
841	thread_pool.o
842
843THREADSOBJS=			\
844	alloc.o			\
845	assfail.o		\
846	c11_thr.o		\
847	cancel.o		\
848	door_calls.o		\
849	tmem.o			\
850	pthr_attr.o		\
851	pthr_barrier.o		\
852	pthr_cond.o		\
853	pthr_mutex.o		\
854	pthr_rwlock.o		\
855	pthread.o		\
856	rwlock.o		\
857	scalls.o		\
858	sema.o			\
859	sigaction.o		\
860	spawn.o			\
861	synch.o			\
862	tdb_agent.o		\
863	thr.o			\
864	thread_interface.o	\
865	tls.o			\
866	tsd.o
867
868THREADSMACHOBJS=		\
869	machdep.o
870
871THREADSASMOBJS=			\
872	asm_subr.o
873
874UNICODEOBJS=			\
875	u8_textprep.o		\
876	uconv.o
877
878UNWINDMACHOBJS=			\
879	call_frame_inst.o	\
880	eh_frame.o		\
881	thrp_unwind.o		\
882	unwind.o
883
884pics/unwind.o:= COPTFLAG64 =
885
886UNWINDASMOBJS=			\
887	unwind_frame.o		\
888	unwind_wrap.o
889
890# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
891# This macro should ALWAYS be empty; native APIs are already 'large file'.
892PORTSYS64=
893
894PORTSYS=			\
895	_autofssys.o		\
896	access.o		\
897	acctctl.o		\
898	bsd_signal.o		\
899	chmod.o			\
900	chown.o			\
901	corectl.o		\
902	epoll.o			\
903	exacctsys.o		\
904	execl.o			\
905	execle.o		\
906	execv.o			\
907	eventfd.o		\
908	fcntl.o			\
909	getpagesizes.o		\
910	getpeerucred.o		\
911	inst_sync.o		\
912	issetugid.o		\
913	label.o			\
914	link.o			\
915	lockf.o			\
916	lwp.o			\
917	lwp_cond.o		\
918	lwp_rwlock.o		\
919	lwp_sigmask.o		\
920	meminfosys.o		\
921	mkdir.o			\
922	mknod.o			\
923	msgsys.o		\
924	nfssys.o		\
925	open.o			\
926	pgrpsys.o		\
927	posix_sigwait.o		\
928	ppriv.o			\
929	psetsys.o		\
930	rctlsys.o		\
931	readlink.o		\
932	rename.o		\
933	sbrk.o			\
934	semsys.o		\
935	set_errno.o		\
936	sharefs.o		\
937	shmsys.o		\
938	sidsys.o		\
939	siginterrupt.o		\
940	signal.o		\
941	signalfd.o		\
942	sigpending.o		\
943	sigstack.o		\
944	stat.o			\
945	symlink.o		\
946	tasksys.o		\
947	time.o			\
948	time_util.o		\
949	timerfd.o		\
950	ucontext.o		\
951	unlink.o		\
952	ustat.o			\
953	utimesys.o		\
954	zone.o
955
956PORTREGEX=			\
957	glob.o			\
958	regcmp.o		\
959	regcomp.o		\
960	regerror.o		\
961	regex.o			\
962	regexec.o		\
963	regfree.o		\
964	wordexp.o
965
966VALUES=				\
967	values-Xa.o
968
969MOSTOBJS=			\
970	$(STRETS)		\
971	$(CRTOBJS)		\
972	$(DYNOBJS)		\
973	$(FPOBJS)		\
974	$(I386FPOBJS)		\
975	$(FPASMOBJS)		\
976	$(ATOMICOBJS)		\
977	$(CHACHAOBJS)		\
978	$(XATTROBJS)		\
979	$(COMOBJS)		\
980	$(GENOBJS)		\
981	$(PORTFP)		\
982	$(PORTGEN)		\
983	$(PORTGEN64)		\
984	$(PORTI18N)		\
985	$(PORTI18N_COND)	\
986	$(PORTINET)		\
987	$(PORTLOCALE)		\
988	$(PORTPRINT)		\
989	$(PORTPRINT_W)		\
990	$(PORTREGEX)		\
991	$(PORTSTDIO)		\
992	$(PORTSTDIO64)		\
993	$(PORTSTDIO_W)		\
994	$(PORTSYS)		\
995	$(PORTSYS64)		\
996	$(AIOOBJS)		\
997	$(RTOBJS)		\
998	$(SECFLAGSOBJS)		\
999	$(TPOOLOBJS)		\
1000	$(THREADSOBJS)		\
1001	$(THREADSMACHOBJS)	\
1002	$(THREADSASMOBJS)	\
1003	$(UNICODEOBJS)		\
1004	$(UNWINDMACHOBJS)	\
1005	$(UNWINDASMOBJS)	\
1006	$(COMSYSOBJS)		\
1007	$(SYSOBJS)		\
1008	$(COMSYSOBJS64)		\
1009	$(SYSOBJS64)		\
1010	$(VALUES)
1011
1012TRACEOBJS=			\
1013	plockstat.o
1014
1015# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
1016# modules whose source is provided in the $(SRC)/lib/crt directory.
1017# This must be done because otherwise the Sun C compiler would insert
1018# its own versions of these modules and those versions contain code
1019# to call out to C++ initialization functions.  Such C++ initialization
1020# functions can call back into libc before thread initialization is
1021# complete and this leads to segmentation violations and other problems.
1022# Since libc contains no C++ code, linking with the minimal crti.o and
1023# crtn.o modules is safe and avoids the problems described above.
1024OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1025CRTSRCS= ../../crt/amd64
1026
1027# include common library definitions
1028include ../../Makefile.lib
1029include ../../Makefile.lib.64
1030
1031CFLAGS64 += $(CTF_FLAGS)
1032
1033# This is necessary to avoid problems with calling _ex_unwind().
1034# We probably don't want any inlining anyway.
1035CFLAGS64 += -xinline=
1036
1037CERRWARN += -_gcc=-Wno-parentheses
1038CERRWARN += -_gcc=-Wno-switch
1039CERRWARN += $(CNOWARN_UNINIT)
1040CERRWARN += -_gcc=-Wno-unused-value
1041CERRWARN += -_gcc=-Wno-unused-label
1042CERRWARN += -_gcc=-Wno-unused-variable
1043CERRWARN += -_gcc=-Wno-type-limits
1044CERRWARN += -_gcc=-Wno-char-subscripts
1045CERRWARN += -_gcc=-Wno-clobbered
1046CERRWARN += -_gcc=-Wno-unused-function
1047CERRWARN += -_gcc=-Wno-address
1048
1049$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
1050
1051# not linted
1052SMATCH=off
1053
1054# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1055# enables ASSERT() checking in the threads portion of the library.
1056# This is automatically enabled for DEBUG builds, not for non-debug builds.
1057THREAD_DEBUG =
1058$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1059
1060# Make string literals read-only to save memory
1061CFLAGS64 += $(XSTRCONST)
1062
1063ALTPICS= $(TRACEOBJS:%=pics/%)
1064
1065$(DYNLIB) := BUILD.SO = $(LD) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1066
1067MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1068
1069CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
1070		-I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1071ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
1072		$(amd64_AS_XARCH)
1073
1074# As a favor to the dtrace syscall provider, libc still calls the
1075# old syscall traps that have been obsoleted by the *at() interfaces.
1076# Delete this to compile libc using only the new *at() system call traps
1077CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1078
1079# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
1080pics/proc64_id.o	:= CFLAGS64 += -I$(SRC)/uts/intel
1081
1082# Inform the run-time linker about libc specialized initialization
1083RTLDINFO =	-z rtldinfo=tls_rtldinfo
1084DYNFLAGS +=	$(RTLDINFO)
1085
1086# Force libc's internal references to be resolved immediately upon loading
1087# in order to avoid critical region problems.  Since almost all libc symbols
1088# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1089DYNFLAGS +=	-znow
1090
1091BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1092
1093# Override this top level flag so the compiler builds in its native
1094# C99 mode.  This has been enabled to support the complex arithmetic
1095# added to libc.
1096CSTD=	$(CSTD_GNU99)
1097
1098# libc method of building an archive
1099# The "$(GREP) -v ' L '" part is necessary only until
1100# lorder is fixed to ignore thread-local variables.
1101BUILD.AR= $(RM) $@ ; \
1102	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1103
1104# extra files for the clean target
1105CLEANFILES +=			\
1106	$(LIBCDIR)/port/gen/errlst.c	\
1107	$(LIBCDIR)/port/gen/new_list.c	\
1108	assym.h			\
1109	genassym		\
1110	crt/_rtld.s		\
1111	pics/crti.o		\
1112	pics/crtn.o		\
1113	$(ALTPICS)
1114
1115CLOBBERFILES +=	$(LIB_PIC)
1116
1117# conditional assignments
1118# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1119$(DYNLIB) := CRTI = crti.o
1120$(DYNLIB) := CRTN = crtn.o
1121
1122# Files which need the threads .il inline template
1123TIL=				\
1124	aio.o			\
1125	alloc.o			\
1126	assfail.o		\
1127	atexit.o		\
1128	atfork.o		\
1129	cancel.o		\
1130	door_calls.o		\
1131	err.o			\
1132	errno.o			\
1133	lwp.o			\
1134	ma.o			\
1135	machdep.o		\
1136	posix_aio.o		\
1137	pthr_attr.o		\
1138	pthr_barrier.o		\
1139	pthr_cond.o		\
1140	pthr_mutex.o		\
1141	pthr_rwlock.o		\
1142	pthread.o		\
1143	rand.o			\
1144	rwlock.o		\
1145	scalls.o		\
1146	sched.o			\
1147	sema.o			\
1148	sigaction.o		\
1149	sigev_thread.o		\
1150	spawn.o			\
1151	stack.o			\
1152	synch.o			\
1153	tdb_agent.o		\
1154	thr.o			\
1155	thread_interface.o	\
1156	thread_pool.o		\
1157	thrp_unwind.o		\
1158	tls.o			\
1159	tmem.o			\
1160	tsd.o
1161
1162$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1163
1164# pics/mul64.o := CFLAGS64 += crt/mul64.il
1165
1166# large-file-aware components that should be built large
1167
1168#$(COMSYSOBJS64:%=pics/%) := \
1169#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1170
1171#$(SYSOBJS64:%=pics/%) := \
1172#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1173
1174#$(PORTGEN64:%=pics/%) := \
1175#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1176
1177#$(PORTSTDIO64:%=pics/%) := \
1178#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1179
1180#$(PORTSYS64:%=pics/%) := \
1181#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1182
1183$(PORTSTDIO_W:%=pics/%) := \
1184	CPPFLAGS += -D_WIDE
1185
1186$(PORTPRINT_W:%=pics/%) := \
1187	CPPFLAGS += -D_WIDE
1188
1189$(PORTPRINT_C89:%=pics/%) := \
1190	CPPFLAGS += -D_C89_INTMAX32
1191
1192$(PORTSTDIO_C89:%=pics/%) := \
1193	CPPFLAGS += -D_C89_INTMAX32
1194
1195$(PORTI18N_COND:%=pics/%) := \
1196	CPPFLAGS += -D_WCS_LONGLONG
1197
1198pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1199
1200pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1201pics/gettimeofday.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1202
1203.KEEP_STATE:
1204
1205all: $(LIBS) $(LIB_PIC)
1206
1207# object files that depend on inline template
1208$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1209# pics/mul64.o: crt/mul64.il
1210
1211# include common libc targets
1212include ../Makefile.targ
1213
1214# We need to strip out all CTF data from the static library
1215$(LIB_PIC) := DIR = pics
1216$(LIB_PIC): pics $$(PICS)
1217	$(BUILD.AR)
1218	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1219	$(AR) -ts $@ > /dev/null
1220	$(POST_PROCESS_A)
1221
1222ASSYMDEP_OBJS=			\
1223	_lwp_mutex_unlock.o	\
1224	_stack_grow.o		\
1225	asm_subr.o		\
1226	getcontext.o		\
1227	setjmp.o		\
1228	tls_get_addr.o		\
1229	vforkx.o
1230
1231$(ASSYMDEP_OBJS:%=pics/%): assym.h
1232
1233# assym.h build rules
1234
1235GENASSYM_C = genassym.c
1236LDFLAGS.native = $(LDASSERTS) $(ZASSERTDEFLIB)=libc.so $(BDIRECT)
1237
1238genassym: $(GENASSYM_C)
1239	$(NATIVECC) $(NATIVE_CFLAGS) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.native) \
1240		$(LDFLAGS.native) -o $@ $(GENASSYM_C)
1241
1242OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1243
1244assym.h: $(OFFSETS) genassym
1245	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1246	./genassym >>$@
1247
1248# derived C source and related explicit dependencies
1249$(LIBCDIR)/port/gen/errlst.c + \
1250$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1251	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1252
1253pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1254
1255pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1256