Bug 14595 - Some binaries have rpaths compiled into them causing RPM build to fail
: Some binaries have rpaths compiled into them causing RPM build to fail
Status: RESOLVED WONTFIX
Product: Logitech Media Server
Classification: Unclassified
Component: RPM
: 7.4.1
: PC RedHat Linux
: P3 normal (vote)
: 7.6.0
Assigned To: Mark Miksis
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-06 02:06 UTC by Robin Bowes
Modified: 2019-01-25 10:41 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Bowes 2009-10-06 02:06:34 UTC
Building on CentOS 5.3 x86_64 from 7.4/trunk, using buildme.pl as follows:

$(pwd)/buildme.pl --build rpm --buildDir /tmp/scbuild/ --sourceDir $(pwd) --destDir ~/rpmbuild/RPMS/

Throws the following warnings, before failing:

+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
*******************************************************************************
*
* WARNING: 'check-rpaths' detected a broken RPATH and will cause 'rpmbuild'
*          to fail. To ignore these errors, you can set the '$QA_RPATHS'
*          environment variable which is a bitmask allowing the values
*          below. The current value of QA_RPATHS is 0x0000.
*
*    0x0001 ... standard RPATHs (e.g. /usr/lib); such RPATHs are a minor
*               issue but are introducing redundant searchpaths without
*               providing a benefit. They can also cause errors in multilib
*               environments.
*    0x0002 ... invalid RPATHs; these are RPATHs which are neither absolute
*               nor relative filenames and can therefore be a SECURITY risk
*    0x0004 ... insecure RPATHs; these are relative RPATHs which are a
*               SECURITY risk
*    0x0008 ... the special '$ORIGIN' RPATHs are appearing after other
*               RPATHs; this is just a minor issue but usually unwanted
*    0x0010 ... the RPATH is empty; there is no reason for such RPATHs
*               and they cause unneeded work while loading libraries
*    0x0020 ... an RPATH references '..' of an absolute path; this will break
*               the functionality when the path before '..' is a symlink
*          
*
* Examples:
* - to ignore standard and empty RPATHs, execute 'rpmbuild' like
*   $ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild my-package.src.rpm
* - to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths like
*   $ RPM_BUILD_ROOT=<top-dir> /usr/lib/rpm/check-rpaths
*  
*******************************************************************************
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/x86_64-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/x86_64-linux-thread-multi/auto/GD/GD.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/i386-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/i386-linux-thread-multi/auto/GD/GD.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/i386-freebsd-64int/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0002: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/i386-freebsd-64int/auto/GD/GD.so' contains an invalid rpath '/usr/local/lib' in [/usr/local/lib:/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/i386-freebsd-64int/auto/GD/GD.so' contains a standard rpath '/usr/lib' in [/usr/local/lib:/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/i386-freebsd-64int/auto/EV/EV.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/i386-freebsd-64int/auto/DBD/mysql/mysql.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/x86_64-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/i386-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
error: Bad exit status from /var/tmp/rpm-tmp.83620 (%install)
    Bad exit status from /var/tmp/rpm-tmp.83620 (%install)
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.27708
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.83620
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.83620


RPM build errors:
INFO: Moving /tmp/scbuild//rpm/RPMS/noarch/*.rpm to /home/robin/rpmbuild/RPMS/
mv: cannot stat `/tmp/scbuild//rpm/RPMS/noarch/*.rpm': No such file or directory

This can be worked around as suggested in the output from check-rpaths:

export QA_RPATHS=$[ 0x0001|0x0010|0x0002 ] ;  $(pwd)/buildme.pl --build rpm --buildDir /tmp/scbuild/ --sourceDir $(pwd) --destDir ~/rpmbuild/RPMS

But, the rpaths should be fixed in those binaries.
Comment 1 SVN Bot 2009-10-06 04:56:14 UTC
 == Auto-comment from SVN commit #28783 to the slim repo by fletch ==
 == https://svn.slimdevices.com/slim?view=revision&revision=28783 ==

Bug 14595 partial - remove freebsd stuff from RPM
Comment 2 Mark Miksis 2009-10-06 05:07:10 UTC
Andy, I fixed the freebsd part by excluding them from the RPM.  I'm not sure if you want to recompile the others or just use chrpath.
Comment 3 Andy Grundman 2009-10-06 08:09:04 UTC
Grr, CentOS drives me nuts with this stupid error.

Anyway, the right solution is to update buildme.sh to build the modules correctly.  Want to take a crack at that Robin?
Comment 4 Mark Miksis 2009-10-06 08:14:59 UTC
(In reply to comment #3)
> Grr, CentOS drives me nuts with this stupid error.
> 
> Anyway, the right solution is to update buildme.sh to build the modules
> correctly.  Want to take a crack at that Robin?

Are you saying that we should build the binary perl modules at RPM build time, or that we should do what we are doing now, and work around the error message?  I agree with the former...
Comment 5 Robin Bowes 2009-10-06 08:36:21 UTC
buildme.sh, or buildme.pl?

Fletch, I would say neither option.

I don't think that those modules should be built when the RPM is created - they are checked into svn.

I don't think we should work around the problem

Option 3 is: whatever the process is for building the binary modules, it should be and corrected to build them correctly.

This link may be useful: http://fedoraproject.org/wiki/Extras/Schedule/RpathCheckBuildsys

R.
Comment 6 Andy Grundman 2009-10-06 08:56:26 UTC
build-perl-modules is dead.  buildme.sh is the way to build modules now, it's in trunk/vendor/CPAN.

Yes the correct option is to fix the build script, rebuild the modules, and check them in over the bad versions.
Comment 7 Chris Owens 2010-03-15 18:06:41 UTC
7.4.x milestone is in the past
Comment 8 Andy Grundman 2011-01-14 13:28:13 UTC
Is this still an issue? Please reopen if so.
Comment 9 Robin Bowes 2011-01-14 13:49:16 UTC
It's not fixed:

This is from building 7.6 trunk:

+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
*******************************************************************************
*
* WARNING: 'check-rpaths' detected a broken RPATH and will cause 'rpmbuild'
*          to fail. To ignore these errors, you can set the '$QA_RPATHS'
*          environment variable which is a bitmask allowing the values
*          below. The current value of QA_RPATHS is 0x0000.
*
*    0x0001 ... standard RPATHs (e.g. /usr/lib); such RPATHs are a minor
*               issue but are introducing redundant searchpaths without
*               providing a benefit. They can also cause errors in multilib
*               environments.
*    0x0002 ... invalid RPATHs; these are RPATHs which are neither absolute
*               nor relative filenames and can therefore be a SECURITY risk
*    0x0004 ... insecure RPATHs; these are relative RPATHs which are a
*               SECURITY risk
*    0x0008 ... the special '$ORIGIN' RPATHs are appearing after other
*               RPATHs; this is just a minor issue but usually unwanted
*    0x0010 ... the RPATH is empty; there is no reason for such RPATHs
*               and they cause unneeded work while loading libraries
*    0x0020 ... an RPATH references '..' of an absolute path; this will break
*               the functionality when the path before '..' is a symlink
*          
*
* Examples:
* - to ignore standard and empty RPATHs, execute 'rpmbuild' like
*   $ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild my-package.src.rpm
* - to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths like
*   $ RPM_BUILD_ROOT=<top-dir> /usr/lib/rpm/check-rpaths
*  
*******************************************************************************
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.12/x86_64-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.12/x86_64-linux-thread-multi/auto/Image/Scale/Scale.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.12/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.12/x86_64-linux-thread-multi/auto/DBD/SQLite/SQLite.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.12/i386-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.12/i386-linux-thread-multi/auto/Image/Scale/Scale.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.12/i386-linux-thread-multi/auto/DBD/mysql/mysql.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.12/i386-linux-thread-multi/auto/DBD/SQLite/SQLite.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/x86_64-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/x86_64-linux-thread-multi/auto/Image/Scale/Scale.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/x86_64-linux-thread-multi/auto/DBD/SQLite/SQLite.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/i386-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/i386-linux-thread-multi/auto/Image/Scale/Scale.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.10/i386-linux-thread-multi/auto/DBD/SQLite/SQLite.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/arm-linux-gnueabi-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/arm-linux-gnueabi-thread-multi/auto/Image/Scale/Scale.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/arm-linux-gnueabi-thread-multi/auto/DBD/mysql/mysql.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/arm-linux-gnueabi-thread-multi/auto/DBD/SQLite/SQLite.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/powerpc-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/powerpc-linux-thread-multi/auto/Image/Scale/Scale.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/powerpc-linux-thread-multi/auto/DBD/mysql/mysql.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/powerpc-linux-thread-multi/auto/DBD/SQLite/SQLite.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/x86_64-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/x86_64-linux-thread-multi/auto/Image/Scale/Scale.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/x86_64-linux-thread-multi/auto/DBD/SQLite/SQLite.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/i386-linux-thread-multi/auto/Audio/Scan/Scan.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/i386-linux-thread-multi/auto/Image/Scale/Scale.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/share/squeezeboxserver/CPAN/arch/5.8/i386-linux-thread-multi/auto/DBD/SQLite/SQLite.so' contains a standard rpath '/usr/lib' in [/usr/lib]
error: Bad exit status from /var/tmp/rpm-tmp.55625 (%install)
    Bad exit status from /var/tmp/rpm-tmp.55625 (%install)
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.9072
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.55625
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.55625
Comment 10 Andy Grundman 2011-01-14 13:55:01 UTC
OK thanks.  Will need to add rpath-removal code to buildme.sh.
Comment 11 Mark Miksis 2011-01-14 13:55:56 UTC
See bug 8232 for more info.  Andy used chrpath --delete to fix this the last time.
Comment 12 Mickey Gee 2011-05-23 09:26:56 UTC
I need to rebuild all Linux binaries/modules using updated scripts to remove rpath. This is an annoying RedHat "feature"
Comment 13 Mickey Gee 2011-05-26 09:23:06 UTC
Hey Mark, can you help on this one? thanks!
Comment 14 Mark Miksis 2011-05-26 13:34:51 UTC
(In reply to comment #13)
> Hey Mark, can you help on this one? thanks!

Hi Mickey,

I'm not sure what I can do.  I have never built the perl module binaries and do not have the source or scripts to do so.  As I mentioned in comment 11, bug 8232 contains more information on the issue and what Andy did to fix this the last time.  As far as I know, the same fix should still work.
Comment 15 Andy Grundman 2011-05-27 16:13:46 UTC
The buildme.sh script and all source is at http://svn.slimdevices.com/repos/slim/7.6/trunk/vendor/CPAN/

I build all Linux binaries on Debian VMs, so it's probably a matter of adding a call to chrpath to the build script in the right places.