forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SystemZ][z/OS] Add z/OS customization file (llvm#111182)
On z/OS, the location of the system libraries and side decks (aka equivalent to libc, etc) are not in a predefined location. The system does have a default location but sysadmins can change this and frequently do. See the -mzos-hlq* options we have for z/OS. To avoid every user needing to specify these -mzos-hlq* options, we added support for a system install default config file that is always read independent of the usual config file. The compiler will read this customization config file before reading the usual config files. The customization file is called clang.cfg and is located in: - the etc dir within the compiler installation dir. - or specified by the CLANG_CONFIG_PATH env var. This env var can either be a directory or the fill path name of the file.
- Loading branch information
Showing
7 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-DABC=123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-DDEF=456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-DDEF=456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// REQUIRES: shell | ||
// REQUIRES: systemz-registered-target | ||
|
||
// RUN: unset CLANG_NO_DEFAULT_CONFIG | ||
// RUN: rm -rf %t && mkdir %t | ||
|
||
// RUN: mkdir -p %t/testbin | ||
// RUN: mkdir -p %t/etc | ||
// RUN: ln -s %clang %t/testbin/clang | ||
// RUN: echo "-DXYZ=789" >%t/etc/clang.cfg | ||
// RUN: %t/testbin/clang --target=s390x-ibm-zos -c -### -no-canonical-prefixes %s 2>&1 | FileCheck -DDIR=%t %s | ||
// RUN: %t/testbin/clang --target=s390x-ibm-zos -c -### -no-canonical-prefixes --no-default-config %s 2>&1 | FileCheck -check-prefix=NOCONFIG %s | ||
// | ||
// CHECK: Configuration file: [[DIR]]/etc/clang.cfg | ||
// CHECK: "-D" "XYZ=789" | ||
// NOCONFIG-NOT: Configuration file: {{.*}}/etc/clang.cfg | ||
// NOCONFIG-NOT: "-D" "XYZ=789" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// REQUIRES: shell | ||
// REQUIRES: systemz-registered-target | ||
|
||
// RUN: unset CLANG_NO_DEFAULT_CONFIG | ||
|
||
// RUN: export CLANG_CONFIG_PATH=%S/Inputs/config-zos | ||
// RUN: %clang --target=s390x-ibm-zos -c -### %s 2>&1 | FileCheck %s | ||
// CHECK: Configuration file: {{.*}}/Inputs/config-zos/clang.cfg | ||
// CHECK: "-D" "ABC=123" | ||
|
||
// RUN: export CLANG_CONFIG_PATH=%S/Inputs/config-zos/def.cfg | ||
// RUN: %clang --target=s390x-ibm-zos -c -### %s 2>&1 | FileCheck %s -check-prefix=CHECK-DEF | ||
// CHECK-DEF: Configuration file: {{.*}}/Inputs/config-zos/def.cfg | ||
// CHECK-DEF: "-D" "DEF=456" | ||
|
||
// RUN: export CLANG_CONFIG_PATH=%S/Inputs/config-zos/Garbage | ||
// RUN: not %clang --target=s390x-ibm-zos -c -### %s 2>&1 | FileCheck %s -check-prefix=CHECK-ERR | ||
// CHECK-ERR: error: configuration file '{{.*}}/Inputs/config-zos/Garbage' cannot be found | ||
|
||
// The directory exists but no clang.cfg in it | ||
// RUN: export CLANG_CONFIG_PATH=%S/Inputs/config-zos/tst | ||
// RUN: not %clang --target=s390x-ibm-zos -c -### %s 2>&1 | FileCheck %s -check-prefix=CHECK-ERRDIR | ||
// CHECK-ERRDIR: error: configuration file '{{.*}}/Inputs/config-zos/tst/clang.cfg' cannot be found |