From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp15.mail.ru (smtp15.mail.ru [94.100.176.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 2F89E4696C3 for ; Tue, 14 Apr 2020 21:14:23 +0300 (MSK) From: "Timur Safin" References: <55e54e04417a674ba9d1f5b679aaa432243aa453.1586650013.git.v.shpilevoy@tarantool.org> In-Reply-To: <55e54e04417a674ba9d1f5b679aaa432243aa453.1586650013.git.v.shpilevoy@tarantool.org> Date: Tue, 14 Apr 2020 21:14:21 +0300 Message-ID: <13ed01d61288$85b14d90$9113e8b0$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: ru Subject: Re: [Tarantool-patches] [PATCH 09/43] build: export src/lib/core/random.c symbols List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Vladislav Shpilevoy' , tarantool-patches@dev.tarantool.org : diff --git a/extra/exports b/extra/exports : index 4b20607ad..1224c550d 100644 : --- a/extra/exports : +++ b/extra/exports : @@ -2,7 +2,6 @@ :=20 : # FFI :=20 : -random_bytes : fiber_time : fiber_time64 : fiber_clock : diff --git a/src/exports.c b/src/exports.c : index c88d0b10d..cd2d49b9b 100644 : --- a/src/exports.c : +++ b/src/exports.c : @@ -50,6 +50,7 @@ :=20 : EXPORT(base64_export_syms); : EXPORT(clock_export_syms); : +EXPORT(random_export_syms); : EXPORT(salad_guava_export_syms); : EXPORT(scramble_export_syms); : EXPORT(tarantool_lua_export_syms); : @@ -60,6 +61,7 @@ export_syms(void) : void *syms[] =3D { : base64_export_syms, : clock_export_syms, : + random_export_syms, : salad_guava_export_syms, : scramble_export_syms, : tarantool_lua_export_syms, : diff --git a/src/lib/core/random.c b/src/lib/core/random.c : index f4fa75b1c..75680c9ea 100644 : --- a/src/lib/core/random.c : +++ b/src/lib/core/random.c : @@ -97,3 +97,12 @@ rand: : while (generated < size) : buf[generated++] =3D rand(); : } : + : +void ** : +random_export_syms(void) : +{ : + static void *syms[] =3D { : + (void *)random_bytes, : + }; : + return syms; : +} I think that this hack (if referencing to otherwise unused, but exported = symbol) should be unnecessary here and in all patches below if we = properly handle exported symbol in the linker. Which should retain those = symbols. Let me check later tonight that we miss here... Timur