[Nut-upsdev] [PATCH] missing -lm in drivers/Makefile

Nik Soggia nut at niksoggia.it
Mon Oct 20 14:01:30 UTC 2014


Hi all,
I couldn't cross-compile NUT for uClibc x86_64 with shared libm, but the problem may show up with any other target as well.
ldexp() requires "-lm" and most toolchains are happy without it, but picky ones aren't.
This is a trivial patch to keep all linkers happy.
Regards,

diff -Naubr nut-2.7.2.old/drivers/Makefile.am nut-2.7.2.new/drivers/Makefile.am
--- nut-2.7.2.old/drivers/Makefile.am	2014-02-27 22:17:32.000000000 +0100
+++ nut-2.7.2.new/drivers/Makefile.am	2014-10-20 15:50:31.000000000 +0200
@@ -171,7 +171,7 @@
 tripplite_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
 
 bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c usb-common.c
-bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
+bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
 
 blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c usb-common.c
 blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
diff -Naubr nut-2.7.2.old/drivers/Makefile.in nut-2.7.2.new/drivers/Makefile.in
--- nut-2.7.2.old/drivers/Makefile.in	2014-04-17 22:26:31.000000000 +0200
+++ nut-2.7.2.new/drivers/Makefile.in	2014-10-20 15:50:32.000000000 +0200
@@ -785,7 +785,7 @@
 tripplite_usb_SOURCES = tripplite_usb.c libusb.c usb-common.c
 tripplite_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
 bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c usb-common.c
-bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
+bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
 blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c usb-common.c
 blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
 nutdrv_atcl_usb_SOURCES = nutdrv_atcl_usb.c usb-common.c

-- 
7\7 7 7-<



More information about the Nut-upsdev mailing list