All of lore.kernel.org
 help / color / mirror / Atom feed
* Build fails due to wrong placement of -llibrary options
@ 2010-08-28 12:23 Christian Franke
  2010-08-28 13:23 ` BVK Chaitanya
  2010-08-28 13:35 ` BVK Chaitanya
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Franke @ 2010-08-28 12:23 UTC (permalink / raw)
  To: grub-devel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Build fails due to wrong placement of -llibrary options
  2010-08-28 12:23 Build fails due to wrong placement of -llibrary options Christian Franke
@ 2010-08-28 13:23 ` BVK Chaitanya
  2010-08-28 13:35 ` BVK Chaitanya
  1 sibling, 0 replies; 4+ messages in thread
From: BVK Chaitanya @ 2010-08-28 13:23 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

On Sat, Aug 28, 2010 at 5:53 PM, Christian Franke
<Christian.Franke@t-online.de> wrote:
>
> $ 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.
>

It is not necessary to modify gentpl.py, fixing in Makefile.util.def
should be sufficient.  Attached patch fixes all these AFAICS.



thanks,
-- 
bvk.chaitanya

[-- Attachment #2: ldadd.patch --]
[-- Type: text/x-diff, Size: 2807 bytes --]

=== modified file 'Makefile.util.def'
--- Makefile.util.def	2010-08-23 15:53:39 +0000
+++ Makefile.util.def	2010-08-28 13:05:34 +0000
@@ -99,7 +99,7 @@
   name = grub-bin2h;
   common = util/bin2h.c;
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
   mansection = 1;
 };
 
@@ -112,7 +112,7 @@
   extra_dist = util/grub-mkimagexx.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
   cppflags = '-DGRUB_PKGLIBROOTDIR=\"$(pkglibrootdir)\"';
 };
 
@@ -123,7 +123,7 @@
   common = util/grub-mkrelpath.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
 };
 
 program = {
@@ -133,7 +133,7 @@
   common = util/grub-script-check.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
 };
 
 program = {
@@ -143,7 +143,7 @@
   common = util/grub-editenv.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
 };
 
 program = {
@@ -153,7 +153,7 @@
   common = util/grub-mkpasswd-pbkdf2.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
   cflags = '$(CFLAGS_GCRY)';
   cppflags = '$(CPPFLAGS_GCRY)';
 };
@@ -171,7 +171,7 @@
   common = util/grub-pe2elf.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL)';
+  ldadd = '$(LIBINTL)';
   condition = COND_GRUB_PE2ELF;
 };
 
@@ -181,7 +181,7 @@
   common = util/grub-fstest.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
   condition = COND_GRUB_FSTEST;
 };
 
@@ -194,8 +194,8 @@
   cflags = '$(freetype_cflags)';
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
-  ldflags = '$(freetype_libs)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(freetype_libs)';
   condition = COND_GRUB_MKFONT;
 };
 
