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