[ewg] Re: [PATCH] installer: fix build environment for ppc64

Yosef Etigin yosefe at voltaire.com
Wed Sep 19 04:22:17 PDT 2007


Michael S. Tsirkin wrote:
> Will it break build of 32 bit libraries on ppc64?
> 
I don't think so - the 32bit rpmbuild is a different command which is
not affected by this patch.

> Quoting Yosef Etigin <yosefe at voltaire.com>:
> Subject: [PATCH] installer: fix build environment for ppc64
> 
> On ppc64, binaries are compiled as 32 bit by default unless the -m64
> flag is specified. When libs are built for ppc64 they are placed in
> /usr/lib64, despite the fact they are actually 32-bit.
> This pacth forces 64 bit compilation on ppc64.
> 
> Signed-off-by: Yosef Etigin <yosefe at voltaire.com>
> --
> 
> diff --git a/install.pl b/install.pl
> index 7965cf4..5ce2345 100755
> --- a/install.pl
> +++ b/install.pl
> @@ -169,6 +169,8 @@ my $mandir      = `rpm --eval '%{_mandir
>  chomp $mandir;
>  my $sysconfdir  = `rpm --eval '%{_sysconfdir}'`;
>  chomp $sysconfdir;
> +chomp (my $optflags = `rpm --eval '%{optflags}'`);
> +
>  my %main_packages = ();
>  my @selected_packages = ();
>  my @selected_by_user = ();
> @@ -2270,7 +2272,7 @@ # Build RPM from source RPM
>  sub build_rpm
>  {
>      my $name = shift @_;
> -    my $cmd;
> +    my $cmd = "";
>      my $res = 0;
>      my $sig = 0;
>      my $TMPRPMS;
> @@ -2279,7 +2281,10 @@ sub build_rpm
>      print "Build $name RPM\n" if ($verbose);
>  
>      if (not $packages_info{$name}{'rpm_exist'}) {
> -        $cmd = "rpmbuild --rebuild --define '_topdir $TOPDIR'";
> +        if ($arch eq "ppc64") {
> +            $cmd = "CFLAGS='$optflags -m64' CXXFLAGS='$optflags -m64' FFLAGS='$optflags -m64' ";
> +        }
> +        $cmd .= "rpmbuild --rebuild --define '_topdir $TOPDIR'";
>          $cmd .= " --target $target_cpu";
>  
>          if ( $parent eq "mvapich") {
> 


-- 
Yossi




More information about the ewg mailing list