xref: /illumos-gate/usr/src/lib/libc/amd64/Makefile (revision 6185db853e024a486ff8837e6784dd290d866112)
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
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
88COMOBJS=			\
89	bcmp.o			\
90	bcopy.o			\
91	bsearch.o		\
92	bzero.o			\
93	ffs.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	uucopy.o		\
282	vhangup.o		\
283	waitid.o		\
284	write.o			\
285	writev.o		\
286	yield.o
287
288SYSOBJS=			\
289	__clock_gettime.o	\
290	__getcontext.o		\
291	__uadmin.o		\
292	_lwp_mutex_unlock.o	\
293	_stack_grow.o		\
294	door.o			\
295	fork1.o			\
296	forkall.o		\
297	fxstat.o		\
298	getcontext.o		\
299	gettimeofday.o		\
300	lwp_private.o		\
301	lxstat.o		\
302	nuname.o		\
303	pipe.o			\
304	syscall.o		\
305	sysi86.o		\
306	tls_get_addr.o		\
307	uadmin.o		\
308	umount.o		\
309	uname.o			\
310	vfork.o			\
311	xmknod.o		\
312	xstat.o
313
314# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
315# This macro should ALWAYS be empty; native APIs are already 'large file'.
316PORTGEN64=
317
318# objects from source under ../port
319PORTFP=				\
320	__flt_decim.o		\
321	__flt_rounds.o		\
322	__tbl_10_b.o		\
323	__tbl_10_h.o		\
324	__tbl_10_s.o		\
325	__tbl_2_b.o		\
326	__tbl_2_h.o		\
327	__tbl_2_s.o		\
328	__tbl_fdq.o		\
329	__tbl_tens.o		\
330	__x_power.o		\
331	_base_sup.o		\
332	aconvert.o		\
333	decimal_bin.o		\
334	double_decim.o		\
335	econvert.o		\
336	fconvert.o		\
337	file_decim.o		\
338	finite.o		\
339	fp_data.o		\
340	func_decim.o		\
341	gconvert.o		\
342	hex_bin.o		\
343	ieee_globals.o		\
344	pack_float.o		\
345	sigfpe.o		\
346	string_decim.o
347
348PORTGEN=			\
349	_env_data.o		\
350	_xftw.o			\
351	a64l.o			\
352	abort.o			\
353	addsev.o		\
354	assert.o		\
355	atof.o			\
356	atoi.o			\
357	atol.o			\
358	atoll.o			\
359	attropen.o		\
360	atexit.o		\
361	atfork.o		\
362	basename.o		\
363	calloc.o		\
364	catgets.o		\
365	catopen.o		\
366	cfgetispeed.o		\
367	cfgetospeed.o		\
368	cfree.o			\
369	cfsetispeed.o		\
370	cfsetospeed.o		\
371	cftime.o		\
372	clock.o			\
373	closedir.o		\
374	closefrom.o		\
375	confstr.o		\
376	crypt.o			\
377	csetlen.o		\
378	ctime.o			\
379	ctime_r.o		\
380	deflt.o			\
381	directio.o		\
382	dirname.o		\
383	div.o			\
384	drand48.o		\
385	dup2.o			\
386	env_data.o		\
387	errno.o			\
388	euclen.o		\
389	event_port.o		\
390	execvp.o		\
391	fattach.o		\
392	fdetach.o		\
393	fdopendir.o		\
394	fmtmsg.o		\
395	ftime.o			\
396	ftok.o			\
397	ftw.o			\
398	gcvt.o			\
399	getauxv.o		\
400	getcwd.o		\
401	getdate_err.o		\
402	getdtblsize.o		\
403	getenv.o		\
404	getexecname.o		\
405	getgrnam.o		\
406	getgrnam_r.o		\
407	gethostid.o		\
408	gethostname.o		\
409	gethz.o			\
410	getisax.o		\
411	getloadavg.o		\
412	getlogin.o		\
413	getmntent.o		\
414	getnetgrent.o		\
415	getopt.o		\
416	getopt_long.o		\
417	getpagesize.o		\
418	getpw.o			\
419	getpwnam.o		\
420	getpwnam_r.o		\
421	getrusage.o		\
422	getspent.o		\
423	getspent_r.o		\
424	getsubopt.o		\
425	gettxt.o		\
426	getusershell.o		\
427	getut.o			\
428	getutx.o		\
429	getvfsent.o		\
430	getwd.o			\
431	getwidth.o		\
432	getxby_door.o		\
433	gtxt.o			\
434	hsearch.o		\
435	iconv.o			\
436	imaxabs.o		\
437	imaxdiv.o		\
438	index.o			\
439	initgroups.o		\
440	insque.o		\
441	isaexec.o		\
442	isastream.o		\
443	isatty.o		\
444	killpg.o		\
445	l64a.o			\
446	lckpwdf.o		\
447	lconstants.o		\
448	lfind.o			\
449	lfmt.o			\
450	lfmt_log.o		\
451	lldiv.o			\
452	lltostr.o		\
453	lmath.o			\
454	localtime.o		\
455	lsearch.o		\
456	madvise.o		\
457	malloc.o		\
458	memalign.o		\
459	mkdev.o			\
460	mkdtemp.o		\
461	mkfifo.o		\
462	mkstemp.o		\
463	mktemp.o		\
464	mlock.o			\
465	mlockall.o		\
466	mon.o			\
467	msync.o			\
468	munlock.o		\
469	munlockall.o		\
470	ndbm.o			\
471	nftw.o			\
472	nlspath_checks.o	\
473	nsparse.o		\
474	nss_common.o		\
475	nss_dbdefs.o		\
476	nss_deffinder.o		\
477	opendir.o		\
478	opt_data.o		\
479	perror.o		\
480	pfmt.o			\
481	pfmt_data.o		\
482	pfmt_print.o		\
483	plock.o			\
484	poll.o			\
485	priocntl.o		\
486	privlib.o		\
487	priv_str_xlate.o	\
488	psiginfo.o		\
489	psignal.o		\
490	pt.o			\
491	putpwent.o		\
492	putspent.o		\
493	raise.o			\
494	rand.o			\
495	random.o		\
496	rctlops.o		\
497	readdir.o		\
498	readdir_r.o		\
499	realpath.o		\
500	reboot.o		\
501	regexpr.o		\
502	rename.o		\
503	rewinddir.o		\
504	rindex.o		\
505	scandir.o		\
506	seekdir.o		\
507	select.o		\
508	select_large_fdset.o	\
509	setlabel.o		\
510	setpriority.o		\
511	settimeofday.o		\
512	sh_locks.o		\
513	sigflag.o		\
514	siglist.o		\
515	sigsend.o		\
516	sigsetops.o		\
517	ssignal.o		\
518	stack.o			\
519	str2sig.o		\
520	strcase_charmap.o	\
521	strcasecmp.o		\
522	strcat.o		\
523	strchr.o		\
524	strcspn.o		\
525	strdup.o		\
526	strerror.o		\
527	strlcat.o		\
528	strlcpy.o		\
529	strncasecmp.o		\
530	strncat.o		\
531	strpbrk.o		\
532	strrchr.o		\
533	strsignal.o		\
534	strspn.o		\
535	strstr.o		\
536	strtod.o		\
537	strtoimax.o		\
538	strtok.o		\
539	strtok_r.o		\
540	strtoll.o		\
541	strtoull.o		\
542	strtoumax.o		\
543	swab.o			\
544	swapctl.o		\
545	sysconf.o		\
546	syslog.o		\
547	tcdrain.o		\
548	tcflow.o		\
549	tcflush.o		\
550	tcgetattr.o		\
551	tcgetpgrp.o		\
552	tcgetsid.o		\
553	tcsendbreak.o		\
554	tcsetattr.o		\
555	tcsetpgrp.o		\
556	tell.o			\
557	telldir.o		\
558	tfind.o			\
559	time_data.o		\
560	time_gdata.o		\
561	truncate.o		\
562	tsdalloc.o		\
563	tsearch.o		\
564	ttyname.o		\
565	ttyslot.o		\
566	ualarm.o		\
567	ucred.o			\
568	valloc.o		\
569	vlfmt.o			\
570	vpfmt.o			\
571	wait3.o			\
572	wait4.o			\
573	waitpid.o		\
574	walkstack.o		\
575	wdata.o			\
576	xgetwidth.o		\
577	xpg4.o			\
578	xpg6.o
579
580PORTPRINT_W=			\
581	doprnt_w.o
582
583PORTPRINT=			\
584	doprnt.o		\
585	fprintf.o		\
586	printf.o		\
587	snprintf.o		\
588	sprintf.o		\
589	vfprintf.o		\
590	vprintf.o		\
591	vsnprintf.o		\
592	vsprintf.o		\
593	vwprintf.o		\
594	wprintf.o
595
596# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
597# This macro should ALWAYS be empty; native APIs are already 'large file'.
598PORTSTDIO64=
599
600PORTSTDIO_W=			\
601	doscan_w.o
602
603PORTSTDIO=			\
604	__extensions.o		\
605	_endopen.o		\
606	_filbuf.o		\
607	_findbuf.o		\
608	_flsbuf.o		\
609	_wrtchk.o		\
610	clearerr.o		\
611	ctermid.o		\
612	ctermid_r.o		\
613	cuserid.o		\
614	data.o			\
615	doscan.o		\
616	fdopen.o		\
617	feof.o			\
618	ferror.o		\
619	fgetc.o			\
620	fgets.o			\
621	fileno.o		\
622	flockf.o		\
623	flush.o			\
624	fopen.o			\
625	fpos.o			\
626	fputc.o			\
627	fputs.o			\
628	fread.o			\
629	fseek.o			\
630	fseeko.o		\
631	ftell.o			\
632	ftello.o		\
633	fwrite.o		\
634	getc.o			\
635	getchar.o		\
636	getpass.o		\
637	gets.o			\
638	getw.o			\
639	mse.o			\
640	popen.o			\
641	putc.o			\
642	putchar.o		\
643	puts.o			\
644	putw.o			\
645	rewind.o		\
646	scanf.o			\
647	setbuf.o		\
648	setbuffer.o		\
649	setvbuf.o		\
650	system.o		\
651	tempnam.o		\
652	tmpfile.o		\
653	tmpnam_r.o		\
654	ungetc.o		\
655	vscanf.o		\
656	vwscanf.o		\
657	wscanf.o
658
659PORTI18N=			\
660	__fgetwc_xpg5.o		\
661	__fgetws_xpg5.o		\
662	__fputwc_xpg5.o		\
663	__fputws_xpg5.o		\
664	__ungetwc_xpg5.o	\
665	getwchar.o		\
666	putwchar.o		\
667	putws.o			\
668	strtows.o		\
669	wcsstr.o		\
670	wcstoimax.o		\
671	wcstol.o		\
672	wcstoul.o		\
673	wcswcs.o		\
674	wmemchr.o		\
675	wmemcmp.o		\
676	wmemcpy.o		\
677	wmemmove.o		\
678	wmemset.o		\
679	wscasecmp.o		\
680	wscat.o			\
681	wschr.o			\
682	wscmp.o			\
683	wscpy.o			\
684	wscspn.o		\
685	wsdup.o			\
686	wslen.o			\
687	wsncasecmp.o		\
688	wsncat.o		\
689	wsncmp.o		\
690	wsncpy.o		\
691	wspbrk.o		\
692	wsprintf.o		\
693	wsrchr.o		\
694	wsscanf.o		\
695	wsspn.o			\
696	wstod.o			\
697	wstok.o			\
698	wstol.o			\
699	wstoll.o		\
700	wsxfrm.o		\
701	gettext.o		\
702	gettext_gnu.o		\
703	gettext_real.o		\
704	gettext_util.o		\
705	plural_parser.o		\
706	wdresolve.o		\
707	_ctype.o		\
708	isascii.o		\
709	toascii.o
710
711PORTI18N_COND=			\
712	wcstol_longlong.o	\
713	wcstoul_longlong.o
714
715AIOOBJS=			\
716	aio.o			\
717	aio_alloc.o		\
718	posix_aio.o
719
720RTOBJS=				\
721	clock_timer.o		\
722	fallocate.o		\
723	mqueue.o		\
724	pos4obj.o		\
725	sched.o			\
726	sem.o			\
727	shm.o			\
728	sigev_thread.o
729
730TPOOLOBJS=			\
731	thread_pool.o
732
733THREADSOBJS=			\
734	alloc.o			\
735	assfail.o		\
736	cancel.o		\
737	door_calls.o		\
738	pthr_attr.o		\
739	pthr_barrier.o		\
740	pthr_cond.o		\
741	pthr_mutex.o		\
742	pthr_rwlock.o		\
743	pthread.o		\
744	rtsched.o		\
745	rwlock.o		\
746	scalls.o		\
747	sema.o			\
748	sigaction.o		\
749	spawn.o			\
750	synch.o			\
751	tdb_agent.o		\
752	thr.o			\
753	thread_interface.o	\
754	tls.o			\
755	tsd.o
756
757THREADSMACHOBJS=		\
758	machdep.o
759
760THREADSASMOBJS=			\
761	asm_subr.o
762
763UNWINDMACHOBJS=			\
764	call_frame_inst.o	\
765	eh_frame.o		\
766	thrp_unwind.o		\
767	unwind.o
768
769pics/unwind.o:= COPTFLAG64 =
770
771UNWINDASMOBJS=			\
772	unwind_frame.o
773
774# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
775# This macro should ALWAYS be empty; native APIs are already 'large file'.
776PORTSYS64=
777
778PORTSYS=			\
779	_autofssys.o		\
780	acctctl.o		\
781	bsd_signal.o		\
782	corectl.o		\
783	exacctsys.o		\
784	execl.o			\
785	execle.o		\
786	execv.o			\
787	fcntl.o			\
788	fsmisc.o		\
789	fstatat.o		\
790	fsync.o			\
791	getpeerucred.o		\
792	inst_sync.o		\
793	issetugid.o		\
794	label.o			\
795	libc_link.o		\
796	libc_open.o		\
797	lockf.o			\
798	lwp.o			\
799	lwp_cond.o		\
800	lwp_rwlock.o		\
801	lwp_sigmask.o		\
802	meminfosys.o		\
803	msgsys.o		\
804	nfssys.o		\
805	openat.o		\
806	pgrpsys.o		\
807	posix_sigwait.o		\
808	ppriv.o			\
809	psetsys.o		\
810	rctlsys.o		\
811	sbrk.o			\
812	semsys.o		\
813	set_errno.o		\
814	shmsys.o		\
815	siginterrupt.o		\
816	signal.o		\
817	sigpending.o		\
818	sigstack.o		\
819	tasksys.o		\
820	time.o			\
821	time_util.o		\
822	ucontext.o		\
823	ustat.o			\
824	zone.o
825
826PORTREGEX=			\
827	glob.o			\
828	regcmp.o		\
829	regex.o			\
830	wordexp.o
831
832VALUES=				\
833	values-Xa.o
834
835MOSTOBJS=			\
836	$(STRETS)		\
837	$(CRTOBJS)		\
838	$(DYNOBJS)		\
839	$(FPOBJS)		\
840	$(I386FPOBJS)		\
841	$(FPASMOBJS)		\
842	$(ATOMICOBJS)		\
843	$(COMOBJS)		\
844	$(GENOBJS)		\
845	$(PORTFP)		\
846	$(PORTGEN)		\
847	$(PORTGEN64)		\
848	$(PORTI18N)		\
849	$(PORTI18N_COND)	\
850	$(PORTPRINT)		\
851	$(PORTPRINT_W)		\
852	$(PORTREGEX)		\
853	$(PORTSTDIO)		\
854	$(PORTSTDIO64)		\
855	$(PORTSTDIO_W)		\
856	$(PORTSYS)		\
857	$(PORTSYS64)		\
858	$(AIOOBJS)		\
859	$(RTOBJS)		\
860	$(TPOOLOBJS)		\
861	$(THREADSOBJS)		\
862	$(THREADSMACHOBJS)	\
863	$(THREADSASMOBJS)	\
864	$(UNWINDMACHOBJS)	\
865	$(UNWINDASMOBJS)	\
866	$(COMSYSOBJS)		\
867	$(SYSOBJS)		\
868	$(COMSYSOBJS64)		\
869	$(SYSOBJS64)		\
870	$(VALUES)
871
872TRACEOBJS=			\
873	plockstat.o
874
875# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
876# modules whose source is provided in the $(SRC)/lib/common directory.
877# This must be done because otherwise the Sun C compiler would insert
878# its own versions of these modules and those versions contain code
879# to call out to C++ initialization functions.  Such C++ initialization
880# functions can call back into libc before thread initialization is
881# complete and this leads to segmentation violations and other problems.
882# Since libc contains no C++ code, linking with the minimal crti.o and
883# crtn.o modules is safe and avoids the problems described above.
884OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
885CRTSRCS= ../../common/amd64
886
887# include common library definitions
888include ../../Makefile.lib
889include ../../Makefile.lib.64
890
891# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
892# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
893# need to be compatible with the ones for the libc stuff.  Whenever the changes
894# that affect the compilation conditions of libc happened, those for libc_i18n
895# also need to be updated.
896
897CFLAGS64 += $(CTF_FLAGS)
898
899# This is necessary to avoid problems with calling _ex_unwind().
900# We probably don't want any inlining anyway.
901CFLAGS64 += -xinline=
902
903# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
904# enables ASSERT() checking in the threads portion of the library.
905# This is automatically enabled for DEBUG builds, not for non-debug builds.
906THREAD_DEBUG =
907$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
908
909CFLAGS64 += $(THREAD_DEBUG)
910
911ALTPICS= $(TRACEOBJS:%=pics/%)
912
913$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
914$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
915
916MAPFILES =	../port/mapfile-vers mapfile-vers
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
925DYNFLAGS +=	$(RTLDINFO)
926
927BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
928
929# Override this top level flag so the compiler builds in its native
930# C99 mode.  This has been enabled to support the complex arithmetic
931# added to libc.
932C99MODE=	$(C99_ENABLE)
933
934# libc method of building an archive
935BUILD.AR= $(RM) $@ ; \
936	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
937
938# extra files for the clean target
939CLEANFILES=			\
940	../port/gen/errlst.c	\
941	../port/gen/new_list.c	\
942	assym.h			\
943	genassym		\
944	crt/_rtld.s		\
945	pics/crti.o		\
946	pics/crtn.o		\
947	$(ALTPICS)
948
949CLOBBERFILES +=	$(LIB_PIC)
950
951# list of C source for lint
952SRCS=							\
953	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
954	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
955	$(PORTFP:%.o=../port/fp/%.c)			\
956	$(PORTGEN:%.o=../port/gen/%.c)			\
957	$(PORTI18N:%.o=../port/i18n/%.c)		\
958	$(PORTPRINT:%.o=../port/print/%.c)		\
959	$(PORTREGEX:%.o=../port/regex/%.c)		\
960	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
961	$(PORTSYS:%.o=../port/sys/%.c)			\
962	$(AIOOBJS:%.o=../port/aio/%.c)			\
963	$(RTOBJS:%.o=../port/rt/%.c)			\
964	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
965	$(THREADSOBJS:%.o=../port/threads/%.c)		\
966	$(THREADSMACHOBJS:%.o=threads/%.c)		\
967	$(UNWINDMACHOBJS:%.o=unwind/%.c)		\
968	$(FPOBJS:%.o=fp/%.c)				\
969	$(I386FPOBJS:%.o=../i386/fp/%.c)		\
970	$(LIBCBASE)/gen/ecvt.c				\
971	$(LIBCBASE)/gen/lexp10.c			\
972	$(LIBCBASE)/gen/llog10.c			\
973	$(LIBCBASE)/gen/ltostr.c			\
974	$(LIBCBASE)/gen/makectxt.c			\
975	$(LIBCBASE)/gen/siginfolst.c			\
976	$(LIBCBASE)/gen/siglongjmp.c			\
977	$(LIBCBASE)/gen/sync_instruction_memory.c	\
978	$(LIBCBASE)/sys/uadmin.c
979
980# conditional assignments
981# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
982$(DYNLIB) := CRTI = crti.o
983$(DYNLIB) := CRTN = crtn.o
984
985# Files which need the threads .il inline template
986TIL=				\
987	aio.o			\
988	alloc.o			\
989	assfail.o		\
990	atexit.o		\
991	atfork.o		\
992	cancel.o		\
993	door_calls.o		\
994	errno.o			\
995	lwp.o			\
996	ma.o			\
997	machdep.o		\
998	posix_aio.o		\
999	pthr_attr.o		\
1000	pthr_barrier.o		\
1001	pthr_cond.o		\
1002	pthr_mutex.o		\
1003	pthr_rwlock.o		\
1004	pthread.o		\
1005	rand.o			\
1006	rtsched.o		\
1007	rwlock.o		\
1008	scalls.o		\
1009	sema.o			\
1010	sigaction.o		\
1011	sigev_thread.o		\
1012	spawn.o			\
1013	stack.o			\
1014	synch.o			\
1015	tdb_agent.o		\
1016	thr.o			\
1017	thread_interface.o	\
1018	thread_pool.o		\
1019	thrp_unwind.o		\
1020	tls.o			\
1021	tsd.o
1022
1023$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1024
1025# pics/mul64.o := CFLAGS64 += crt/mul64.il
1026
1027# large-file-aware components that should be built large
1028
1029#$(COMSYSOBJS64:%=pics/%) := \
1030#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1031
1032#$(SYSOBJS64:%=pics/%) := \
1033#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1034
1035#$(PORTGEN64:%=pics/%) := \
1036#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1037
1038#$(PORTSTDIO64:%=pics/%) := \
1039#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1040
1041#$(PORTSYS64:%=pics/%) := \
1042#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1043
1044$(PORTSTDIO_W:%=pics/%) := \
1045	CPPFLAGS += -D_WIDE
1046
1047$(PORTPRINT_W:%=pics/%) := \
1048	CPPFLAGS += -D_WIDE
1049
1050$(PORTPRINT_C89:%=pics/%) := \
1051	CPPFLAGS += -D_C89_INTMAX32
1052
1053$(PORTSTDIO_C89:%=pics/%) := \
1054	CPPFLAGS += -D_C89_INTMAX32
1055
1056$(PORTI18N_COND:%=pics/%) := \
1057	CPPFLAGS += -D_WCS_LONGLONG
1058
1059.KEEP_STATE:
1060
1061all: $(LIBS) $(LIB_PIC)
1062
1063lint	:=	CPPFLAGS += -I../$(MACH)/fp
1064lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1065lint	:=	LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1066
1067lint:
1068	@echo $(LINT.c) ... $(LDLIBS)
1069	@$(LINT.c) $(SRCS) $(LDLIBS)
1070
1071$(LINTLIB):= SRCS=../port/llib-lc
1072$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1073$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=amd64
1074
1075# object files that depend on inline template
1076$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1077# pics/mul64.o: crt/mul64.il
1078
1079# include common libc targets
1080include ../Makefile.targ
1081
1082# We need to strip out all CTF data from the static library
1083$(LIB_PIC) := DIR = pics
1084$(LIB_PIC): pics $$(PICS)
1085	$(BUILD.AR)
1086	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1087	$(AR) -ts $@ > /dev/null
1088	$(POST_PROCESS_A)
1089
1090ASSYMDEP_OBJS=			\
1091	_lwp_mutex_unlock.o	\
1092	_stack_grow.o		\
1093	asm_subr.o		\
1094	getcontext.o		\
1095	tls_get_addr.o		\
1096	vfork.o
1097
1098$(ASSYMDEP_OBJS:%=pics/%): assym.h
1099
1100# assym.h build rules
1101
1102GENASSYM_C = genassym.c
1103
1104# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1105#	live in Makefile.master
1106
1107CPPFLAGS.genassym = \
1108	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1109
1110genassym: $(GENASSYM_C)
1111	$(NATIVECC) -Iinc -I../inc $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1112
1113OFFSETS = ../$(MACH)/offsets.in
1114
1115assym.h: $(OFFSETS) genassym
1116	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1117	./genassym >>$@
1118
1119# derived C source and related explicit dependencies
1120../port/gen/errlst.c + \
1121../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1122	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1123
1124pics/errlst.o: ../port/gen/errlst.c
1125
1126pics/new_list.o: ../port/gen/new_list.c
1127