stlink: Build failure on 32-bit Mac OS X 10.6

Thank you for giving feedback to the stlink project.

In order to allow developers and other contributors to isolate and target your respective issue, please take some time to fill out each of the following items appropriate to your specific problem:

  • Programmer/board type: [] (e.g Stlink /v1, /v2, /v2-clone, /v2-1)
  • Programmer firmware version: [] (e.g STSW-LINK007 2.27.15)
  • Operating system and version: [Mac OS X 10.6 i386] (e.g Linux, Mac OS X, Windows)
  • Stlink tools version and/or git commit hash: [v1.6.1] (e.g v1.1.0/git-c722056)
  • Stlink commandline tool name: [] (e.g st-info, st-flash, st-util)
  • Target chip (and board if applicable): [] (e.g STM32F402VG)

Futher we kindly ask you to describe the detected problem as detailed as possible and to add debug output if available, by using the following template:

Commandline-Output:

Complete log can be found in https://build.macports.org/builders/ports-10.6_i386-builder/builds/13998/steps/install-port/logs/stdio

...
[ 16%] Building C object CMakeFiles/stlink.dir/src/md5.c.o
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/stlink-1.6.1/src/common.c:1566:18: error: implicit conversion loses integer precision: 'off_t' (aka 'long long') to 'size_t' (aka 'unsigned long') [-Werror,-Wshorten-64-to-32]
    mf->len = st.st_size;
            ~ ~~~^~~~~~~
/opt/local/bin/clang-mp-9.0 -DSTLINK_HAVE_SYS_MMAN_H -DSTLINK_HAVE_UNISTD_H -Dstlink_EXPORTS -I/opt/local/include/libusb-1.0 -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/stlink-1.6.1/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/build/include/stlink -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/stlink-1.6.1/include/stlink -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/stlink-1.6.1/include/stlink/tools -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/stlink-1.6.1/src -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/stlink-1.6.1/src/tools  -pipe -Os -DNDEBUG -I/opt/local/include -std=gnu11 -Wall -Wextra -Wshadow -D_FORTIFY_SOURCE=2 -fstrict-aliasing -Wundef -Wformat -Wformat-security -Wmissing-variable-declarations -Wshorten-64-to-32 -Wimplicit-function-declaration -Wredundant-decls -fPIC -O2 -Werror -arch i386 -mmacosx-version-min=10.6 -fPIC   -o CMakeFiles/stlink.dir/src/md5.c.o   -c /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/stlink-1.6.1/src/md5.c
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/stlink-1.6.1/src/common.c:1566:18: error: implicit conversion loses integer precision: 'off_t' (aka 'long long') to 'size_t' (aka 'unsigned long') [-Werror,-Wshorten-64-to-32]
    mf->len = st.st_size;
            ~ ~~~^~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/stlink-static.dir/src/common.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_cross_stlink/stlink/work/build'
make[1]: *** [CMakeFiles/stlink-static.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [CMakeFiles/stlink.dir/src/common.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
...

Expected/description:

Should compile without any issues, maybe should take a look at the CI

I really wonder how this can happen with a 32 bit clang CI🤔

Related with https://github.com/stlink-org/stlink/issues/629

NOTICE: This bug report may be closed without further notice, if not enough information is provided!

Thank you for your support.

The stlink project maintainers

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 19 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, this sounds like the same issue. The error messages even indicate the same line as the patch I proposed.

Does it happen with previous versions as well (1.6.0, 1.5.1) ?

Not sure about 1.5.1. A similar build failure in 1.6.0 release was fixed in develop branch by https://github.com/stlink-org/stlink/pull/908