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