sof/tools/testbench
Marc Herbert 3de29dac2a testbench: make lib_table actually global and stop passing it around
This fixes compilation with:

  CFLAGS=-fno-common ./scripts/rebuild-testbench.sh

  sof/tools/testbench/topology.c:24: multiple definition of `lib_table';
  sof/tools/testbench/testbench.c:39: first defined here

This was detected by Gentoo 10 which uses -fno-common by default, thanks
Guennadi for the report and investigation.

Commit 03067c6c77 ("host: set up shared library table") introduced a
strange "lib_table" symbol that was apparently meant to be global but
was not really because of some confusion between arrays and pointers and
needed to be passed around and "initialized to itself" (!) at run time
as seen in the sample trace below:

topology.c

struct shared_lib_table *lib_table;

parse_topology(..., library_table,...)
{

        printf("DEBUG1 ----- %p, %p, %p\n",
                  &lib_table,     lib_table,      library_table);

        lib_table = library_table;

        printf("DEBUG2 ----- %p, %p, %p\n",
                 &lib_table,      lib_table,      library_table);

}

Log:

    DEBUG1 ----- 0x56298c954040, 0x56298c951183, 0x56298c954040

    DEBUG2 ----- 0x56298c954040, 0x56298c954040, 0x56298c954040

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-11-05 23:09:35 +00:00
..
include/testbench testbench: make lib_table actually global and stop passing it around 2020-11-05 23:09:35 +00:00
CMakeLists.txt host: move edf_schedule to platform 2020-10-20 09:28:28 +01:00
common_test.c host: move drivers and libs out of testbench 2020-10-06 11:04:38 +01:00
file.c treewide: Remove references to .free and .avail members of audio_stream. 2020-08-03 21:53:14 +01:00
testbench.c testbench: make lib_table actually global and stop passing it around 2020-11-05 23:09:35 +00:00
topology.c testbench: make lib_table actually global and stop passing it around 2020-11-05 23:09:35 +00:00