build/2220: Build does not respect AR_FLAGS env. variable, fails

skunk@iSKUNK.ORG skunk@iSKUNK.ORG
Tue Jan 16 19:48:00 GMT 2007


>Number:         2220
>Category:       build
>Synopsis:       Build does not respect AR_FLAGS env. variable, fails
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 16 19:48:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     skunk@iSKUNK.ORG
>Release:        gdb-6.6
>Organization:
>Environment:
AIX 5.3 (64-bit)
>Description:
When building 64-bit static libraries on AIX, ar(1) must be explicitly told to take 64-bit objects, otherwise it expects 32-bit input and chokes if it doesn't see same.

As such, I normally set AR_FLAGS="-X64 cru" in my environment, which addresses the problem cleanly with most autotoolized packages. The GDB build system, however, seems to use AR_FLAGS="rc" unconditionally---leading to an immediate build failure:

...
rm -f ./libiberty.a pic/./libiberty.a
ar rc ./libiberty.a \
  ./regex.o ./cplus-dem.o ./cp-demangle.o ...
ar: 0707-126 ./regex.o is not valid with the current object file mode.
        Use the -X option to specify the desired object mode.
ar: 0707-126 ./cplus-dem.o is not valid with the current object file mode.
        Use the -X option to specify the desired object mode.
...
gmake[2]: *** [libiberty.a] Error 53
gmake[2]: Leaving directory `/tmp/gdb-6.6.build/libiberty'
gmake[1]: *** [all-libiberty] Error 2
gmake[1]: Leaving directory `/tmp/gdb-6.6.build'
gmake: *** [all] Error 2
>How-To-Repeat:

>Fix:
Don't set AR_FLAGS to a literal value in the makefile templates; handle it as another autoconf substitution.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gdb-prs mailing list