Bug#1067651: mapserver fails to build on armhf in Ubuntu due to implicit declaration of strlcpy

Vladimir Petko vpa1977 at gmail.com
Mon Mar 25 02:39:41 GMT 2024


Package: mapserver
Severity: wishlist
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu noble ubuntu-patch

Dear Maintainer,

The package failed to build in Ubuntu noble on armhf:
--
/<<PKGBUILDDIR>>/mapshape.c: In function ‘msShapefileOpenHandle’:
/<<PKGBUILDDIR>>/mapshape.c:1755:3: error: implicit declaration of function
‘strlcpy’; did you mean ‘strncpy’? [-Werror=implicit-function-declaration]
 1755 | strlcpy(shpfile->source, filename, sizeof(shpfile->source));
      | ^~~~~~~
      | strncpy
/<<PKGBUILDDIR>>/mapshape.c: In function ‘msShapefileOpen’:
/<<PKGBUILDDIR>>/mapshape.c:1841:3: error: implicit declaration of function
‘strlcat’; did you mean ‘strncat’? [-Werror=implicit-function-declaration]
 1841 | strlcat(dbfFilename, ".dbf", bufferSize);
      | ^~~~~~~
      | strncat
--
See the build log[1]

strlcpy/strlcat function prototype is enabled in string.h when __USE_MISC macro
is defined.
strlcpy/strlcat functions belong to a set of functions declared on BSD
systems[2]


In Ubuntu, the attached patch was applied to achieve the following:
  * d/rules: define -D_BSD_SOURCE to ensure that strlcpy/strlcat functions
    are declared (LP: #2058864).


Thanks for considering the patch.

[1] https://launchpadlibrarian.net/720858988/buildlog_ubuntu-noble-
armhf.mapserver_8.0.1-4build3_BUILDING.txt.gz
[2] https://linux.die.net/man/3/strlcat


-- System Information:
Debian Release: trixie/sid
  APT prefers mantic-updates
  APT policy: (500, 'mantic-updates'), (500, 'mantic-security'), (500, 'mantic'), (100, 'mantic-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-25-generic (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
diff -Nru mapserver-8.0.1/debian/rules mapserver-8.0.1/debian/rules
--- mapserver-8.0.1/debian/rules	2024-03-16 20:08:52.000000000 +1300
+++ mapserver-8.0.1/debian/rules	2024-03-25 15:19:52.000000000 +1300
@@ -17,7 +17,7 @@
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
-CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
+CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) -D_BSD_SOURCE
 CFLAGS   := $(shell dpkg-buildflags --get CFLAGS)
 LDFLAGS  := $(shell dpkg-buildflags --get LDFLAGS)
 


More information about the Pkg-grass-devel mailing list