As reported by Port Fallouts , 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 , 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. 
Created attachment 227367 [details]
Attached is a patch that fixes the build once again. It can be added to the port as
to fix the build. Tested on armv7 FreeBSD 13.0-RELEASE.
The contents of this patch have been proposed upstream and may be included in a future release:
Please also consider making the GTK3 option into a flavour in a future version of the port.
Comment on attachment 227367 [details]
Maintainer timeout for patch.
@Robert Thanks for the report and patch. Could you:
- Update the patch to include a comment in the header
- Look for a method to disable, or override -Werror, which shouldn't be used/included in release builds.
Created attachment 227911 [details]
devel/stlink: fix build on 32 bit platforms
Improved patch as per koobs' wishes.
While we are at it, pet portlint and portclippy and regenerate existing patches.
Tested with Poudriere on armv7 arm64 i386 amd64 FreeBSD 13.0-RELEASE.