xref: /illumos-gate/usr/src/lib/libc/amd64/Makefile (revision b3263c9871d056ea54cca24eaeedd5a41fd333de)
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	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
889# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
890# This macro should ALWAYS be empty; native APIs are already 'large file'.
891PORTSYS64=
892
893PORTSYS=			\
894	_autofssys.o		\
895	access.o		\
896	acctctl.o		\
897	bsd_signal.o		\
898	chmod.o			\
899	chown.o			\
900	corectl.o		\
901	epoll.o			\
902	exacctsys.o		\
903	execl.o			\
904	execle.o		\
905	execv.o			\
906	eventfd.o		\
907	fcntl.o			\
908	getpagesizes.o		\
909	getpeerucred.o		\
910	inst_sync.o		\
911	issetugid.o		\
912	label.o			\
913	link.o			\
914	lockf.o			\
915	lwp.o			\
916	lwp_cond.o		\
917	lwp_rwlock.o		\
918	lwp_sigmask.o		\
919	meminfosys.o		\
920	mkdir.o			\
921	mknod.o			\
922	msgsys.o		\
923	nfssys.o		\
924	open.o			\
925	pgrpsys.o		\
926	posix_sigwait.o		\
927	ppriv.o			\
928	psetsys.o		\
929	rctlsys.o		\
930	readlink.o		\
931	rename.o		\
932	sbrk.o			\
933	semsys.o		\
934	set_errno.o		\
935	sharefs.o		\
936	shmsys.o		\
937	sidsys.o		\
938	siginterrupt.o		\
939	signal.o		\
940	signalfd.o		\
941	sigpending.o		\
942	sigstack.o		\
943	stat.o			\
944	symlink.o		\
945	tasksys.o		\
946	time.o			\
947	time_util.o		\
948	timerfd.o		\
949	ucontext.o		\
950	unlink.o		\
951	ustat.o			\
952	utimesys.o		\
953	zone.o
954
955PORTREGEX=			\
956	glob.o			\
957	regcmp.o		\
958	regcomp.o		\
959	regerror.o		\
960	regex.o			\
961	regexec.o		\
962	regfree.o		\
963	wordexp.o
964
965VALUES=				\
966	values-Xa.o
967
968MOSTOBJS=			\
969	$(STRETS)		\
970	$(CRTOBJS)		\
971	$(DYNOBJS)		\
972	$(FPOBJS)		\
973	$(I386FPOBJS)		\
974	$(FPASMOBJS)		\
975	$(ATOMICOBJS)		\
976	$(CHACHAOBJS)		\
977	$(XATTROBJS)		\
978	$(COMOBJS)		\
979	$(GENOBJS)		\
980	$(PORTFP)		\
981	$(PORTGEN)		\
982	$(PORTGEN64)		\
983	$(PORTI18N)		\
984	$(PORTI18N_COND)	\
985	$(PORTINET)		\
986	$(PORTLOCALE)		\
987	$(PORTPRINT)		\
988	$(PORTPRINT_W)		\
989	$(PORTREGEX)		\
990	$(PORTSTDIO)		\
991	$(PORTSTDIO64)		\
992	$(PORTSTDIO_W)		\
993	$(PORTSYS)		\
994	$(PORTSYS64)		\
995	$(AIOOBJS)		\
996	$(RTOBJS)		\
997	$(SECFLAGSOBJS)		\
998	$(TPOOLOBJS)		\
999	$(THREADSOBJS)		\
1000	$(THREADSMACHOBJS)	\
1001	$(THREADSASMOBJS)	\
1002	$(UNICODEOBJS)		\
1003	$(UNWINDMACHOBJS)	\
1004	$(UNWINDASMOBJS)	\
1005	$(COMSYSOBJS)		\
1006	$(SYSOBJS)		\
1007	$(COMSYSOBJS64)		\
1008	$(SYSOBJS64)		\
1009	$(VALUES)
1010
1011TRACEOBJS=			\
1012	plockstat.o
1013
1014# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
1015# modules whose source is provided in the $(SRC)/lib/crt directory.
1016# This must be done because otherwise the Sun C compiler would insert
1017# its own versions of these modules and those versions contain code
1018# to call out to C++ initialization functions.  Such C++ initialization
1019# functions can call back into libc before thread initialization is
1020# complete and this leads to segmentation violations and other problems.
1021# Since libc contains no C++ code, linking with the minimal crti.o and
1022# crtn.o modules is safe and avoids the problems described above.
1023OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1024CRTSRCS= ../../crt/amd64
1025
1026# include common library definitions
1027include ../../Makefile.lib
1028include ../../Makefile.lib.64
1029
1030CFLAGS64 += $(CTF_FLAGS)
1031
1032# This is necessary to avoid problems with calling _ex_unwind().
1033# We probably don't want any inlining anyway.
1034CFLAGS64 += -xinline=
1035
1036CERRWARN += -_gcc=-Wno-parentheses
1037CERRWARN += -_gcc=-Wno-switch
1038CERRWARN += $(CNOWARN_UNINIT)
1039CERRWARN += -_gcc=-Wno-unused-value
1040CERRWARN += -_gcc=-Wno-unused-label
1041CERRWARN += -_gcc=-Wno-unused-variable
1042CERRWARN += -_gcc=-Wno-type-limits
1043CERRWARN += -_gcc=-Wno-char-subscripts
1044CERRWARN += -_gcc=-Wno-clobbered
1045CERRWARN += -_gcc=-Wno-unused-function
1046CERRWARN += -_gcc=-Wno-address
1047
1048$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
1049
1050# not linted
1051SMATCH=off
1052
1053# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1054# enables ASSERT() checking in the threads portion of the library.
1055# This is automatically enabled for DEBUG builds, not for non-debug builds.
1056THREAD_DEBUG =
1057$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1058
1059# Make string literals read-only to save memory
1060CFLAGS64 += $(XSTRCONST)
1061
1062ALTPICS= $(TRACEOBJS:%=pics/%)
1063
1064$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1065
1066MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1067
1068CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
1069		-I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1070ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
1071		$(amd64_AS_XARCH)
1072
1073# As a favor to the dtrace syscall provider, libc still calls the
1074# old syscall traps that have been obsoleted by the *at() interfaces.
1075# Delete this to compile libc using only the new *at() system call traps
1076CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1077
1078# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
1079pics/proc64_id.o	:= CFLAGS64 += -I$(SRC)/uts/intel
1080
1081# Inform the run-time linker about libc specialized initialization
1082RTLDINFO =	-z rtldinfo=tls_rtldinfo
1083DYNFLAGS +=	$(RTLDINFO)
1084
1085# Force libc's internal references to be resolved immediately upon loading
1086# in order to avoid critical region problems.  Since almost all libc symbols
1087# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1088DYNFLAGS +=	-znow
1089
1090BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1091
1092# Override this top level flag so the compiler builds in its native
1093# C99 mode.  This has been enabled to support the complex arithmetic
1094# added to libc.
1095CSTD=	$(CSTD_GNU99)
1096
1097# libc method of building an archive
1098# The "$(GREP) -v ' L '" part is necessary only until
1099# lorder is fixed to ignore thread-local variables.
1100BUILD.AR= $(RM) $@ ; \
1101	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1102
1103# extra files for the clean target
1104CLEANFILES +=			\
1105	$(LIBCDIR)/port/gen/errlst.c	\
1106	$(LIBCDIR)/port/gen/new_list.c	\
1107	assym.h			\
1108	genassym		\
1109	crt/_rtld.s		\
1110	pics/crti.o		\
1111	pics/crtn.o		\
1112	$(ALTPICS)
1113
1114CLOBBERFILES +=	$(LIB_PIC)
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)
1200pics/gettimeofday.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1201
1202.KEEP_STATE:
1203
1204all: $(LIBS) $(LIB_PIC)
1205
1206# object files that depend on inline template
1207$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1208# pics/mul64.o: crt/mul64.il
1209
1210# include common libc targets
1211include ../Makefile.targ
1212
1213# We need to strip out all CTF data from the static library
1214$(LIB_PIC) := DIR = pics
1215$(LIB_PIC): pics $$(PICS)
1216	$(BUILD.AR)
1217	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1218	$(AR) -ts $@ > /dev/null
1219	$(POST_PROCESS_A)
1220
1221ASSYMDEP_OBJS=			\
1222	_lwp_mutex_unlock.o	\
1223	_stack_grow.o		\
1224	asm_subr.o		\
1225	getcontext.o		\
1226	setjmp.o		\
1227	tls_get_addr.o		\
1228	vforkx.o
1229
1230$(ASSYMDEP_OBJS:%=pics/%): assym.h
1231
1232# assym.h build rules
1233
1234GENASSYM_C = genassym.c
1235LDFLAGS.native = $(LDASSERTS) $(ZASSERTDEFLIB)=libc.so $(BDIRECT)
1236
1237genassym: $(GENASSYM_C)
1238	$(NATIVECC) $(NATIVE_CFLAGS) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.native) \
1239		$(LDFLAGS.native) -o $@ $(GENASSYM_C)
1240
1241OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1242
1243assym.h: $(OFFSETS) genassym
1244	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1245	./genassym >>$@
1246
1247# derived C source and related explicit dependencies
1248$(LIBCDIR)/port/gen/errlst.c + \
1249$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1250	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1251
1252pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1253
1254pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1255