Skip to content

[BUG] Tools fail to build on i686 and musl systems #4902

@cinerea0

Description

@cinerea0

Describe the bug
The tools found in the "tools" directory in this repository cannot be built on i686 or x86_64-musl systems. On i686 systems the tools fail to build because of type mismatch (My knowledge of C is minimal, but it seems like "ld" should be "zd" in convert.c.). On x86_64-musl systems the tools fail to build because a topology file can't be parsed. The full error logs for these can be found here: void-linux/void-packages#33318.

To Reproduce
Attempt to build the tools on the platforms listed above.

Reproduction Rate
This happens every build attempt.

Expected behavior
I expect the tools to build correctly.

Impact
This prevents Void Linux from distributing the tools since they currently cannot be built from source on all of the expected architectures. Additionally, due to the way the tools used to be distributed, Void cannot provide an update to v1.9 of sof-firmware.

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
  2. Name of the topology file
    • Topology: sof-cml-nocodec.tplg
  3. Name of the platform(s) on which the bug is observed.
    • Platform: i686 and x86_64-musl

Screenshots or console output

i686 error
[54/388] Building C object logger/CMakeFiles/sof-logger.dir/convert.c.o
FAILED: logger/CMakeFiles/sof-logger.dir/convert.c.o 
/usr/bin/cc  -I/builddir/sof-1.9/tools/../src/include -I/builddir/sof-1.9/tools/../rimage/src/include -I/builddir/sof-1.9/tools/.. -DNDEBUG -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=i686 -O2 -Wall -Werror -MD -MT logger/CMakeFiles/sof-logger.dir/convert.c.o -MF logger/CMakeFiles/sof-logger.dir/convert.c.o.d -o logger/CMakeFiles/sof-logger.dir/convert.c.o -c /builddir/sof-1.9/tools/logger/convert.c
/builddir/sof-1.9/tools/logger/convert.c: In function 'fetch_entry':
/builddir/sof-1.9/tools/logger/convert.c:746:44: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
  746 |     log_err("Partial read of %u bytes of %lu, reading more\n",
      |                                          ~~^
      |                                            |
      |                                            long unsigned int
      |                                          %u
  747 |      ret, size);
      |           ~~~~                              
      |           |
      |           size_t {aka unsigned int}
/builddir/sof-1.9/tools/logger/convert.c: In function 'logger_read':
/builddir/sof-1.9/tools/logger/convert.c:877:63: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Werror=format=]
  877 |      log_err("file '%s' is unaligned with trace entry size (%ld)\n",
      |                                                             ~~^
      |                                                               |
      |                                                               long int
      |                                                             %d
  878 |       global_config->in_file, sizeof(dma_log));
      |                               ~~~~~~~~~~~~~~~                  
      |                               |
      |                               unsigned int
/builddir/sof-1.9/tools/logger/convert.c: In function 'dump_ldc_info':
/builddir/sof-1.9/tools/logger/convert.c:997:55: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'} [-Werror=format=]
  997 |  fprintf(out_fd, "Components uuid dictionary size:\t%ld bytes\n",
      |                                                     ~~^
      |                                                       |
      |                                                       long int
      |                                                     %d
  998 |   remaining);
      |   ~~~~~~~~~                                            
      |   |
      |   ssize_t {aka int}
/builddir/sof-1.9/tools/logger/convert.c:1010:26: error: format '%lX' expects argument of type 'long unsigned int', but argument 3 has type 'uintptr_t' {aka 'unsigned int'} [-Werror=format=]
 1010 |   fprintf(out_fd, "\t0x%lX  %s\n", uid_addr, name);
      |                        ~~^         ~~~~~~~~
      |                          |         |
      |                          |         uintptr_t {aka unsigned int}
      |                          long unsigned int
      |                        %X
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.
x86_64-musl error
[5/388] Generating sof-cml-nocodec.tplg
ALSA lib parser.c:213:(tplg_load_config) failed to parse topology
Unable to load configuration: Invalid argument
FAILED: topology/topology1/sof-cml-nocodec.tplg /builddir/sof-1.9/tools/build/topology/topology1/sof-cml-nocodec.tplg 
cd /builddir/sof-1.9/tools/build/topology/topology1 && alsatplg ${VERBOSE:+-v 1} -c /builddir/sof-1.9/tools/build/topology/topology1/sof-cml-nocodec.conf -o sof-cml-nocodec.tplg
[7/388] Building C object probes/CMakeFiles/sof-probes.dir/probes_main.c.o
ninja: build stopped: subcommand failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions