[Tarantool-patches] [PATCH 09/43] build: export src/lib/core/random.c symbols

Timur Safin tsafin at tarantool.org
Tue Apr 14 21:14:21 MSK 2020


: diff --git a/extra/exports b/extra/exports
: index 4b20607ad..1224c550d 100644
: --- a/extra/exports
: +++ b/extra/exports
: @@ -2,7 +2,6 @@
: 
:  # FFI
: 
: -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 @@
: 
:  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[] = {
:  		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++] = rand();
:  }
: +
: +void **
: +random_export_syms(void)
: +{
: +	static void *syms[] = {
: +		(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



More information about the Tarantool-patches mailing list