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