]> granicus.if.org Git - zfs/commitdiff
Add gcc-init-pragmas branch
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 21 Nov 2008 18:39:47 +0000 (10:39 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 21 Nov 2008 18:39:47 +0000 (10:39 -0800)
.topdeps [new file with mode: 0644]
.topmsg [new file with mode: 0644]
zfs/lib/libuutil/uu_misc.c
zfs/lib/libzfs/libzfs_mount.c

diff --git a/.topdeps b/.topdeps
new file mode 100644 (file)
index 0000000..1f7391f
--- /dev/null
+++ b/.topdeps
@@ -0,0 +1 @@
+master
diff --git a/.topmsg b/.topmsg
new file mode 100644 (file)
index 0000000..704245f
--- /dev/null
+++ b/.topmsg
@@ -0,0 +1,9 @@
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Subject: [PATCH] gcc-init-pragmas
+
+Use constructor attribute on non-Solaris platforms.
+
+The #pragma init/fini ->__attribute__((constructor/destructor))
+conversions, these should go upstream.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
index 0ead166e70e58c068a7e5ca143872a5b93b620a3..14110312342d4bcb2ebab833de958be75f5ac332 100644 (file)
@@ -247,7 +247,13 @@ uu_release_child(void)
        uu_release();
 }
 
+#ifdef __GNUC__
+static void
+uu_init(void) __attribute__((constructor));
+#else
 #pragma init(uu_init)
+#endif
+
 static void
 uu_init(void)
 {
index 35a2cea7a7b536b4726bbaac01e9788d3761c804..f31a209e7e05f44ac2efcca1e9de04a04c496f3a 100644 (file)
@@ -128,7 +128,13 @@ zfs_share_proto_t share_all_proto[] = {
        PROTO_END
 };
 
+#ifdef __GNUC__
+static void
+zfs_iscsi_init(void) __attribute__((constructor));
+#else
 #pragma init(zfs_iscsi_init)
+#endif
+
 static void
 zfs_iscsi_init(void)
 {
@@ -548,8 +554,12 @@ static void (*_sa_update_sharetab_ts)(sa_handle_t);
  * values to be used later. This is triggered by the runtime loader.
  * Make sure the correct ISA version is loaded.
  */
-
+#ifdef __GNUC__
+static void
+_zfs_init_libshare(void) __attribute__((constructor));
+#else
 #pragma init(_zfs_init_libshare)
+#endif
 static void
 _zfs_init_libshare(void)
 {