Ticket #854 (closed cage: fixed)
config/inter/progs.pm: Figure out why -libpath: needs to be removed from $linkflags and $ldflags
Reported by: | jkeenan | Owned by: | jkeenan |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | configure | Version: | 1.3.0 |
Severity: | low | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: |
Description
This ticket is being transferred from RT #43174. It holds a June 2007 ticketization by Paul T Cochrane of two inline comments found in config/inter/progs.pm.
Original description: In the file config/inter/progs.pm, there are two comments making the point that it is not understood why the string '-libpath:\S+' needs to be removed from the $linkflags and $ldflags variables. Why does it need to be removed? It doesn't seem from the code that anything nspecial needs to happen, but some more understanding would be nice.
Here is the relevant code from config/inter/progs.pm:
$linkflags = $conf->data->get('linkflags'); $linkflags =~ s/-libpath:\S+//g; # RT#43174 No idea why. $linkflags = integrate( $linkflags, $conf->options->get('linkflags') ); $linkflags = prompt( "And flags for your linker?", $linkflags ) if $ask; $conf->data->set( linkflags => $linkflags ); $ldflags = $conf->data->get('ldflags'); $ldflags =~ s/-libpath:\S+//g; # RT#43174 No idea why. $ldflags = integrate( $ldflags, $conf->options->get('ldflags') ); $ldflags = prompt( "And your $ld flags for building shared libraries?", $ldflags ) if $ask; $conf->data->set( ldflags => $ldflags );
The Parrot::Configure object's linkflags and ldflags settings are originally set in config/init/defaults.pm, where each is picked up from the Perl 5 %Config settings for ldflags and possibly modified later in that same module to account for 64-bit platform differences.
So, to resolve the question in this ticket, we would have to ask:
1. Under what circumstances would the Perl 5 $Config{ldflags} contain a string matching qr/-libpath:\S+/?
2. What is the harm caused by leaving a string matching that pattern in Parrot::Configure's linkflags or ldflags attributes?
Now, I don't claim to know the answers to either question. But Internet searching suggests that in this context libpath is something encountered mainly on AIX. See, for example this page from the Linux Documentation Project or this one from Apache. Let me quote from the latter:
On UNIX platforms you must ensure that LIBPATH environment variable is set properly to pick up the shared libraries at runtime. (UNIX gurus will understand here that LIBPATH actually translates to LD_LIBRARY_PATH on Solaris and Linux, SHLIB_PATH on HP-UX, DYLD_LIBRARY_PATH on Mac OS X, and stays as LIBPATH on AIX).
So I suspect that this regex substitution was introduced by someone familiar with AIX.
But I'm just speculating. Can anyone offer something better?
Thank you very much.
kid51