bug-gnulib
[Top][All Lists]
Advanced

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

Re: rpl_free undefined


From: Reuben Thomas
Subject: Re: rpl_free undefined
Date: Mon, 2 May 2022 12:38:48 +0100

On Mon, 2 May 2022 at 02:02, Bruno Haible <bruno@clisp.org> wrote:

I don't want to debug a gnulib version from more than 1 year ago, therefore
I'm using
   ./bootstrap --skip-git --gnulib-srcdir=$GNULIB_SRCDIR
(Argh. Why is this option not called --no-git, like in the other 'bootstrap'?)

Then I get an error message
  ./bootstrap: 136: eval: ./gnulib/gnulib-tool: not found
(Argh. I'm not going to debug your private 'bootstrap' variant.)

I am using Gary Vaughan's rewrite of bootstrap; please do file an issue about the incompatible command-line switch (and any other bugs you find) at https://github.com/gnulib-modules/bootstrap/

In any case, I can guess that your bootstrap.conf organises for two gnulib-tool
invocations. Probably as documented in
  https://www.gnu.org/software/gnulib/manual/html_node/Multiple-instances.html

Yes, exactly.

The problem that you report can easily happen if
  (1) the gnulib-tool invocation for the "library" uses code that makes use
      of the free() function, without requiring 'free-posix',

That was my case.

  (2) the gnulib-tool invocation for "src" uses the module 'free-posix'
      (implicitly or explicitly),

That was also my case.
 
  (3) the -I options for building the "library" gnulib include the build
      directory of the "src" gnulib; this is where a generated stdlib.h
      will be placed that does '#define free rpl_free'.

This is not the case as far as I can see. Rather, the "library" gnulib's stdlib.h contains "#define free rpl_free" guarded by "#if 1" guards. The library code in "lib" uses only the "library" gnulib's includes, not the "src" gnulib's includes.

Please provide a tarball, as described
above, so that I could confirm it. There were definitely some (big) changes
in this area in the last year; that's why I say that the tarball should be
built with a recent gnulib.

I have done this on branch gnulib-oddity: https://github.com/rrthomas/libpaper/tree/gnulib-oddity
(I checked in a dist tarball.)

However, updating gnulib seems to have fixed the problem. (I'm sorry, I did check gnulib history for free.c and friends, but I didn't notice any significant changes, which is why I had not already updated.)

But there is a new problem: when I build from the tarball with the updated gnulib on MSYS I get multiple definition errors for relocate and relocate2:

  CCLD     paper.exe
/usr/lib/gcc/x86_64-pc-msys/11.2.0/../../../../x86_64-pc-msys/bin/ld: ../src/libgnu/.libs/libgnupaper.a(relocatable.o): in function `set_relocation_prefix':
/home/rrt/libpaper-test/libpaper-1.2.0/src/libgnu/relocatable.c:169: multiple definition of `set_relocation_prefix'; ../lib/.libs/libpaper.a(relocatable.o):/home/rrt/libpaper-test/libpaper-1.2.0/libgnu/relocatable.c:169: first defined here
/usr/lib/gcc/x86_64-pc-msys/11.2.0/../../../../x86_64-pc-msys/bin/ld: ../src/libgnu/.libs/libgnupaper.a(relocatable.o): in function `relocate':
/home/rrt/libpaper-test/libpaper-1.2.0/src/libgnu/relocatable.c:482: multiple definition of `relocate'; ../lib/.libs/libpaper.a(relocatable.o):/home/rrt/libpaper-test/libpaper-1.2.0/libgnu/relocatable.c:482: first defined here
/usr/lib/gcc/x86_64-pc-msys/11.2.0/../../../../x86_64-pc-msys/bin/ld: ../src/libgnu/.libs/libgnupaper.a(relocatable.o): in function `relocate2':
/home/rrt/libpaper-test/libpaper-1.2.0/src/libgnu/relocatable.c:597: multiple definition of `relocate2'; ../lib/.libs/libpaper.a(relocatable.o):/home/rrt/libpaper-test/libpaper-1.2.0/libgnu/relocatable.c:597: first defined here
collect2: error: ld returned 1 exit status

It works fine on mingw.

--
https://rrt.sc3d.org

reply via email to

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