diff --git a/zfs/lib/libuutil/uu_misc.c b/zfs/lib/libuutil/uu_misc.c index 071eabfa44..764b343899 100644 --- a/zfs/lib/libuutil/uu_misc.c +++ b/zfs/lib/libuutil/uu_misc.c @@ -251,7 +251,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) { diff --git a/zfs/lib/libzfs/libzfs_mount.c b/zfs/lib/libzfs/libzfs_mount.c index 7c5c7f3eca..d570293739 100644 --- a/zfs/lib/libzfs/libzfs_mount.c +++ b/zfs/lib/libzfs/libzfs_mount.c @@ -126,7 +126,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) { @@ -546,8 +552,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) {