0

In grub2/grub-core's Makefile.core.def,

module = {
    name = regexp;
    common = commands/regexp.c;
    common = commands/wildcard.c
    ldadd = libgnulib.a;
    cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
    cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)'
};

What does ldadd do? Where does libgnulib.a live? I tried to search for libgnulib.a in the grub directory but I couldn't find it. I also tried to search online but couldn't find any info.

Thanks, Matt

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
user2719735
  • 97
  • 2
  • 10
  • Did you try searching for `AutoGen definitions` on the internet? The first hit for me seems fairly relevant to that file and its contents. https://www.gnu.org/software/autogen/manual/html_node/Definitions-File.html – Etan Reisner Oct 07 '14 at 23:28
  • Your question on the grub-devel mailing lists suggests this may in fact be a duplicate of http://stackoverflow.com/questions/25396711/grub-bootloader-with-shared-library-support. – unixsmurf Oct 09 '14 at 14:48

1 Answers1

1

The construct you are referring to actually went away in the upstream project last November, with this commit. The regexp module now simply includes gnulib/regex.c directly.

Before then, it was a library generated as part of the build, and put into the grub-core directory. The ldadd directive simply causes the generated Makefile to add the specified library to the link step for the current module.

unixsmurf
  • 5,852
  • 1
  • 33
  • 40
  • Thanks for the clarification. I see library = { name = libgnulib.a; common = gnulib/regex.c; cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)'; cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)'; }; Why is the "gnulib/regex.c" used for the common? – user2719735 Oct 24 '14 at 02:28
  • 'common' simply means build and include in module for all target platforms. Certain modules with either processor or firmware architecture specific bits also contain source files included per architecture; for example the 'linux' module. – unixsmurf Oct 24 '14 at 07:05
  • You mentioned the libgnulib.a was generated as part of the build and put into the grub-core directory, but I cannot find it there. I tried find command and couldn't find it anywhere. – user2719735 Nov 19 '14 at 04:08
  • No - like I said, it no longer exists in the upstream version of GRUB. – unixsmurf Nov 19 '14 at 14:55
  • We are still using the older version, and looks like we won't be updating for a while. – user2719735 Nov 19 '14 at 19:28
  • Then I must say that I am most perplexed, since when I reset to the version of grub where libgnulib.a is still explicitly included and built, I get a grub-core/libgnulib.a generated. Regardless, it sounds like the actual problem you are trying to solve is not actually related to your question. I would recommend you post a new question describing what you are trying to do, and what problems you are encountering while doing it. – unixsmurf Nov 20 '14 at 09:54