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