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