Skip to content

Commit 02aa695

Browse files
authored
[clang][AIX] Only export libclang.map symbols from libclang (#78748)
This will prevent unnecessary symbols being exported in libclang, which could cause issues with non-unique objects.
1 parent 1e2a4cc commit 02aa695

14 files changed

+3
-15
lines changed

clang/test/Index/Core/designated-inits.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
32

43
struct MyStruct {

clang/test/Index/Core/external-source-symbol-attr-cxx.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
32

43
#define GEN_DECL_USR(mod_name, usr) __attribute__((external_source_symbol(language="Swift", defined_in=mod_name, USR=usr, generated_declaration)))

clang/test/Index/Core/external-source-symbol-attr.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
32

43
#define EXT_DECL(mod_name) __attribute__((external_source_symbol(language="Swift", defined_in=mod_name)))

clang/test/Index/Core/index-dependent-source.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -std=c++14 -target x86_64-apple-macosx10.7 | FileCheck %s
32

43
int invalid;

clang/test/Index/Core/index-instantiated-source.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -std=c++14 -target x86_64-apple-macosx10.7 | FileCheck %s
32
// References to declarations in instantiations should be canonicalized:
43

clang/test/Index/Core/index-source-invalid-name.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -std=c++1z -target x86_64-apple-macosx10.7 | FileCheck %s
32

43
namespace rdar32474406 {

clang/test/Index/Core/index-source.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -std=c++1z -target x86_64-apple-macosx10.7 | FileCheck %s
32
// RUN: c-index-test core -print-source-symbols -include-locals -- %s -std=c++1z -target x86_64-apple-macosx10.7 | FileCheck -check-prefix=LOCAL %s
43

clang/test/Index/Core/index-source.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
32
// RUN: c-index-test core -print-source-symbols -include-locals -- %s -target x86_64-apple-macosx10.7 | FileCheck -check-prefix=LOCAL %s
43

clang/test/Index/Core/index-source.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
32

43
@interface MyCls

clang/test/Index/Core/index-subkinds.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
32

43
// CHECK: [[@LINE+1]]:12 | class/ObjC | XCTestCase | c:objc(cs)XCTestCase | _OBJC_CLASS_$_XCTestCase | Decl | rel: 0

clang/test/Index/Core/index-with-module.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: rm -rf %t.mcp
32
// RUN: c-index-test core -print-source-symbols -dump-imported-module-files -- %s -I %S/Inputs/module -fmodules -fmodules-cache-path=%t.mcp | FileCheck %s
43

clang/test/Index/ms-property.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- -target x86_64-apple-darwin10 -fms-extensions -fno-ms-compatibility %s | FileCheck %s
32

43
// CHECK: [[@LINE+1]]:8 | struct/C++ | Simple | [[Simple_USR:.*]] | <no-cgname> | Def | rel: 0

clang/test/Index/using_if_exists.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// XFAIL: target={{.*}}-aix{{.*}}
21
// RUN: c-index-test core -print-source-symbols -- %s -target x86_64-unknown-unknown 2>&1 | FileCheck %s
32

43
namespace ns {

clang/tools/libclang/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ if(MSVC)
9797
set(LLVM_EXPORTED_SYMBOL_FILE)
9898
endif()
9999

100-
if (UNIX AND NOT APPLE)
100+
if (UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
101101
set(LLVM_EXPORTED_SYMBOL_FILE)
102102
set(USE_VERSION_SCRIPT ${LLVM_HAVE_LINK_VERSION_SCRIPT})
103103
endif()
@@ -129,8 +129,9 @@ else()
129129
set(output_name "clang")
130130
endif()
131131

132-
# libclang requires headers which need _ALL_SOURCE to build on AIX
133132
if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
133+
set(CMAKE_AIX_EXPORT_ALL_SYMBOLS OFF)
134+
# libclang requires headers which need _ALL_SOURCE to build on AIX
134135
remove_definitions("-D_XOPEN_SOURCE=700")
135136
endif()
136137

0 commit comments

Comments
 (0)