From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 19 Jan 2007 16:57:13 +0300 From: Alexey Tourbin To: devel@lists.altlinux.org Message-ID: <20070119135713.GU7811@localhost.localdomain> Mail-Followup-To: devel@lists.altlinux.org References: <45B095D5.1010609@elan.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s84eBR/zx33jl1qi" Content-Disposition: inline In-Reply-To: <45B095D5.1010609@elan.com.ua> Subject: Re: [devel] =?koi8-r?b?cGVybCBNYWtlZmlsZS5QTCDQ0s/QydPZ18HF1CBMRF9S?= =?koi8-r?b?VU5fUEFUSA==?= X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.9rc1 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2007 13:57:18 -0000 Archived-At: List-Archive: List-Post: --s84eBR/zx33jl1qi Content-Type: multipart/mixed; boundary="DhmH2k3MviYEy8Fq" Content-Disposition: inline --DhmH2k3MviYEy8Fq Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 19, 2007 at 11:56:37AM +0200, Slava Dubrovskiy wrote: > =E9 =CB=C1=CB =D2=C5=DA=D5=CC=D8=D4=C1=D4 > $readelf -d blib/arch/auto/Graphics/Magick/Magick.so | grep RPATH > 0x0000000f (RPATH) Library rpath: > [/home/slava/RPM/BUILD/GraphicsMagick-1.1.7/PerlMagick/../magick/.libs] =EB=D3=D4=C1=D4=C9 =D7=CF=D4: http://www.security-mob.com/my_smob/alert_info.asp?alert=3D29136 =F7 =D2=C5=C4=C8=C1=D4=CF=D7=D3=CB=CF=CA =D3=C2=CF=D2=CB=C5 LD_RUN_PATH =D7= =CF=CF=C2=DD=C5 =CF=D4=CF=D2=D7=C1=CC=C9 =D0=CF =D5=CD=CF=CC=DE=C1=CE=C9=C0. =EE=C5 =DA=CE=C1=C0 =C8=CF=D2=CF=DB=CF =DC=D4=CF =C9=CC=C9 =D0=CC=CF=C8=CF. --DhmH2k3MviYEy8Fq Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="perl-5.8.7-USE_MM_LD_RUN_PATH.patch" Content-Transfer-Encoding: quoted-printable --- perl-5.8.7/lib/ExtUtils/MakeMaker.pm.USE_MM_LD_RUN_PATH 2005-12-08 15:1= 0:24.000000000 -0500 +++ perl-5.8.7/lib/ExtUtils/MakeMaker.pm 2005-12-08 19:36:26.000000000 -0500 @@ -226,7 +226,7 @@ PERL_SRC PERM_RW PERM_RWX PL_FILES PM PM_FILTER PMLIBDIRS POLLUTE PPM_INSTALL_EXEC PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ - SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG + SKIP TYPEMAPS USE_MM_LD_RUN_PATH VERSION VERSION_FROM XS XSOPT XSPROTO= ARG XS_VERSION clean depend dist dynamic_lib linkext macro realclean tool_autosplit =20 @@ -362,7 +362,27 @@ print join(" ", map { "perl($_)>=3D$self->{PREREQ_PM}->{$_} " }=20 sort keys %{$self->{PREREQ_PM}}), "\n"; exit 0; - } + } + =20 + # USE_MM_LD_RUN_PATH - another RedHatism to disable automatic RPATH ge= neration + if ( ( ! $self->{USE_MM_LD_RUN_PATH} ) + &&( ("@ARGV" =3D~ /\bUSE_MM_LD_RUN_PATH(=3D([01]))?\b/) + ||( exists( $ENV{USE_MM_LD_RUN_PATH} )=20 + &&( $ENV{USE_MM_LD_RUN_PATH} =3D~ /([01])?$/ ) + ) + ) + ) + { + my $v =3D $1; + if( $v ) + { + $v =3D ($v=3D~/=3D([01])$/)[0]; + }else + { + $v =3D 1; + }; + $self->{USE_MM_LD_RUN_PATH}=3D$v; + } =20 print STDOUT "MakeMaker (v$VERSION)\n" if $Verbose; if (-f "MANIFEST" && ! -f "Makefile"){ @@ -2007,6 +2027,40 @@ precedence, even if it isn't listed in TYPEMAPS. The default system typemap has lowest precedence. =20 +=3Ditem USE_MM_LD_RUN_PATH + +boolean +The Red Hat perl MakeMaker distribution differs from the standard=20 +upstream release in that it disables use of the MakeMaker generated +LD_RUN_PATH by default, UNLESS this attribute is specified , or the +USE_MM_LD_RUN_PATH environment variable is set during the MakeMaker run. + +The upstream MakeMaker will set the ld(1) environment variable LD_RUN_PATH= =20 +to the concatenation of every -L ld(1) option directory in which a -l ld(1) +option library is found, which is used as the ld(1) -rpath option if none= =20 +is specified. This means that, if your application builds shared libraries= =20 +and your MakeMaker application links to them, that the absolute paths of t= he +libraries in the build tree will be inserted into the RPATH header of all= =20 +MakeMaker generated binaries, and that such binaries will be unable to lin= k=20 +to these libraries if they do not still reside in the build tree directori= es=20 +(unlikely) or in the system library directories (/lib or /usr/lib), regard= less=20 +of any LD_LIBRARY_PATH setting. So if you specified -L../mylib -lmylib , a= nd + your 'libmylib.so' gets installed into /some_directory_other_than_usr_lib, + your MakeMaker application will be unable to link to it, even if LD_LIBRA= RY_PATH=20 +is set to include /some_directory_other_than_usr_lib, because RPATH overri= des +LD_LIBRARY_PATH. + +So for Red Hat MakeMaker builds LD_RUN_PATH is NOT generated by default for +every link. You can still use explicit -rpath ld options or the LD_RUN_PATH +environment variable during the build to generate an RPATH for the binarie= s. +=20 +You can set the USE_MM_LD_RUN_PATH attribute to 1 on the MakeMaker command +line or in the WriteMakefile arguments to enable generation of LD_RUN_PATH +for every link command.=20 + +USE_MM_LD_RUN_PATH will default to 1 (LD_RUN_PATH will be used) IF the=20 +$USE_MM_LD_RUN_PATH environment variable is set during a MakeMaker run.=20 + =3Ditem VENDORPREFIX =20 Like PERLPREFIX, but only for the vendor install locations. --- perl-5.8.7/lib/ExtUtils/MM_Unix.pm.USE_MM_LD_RUN_PATH 2005-12-08 15:10:= 24.000000000 -0500 +++ perl-5.8.7/lib/ExtUtils/MM_Unix.pm 2005-12-08 18:35:13.000000000 -0500 @@ -1142,7 +1142,7 @@ } =20 my $ld_run_path_shell =3D ""; - if ($self->{LD_RUN_PATH} ne "") { + if (($self->{LD_RUN_PATH} ne "") && ($self->{USE_MM_LD_RUN_PATH})) { $ld_run_path_shell =3D 'LD_RUN_PATH=3D"$(LD_RUN_PATH)" '; } push(@m, --- perl-5.8.7/lib/ExtUtils/Liblist.pm.USE_MM_LD_RUN_PATH 2003-04-07 14:58:= 17.000000000 -0400 +++ perl-5.8.7/lib/ExtUtils/Liblist.pm 2005-12-08 19:39:28.000000000 -0500 @@ -51,6 +51,8 @@ specifics below. The list of the filenames is returned only if $need_names argument is true. =20 +NOTE: if the LD_RUN_PATH me + Dependent libraries can be linked in one of three ways: =20 =3Dover 2 @@ -87,6 +89,11 @@ in LDLOADLIBS. It is passed as an environment variable to the process that links the shared library. =20 +Red Hat extension: This generation of LD_RUN_PATH is disabled by default. +To use the generated LD_RUN_PATH for all links, set the USE_MM_LD_RUN_PATH +MakeMaker object attribute / argument, (or set the $USE_MM_LD_RUN_PATH +environment variable).=20 + =3Dhead2 BSLOADLIBS =20 List of those libraries that are needed but can be linked in --DhmH2k3MviYEy8Fq-- --s84eBR/zx33jl1qi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFFsM45fBKgtDjnu0YRApatAJ9XX93ERk3VBxBYkLtHUUgqr/ci+QCgs4FM rTjjscysRy1h7isVKEoE0tc= =VXyR -----END PGP SIGNATURE----- --s84eBR/zx33jl1qi--