Add gcc-init-pragmas branch

This commit is contained in:
Brian Behlendorf 2008-11-21 10:39:47 -08:00
parent 9fc325737b
commit 0b80af1f8e
4 changed files with 27 additions and 1 deletions

1
.topdeps Normal file
View File

@ -0,0 +1 @@
master

9
.topmsg Normal file
View File

@ -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>

View 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)
{

View 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)
{