[llvm] cad1782 - [AIX][XCOFF] print unsupported message for llvm-ar big archive write operation
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 1 08:55:40 PDT 2022
Author: zhijian
Date: 2022-04-01T11:55:11-04:00
New Revision: cad178274c0bbf02b10bc50ada9a2d0b02194b9c
URL: https://github.com/llvm/llvm-project/commit/cad178274c0bbf02b10bc50ada9a2d0b02194b9c
DIFF: https://github.com/llvm/llvm-project/commit/cad178274c0bbf02b10bc50ada9a2d0b02194b9c.diff
LOG: [AIX][XCOFF] print unsupported message for llvm-ar big archive write operation
Summary:
when run "llvm-ar cr" on AIX OS , it created a gnu archive, it is not desirable in aix OS.
instead of creating a gnu archive, the patch will print a unsupport message for llvm-ar big archive write operation in AIX OS.
after implement the big archive operation, I will revert the XFAIL: AIX " and "--format=gnu" test cases in the patch.
Reviewer : James Henderson, Jinsong Ji
Differential Revision: https://reviews.llvm.org/D122746
Added:
llvm/test/tools/llvm-ar/Inputs/xcoff.yaml
llvm/test/tools/llvm-ar/default-xcoff.test
Modified:
llvm/test/Object/ar-create.test
llvm/test/Object/archive-extract-dir.test
llvm/test/Object/archive-malformed-object.test
llvm/test/Object/archive-replace-pos.test
llvm/test/Object/archive-unknown-filetype.test
llvm/test/Object/archive-update.test
llvm/test/Object/directory.ll
llvm/test/tools/llvm-ar/count.test
llvm/test/tools/llvm-ar/create.test
llvm/test/tools/llvm-ar/dash-before-letter.test
llvm/test/tools/llvm-ar/delete.test
llvm/test/tools/llvm-ar/display-empty.test
llvm/test/tools/llvm-ar/double-hyphen.test
llvm/test/tools/llvm-ar/error-opening-permission.test
llvm/test/tools/llvm-ar/extract.test
llvm/test/tools/llvm-ar/flatten-thin-archive.test
llvm/test/tools/llvm-ar/full-path-option.test
llvm/test/tools/llvm-ar/full-to-thin-archive.test
llvm/test/tools/llvm-ar/insert-after.test
llvm/test/tools/llvm-ar/insert-before.test
llvm/test/tools/llvm-ar/move-after.test
llvm/test/tools/llvm-ar/move-before.test
llvm/test/tools/llvm-ar/mri-delete.test
llvm/test/tools/llvm-ar/mri-nonascii.test
llvm/test/tools/llvm-ar/non-windows-name-case.test
llvm/test/tools/llvm-ar/plugin.test
llvm/test/tools/llvm-ar/print.test
llvm/test/tools/llvm-ar/quick-append.test
llvm/test/tools/llvm-ar/read-only-archive.test
llvm/test/tools/llvm-ar/response-utf8.test
llvm/test/tools/llvm-ar/thin-to-full-archive.test
llvm/test/tools/llvm-libtool-darwin/archive-flattening.test
llvm/test/tools/llvm-link/archivell.ll
llvm/test/tools/llvm-nm/option-X.test
llvm/test/tools/llvm-readobj/basic.test
llvm/test/tools/llvm-size/archive.test
llvm/tools/llvm-ar/llvm-ar.cpp
Removed:
################################################################################
diff --git a/llvm/test/Object/ar-create.test b/llvm/test/Object/ar-create.test
index 07c9ba4373590..e43603416bb78 100644
--- a/llvm/test/Object/ar-create.test
+++ b/llvm/test/Object/ar-create.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
Test which operations create an archive and which don't.
RUN: touch %t
diff --git a/llvm/test/Object/archive-extract-dir.test b/llvm/test/Object/archive-extract-dir.test
index 67d6781ee0927..e3e6ab4bcf6b2 100644
--- a/llvm/test/Object/archive-extract-dir.test
+++ b/llvm/test/Object/archive-extract-dir.test
@@ -1,3 +1,5 @@
+XFAIL: system-aix
+
RUN: mkdir -p %t
RUN: cd %t
RUN: rm -rf foo
diff --git a/llvm/test/Object/archive-malformed-object.test b/llvm/test/Object/archive-malformed-object.test
index 7d502c3f301d6..bb03ba0e7f75d 100644
--- a/llvm/test/Object/archive-malformed-object.test
+++ b/llvm/test/Object/archive-malformed-object.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Show that the archive library emits error messages when adding malformed
## objects.
diff --git a/llvm/test/Object/archive-replace-pos.test b/llvm/test/Object/archive-replace-pos.test
index 0acead69a1e24..05469709789cd 100644
--- a/llvm/test/Object/archive-replace-pos.test
+++ b/llvm/test/Object/archive-replace-pos.test
@@ -1,3 +1,5 @@
+XFAIL: system-aix
+
Test adding a member to a particular position
RUN: touch %t.foo
diff --git a/llvm/test/Object/archive-unknown-filetype.test b/llvm/test/Object/archive-unknown-filetype.test
index 5647501c51fc1..88b7c36f88040 100644
--- a/llvm/test/Object/archive-unknown-filetype.test
+++ b/llvm/test/Object/archive-unknown-filetype.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Show that the archive library does not emit an error or add any symbols to
## the archive symbol table, when it encounters an unknown file type, but still
## adds the file to the archive.
diff --git a/llvm/test/Object/archive-update.test b/llvm/test/Object/archive-update.test
index e152da5705c16..4af48cada71e8 100644
--- a/llvm/test/Object/archive-update.test
+++ b/llvm/test/Object/archive-update.test
@@ -1,3 +1,5 @@
+XFAIL: system-aix
+
Test the 'u' option of llvm-ar
RUN: rm -rf %t && mkdir -p %t && cd %t
diff --git a/llvm/test/Object/directory.ll b/llvm/test/Object/directory.ll
index b9da6b7ffb7ad..f76d3b9ec1f86 100644
--- a/llvm/test/Object/directory.ll
+++ b/llvm/test/Object/directory.ll
@@ -1,3 +1,5 @@
+; XFAIL: system-aix
+
;RUN: rm -rf %t && mkdir -p %t
;RUN: not llvm-ar r %t/test.a . 2>&1 | FileCheck -DMSG=%errc_EISDIR %s
;CHECK: .: [[MSG]]
diff --git a/llvm/test/tools/llvm-ar/Inputs/xcoff.yaml b/llvm/test/tools/llvm-ar/Inputs/xcoff.yaml
new file mode 100644
index 0000000000000..4893730e50e07
--- /dev/null
+++ b/llvm/test/tools/llvm-ar/Inputs/xcoff.yaml
@@ -0,0 +1,3 @@
+--- !XCOFF
+FileHeader:
+ MagicNumber: 0x1DF
diff --git a/llvm/test/tools/llvm-ar/count.test b/llvm/test/tools/llvm-ar/count.test
index fa6141ff13f39..57c575e64740f 100644
--- a/llvm/test/tools/llvm-ar/count.test
+++ b/llvm/test/tools/llvm-ar/count.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
# Test the 'N' count parameter.
# Get a temp clean cwd to extract into.
diff --git a/llvm/test/tools/llvm-ar/create.test b/llvm/test/tools/llvm-ar/create.test
index a29b93ec5d6da..0b40e05fe4be9 100644
--- a/llvm/test/tools/llvm-ar/create.test
+++ b/llvm/test/tools/llvm-ar/create.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
## Test the creation warning and supression of that warning.
RUN: touch %t1.txt
diff --git a/llvm/test/tools/llvm-ar/dash-before-letter.test b/llvm/test/tools/llvm-ar/dash-before-letter.test
index 43930b1217367..cfe2c6b3f523c 100644
--- a/llvm/test/tools/llvm-ar/dash-before-letter.test
+++ b/llvm/test/tools/llvm-ar/dash-before-letter.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
# Test the use of dash before key letters.
RUN: touch %t1.txt
diff --git a/llvm/test/tools/llvm-ar/default-xcoff.test b/llvm/test/tools/llvm-ar/default-xcoff.test
new file mode 100644
index 0000000000000..25c0a4a7db299
--- /dev/null
+++ b/llvm/test/tools/llvm-ar/default-xcoff.test
@@ -0,0 +1,10 @@
+; REQUIRES: system-aix
+;; Test llvm-ar does not support Big AIX archive write operation.
+
+; RUN: yaml2obj %S/Inputs/xcoff.yaml -o %t.obj
+; RUN: rm -f %t.ar
+; RUN: not llvm-ar cr %t.ar %t.obj 2>&1 | FileCheck %s
+; RUN: echo "test big archive" > %t.txt
+; RUN: not llvm-ar cr %t.ar %t.txt 2>&1 | FileCheck %s
+
+; CHECK: unsupported big AIX write operation
diff --git a/llvm/test/tools/llvm-ar/delete.test b/llvm/test/tools/llvm-ar/delete.test
index 20e58b9a45b57..6bf4481873ba2 100644
--- a/llvm/test/tools/llvm-ar/delete.test
+++ b/llvm/test/tools/llvm-ar/delete.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Test the deletion of members and that symbols are removed from the symbol table.
# RUN: yaml2obj %s -o %t-delete.o --docnum=1
diff --git a/llvm/test/tools/llvm-ar/display-empty.test b/llvm/test/tools/llvm-ar/display-empty.test
index 22310c8db18bf..77a9c8e9d1d2b 100644
--- a/llvm/test/tools/llvm-ar/display-empty.test
+++ b/llvm/test/tools/llvm-ar/display-empty.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Test Display of empty archives.
# RUN: rm -rf %t && mkdir -p %t
diff --git a/llvm/test/tools/llvm-ar/double-hyphen.test b/llvm/test/tools/llvm-ar/double-hyphen.test
index edea626ce7f53..e79165240cf3e 100644
--- a/llvm/test/tools/llvm-ar/double-hyphen.test
+++ b/llvm/test/tools/llvm-ar/double-hyphen.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Test the use of "--" on the commandline
# RUN: echo contents > %t.txt
diff --git a/llvm/test/tools/llvm-ar/error-opening-permission.test b/llvm/test/tools/llvm-ar/error-opening-permission.test
index 4107bdfc044fe..c5da135c39cf8 100644
--- a/llvm/test/tools/llvm-ar/error-opening-permission.test
+++ b/llvm/test/tools/llvm-ar/error-opening-permission.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Unsupported on windows as marking files "unreadable"
## is non-trivial on windows.
# UNSUPPORTED: system-windows
diff --git a/llvm/test/tools/llvm-ar/extract.test b/llvm/test/tools/llvm-ar/extract.test
index fec5e4bb99693..3f36c5af246bb 100644
--- a/llvm/test/tools/llvm-ar/extract.test
+++ b/llvm/test/tools/llvm-ar/extract.test
@@ -1,5 +1,5 @@
## Test extract operation.
-# XFAIL: system-darwin
+# XFAIL: system-darwin,system-aix
# RUN: rm -rf %t && mkdir -p %t/extracted/
diff --git a/llvm/test/tools/llvm-ar/flatten-thin-archive.test b/llvm/test/tools/llvm-ar/flatten-thin-archive.test
index a80edd9d50c76..887b2e27725b3 100644
--- a/llvm/test/tools/llvm-ar/flatten-thin-archive.test
+++ b/llvm/test/tools/llvm-ar/flatten-thin-archive.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
# This test creates a thin archive that contains a thin archive, a regular
# archive, and a file.
#
diff --git a/llvm/test/tools/llvm-ar/full-path-option.test b/llvm/test/tools/llvm-ar/full-path-option.test
index 2ed7b76219963..f24f1a8cafd2d 100644
--- a/llvm/test/tools/llvm-ar/full-path-option.test
+++ b/llvm/test/tools/llvm-ar/full-path-option.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
# Note: many of these tests depend on relative paths, so we have to cd to a
# test directory first.
RUN: mkdir -p %t && cd %t
diff --git a/llvm/test/tools/llvm-ar/full-to-thin-archive.test b/llvm/test/tools/llvm-ar/full-to-thin-archive.test
index 511e0cb743322..8683dd16988fd 100644
--- a/llvm/test/tools/llvm-ar/full-to-thin-archive.test
+++ b/llvm/test/tools/llvm-ar/full-to-thin-archive.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Test archives do not convert to thin archives.
# RUN: rm -rf %t && mkdir -p %t
diff --git a/llvm/test/tools/llvm-ar/insert-after.test b/llvm/test/tools/llvm-ar/insert-after.test
index a3f51a6d4d792..e3540270393cf 100644
--- a/llvm/test/tools/llvm-ar/insert-after.test
+++ b/llvm/test/tools/llvm-ar/insert-after.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
## Test inserting files after a file.
RUN: touch %t1.txt
diff --git a/llvm/test/tools/llvm-ar/insert-before.test b/llvm/test/tools/llvm-ar/insert-before.test
index f2a6bdd4e170f..ffb52b156c382 100644
--- a/llvm/test/tools/llvm-ar/insert-before.test
+++ b/llvm/test/tools/llvm-ar/insert-before.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
## Test inserting files before a file.
RUN: touch %t1.txt
diff --git a/llvm/test/tools/llvm-ar/move-after.test b/llvm/test/tools/llvm-ar/move-after.test
index 8bd83216c6895..da385db4f4a7a 100644
--- a/llvm/test/tools/llvm-ar/move-after.test
+++ b/llvm/test/tools/llvm-ar/move-after.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
## Test moving files after a file.
RUN: touch %t1.txt
diff --git a/llvm/test/tools/llvm-ar/move-before.test b/llvm/test/tools/llvm-ar/move-before.test
index bab8592f8f978..972fc9f33f1f7 100644
--- a/llvm/test/tools/llvm-ar/move-before.test
+++ b/llvm/test/tools/llvm-ar/move-before.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
## Test moving files after a file.
RUN: touch %t1.txt
diff --git a/llvm/test/tools/llvm-ar/mri-delete.test b/llvm/test/tools/llvm-ar/mri-delete.test
index bb829ce13c72c..55e68862a3b89 100644
--- a/llvm/test/tools/llvm-ar/mri-delete.test
+++ b/llvm/test/tools/llvm-ar/mri-delete.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
RUN: yaml2obj %S/Inputs/elf.yaml -o %t.o
RUN: rm -f %t.ar
diff --git a/llvm/test/tools/llvm-ar/mri-nonascii.test b/llvm/test/tools/llvm-ar/mri-nonascii.test
index 2a6888747564b..28b27eb382207 100644
--- a/llvm/test/tools/llvm-ar/mri-nonascii.test
+++ b/llvm/test/tools/llvm-ar/mri-nonascii.test
@@ -1,3 +1,4 @@
+XFAIL: system-aix
# Test non-ascii archive members
RUN: rm -rf %t && mkdir -p %t/extracted
diff --git a/llvm/test/tools/llvm-ar/non-windows-name-case.test b/llvm/test/tools/llvm-ar/non-windows-name-case.test
index 37c53022603d1..fbc17e142dd64 100644
--- a/llvm/test/tools/llvm-ar/non-windows-name-case.test
+++ b/llvm/test/tools/llvm-ar/non-windows-name-case.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Test that on windows, members are case insensitive.
# UNSUPPORTED: system-windows
diff --git a/llvm/test/tools/llvm-ar/plugin.test b/llvm/test/tools/llvm-ar/plugin.test
index 0dda3d98dde28..24b7cf59afa59 100644
--- a/llvm/test/tools/llvm-ar/plugin.test
+++ b/llvm/test/tools/llvm-ar/plugin.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Test that --plugin is ignored.
# RUN: rm -f %t.a
diff --git a/llvm/test/tools/llvm-ar/print.test b/llvm/test/tools/llvm-ar/print.test
index ba7b5259b038c..1f7eb434bd638 100644
--- a/llvm/test/tools/llvm-ar/print.test
+++ b/llvm/test/tools/llvm-ar/print.test
@@ -1,5 +1,5 @@
## Test Print output
-# XFAIL: system-darwin
+# XFAIL: system-darwin,system-aix
# RUN: rm -rf %t && mkdir -p %t
# RUN: echo file1 > %t/1.txt
diff --git a/llvm/test/tools/llvm-ar/quick-append.test b/llvm/test/tools/llvm-ar/quick-append.test
index 60c3508a3da63..a589c5dc6d9a0 100644
--- a/llvm/test/tools/llvm-ar/quick-append.test
+++ b/llvm/test/tools/llvm-ar/quick-append.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Test quick append
# RUN: rm -rf %t && mkdir -p %t
diff --git a/llvm/test/tools/llvm-ar/read-only-archive.test b/llvm/test/tools/llvm-ar/read-only-archive.test
index 0365f6ad054da..b2599ec1819c1 100644
--- a/llvm/test/tools/llvm-ar/read-only-archive.test
+++ b/llvm/test/tools/llvm-ar/read-only-archive.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Test that read-only archives cannot be edited
# RUN: rm -rf %t && mkdir -p %t
diff --git a/llvm/test/tools/llvm-ar/response-utf8.test b/llvm/test/tools/llvm-ar/response-utf8.test
index b3e405f854902..1b7ac1c79f27b 100644
--- a/llvm/test/tools/llvm-ar/response-utf8.test
+++ b/llvm/test/tools/llvm-ar/response-utf8.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Check that response files can cope with non-ascii characters.
# RUN: echo 'contents' > %t-£.txt
diff --git a/llvm/test/tools/llvm-ar/thin-to-full-archive.test b/llvm/test/tools/llvm-ar/thin-to-full-archive.test
index bbe5302853648..89f5e6675432c 100644
--- a/llvm/test/tools/llvm-ar/thin-to-full-archive.test
+++ b/llvm/test/tools/llvm-ar/thin-to-full-archive.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## Test thin archives do not siletly convert to full archives on write.
# RUN: rm -f %tthin.a %tfull.a
diff --git a/llvm/test/tools/llvm-libtool-darwin/archive-flattening.test b/llvm/test/tools/llvm-libtool-darwin/archive-flattening.test
index 3b133cdffba16..2d009fcfd6774 100644
--- a/llvm/test/tools/llvm-libtool-darwin/archive-flattening.test
+++ b/llvm/test/tools/llvm-libtool-darwin/archive-flattening.test
@@ -1,3 +1,4 @@
+# XFAIL: system-aix
## This test checks that an archive is flattened correctly.
# RUN: yaml2obj %S/Inputs/input1.yaml -o %t-input1.o
diff --git a/llvm/test/tools/llvm-link/archivell.ll b/llvm/test/tools/llvm-link/archivell.ll
index 5a90990d46639..5614b0b561951 100644
--- a/llvm/test/tools/llvm-link/archivell.ll
+++ b/llvm/test/tools/llvm-link/archivell.ll
@@ -1,4 +1,4 @@
-# RUN: llvm-ar cr %t.fg.a %S/Inputs/f.ll %S/Inputs/g.ll
+# RUN: llvm-ar --format=gnu cr %t.fg.a %S/Inputs/f.ll %S/Inputs/g.ll
# RUN: not llvm-link %S/Inputs/h.ll %t.fg.a -o %t.linked.bc 2>&1 | FileCheck %s
# RUN: rm -f %t.fg.a
diff --git a/llvm/test/tools/llvm-nm/option-X.test b/llvm/test/tools/llvm-nm/option-X.test
index caa21f9d7961f..169d77e204aea 100644
--- a/llvm/test/tools/llvm-nm/option-X.test
+++ b/llvm/test/tools/llvm-nm/option-X.test
@@ -56,7 +56,7 @@ Symbols:
# RUN: yaml2obj --docnum=2 -DFLAG=0x1DF %s -o %t_xcoff32.o
# RUN: yaml2obj --docnum=2 -DFLAG=0x1F7 %s -o %t_xcoff64.o
# RUN: rm -f %t.a
-# RUN: llvm-ar -q -c %t.a %t_xcoff32.o %t_xcoff64.o
+# RUN: llvm-ar --format=gnu -q -c %t.a %t_xcoff32.o %t_xcoff64.o
# RUN: llvm-nm --format=just-symbols -X32 %t_xcoff32.o | \
# RUN: FileCheck --check-prefixes=XCOFF32 %s --implicit-check-not={{.}}
diff --git a/llvm/test/tools/llvm-readobj/basic.test b/llvm/test/tools/llvm-readobj/basic.test
index 73912373d7d2f..0db336f2596c1 100644
--- a/llvm/test/tools/llvm-readobj/basic.test
+++ b/llvm/test/tools/llvm-readobj/basic.test
@@ -16,7 +16,7 @@ EMPTY: '{{.*}}.empty': The file was not recognized as a valid object file
# Test that unrecognised files in archives are ignored.
RUN: rm -f %t.a
-RUN: llvm-ar rc %t.a %t.empty
+RUN: llvm-ar --format=gnu rc %t.a %t.empty
RUN: llvm-readobj --all %t.a 2>&1 | FileCheck --check-prefix=NO-OUTPUT --allow-empty %s
NO-OUTPUT-NOT: {{.}}
diff --git a/llvm/test/tools/llvm-size/archive.test b/llvm/test/tools/llvm-size/archive.test
index 23c4cd10c4912..621c53ba33dbc 100644
--- a/llvm/test/tools/llvm-size/archive.test
+++ b/llvm/test/tools/llvm-size/archive.test
@@ -5,21 +5,21 @@
## Case 1: Empty archive. No output expected.
# RUN: rm -f %t1.a
-# RUN: llvm-ar rc %t1.a
+# RUN: llvm-ar --format=gnu rc %t1.a
# RUN: llvm-size -B %t1.a | count 0
# RUN: llvm-size -A %t1.a | count 0
## Case 2: Single member.
# RUN: rm -f %t2.a
-# RUN: llvm-ar rc %t2.a %t1
+# RUN: llvm-ar --format=gnu rc %t2.a %t1
# RUN: llvm-size -B %t2.a | FileCheck %s -DARCHIVE=%t2.a --check-prefix=BERKELEY-1
# RUN: llvm-size -A %t2.a | FileCheck %s -DARCHIVE=%t2.a --check-prefix=SYSV-1
## Case 3: Multiple members.
# RUN: rm -f %t3.a
-# RUN: llvm-ar rc %t3.a %t1 %t2
+# RUN: llvm-ar --format=gnu rc %t3.a %t1 %t2
# RUN: llvm-size -B %t3.a | FileCheck %s -DARCHIVE=%t3.a --check-prefixes=BERKELEY-1,BERKELEY-2
# RUN: llvm-size -A %t3.a | FileCheck %s -DARCHIVE=%t3.a --check-prefixes=SYSV-1,SYSV-2
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index 6ab5bf7e9c281..3d4964f96d72f 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -22,6 +22,7 @@
#include "llvm/Object/MachO.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/SymbolicFile.h"
+#include "llvm/Object/XCOFFObjectFile.h"
#include "llvm/Support/Chrono.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ConvertUTF.h"
@@ -881,9 +882,11 @@ computeNewArchiveMembers(ArchiveOperation Operation,
}
static object::Archive::Kind getDefaultForHost() {
- return Triple(sys::getProcessTriple()).isOSDarwin()
+ Triple HostTriple(sys::getProcessTriple());
+ return HostTriple.isOSDarwin()
? object::Archive::K_DARWIN
- : object::Archive::K_GNU;
+ : (HostTriple.isOSAIX() ? object::Archive::K_AIXBIG
+ : object::Archive::K_GNU);
}
static object::Archive::Kind getKindFromMember(const NewArchiveMember &Member) {
@@ -894,7 +897,9 @@ static object::Archive::Kind getKindFromMember(const NewArchiveMember &Member) {
if (OptionalObject)
return isa<object::MachOObjectFile>(**OptionalObject)
? object::Archive::K_DARWIN
- : object::Archive::K_GNU;
+ : (isa<object::XCOFFObjectFile>(**OptionalObject)
+ ? object::Archive::K_AIXBIG
+ : object::Archive::K_GNU);
// squelch the error in case we had a non-object file
consumeError(OptionalObject.takeError());
@@ -939,6 +944,8 @@ static void performWriteOperation(ArchiveOperation Operation,
else
Kind = !NewMembers.empty() ? getKindFromMember(NewMembers.front())
: getDefaultForHost();
+ if (Kind == object::Archive::K_AIXBIG)
+ fail("unsupported big AIX write operation");
break;
case GNU:
Kind = object::Archive::K_GNU;
More information about the llvm-commits
mailing list