Subject: New AIX transforms
To: None <tech-pkg@netbsd.org>
From: Peter Schmiedeskamp <pschmied@yahoo.com>
List: tech-pkg
Date: 03/09/2005 10:19:25
Hi, Grant.  I just noticed that you committed a bunch
of wrappers for AIX back in Feb.  Is this ready for
testing?  If so, I'm running into a couple of problems
that I think may be related.

My testing environment is a p610 running AIX 5.3
patchset 1.

==========================
Attempt with XLC
==========================
First, I started clean (rm -rf /usr/pkg; rm -rf
/var/db/pkg then bootstrap). 

My mk.conf file looks like this:

PKG_DBDIR=/var/db/pkg
LOCALBASE=/usr/pkg
FETCH_CMD=/usr/pkg/bin/ftp
PAX=/usr/pkg/bin/pax
SED=/usr/pkg/bin/nbsed
CC=/usr/bin/xlc
CHECK_SHLIBS=no
GCC_REQD=3.0
CONFIG_SHELL=/opt/freeware/bin/bash
MAKE_FLAGS+="-j2"
CLEANDEPENDS=YES


The bootstrap fails with the following:
        /usr/bin/xlc *.o -o bmake.boot 
-L../libnbcompat -lnbcompat
        rm -f *.[ado] */*.[ado] 
        CC="/usr/bin/xlc" MAKEFLAGS=""
MAKESYSPATH=/usr/pkg/share/mk ./bmake.boot -f Makefile

/usr/bin/xlc -O -I. -I. -DHAVE_CONFIG_H 
-I../libnbcompat -I./missing -DNEED_HOST_CDEFS_H
"-D_PATH_DEFSYSPATH=\"/usr/pkg/share/mk\""  
-DSIGNAL_FLAGS=SA_RESTART  -Werror   -c arch.c
/usr/bin/xlc: 1501-210 command option Werror contains
an incorrect subargument
*** Error code 40

Stop.
bmake.boot: stopped in
/usr/pkgsrc/bootstrap/work/bmake
make: 1254-004 The error code from the last command is
1.


Stop.
===> exited with status 2
aborted.

As it says, the error is with the -Werror flag that is
passed to XLC at this point.  If I comment the
"CFLAGS+= -Werror" directive out of the
bootstrap/bmake/mk/bsd.sys.mk file, bootstrap works
cleanly.

I suspect, however, that the solution is not to just
take this flag out but instead to create a case for if
xlc rather than gcc is used. There is probably a
correct place to set whether or not this flag gets set
for XLC, but I don't know where this would be.  Any
thoughts?

--------- Post-bootstrap: XLC ----------
I first symlink a working zcat to /usr/pkg/bin/zcat
(this is a known issue if I recall correctly).

I then build / install "devel/patch"

I then attempt to build "archivers/gzip" so that I can
replace my zcat.  I encounter the following problem:

Pkgsrc attempts to build gcc, gmake as a dependency. 
During the toolchain wrapper portion of the gmake
install, an error occurs:

===> Creating toolchain wrappers for gmake-3.80nb4
/bin/sh:
/usr/pkgsrc/devel/gmake/work/.wrapper/tmp/gen-reorder:
 not found.
*** Error code 127

Stop.
bmake: stopped in /usr/pkgsrc/devel/gmake
*** Error code 1

I verified that "gen-reorder" does not exist in
work/.wrapper/tmp/.  I don't know when or from whence
gen-reorder is created.


=======================
Attempt with GCC
=======================
My gcc is 3.4.3 and was hand-built on this machine.

Again, I start with a clean build (rm -rf /usr/pkg; rm
-rf /var/db/pkg; ./cleanup)

I modify my mk.conf:
PKG_DBDIR=/var/db/pkg
LOCALBASE=/usr/pkg
FETCH_CMD=/usr/pkg/bin/ftp
PAX=/usr/pkg/bin/pax
SED=/usr/pkg/bin/nbsed
CC=/usr/gcc34/bin/gcc
CHECK_SHLIBS=no
GCC_REQD=3.0
CONFIG_SHELL=/opt/freeware/bin/bash
MAKE_FLAGS+="-j2"
CLEANDEPENDS=YES

The bootstrap works cleanly with this configuration.

------------ Post bootstrap: GCC --------------
My first step is to build "devel/patch"

I attempt to build and get the following error:

===> Creating toolchain wrappers for patch-2.5.4nb2
/bin/sh:
/usr/pkgsrc/devel/patch/work/.wrapper/tmp/gen-reorder:
 not found.
*** Error code 127

This seems to be related to the error that I get when
building gmake with XLC.  I'm not sure of from where
work/.wrapper/tmp/gen-reorder is built.


---------------------
Let me know if there is anything else I can provide. 
I just wanted to provide feedback since there had
recently been some changes to AIX support.

-Peter

--- grant beattie <grant@NetBSD.org> wrote:
> On Fri, Feb 18, 2005 at 12:26:50PM -0800, Peter
> Schmiedeskamp wrote:
> 
> > Basically what I did was to add "-Wl," in front of
> > everything that looks like a linker flag.  The
> only
> > potential pitfall of this that I can see is for
> AIX
> > users attempting to use the XLC compiler.  But,
> given
> > that I've had very little success with XLC, it may
> be
> > best to have perl working _some_ way.  I'm not
> sure
> > that this would even break XLC.  Does anybody know
> if
> > XLC cares if linker flags are prepended with
> "-Wl,"?
> 
> hi Peter,
> 
> Tim Rightnour and I have been working on AIX support
> on 4.3 and 5.1
> and we have made good progress. after testing a bit
> more, I'll commit
> some work that should allow a number of packages to
> build without
> modification on AIX.
> 
> AIX-style shared objects work, but dynamic linking
> is not always
> perfect yet. for example, perl builds builds but
> won't run because it
> doesn't get runtime linked against libperl.
> 
> pkgsrc uses toolchain wrappers (see
> pkgsrc/mk/wrapper) to manipulate
> compiler and linker arguments, which should make xlc
> relatively easy
> to support.
> 
> incidentally, the support in pkgsrc for the "xlc"
> compiler actually
> refers to xlc on Darwin, which is a little different
> to xlc on AIX.
> maybe they should become xlc-darwin and xlc-aix or
> something..
> 
> > I submitted the patch and it is being tracked in
> the
> > NetBSD bugtracker as 'pkg/29440'.
> 
> thanks! I've updated the PR to reflect the current
> state.
> 
> grant.
> 
> 


	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/