[Bug 257708] devel/stlink: build fails on 32 bit platforms

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 09 Aug 2021 12:14:54 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257708

            Bug ID: 257708
           Summary: devel/stlink: build fails on 32 bit platforms
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
               URL: https://lists.freebsd.org/archives/freebsd-pkg-fallout
                    /2021-August/073895.html
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: lev_at_FreeBSD.org
          Reporter: fuz_at_fuz.su
          Assignee: lev_at_FreeBSD.org
             Flags: maintainer-feedback?(lev_at_FreeBSD.org)

As reported by Port Fallouts [1], devel/stlink fails to build on various 32 bit
platforms.  This appears to be due to an overly zealous warning:

/usr/bin/cc -DSTLINK_HAVE_SYS_MMAN_H -DSTLINK_HAVE_SYS_TIME_H
-DSTLINK_HAVE_UNISTD_H -I/wrkdirs/usr/ports/devel/stlink/work/stlink-1.7.0/inc
-I/wrkdirs/usr/ports/devel/stlink/work/.build/inc
-I/wrkdirs/usr/ports/devel/stlink/work/stlink-1.7.0/src
-I/wrkdirs/usr/ports/devel/stlink/work/stlink-1.7.0/src/st-flash
-I/wrkdirs/usr/ports/devel/stlink/work/stlink-1.7.0/src/stlink-lib -O2 -pipe 
-fstack-protector-strong -fno-strict-aliasing -std=c99 -std=gnu11 -std=gnu18
-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 -O2 -pipe 
-fstack-protector-strong -fno-strict-aliasing -std=c99 -MD -MT
CMakeFiles/stlink-static.dir/src/common.c.o -MF
CMakeFiles/stlink-static.dir/src/common.c.o.d -o
CMakeFiles/stlink-static.dir/src/common.c.o -c
/wrkdirs/usr/ports/devel/stlink/work/stlink-1.7.0/src/common.c
/wrkdirs/usr/ports/devel/stlink/work/stlink-1.7.0/src/common.c:2222:16: error:
implicit conversion loses integer precision: 'off_t' (aka 'long long') to
'size_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
  mf->len = st.st_size;
          ~ ~~~^~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

A patch for this issue had already existed in am old revision [2], but was
taken out last year.  Perhaps it is required to reintroduce the patch.  I have
meanwhile reported the issue back to upstream, so perhaps they may fix it once
again. [3]

[1]:
https://lists.freebsd.org/archives/freebsd-pkg-fallout/2021-August/073895.html
[2]:
https://cgit.freebsd.org/ports/commit/devel/stlink?id=fa323644a47f359c2bf843fd98aaa956e14ba845
[3]: https://github.com/stlink-org/stlink/issues/1175

-- 
You are receiving this mail because:
You are the assignee for the bug.
Received on Mon Aug 09 2021 - 12:14:54 UTC

Original text of this message