bugGNU roff - Bugs: bug #60338, newer gnulib will cause 'undefined...

 
 

bug #60338: newer gnulib will cause 'undefined reference to "rpl_free"' errors

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Mon 05 Apr 2021 12:06:01 AM UTC
   
 
Category:  Core Severity:  1 - Wish
Item Group:  Build/Installation Status:  Invalid
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 26 Apr 2022 03:34:46 PM UTC, comment #11: 

The prediction that gnulib would provoke these warnings seems not to have borne out.

No code changes (beyond updating the gnulib submodule, which reportedly also caused the diagnostic) appear to have been necessary.

Therefore I'm closing this ticket as invalid.

G. Branden Robinson <gbranden>
Group administrator
Mon 25 Apr 2022 06:16:58 PM UTC, comment #10: 

  The executables don't include "rpl_free" any more.

"free_preserves_errno" is now 'yes' and thus "HAVE_FREE_POSIX 1".

  This ticket can be closed as being fixed.

Bjarni Ingi Gislason <bjarniig>
Sat 21 Aug 2021 01:55:46 AM UTC, comment #9: 


comment #8:

>   Are you using an old version of "gnulib".


I'm using the one from our git submodule, which is the one for which we claim support.

> My ChangeLog in groff/gnulib is from 15th August 2021.


Yes, you're using something much newer.

>   I update my gnulib repository before I use this bootstrap script:


Then you can't expect it to work if gnulib changes something that breaks compatibility.

>   I also use "-DGNULIB_NAMESPACE=gnulib"


Why?  What does this do?  Why should groff's build use it?

>   I am using "autoconf 2.71" now in my configure.


Yes, this is very new, and groff has not updated its dependencies yet.  Doing so depends on how easy this is to do without breaking support for older host platforms with older versions of underlying tooling.

> I have already reported bugs after an update of gnulib.


This stuff is good to know, but it's not anything more than a "Wish"-severity bug until the groff development team decides to update the build dependencies we support.  That's a collective decision that should be made on the mailing list, and last I checked Bertrand was still our GNU maintainer and release engineer.

>   It is not enough to just update gnulib in master before a release.


That is a question of policy and resource management.

G. Branden Robinson <gbranden>
Group administrator
Tue 17 Aug 2021 08:48:33 PM UTC, comment #8: 

  Are you using an old version of "gnulib".
My ChangeLog in groff/gnulib is from 15th August 2021.

  I update my gnulib repository before I use this bootstrap script:

set -efu

branch=$(git status | sed -n 's/^On branch // p')
echo Is on branch $branch | tee bootstrap.output.$branch

./bootstrap --no-git --gnulib-srcdir=$GNULIB_SRCDIR \
--bootstrap-sync 2>&1 | tee -a bootstrap.output.$branch

####

  I also use "-DGNULIB_NAMESPACE=gnulib"

##

You do not have "src/libs/libgroff/libgroff_a-fprintf.o"

There is no "rpl_..." in master's version of "build/src/include/config.h"

####

  I am using "autoconf 2.71" now in my configure.

  Differences between configuring are in an attached file:

####

  From configure:

 Compiler                        : /usr/bin/gcc -Wall -Wextra -Wformat=2
 -Wstringop-overflow=4 -Wshadow=global -Wredundant-decls -Wunused
-Wunused-parameter -fsanitize=signed-integer-overflow
-fsanitize-undefined-trap-on-error -fstack-protector-strong -fno-common
-fstack-clash-protection -ftrapv -funsigned-char
-fvar-tracking-assignments  -g -O  -Wmissing-prototypes
-Wold-style-definition -Wstrict-prototypes  -Wold-style-declaration 
-D_FORTIFY_SOURCE=2
 
####

  From Makefile:

CPPFLAGS = -D_FORTIFY_SOURCE=2
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -Wall -Wextra -Wformat=2  -Wstringop-overflow=4
-Wshadow=global -Wredundant-decls -Wunused -Wunused-parameter
-fsanitize=signed-integer-overflow -fsanitize-undefined-trap-on-error
-fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv
-funsigned-char -fvar-tracking-assignments  -g -O  -fcheck-new
-std=c++17 -Wredundant-decls -DGNULIB_NAMESPACE=gnulib
CYGPATH_W = echo

####

I have already reported bugs after an update of gnulib.

  It is not enough to just update gnulib in master before a release.

bug #60338

bug #60339

bug #60855

  Check if your "groff" and "troff" contains "rpl_fprintf".

  See also bug #60035 and bug #59276 (both closed).