@@ -212,7 +212,7 @@
   sparc64_ieee1275 = util/ieee1275/devicemap.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
 };
 
 program = {
@@ -222,7 +222,7 @@
   common = util/grub-probe.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
 };
 
 program = {
@@ -239,7 +239,7 @@
   sparc64_ieee1275 = util/lvm.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
 
   enable = i386_pc;
   enable = sparc64_ieee1275;
@@ -506,5 +506,5 @@
   common = grub-core/tests/lib/test.c;
   cflags = -Wno-format;
   ldadd = libgrub.a;
-  ldflags = '$(LIBDEVMAPPER)';
+  ldadd = '$(LIBDEVMAPPER)';
 };


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Build fails due to wrong placement of -llibrary options
  2010-08-28 12:23 Build fails due to wrong placement of -llibrary options Christian Franke
  2010-08-28 13:23 ` BVK Chaitanya
@ 2010-08-28 13:35 ` BVK Chaitanya
  2010-08-28 19:02   ` Christian Franke
  1 sibling, 1 reply; 4+ messages in thread
From: BVK Chaitanya @ 2010-08-28 13:35 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

On Sat, Aug 28, 2010 at 5:53 PM, Christian Franke
<Christian.Franke@t-online.de> wrote:
>
> $ 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.
>

It is not necessary to modify gentpl.py, fixing in Makefile.util.def
should be sufficient.  Attached patch fixes all these AFAICS.



thanks,
-- 
bvk.chaitanya

[-- Attachment #2: ldadd.patch --]
[-- Type: text/x-diff, Size: 2807 bytes --]

=== modified file 'Makefile.util.def'
--- Makefile.util.def	2010-08-23 15:53:39 +0000
+++ Makefile.util.def	2010-08-28 13:05:34 +0000
@@ -99,7 +99,7 @@
   name = grub-bin2h;
   common = util/bin2h.c;
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
   mansection = 1;
 };
 
@@ -112,7 +112,7 @@
   extra_dist = util/grub-mkimagexx.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
   cppflags = '-DGRUB_PKGLIBROOTDIR=\"$(pkglibrootdir)\"';
 };
 
@@ -123,7 +123,7 @@
   common = util/grub-mkrelpath.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
 };
 
 program = {
@@ -133,7 +133,7 @@
   common = util/grub-script-check.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
 };
 
 program = {
@@ -143,7 +143,7 @@
   common = util/grub-editenv.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
 };
 
 program = {
@@ -153,7 +153,7 @@
   common = util/grub-mkpasswd-pbkdf2.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
   cflags = '$(CFLAGS_GCRY)';
   cppflags = '$(CPPFLAGS_GCRY)';
 };
@@ -171,7 +171,7 @@
   common = util/grub-pe2elf.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL)';
+  ldadd = '$(LIBINTL)';
   condition = COND_GRUB_PE2ELF;
 };
 
@@ -181,7 +181,7 @@
   common = util/grub-fstest.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
   condition = COND_GRUB_FSTEST;
 };
 
@@ -194,8 +194,8 @@
   cflags = '$(freetype_cflags)';
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER)';
-  ldflags = '$(freetype_libs)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
+  ldadd = '$(freetype_libs)';
   condition = COND_GRUB_MKFONT;
 };
 
@@ -212,7 +212,7 @@
   sparc64_ieee1275 = util/ieee1275/devicemap.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
 };
 
 program = {
@@ -222,7 +222,7 @@
   common = util/grub-probe.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
 };
 
 program = {
@@ -239,7 +239,7 @@
   sparc64_ieee1275 = util/lvm.c;
 
   ldadd = libgrub.a;
-  ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)';
 
   enable = i386_pc;
   enable = sparc64_ieee1275;
@@ -506,5 +506,5 @@
   common = grub-core/tests/lib/test.c;
   cflags = -Wno-format;
   ldadd = libgrub.a;
-  ldflags = '$(LIBDEVMAPPER)';
+  ldadd = '$(LIBDEVMAPPER)';
 };


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Build fails due to wrong placement of -llibrary options
  2010-08-28 13:35 ` BVK Chaitanya
@ 2010-08-28 19:02   ` Christian Franke
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Franke @ 2010-08-28 19:02 UTC (permalink / raw)
  To: The development of GNU GRUB

BVK Chaitanya wrote:
> On Sat, Aug 28, 2010 at 5:53 PM, Christian Franke
> <...>  wrote:
>    
>> $ 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.
>>
>>      
> It is not necessary to modify gentpl.py, fixing in Makefile.util.def
> should be sufficient.  Attached patch fixes all these AFAICS.
>
>    

With the patch it works, thanks! Please apply.

-- 
Regards,
Christian Franke



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-28 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-28 12:23 Build fails due to wrong placement of -llibrary options Christian Franke
2010-08-28 13:23 ` BVK Chaitanya
2010-08-28 13:35 ` BVK Chaitanya
2010-08-28 19:02   ` Christian Franke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.