svn commit: r193767 - in projects/clangbsd: cddl/lib/libzpool lib/librt sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Ed Schouten ed at FreeBSD.org
Mon Jun 8 21:47:56 UTC 2009


Author: ed
Date: Mon Jun  8 21:47:55 2009
New Revision: 193767
URL: http://svn.freebsd.org/changeset/base/193767

Log:
  Build librt and libzpool with Clang.
  
  Unfortunately #pragma weak isn't yet good enough to build libzpool, so
  change it slightly to use a construct that does work.

Modified:
  projects/clangbsd/cddl/lib/libzpool/Makefile
  projects/clangbsd/lib/librt/Makefile
  projects/clangbsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c

Modified: projects/clangbsd/cddl/lib/libzpool/Makefile
==============================================================================
--- projects/clangbsd/cddl/lib/libzpool/Makefile	Mon Jun  8 21:44:03 2009	(r193766)
+++ projects/clangbsd/cddl/lib/libzpool/Makefile	Mon Jun  8 21:47:55 2009	(r193767)
@@ -23,13 +23,6 @@ ATOMIC_SRCS=	opensolaris_atomic.c
 
 LIB=		zpool
 
-.include <bsd.own.mk>
-
-# XXX: LLVM PR3679
-.if ${MK_CLANG_IS_CC} != "no" && ${CC} == "cc"
-CC=		gcc
-.endif
-
 ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} vdev_file.c
 ZFS_SHARED_SRCS= ${ZFS_SHARED_OBJS:C/.o$/.c/}
 KERNEL_SRCS=	kernel.c taskq.c util.c

Modified: projects/clangbsd/lib/librt/Makefile
==============================================================================
--- projects/clangbsd/lib/librt/Makefile	Mon Jun  8 21:44:03 2009	(r193766)
+++ projects/clangbsd/lib/librt/Makefile	Mon Jun  8 21:47:55 2009	(r193767)
@@ -1,12 +1,5 @@
 # $FreeBSD$
 
-.include <bsd.own.mk>
-
-# XXX: LLVM PR3678
-.if ${MK_CLANG_IS_CC} != "no" && ${CC} == "cc"
-CC=	gcc
-.endif
-
 LIB=rt
 SHLIB_MAJOR= 1
 CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}

Modified: projects/clangbsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- projects/clangbsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Mon Jun  8 21:44:03 2009	(r193766)
+++ projects/clangbsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Mon Jun  8 21:47:55 2009	(r193767)
@@ -1232,7 +1232,6 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
 	return (0);
 }
 
-#pragma weak dmu_buf_will_dirty = dbuf_will_dirty
 void
 dbuf_will_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
 {
@@ -1246,6 +1245,7 @@ dbuf_will_dirty(dmu_buf_impl_t *db, dmu_
 	(void) dbuf_read(db, NULL, rf);
 	(void) dbuf_dirty(db, tx);
 }
+__weak_reference(dbuf_will_dirty, dmu_buf_will_dirty);
 
 void
 dmu_buf_will_fill(dmu_buf_t *db_fake, dmu_tx_t *tx)
@@ -1264,7 +1264,6 @@ dmu_buf_will_fill(dmu_buf_t *db_fake, dm
 	(void) dbuf_dirty(db, tx);
 }
 
-#pragma weak dmu_buf_fill_done = dbuf_fill_done
 /* ARGSUSED */
 void
 dbuf_fill_done(dmu_buf_impl_t *db, dmu_tx_t *tx)
@@ -1285,6 +1284,7 @@ dbuf_fill_done(dmu_buf_impl_t *db, dmu_t
 	}
 	mutex_exit(&db->db_mtx);
 }
+__weak_reference(dbuf_fill_done, dmu_buf_fill_done);
 
 /*
  * "Clear" the contents of this dbuf.  This will mark the dbuf
@@ -1707,15 +1707,14 @@ dbuf_create_bonus(dnode_t *dn)
 	dn->dn_bonus = dbuf_create(dn, 0, DB_BONUS_BLKID, dn->dn_dbuf, NULL);
 }
 
-#pragma weak dmu_buf_add_ref = dbuf_add_ref
 void
 dbuf_add_ref(dmu_buf_impl_t *db, void *tag)
 {
 	int64_t holds = refcount_add(&db->db_holds, tag);
 	ASSERT(holds > 1);
 }
+__weak_reference(dbuf_add_ref, dmu_buf_add_ref);
 
-#pragma weak dmu_buf_rele = dbuf_rele
 void
 dbuf_rele(dmu_buf_impl_t *db, void *tag)
 {
@@ -1768,13 +1767,14 @@ dbuf_rele(dmu_buf_impl_t *db, void *tag)
 		mutex_exit(&db->db_mtx);
 	}
 }
+__weak_reference(dbuf_rele, dmu_buf_rele);
 
-#pragma weak dmu_buf_refcount = dbuf_refcount
 uint64_t
 dbuf_refcount(dmu_buf_impl_t *db)
 {
 	return (refcount_count(&db->db_holds));
 }
+__weak_reference(dbuf_refcount, dmu_buf_refcount);
 
 void *
 dmu_buf_set_user(dmu_buf_t *db_fake, void *user_ptr, void *user_data_ptr_ptr,


More information about the svn-src-projects mailing list