(file #51794)

Bjarni Ingi Gislason <bjarniig>
Mon 16 Aug 2021 05:58:04 PM UTC, comment #7: 

I can't reproduce the reported problem with CFLAGS and CXXFLAGS including -Og and -D_FORTIFY_SOURCE=2 options.

See attached build script and logs of standard output and standard error.

(file #51788, file #51789, file #51790)

G. Branden Robinson <gbranden>
Group administrator
Fri 13 Aug 2021 10:49:14 PM UTC, comment #6: 

  I use '-Og'; "-O..." is a shortcut for "any type of optimisation".

  My suggestion should work without or with any type of optimisation.

Bjarni Ingi Gislason <bjarniig>
Fri 13 Aug 2021 02:40:03 PM UTC, comment #5: 


comment #3:

>   This is caused by using both options "-O..." and -D_FORTIFY_SOURCE=2.
>
>   Debian uses these options.


-O... (read literally) isn't a gcc option.  What are you replacing with the ellipsis?  Does even -O0 impose this requirement when used in conjunction with -D_FORTIFY_SOURCE=2?

G. Branden Robinson <gbranden>
Group administrator
Mon 09 Aug 2021 08:41:38 PM UTC, comment #4: 

  One must define "GNULIB_NAMESPACE" to make "rpl_fprintf" accessible to the linker, for example by adding

-DGNULIB_NAMESPACE=gnulib

to CXXFLAGS.

  More about this is for example in "gnulib.html" chapter 6.5
"A C++ namespace for gnulib"

or www.gnu.org/software/gnulib/manual/gnulib.html

Bjarni Ingi Gislason <bjarniig>
Mon 02 Aug 2021 05:30:57 PM UTC, comment #3: 

  This is caused by using both options "-O..." and -D_FORTIFY_SOURCE=2.

  Debian uses these options.

Bjarni Ingi Gislason <bjarniig>
Wed 21 Apr 2021 02:34:10 AM UTC, comment #2: 

Hi Bjarni,

I don't get any compilation errors with my Debian buster-based toolchain.  Are you saying you see these errors after updating gnulib to a revision not currently used in the groff Git repository?

G. Branden Robinson <gbranden>
Group administrator
Mon 05 Apr 2021 03:18:41 AM UTC, comment #1: 

Subject: compilation error: undefined reference to "rpl_free"

  The output of "configure" shows:

checking whether free is known to preserve errno... no

  Therefore "rpl_free" is used.

  This can be fixed be adding

lib/free.c

  to the variable "libdriver_a_SOURCES" in the file
"src/libs/libdriver/libdriver.am".

  That causes the next compilation error:

In file included from /usr/include/X11/Xos.h:89,
                 from ../src/devices/xditview/font.c:7:
./lib/unistd.h:663:3: error: #error "Please include config.h first."
  663 |  #error "Please include config.h first."
      |   ^~~~~
./lib/unistd.h:665:24: error: expected ';' before 'extern'
  665 | _GL_INLINE_HEADER_BEGIN
      |                        ^
      |                        ;
./lib/unistd.h:2806:22: error: expected ';' before 'struct'
 2806 | _GL_INLINE_HEADER_END
      |                      ^
      |                      ;


Bjarni Ingi Gislason <bjarniig>
Mon 05 Apr 2021 12:06:01 AM UTC, original submission:  

Subject: compilation error: undefined reference to "rpl_free"

  Latest gnulib versions are used from its git repository,
commit 3f913f1f28a3b39b2905f9143b0f3e722e63ee35.

...
  CXX      src/libs/libgroff/libgroff_a-uniuni.o
  CXX      src/libs/libgroff/libgroff_a-version.o
  AR       libgroff.a
  CXXLD    grodvi
/usr/bin/ld: libdriver.a(input.o): in function `remember_filename(char const*)':
/home/bg/git/groff/build/../src/libs/libdriver/input.cpp:1038: undefined reference to `rpl_free'
/usr/bin/ld: libdriver.a(input.o): in function `remember_source_filename(char const*)':
/home/bg/git/groff/build/../src/libs/libdriver/input.cpp:1064: undefined reference to `rpl_free'
/usr/bin/ld: libgroff.a(libgroff_a-font.o): in function `text_file::~text_file()':
/home/bg/git/groff/build/../src/libs/libgroff/font.cpp:93: undefined reference to `rpl_free'
/usr/bin/ld: libgroff.a(libgroff_a-glyphuni.o): in function `glyph_to_unicode_ptable::~glyph_to_unicode_ptable()':
/home/bg/git/groff/build/../src/libs/libgroff/glyphuni.cpp:31: undefined reference to `rpl_free'
/usr/bin/ld: libgroff.a(libgroff_a-glyphuni.o): in function `glyph_to_unicode_ptable::define(char const*, glyph_to_unicode*)':
/home/bg/git/groff/build/../src/libs/libgroff/glyphuni.cpp:31: undefined reference to `rpl_free'
/usr/bin/ld: libgroff.a(libgroff_a-nametoindex.o):/home/bg/git/groff/build/../src/libs/libgroff/nametoindex.cpp:40: more undefined references to `rpl_free' follow
collect2: error: ld returned 1 exit status


Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #51794:  bootstap.diff added by bjarniig (6KiB - text/x-patch - Difference between mine and Brandens bootstrap output)
file #51788:  make-groff added by gbranden (877B - application/octet-stream)
file #51789:  ERR added by gbranden (23KiB - application/octet-stream)
file #51790:  LOG added by gbranden (103KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bgarrigues (Updated the item)
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-04-26 gbranden StatusNone Invalid
        Assigned tobgarrigues gbranden
        Open/ClosedOpen Closed
    2022-04-24 bgarrigues Assigned toNone bgarrigues
    2021-08-21 gbranden Severity3 - Normal 1 - Wish
        StatusUnreproducible None
        Summarycompilation error: undefined reference to &quot;rpl_free&quot; newer gnulib will cause 'undefined reference to "rpl_free"' errors
    2021-08-17 bjarniig Attached File- Added bootstap.diff, #51794
    2021-08-16 gbranden Attached File- Added make-groff, #51788
        Attached File- Added ERR, #51789
        Attached File- Added LOG, #51790
        StatusNeed Info Unreproducible
    2021-04-21 gbranden StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code