Package: luola
Version: 1.3.2-11
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu disco ubuntu-patch

Dear Maintainer,

luola currently fails to build from source with ld --as-needed, which is
enabled by default in Ubuntu. This linker option requires that
libraries be placed after the objects that require them, but the current
logic to add -lm to LDFLAGS adds it near the beginning of the command
with the linker options.

In Ubuntu, the attached patch was applied to achieve the following:

  * d/p/link_against_libm: Use Autotools to find/link against libm instead of
    manually appending -lm to LDFLAGS to fix FTBFS with ld --as-needed.

Thanks for considering the patch.

Logan Rosen

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

Kernel: Linux 4.18.0-12-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru luola-1.3.2/debian/patches/link_against_libm 
luola-1.3.2/debian/patches/link_against_libm
--- luola-1.3.2/debian/patches/link_against_libm        1969-12-31 
19:00:00.000000000 -0500
+++ luola-1.3.2/debian/patches/link_against_libm        2018-12-16 
19:15:32.000000000 -0500
@@ -0,0 +1,10 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -73,6 +73,7 @@
+ #AC_CHECK_LIB(pthread, main,, AC_MSG_ERROR(SDL needs pthread !))
+ AC_CHECK_LIB([SDL_image],[main],[],AC_MSG_ERROR(SDL_image is needed))
+ AC_CHECK_LIB([z],[main],[],AC_MSG_ERROR(libz is needed))
++AC_SEARCH_LIBS([hypot],[m],[],AC_MSG_ERROR(libm is needed))
+ 
+ AC_CONFIG_FILES([Makefile
+                  contrib/Makefile
diff -Nru luola-1.3.2/debian/patches/series luola-1.3.2/debian/patches/series
--- luola-1.3.2/debian/patches/series   2018-09-13 17:50:13.000000000 -0400
+++ luola-1.3.2/debian/patches/series   2018-12-16 19:12:42.000000000 -0500
@@ -2,3 +2,4 @@
 luola-manpage
 remove_implicit_declaration
 hurd_path_max
+link_against_libm
diff -Nru luola-1.3.2/debian/rules luola-1.3.2/debian/rules
--- luola-1.3.2/debian/rules    2018-09-13 17:50:13.000000000 -0400
+++ luola-1.3.2/debian/rules    2018-12-16 19:15:38.000000000 -0500
@@ -5,7 +5,6 @@
 export DH_VERBOSE=1
 
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
-export DEB_LDFLAGS_MAINT_APPEND = -lm
 
 %:
        dh $@

Reply via email to