Re: ld: error: bzlib.pico:147: unclosed quote

From: Mark Millard via freebsd-arm <freebsd-arm_at_freebsd.org>
Date: Wed, 22 Dec 2021 01:28:09 UTC
On 2021-Dec-21, at 10:00, bob prohaska <fbsd@www.zefox.net> wrote:

> A try at buildworld on a Pi4 from sources updated this morning stoped with
> 
> Building /usr/obj/usr/src/arm64.aarch64/lib/libelf/elf_update.o
> --- lib/libbz2__L ---
> ld: error: bzlib.pico:147: unclosed quote
> ld: error: compress.pico:108: unclosed quote
> --- lib/libcom_err__L ---
> Building /usr/obj/usr/src/arm64.aarch64/lib/libcom_err/libcom_err.so.5.debug
> --- lib/libbz2__L ---
> ld: error: decompress.pico: section header table goes past the end of the file: e_shoff = 0xc388
> cc: error: linker command failed with exit code 1 (use -v to see invocation)

Going in a different direction in this note: The
"unclosed quote" messages seem to be from:

contrib/llvm-project/lld/ELF/ScriptLexer.cpp

in its:

// Split S into linker script tokens.
void ScriptLexer::tokenize(MemoryBufferRef mb) {
  std::vector<StringRef> vec;
  mbs.push_back(mb);
  StringRef s = mb.getBuffer();
  StringRef begin = s;
  
  for (;;) {
    s = skipSpace(s);
    if (s.empty())
      break;

    // Quoted token. Note that double-quote characters are parts of a token
    // because, in a glob match context, only unquoted tokens are interpreted
    // as glob patterns. Double-quoted tokens are literal patterns in that
    // context.
    if (s.startswith("\"")) {
      size_t e = s.find("\"", 1);
      if (e == StringRef::npos) {
        StringRef filename = mb.getBufferIdentifier();
        size_t lineno = begin.substr(0, s.data() - begin.data()).count('\n');
        error(filename + ":" + Twine(lineno + 1) + ": unclosed quote");
        return;
      }
. . .

code. That code suggests that bzlib.pico and compress.pico were
being treated as linker scripts for some reason. (I've no clue
why at this point.)

Seeing some parts of the content of the related *.meta files
might give a clue why, if you were using META_MODE.


===
Mark Millard
marklmi at yahoo.com