Andrew Dunstan <[email protected]> writes:
> For OSX we'd construct the list via File::Find to recurse through the
> directories.
> So, something like this:
Thanks for the tips. The attached patch against buildfarm 4.11 seems
to work, cf
http://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=dromedary&dt=2014-04-03%2003%3A33%3A16&stg=typedefs
I tried it on current OSX (10.9.2) as well as dromedary's 10.6.8.
It does not work on prairiedog (10.4.11) --- the debug info format
seems to be different that far back. Can't say that's worth worrying
about.
regards, tom lane
*** build-farm-4.11/run_build.pl~ Fri Jun 14 09:05:52 2013
--- build-farm-4.11/run_build.pl Wed Apr 2 23:31:27 2014
***************
*** 1506,1520 ****
my $objdump = $host || 'objdump';
my @err = `$objdump -W 2>&1`;
my @readelferr = `readelf -w 2>&1`;
my %syms;
my @dumpout;
my @flds;
! foreach my $bin (
! glob("$installdir/bin/*"),
! glob("$installdir/lib/*"),
! glob("$installdir/lib/postgresql/*")
! )
{
next if $bin =~ m!bin/(ipcclean|pltcl_)!;
next unless -f $bin;
--- 1506,1536 ----
my $objdump = $host || 'objdump';
my @err = `$objdump -W 2>&1`;
my @readelferr = `readelf -w 2>&1`;
+ my $using_osx = (`uname` eq "Darwin\n");
+ my @testfiles;
my %syms;
my @dumpout;
my @flds;
! if ($using_osx)
! {
! # On OS X, we need to examine the .o files
! my $obj_wanted = sub {
! /^.*\.o\z/s && push(@testfiles, $File::Find::name);
! };
!
! File::Find::find($obj_wanted,$pgsql);
! }
! else
! {
! # Elsewhere, look at the installed executables and shared libraries
! @testfiles = (
! glob("$installdir/bin/*"),
! glob("$installdir/lib/*"),
! glob("$installdir/lib/postgresql/*")
! );
! }
! foreach my $bin (@testfiles)
{
next if $bin =~ m!bin/(ipcclean|pltcl_)!;
next unless -f $bin;
***************
*** 1534,1540 ****
}
elsif ( @readelferr > 10 )
{
-
# FreeBSD, similar output to Linux
@dumpout =
`readelf -w $bin 2>/dev/null | egrep -A3 DW_TAG_typedef 2>/dev/null`;
--- 1550,1555 ----
***************
*** 1546,1551 ****
--- 1561,1579 ----
$syms{$flds[-1]} =1;
}
}
+ elsif ($using_osx)
+ {
+ @dumpout =
+ `dwarfdump $bin 2>/dev/null | egrep -A2 TAG_typedef 2>/dev/null`;
+ foreach (@dumpout)
+ {
+ @flds = split;
+ next unless (@flds == 3);
+ next unless ($flds[0] eq "AT_name(");
+ next unless ($flds[1] =~ m/^"(.*)"$/);
+ $syms{$1} =1;
+ }
+ }
else
{
@dumpout = `$objdump --stabs $bin 2>/dev/null`;
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers