[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2024-03-09 Thread via cfe-commits
hoyhoy wrote: cmake is broken as well. It includes zlib internally. https://gitlab.kitware.com/cmake/cmake/-/issues/25755 https://github.com/llvm/llvm-project/pull/74676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2024-01-25 Thread Zixu Wang via cfe-commits
zixu-w wrote: > Is the motivation for this change in behavior (on macOS) documented > somewhere? Besides zlib as already discussed above, pre-defining > `TARGET_OS_MAC` apparently at least also affects some libpng builds (and I > ultimately had to globally set `-fno-define-target-os-macros`

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2024-01-24 Thread via cfe-commits
stbergmann wrote: Is the motivation for this change in behavior (on macOS) documented somewhere? Besides zlib as already discussed above, pre-defining `TARGET_OS_MAC` apparently at least also affects some libpng builds (and I ultimately had to globally set `-fno-define-target-os-macros` for

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2024-01-19 Thread Mark Adler via cfe-commits
madler wrote: > > We have provided a fix for zlib > > ([madler/zlib#895](https://github.com/madler/zlib/pull/895)) which was > > accepted by @madler. > > But nowhere released, not even in the repository :( This should be fixed in the zlib develop branch. Have you tried it?

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2024-01-19 Thread Florian Hahn via cfe-commits
fhahn wrote: It looks like this may also break both Blender and Povray. Worked around build failures in SPEC2017 in llvm-test-suite in 9b14a92d585657b87f2ca2b135ba9044685393be, but the projects will likely need to be fixed at the source. https://github.com/llvm/llvm-project/pull/74676

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2024-01-17 Thread Zixu Wang via cfe-commits
zixu-w wrote: > > We have provided a fix for zlib > > ([madler/zlib#895](https://github.com/madler/zlib/pull/895)) which was > > accepted by @madler. > > But nowhere released, not even in the repository :( Yeah... Not entirely familiar with the zlib development and contribution process, but

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2024-01-17 Thread Mike Hommey via cfe-commits
glandium wrote: > We have provided a fix for zlib > ([madler/zlib#895](https://github.com/madler/zlib/pull/895)) which was > accepted by @madler. But nowhere released, not even in the repository :( https://github.com/llvm/llvm-project/pull/74676

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2024-01-17 Thread Zixu Wang via cfe-commits
zixu-w wrote: > > It looks like this breaks building at least `MultiSource` from > > https://github.com/llvm/llvm-test-suite/. The first failure I see is when > > building `llvm-test-suite/MultiSource/Applications/ClamAV/zlib_zutil.c` > > ``` > > In file included from > >

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2024-01-16 Thread Mike Hommey via cfe-commits
glandium wrote: > It looks like this breaks building at least `MultiSource` from > https://github.com/llvm/llvm-test-suite/. The first failure I see is when > building `llvm-test-suite/MultiSource/Applications/ClamAV/zlib_zutil.c` > > ``` > In file included from >

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-08 Thread Florian Hahn via cfe-commits
fhahn wrote: Please also see the failures on GreenDragon: https://green.lab.llvm.org/green/job/lnt-ctmark-aarch64-Os/15893/console https://github.com/llvm/llvm-project/pull/74676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-08 Thread Florian Hahn via cfe-commits
fhahn wrote: It looks like this breaks building at least `MultiSource` from https://github.com/llvm/llvm-test-suite/. The first failure I see is when building `llvm-test-suite/MultiSource/Applications/ClamAV/zlib_zutil.c` ``` In file included from

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-07 Thread Zixu Wang via cfe-commits
https://github.com/zixu-w closed https://github.com/llvm/llvm-project/pull/74676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-07 Thread Ian Anderson via cfe-commits
https://github.com/ian-twilightcoder approved this pull request. https://github.com/llvm/llvm-project/pull/74676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-07 Thread Jon Roelofs via cfe-commits
https://github.com/jroelofs approved this pull request. https://github.com/llvm/llvm-project/pull/74676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-07 Thread Zixu Wang via cfe-commits
https://github.com/zixu-w updated https://github.com/llvm/llvm-project/pull/74676 >From f02d0c7323fa8fb357bd0228f6746b7f878eaa59 Mon Sep 17 00:00:00 2001 From: Zixu Wang Date: Thu, 14 Sep 2023 17:06:24 -0700 Subject: [PATCH] [clang][PP] Add extension to predefine target OS macros Add an

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-07 Thread Jon Roelofs via cfe-commits
@@ -0,0 +1,131 @@ +// RUN: %clang -### --target=arm64-apple-darwin %s 2>&1 | FileCheck %s --check-prefix=DEFAULT-OPTION + +// RUN: %clang -dM -E --target=arm64-apple-macos %s 2>&1 \ +// RUN: | FileCheck %s -DMAC=1 \ +// RUN:-DOSX=1 \ +// RUN:

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-07 Thread Jon Roelofs via cfe-commits
@@ -0,0 +1,131 @@ +// RUN: %clang -### --target=arm64-apple-darwin %s 2>&1 | FileCheck %s --check-prefix=DEFAULT-OPTION + +// RUN: %clang -dM -E --target=arm64-apple-macos %s 2>&1 \ +// RUN: | FileCheck %s -DMAC=1 \ +// RUN:-DOSX=1 \ +// RUN:

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-07 Thread Jon Roelofs via cfe-commits
@@ -1344,6 +1344,15 @@ static void InitializePredefinedMacros(const TargetInfo , if (TI.getTriple().isOSBinFormatELF()) Builder.defineMacro("__ELF__"); + // Target OS macro definitions. + if (PPOpts.DefineTargetOSMacros) { +const llvm::Triple = TI.getTriple();

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-06 Thread Ian Anderson via cfe-commits
https://github.com/ian-twilightcoder approved this pull request. https://github.com/llvm/llvm-project/pull/74676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-06 Thread Ian Anderson via cfe-commits
@@ -0,0 +1,131 @@ +// RUN: %clang -### --target=arm64-apple-darwin %s 2>&1 | FileCheck %s --check-prefix=DEFAULT-OPTION + +// RUN: %clang -dM -E --target=arm64-apple-macos %s 2>&1 \ +// RUN: | FileCheck %s -DMAC=1 \ +// RUN:-DOSX=1 \ +// RUN:

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-06 Thread Zixu Wang via cfe-commits
https://github.com/zixu-w updated https://github.com/llvm/llvm-project/pull/74676 >From cdc7cf721a7d4a6bf318181ea3f37adf7c571ed1 Mon Sep 17 00:00:00 2001 From: Zixu Wang Date: Thu, 14 Sep 2023 17:06:24 -0700 Subject: [PATCH] [clang][PP] Add extension to predefine target OS macros Add an

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-06 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 23d402e5b705d98463150302a55623951284b5f2 2812f69940451b810b8aa9a580e98a4a22a89967 --

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Zixu Wang (zixu-w) Changes Add an extension feature `define-target-os-macros` that enables clang to provide definitions of common TARGET_OS_* conditional macros. The extension is enabled in the Darwin toolchain driver. --- Full

[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

2023-12-06 Thread Zixu Wang via cfe-commits
https://github.com/zixu-w created https://github.com/llvm/llvm-project/pull/74676 Add an extension feature `define-target-os-macros` that enables clang to provide definitions of common TARGET_OS_* conditional macros. The extension is enabled in the Darwin toolchain driver. >From