bugGNU gettext - Bugs: bug #61769, building libasprintf does not...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #61769: building libasprintf does not honour RPATH configure option --disable-rpath

Submitter:  Rudi Heitbaum <heitbaum>
Submitted:  Sat 08 Jan 2022 03:30:48 AM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Works For Me
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Sat 25 Jun 2022 08:08:50 PM UTC, comment #3: 

1) When I build, on Ubuntu 22.04, gettext 0.21
  - once with CC=gcc, CXX=g++,
  - once with CC="gcc -fuse-ld=gold", CXX="g++ -fuse-ld=gold",
I obtain identical results: --disable-rpath has the desired effect.

$ readelf --dynamic build-64.ld/gettext-runtime/libasprintf/.libs/libasprintf.so | grep PATH
$ readelf --dynamic build-64.gold/gettext-runtime/libasprintf/.libs/libasprintf.so | grep PATH


Therefore, I'm closing this ticket as "works for me".

Nevertheless, here are two more findings:

2) When I look at your gettext-runtime/libasprintf/config.log, I see the lines

configure:11347: checking for ld used by /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-g++
configure:11414: result: /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-ld -m elf_x86_64 -m elf_x86_64

That is, the libtool configuration guessed wrong about the linker. The reason is that you have put the -fuse-ld=gold option into the LDFLAGS, not the CC and CXX variables. The documentation at https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/html_node/Preset-Output-Variables.html says "one approach is to put the option into CC. Another is to put it into both CPPFLAGS and LDFLAGS, but not into CFLAGS." But apparently for this particular option, putting it into CC and CXX is the better choice.

3) In the same file, I also see the lines

configure:13157: checking if /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-g++ static flag -static works
configure:13185: result: no

That result should be 'yes'. This points to an issue with your cross-compiler installation.

Bruno Haible <haible>
Group administrator
Sat 08 Jan 2022 06:47:48 AM UTC, comment #2: 

Hi Bruno,

Hope this helps.

Buildhost:
ubuntu 20.04.3 LTS

Target:
Operating system: LibreELEC - https://github.com/LibreELEC/LibreELEC.tv
LibreELEC 11 - PROJECT=Generic ARCH=x86_64

Using :master + https://github.com/LibreELEC/LibreELEC.tv/pull/6094/commits/0e089928bf92d7f62acd05b96d5566984013ca55

- GNU gold
- GCC 10.2.0
- binutils 2.37
- GLIBC 2.34

all config.log attached in the tar.
buildlog.txt includes both the HOST and the TARGET build. The TARGET build it the one that we are removing RPATH/RUNPATH from.

This was identified as part of the RPATH clean up in the distro https://github.com/LibreELEC/LibreELEC.tv/pull/6094

(file #52626)

Rudi Heitbaum <heitbaum>
Sat 08 Jan 2022 06:24:01 AM UTC, comment #1: 

What's the platform name (esp. operating system and version), the linker used (GNU ld, GNU gold, LLVM lld, etc.), and libc type?

Bruno Haible <haible>
Group administrator
Sat 08 Jan 2022 03:30:48 AM UTC, original submission:  


The libtool in "gettext-runtime/libasprintf/libtool" does not honour the --disable-rpath option of configure.

Output:

readelf --dynamic libasprintf.so.0.0.0 | grep PATH
 0x000000000000001d (RUNPATH)            Library runpath: [/build/LibreELEC.tv/build.LibreELEC-Generic.x86_64-11.0-devel/toolchain/lib]

The following post-configure works around this.
 
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' gettext-runtime/libasprintf/libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' gettext-runtime/libasprintf/libtool

Rudi Heitbaum <heitbaum>

 

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

Attached Files
file #52626:  config.tar added by heitbaum (2MiB - application/x-tar)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by heitbaum (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.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-25 haible StatusNeed Info Works For Me
        Assigned toNone haible
        Open/ClosedOpen Closed
    2022-01-08 heitbaum Attached File- Added config.tar, #52626
    2022-01-08 haible StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code