bugmake - Bugs: bug #59096, The built in rule for archives...

 
 

bug #59096: The built in rule for archives fails on aix.

Submitter:  Dmitry Goncharov <dgoncharov>
Submitted:  Thu 10 Sep 2020 11:40:31 PM UTC
   
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  None Operating System:  None
Fixed Release:  4.4 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 29 Nov 2020 11:10:40 PM UTC, comment #2: 

I applied a fix for this issue but used a different solution: I want users to be able to override without having to redefine the entire rule.

Paul D. Smith <psmith>
Group administrator
Thu 10 Sep 2020 11:43:58 PM UTC, comment #1: 

This is a patch which fixes this rule.

diff --git a/src/default.c b/src/default.c
index 751ea15..7d31355 100644
--- a/src/default.c
+++ b/src/default.c
@@ -71,6 +71,9 @@ static struct pspec default_pattern_rules[] =

 #else
     { "(%)", "%",
+#ifdef _AIX
+        "OBJECT_MODE=any "
+#endif
         "$(AR) $(ARFLAGS) $@ $<" },
 #endif
     /* The X.out rules are only in BSD's default set because

Dmitry Goncharov <dgoncharov>
Thu 10 Sep 2020 11:40:31 PM UTC, original submission:  

$ cat makefile
all: libhello.a(a.o)
%.o: %.c
        $(CC) -c -maix64 $<
a.c:
        echo 'static int a;' >$@
$
$ make
gcc -c -maix64 a.c
ar rv libhello.a a.o
ar: Creating an archive file libhello.a.
a - a.o
ar: 0707-126 a.o is not valid with the current object file mode.
        Use the -X option to specify the desired object mode.
<builtin>: recipe for target 'libhello.a(a.o)' failed
make: * [libhello.a(a.o)] Error 1
rm a.o
$

Aix ar requires an option to specify the object file format.

Quote from
https://www.ibm.com/support/knowledgecenter/ssw_aix_72/a_commands/ar.html


"-X mode Specifies the type of object file ar should examine. The mode must be one of the following:
32
Processes only 32-bit object files
64
Processes only 64-bit object files
32_64
Processes both 32-bit and 64-bit object files
d64
Examines discontinued 64-bit XCOFF files (magic number == U803XTOCMAGIC).
any
Processes all of the supported object files.
The default is to process 32-bit object files (ignore 64-bit objects). The mode can also be set with the OBJECT_MODE environment variable. For example, OBJECT_MODE=64 causes ar to process any 64-bit objects and ignore 32-bit objects. The -X flag overrides the OBJECT_MODE variable."


Dmitry Goncharov <dgoncharov>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by dgoncharov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-29 psmith Item GroupNone Enhancement
        StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.4

    Back to the top

    Powered by Savane 3.14-fc07.
    Corresponding source code