grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Build fails due to wrong placement of -llibrary options


From: Christian Franke
Subject: Build fails due to wrong placement of -llibrary options
Date: Sat, 28 Aug 2010 14:23:07 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100504 SeaMonkey/2.0.5

I'm trying to fix the build on Cygwin after the recent move to the new autogen/automake build system.

There is one Cygwin independent issue found so far:

$ make
[...]
gcc [...] -lintl -o grub-bin2h.exe util/grub_bin2h-bin2h.o libgrub.a
libgrub.a(...): undefined reference to `_libintl_gettext'
[...]

Workaround:

$ make LIBS=-lintl
[...]
gcc [...] -lintl -o grub-bin2h.exe util/grub_bin2h-bin2h.o libgrub.a -lintl


The placement of -llibrary options matter because the linker searches libraries and objects in the order specified.

$ grep ^grub_bin2h_LD Makefile
grub_bin2h_LDADD = libgrub.a
grub_bin2h_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_PROGRAM) $(LIBINTL) $(LIBDEVMAPPER)

The above should be:
grub_bin2h_LDADD = libgrub.a $(LIBINTL) $(LIBDEVMAPPER)
grub_bin2h_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_PROGRAM)

Same for all other utils. This likely needs to be fixed in gentpl.py.


--
Regards,
Christian Franke




reply via email to

[Prev in Thread] Current Thread [Next in Thread]